diff options
author | Kamil Rojewski <kamil.rojewski@gmail.com> | 2021-03-04 21:12:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-04 12:12:44 -0800 |
commit | 4033ff5892ed6a5e083811fa13c7f9094d46d5db (patch) | |
tree | 4882504f91d878ebf3eca2b68a8bcb5561f3298f /tests/union_vector/book-reader.ts | |
parent | a08357251226eb58e3d0e71f6f5de78b2082a043 (diff) | |
download | flatbuffers-4033ff5892ed6a5e083811fa13c7f9094d46d5db.tar.gz flatbuffers-4033ff5892ed6a5e083811fa13c7f9094d46d5db.tar.bz2 flatbuffers-4033ff5892ed6a5e083811fa13c7f9094d46d5db.zip |
fixed invalid TS call and added test files (#6495)
e581013e3d42af13d2fe37b0ac46a3fd43f3638c broke TS generation - please don't use "replace" to refactor function names :)
Diffstat (limited to 'tests/union_vector/book-reader.ts')
-rw-r--r-- | tests/union_vector/book-reader.ts | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/union_vector/book-reader.ts b/tests/union_vector/book-reader.ts new file mode 100644 index 00000000..23106006 --- /dev/null +++ b/tests/union_vector/book-reader.ts @@ -0,0 +1,63 @@ +// automatically generated by the FlatBuffers compiler, do not modify + +import * as flatbuffers from 'flatbuffers'; + + + +export class BookReader { + bb: flatbuffers.ByteBuffer|null = null; + bb_pos = 0; +__init(i:number, bb:flatbuffers.ByteBuffer):BookReader { + this.bb_pos = i; + this.bb = bb; + return this; +} + +booksRead():number { + return this.bb!.readInt32(this.bb_pos); +} + +mutate_books_read(value:number):boolean { + this.bb!.writeInt32(this.bb_pos + 0, value); + return true; +} + +static getFullyQualifiedName():string { + return 'BookReader'; +} + +static sizeOf():number { + return 4; +} + +static createBookReader(builder:flatbuffers.Builder, books_read: number):flatbuffers.Offset { + builder.prep(4, 4); + builder.writeInt32(books_read); + return builder.offset(); +} + + +unpack(): BookReaderT { + return new BookReaderT( + this.booksRead() + ); +} + + +unpackTo(_o: BookReaderT): void { + _o.booksRead = this.booksRead(); +} +} + +export class BookReaderT { +constructor( + public booksRead: number = 0 +){} + + +pack(builder:flatbuffers.Builder): flatbuffers.Offset { + return BookReader.createBookReader(builder, + this.booksRead + ); +} +} |