repo_name string | dataset string | owner string | lang string | func_name string | code string | docstring string | url string | sha string |
|---|---|---|---|---|---|---|---|---|
whisper_android | github_2023 | vilassn | typescript | Builder.requiredField | requiredField(table: Offset, field: number): void {
const table_start = this.bb.capacity() - table;
const vtable_start = table_start - this.bb.readInt32(table_start);
const ok = this.bb.readInt16(vtable_start + field) != 0;
// If this fails, the caller will show what field needs to be set.
... | /**
* This checks a required field has been set in a given table that has
* just been constructed.
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L458-L467 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | Builder.startVector | startVector(elem_size: number, num_elems: number, alignment: number): void {
this.notNested();
this.vector_num_elems = num_elems;
this.prep(SIZEOF_INT, elem_size * num_elems);
this.prep(alignment, elem_size * num_elems); // Just in case alignment > int.
} | /**
* Start a new array/vector of objects. Users usually will not call
* this directly. The FlatBuffers compiler will create a start/end
* method for vector types in generated code.
*
* @param elem_size The size of each element in the array
* @param num_elems The number of elements in the... | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L478-L483 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | Builder.endVector | endVector(): Offset {
this.writeInt32(this.vector_num_elems);
return this.offset();
} | /**
* Finish off the creation of an array and all its elements. The array must be
* created with `startVector`.
*
* @returns The offset at which the newly created array
* starts.
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L492-L495 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | Builder.createSharedString | createSharedString(s: string | Uint8Array): Offset {
if (!s) { return 0 }
if (!this.string_maps) {
this.string_maps = new Map();
}
if (this.string_maps.has(s)) {
return this.string_maps.get(s) as Offset
}
const offset = this.createString(s)
this.string_map... | /**
* Encode the string `s` in the buffer using UTF-8. If the string passed has
* already been seen, we return the offset of the already written string
*
* @param s The string to encode
* @return The offset in the buffer where the encoded string starts
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L504-L517 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | Builder.createString | createString(s: string | Uint8Array | null | undefined): Offset {
if (s === null || s === undefined) {
return 0;
}
let utf8: string | Uint8Array | number[];
if (s instanceof Uint8Array) {
utf8 = s;
} else {
utf8 = this.text_encoder.encode(s);
}
this.... | /**
* Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed
* instead of a string, it is assumed to contain valid UTF-8 encoded data.
*
* @param s The string to encode
* @return The offset in the buffer where the encoded string starts
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L526-L545 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | Builder.createObjectOffset | createObjectOffset(obj: string | IGeneratedObject | null): Offset {
if(obj === null) {
return 0
}
if(typeof obj === 'string') {
return this.createString(obj);
} else {
return obj.pack(this);
}
} | /**
* A helper function to pack an object
*
* @returns offset of obj
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L552-L562 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | Builder.createObjectOffsetList | createObjectOffsetList(list: (string | IGeneratedObject)[]): Offset[] {
const ret: number[] = [];
for(let i = 0; i < list.length; ++i) {
const val = list[i];
if(val !== null) {
ret.push(this.createObjectOffset(val));
} else {
throw new Error(
'Fl... | /**
* A helper function to pack a list of object
*
* @returns list of offsets of each non null object
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L569-L584 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.constructor | constructor(private bytes_: Uint8Array) { } | /**
* Create a new ByteBuffer with a given array of bytes (`Uint8Array`)
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L13-L13 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.allocate | static allocate(byte_size: number): ByteBuffer {
return new ByteBuffer(new Uint8Array(byte_size));
} | /**
* Create and allocate a new ByteBuffer with a given size.
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L18-L20 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.bytes | bytes(): Uint8Array {
return this.bytes_;
} | /**
* Get the underlying `Uint8Array`.
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L29-L31 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.position | position(): number {
return this.position_;
} | /**
* Get the buffer's position.
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L36-L38 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.setPosition | setPosition(position: number): void {
this.position_ = position;
} | /**
* Set the buffer's position.
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L43-L45 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.capacity | capacity(): number {
return this.bytes_.length;
} | /**
* Get the buffer's capacity.
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L50-L52 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.getBufferIdentifier | getBufferIdentifier(): string {
if (this.bytes_.length < this.position_ + SIZEOF_INT +
FILE_IDENTIFIER_LENGTH) {
throw new Error(
'FlatBuffers: ByteBuffer is too short to contain an identifier.');
}
let result = "";
for (let i = 0; i < FILE_IDENTIFIER_LENGTH; i++) {... | /**
* Return the file identifier. Behavior is undefined for FlatBuffers whose
* schema does not include a file_identifier (likely points at padding or the
* start of a the root vtable).
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L155-L167 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.__offset | __offset(bb_pos: number, vtable_offset: number): Offset {
const vtable = bb_pos - this.readInt32(bb_pos);
return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;
} | /**
* Look up a field in the vtable, return an offset into the object, or 0 if the
* field is not present.
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L173-L176 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.__union | __union(t: Table, offset: number): Table {
t.bb_pos = offset + this.readInt32(offset);
t.bb = this;
return t;
} | /**
* Initialize any Table-derived type to point to the union at the given offset.
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L181-L185 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.__string | __string(offset: number, opt_encoding?: Encoding): string | Uint8Array {
offset += this.readInt32(offset);
const length = this.readInt32(offset);
offset += SIZEOF_INT;
const utf8bytes = this.bytes_.subarray(offset, offset + length);
if (opt_encoding === Encoding.UTF8_BYTES)
return ... | /**
* Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.
* This allocates a new string and converts to wide chars upon each access.
*
* To avoid the conversion to string, pass Encoding.UTF8_BYTES as the
* "optionalEncoding" argument. This is useful for avoiding conversion ... | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L198-L207 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.__union_with_string | __union_with_string(o: Table | string, offset: number) : Table | string {
if(typeof o === 'string') {
return this.__string(offset) as string;
}
return this.__union(o, offset);
} | /**
* Handle unions that can contain string as its member, if a Table-derived type then initialize it,
* if a string then return a new one
*
* WARNING: strings are immutable in JS so we can't change the string that the user gave us, this
* makes the behaviour of __union_with_string different... | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L216-L221 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.__indirect | __indirect(offset: Offset): Offset {
return offset + this.readInt32(offset);
} | /**
* Retrieve the relative offset stored at "offset"
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L226-L228 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.__vector | __vector(offset: Offset): Offset {
return offset + this.readInt32(offset) + SIZEOF_INT; // data starts after the length
} | /**
* Get the start of data of a vector whose offset is stored at "offset" in this object.
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L233-L235 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.__vector_len | __vector_len(offset: Offset): Offset {
return this.readInt32(offset + this.readInt32(offset));
} | /**
* Get the length of a vector whose offset is stored at "offset" in this object.
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L240-L242 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.createScalarList | createScalarList<T>(listAccessor: (i: number) => T | null, listLength: number): T[] {
const ret: T[] = [];
for(let i = 0; i < listLength; ++i) {
const val = listAccessor(i);
if(val !== null) {
ret.push(val);
}
}
return ret;
} | /**
* A helper function for generating list for obj api
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L260-L269 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
whisper_android | github_2023 | vilassn | typescript | ByteBuffer.createObjList | createObjList<T1 extends IUnpackableObject<T2>, T2 extends IGeneratedObject>(listAccessor: (i: number) => T1 | null, listLength: number): T2[] {
const ret: T2[] = [];
for(let i = 0; i < listLength; ++i) {
const val = listAccessor(i);
if(val !== null) {
ret.push(val.unpack());
... | /**
* A helper function for generating list for obj api
* @param listAccessor function that accepts an index and return data at that index
* @param listLength listLength
* @param res result list
*/ | https://github.com/vilassn/whisper_android/blob/08b766af195510e1ac6ede69cb152d8ca9ebb37e/whisper_native/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L277-L286 | 08b766af195510e1ac6ede69cb152d8ca9ebb37e |
ocr-pwa | github_2023 | plantree | typescript | TesseractEngine.init | async init(): Promise<void> {
this.worker = await createWorker({
logger: (m) => console.log(m)
});
/** You can load more languages in advance, but use only part of them in Worker.initialize() */
await this.worker.loadLanguage('eng+chi_sim+rus');
await this.worker.initialize('eng+chi_sim+rus');... | /* eslint-disable no-console */ | https://github.com/plantree/ocr-pwa/blob/b4154822920bda4a0387a9c6d05f4964519db2c7/src/ocr/tesseract/index.ts#L12-L19 | b4154822920bda4a0387a9c6d05f4964519db2c7 |
marquee | github_2023 | animate-react-native | typescript | start | function start() {
frameCallback.setActive(true);
} | // Pan Gestures | https://github.com/animate-react-native/marquee/blob/288f4d794e92ba7bad75faacb3efde9a1c3ec01d/src/index.tsx#L164-L166 | 288f4d794e92ba7bad75faacb3efde9a1c3ec01d |
whisper.tflite | github_2023 | nyadla-sys | typescript | Monster.testarrayoftables | testarrayoftables(index: number, obj?:Monster):Monster|null {
const offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? (obj || new Monster()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
} | /**
* an example documentation comment: this will end up in the generated code
* multiline too
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/tests/my-game/example/monster.ts#L156-L159 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Type.baseSize | baseSize():number {
const offset = this.bb!.__offset(this.bb_pos, 12);
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 4;
} | /**
* The size (octets) of the `base_type` field.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/tests/ts/reflection_generated.ts#L123-L126 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Type.elementSize | elementSize():number {
const offset = this.bb!.__offset(this.bb_pos, 14);
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
} | /**
* The size (octets) of the `element` field, if present.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/tests/ts/reflection_generated.ts#L142-L145 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Field.padding | padding():number {
const offset = this.bb!.__offset(this.bb_pos, 28);
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
} | /**
* Number of padding octets to always add after this field. Structs only.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/tests/ts/reflection_generated.ts#L927-L930 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Schema.fbsFiles | fbsFiles(index: number, obj?:SchemaFile):SchemaFile|null {
const offset = this.bb!.__offset(this.bb_pos, 18);
return offset ? (obj || new SchemaFile()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
} | /**
* All the files used in this compilation. Files are relative to where
* flatc was invoked.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/tests/ts/reflection_generated.ts#L1956-L1959 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Monster.testarrayoftables | testarrayoftables(index: number, obj?:Monster):Monster|null {
const offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? (obj || new Monster()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
} | /**
* an example documentation comment: this will end up in the generated code
* multiline too
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/tests/ts/my-game/example/monster.ts#L156-L159 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Field.padding | padding():number {
const offset = this.bb!.__offset(this.bb_pos, 28);
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
} | /**
* Number of padding octets to always add after this field. Structs only.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/tests/ts/reflection/field.ts#L192-L195 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Schema.fbsFiles | fbsFiles(index: number, obj?:SchemaFile):SchemaFile|null {
const offset = this.bb!.__offset(this.bb_pos, 18);
return offset ? (obj || new SchemaFile()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
} | /**
* All the files used in this compilation. Files are relative to where
* flatc was invoked.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/tests/ts/reflection/schema.ts#L102-L105 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Type.baseSize | baseSize():number {
const offset = this.bb!.__offset(this.bb_pos, 12);
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 4;
} | /**
* The size (octets) of the `base_type` field.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/tests/ts/reflection/type.ts#L93-L96 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Type.elementSize | elementSize():number {
const offset = this.bb!.__offset(this.bb_pos, 14);
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
} | /**
* The size (octets) of the `element` field, if present.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/tests/ts/reflection/type.ts#L112-L115 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | MyGame_Example_Monster.testarrayoftables | testarrayoftables(index: number, obj?:MyGame_Example_Monster):MyGame_Example_Monster|null {
const offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? (obj || new MyGame_Example_Monster()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
} | /**
* an example documentation comment: this will end up in the generated code
* multiline too
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/tests/ts/ts-flat-files/monster_test_generated.ts#L823-L826 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.constructor | constructor(opt_initial_size?: number) {
let initial_size: number;
if (!opt_initial_size) {
initial_size = 1024;
} else {
initial_size = opt_initial_size;
}
/**
* @type {ByteBuffer}
* @private
*/
this.bb = ByteBuffer.allocate(initial_size);
... | /**
* Create a FlatBufferBuilder.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L32-L47 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.forceDefaults | forceDefaults(forceDefaults: boolean): void {
this.force_defaults = forceDefaults;
} | /**
* In order to save space, fields that are set to their default value
* don't get serialized into the buffer. Forcing defaults provides a
* way to manually disable this optimization.
*
* @param forceDefaults true always serializes default values
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L71-L73 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.dataBuffer | dataBuffer(): ByteBuffer {
return this.bb;
} | /**
* Get the ByteBuffer representing the FlatBuffer. Only call this after you've
* called finish(). The actual data starts at the ByteBuffer's current position,
* not necessarily at 0.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L80-L82 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.asUint8Array | asUint8Array(): Uint8Array {
return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());
} | /**
* Get the bytes representing the FlatBuffer. Only call this after you've
* called finish().
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L88-L90 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.prep | prep(size: number, additional_bytes: number): void {
// Track the biggest thing we've ever aligned to.
if (size > this.minalign) {
this.minalign = size;
}
// Find the amount of alignment needed such that `size` is properly
// aligned after `additional_bytes`
const align_si... | /**
* Prepare to write an element of `size` after `additional_bytes` have been
* written, e.g. if you write a string, you need to align such the int length
* field is aligned to 4 bytes, and the string data follows it directly. If all
* you need to do is alignment, `additional_bytes` will be 0.
... | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L101-L119 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.addInt8 | addInt8(value: number): void {
this.prep(1, 0);
this.writeInt8(value);
} | /**
* Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).
* @param value The `int8` to add the buffer.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L155-L158 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.addInt16 | addInt16(value: number): void {
this.prep(2, 0);
this.writeInt16(value);
} | /**
* Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).
* @param value The `int16` to add the buffer.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L164-L167 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.addInt32 | addInt32(value: number): void {
this.prep(4, 0);
this.writeInt32(value);
} | /**
* Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).
* @param value The `int32` to add the buffer.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L173-L176 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.addInt64 | addInt64(value: bigint): void {
this.prep(8, 0);
this.writeInt64(value);
} | /**
* Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).
* @param value The `int64` to add the buffer.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L182-L185 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.addFloat32 | addFloat32(value: number): void {
this.prep(4, 0);
this.writeFloat32(value);
} | /**
* Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).
* @param value The `float32` to add the buffer.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L191-L194 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.addFloat64 | addFloat64(value: number): void {
this.prep(8, 0);
this.writeFloat64(value);
} | /**
* Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).
* @param value The `float64` to add the buffer.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L200-L203 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.addFieldStruct | addFieldStruct(voffset: number, value: Offset, defaultValue: Offset): void {
if (value != defaultValue) {
this.nested(value);
this.slot(voffset);
}
} | /**
* Structs are stored inline, so nothing additional is being added. `d` is always 0.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L257-L262 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.nested | nested(obj: Offset): void {
if (obj != this.offset()) {
throw new Error('FlatBuffers: struct must be serialized inline.');
}
} | /**
* Structures are always stored inline, they need to be created right
* where they're used. You'll get this assertion failure if you
* created it elsewhere.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L269-L273 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.notNested | notNested(): void {
if (this.isNested) {
throw new Error('FlatBuffers: object serialization must not be nested.');
}
} | /**
* Should not be creating any other object, string or vector
* while an object is being constructed
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L279-L283 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.slot | slot(voffset: number): void {
if (this.vtable !== null)
this.vtable[voffset] = this.offset();
} | /**
* Set the current vtable at `voffset` to the current location in the buffer.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L288-L291 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.offset | offset(): Offset {
return this.bb.capacity() - this.space;
} | /**
* @returns Offset relative to the end of the buffer.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L296-L298 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.growByteBuffer | static growByteBuffer(bb: ByteBuffer): ByteBuffer {
const old_buf_size = bb.capacity();
// Ensure we don't grow beyond what fits in an int.
if (old_buf_size & 0xC0000000) {
throw new Error('FlatBuffers: cannot grow buffer beyond 2 gigabytes.');
}
const new_buf_size = old_buf_... | /**
* Doubles the size of the backing ByteBuffer and copies the old data towards
* the end of the new buffer (since we build the buffer backwards).
*
* @param bb The current buffer with the existing data
* @returns A new byte buffer with the old data copied
* to it. The data is located at ... | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L312-L325 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.addOffset | addOffset(offset: Offset): void {
this.prep(SIZEOF_INT, 0); // Ensure alignment is already done.
this.writeInt32(this.offset() - offset + SIZEOF_INT);
} | /**
* Adds on offset, relative to where it will be written.
*
* @param offset The offset to add.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L332-L335 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.startObject | startObject(numfields: number): void {
this.notNested();
if (this.vtable == null) {
this.vtable = [];
}
this.vtable_in_use = numfields;
for (let i = 0; i < numfields; i++) {
this.vtable[i] = 0; // This will push additional elements as needed
}
this.isNested = tr... | /**
* Start encoding a new object in the buffer. Users will not usually need to
* call this directly. The FlatBuffers compiler will generate helper methods
* that call this method internally.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L342-L353 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.endObject | endObject(): Offset {
if (this.vtable == null || !this.isNested) {
throw new Error('FlatBuffers: endObject called without startObject');
}
this.addInt32(0);
const vtableloc = this.offset();
// Trim trailing zeroes.
let i = this.vtable_in_use - 1;
// eslint-disable... | /**
* Finish off writing the object that is under construction.
*
* @returns The offset to the object inside `dataBuffer`
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L360-L420 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.finish | finish(root_table: Offset, opt_file_identifier?: string, opt_size_prefix?: boolean): void {
const size_prefix = opt_size_prefix ? SIZE_PREFIX_LENGTH : 0;
if (opt_file_identifier) {
const file_identifier = opt_file_identifier;
this.prep(this.minalign, SIZEOF_INT +
FILE_IDENTIFIER_LE... | /**
* Finalize a buffer, poiting to the given `root_table`.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L425-L445 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.finishSizePrefixed | finishSizePrefixed(this: Builder, root_table: Offset, opt_file_identifier?: string): void {
this.finish(root_table, opt_file_identifier, true);
} | /**
* Finalize a size prefixed buffer, pointing to the given `root_table`.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L450-L452 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.requiredField | requiredField(table: Offset, field: number): void {
const table_start = this.bb.capacity() - table;
const vtable_start = table_start - this.bb.readInt32(table_start);
const ok = this.bb.readInt16(vtable_start + field) != 0;
// If this fails, the caller will show what field needs to be set.
... | /**
* This checks a required field has been set in a given table that has
* just been constructed.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L458-L467 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.startVector | startVector(elem_size: number, num_elems: number, alignment: number): void {
this.notNested();
this.vector_num_elems = num_elems;
this.prep(SIZEOF_INT, elem_size * num_elems);
this.prep(alignment, elem_size * num_elems); // Just in case alignment > int.
} | /**
* Start a new array/vector of objects. Users usually will not call
* this directly. The FlatBuffers compiler will create a start/end
* method for vector types in generated code.
*
* @param elem_size The size of each element in the array
* @param num_elems The number of elements in the... | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L478-L483 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.endVector | endVector(): Offset {
this.writeInt32(this.vector_num_elems);
return this.offset();
} | /**
* Finish off the creation of an array and all its elements. The array must be
* created with `startVector`.
*
* @returns The offset at which the newly created array
* starts.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L492-L495 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.createSharedString | createSharedString(s: string | Uint8Array): Offset {
if (!s) { return 0 }
if (!this.string_maps) {
this.string_maps = new Map();
}
if (this.string_maps.has(s)) {
return this.string_maps.get(s) as Offset
}
const offset = this.createString(s)
this.string_map... | /**
* Encode the string `s` in the buffer using UTF-8. If the string passed has
* already been seen, we return the offset of the already written string
*
* @param s The string to encode
* @return The offset in the buffer where the encoded string starts
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L504-L517 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.createString | createString(s: string | Uint8Array | null | undefined): Offset {
if (s === null || s === undefined) {
return 0;
}
let utf8: string | Uint8Array | number[];
if (s instanceof Uint8Array) {
utf8 = s;
} else {
utf8 = this.text_encoder.encode(s);
}
this.... | /**
* Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed
* instead of a string, it is assumed to contain valid UTF-8 encoded data.
*
* @param s The string to encode
* @return The offset in the buffer where the encoded string starts
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L526-L545 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.createObjectOffset | createObjectOffset(obj: string | IGeneratedObject | null): Offset {
if(obj === null) {
return 0
}
if(typeof obj === 'string') {
return this.createString(obj);
} else {
return obj.pack(this);
}
} | /**
* A helper function to pack an object
*
* @returns offset of obj
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L552-L562 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | Builder.createObjectOffsetList | createObjectOffsetList(list: (string | IGeneratedObject)[]): Offset[] {
const ret: number[] = [];
for(let i = 0; i < list.length; ++i) {
const val = list[i];
if(val !== null) {
ret.push(this.createObjectOffset(val));
} else {
throw new Error(
'Fl... | /**
* A helper function to pack a list of object
*
* @returns list of offsets of each non null object
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/builder.ts#L569-L584 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.constructor | constructor(private bytes_: Uint8Array) { } | /**
* Create a new ByteBuffer with a given array of bytes (`Uint8Array`)
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L13-L13 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.allocate | static allocate(byte_size: number): ByteBuffer {
return new ByteBuffer(new Uint8Array(byte_size));
} | /**
* Create and allocate a new ByteBuffer with a given size.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L18-L20 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.bytes | bytes(): Uint8Array {
return this.bytes_;
} | /**
* Get the underlying `Uint8Array`.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L29-L31 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.position | position(): number {
return this.position_;
} | /**
* Get the buffer's position.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L36-L38 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.setPosition | setPosition(position: number): void {
this.position_ = position;
} | /**
* Set the buffer's position.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L43-L45 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.capacity | capacity(): number {
return this.bytes_.length;
} | /**
* Get the buffer's capacity.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L50-L52 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.getBufferIdentifier | getBufferIdentifier(): string {
if (this.bytes_.length < this.position_ + SIZEOF_INT +
FILE_IDENTIFIER_LENGTH) {
throw new Error(
'FlatBuffers: ByteBuffer is too short to contain an identifier.');
}
let result = "";
for (let i = 0; i < FILE_IDENTIFIER_LENGTH; i++) {... | /**
* Return the file identifier. Behavior is undefined for FlatBuffers whose
* schema does not include a file_identifier (likely points at padding or the
* start of a the root vtable).
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L155-L167 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.__offset | __offset(bb_pos: number, vtable_offset: number): Offset {
const vtable = bb_pos - this.readInt32(bb_pos);
return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;
} | /**
* Look up a field in the vtable, return an offset into the object, or 0 if the
* field is not present.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L173-L176 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.__union | __union(t: Table, offset: number): Table {
t.bb_pos = offset + this.readInt32(offset);
t.bb = this;
return t;
} | /**
* Initialize any Table-derived type to point to the union at the given offset.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L181-L185 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.__string | __string(offset: number, opt_encoding?: Encoding): string | Uint8Array {
offset += this.readInt32(offset);
const length = this.readInt32(offset);
offset += SIZEOF_INT;
const utf8bytes = this.bytes_.subarray(offset, offset + length);
if (opt_encoding === Encoding.UTF8_BYTES)
return ... | /**
* Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.
* This allocates a new string and converts to wide chars upon each access.
*
* To avoid the conversion to string, pass Encoding.UTF8_BYTES as the
* "optionalEncoding" argument. This is useful for avoiding conversion ... | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L198-L207 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.__union_with_string | __union_with_string(o: Table | string, offset: number) : Table | string {
if(typeof o === 'string') {
return this.__string(offset) as string;
}
return this.__union(o, offset);
} | /**
* Handle unions that can contain string as its member, if a Table-derived type then initialize it,
* if a string then return a new one
*
* WARNING: strings are immutable in JS so we can't change the string that the user gave us, this
* makes the behaviour of __union_with_string different... | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L216-L221 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.__indirect | __indirect(offset: Offset): Offset {
return offset + this.readInt32(offset);
} | /**
* Retrieve the relative offset stored at "offset"
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L226-L228 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.__vector | __vector(offset: Offset): Offset {
return offset + this.readInt32(offset) + SIZEOF_INT; // data starts after the length
} | /**
* Get the start of data of a vector whose offset is stored at "offset" in this object.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L233-L235 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.__vector_len | __vector_len(offset: Offset): Offset {
return this.readInt32(offset + this.readInt32(offset));
} | /**
* Get the length of a vector whose offset is stored at "offset" in this object.
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L240-L242 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.createScalarList | createScalarList<T>(listAccessor: (i: number) => T | null, listLength: number): T[] {
const ret: T[] = [];
for(let i = 0; i < listLength; ++i) {
const val = listAccessor(i);
if(val !== null) {
ret.push(val);
}
}
return ret;
} | /**
* A helper function for generating list for obj api
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L260-L269 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
whisper.tflite | github_2023 | nyadla-sys | typescript | ByteBuffer.createObjList | createObjList<T1 extends IUnpackableObject<T2>, T2 extends IGeneratedObject>(listAccessor: (i: number) => T1 | null, listLength: number): T2[] {
const ret: T2[] = [];
for(let i = 0; i < listLength; ++i) {
const val = listAccessor(i);
if(val !== null) {
ret.push(val.unpack());
... | /**
* A helper function for generating list for obj api
* @param listAccessor function that accepts an index and return data at that index
* @param listLength listLength
* @param res result list
*/ | https://github.com/nyadla-sys/whisper.tflite/blob/a6c2229f5babfcfee13b4491e0f721ad870b668e/whisper_android/app/src/main/cpp/tf-lite-api/include/flatbuffers/ts/byte-buffer.ts#L277-L286 | a6c2229f5babfcfee13b4491e0f721ad870b668e |
qgis-js | github_2023 | qgis | typescript | loadModule | function loadModule(mainScriptPath: string): Promise<QtRuntimeFactory> {
return new Promise(async (resolve, reject) => {
try {
// hack to import es module without vite knowing about it
const createQtAppInstance = (
await new Function(`return import("${mainScriptPath}")`)()
).default;
... | /**
* Loads the QtRuntimeFactory Emscripten module with the given prefix.
*
* @param mainScriptPath - The import path of the main script
* @returns A promise that resolves with the QtRuntimeFactory module.
*/ | https://github.com/qgis/qgis-js/blob/8c7f8e8594721eca4b913d9ed82675c7887999f1/packages/qgis-js/src/loader.ts#L30-L44 | 8c7f8e8594721eca4b913d9ed82675c7887999f1 |
qgis-js | github_2023 | qgis | typescript | update | const update = () => {
init();
}; | // recreate the entire map on each update to get new projections working | https://github.com/qgis/qgis-js/blob/8c7f8e8594721eca4b913d9ed82675c7887999f1/sites/dev/src/ol.ts#L204-L206 | 8c7f8e8594721eca4b913d9ed82675c7887999f1 |
qgis-js | github_2023 | qgis | typescript | update | const update = () => {
if (source) {
source.killPendingJobs();
}
init();
}; | // recreate the entire map on each update to get new projections working | https://github.com/qgis/qgis-js/blob/8c7f8e8594721eca4b913d9ed82675c7887999f1/sites/dev/src/ol.ts#L308-L313 | 8c7f8e8594721eca4b913d9ed82675c7887999f1 |
qgis-js | github_2023 | qgis | typescript | measureStart | function measureStart(name: string) {
performance.mark(`${name}-start`);
} | // Utility functions | https://github.com/qgis/qgis-js/blob/8c7f8e8594721eca4b913d9ed82675c7887999f1/sites/performance/src/index.ts#L322-L324 | 8c7f8e8594721eca4b913d9ed82675c7887999f1 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | startServing | async function startServing(
ctx: BuildCtx,
mut: Mutex,
initialContent: ProcessedContent[],
clientRefresh: () => void,
dependencies: Dependencies, // emitter name: dep graph
) {
const { argv } = ctx
// cache file parse results
const contentMap = new Map<FilePath, ProcessedContent>()
for (const conten... | // setup watcher for rebuilds | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/build.ts#L100-L144 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | DepGraph.nodes | get nodes(): T[] {
return Array.from(this._graph.keys())
} | // BASIC GRAPH OPERATIONS | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/depgraph.ts#L22-L24 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | DepGraph.removeNode | removeNode(node: T): void {
if (this._graph.has(node)) {
// first remove all edges so other nodes don't have references to this node
for (const target of this._graph.get(node)!.outgoing) {
this.removeEdge(node, target)
}
for (const source of this._graph.get(node)!.incoming) {
... | // Remove node and all edges connected to it | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/depgraph.ts#L43-L54 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | DepGraph.outDegree | outDegree(node: T): number {
return this.hasNode(node) ? this._graph.get(node)!.outgoing.size : -1
} | // returns -1 if node does not exist | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/depgraph.ts#L82-L84 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | DepGraph.inDegree | inDegree(node: T): number {
return this.hasNode(node) ? this._graph.get(node)!.incoming.size : -1
} | // returns -1 if node does not exist | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/depgraph.ts#L87-L89 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | DepGraph.mergeGraph | mergeGraph(other: DepGraph<T>): void {
other.forEachEdge(([source, target]) => {
this.addNode(source)
this.addNode(target)
this.addEdge(source, target)
})
} | // Add all nodes and edges from other graph to this graph | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/depgraph.ts#L110-L116 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | DepGraph.updateIncomingEdgesForNode | updateIncomingEdgesForNode(other: DepGraph<T>, node: T): void {
this.addNode(node)
// Add edge if it is present in other
other.forEachInNeighbor(node, (neighbor) => {
this.addEdge(neighbor, node)
})
// For node provided, remove incoming edge if it is absent in other
this.forEachEdge(([so... | // If an incoming edge was deleted in other, it is deleted in this graph | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/depgraph.ts#L122-L136 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | DepGraph.removeOrphanNodes | removeOrphanNodes(): Set<T> {
let orphanNodes = new Set<T>()
this.forEachNode((node) => {
if (this.inDegree(node) === 0 && this.outDegree(node) === 0) {
orphanNodes.add(node)
}
})
orphanNodes.forEach((node) => {
this.removeNode(node)
})
return orphanNodes
} | // A node may be orphaned if the only node pointing to it was removed | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/depgraph.ts#L140-L154 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | DepGraph.getLeafNodes | getLeafNodes(node: T): Set<T> {
let stack: T[] = [node]
let visited = new Set<T>()
let leafNodes = new Set<T>()
// DFS
while (stack.length > 0) {
let node = stack.pop()!
// If the node is already visited, skip it
if (visited.has(node)) {
continue
}
visited.add... | // and the node is B, this function returns [C] | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/depgraph.ts#L160-L189 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | DepGraph.getLeafNodeAncestors | getLeafNodeAncestors(node: T): Set<T> {
const leafNodes = this.getLeafNodes(node)
let visited = new Set<T>()
let upstreamNodes = new Set<T>()
// Backwards DFS for each leaf node
leafNodes.forEach((leafNode) => {
let stack: T[] = [leafNode]
while (stack.length > 0) {
let node = ... | // and the node is B, this function returns [A, B, D] | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/depgraph.ts#L195-L227 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | FileNode.add | add(file: QuartzPluginData) {
this.insert({ file: file, path: simplifySlug(file.slug!).split("/") })
} | // Add new file to tree | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/components/ExplorerNode.tsx#L101-L103 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | FileNode.filter | filter(filterFn: (node: FileNode) => boolean) {
this.children = this.children.filter(filterFn)
this.children.forEach((child) => child.filter(filterFn))
} | /**
* Filter FileNode tree. Behaves similar to `Array.prototype.filter()`, but modifies tree in place
* @param filterFn function to filter tree with
*/ | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/components/ExplorerNode.tsx#L109-L112 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | FileNode.map | map(mapFn: (node: FileNode) => void) {
mapFn(this)
this.children.forEach((child) => child.map(mapFn))
} | /**
* Filter FileNode tree. Behaves similar to `Array.prototype.map()`, but modifies tree in place
* @param mapFn function to use for mapping over tree
*/ | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/components/ExplorerNode.tsx#L118-L121 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | FileNode.getFolderPaths | getFolderPaths(collapsed: boolean): FolderState[] {
const folderPaths: FolderState[] = []
const traverse = (node: FileNode, currentPath: string) => {
if (!node.file) {
const folderPath = joinSegments(currentPath, node.name)
if (folderPath !== "") {
folderPaths.push({ path: folde... | /**
* Get folder representation with state of tree.
* Intended to only be called on root node before changes to the tree are made
* @param collapsed default state of folders (collapsed by default or not)
* @returns array containing folder state for tree
*/ | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/components/ExplorerNode.tsx#L129-L145 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Obsidian-PaperBell | github_2023 | PaperBell-Org | typescript | FileNode.sort | sort(sortFn: (a: FileNode, b: FileNode) => number) {
this.children = this.children.sort(sortFn)
this.children.forEach((e) => e.sort(sortFn))
} | /**
* Sorts tree according to sort/compare function
* @param sortFn compare function used for `.sort()`, also used recursively for children
*/ | https://github.com/PaperBell-Org/Obsidian-PaperBell/blob/2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92/quartz/components/ExplorerNode.tsx#L152-L155 | 2c49cbd8e71e0232f3cdbcc7548d9bd0b40d3a92 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.