Improve TS types to support isolatedModules and isolatedDeclarations

This commit is contained in:
Björn Harrtell
2026-04-08 05:42:18 +02:00
parent e223d69b36
commit 496f10525b
249 changed files with 12736 additions and 14776 deletions

View File

@@ -818,7 +818,7 @@ class TsGenerator : public BaseGenerator {
code += "static finish" + (size_prefixed ? sizePrefixed : "") + code += "static finish" + (size_prefixed ? sizePrefixed : "") +
GetPrefixedName(struct_def) + "Buffer"; GetPrefixedName(struct_def) + "Buffer";
code += "(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {\n"; code += "(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {\n";
code += " builder.finish(offset"; code += " builder.finish(offset";
if (!parser_.file_identifier_.empty()) { if (!parser_.file_identifier_.empty()) {
code += ", '" + parser_.file_identifier_ + "'"; code += ", '" + parser_.file_identifier_ + "'";
@@ -1703,7 +1703,7 @@ class TsGenerator : public BaseGenerator {
} }
code += " bb: flatbuffers.ByteBuffer|" + null_keyword_ + " = " + code += " bb: flatbuffers.ByteBuffer|" + null_keyword_ + " = " +
null_keyword_ + ";\n"; null_keyword_ + ";\n";
code += " bb_pos = 0;\n"; code += " bb_pos: number = 0;\n";
// Generate the __init method that sets the field in a pre-existing // Generate the __init method that sets the field in a pre-existing
// accessor object. This is to allow object reuse. // accessor object. This is to allow object reuse.
@@ -2156,7 +2156,7 @@ class TsGenerator : public BaseGenerator {
GenDocComment(code_ptr); GenDocComment(code_ptr);
code += "static start" + GetPrefixedName(struct_def) + code += "static start" + GetPrefixedName(struct_def) +
"(builder:flatbuffers.Builder) {\n"; "(builder:flatbuffers.Builder):void {\n";
code += " builder.startObject(" + code += " builder.startObject(" +
NumToString(struct_def.fields.vec.size()) + ");\n"; NumToString(struct_def.fields.vec.size()) + ");\n";
@@ -2173,7 +2173,7 @@ class TsGenerator : public BaseGenerator {
GenDocComment(code_ptr); GenDocComment(code_ptr);
code += "static " + namer_.Method("add", field); code += "static " + namer_.Method("add", field);
code += "(builder:flatbuffers.Builder, " + argname + ":" + code += "(builder:flatbuffers.Builder, " + argname + ":" +
GetArgType(imports, struct_def, field, false) + ") {\n"; GetArgType(imports, struct_def, field, false) + "):void {\n";
code += " builder.addField" + GenWriteMethod(field.value.type) + "("; code += " builder.addField" + GenWriteMethod(field.value.type) + "(";
code += NumToString(it - struct_def.fields.vec.begin()) + ", "; code += NumToString(it - struct_def.fields.vec.begin()) + ", ";
if (field.value.type.base_type == BASE_TYPE_BOOL) { if (field.value.type.base_type == BASE_TYPE_BOOL) {
@@ -2245,7 +2245,7 @@ class TsGenerator : public BaseGenerator {
code += "static "; code += "static ";
code += namer_.Method("start", field, "Vector"); code += namer_.Method("start", field, "Vector");
code += "(builder:flatbuffers.Builder, numElems:number) {\n"; code += "(builder:flatbuffers.Builder, numElems:number):void {\n";
code += " builder.startVector(" + NumToString(elem_size); code += " builder.startVector(" + NumToString(elem_size);
code += ", numElems, " + NumToString(alignment) + ");\n"; code += ", numElems, " + NumToString(alignment) + ");\n";
code += "}\n\n"; code += "}\n\n";

View File

@@ -228,6 +228,11 @@ print(
" no_import_ext..." " no_import_ext..."
) )
check_call(["../../node_modules/.bin/tsc", "-p", "./tsconfig.node.json"]) check_call(["../../node_modules/.bin/tsc", "-p", "./tsconfig.node.json"])
print(
"Running TypeScript Compiler with isolatedDeclarations and"
" isolatedModules..."
)
check_call(["../../node_modules/.bin/tsc", "-p", "./tsconfig.isolated.json"])
NODE_CMD = ["node"] NODE_CMD = ["node"]

9
tests/ts/abc.ts Normal file
View File

@@ -0,0 +1,9 @@
// automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
export enum ABC {
A = 0,
B = 1,
C = 2
}

View File

@@ -1,6 +1,5 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export { ArrayStruct, ArrayStructT } from './example/array-struct.js'; export { ArrayStruct, ArrayStructT } from './example/array-struct.js';
export { ArrayTable, ArrayTableT } from './example/array-table.js'; export { ArrayTable, ArrayTableT } from './example/array-table.js';
export { InnerStruct, InnerStructT } from './example/inner-struct.js'; export { InnerStruct, InnerStructT } from './example/inner-struct.js';

View File

@@ -1,12 +1,7 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import { import { NestedStruct, NestedStructT } from './nested-struct.js';
NestedStruct, import { OuterStruct, OuterStructT } from './outer-struct.js';
NestedStructT, export declare class ArrayStruct implements flatbuffers.IUnpackableObject<ArrayStructT> {
} from '../../my-game/example/nested-struct.js';
import {OuterStruct, OuterStructT} from '../../my-game/example/outer-struct.js';
export declare class ArrayStruct
implements flatbuffers.IUnpackableObject<ArrayStructT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): ArrayStruct; __init(i: number, bb: flatbuffers.ByteBuffer): ArrayStruct;
@@ -17,37 +12,20 @@ export declare class ArrayStruct
e(): number; e(): number;
f(index: number, obj?: OuterStruct): OuterStruct | null; f(index: number, obj?: OuterStruct): OuterStruct | null;
g(index: number): bigint | null; g(index: number): bigint | null;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.ArrayStruct";
static sizeOf(): number; static sizeOf(): number;
static createArrayStruct( static createArrayStruct(builder: flatbuffers.Builder, a_underscore: number, b_underscore: number[], c: number, d: (any | NestedStructT)[], e: number, f: (any | OuterStructT)[], g: bigint[]): flatbuffers.Offset;
builder: flatbuffers.Builder,
a_underscore: number,
b_underscore: number[] | null,
c: number,
d: (any | NestedStructT)[] | null,
e: number,
f: (any | OuterStructT)[] | null,
g: bigint[] | null,
): flatbuffers.Offset;
unpack(): ArrayStructT; unpack(): ArrayStructT;
unpackTo(_o: ArrayStructT): void; unpackTo(_o: ArrayStructT): void;
} }
export declare class ArrayStructT implements flatbuffers.IGeneratedObject { export declare class ArrayStructT implements flatbuffers.IGeneratedObject {
aUnderscore: number; aUnderscore: number;
bUnderscore: number[]; bUnderscore: (number)[];
c: number; c: number;
d: NestedStructT[]; d: (NestedStructT)[];
e: number; e: number;
f: OuterStructT[]; f: (OuterStructT)[];
g: bigint[]; g: (bigint)[];
constructor( constructor(aUnderscore?: number, bUnderscore?: (number)[], c?: number, d?: (NestedStructT)[], e?: number, f?: (OuterStructT)[], g?: (bigint)[]);
aUnderscore?: number,
bUnderscore?: number[],
c?: number,
d?: NestedStructT[],
e?: number,
f?: OuterStructT[],
g?: bigint[],
);
pack(builder: flatbuffers.Builder): flatbuffers.Offset; pack(builder: flatbuffers.Builder): flatbuffers.Offset;
} }

View File

@@ -1,6 +1,6 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
import {NestedStruct, NestedStructT} from '../../my-game/example/nested-struct.js'; import { NestedStruct, NestedStructT } from './nested-struct.js';
import {OuterStruct, OuterStructT} from '../../my-game/example/outer-struct.js'; import { OuterStruct, OuterStructT } from './outer-struct.js';
export class ArrayStruct { export class ArrayStruct {
constructor() { constructor() {
this.bb = null; this.bb = null;
@@ -21,15 +21,13 @@ export class ArrayStruct {
return this.bb.readInt8(this.bb_pos + 64); return this.bb.readInt8(this.bb_pos + 64);
} }
d(index, obj) { d(index, obj) {
return (obj || new NestedStruct()) return (obj || new NestedStruct()).__init(this.bb_pos + 72 + index * 1072, this.bb);
.__init(this.bb_pos + 72 + index * 1072, this.bb);
} }
e() { e() {
return this.bb.readInt32(this.bb_pos + 2216); return this.bb.readInt32(this.bb_pos + 2216);
} }
f(index, obj) { f(index, obj) {
return (obj || new OuterStruct()) return (obj || new OuterStruct()).__init(this.bb_pos + 2224 + index * 208, this.bb);
.__init(this.bb_pos + 2224 + index * 208, this.bb);
} }
g(index) { g(index) {
return this.bb.readInt64(this.bb_pos + 2640 + index * 8); return this.bb.readInt64(this.bb_pos + 2640 + index * 8);
@@ -51,12 +49,7 @@ export class ArrayStruct {
item.pack(builder); item.pack(builder);
continue; continue;
} }
OuterStruct.createOuterStruct( OuterStruct.createOuterStruct(builder, item?.a, item?.b, (item?.cUnderscore?.a ?? 0), (item?.cUnderscore?.b ?? []), (item?.cUnderscore?.c ?? 0), (item?.cUnderscore?.dUnderscore ?? BigInt(0)), item?.d, (item?.e?.a ?? 0), (item?.e?.b ?? []), (item?.e?.c ?? 0), (item?.e?.dUnderscore ?? BigInt(0)), item?.f);
builder, item?.a, item?.b, (item?.cUnderscore?.a ?? 0),
(item?.cUnderscore?.b ?? []), (item?.cUnderscore?.c ?? 0),
(item?.cUnderscore?.dUnderscore ?? BigInt(0)), item?.d,
(item?.e?.a ?? 0), (item?.e?.b ?? []), (item?.e?.c ?? 0),
(item?.e?.dUnderscore ?? BigInt(0)), item?.f);
} }
builder.pad(4); builder.pad(4);
builder.writeInt32(e); builder.writeInt32(e);
@@ -66,8 +59,7 @@ export class ArrayStruct {
item.pack(builder); item.pack(builder);
continue; continue;
} }
NestedStruct.createNestedStruct( NestedStruct.createNestedStruct(builder, item?.a, item?.b, item?.cUnderscore, item?.dOuter, item?.e);
builder, item?.a, item?.b, item?.cUnderscore, item?.dOuter, item?.e);
} }
builder.pad(7); builder.pad(7);
builder.writeInt8(c); builder.writeInt8(c);
@@ -78,12 +70,7 @@ export class ArrayStruct {
return builder.offset(); return builder.offset();
} }
unpack() { unpack() {
return new ArrayStructT( return new ArrayStructT(this.aUnderscore(), this.bb.createScalarList(this.bUnderscore.bind(this), 15), this.c(), this.bb.createObjList(this.d.bind(this), 2), this.e(), this.bb.createObjList(this.f.bind(this), 2), this.bb.createScalarList(this.g.bind(this), 2));
this.aUnderscore(),
this.bb.createScalarList(this.bUnderscore.bind(this), 15), this.c(),
this.bb.createObjList(this.d.bind(this), 2), this.e(),
this.bb.createObjList(this.f.bind(this), 2),
this.bb.createScalarList(this.g.bind(this), 2));
} }
unpackTo(_o) { unpackTo(_o) {
_o.aUnderscore = this.aUnderscore(); _o.aUnderscore = this.aUnderscore();
@@ -96,9 +83,7 @@ export class ArrayStruct {
} }
} }
export class ArrayStructT { export class ArrayStructT {
constructor( constructor(aUnderscore = 0.0, bUnderscore = [], c = 0, d = [], e = 0, f = [], g = []) {
aUnderscore = 0.0, bUnderscore = [], c = 0, d = [], e = 0, f = [],
g = []) {
this.aUnderscore = aUnderscore; this.aUnderscore = aUnderscore;
this.bUnderscore = bUnderscore; this.bUnderscore = bUnderscore;
this.c = c; this.c = c;
@@ -108,8 +93,6 @@ export class ArrayStructT {
this.g = g; this.g = g;
} }
pack(builder) { pack(builder) {
return ArrayStruct.createArrayStruct( return ArrayStruct.createArrayStruct(builder, this.aUnderscore, this.bUnderscore, this.c, this.d, this.e, this.f, this.g);
builder, this.aUnderscore, this.bUnderscore, this.c, this.d, this.e,
this.f, this.g);
} }
} }

View File

@@ -4,17 +4,13 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import { import { NestedStruct, NestedStructT } from './nested-struct.js';
NestedStruct, import { OuterStruct, OuterStructT } from './outer-struct.js';
NestedStructT,
} from '../../my-game/example/nested-struct.js';
import {OuterStruct, OuterStructT} from '../../my-game/example/outer-struct.js';
export class ArrayStruct
implements flatbuffers.IUnpackableObject<ArrayStructT> export class ArrayStruct implements flatbuffers.IUnpackableObject<ArrayStructT> {
{
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):ArrayStruct { __init(i:number, bb:flatbuffers.ByteBuffer):ArrayStruct {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -34,10 +30,7 @@ export class ArrayStruct
} }
d(index: number, obj?:NestedStruct):NestedStruct|null { d(index: number, obj?:NestedStruct):NestedStruct|null {
return (obj || new NestedStruct()).__init( return (obj || new NestedStruct()).__init(this.bb_pos + 72 + index * 1072, this.bb!);
this.bb_pos + 72 + index * 1072,
this.bb!,
);
} }
e():number { e():number {
@@ -45,17 +38,14 @@ export class ArrayStruct
} }
f(index: number, obj?:OuterStruct):OuterStruct|null { f(index: number, obj?:OuterStruct):OuterStruct|null {
return (obj || new OuterStruct()).__init( return (obj || new OuterStruct()).__init(this.bb_pos + 2224 + index * 208, this.bb!);
this.bb_pos + 2224 + index * 208,
this.bb!,
);
} }
g(index: number):bigint|null { g(index: number):bigint|null {
return this.bb!.readInt64(this.bb_pos + 2640 + index * 8); return this.bb!.readInt64(this.bb_pos + 2640 + index * 8);
} }
static getFullyQualifiedName(): string { static getFullyQualifiedName(): "MyGame.Example.ArrayStruct" {
return 'MyGame.Example.ArrayStruct'; return 'MyGame.Example.ArrayStruct';
} }
@@ -63,22 +53,14 @@ export class ArrayStruct
return 2656; return 2656;
} }
static createArrayStruct( static createArrayStruct(builder:flatbuffers.Builder, a_underscore: number, b_underscore: number[], c: number, d: (any|NestedStructT)[], e: number, f: (any|OuterStructT)[], g: bigint[]):flatbuffers.Offset {
builder: flatbuffers.Builder,
a_underscore: number,
b_underscore: number[] | null,
c: number,
d: (any | NestedStructT)[] | null,
e: number,
f: (any | OuterStructT)[] | null,
g: bigint[] | null,
): flatbuffers.Offset {
builder.prep(8, 2656); builder.prep(8, 2656);
for (let i = 1; i >= 0; --i) { for (let i = 1; i >= 0; --i) {
builder.writeInt64(BigInt(g?.[i] ?? 0)); builder.writeInt64(BigInt(g?.[i] ?? 0));
} }
for (let i = 1; i >= 0; --i) { for (let i = 1; i >= 0; --i) {
const item = f?.[i]; const item = f?.[i];
@@ -87,20 +69,19 @@ export class ArrayStruct
continue; continue;
} }
OuterStruct.createOuterStruct( OuterStruct.createOuterStruct(builder,
builder,
item?.a, item?.a,
item?.b, item?.b,
item?.cUnderscore?.a ?? 0, (item?.cUnderscore?.a ?? 0),
item?.cUnderscore?.b ?? [], (item?.cUnderscore?.b ?? []),
item?.cUnderscore?.c ?? 0, (item?.cUnderscore?.c ?? 0),
item?.cUnderscore?.dUnderscore ?? BigInt(0), (item?.cUnderscore?.dUnderscore ?? BigInt(0)),
item?.d, item?.d,
item?.e?.a ?? 0, (item?.e?.a ?? 0),
item?.e?.b ?? [], (item?.e?.b ?? []),
item?.e?.c ?? 0, (item?.e?.c ?? 0),
item?.e?.dUnderscore ?? BigInt(0), (item?.e?.dUnderscore ?? BigInt(0)),
item?.f, item?.f
); );
} }
@@ -115,13 +96,12 @@ export class ArrayStruct
continue; continue;
} }
NestedStruct.createNestedStruct( NestedStruct.createNestedStruct(builder,
builder,
item?.a, item?.a,
item?.b, item?.b,
item?.cUnderscore, item?.cUnderscore,
item?.dOuter, item?.dOuter,
item?.e, item?.e
); );
} }
@@ -129,13 +109,15 @@ export class ArrayStruct
builder.writeInt8(c); builder.writeInt8(c);
for (let i = 14; i >= 0; --i) { for (let i = 14; i >= 0; --i) {
builder.writeInt32(b_underscore?.[i] ?? 0); builder.writeInt32((b_underscore?.[i] ?? 0));
} }
builder.writeFloat32(a_underscore); builder.writeFloat32(a_underscore);
return builder.offset(); return builder.offset();
} }
unpack(): ArrayStructT { unpack(): ArrayStructT {
return new ArrayStructT( return new ArrayStructT(
this.aUnderscore(), this.aUnderscore(),
@@ -144,26 +126,18 @@ export class ArrayStruct
this.bb!.createObjList<NestedStruct, NestedStructT>(this.d.bind(this), 2), this.bb!.createObjList<NestedStruct, NestedStructT>(this.d.bind(this), 2),
this.e(), this.e(),
this.bb!.createObjList<OuterStruct, OuterStructT>(this.f.bind(this), 2), this.bb!.createObjList<OuterStruct, OuterStructT>(this.f.bind(this), 2),
this.bb!.createScalarList<bigint>(this.g.bind(this), 2), this.bb!.createScalarList<bigint>(this.g.bind(this), 2)
); );
} }
unpackTo(_o: ArrayStructT): void { unpackTo(_o: ArrayStructT): void {
_o.aUnderscore = this.aUnderscore(); _o.aUnderscore = this.aUnderscore();
_o.bUnderscore = this.bb!.createScalarList<number>( _o.bUnderscore = this.bb!.createScalarList<number>(this.bUnderscore.bind(this), 15);
this.bUnderscore.bind(this),
15,
);
_o.c = this.c(); _o.c = this.c();
_o.d = this.bb!.createObjList<NestedStruct, NestedStructT>( _o.d = this.bb!.createObjList<NestedStruct, NestedStructT>(this.d.bind(this), 2);
this.d.bind(this),
2,
);
_o.e = this.e(); _o.e = this.e();
_o.f = this.bb!.createObjList<OuterStruct, OuterStructT>( _o.f = this.bb!.createObjList<OuterStruct, OuterStructT>(this.f.bind(this), 2);
this.f.bind(this),
2,
);
_o.g = this.bb!.createScalarList<bigint>(this.g.bind(this), 2); _o.g = this.bb!.createScalarList<bigint>(this.g.bind(this), 2);
} }
} }
@@ -171,24 +145,24 @@ export class ArrayStruct
export class ArrayStructT implements flatbuffers.IGeneratedObject { export class ArrayStructT implements flatbuffers.IGeneratedObject {
constructor( constructor(
public aUnderscore: number = 0.0, public aUnderscore: number = 0.0,
public bUnderscore: number[] = [], public bUnderscore: (number)[] = [],
public c: number = 0, public c: number = 0,
public d: NestedStructT[] = [], public d: (NestedStructT)[] = [],
public e: number = 0, public e: number = 0,
public f: OuterStructT[] = [], public f: (OuterStructT)[] = [],
public g: bigint[] = [], public g: (bigint)[] = []
){} ){}
pack(builder:flatbuffers.Builder): flatbuffers.Offset { pack(builder:flatbuffers.Builder): flatbuffers.Offset {
return ArrayStruct.createArrayStruct( return ArrayStruct.createArrayStruct(builder,
builder,
this.aUnderscore, this.aUnderscore,
this.bUnderscore, this.bUnderscore,
this.c, this.c,
this.d, this.d,
this.e, this.e,
this.f, this.f,
this.g, this.g
); );
} }
} }

View File

@@ -1,48 +1,28 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import {ArrayStruct, ArrayStructT} from '../../my-game/example/array-struct.js'; import { ArrayStruct, ArrayStructT } from './array-struct.js';
export declare class ArrayTable export declare class ArrayTable implements flatbuffers.IUnpackableObject<ArrayTableT> {
implements flatbuffers.IUnpackableObject<ArrayTableT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): ArrayTable; __init(i: number, bb: flatbuffers.ByteBuffer): ArrayTable;
static getRootAsArrayTable( static getRootAsArrayTable(bb: flatbuffers.ByteBuffer, obj?: ArrayTable): ArrayTable;
bb: flatbuffers.ByteBuffer, static getSizePrefixedRootAsArrayTable(bb: flatbuffers.ByteBuffer, obj?: ArrayTable): ArrayTable;
obj?: ArrayTable,
): ArrayTable;
static getSizePrefixedRootAsArrayTable(
bb: flatbuffers.ByteBuffer,
obj?: ArrayTable,
): ArrayTable;
static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean; static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean;
a(): string | null; a(): string | null;
a(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; a(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
cUnderscore(obj?: ArrayStruct): ArrayStruct | null; cUnderscore(obj?: ArrayStruct): ArrayStruct | null;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.ArrayTable";
static startArrayTable(builder: flatbuffers.Builder): void; static startArrayTable(builder: flatbuffers.Builder): void;
static addA(builder: flatbuffers.Builder, aOffset: flatbuffers.Offset): void; static addA(builder: flatbuffers.Builder, aOffset: flatbuffers.Offset): void;
static addCUnderscore( static addCUnderscore(builder: flatbuffers.Builder, cUnderscoreOffset: flatbuffers.Offset): void;
builder: flatbuffers.Builder,
cUnderscoreOffset: flatbuffers.Offset,
): void;
static endArrayTable(builder: flatbuffers.Builder): flatbuffers.Offset; static endArrayTable(builder: flatbuffers.Builder): flatbuffers.Offset;
static finishArrayTableBuffer( static finishArrayTableBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static finishSizePrefixedArrayTableBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
offset: flatbuffers.Offset,
): void;
static finishSizePrefixedArrayTableBuffer(
builder: flatbuffers.Builder,
offset: flatbuffers.Offset,
): void;
unpack(): ArrayTableT; unpack(): ArrayTableT;
unpackTo(_o: ArrayTableT): void; unpackTo(_o: ArrayTableT): void;
} }
export declare class ArrayTableT implements flatbuffers.IGeneratedObject { export declare class ArrayTableT implements flatbuffers.IGeneratedObject {
a: string | Uint8Array | null; a: string | Uint8Array | null;
cUnderscore: ArrayStructT | null; cUnderscore: ArrayStructT | null;
constructor( constructor(a?: string | Uint8Array | null, cUnderscore?: ArrayStructT | null);
a?: string | Uint8Array | null,
cUnderscore?: ArrayStructT | null,
);
pack(builder: flatbuffers.Builder): flatbuffers.Offset; pack(builder: flatbuffers.Builder): flatbuffers.Offset;
} }

View File

@@ -1,10 +1,7 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import { ArrayStruct } from './array-struct.js';
import {ArrayStruct} from '../../my-game/example/array-struct.js';
export class ArrayTable { export class ArrayTable {
constructor() { constructor() {
this.bb = null; this.bb = null;
@@ -16,27 +13,22 @@ export class ArrayTable {
return this; return this;
} }
static getRootAsArrayTable(bb, obj) { static getRootAsArrayTable(bb, obj) {
return (obj || new ArrayTable()) return (obj || new ArrayTable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getSizePrefixedRootAsArrayTable(bb, obj) { static getSizePrefixedRootAsArrayTable(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new ArrayTable()) return (obj || new ArrayTable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static bufferHasIdentifier(bb) { static bufferHasIdentifier(bb) {
return bb.__has_identifier('RHUB'); return bb.__has_identifier('RHUB');
} }
a(optionalEncoding) { a(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 4); const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
null;
} }
cUnderscore(obj) { cUnderscore(obj) {
const offset = this.bb.__offset(this.bb_pos, 6); const offset = this.bb.__offset(this.bb_pos, 6);
return offset ? return offset ? (obj || new ArrayStruct()).__init(this.bb_pos + offset, this.bb) : null;
(obj || new ArrayStruct()).__init(this.bb_pos + offset, this.bb) :
null;
} }
static getFullyQualifiedName() { static getFullyQualifiedName() {
return 'MyGame.Example.ArrayTable'; return 'MyGame.Example.ArrayTable';
@@ -61,14 +53,11 @@ export class ArrayTable {
builder.finish(offset, 'RHUB', true); builder.finish(offset, 'RHUB', true);
} }
unpack() { unpack() {
return new ArrayTableT( return new ArrayTableT(this.a(), (this.cUnderscore() !== null ? this.cUnderscore().unpack() : null));
this.a(),
(this.cUnderscore() !== null ? this.cUnderscore().unpack() : null));
} }
unpackTo(_o) { unpackTo(_o) {
_o.a = this.a(); _o.a = this.a();
_o.cUnderscore = _o.cUnderscore = (this.cUnderscore() !== null ? this.cUnderscore().unpack() : null);
(this.cUnderscore() !== null ? this.cUnderscore().unpack() : null);
} }
} }
export class ArrayTableT { export class ArrayTableT {
@@ -80,9 +69,7 @@ export class ArrayTableT {
const a = (this.a !== null ? builder.createString(this.a) : 0); const a = (this.a !== null ? builder.createString(this.a) : 0);
ArrayTable.startArrayTable(builder); ArrayTable.startArrayTable(builder);
ArrayTable.addA(builder, a); ArrayTable.addA(builder, a);
ArrayTable.addCUnderscore( ArrayTable.addCUnderscore(builder, (this.cUnderscore !== null ? this.cUnderscore.pack(builder) : 0));
builder,
(this.cUnderscore !== null ? this.cUnderscore.pack(builder) : 0));
return ArrayTable.endArrayTable(builder); return ArrayTable.endArrayTable(builder);
} }
} }

View File

@@ -4,74 +4,56 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import {ArrayStruct, ArrayStructT} from '../../my-game/example/array-struct.js'; import { ArrayStruct, ArrayStructT } from './array-struct.js';
export class ArrayTable implements flatbuffers.IUnpackableObject<ArrayTableT> { export class ArrayTable implements flatbuffers.IUnpackableObject<ArrayTableT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):ArrayTable { __init(i:number, bb:flatbuffers.ByteBuffer):ArrayTable {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
return this; return this;
} }
static getRootAsArrayTable( static getRootAsArrayTable(bb:flatbuffers.ByteBuffer, obj?:ArrayTable):ArrayTable {
bb: flatbuffers.ByteBuffer, return (obj || new ArrayTable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
obj?: ArrayTable,
): ArrayTable {
return (obj || new ArrayTable()).__init(
bb.readInt32(bb.position()) + bb.position(),
bb,
);
} }
static getSizePrefixedRootAsArrayTable( static getSizePrefixedRootAsArrayTable(bb:flatbuffers.ByteBuffer, obj?:ArrayTable):ArrayTable {
bb: flatbuffers.ByteBuffer,
obj?: ArrayTable,
): ArrayTable {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new ArrayTable()).__init( return (obj || new ArrayTable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
bb.readInt32(bb.position()) + bb.position(),
bb,
);
} }
static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean { static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean {
return bb.__has_identifier('RHUB'); return bb.__has_identifier('RHUB');
} }
a(): string | null; a():string|null
a(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; a(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
a(optionalEncoding?:any):string|Uint8Array|null { a(optionalEncoding?:any):string|Uint8Array|null {
const offset = this.bb!.__offset(this.bb_pos, 4); const offset = this.bb!.__offset(this.bb_pos, 4);
return offset return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
: null;
} }
cUnderscore(obj?:ArrayStruct):ArrayStruct|null { cUnderscore(obj?:ArrayStruct):ArrayStruct|null {
const offset = this.bb!.__offset(this.bb_pos, 6); const offset = this.bb!.__offset(this.bb_pos, 6);
return offset return offset ? (obj || new ArrayStruct()).__init(this.bb_pos + offset, this.bb!) : null;
? (obj || new ArrayStruct()).__init(this.bb_pos + offset, this.bb!)
: null;
} }
static getFullyQualifiedName(): string { static getFullyQualifiedName(): "MyGame.Example.ArrayTable" {
return 'MyGame.Example.ArrayTable'; return 'MyGame.Example.ArrayTable';
} }
static startArrayTable(builder: flatbuffers.Builder) { static startArrayTable(builder:flatbuffers.Builder):void {
builder.startObject(2); builder.startObject(2);
} }
static addA(builder: flatbuffers.Builder, aOffset: flatbuffers.Offset) { static addA(builder:flatbuffers.Builder, aOffset:flatbuffers.Offset):void {
builder.addFieldOffset(0, aOffset, 0); builder.addFieldOffset(0, aOffset, 0);
} }
static addCUnderscore( static addCUnderscore(builder:flatbuffers.Builder, cUnderscoreOffset:flatbuffers.Offset):void {
builder: flatbuffers.Builder,
cUnderscoreOffset: flatbuffers.Offset,
) {
builder.addFieldStruct(1, cUnderscoreOffset, 0); builder.addFieldStruct(1, cUnderscoreOffset, 0);
} }
@@ -80,49 +62,42 @@ export class ArrayTable implements flatbuffers.IUnpackableObject<ArrayTableT> {
return offset; return offset;
} }
static finishArrayTableBuffer( static finishArrayTableBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
builder: flatbuffers.Builder,
offset: flatbuffers.Offset,
) {
builder.finish(offset, 'RHUB'); builder.finish(offset, 'RHUB');
} }
static finishSizePrefixedArrayTableBuffer( static finishSizePrefixedArrayTableBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
builder: flatbuffers.Builder,
offset: flatbuffers.Offset,
) {
builder.finish(offset, 'RHUB', true); builder.finish(offset, 'RHUB', true);
} }
unpack(): ArrayTableT { unpack(): ArrayTableT {
return new ArrayTableT( return new ArrayTableT(
this.a(), this.a(),
this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null, (this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null)
); );
} }
unpackTo(_o: ArrayTableT): void { unpackTo(_o: ArrayTableT): void {
_o.a = this.a(); _o.a = this.a();
_o.cUnderscore = _o.cUnderscore = (this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null);
this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null;
} }
} }
export class ArrayTableT implements flatbuffers.IGeneratedObject { export class ArrayTableT implements flatbuffers.IGeneratedObject {
constructor( constructor(
public a: string|Uint8Array|null = null, public a: string|Uint8Array|null = null,
public cUnderscore: ArrayStructT | null = null, public cUnderscore: ArrayStructT|null = null
){} ){}
pack(builder:flatbuffers.Builder): flatbuffers.Offset { pack(builder:flatbuffers.Builder): flatbuffers.Offset {
const a = this.a !== null ? builder.createString(this.a!) : 0; const a = (this.a !== null ? builder.createString(this.a!) : 0);
ArrayTable.startArrayTable(builder); ArrayTable.startArrayTable(builder);
ArrayTable.addA(builder, a); ArrayTable.addA(builder, a);
ArrayTable.addCUnderscore( ArrayTable.addCUnderscore(builder, (this.cUnderscore !== null ? this.cUnderscore!.pack(builder) : 0));
builder,
this.cUnderscore !== null ? this.cUnderscore!.pack(builder) : 0,
);
return ArrayTable.endArrayTable(builder); return ArrayTable.endArrayTable(builder);
} }

View File

@@ -1,7 +1,5 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export declare class InnerStruct export declare class InnerStruct implements flatbuffers.IUnpackableObject<InnerStructT> {
implements flatbuffers.IUnpackableObject<InnerStructT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): InnerStruct; __init(i: number, bb: flatbuffers.ByteBuffer): InnerStruct;
@@ -9,23 +7,17 @@ export declare class InnerStruct
b(index: number): number | null; b(index: number): number | null;
c(): number; c(): number;
dUnderscore(): bigint; dUnderscore(): bigint;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.InnerStruct";
static sizeOf(): number; static sizeOf(): number;
static createInnerStruct( static createInnerStruct(builder: flatbuffers.Builder, a: number, b: number[], c: number, d_underscore: bigint): flatbuffers.Offset;
builder: flatbuffers.Builder,
a: number,
b: number[] | null,
c: number,
d_underscore: bigint,
): flatbuffers.Offset;
unpack(): InnerStructT; unpack(): InnerStructT;
unpackTo(_o: InnerStructT): void; unpackTo(_o: InnerStructT): void;
} }
export declare class InnerStructT implements flatbuffers.IGeneratedObject { export declare class InnerStructT implements flatbuffers.IGeneratedObject {
a: number; a: number;
b: number[]; b: (number)[];
c: number; c: number;
dUnderscore: bigint; dUnderscore: bigint;
constructor(a?: number, b?: number[], c?: number, dUnderscore?: bigint); constructor(a?: number, b?: (number)[], c?: number, dUnderscore?: bigint);
pack(builder: flatbuffers.Builder): flatbuffers.Offset; pack(builder: flatbuffers.Builder): flatbuffers.Offset;
} }

View File

@@ -39,9 +39,7 @@ export class InnerStruct {
return builder.offset(); return builder.offset();
} }
unpack() { unpack() {
return new InnerStructT( return new InnerStructT(this.a(), this.bb.createScalarList(this.b.bind(this), 13), this.c(), this.dUnderscore());
this.a(), this.bb.createScalarList(this.b.bind(this), 13), this.c(),
this.dUnderscore());
} }
unpackTo(_o) { unpackTo(_o) {
_o.a = this.a(); _o.a = this.a();
@@ -58,7 +56,6 @@ export class InnerStructT {
this.dUnderscore = dUnderscore; this.dUnderscore = dUnderscore;
} }
pack(builder) { pack(builder) {
return InnerStruct.createInnerStruct( return InnerStruct.createInnerStruct(builder, this.a, this.b, this.c, this.dUnderscore);
builder, this.a, this.b, this.c, this.dUnderscore);
} }
} }

View File

@@ -4,11 +4,11 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export class InnerStruct
implements flatbuffers.IUnpackableObject<InnerStructT>
{ export class InnerStruct implements flatbuffers.IUnpackableObject<InnerStructT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):InnerStruct { __init(i:number, bb:flatbuffers.ByteBuffer):InnerStruct {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -31,7 +31,7 @@ export class InnerStruct
return this.bb!.readInt64(this.bb_pos + 24); return this.bb!.readInt64(this.bb_pos + 24);
} }
static getFullyQualifiedName(): string { static getFullyQualifiedName(): "MyGame.Example.InnerStruct" {
return 'MyGame.Example.InnerStruct'; return 'MyGame.Example.InnerStruct';
} }
@@ -39,35 +39,32 @@ export class InnerStruct
return 32; return 32;
} }
static createInnerStruct( static createInnerStruct(builder:flatbuffers.Builder, a: number, b: number[], c: number, d_underscore: bigint):flatbuffers.Offset {
builder: flatbuffers.Builder,
a: number,
b: number[] | null,
c: number,
d_underscore: bigint,
): flatbuffers.Offset {
builder.prep(8, 32); builder.prep(8, 32);
builder.writeInt64(BigInt(d_underscore ?? 0)); builder.writeInt64(BigInt(d_underscore ?? 0));
builder.pad(2); builder.pad(2);
builder.writeInt8(c); builder.writeInt8(c);
for (let i = 12; i >= 0; --i) { for (let i = 12; i >= 0; --i) {
builder.writeInt8(b?.[i] ?? 0); builder.writeInt8((b?.[i] ?? 0));
} }
builder.writeFloat64(a); builder.writeFloat64(a);
return builder.offset(); return builder.offset();
} }
unpack(): InnerStructT { unpack(): InnerStructT {
return new InnerStructT( return new InnerStructT(
this.a(), this.a(),
this.bb!.createScalarList<number>(this.b.bind(this), 13), this.bb!.createScalarList<number>(this.b.bind(this), 13),
this.c(), this.c(),
this.dUnderscore(), this.dUnderscore()
); );
} }
unpackTo(_o: InnerStructT): void { unpackTo(_o: InnerStructT): void {
_o.a = this.a(); _o.a = this.a();
_o.b = this.bb!.createScalarList<number>(this.b.bind(this), 13); _o.b = this.bb!.createScalarList<number>(this.b.bind(this), 13);
@@ -79,18 +76,18 @@ export class InnerStruct
export class InnerStructT implements flatbuffers.IGeneratedObject { export class InnerStructT implements flatbuffers.IGeneratedObject {
constructor( constructor(
public a: number = 0.0, public a: number = 0.0,
public b: number[] = [], public b: (number)[] = [],
public c: number = 0, public c: number = 0,
public dUnderscore: bigint = BigInt('0'), public dUnderscore: bigint = BigInt('0')
){} ){}
pack(builder:flatbuffers.Builder): flatbuffers.Offset { pack(builder:flatbuffers.Builder): flatbuffers.Offset {
return InnerStruct.createInnerStruct( return InnerStruct.createInnerStruct(builder,
builder,
this.a, this.a,
this.b, this.b,
this.c, this.c,
this.dUnderscore, this.dUnderscore
); );
} }
} }

View File

@@ -1,9 +1,7 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import {OuterStruct, OuterStructT} from '../../my-game/example/outer-struct.js'; import { OuterStruct, OuterStructT } from './outer-struct.js';
import {TestEnum} from '../../my-game/example/test-enum.js'; import { TestEnum } from './test-enum.js';
export declare class NestedStruct export declare class NestedStruct implements flatbuffers.IUnpackableObject<NestedStructT> {
implements flatbuffers.IUnpackableObject<NestedStructT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): NestedStruct; __init(i: number, bb: flatbuffers.ByteBuffer): NestedStruct;
@@ -12,31 +10,18 @@ export declare class NestedStruct
cUnderscore(index: number): TestEnum | null; cUnderscore(index: number): TestEnum | null;
dOuter(index: number, obj?: OuterStruct): OuterStruct | null; dOuter(index: number, obj?: OuterStruct): OuterStruct | null;
e(index: number): bigint | null; e(index: number): bigint | null;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.NestedStruct";
static sizeOf(): number; static sizeOf(): number;
static createNestedStruct( static createNestedStruct(builder: flatbuffers.Builder, a: number[], b: TestEnum, c_underscore: number[], d_outer: (any | OuterStructT)[], e: bigint[]): flatbuffers.Offset;
builder: flatbuffers.Builder,
a: number[] | null,
b: TestEnum,
c_underscore: number[] | null,
d_outer: (any | OuterStructT)[] | null,
e: bigint[] | null,
): flatbuffers.Offset;
unpack(): NestedStructT; unpack(): NestedStructT;
unpackTo(_o: NestedStructT): void; unpackTo(_o: NestedStructT): void;
} }
export declare class NestedStructT implements flatbuffers.IGeneratedObject { export declare class NestedStructT implements flatbuffers.IGeneratedObject {
a: number[]; a: (number)[];
b: TestEnum; b: TestEnum;
cUnderscore: TestEnum[]; cUnderscore: (TestEnum)[];
dOuter: OuterStructT[]; dOuter: (OuterStructT)[];
e: bigint[]; e: (bigint)[];
constructor( constructor(a?: (number)[], b?: TestEnum, cUnderscore?: (TestEnum)[], dOuter?: (OuterStructT)[], e?: (bigint)[]);
a?: number[],
b?: TestEnum,
cUnderscore?: TestEnum[],
dOuter?: OuterStructT[],
e?: bigint[],
);
pack(builder: flatbuffers.Builder): flatbuffers.Offset; pack(builder: flatbuffers.Builder): flatbuffers.Offset;
} }

View File

@@ -1,6 +1,6 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
import {OuterStruct, OuterStructT} from '../../my-game/example/outer-struct.js'; import { OuterStruct, OuterStructT } from './outer-struct.js';
import {TestEnum} from '../../my-game/example/test-enum.js'; import { TestEnum } from './test-enum.js';
export class NestedStruct { export class NestedStruct {
constructor() { constructor() {
this.bb = null; this.bb = null;
@@ -21,8 +21,7 @@ export class NestedStruct {
return this.bb.readInt8(this.bb_pos + 9 + index); return this.bb.readInt8(this.bb_pos + 9 + index);
} }
dOuter(index, obj) { dOuter(index, obj) {
return (obj || new OuterStruct()) return (obj || new OuterStruct()).__init(this.bb_pos + 16 + index * 208, this.bb);
.__init(this.bb_pos + 16 + index * 208, this.bb);
} }
e(index) { e(index) {
return this.bb.readInt64(this.bb_pos + 1056 + index * 8); return this.bb.readInt64(this.bb_pos + 1056 + index * 8);
@@ -44,12 +43,7 @@ export class NestedStruct {
item.pack(builder); item.pack(builder);
continue; continue;
} }
OuterStruct.createOuterStruct( OuterStruct.createOuterStruct(builder, item?.a, item?.b, (item?.cUnderscore?.a ?? 0), (item?.cUnderscore?.b ?? []), (item?.cUnderscore?.c ?? 0), (item?.cUnderscore?.dUnderscore ?? BigInt(0)), item?.d, (item?.e?.a ?? 0), (item?.e?.b ?? []), (item?.e?.c ?? 0), (item?.e?.dUnderscore ?? BigInt(0)), item?.f);
builder, item?.a, item?.b, (item?.cUnderscore?.a ?? 0),
(item?.cUnderscore?.b ?? []), (item?.cUnderscore?.c ?? 0),
(item?.cUnderscore?.dUnderscore ?? BigInt(0)), item?.d,
(item?.e?.a ?? 0), (item?.e?.b ?? []), (item?.e?.c ?? 0),
(item?.e?.dUnderscore ?? BigInt(0)), item?.f);
} }
builder.pad(5); builder.pad(5);
for (let i = 1; i >= 0; --i) { for (let i = 1; i >= 0; --i) {
@@ -62,11 +56,7 @@ export class NestedStruct {
return builder.offset(); return builder.offset();
} }
unpack() { unpack() {
return new NestedStructT( return new NestedStructT(this.bb.createScalarList(this.a.bind(this), 2), this.b(), this.bb.createScalarList(this.cUnderscore.bind(this), 2), this.bb.createObjList(this.dOuter.bind(this), 5), this.bb.createScalarList(this.e.bind(this), 2));
this.bb.createScalarList(this.a.bind(this), 2), this.b(),
this.bb.createScalarList(this.cUnderscore.bind(this), 2),
this.bb.createObjList(this.dOuter.bind(this), 5),
this.bb.createScalarList(this.e.bind(this), 2));
} }
unpackTo(_o) { unpackTo(_o) {
_o.a = this.bb.createScalarList(this.a.bind(this), 2); _o.a = this.bb.createScalarList(this.a.bind(this), 2);
@@ -77,9 +67,7 @@ export class NestedStruct {
} }
} }
export class NestedStructT { export class NestedStructT {
constructor( constructor(a = [], b = TestEnum.A, cUnderscore = [TestEnum.A, TestEnum.A], dOuter = [], e = []) {
a = [], b = TestEnum.A, cUnderscore = [TestEnum.A, TestEnum.A],
dOuter = [], e = []) {
this.a = a; this.a = a;
this.b = b; this.b = b;
this.cUnderscore = cUnderscore; this.cUnderscore = cUnderscore;
@@ -87,7 +75,6 @@ export class NestedStructT {
this.e = e; this.e = e;
} }
pack(builder) { pack(builder) {
return NestedStruct.createNestedStruct( return NestedStruct.createNestedStruct(builder, this.a, this.b, this.cUnderscore, this.dOuter, this.e);
builder, this.a, this.b, this.cUnderscore, this.dOuter, this.e);
} }
} }

View File

@@ -4,14 +4,13 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import {OuterStruct, OuterStructT} from '../../my-game/example/outer-struct.js'; import { OuterStruct, OuterStructT } from './outer-struct.js';
import {TestEnum} from '../../my-game/example/test-enum.js'; import { TestEnum } from './test-enum.js';
export class NestedStruct
implements flatbuffers.IUnpackableObject<NestedStructT> export class NestedStruct implements flatbuffers.IUnpackableObject<NestedStructT> {
{
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):NestedStruct { __init(i:number, bb:flatbuffers.ByteBuffer):NestedStruct {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -31,17 +30,14 @@ export class NestedStruct
} }
dOuter(index: number, obj?:OuterStruct):OuterStruct|null { dOuter(index: number, obj?:OuterStruct):OuterStruct|null {
return (obj || new OuterStruct()).__init( return (obj || new OuterStruct()).__init(this.bb_pos + 16 + index * 208, this.bb!);
this.bb_pos + 16 + index * 208,
this.bb!,
);
} }
e(index: number):bigint|null { e(index: number):bigint|null {
return this.bb!.readInt64(this.bb_pos + 1056 + index * 8); return this.bb!.readInt64(this.bb_pos + 1056 + index * 8);
} }
static getFullyQualifiedName(): string { static getFullyQualifiedName(): "MyGame.Example.NestedStruct" {
return 'MyGame.Example.NestedStruct'; return 'MyGame.Example.NestedStruct';
} }
@@ -49,20 +45,14 @@ export class NestedStruct
return 1072; return 1072;
} }
static createNestedStruct( static createNestedStruct(builder:flatbuffers.Builder, a: number[], b: TestEnum, c_underscore: number[], d_outer: (any|OuterStructT)[], e: bigint[]):flatbuffers.Offset {
builder: flatbuffers.Builder,
a: number[] | null,
b: TestEnum,
c_underscore: number[] | null,
d_outer: (any | OuterStructT)[] | null,
e: bigint[] | null,
): flatbuffers.Offset {
builder.prep(8, 1072); builder.prep(8, 1072);
for (let i = 1; i >= 0; --i) { for (let i = 1; i >= 0; --i) {
builder.writeInt64(BigInt(e?.[i] ?? 0)); builder.writeInt64(BigInt(e?.[i] ?? 0));
} }
for (let i = 4; i >= 0; --i) { for (let i = 4; i >= 0; --i) {
const item = d_outer?.[i]; const item = d_outer?.[i];
@@ -71,83 +61,77 @@ export class NestedStruct
continue; continue;
} }
OuterStruct.createOuterStruct( OuterStruct.createOuterStruct(builder,
builder,
item?.a, item?.a,
item?.b, item?.b,
item?.cUnderscore?.a ?? 0, (item?.cUnderscore?.a ?? 0),
item?.cUnderscore?.b ?? [], (item?.cUnderscore?.b ?? []),
item?.cUnderscore?.c ?? 0, (item?.cUnderscore?.c ?? 0),
item?.cUnderscore?.dUnderscore ?? BigInt(0), (item?.cUnderscore?.dUnderscore ?? BigInt(0)),
item?.d, item?.d,
item?.e?.a ?? 0, (item?.e?.a ?? 0),
item?.e?.b ?? [], (item?.e?.b ?? []),
item?.e?.c ?? 0, (item?.e?.c ?? 0),
item?.e?.dUnderscore ?? BigInt(0), (item?.e?.dUnderscore ?? BigInt(0)),
item?.f, item?.f
); );
} }
builder.pad(5); builder.pad(5);
for (let i = 1; i >= 0; --i) { for (let i = 1; i >= 0; --i) {
builder.writeInt8(c_underscore?.[i] ?? 0); builder.writeInt8((c_underscore?.[i] ?? 0));
} }
builder.writeInt8(b); builder.writeInt8(b);
for (let i = 1; i >= 0; --i) { for (let i = 1; i >= 0; --i) {
builder.writeInt32(a?.[i] ?? 0); builder.writeInt32((a?.[i] ?? 0));
} }
return builder.offset(); return builder.offset();
} }
unpack(): NestedStructT { unpack(): NestedStructT {
return new NestedStructT( return new NestedStructT(
this.bb!.createScalarList<number>(this.a.bind(this), 2), this.bb!.createScalarList<number>(this.a.bind(this), 2),
this.b(), this.b(),
this.bb!.createScalarList<TestEnum>(this.cUnderscore.bind(this), 2), this.bb!.createScalarList<TestEnum>(this.cUnderscore.bind(this), 2),
this.bb!.createObjList<OuterStruct, OuterStructT>( this.bb!.createObjList<OuterStruct, OuterStructT>(this.dOuter.bind(this), 5),
this.dOuter.bind(this), this.bb!.createScalarList<bigint>(this.e.bind(this), 2)
5,
),
this.bb!.createScalarList<bigint>(this.e.bind(this), 2),
); );
} }
unpackTo(_o: NestedStructT): void { unpackTo(_o: NestedStructT): void {
_o.a = this.bb!.createScalarList<number>(this.a.bind(this), 2); _o.a = this.bb!.createScalarList<number>(this.a.bind(this), 2);
_o.b = this.b(); _o.b = this.b();
_o.cUnderscore = this.bb!.createScalarList<TestEnum>( _o.cUnderscore = this.bb!.createScalarList<TestEnum>(this.cUnderscore.bind(this), 2);
this.cUnderscore.bind(this), _o.dOuter = this.bb!.createObjList<OuterStruct, OuterStructT>(this.dOuter.bind(this), 5);
2,
);
_o.dOuter = this.bb!.createObjList<OuterStruct, OuterStructT>(
this.dOuter.bind(this),
5,
);
_o.e = this.bb!.createScalarList<bigint>(this.e.bind(this), 2); _o.e = this.bb!.createScalarList<bigint>(this.e.bind(this), 2);
} }
} }
export class NestedStructT implements flatbuffers.IGeneratedObject { export class NestedStructT implements flatbuffers.IGeneratedObject {
constructor( constructor(
public a: number[] = [], public a: (number)[] = [],
public b: TestEnum = TestEnum.A, public b: TestEnum = TestEnum.A,
public cUnderscore: TestEnum[] = [TestEnum.A, TestEnum.A], public cUnderscore: (TestEnum)[] = [TestEnum.A, TestEnum.A],
public dOuter: OuterStructT[] = [], public dOuter: (OuterStructT)[] = [],
public e: bigint[] = [], public e: (bigint)[] = []
){} ){}
pack(builder:flatbuffers.Builder): flatbuffers.Offset { pack(builder:flatbuffers.Builder): flatbuffers.Offset {
return NestedStruct.createNestedStruct( return NestedStruct.createNestedStruct(builder,
builder,
this.a, this.a,
this.b, this.b,
this.cUnderscore, this.cUnderscore,
this.dOuter, this.dOuter,
this.e, this.e
); );
} }
} }

View File

@@ -1,8 +1,6 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import {InnerStruct, InnerStructT} from '../../my-game/example/inner-struct.js'; import { InnerStruct, InnerStructT } from './inner-struct.js';
export declare class OuterStruct export declare class OuterStruct implements flatbuffers.IUnpackableObject<OuterStructT> {
implements flatbuffers.IUnpackableObject<OuterStructT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): OuterStruct; __init(i: number, bb: flatbuffers.ByteBuffer): OuterStruct;
@@ -12,23 +10,9 @@ export declare class OuterStruct
d(index: number, obj?: InnerStruct): InnerStruct | null; d(index: number, obj?: InnerStruct): InnerStruct | null;
e(obj?: InnerStruct): InnerStruct | null; e(obj?: InnerStruct): InnerStruct | null;
f(index: number): number | null; f(index: number): number | null;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.OuterStruct";
static sizeOf(): number; static sizeOf(): number;
static createOuterStruct( static createOuterStruct(builder: flatbuffers.Builder, a: boolean, b: number, c_underscore_a: number, c_underscore_b: number[], c_underscore_c: number, c_underscore_d_underscore: bigint, d: (any | InnerStructT)[], e_a: number, e_b: number[], e_c: number, e_d_underscore: bigint, f: number[]): flatbuffers.Offset;
builder: flatbuffers.Builder,
a: boolean,
b: number,
c_underscore_a: number,
c_underscore_b: number[] | null,
c_underscore_c: number,
c_underscore_d_underscore: bigint,
d: (any | InnerStructT)[] | null,
e_a: number,
e_b: number[] | null,
e_c: number,
e_d_underscore: bigint,
f: number[] | null,
): flatbuffers.Offset;
unpack(): OuterStructT; unpack(): OuterStructT;
unpackTo(_o: OuterStructT): void; unpackTo(_o: OuterStructT): void;
} }
@@ -36,16 +20,9 @@ export declare class OuterStructT implements flatbuffers.IGeneratedObject {
a: boolean; a: boolean;
b: number; b: number;
cUnderscore: InnerStructT | null; cUnderscore: InnerStructT | null;
d: InnerStructT[]; d: (InnerStructT)[];
e: InnerStructT | null; e: InnerStructT | null;
f: number[]; f: (number)[];
constructor( constructor(a?: boolean, b?: number, cUnderscore?: InnerStructT | null, d?: (InnerStructT)[], e?: InnerStructT | null, f?: (number)[]);
a?: boolean,
b?: number,
cUnderscore?: InnerStructT | null,
d?: InnerStructT[],
e?: InnerStructT | null,
f?: number[],
);
pack(builder: flatbuffers.Builder): flatbuffers.Offset; pack(builder: flatbuffers.Builder): flatbuffers.Offset;
} }

View File

@@ -1,5 +1,5 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
import {InnerStruct, InnerStructT} from '../../my-game/example/inner-struct.js'; import { InnerStruct, InnerStructT } from './inner-struct.js';
export class OuterStruct { export class OuterStruct {
constructor() { constructor() {
this.bb = null; this.bb = null;
@@ -20,8 +20,7 @@ export class OuterStruct {
return (obj || new InnerStruct()).__init(this.bb_pos + 16, this.bb); return (obj || new InnerStruct()).__init(this.bb_pos + 16, this.bb);
} }
d(index, obj) { d(index, obj) {
return (obj || new InnerStruct()) return (obj || new InnerStruct()).__init(this.bb_pos + 48 + index * 32, this.bb);
.__init(this.bb_pos + 48 + index * 32, this.bb);
} }
e(obj) { e(obj) {
return (obj || new InnerStruct()).__init(this.bb_pos + 144, this.bb); return (obj || new InnerStruct()).__init(this.bb_pos + 144, this.bb);
@@ -35,9 +34,7 @@ export class OuterStruct {
static sizeOf() { static sizeOf() {
return 208; return 208;
} }
static createOuterStruct( static createOuterStruct(builder, a, b, c_underscore_a, c_underscore_b, c_underscore_c, c_underscore_d_underscore, d, e_a, e_b, e_c, e_d_underscore, f) {
builder, a, b, c_underscore_a, c_underscore_b, c_underscore_c,
c_underscore_d_underscore, d, e_a, e_b, e_c, e_d_underscore, f) {
builder.prep(8, 208); builder.prep(8, 208);
for (let i = 3; i >= 0; --i) { for (let i = 3; i >= 0; --i) {
builder.writeFloat64((f?.[i] ?? 0)); builder.writeFloat64((f?.[i] ?? 0));
@@ -56,8 +53,7 @@ export class OuterStruct {
item.pack(builder); item.pack(builder);
continue; continue;
} }
InnerStruct.createInnerStruct( InnerStruct.createInnerStruct(builder, item?.a, item?.b, item?.c, item?.dUnderscore);
builder, item?.a, item?.b, item?.c, item?.dUnderscore);
} }
builder.prep(8, 32); builder.prep(8, 32);
builder.writeInt64(BigInt(c_underscore_d_underscore ?? 0)); builder.writeInt64(BigInt(c_underscore_d_underscore ?? 0));
@@ -73,26 +69,19 @@ export class OuterStruct {
return builder.offset(); return builder.offset();
} }
unpack() { unpack() {
return new OuterStructT( return new OuterStructT(this.a(), this.b(), (this.cUnderscore() !== null ? this.cUnderscore().unpack() : null), this.bb.createObjList(this.d.bind(this), 3), (this.e() !== null ? this.e().unpack() : null), this.bb.createScalarList(this.f.bind(this), 4));
this.a(), this.b(),
(this.cUnderscore() !== null ? this.cUnderscore().unpack() : null),
this.bb.createObjList(this.d.bind(this), 3),
(this.e() !== null ? this.e().unpack() : null),
this.bb.createScalarList(this.f.bind(this), 4));
} }
unpackTo(_o) { unpackTo(_o) {
_o.a = this.a(); _o.a = this.a();
_o.b = this.b(); _o.b = this.b();
_o.cUnderscore = _o.cUnderscore = (this.cUnderscore() !== null ? this.cUnderscore().unpack() : null);
(this.cUnderscore() !== null ? this.cUnderscore().unpack() : null);
_o.d = this.bb.createObjList(this.d.bind(this), 3); _o.d = this.bb.createObjList(this.d.bind(this), 3);
_o.e = (this.e() !== null ? this.e().unpack() : null); _o.e = (this.e() !== null ? this.e().unpack() : null);
_o.f = this.bb.createScalarList(this.f.bind(this), 4); _o.f = this.bb.createScalarList(this.f.bind(this), 4);
} }
} }
export class OuterStructT { export class OuterStructT {
constructor( constructor(a = false, b = 0.0, cUnderscore = null, d = [], e = null, f = []) {
a = false, b = 0.0, cUnderscore = null, d = [], e = null, f = []) {
this.a = a; this.a = a;
this.b = b; this.b = b;
this.cUnderscore = cUnderscore; this.cUnderscore = cUnderscore;
@@ -101,11 +90,6 @@ export class OuterStructT {
this.f = f; this.f = f;
} }
pack(builder) { pack(builder) {
return OuterStruct.createOuterStruct( return OuterStruct.createOuterStruct(builder, this.a, this.b, (this.cUnderscore?.a ?? 0), (this.cUnderscore?.b ?? []), (this.cUnderscore?.c ?? 0), (this.cUnderscore?.dUnderscore ?? BigInt(0)), this.d, (this.e?.a ?? 0), (this.e?.b ?? []), (this.e?.c ?? 0), (this.e?.dUnderscore ?? BigInt(0)), this.f);
builder, this.a, this.b, (this.cUnderscore?.a ?? 0),
(this.cUnderscore?.b ?? []), (this.cUnderscore?.c ?? 0),
(this.cUnderscore?.dUnderscore ?? BigInt(0)), this.d, (this.e?.a ?? 0),
(this.e?.b ?? []), (this.e?.c ?? 0), (this.e?.dUnderscore ?? BigInt(0)),
this.f);
} }
} }

View File

@@ -4,13 +4,12 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import {InnerStruct, InnerStructT} from '../../my-game/example/inner-struct.js'; import { InnerStruct, InnerStructT } from './inner-struct.js';
export class OuterStruct
implements flatbuffers.IUnpackableObject<OuterStructT> export class OuterStruct implements flatbuffers.IUnpackableObject<OuterStructT> {
{
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):OuterStruct { __init(i:number, bb:flatbuffers.ByteBuffer):OuterStruct {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -30,10 +29,7 @@ export class OuterStruct
} }
d(index: number, obj?:InnerStruct):InnerStruct|null { d(index: number, obj?:InnerStruct):InnerStruct|null {
return (obj || new InnerStruct()).__init( return (obj || new InnerStruct()).__init(this.bb_pos + 48 + index * 32, this.bb!);
this.bb_pos + 48 + index * 32,
this.bb!,
);
} }
e(obj?:InnerStruct):InnerStruct|null { e(obj?:InnerStruct):InnerStruct|null {
@@ -44,7 +40,7 @@ export class OuterStruct
return this.bb!.readFloat64(this.bb_pos + 176 + index * 8); return this.bb!.readFloat64(this.bb_pos + 176 + index * 8);
} }
static getFullyQualifiedName(): string { static getFullyQualifiedName(): "MyGame.Example.OuterStruct" {
return 'MyGame.Example.OuterStruct'; return 'MyGame.Example.OuterStruct';
} }
@@ -52,25 +48,12 @@ export class OuterStruct
return 208; return 208;
} }
static createOuterStruct( static createOuterStruct(builder:flatbuffers.Builder, a: boolean, b: number, c_underscore_a: number, c_underscore_b: number[], c_underscore_c: number, c_underscore_d_underscore: bigint, d: (any|InnerStructT)[], e_a: number, e_b: number[], e_c: number, e_d_underscore: bigint, f: number[]):flatbuffers.Offset {
builder: flatbuffers.Builder,
a: boolean,
b: number,
c_underscore_a: number,
c_underscore_b: number[] | null,
c_underscore_c: number,
c_underscore_d_underscore: bigint,
d: (any | InnerStructT)[] | null,
e_a: number,
e_b: number[] | null,
e_c: number,
e_d_underscore: bigint,
f: number[] | null,
): flatbuffers.Offset {
builder.prep(8, 208); builder.prep(8, 208);
for (let i = 3; i >= 0; --i) { for (let i = 3; i >= 0; --i) {
builder.writeFloat64(f?.[i] ?? 0); builder.writeFloat64((f?.[i] ?? 0));
} }
builder.prep(8, 32); builder.prep(8, 32);
@@ -79,7 +62,8 @@ export class OuterStruct
builder.writeInt8(e_c); builder.writeInt8(e_c);
for (let i = 12; i >= 0; --i) { for (let i = 12; i >= 0; --i) {
builder.writeInt8(e_b?.[i] ?? 0); builder.writeInt8((e_b?.[i] ?? 0));
} }
builder.writeFloat64(e_a); builder.writeFloat64(e_a);
@@ -92,12 +76,11 @@ export class OuterStruct
continue; continue;
} }
InnerStruct.createInnerStruct( InnerStruct.createInnerStruct(builder,
builder,
item?.a, item?.a,
item?.b, item?.b,
item?.c, item?.c,
item?.dUnderscore, item?.dUnderscore
); );
} }
@@ -107,7 +90,8 @@ export class OuterStruct
builder.writeInt8(c_underscore_c); builder.writeInt8(c_underscore_c);
for (let i = 12; i >= 0; --i) { for (let i = 12; i >= 0; --i) {
builder.writeInt8(c_underscore_b?.[i] ?? 0); builder.writeInt8((c_underscore_b?.[i] ?? 0));
} }
builder.writeFloat64(c_underscore_a); builder.writeFloat64(c_underscore_a);
@@ -117,27 +101,25 @@ export class OuterStruct
return builder.offset(); return builder.offset();
} }
unpack(): OuterStructT { unpack(): OuterStructT {
return new OuterStructT( return new OuterStructT(
this.a(), this.a(),
this.b(), this.b(),
this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null, (this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null),
this.bb!.createObjList<InnerStruct, InnerStructT>(this.d.bind(this), 3), this.bb!.createObjList<InnerStruct, InnerStructT>(this.d.bind(this), 3),
this.e() !== null ? this.e()!.unpack() : null, (this.e() !== null ? this.e()!.unpack() : null),
this.bb!.createScalarList<number>(this.f.bind(this), 4), this.bb!.createScalarList<number>(this.f.bind(this), 4)
); );
} }
unpackTo(_o: OuterStructT): void { unpackTo(_o: OuterStructT): void {
_o.a = this.a(); _o.a = this.a();
_o.b = this.b(); _o.b = this.b();
_o.cUnderscore = _o.cUnderscore = (this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null);
this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null; _o.d = this.bb!.createObjList<InnerStruct, InnerStructT>(this.d.bind(this), 3);
_o.d = this.bb!.createObjList<InnerStruct, InnerStructT>( _o.e = (this.e() !== null ? this.e()!.unpack() : null);
this.d.bind(this),
3,
);
_o.e = this.e() !== null ? this.e()!.unpack() : null;
_o.f = this.bb!.createScalarList<number>(this.f.bind(this), 4); _o.f = this.bb!.createScalarList<number>(this.f.bind(this), 4);
} }
} }
@@ -147,26 +129,26 @@ export class OuterStructT implements flatbuffers.IGeneratedObject {
public a: boolean = false, public a: boolean = false,
public b: number = 0.0, public b: number = 0.0,
public cUnderscore: InnerStructT|null = null, public cUnderscore: InnerStructT|null = null,
public d: InnerStructT[] = [], public d: (InnerStructT)[] = [],
public e: InnerStructT|null = null, public e: InnerStructT|null = null,
public f: number[] = [], public f: (number)[] = []
){} ){}
pack(builder:flatbuffers.Builder): flatbuffers.Offset { pack(builder:flatbuffers.Builder): flatbuffers.Offset {
return OuterStruct.createOuterStruct( return OuterStruct.createOuterStruct(builder,
builder,
this.a, this.a,
this.b, this.b,
this.cUnderscore?.a ?? 0, (this.cUnderscore?.a ?? 0),
this.cUnderscore?.b ?? [], (this.cUnderscore?.b ?? []),
this.cUnderscore?.c ?? 0, (this.cUnderscore?.c ?? 0),
this.cUnderscore?.dUnderscore ?? BigInt(0), (this.cUnderscore?.dUnderscore ?? BigInt(0)),
this.d, this.d,
this.e?.a ?? 0, (this.e?.a ?? 0),
this.e?.b ?? [], (this.e?.b ?? []),
this.e?.c ?? 0, (this.e?.c ?? 0),
this.e?.dUnderscore ?? BigInt(0), (this.e?.dUnderscore ?? BigInt(0)),
this.f, this.f
); );
} }
} }

View File

@@ -1,5 +1,5 @@
export declare enum TestEnum { export declare enum TestEnum {
A = 0, A = 0,
B = 1, B = 1,
C = 2, C = 2
} }

View File

@@ -1,9 +1,8 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export var TestEnum; export var TestEnum;
(function (TestEnum) { (function (TestEnum) {
TestEnum[TestEnum['A'] = 0] = 'A'; TestEnum[TestEnum["A"] = 0] = "A";
TestEnum[TestEnum['B'] = 1] = 'B'; TestEnum[TestEnum["B"] = 1] = "B";
TestEnum[TestEnum['C'] = 2] = 'C'; TestEnum[TestEnum["C"] = 2] = "C";
})(TestEnum || (TestEnum = {})); })(TestEnum || (TestEnum = {}));

View File

@@ -5,5 +5,5 @@
export enum TestEnum { export enum TestEnum {
A = 0, A = 0,
B = 1, B = 1,
C = 2, C = 2
} }

View File

@@ -4,9 +4,11 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export class Person { export class Person {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):Person { __init(i:number, bb:flatbuffers.ByteBuffer):Person {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -14,30 +16,19 @@ export class Person {
} }
static getRootAsPerson(bb:flatbuffers.ByteBuffer, obj?:Person):Person { static getRootAsPerson(bb:flatbuffers.ByteBuffer, obj?:Person):Person {
return (obj || new Person()).__init( return (obj || new Person()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
bb.readInt32(bb.position()) + bb.position(),
bb,
);
} }
static getSizePrefixedRootAsPerson( static getSizePrefixedRootAsPerson(bb:flatbuffers.ByteBuffer, obj?:Person):Person {
bb: flatbuffers.ByteBuffer,
obj?: Person,
): Person {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new Person()).__init( return (obj || new Person()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
bb.readInt32(bb.position()) + bb.position(),
bb,
);
} }
name(): string | null; name():string|null
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
name(optionalEncoding?:any):string|Uint8Array|null { name(optionalEncoding?:any):string|Uint8Array|null {
const offset = this.bb!.__offset(this.bb_pos, 4); const offset = this.bb!.__offset(this.bb_pos, 4);
return offset return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
: null;
} }
age():number { age():number {
@@ -45,15 +36,15 @@ export class Person {
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0; return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
} }
static startPerson(builder: flatbuffers.Builder) { static startPerson(builder:flatbuffers.Builder):void {
builder.startObject(2); builder.startObject(2);
} }
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) { static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset):void {
builder.addFieldOffset(0, nameOffset, 0); builder.addFieldOffset(0, nameOffset, 0);
} }
static addAge(builder: flatbuffers.Builder, age: number) { static addAge(builder:flatbuffers.Builder, age:number):void {
builder.addFieldInt16(1, age, 0); builder.addFieldInt16(1, age, 0);
} }
@@ -62,25 +53,15 @@ export class Person {
return offset; return offset;
} }
static finishPersonBuffer( static finishPersonBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
builder: flatbuffers.Builder,
offset: flatbuffers.Offset,
) {
builder.finish(offset); builder.finish(offset);
} }
static finishSizePrefixedPersonBuffer( static finishSizePrefixedPersonBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
builder: flatbuffers.Builder,
offset: flatbuffers.Offset,
) {
builder.finish(offset, undefined, true); builder.finish(offset, undefined, true);
} }
static createPerson( static createPerson(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset, age:number):flatbuffers.Offset {
builder: flatbuffers.Builder,
nameOffset: flatbuffers.Offset,
age: number,
): flatbuffers.Offset {
Person.startPerson(builder); Person.startPerson(builder);
Person.addName(builder, nameOffset); Person.addName(builder, nameOffset);
Person.addAge(builder, age); Person.addAge(builder, age);

View File

@@ -0,0 +1,473 @@
// automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers';
import { ABC } from './abc.js';
import { EvenMoreStruct, EvenMoreStructT } from './even-more-struct.js';
export class EvenMoreDefaults implements flatbuffers.IUnpackableObject<EvenMoreDefaultsT> {
bb: flatbuffers.ByteBuffer|null = null;
bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):EvenMoreDefaults {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsEvenMoreDefaults(bb:flatbuffers.ByteBuffer, obj?:EvenMoreDefaults):EvenMoreDefaults {
return (obj || new EvenMoreDefaults()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsEvenMoreDefaults(bb:flatbuffers.ByteBuffer, obj?:EvenMoreDefaults):EvenMoreDefaults {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new EvenMoreDefaults()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
str(obj?:EvenMoreStruct):EvenMoreStruct|null {
const offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? (obj || new EvenMoreStruct()).__init(this.bb_pos + offset, this.bb!) : null;
}
ints(index: number):number|null {
const offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? this.bb!.readInt32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;
}
intsLength():number {
const offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
intsArray():Int32Array {
const offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? new Int32Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : new Int32Array();
}
floats(index: number):number|null {
const offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? this.bb!.readFloat32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;
}
floatsLength():number {
const offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
floatsArray():Float32Array {
const offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? new Float32Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : new Float32Array();
}
floatOptional(index: number):number|null {
const offset = this.bb!.__offset(this.bb_pos, 10);
return offset ? this.bb!.readFloat32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;
}
floatOptionalLength():number {
const offset = this.bb!.__offset(this.bb_pos, 10);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
floatOptionalArray():Float32Array|null {
const offset = this.bb!.__offset(this.bb_pos, 10);
return offset ? new Float32Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
}
bytesOptional(index: number):number|null {
const offset = this.bb!.__offset(this.bb_pos, 12);
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}
bytesOptionalLength():number {
const offset = this.bb!.__offset(this.bb_pos, 12);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
bytesOptionalArray():Uint8Array|null {
const offset = this.bb!.__offset(this.bb_pos, 12);
return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
}
floatsRequired(index: number):number|null {
const offset = this.bb!.__offset(this.bb_pos, 14);
return offset ? this.bb!.readFloat32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;
}
floatsRequiredLength():number {
const offset = this.bb!.__offset(this.bb_pos, 14);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
floatsRequiredArray():Float32Array {
const offset = this.bb!.__offset(this.bb_pos, 14);
return new Float32Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset));
}
emptyString():string
emptyString(optionalEncoding:flatbuffers.Encoding):string|Uint8Array
emptyString(optionalEncoding?:any):string|Uint8Array {
const offset = this.bb!.__offset(this.bb_pos, 16);
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : "";
}
someString():string
someString(optionalEncoding:flatbuffers.Encoding):string|Uint8Array
someString(optionalEncoding?:any):string|Uint8Array {
const offset = this.bb!.__offset(this.bb_pos, 18);
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : "some";
}
zeroString():string|null
zeroString(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
zeroString(optionalEncoding?:any):string|Uint8Array|null {
const offset = this.bb!.__offset(this.bb_pos, 20);
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}
aString():string
aString(optionalEncoding:flatbuffers.Encoding):string|Uint8Array
aString(optionalEncoding?:any):string|Uint8Array {
const offset = this.bb!.__offset(this.bb_pos, 22);
return this.bb!.__string(this.bb_pos + offset, optionalEncoding);
}
requiredString():string
requiredString(optionalEncoding:flatbuffers.Encoding):string|Uint8Array
requiredString(optionalEncoding?:any):string|Uint8Array {
const offset = this.bb!.__offset(this.bb_pos, 24);
return this.bb!.__string(this.bb_pos + offset, optionalEncoding);
}
abcs(index: number):ABC|null {
const offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? this.bb!.readInt32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : null;
}
abcsLength():number {
const offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
abcsArray():Int32Array {
const offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? new Int32Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : new Int32Array();
}
bools(index: number):boolean|null {
const offset = this.bb!.__offset(this.bb_pos, 28);
return offset ? !!this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : false;
}
boolsLength():number {
const offset = this.bb!.__offset(this.bb_pos, 28);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
boolsArray():Int8Array {
const offset = this.bb!.__offset(this.bb_pos, 28);
return offset ? new Int8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : new Int8Array();
}
oneBool():boolean {
const offset = this.bb!.__offset(this.bb_pos, 30);
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : true;
}
mutate_one_bool(value:boolean):boolean {
const offset = this.bb!.__offset(this.bb_pos, 30);
if (offset === 0) {
return false;
}
this.bb!.writeInt8(this.bb_pos + offset, +value);
return true;
}
static getFullyQualifiedName(): "EvenMoreDefaults" {
return 'EvenMoreDefaults';
}
static startEvenMoreDefaults(builder:flatbuffers.Builder):void {
builder.startObject(14);
}
static addStr(builder:flatbuffers.Builder, strOffset:flatbuffers.Offset):void {
builder.addFieldStruct(0, strOffset, 0);
}
static addInts(builder:flatbuffers.Builder, intsOffset:flatbuffers.Offset):void {
builder.addFieldOffset(1, intsOffset, 0);
}
static createIntsVector(builder:flatbuffers.Builder, data:number[]|Int32Array):flatbuffers.Offset;
/**
* @deprecated This Uint8Array overload will be removed in the future.
*/
static createIntsVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
static createIntsVector(builder:flatbuffers.Builder, data:number[]|Int32Array|Uint8Array):flatbuffers.Offset {
builder.startVector(4, data.length, 4);
for (let i = data.length - 1; i >= 0; i--) {
builder.addInt32(data[i]!);
}
return builder.endVector();
}
static startIntsVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 4);
}
static addFloats(builder:flatbuffers.Builder, floatsOffset:flatbuffers.Offset):void {
builder.addFieldOffset(2, floatsOffset, 0);
}
static createFloatsVector(builder:flatbuffers.Builder, data:number[]|Float32Array):flatbuffers.Offset;
/**
* @deprecated This Uint8Array overload will be removed in the future.
*/
static createFloatsVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
static createFloatsVector(builder:flatbuffers.Builder, data:number[]|Float32Array|Uint8Array):flatbuffers.Offset {
builder.startVector(4, data.length, 4);
for (let i = data.length - 1; i >= 0; i--) {
builder.addFloat32(data[i]!);
}
return builder.endVector();
}
static startFloatsVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 4);
}
static addFloatOptional(builder:flatbuffers.Builder, floatOptionalOffset:flatbuffers.Offset):void {
builder.addFieldOffset(3, floatOptionalOffset, 0);
}
static createFloatOptionalVector(builder:flatbuffers.Builder, data:number[]|Float32Array):flatbuffers.Offset;
/**
* @deprecated This Uint8Array overload will be removed in the future.
*/
static createFloatOptionalVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
static createFloatOptionalVector(builder:flatbuffers.Builder, data:number[]|Float32Array|Uint8Array):flatbuffers.Offset {
builder.startVector(4, data.length, 4);
for (let i = data.length - 1; i >= 0; i--) {
builder.addFloat32(data[i]!);
}
return builder.endVector();
}
static startFloatOptionalVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 4);
}
static addBytesOptional(builder:flatbuffers.Builder, bytesOptionalOffset:flatbuffers.Offset):void {
builder.addFieldOffset(4, bytesOptionalOffset, 0);
}
static createBytesOptionalVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
builder.startVector(1, data.length, 1);
for (let i = data.length - 1; i >= 0; i--) {
builder.addInt8(data[i]!);
}
return builder.endVector();
}
static startBytesOptionalVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(1, numElems, 1);
}
static addFloatsRequired(builder:flatbuffers.Builder, floatsRequiredOffset:flatbuffers.Offset):void {
builder.addFieldOffset(5, floatsRequiredOffset, 0);
}
static createFloatsRequiredVector(builder:flatbuffers.Builder, data:number[]|Float32Array):flatbuffers.Offset;
/**
* @deprecated This Uint8Array overload will be removed in the future.
*/
static createFloatsRequiredVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
static createFloatsRequiredVector(builder:flatbuffers.Builder, data:number[]|Float32Array|Uint8Array):flatbuffers.Offset {
builder.startVector(4, data.length, 4);
for (let i = data.length - 1; i >= 0; i--) {
builder.addFloat32(data[i]!);
}
return builder.endVector();
}
static startFloatsRequiredVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 4);
}
static addEmptyString(builder:flatbuffers.Builder, emptyStringOffset:flatbuffers.Offset):void {
builder.addFieldOffset(6, emptyStringOffset, 0);
}
static addSomeString(builder:flatbuffers.Builder, someStringOffset:flatbuffers.Offset):void {
builder.addFieldOffset(7, someStringOffset, 0);
}
static addZeroString(builder:flatbuffers.Builder, zeroStringOffset:flatbuffers.Offset):void {
builder.addFieldOffset(8, zeroStringOffset, 0);
}
static addAString(builder:flatbuffers.Builder, aStringOffset:flatbuffers.Offset):void {
builder.addFieldOffset(9, aStringOffset, 0);
}
static addRequiredString(builder:flatbuffers.Builder, requiredStringOffset:flatbuffers.Offset):void {
builder.addFieldOffset(10, requiredStringOffset, 0);
}
static addAbcs(builder:flatbuffers.Builder, abcsOffset:flatbuffers.Offset):void {
builder.addFieldOffset(11, abcsOffset, 0);
}
static createAbcsVector(builder:flatbuffers.Builder, data:ABC[]):flatbuffers.Offset {
builder.startVector(4, data.length, 4);
for (let i = data.length - 1; i >= 0; i--) {
builder.addInt32(data[i]!);
}
return builder.endVector();
}
static startAbcsVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 4);
}
static addBools(builder:flatbuffers.Builder, boolsOffset:flatbuffers.Offset):void {
builder.addFieldOffset(12, boolsOffset, 0);
}
static createBoolsVector(builder:flatbuffers.Builder, data:boolean[]):flatbuffers.Offset {
builder.startVector(1, data.length, 1);
for (let i = data.length - 1; i >= 0; i--) {
builder.addInt8(+data[i]!);
}
return builder.endVector();
}
static startBoolsVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(1, numElems, 1);
}
static addOneBool(builder:flatbuffers.Builder, oneBool:boolean):void {
builder.addFieldInt8(13, +oneBool, +true);
}
static endEvenMoreDefaults(builder:flatbuffers.Builder):flatbuffers.Offset {
const offset = builder.endObject();
builder.requiredField(offset, 14) // floats_required
builder.requiredField(offset, 22) // a_string
builder.requiredField(offset, 24) // required_string
return offset;
}
static createEvenMoreDefaults(builder:flatbuffers.Builder, strOffset:flatbuffers.Offset, intsOffset:flatbuffers.Offset, floatsOffset:flatbuffers.Offset, floatOptionalOffset:flatbuffers.Offset, bytesOptionalOffset:flatbuffers.Offset, floatsRequiredOffset:flatbuffers.Offset, emptyStringOffset:flatbuffers.Offset, someStringOffset:flatbuffers.Offset, zeroStringOffset:flatbuffers.Offset, aStringOffset:flatbuffers.Offset, requiredStringOffset:flatbuffers.Offset, abcsOffset:flatbuffers.Offset, boolsOffset:flatbuffers.Offset, oneBool:boolean):flatbuffers.Offset {
EvenMoreDefaults.startEvenMoreDefaults(builder);
EvenMoreDefaults.addStr(builder, strOffset);
EvenMoreDefaults.addInts(builder, intsOffset);
EvenMoreDefaults.addFloats(builder, floatsOffset);
EvenMoreDefaults.addFloatOptional(builder, floatOptionalOffset);
EvenMoreDefaults.addBytesOptional(builder, bytesOptionalOffset);
EvenMoreDefaults.addFloatsRequired(builder, floatsRequiredOffset);
EvenMoreDefaults.addEmptyString(builder, emptyStringOffset);
EvenMoreDefaults.addSomeString(builder, someStringOffset);
EvenMoreDefaults.addZeroString(builder, zeroStringOffset);
EvenMoreDefaults.addAString(builder, aStringOffset);
EvenMoreDefaults.addRequiredString(builder, requiredStringOffset);
EvenMoreDefaults.addAbcs(builder, abcsOffset);
EvenMoreDefaults.addBools(builder, boolsOffset);
EvenMoreDefaults.addOneBool(builder, oneBool);
return EvenMoreDefaults.endEvenMoreDefaults(builder);
}
unpack(): EvenMoreDefaultsT {
return new EvenMoreDefaultsT(
(this.str() !== null ? this.str()!.unpack() : null),
this.bb!.createScalarList<number>(this.ints.bind(this), this.intsLength()),
this.bb!.createScalarList<number>(this.floats.bind(this), this.floatsLength()),
this.bb!.createScalarList<number>(this.floatOptional.bind(this), this.floatOptionalLength()),
this.bb!.createScalarList<number>(this.bytesOptional.bind(this), this.bytesOptionalLength()),
this.bb!.createScalarList<number>(this.floatsRequired.bind(this), this.floatsRequiredLength()),
this.emptyString(),
this.someString(),
this.zeroString(),
this.aString(),
this.requiredString(),
this.bb!.createScalarList<ABC>(this.abcs.bind(this), this.abcsLength()),
this.bb!.createScalarList<boolean>(this.bools.bind(this), this.boolsLength()),
this.oneBool()
);
}
unpackTo(_o: EvenMoreDefaultsT): void {
_o.str = (this.str() !== null ? this.str()!.unpack() : null);
_o.ints = this.bb!.createScalarList<number>(this.ints.bind(this), this.intsLength());
_o.floats = this.bb!.createScalarList<number>(this.floats.bind(this), this.floatsLength());
_o.floatOptional = this.bb!.createScalarList<number>(this.floatOptional.bind(this), this.floatOptionalLength());
_o.bytesOptional = this.bb!.createScalarList<number>(this.bytesOptional.bind(this), this.bytesOptionalLength());
_o.floatsRequired = this.bb!.createScalarList<number>(this.floatsRequired.bind(this), this.floatsRequiredLength());
_o.emptyString = this.emptyString();
_o.someString = this.someString();
_o.zeroString = this.zeroString();
_o.aString = this.aString();
_o.requiredString = this.requiredString();
_o.abcs = this.bb!.createScalarList<ABC>(this.abcs.bind(this), this.abcsLength());
_o.bools = this.bb!.createScalarList<boolean>(this.bools.bind(this), this.boolsLength());
_o.oneBool = this.oneBool();
}
}
export class EvenMoreDefaultsT implements flatbuffers.IGeneratedObject {
constructor(
public str: EvenMoreStructT|null = null,
public ints: (number)[] = [],
public floats: (number)[] = [],
public floatOptional: (number)[] = [],
public bytesOptional: (number)[] = [],
public floatsRequired: (number)[] = [],
public emptyString: string|Uint8Array = "",
public someString: string|Uint8Array = "some",
public zeroString: string|Uint8Array|null = null,
public aString: string|Uint8Array|null = null,
public requiredString: string|Uint8Array|null = null,
public abcs: (ABC)[] = [],
public bools: (boolean)[] = [],
public oneBool: boolean = true
){}
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
const ints = EvenMoreDefaults.createIntsVector(builder, this.ints);
const floats = EvenMoreDefaults.createFloatsVector(builder, this.floats);
const floatOptional = EvenMoreDefaults.createFloatOptionalVector(builder, this.floatOptional);
const bytesOptional = EvenMoreDefaults.createBytesOptionalVector(builder, this.bytesOptional);
const floatsRequired = EvenMoreDefaults.createFloatsRequiredVector(builder, this.floatsRequired);
const emptyString = (this.emptyString !== null ? builder.createString(this.emptyString!) : 0);
const someString = (this.someString !== null ? builder.createString(this.someString!) : 0);
const zeroString = (this.zeroString !== null ? builder.createString(this.zeroString!) : 0);
const aString = (this.aString !== null ? builder.createString(this.aString!) : 0);
const requiredString = (this.requiredString !== null ? builder.createString(this.requiredString!) : 0);
const abcs = EvenMoreDefaults.createAbcsVector(builder, this.abcs);
const bools = EvenMoreDefaults.createBoolsVector(builder, this.bools);
return EvenMoreDefaults.createEvenMoreDefaults(builder,
(this.str !== null ? this.str!.pack(builder) : 0),
ints,
floats,
floatOptional,
bytesOptional,
floatsRequired,
emptyString,
someString,
zeroString,
aString,
requiredString,
abcs,
bools,
this.oneBool
);
}
}

View File

@@ -0,0 +1,64 @@
// automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers';
export class EvenMoreStruct implements flatbuffers.IUnpackableObject<EvenMoreStructT> {
bb: flatbuffers.ByteBuffer|null = null;
bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):EvenMoreStruct {
this.bb_pos = i;
this.bb = bb;
return this;
}
g(index: number):bigint|null {
return this.bb!.readInt64(this.bb_pos + 0 + index * 8);
}
static getFullyQualifiedName(): "EvenMoreStruct" {
return 'EvenMoreStruct';
}
static sizeOf():number {
return 16;
}
static createEvenMoreStruct(builder:flatbuffers.Builder, g: bigint[]):flatbuffers.Offset {
builder.prep(8, 16);
for (let i = 1; i >= 0; --i) {
builder.writeInt64(BigInt(g?.[i] ?? 0));
}
return builder.offset();
}
unpack(): EvenMoreStructT {
return new EvenMoreStructT(
this.bb!.createScalarList<bigint>(this.g.bind(this), 2)
);
}
unpackTo(_o: EvenMoreStructT): void {
_o.g = this.bb!.createScalarList<bigint>(this.g.bind(this), 2);
}
}
export class EvenMoreStructT implements flatbuffers.IGeneratedObject {
constructor(
public g: (bigint)[] = []
){}
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
return EvenMoreStruct.createEvenMoreStruct(builder,
this.g
);
}
}

View File

@@ -0,0 +1,7 @@
// automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
export { ABC } from './abc.js';
export { EvenMoreDefaults, EvenMoreDefaultsT } from './even-more-defaults.js';
export { EvenMoreStruct, EvenMoreStructT } from './even-more-struct.js';

View File

@@ -1,4 +1,3 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export { Abc } from './foobar/abc.js'; export { Abc } from './foobar/abc.js';

View File

@@ -1,3 +1,3 @@
export declare enum Abc { export declare enum Abc {
a = 0, a = 0
} }

View File

@@ -1,7 +1,6 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export var Abc; export var Abc;
(function (Abc) { (function (Abc) {
Abc[Abc['a'] = 0] = 'a'; Abc[Abc["a"] = 0] = "a";
})(Abc || (Abc = {})); })(Abc || (Abc = {}));

View File

@@ -3,5 +3,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
export enum Abc { export enum Abc {
a = 0, a = 0
} }

View File

@@ -1,3 +1,3 @@
export declare enum class_ { export declare enum class_ {
arguments_ = 0, arguments_ = 0
} }

View File

@@ -1,7 +1,6 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export var class_; export var class_;
(function (class_) { (function (class_) {
class_[class_['arguments_'] = 0] = 'arguments_'; class_[class_["arguments_"] = 0] = "arguments_";
})(class_ || (class_ = {})); })(class_ || (class_ = {}));

View File

@@ -3,5 +3,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
export enum class_ { export enum class_ {
arguments_ = 0, arguments_ = 0
} }

View File

@@ -4,12 +4,13 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import {Abc} from '../foobar/abc.js'; import { Abc } from './abc.js';
import {class_} from '../foobar/class.js'; import { class_ } from './class.js';
export class Tab implements flatbuffers.IUnpackableObject<TabT> { export class Tab implements flatbuffers.IUnpackableObject<TabT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):Tab { __init(i:number, bb:flatbuffers.ByteBuffer):Tab {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -17,18 +18,12 @@ export class Tab implements flatbuffers.IUnpackableObject<TabT> {
} }
static getRootAsTab(bb:flatbuffers.ByteBuffer, obj?:Tab):Tab { static getRootAsTab(bb:flatbuffers.ByteBuffer, obj?:Tab):Tab {
return (obj || new Tab()).__init( return (obj || new Tab()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
bb.readInt32(bb.position()) + bb.position(),
bb,
);
} }
static getSizePrefixedRootAsTab(bb:flatbuffers.ByteBuffer, obj?:Tab):Tab { static getSizePrefixedRootAsTab(bb:flatbuffers.ByteBuffer, obj?:Tab):Tab {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new Tab()).__init( return (obj || new Tab()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
bb.readInt32(bb.position()) + bb.position(),
bb,
);
} }
abc():Abc { abc():Abc {
@@ -49,9 +44,7 @@ export class Tab implements flatbuffers.IUnpackableObject<TabT> {
arg():class_ { arg():class_ {
const offset = this.bb!.__offset(this.bb_pos, 6); const offset = this.bb!.__offset(this.bb_pos, 6);
return offset return offset ? this.bb!.readInt32(this.bb_pos + offset) : class_.arguments_;
? this.bb!.readInt32(this.bb_pos + offset)
: class_.arguments_;
} }
mutate_arg(value:class_):boolean { mutate_arg(value:class_):boolean {
@@ -65,32 +58,30 @@ export class Tab implements flatbuffers.IUnpackableObject<TabT> {
return true; return true;
} }
name(): string | null; name():string|null
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
name(optionalEncoding?:any):string|Uint8Array|null { name(optionalEncoding?:any):string|Uint8Array|null {
const offset = this.bb!.__offset(this.bb_pos, 8); const offset = this.bb!.__offset(this.bb_pos, 8);
return offset return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
: null;
} }
static getFullyQualifiedName(): string { static getFullyQualifiedName(): "foobar.Tab" {
return 'foobar.Tab'; return 'foobar.Tab';
} }
static startTab(builder: flatbuffers.Builder) { static startTab(builder:flatbuffers.Builder):void {
builder.startObject(3); builder.startObject(3);
} }
static addAbc(builder: flatbuffers.Builder, abc: Abc) { static addAbc(builder:flatbuffers.Builder, abc:Abc):void {
builder.addFieldInt32(0, abc, Abc.a); builder.addFieldInt32(0, abc, Abc.a);
} }
static addArg(builder: flatbuffers.Builder, arg: class_) { static addArg(builder:flatbuffers.Builder, arg:class_):void {
builder.addFieldInt32(1, arg, class_.arguments_); builder.addFieldInt32(1, arg, class_.arguments_);
} }
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) { static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset):void {
builder.addFieldOffset(2, nameOffset, 0); builder.addFieldOffset(2, nameOffset, 0);
} }
@@ -99,12 +90,7 @@ export class Tab implements flatbuffers.IUnpackableObject<TabT> {
return offset; return offset;
} }
static createTab( static createTab(builder:flatbuffers.Builder, abc:Abc, arg:class_, nameOffset:flatbuffers.Offset):flatbuffers.Offset {
builder: flatbuffers.Builder,
abc: Abc,
arg: class_,
nameOffset: flatbuffers.Offset,
): flatbuffers.Offset {
Tab.startTab(builder); Tab.startTab(builder);
Tab.addAbc(builder, abc); Tab.addAbc(builder, abc);
Tab.addArg(builder, arg); Tab.addArg(builder, arg);
@@ -113,9 +99,14 @@ export class Tab implements flatbuffers.IUnpackableObject<TabT> {
} }
unpack(): TabT { unpack(): TabT {
return new TabT(this.abc(), this.arg(), this.name()); return new TabT(
this.abc(),
this.arg(),
this.name()
);
} }
unpackTo(_o: TabT): void { unpackTo(_o: TabT): void {
_o.abc = this.abc(); _o.abc = this.abc();
_o.arg = this.arg(); _o.arg = this.arg();
@@ -127,12 +118,17 @@ export class TabT implements flatbuffers.IGeneratedObject {
constructor( constructor(
public abc: Abc = Abc.a, public abc: Abc = Abc.a,
public arg: class_ = class_.arguments_, public arg: class_ = class_.arguments_,
public name: string | Uint8Array | null = null, public name: string|Uint8Array|null = null
){} ){}
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
const name = this.name !== null ? builder.createString(this.name!) : 0;
return Tab.createTab(builder, this.abc, this.arg, name); pack(builder:flatbuffers.Builder): flatbuffers.Offset {
const name = (this.name !== null ? builder.createString(this.name!) : 0);
return Tab.createTab(builder,
this.abc,
this.arg,
name
);
} }
} }

View File

@@ -1,4 +1,3 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export { Person } from './c/person.js'; export { Person } from './c/person.js';

View File

@@ -4,31 +4,15 @@ export declare class Person {
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): Person; __init(i: number, bb: flatbuffers.ByteBuffer): Person;
static getRootAsPerson(bb: flatbuffers.ByteBuffer, obj?: Person): Person; static getRootAsPerson(bb: flatbuffers.ByteBuffer, obj?: Person): Person;
static getSizePrefixedRootAsPerson( static getSizePrefixedRootAsPerson(bb: flatbuffers.ByteBuffer, obj?: Person): Person;
bb: flatbuffers.ByteBuffer,
obj?: Person,
): Person;
name(): string | null; name(): string | null;
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
age(): number; age(): number;
static startPerson(builder: flatbuffers.Builder): void; static startPerson(builder: flatbuffers.Builder): void;
static addName( static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
builder: flatbuffers.Builder,
nameOffset: flatbuffers.Offset,
): void;
static addAge(builder: flatbuffers.Builder, age: number): void; static addAge(builder: flatbuffers.Builder, age: number): void;
static endPerson(builder: flatbuffers.Builder): flatbuffers.Offset; static endPerson(builder: flatbuffers.Builder): flatbuffers.Offset;
static finishPersonBuffer( static finishPersonBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static finishSizePrefixedPersonBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
offset: flatbuffers.Offset, static createPerson(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset, age: number): flatbuffers.Offset;
): void;
static finishSizePrefixedPersonBuffer(
builder: flatbuffers.Builder,
offset: flatbuffers.Offset,
): void;
static createPerson(
builder: flatbuffers.Builder,
nameOffset: flatbuffers.Offset,
age: number,
): flatbuffers.Offset;
} }

View File

@@ -1,6 +1,5 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export class Person { export class Person {
constructor() { constructor() {
@@ -13,18 +12,15 @@ export class Person {
return this; return this;
} }
static getRootAsPerson(bb, obj) { static getRootAsPerson(bb, obj) {
return (obj || new Person()) return (obj || new Person()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getSizePrefixedRootAsPerson(bb, obj) { static getSizePrefixedRootAsPerson(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new Person()) return (obj || new Person()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
name(optionalEncoding) { name(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 4); const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
null;
} }
age() { age() {
const offset = this.bb.__offset(this.bb_pos, 6); const offset = this.bb.__offset(this.bb_pos, 6);

View File

@@ -4,9 +4,11 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export class Person { export class Person {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):Person { __init(i:number, bb:flatbuffers.ByteBuffer):Person {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -14,30 +16,19 @@ export class Person {
} }
static getRootAsPerson(bb:flatbuffers.ByteBuffer, obj?:Person):Person { static getRootAsPerson(bb:flatbuffers.ByteBuffer, obj?:Person):Person {
return (obj || new Person()).__init( return (obj || new Person()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
bb.readInt32(bb.position()) + bb.position(),
bb,
);
} }
static getSizePrefixedRootAsPerson( static getSizePrefixedRootAsPerson(bb:flatbuffers.ByteBuffer, obj?:Person):Person {
bb: flatbuffers.ByteBuffer,
obj?: Person,
): Person {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new Person()).__init( return (obj || new Person()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
bb.readInt32(bb.position()) + bb.position(),
bb,
);
} }
name(): string | null; name():string|null
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
name(optionalEncoding?:any):string|Uint8Array|null { name(optionalEncoding?:any):string|Uint8Array|null {
const offset = this.bb!.__offset(this.bb_pos, 4); const offset = this.bb!.__offset(this.bb_pos, 4);
return offset return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
: null;
} }
age():number { age():number {
@@ -45,15 +36,15 @@ export class Person {
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0; return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
} }
static startPerson(builder: flatbuffers.Builder) { static startPerson(builder:flatbuffers.Builder):void {
builder.startObject(2); builder.startObject(2);
} }
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) { static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset):void {
builder.addFieldOffset(0, nameOffset, 0); builder.addFieldOffset(0, nameOffset, 0);
} }
static addAge(builder: flatbuffers.Builder, age: number) { static addAge(builder:flatbuffers.Builder, age:number):void {
builder.addFieldInt16(1, age, 0); builder.addFieldInt16(1, age, 0);
} }
@@ -62,25 +53,15 @@ export class Person {
return offset; return offset;
} }
static finishPersonBuffer( static finishPersonBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
builder: flatbuffers.Builder,
offset: flatbuffers.Offset,
) {
builder.finish(offset); builder.finish(offset);
} }
static finishSizePrefixedPersonBuffer( static finishSizePrefixedPersonBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
builder: flatbuffers.Builder,
offset: flatbuffers.Offset,
) {
builder.finish(offset, undefined, true); builder.finish(offset, undefined, true);
} }
static createPerson( static createPerson(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset, age:number):flatbuffers.Offset {
builder: flatbuffers.Builder,
nameOffset: flatbuffers.Offset,
age: number,
): flatbuffers.Offset {
Person.startPerson(builder); Person.startPerson(builder);
Person.addName(builder, nameOffset); Person.addName(builder, nameOffset);
Person.addAge(builder, age); Person.addAge(builder, age);

View File

@@ -1,2 +1,2 @@
export * as MyGame from './my-game.js';
export { TableA, TableAT } from './table-a.js'; export { TableA, TableAT } from './table-a.js';
export * as MyGame from './my-game.js';

View File

@@ -1,5 +1,4 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export * as MyGame from './my-game.js';
export { TableA, TableAT } from './table-a.js'; export { TableA, TableAT } from './table-a.js';
export * as MyGame from './my-game.js';

View File

@@ -882,7 +882,7 @@ var Monster2 = class _Monster {
} }
name(optionalEncoding) { name(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 10); const offset = this.bb.__offset(this.bb_pos, 10);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; return this.bb.__string(this.bb_pos + offset, optionalEncoding);
} }
inventory(index) { inventory(index) {
const offset = this.bb.__offset(this.bb_pos, 14); const offset = this.bb.__offset(this.bb_pos, 14);
@@ -1274,7 +1274,7 @@ var Monster2 = class _Monster {
} }
vectorOfEnums(index) { vectorOfEnums(index) {
const offset = this.bb.__offset(this.bb_pos, 98); const offset = this.bb.__offset(this.bb_pos, 98);
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0; return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : null;
} }
vectorOfEnumsLength() { vectorOfEnumsLength() {
const offset = this.bb.__offset(this.bb_pos, 98); const offset = this.bb.__offset(this.bb_pos, 98);

View File

@@ -1,7 +1,4 @@
export { InParentNamespace, InParentNamespaceT } from './my-game/in-parent-namespace.js';
export * as Example from './my-game/example.js'; export * as Example from './my-game/example.js';
export * as Example2 from './my-game/example2.js'; export * as Example2 from './my-game/example2.js';
export {
InParentNamespace,
InParentNamespaceT,
} from './my-game/in-parent-namespace.js';
export * as OtherNameSpace from './my-game/other-name-space.js'; export * as OtherNameSpace from './my-game/other-name-space.js';

View File

@@ -1,7 +1,6 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */ export { InParentNamespace, InParentNamespaceT } from './my-game/in-parent-namespace.js';
export * as Example from './my-game/example.js'; export * as Example from './my-game/example.js';
export * as Example2 from './my-game/example2.js'; export * as Example2 from './my-game/example2.js';
export {InParentNamespace, InParentNamespaceT} from './my-game/in-parent-namespace.js';
export * as OtherNameSpace from './my-game/other-name-space.js'; export * as OtherNameSpace from './my-game/other-name-space.js';

View File

@@ -1,25 +1,16 @@
export { Ability, AbilityT } from './example/ability.js'; export { Ability, AbilityT } from './example/ability.js';
export { Any } from './example/any.js';
export { AnyAmbiguousAliases } from './example/any-ambiguous-aliases.js'; export { AnyAmbiguousAliases } from './example/any-ambiguous-aliases.js';
export { AnyUniqueAliases } from './example/any-unique-aliases.js'; export { AnyUniqueAliases } from './example/any-unique-aliases.js';
export {Any} from './example/any.js';
export { Color } from './example/color.js'; export { Color } from './example/color.js';
export { LongEnum } from './example/long-enum.js'; export { LongEnum } from './example/long-enum.js';
export { Monster, MonsterT } from './example/monster.js'; export { Monster, MonsterT } from './example/monster.js';
export { Race } from './example/race.js'; export { Race } from './example/race.js';
export { Referrable, ReferrableT } from './example/referrable.js'; export { Referrable, ReferrableT } from './example/referrable.js';
export { Stat, StatT } from './example/stat.js'; export { Stat, StatT } from './example/stat.js';
export { export { StructOfStructs, StructOfStructsT } from './example/struct-of-structs.js';
StructOfStructsOfStructs, export { StructOfStructsOfStructs, StructOfStructsOfStructsT } from './example/struct-of-structs-of-structs.js';
StructOfStructsOfStructsT,
} from './example/struct-of-structs-of-structs.js';
export {
StructOfStructs,
StructOfStructsT,
} from './example/struct-of-structs.js';
export {
TestSimpleTableWithEnum,
TestSimpleTableWithEnumT,
} from './example/test-simple-table-with-enum.js';
export { Test, TestT } from './example/test.js'; export { Test, TestT } from './example/test.js';
export { TestSimpleTableWithEnum, TestSimpleTableWithEnumT } from './example/test-simple-table-with-enum.js';
export { TypeAliases, TypeAliasesT } from './example/type-aliases.js'; export { TypeAliases, TypeAliasesT } from './example/type-aliases.js';
export { Vec3, Vec3T } from './example/vec3.js'; export { Vec3, Vec3T } from './example/vec3.js';

View File

@@ -1,19 +1,18 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export { Ability, AbilityT } from './example/ability.js'; export { Ability, AbilityT } from './example/ability.js';
export { Any } from './example/any.js';
export { AnyAmbiguousAliases } from './example/any-ambiguous-aliases.js'; export { AnyAmbiguousAliases } from './example/any-ambiguous-aliases.js';
export { AnyUniqueAliases } from './example/any-unique-aliases.js'; export { AnyUniqueAliases } from './example/any-unique-aliases.js';
export {Any} from './example/any.js';
export { Color } from './example/color.js'; export { Color } from './example/color.js';
export { LongEnum } from './example/long-enum.js'; export { LongEnum } from './example/long-enum.js';
export { Monster, MonsterT } from './example/monster.js'; export { Monster, MonsterT } from './example/monster.js';
export { Race } from './example/race.js'; export { Race } from './example/race.js';
export { Referrable, ReferrableT } from './example/referrable.js'; export { Referrable, ReferrableT } from './example/referrable.js';
export { Stat, StatT } from './example/stat.js'; export { Stat, StatT } from './example/stat.js';
export {StructOfStructsOfStructs, StructOfStructsOfStructsT} from './example/struct-of-structs-of-structs.js';
export { StructOfStructs, StructOfStructsT } from './example/struct-of-structs.js'; export { StructOfStructs, StructOfStructsT } from './example/struct-of-structs.js';
export {TestSimpleTableWithEnum, TestSimpleTableWithEnumT} from './example/test-simple-table-with-enum.js'; export { StructOfStructsOfStructs, StructOfStructsOfStructsT } from './example/struct-of-structs-of-structs.js';
export { Test, TestT } from './example/test.js'; export { Test, TestT } from './example/test.js';
export { TestSimpleTableWithEnum, TestSimpleTableWithEnumT } from './example/test-simple-table-with-enum.js';
export { TypeAliases, TypeAliasesT } from './example/type-aliases.js'; export { TypeAliases, TypeAliasesT } from './example/type-aliases.js';
export { Vec3, Vec3T } from './example/vec3.js'; export { Vec3, Vec3T } from './example/vec3.js';

View File

@@ -1,7 +1,5 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export declare class Ability export declare class Ability implements flatbuffers.IUnpackableObject<AbilityT> {
implements flatbuffers.IUnpackableObject<AbilityT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): Ability; __init(i: number, bb: flatbuffers.ByteBuffer): Ability;
@@ -9,13 +7,9 @@ export declare class Ability
mutate_id(value: number): boolean; mutate_id(value: number): boolean;
distance(): number; distance(): number;
mutate_distance(value: number): boolean; mutate_distance(value: number): boolean;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.Ability";
static sizeOf(): number; static sizeOf(): number;
static createAbility( static createAbility(builder: flatbuffers.Builder, id: number, distance: number): flatbuffers.Offset;
builder: flatbuffers.Builder,
id: number,
distance: number,
): flatbuffers.Offset;
unpack(): AbilityT; unpack(): AbilityT;
unpackTo(_o: AbilityT): void; unpackTo(_o: AbilityT): void;
} }

View File

@@ -8,7 +8,7 @@ import * as flatbuffers from 'flatbuffers';
export class Ability implements flatbuffers.IUnpackableObject<AbilityT> { export class Ability implements flatbuffers.IUnpackableObject<AbilityT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):Ability { __init(i:number, bb:flatbuffers.ByteBuffer):Ability {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;

View File

@@ -1,16 +1,9 @@
import {Monster} from '../../my-game/example/monster.js'; import { Monster } from './monster.js';
export declare enum AnyAmbiguousAliases { export declare enum AnyAmbiguousAliases {
NONE = 0, NONE = 0,
M1 = 1, M1 = 1,
M2 = 2, M2 = 2,
M3 = 3, M3 = 3
} }
export declare function unionToAnyAmbiguousAliases( export declare function unionToAnyAmbiguousAliases(type: AnyAmbiguousAliases, accessor: (obj: Monster) => Monster | null): Monster | null;
type: AnyAmbiguousAliases, export declare function unionListToAnyAmbiguousAliases(type: AnyAmbiguousAliases, accessor: (index: number, obj: Monster) => Monster | null, index: number): Monster | null;
accessor: (obj: Monster) => Monster | null,
): Monster | null;
export declare function unionListToAnyAmbiguousAliases(
type: AnyAmbiguousAliases,
accessor: (index: number, obj: Monster) => Monster | null,
index: number,
): Monster | null;

View File

@@ -1,39 +1,28 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */ import { Monster } from './monster.js';
import {Monster} from '../../my-game/example/monster.js';
export var AnyAmbiguousAliases; export var AnyAmbiguousAliases;
(function (AnyAmbiguousAliases) { (function (AnyAmbiguousAliases) {
AnyAmbiguousAliases[AnyAmbiguousAliases['NONE'] = 0] = 'NONE'; AnyAmbiguousAliases[AnyAmbiguousAliases["NONE"] = 0] = "NONE";
AnyAmbiguousAliases[AnyAmbiguousAliases['M1'] = 1] = 'M1'; AnyAmbiguousAliases[AnyAmbiguousAliases["M1"] = 1] = "M1";
AnyAmbiguousAliases[AnyAmbiguousAliases['M2'] = 2] = 'M2'; AnyAmbiguousAliases[AnyAmbiguousAliases["M2"] = 2] = "M2";
AnyAmbiguousAliases[AnyAmbiguousAliases['M3'] = 3] = 'M3'; AnyAmbiguousAliases[AnyAmbiguousAliases["M3"] = 3] = "M3";
})(AnyAmbiguousAliases || (AnyAmbiguousAliases = {})); })(AnyAmbiguousAliases || (AnyAmbiguousAliases = {}));
export function unionToAnyAmbiguousAliases(type, accessor) { export function unionToAnyAmbiguousAliases(type, accessor) {
switch (AnyAmbiguousAliases[type]) { switch (AnyAmbiguousAliases[type]) {
case 'NONE': case 'NONE': return null;
return null; case 'M1': return accessor(new Monster());
case 'M1': case 'M2': return accessor(new Monster());
return accessor(new Monster()); case 'M3': return accessor(new Monster());
case 'M2': default: return null;
return accessor(new Monster());
case 'M3':
return accessor(new Monster());
default:
return null;
} }
} }
export function unionListToAnyAmbiguousAliases(type, accessor, index) { export function unionListToAnyAmbiguousAliases(type, accessor, index) {
switch (AnyAmbiguousAliases[type]) { switch (AnyAmbiguousAliases[type]) {
case 'NONE': case 'NONE': return null;
return null; case 'M1': return accessor(index, new Monster());
case 'M1': case 'M2': return accessor(index, new Monster());
return accessor(index, new Monster()); case 'M3': return accessor(index, new Monster());
case 'M2': default: return null;
return accessor(index, new Monster());
case 'M3':
return accessor(index, new Monster());
default:
return null;
} }
} }

View File

@@ -1,23 +1,11 @@
import {Monster} from '../../my-game/example/monster.js'; import { Monster as MyGame_Example2_Monster } from '../example2/monster.js';
import {TestSimpleTableWithEnum} from '../../my-game/example/test-simple-table-with-enum.js'; import { Monster } from './monster.js';
import {Monster as MyGame_Example2_Monster} from '../../my-game/example2/monster.js'; import { TestSimpleTableWithEnum } from './test-simple-table-with-enum.js';
export declare enum AnyUniqueAliases { export declare enum AnyUniqueAliases {
NONE = 0, NONE = 0,
M = 1, M = 1,
TS = 2, TS = 2,
M2 = 3, M2 = 3
} }
export declare function unionToAnyUniqueAliases( export declare function unionToAnyUniqueAliases(type: AnyUniqueAliases, accessor: (obj: Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum) => Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null): Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null;
type: AnyUniqueAliases, export declare function unionListToAnyUniqueAliases(type: AnyUniqueAliases, accessor: (index: number, obj: Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum) => Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null, index: number): Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null;
accessor: (
obj: Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum,
) => Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null,
): Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null;
export declare function unionListToAnyUniqueAliases(
type: AnyUniqueAliases,
accessor: (
index: number,
obj: Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum,
) => Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null,
index: number,
): Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null;

View File

@@ -1,42 +1,30 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */ import { Monster as MyGame_Example2_Monster } from '../example2/monster.js';
import {Monster} from '../../my-game/example/monster.js'; import { Monster } from './monster.js';
import {TestSimpleTableWithEnum} from '../../my-game/example/test-simple-table-with-enum.js'; import { TestSimpleTableWithEnum } from './test-simple-table-with-enum.js';
import {Monster as MyGame_Example2_Monster} from '../../my-game/example2/monster.js';
export var AnyUniqueAliases; export var AnyUniqueAliases;
(function (AnyUniqueAliases) { (function (AnyUniqueAliases) {
AnyUniqueAliases[AnyUniqueAliases['NONE'] = 0] = 'NONE'; AnyUniqueAliases[AnyUniqueAliases["NONE"] = 0] = "NONE";
AnyUniqueAliases[AnyUniqueAliases['M'] = 1] = 'M'; AnyUniqueAliases[AnyUniqueAliases["M"] = 1] = "M";
AnyUniqueAliases[AnyUniqueAliases['TS'] = 2] = 'TS'; AnyUniqueAliases[AnyUniqueAliases["TS"] = 2] = "TS";
AnyUniqueAliases[AnyUniqueAliases['M2'] = 3] = 'M2'; AnyUniqueAliases[AnyUniqueAliases["M2"] = 3] = "M2";
})(AnyUniqueAliases || (AnyUniqueAliases = {})); })(AnyUniqueAliases || (AnyUniqueAliases = {}));
export function unionToAnyUniqueAliases(type, accessor) { export function unionToAnyUniqueAliases(type, accessor) {
switch (AnyUniqueAliases[type]) { switch (AnyUniqueAliases[type]) {
case 'NONE': case 'NONE': return null;
return null; case 'M': return accessor(new Monster());
case 'M': case 'TS': return accessor(new TestSimpleTableWithEnum());
return accessor(new Monster()); case 'M2': return accessor(new MyGame_Example2_Monster());
case 'TS': default: return null;
return accessor(new TestSimpleTableWithEnum());
case 'M2':
return accessor(new MyGame_Example2_Monster());
default:
return null;
} }
} }
export function unionListToAnyUniqueAliases(type, accessor, index) { export function unionListToAnyUniqueAliases(type, accessor, index) {
switch (AnyUniqueAliases[type]) { switch (AnyUniqueAliases[type]) {
case 'NONE': case 'NONE': return null;
return null; case 'M': return accessor(index, new Monster());
case 'M': case 'TS': return accessor(index, new TestSimpleTableWithEnum());
return accessor(index, new Monster()); case 'M2': return accessor(index, new MyGame_Example2_Monster());
case 'TS': default: return null;
return accessor(index, new TestSimpleTableWithEnum());
case 'M2':
return accessor(index, new MyGame_Example2_Monster());
default:
return null;
} }
} }

View File

@@ -1,23 +1,11 @@
import {Monster} from '../../my-game/example/monster.js'; import { Monster as MyGame_Example2_Monster } from '../example2/monster.js';
import {TestSimpleTableWithEnum} from '../../my-game/example/test-simple-table-with-enum.js'; import { Monster } from './monster.js';
import {Monster as MyGame_Example2_Monster} from '../../my-game/example2/monster.js'; import { TestSimpleTableWithEnum } from './test-simple-table-with-enum.js';
export declare enum Any { export declare enum Any {
NONE = 0, NONE = 0,
Monster = 1, Monster = 1,
TestSimpleTableWithEnum = 2, TestSimpleTableWithEnum = 2,
MyGame_Example2_Monster = 3, MyGame_Example2_Monster = 3
} }
export declare function unionToAny( export declare function unionToAny(type: Any, accessor: (obj: Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum) => Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null): Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null;
type: Any, export declare function unionListToAny(type: Any, accessor: (index: number, obj: Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum) => Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null, index: number): Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null;
accessor: (
obj: Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum,
) => Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null,
): Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null;
export declare function unionListToAny(
type: Any,
accessor: (
index: number,
obj: Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum,
) => Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null,
index: number,
): Monster | MyGame_Example2_Monster | TestSimpleTableWithEnum | null;

View File

@@ -1,42 +1,30 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */ import { Monster as MyGame_Example2_Monster } from '../example2/monster.js';
import {Monster} from '../../my-game/example/monster.js'; import { Monster } from './monster.js';
import {TestSimpleTableWithEnum} from '../../my-game/example/test-simple-table-with-enum.js'; import { TestSimpleTableWithEnum } from './test-simple-table-with-enum.js';
import {Monster as MyGame_Example2_Monster} from '../../my-game/example2/monster.js';
export var Any; export var Any;
(function (Any) { (function (Any) {
Any[Any['NONE'] = 0] = 'NONE'; Any[Any["NONE"] = 0] = "NONE";
Any[Any['Monster'] = 1] = 'Monster'; Any[Any["Monster"] = 1] = "Monster";
Any[Any['TestSimpleTableWithEnum'] = 2] = 'TestSimpleTableWithEnum'; Any[Any["TestSimpleTableWithEnum"] = 2] = "TestSimpleTableWithEnum";
Any[Any['MyGame_Example2_Monster'] = 3] = 'MyGame_Example2_Monster'; Any[Any["MyGame_Example2_Monster"] = 3] = "MyGame_Example2_Monster";
})(Any || (Any = {})); })(Any || (Any = {}));
export function unionToAny(type, accessor) { export function unionToAny(type, accessor) {
switch (Any[type]) { switch (Any[type]) {
case 'NONE': case 'NONE': return null;
return null; case 'Monster': return accessor(new Monster());
case 'Monster': case 'TestSimpleTableWithEnum': return accessor(new TestSimpleTableWithEnum());
return accessor(new Monster()); case 'MyGame_Example2_Monster': return accessor(new MyGame_Example2_Monster());
case 'TestSimpleTableWithEnum': default: return null;
return accessor(new TestSimpleTableWithEnum());
case 'MyGame_Example2_Monster':
return accessor(new MyGame_Example2_Monster());
default:
return null;
} }
} }
export function unionListToAny(type, accessor, index) { export function unionListToAny(type, accessor, index) {
switch (Any[type]) { switch (Any[type]) {
case 'NONE': case 'NONE': return null;
return null; case 'Monster': return accessor(index, new Monster());
case 'Monster': case 'TestSimpleTableWithEnum': return accessor(index, new TestSimpleTableWithEnum());
return accessor(index, new Monster()); case 'MyGame_Example2_Monster': return accessor(index, new MyGame_Example2_Monster());
case 'TestSimpleTableWithEnum': default: return null;
return accessor(index, new TestSimpleTableWithEnum());
case 'MyGame_Example2_Monster':
return accessor(index, new MyGame_Example2_Monster());
default:
return null;
} }
} }

View File

@@ -11,5 +11,5 @@ export declare enum Color {
/** /**
* \brief color Blue (1u << 3) * \brief color Blue (1u << 3)
*/ */
Blue = 8, Blue = 8
} }

View File

@@ -1,19 +1,18 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
/** /**
* Composite components of Monster color. * Composite components of Monster color.
*/ */
export var Color; export var Color;
(function (Color) { (function (Color) {
Color[Color['Red'] = 1] = 'Red'; Color[Color["Red"] = 1] = "Red";
/** /**
* \brief color Green * \brief color Green
* Green is bit_flag with value (1u << 1) * Green is bit_flag with value (1u << 1)
*/ */
Color[Color['Green'] = 2] = 'Green'; Color[Color["Green"] = 2] = "Green";
/** /**
* \brief color Blue (1u << 3) * \brief color Blue (1u << 3)
*/ */
Color[Color['Blue'] = 8] = 'Blue'; Color[Color["Blue"] = 8] = "Blue";
})(Color || (Color = {})); })(Color || (Color = {}));

View File

@@ -1,5 +1,5 @@
export declare enum LongEnum { export declare enum LongEnum {
LongOne = '2', LongOne = "2",
LongTwo = '4', LongTwo = "4",
LongBig = '1099511627776', LongBig = "1099511627776"
} }

View File

@@ -1,9 +1,8 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export var LongEnum; export var LongEnum;
(function (LongEnum) { (function (LongEnum) {
LongEnum['LongOne'] = '2'; LongEnum["LongOne"] = "2";
LongEnum['LongTwo'] = '4'; LongEnum["LongTwo"] = "4";
LongEnum['LongBig'] = '1099511627776'; LongEnum["LongBig"] = "1099511627776";
})(LongEnum || (LongEnum = {})); })(LongEnum || (LongEnum = {}));

View File

@@ -1,42 +1,34 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import {Ability, AbilityT} from '../../my-game/example/ability.js'; import { MonsterT as MyGame_Example2_MonsterT } from '../example2/monster.js';
import {AnyAmbiguousAliases} from '../../my-game/example/any-ambiguous-aliases.js'; import { Ability, AbilityT } from './ability.js';
import {AnyUniqueAliases} from '../../my-game/example/any-unique-aliases.js'; import { Any } from './any.js';
import {Any} from '../../my-game/example/any.js'; import { AnyAmbiguousAliases } from './any-ambiguous-aliases.js';
import {Color} from '../../my-game/example/color.js'; import { AnyUniqueAliases } from './any-unique-aliases.js';
import {Race} from '../../my-game/example/race.js'; import { Color } from './color.js';
import {Referrable, ReferrableT} from '../../my-game/example/referrable.js'; import { Race } from './race.js';
import {Stat, StatT} from '../../my-game/example/stat.js'; import { Referrable, ReferrableT } from './referrable.js';
import {TestSimpleTableWithEnumT} from '../../my-game/example/test-simple-table-with-enum.js'; import { Stat, StatT } from './stat.js';
import {Test, TestT} from '../../my-game/example/test.js'; import { Test, TestT } from './test.js';
import {Vec3, Vec3T} from '../../my-game/example/vec3.js'; import { TestSimpleTableWithEnumT } from './test-simple-table-with-enum.js';
import {MonsterT as MyGame_Example2_MonsterT} from '../../my-game/example2/monster.js'; import { Vec3, Vec3T } from './vec3.js';
import { import { InParentNamespace, InParentNamespaceT } from '../in-parent-namespace.js';
InParentNamespace,
InParentNamespaceT,
} from '../../my-game/in-parent-namespace.js';
/** /**
* an example documentation comment: "monster object" * an example documentation comment: "monster object"
*/ */
export declare class Monster export declare class Monster implements flatbuffers.IUnpackableObject<MonsterT> {
implements flatbuffers.IUnpackableObject<MonsterT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): Monster; __init(i: number, bb: flatbuffers.ByteBuffer): Monster;
static getRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster; static getRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster;
static getSizePrefixedRootAsMonster( static getSizePrefixedRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster;
bb: flatbuffers.ByteBuffer,
obj?: Monster,
): Monster;
static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean; static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean;
pos(obj?: Vec3): Vec3 | null; pos(obj?: Vec3): Vec3 | null;
mana(): number; mana(): number;
mutate_mana(value: number): boolean; mutate_mana(value: number): boolean;
hp(): number; hp(): number;
mutate_hp(value: number): boolean; mutate_hp(value: number): boolean;
name(): string | null; name(): string;
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
inventory(index: number): number | null; inventory(index: number): number | null;
inventoryLength(): number; inventoryLength(): number;
inventoryArray(): Uint8Array | null; inventoryArray(): Uint8Array | null;
@@ -47,10 +39,7 @@ export declare class Monster
test4(index: number, obj?: Test): Test | null; test4(index: number, obj?: Test): Test | null;
test4Length(): number; test4Length(): number;
testarrayofstring(index: number): string; testarrayofstring(index: number): string;
testarrayofstring( testarrayofstring(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
index: number,
optionalEncoding: flatbuffers.Encoding,
): string | Uint8Array;
testarrayofstringLength(): number; testarrayofstringLength(): number;
/** /**
* an example documentation comment: this will end up in the generated code * an example documentation comment: this will end up in the generated code
@@ -91,10 +80,7 @@ export declare class Monster
testf3(): number; testf3(): number;
mutate_testf3(value: number): boolean; mutate_testf3(value: number): boolean;
testarrayofstring2(index: number): string; testarrayofstring2(index: number): string;
testarrayofstring2( testarrayofstring2(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
index: number,
optionalEncoding: flatbuffers.Encoding,
): string | Uint8Array;
testarrayofstring2Length(): number; testarrayofstring2Length(): number;
testarrayofsortedstruct(index: number, obj?: Ability): Ability | null; testarrayofsortedstruct(index: number, obj?: Ability): Ability | null;
testarrayofsortedstructLength(): number; testarrayofsortedstructLength(): number;
@@ -160,374 +146,113 @@ export declare class Monster
mutate_negative_infinity_default(value: number): boolean; mutate_negative_infinity_default(value: number): boolean;
doubleInfDefault(): number; doubleInfDefault(): number;
mutate_double_inf_default(value: number): boolean; mutate_double_inf_default(value: number): boolean;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.Monster";
static startMonster(builder: flatbuffers.Builder): void; static startMonster(builder: flatbuffers.Builder): void;
static addPos( static addPos(builder: flatbuffers.Builder, posOffset: flatbuffers.Offset): void;
builder: flatbuffers.Builder,
posOffset: flatbuffers.Offset,
): void;
static addMana(builder: flatbuffers.Builder, mana: number): void; static addMana(builder: flatbuffers.Builder, mana: number): void;
static addHp(builder: flatbuffers.Builder, hp: number): void; static addHp(builder: flatbuffers.Builder, hp: number): void;
static addName( static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static addInventory(builder: flatbuffers.Builder, inventoryOffset: flatbuffers.Offset): void;
nameOffset: flatbuffers.Offset, static createInventoryVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
): void; static startInventoryVector(builder: flatbuffers.Builder, numElems: number): void;
static addInventory(
builder: flatbuffers.Builder,
inventoryOffset: flatbuffers.Offset,
): void;
static createInventoryVector(
builder: flatbuffers.Builder,
data: number[] | Uint8Array,
): flatbuffers.Offset;
static startInventoryVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addColor(builder: flatbuffers.Builder, color: Color): void; static addColor(builder: flatbuffers.Builder, color: Color): void;
static addTestType(builder: flatbuffers.Builder, testType: Any): void; static addTestType(builder: flatbuffers.Builder, testType: Any): void;
static addTest( static addTest(builder: flatbuffers.Builder, testOffset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static addTest4(builder: flatbuffers.Builder, test4Offset: flatbuffers.Offset): void;
testOffset: flatbuffers.Offset,
): void;
static addTest4(
builder: flatbuffers.Builder,
test4Offset: flatbuffers.Offset,
): void;
static startTest4Vector(builder: flatbuffers.Builder, numElems: number): void; static startTest4Vector(builder: flatbuffers.Builder, numElems: number): void;
static addTestarrayofstring( static addTestarrayofstring(builder: flatbuffers.Builder, testarrayofstringOffset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static createTestarrayofstringVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
testarrayofstringOffset: flatbuffers.Offset, static startTestarrayofstringVector(builder: flatbuffers.Builder, numElems: number): void;
): void; static addTestarrayoftables(builder: flatbuffers.Builder, testarrayoftablesOffset: flatbuffers.Offset): void;
static createTestarrayofstringVector( static createTestarrayoftablesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
builder: flatbuffers.Builder, static startTestarrayoftablesVector(builder: flatbuffers.Builder, numElems: number): void;
data: flatbuffers.Offset[], static addEnemy(builder: flatbuffers.Builder, enemyOffset: flatbuffers.Offset): void;
): flatbuffers.Offset; static addTestnestedflatbuffer(builder: flatbuffers.Builder, testnestedflatbufferOffset: flatbuffers.Offset): void;
static startTestarrayofstringVector( static createTestnestedflatbufferVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
builder: flatbuffers.Builder, static startTestnestedflatbufferVector(builder: flatbuffers.Builder, numElems: number): void;
numElems: number, static addTestempty(builder: flatbuffers.Builder, testemptyOffset: flatbuffers.Offset): void;
): void;
static addTestarrayoftables(
builder: flatbuffers.Builder,
testarrayoftablesOffset: flatbuffers.Offset,
): void;
static createTestarrayoftablesVector(
builder: flatbuffers.Builder,
data: flatbuffers.Offset[],
): flatbuffers.Offset;
static startTestarrayoftablesVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addEnemy(
builder: flatbuffers.Builder,
enemyOffset: flatbuffers.Offset,
): void;
static addTestnestedflatbuffer(
builder: flatbuffers.Builder,
testnestedflatbufferOffset: flatbuffers.Offset,
): void;
static createTestnestedflatbufferVector(
builder: flatbuffers.Builder,
data: number[] | Uint8Array,
): flatbuffers.Offset;
static startTestnestedflatbufferVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addTestempty(
builder: flatbuffers.Builder,
testemptyOffset: flatbuffers.Offset,
): void;
static addTestbool(builder: flatbuffers.Builder, testbool: boolean): void; static addTestbool(builder: flatbuffers.Builder, testbool: boolean): void;
static addTesthashs32Fnv1( static addTesthashs32Fnv1(builder: flatbuffers.Builder, testhashs32Fnv1: number): void;
builder: flatbuffers.Builder, static addTesthashu32Fnv1(builder: flatbuffers.Builder, testhashu32Fnv1: number): void;
testhashs32Fnv1: number, static addTesthashs64Fnv1(builder: flatbuffers.Builder, testhashs64Fnv1: bigint): void;
): void; static addTesthashu64Fnv1(builder: flatbuffers.Builder, testhashu64Fnv1: bigint): void;
static addTesthashu32Fnv1( static addTesthashs32Fnv1a(builder: flatbuffers.Builder, testhashs32Fnv1a: number): void;
builder: flatbuffers.Builder, static addTesthashu32Fnv1a(builder: flatbuffers.Builder, testhashu32Fnv1a: number): void;
testhashu32Fnv1: number, static addTesthashs64Fnv1a(builder: flatbuffers.Builder, testhashs64Fnv1a: bigint): void;
): void; static addTesthashu64Fnv1a(builder: flatbuffers.Builder, testhashu64Fnv1a: bigint): void;
static addTesthashs64Fnv1( static addTestarrayofbools(builder: flatbuffers.Builder, testarrayofboolsOffset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static createTestarrayofboolsVector(builder: flatbuffers.Builder, data: boolean[]): flatbuffers.Offset;
testhashs64Fnv1: bigint, static startTestarrayofboolsVector(builder: flatbuffers.Builder, numElems: number): void;
): void;
static addTesthashu64Fnv1(
builder: flatbuffers.Builder,
testhashu64Fnv1: bigint,
): void;
static addTesthashs32Fnv1a(
builder: flatbuffers.Builder,
testhashs32Fnv1a: number,
): void;
static addTesthashu32Fnv1a(
builder: flatbuffers.Builder,
testhashu32Fnv1a: number,
): void;
static addTesthashs64Fnv1a(
builder: flatbuffers.Builder,
testhashs64Fnv1a: bigint,
): void;
static addTesthashu64Fnv1a(
builder: flatbuffers.Builder,
testhashu64Fnv1a: bigint,
): void;
static addTestarrayofbools(
builder: flatbuffers.Builder,
testarrayofboolsOffset: flatbuffers.Offset,
): void;
static createTestarrayofboolsVector(
builder: flatbuffers.Builder,
data: boolean[],
): flatbuffers.Offset;
static startTestarrayofboolsVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addTestf(builder: flatbuffers.Builder, testf: number): void; static addTestf(builder: flatbuffers.Builder, testf: number): void;
static addTestf2(builder: flatbuffers.Builder, testf2: number): void; static addTestf2(builder: flatbuffers.Builder, testf2: number): void;
static addTestf3(builder: flatbuffers.Builder, testf3: number): void; static addTestf3(builder: flatbuffers.Builder, testf3: number): void;
static addTestarrayofstring2( static addTestarrayofstring2(builder: flatbuffers.Builder, testarrayofstring2Offset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static createTestarrayofstring2Vector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
testarrayofstring2Offset: flatbuffers.Offset, static startTestarrayofstring2Vector(builder: flatbuffers.Builder, numElems: number): void;
): void; static addTestarrayofsortedstruct(builder: flatbuffers.Builder, testarrayofsortedstructOffset: flatbuffers.Offset): void;
static createTestarrayofstring2Vector( static startTestarrayofsortedstructVector(builder: flatbuffers.Builder, numElems: number): void;
builder: flatbuffers.Builder, static addFlex(builder: flatbuffers.Builder, flexOffset: flatbuffers.Offset): void;
data: flatbuffers.Offset[], static createFlexVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
): flatbuffers.Offset;
static startTestarrayofstring2Vector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addTestarrayofsortedstruct(
builder: flatbuffers.Builder,
testarrayofsortedstructOffset: flatbuffers.Offset,
): void;
static startTestarrayofsortedstructVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addFlex(
builder: flatbuffers.Builder,
flexOffset: flatbuffers.Offset,
): void;
static createFlexVector(
builder: flatbuffers.Builder,
data: number[] | Uint8Array,
): flatbuffers.Offset;
static startFlexVector(builder: flatbuffers.Builder, numElems: number): void; static startFlexVector(builder: flatbuffers.Builder, numElems: number): void;
static addTest5( static addTest5(builder: flatbuffers.Builder, test5Offset: flatbuffers.Offset): void;
builder: flatbuffers.Builder,
test5Offset: flatbuffers.Offset,
): void;
static startTest5Vector(builder: flatbuffers.Builder, numElems: number): void; static startTest5Vector(builder: flatbuffers.Builder, numElems: number): void;
static addVectorOfLongs( static addVectorOfLongs(builder: flatbuffers.Builder, vectorOfLongsOffset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static createVectorOfLongsVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset;
vectorOfLongsOffset: flatbuffers.Offset, static startVectorOfLongsVector(builder: flatbuffers.Builder, numElems: number): void;
): void; static addVectorOfDoubles(builder: flatbuffers.Builder, vectorOfDoublesOffset: flatbuffers.Offset): void;
static createVectorOfLongsVector( static createVectorOfDoublesVector(builder: flatbuffers.Builder, data: number[] | Float64Array): flatbuffers.Offset;
builder: flatbuffers.Builder,
data: bigint[],
): flatbuffers.Offset;
static startVectorOfLongsVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addVectorOfDoubles(
builder: flatbuffers.Builder,
vectorOfDoublesOffset: flatbuffers.Offset,
): void;
static createVectorOfDoublesVector(
builder: flatbuffers.Builder,
data: number[] | Float64Array,
): flatbuffers.Offset;
/** /**
* @deprecated This Uint8Array overload will be removed in the future. * @deprecated This Uint8Array overload will be removed in the future.
*/ */
static createVectorOfDoublesVector( static createVectorOfDoublesVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
builder: flatbuffers.Builder, static startVectorOfDoublesVector(builder: flatbuffers.Builder, numElems: number): void;
data: number[] | Uint8Array, static addParentNamespaceTest(builder: flatbuffers.Builder, parentNamespaceTestOffset: flatbuffers.Offset): void;
): flatbuffers.Offset; static addVectorOfReferrables(builder: flatbuffers.Builder, vectorOfReferrablesOffset: flatbuffers.Offset): void;
static startVectorOfDoublesVector( static createVectorOfReferrablesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
builder: flatbuffers.Builder, static startVectorOfReferrablesVector(builder: flatbuffers.Builder, numElems: number): void;
numElems: number, static addSingleWeakReference(builder: flatbuffers.Builder, singleWeakReference: bigint): void;
): void; static addVectorOfWeakReferences(builder: flatbuffers.Builder, vectorOfWeakReferencesOffset: flatbuffers.Offset): void;
static addParentNamespaceTest( static createVectorOfWeakReferencesVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset;
builder: flatbuffers.Builder, static startVectorOfWeakReferencesVector(builder: flatbuffers.Builder, numElems: number): void;
parentNamespaceTestOffset: flatbuffers.Offset, static addVectorOfStrongReferrables(builder: flatbuffers.Builder, vectorOfStrongReferrablesOffset: flatbuffers.Offset): void;
): void; static createVectorOfStrongReferrablesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
static addVectorOfReferrables( static startVectorOfStrongReferrablesVector(builder: flatbuffers.Builder, numElems: number): void;
builder: flatbuffers.Builder, static addCoOwningReference(builder: flatbuffers.Builder, coOwningReference: bigint): void;
vectorOfReferrablesOffset: flatbuffers.Offset, static addVectorOfCoOwningReferences(builder: flatbuffers.Builder, vectorOfCoOwningReferencesOffset: flatbuffers.Offset): void;
): void; static createVectorOfCoOwningReferencesVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset;
static createVectorOfReferrablesVector( static startVectorOfCoOwningReferencesVector(builder: flatbuffers.Builder, numElems: number): void;
builder: flatbuffers.Builder, static addNonOwningReference(builder: flatbuffers.Builder, nonOwningReference: bigint): void;
data: flatbuffers.Offset[], static addVectorOfNonOwningReferences(builder: flatbuffers.Builder, vectorOfNonOwningReferencesOffset: flatbuffers.Offset): void;
): flatbuffers.Offset; static createVectorOfNonOwningReferencesVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset;
static startVectorOfReferrablesVector( static startVectorOfNonOwningReferencesVector(builder: flatbuffers.Builder, numElems: number): void;
builder: flatbuffers.Builder, static addAnyUniqueType(builder: flatbuffers.Builder, anyUniqueType: AnyUniqueAliases): void;
numElems: number, static addAnyUnique(builder: flatbuffers.Builder, anyUniqueOffset: flatbuffers.Offset): void;
): void; static addAnyAmbiguousType(builder: flatbuffers.Builder, anyAmbiguousType: AnyAmbiguousAliases): void;
static addSingleWeakReference( static addAnyAmbiguous(builder: flatbuffers.Builder, anyAmbiguousOffset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static addVectorOfEnums(builder: flatbuffers.Builder, vectorOfEnumsOffset: flatbuffers.Offset): void;
singleWeakReference: bigint, static createVectorOfEnumsVector(builder: flatbuffers.Builder, data: Color[]): flatbuffers.Offset;
): void; static startVectorOfEnumsVector(builder: flatbuffers.Builder, numElems: number): void;
static addVectorOfWeakReferences(
builder: flatbuffers.Builder,
vectorOfWeakReferencesOffset: flatbuffers.Offset,
): void;
static createVectorOfWeakReferencesVector(
builder: flatbuffers.Builder,
data: bigint[],
): flatbuffers.Offset;
static startVectorOfWeakReferencesVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addVectorOfStrongReferrables(
builder: flatbuffers.Builder,
vectorOfStrongReferrablesOffset: flatbuffers.Offset,
): void;
static createVectorOfStrongReferrablesVector(
builder: flatbuffers.Builder,
data: flatbuffers.Offset[],
): flatbuffers.Offset;
static startVectorOfStrongReferrablesVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addCoOwningReference(
builder: flatbuffers.Builder,
coOwningReference: bigint,
): void;
static addVectorOfCoOwningReferences(
builder: flatbuffers.Builder,
vectorOfCoOwningReferencesOffset: flatbuffers.Offset,
): void;
static createVectorOfCoOwningReferencesVector(
builder: flatbuffers.Builder,
data: bigint[],
): flatbuffers.Offset;
static startVectorOfCoOwningReferencesVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addNonOwningReference(
builder: flatbuffers.Builder,
nonOwningReference: bigint,
): void;
static addVectorOfNonOwningReferences(
builder: flatbuffers.Builder,
vectorOfNonOwningReferencesOffset: flatbuffers.Offset,
): void;
static createVectorOfNonOwningReferencesVector(
builder: flatbuffers.Builder,
data: bigint[],
): flatbuffers.Offset;
static startVectorOfNonOwningReferencesVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addAnyUniqueType(
builder: flatbuffers.Builder,
anyUniqueType: AnyUniqueAliases,
): void;
static addAnyUnique(
builder: flatbuffers.Builder,
anyUniqueOffset: flatbuffers.Offset,
): void;
static addAnyAmbiguousType(
builder: flatbuffers.Builder,
anyAmbiguousType: AnyAmbiguousAliases,
): void;
static addAnyAmbiguous(
builder: flatbuffers.Builder,
anyAmbiguousOffset: flatbuffers.Offset,
): void;
static addVectorOfEnums(
builder: flatbuffers.Builder,
vectorOfEnumsOffset: flatbuffers.Offset,
): void;
static createVectorOfEnumsVector(
builder: flatbuffers.Builder,
data: Color[],
): flatbuffers.Offset;
static startVectorOfEnumsVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addSignedEnum(builder: flatbuffers.Builder, signedEnum: Race): void; static addSignedEnum(builder: flatbuffers.Builder, signedEnum: Race): void;
static addTestrequirednestedflatbuffer( static addTestrequirednestedflatbuffer(builder: flatbuffers.Builder, testrequirednestedflatbufferOffset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static createTestrequirednestedflatbufferVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
testrequirednestedflatbufferOffset: flatbuffers.Offset, static startTestrequirednestedflatbufferVector(builder: flatbuffers.Builder, numElems: number): void;
): void; static addScalarKeySortedTables(builder: flatbuffers.Builder, scalarKeySortedTablesOffset: flatbuffers.Offset): void;
static createTestrequirednestedflatbufferVector( static createScalarKeySortedTablesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
builder: flatbuffers.Builder, static startScalarKeySortedTablesVector(builder: flatbuffers.Builder, numElems: number): void;
data: number[] | Uint8Array, static addNativeInline(builder: flatbuffers.Builder, nativeInlineOffset: flatbuffers.Offset): void;
): flatbuffers.Offset; static addLongEnumNonEnumDefault(builder: flatbuffers.Builder, longEnumNonEnumDefault: bigint): void;
static startTestrequirednestedflatbufferVector( static addLongEnumNormalDefault(builder: flatbuffers.Builder, longEnumNormalDefault: bigint): void;
builder: flatbuffers.Builder,
numElems: number,
): void;
static addScalarKeySortedTables(
builder: flatbuffers.Builder,
scalarKeySortedTablesOffset: flatbuffers.Offset,
): void;
static createScalarKeySortedTablesVector(
builder: flatbuffers.Builder,
data: flatbuffers.Offset[],
): flatbuffers.Offset;
static startScalarKeySortedTablesVector(
builder: flatbuffers.Builder,
numElems: number,
): void;
static addNativeInline(
builder: flatbuffers.Builder,
nativeInlineOffset: flatbuffers.Offset,
): void;
static addLongEnumNonEnumDefault(
builder: flatbuffers.Builder,
longEnumNonEnumDefault: bigint,
): void;
static addLongEnumNormalDefault(
builder: flatbuffers.Builder,
longEnumNormalDefault: bigint,
): void;
static addNanDefault(builder: flatbuffers.Builder, nanDefault: number): void; static addNanDefault(builder: flatbuffers.Builder, nanDefault: number): void;
static addInfDefault(builder: flatbuffers.Builder, infDefault: number): void; static addInfDefault(builder: flatbuffers.Builder, infDefault: number): void;
static addPositiveInfDefault( static addPositiveInfDefault(builder: flatbuffers.Builder, positiveInfDefault: number): void;
builder: flatbuffers.Builder, static addInfinityDefault(builder: flatbuffers.Builder, infinityDefault: number): void;
positiveInfDefault: number, static addPositiveInfinityDefault(builder: flatbuffers.Builder, positiveInfinityDefault: number): void;
): void; static addNegativeInfDefault(builder: flatbuffers.Builder, negativeInfDefault: number): void;
static addInfinityDefault( static addNegativeInfinityDefault(builder: flatbuffers.Builder, negativeInfinityDefault: number): void;
builder: flatbuffers.Builder, static addDoubleInfDefault(builder: flatbuffers.Builder, doubleInfDefault: number): void;
infinityDefault: number,
): void;
static addPositiveInfinityDefault(
builder: flatbuffers.Builder,
positiveInfinityDefault: number,
): void;
static addNegativeInfDefault(
builder: flatbuffers.Builder,
negativeInfDefault: number,
): void;
static addNegativeInfinityDefault(
builder: flatbuffers.Builder,
negativeInfinityDefault: number,
): void;
static addDoubleInfDefault(
builder: flatbuffers.Builder,
doubleInfDefault: number,
): void;
static endMonster(builder: flatbuffers.Builder): flatbuffers.Offset; static endMonster(builder: flatbuffers.Builder): flatbuffers.Offset;
static finishMonsterBuffer( static finishMonsterBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static finishSizePrefixedMonsterBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
offset: flatbuffers.Offset,
): void;
static finishSizePrefixedMonsterBuffer(
builder: flatbuffers.Builder,
offset: flatbuffers.Offset,
): void;
serialize(): Uint8Array; serialize(): Uint8Array;
static deserialize(buffer: Uint8Array): Monster; static deserialize(buffer: Uint8Array): Monster;
unpack(): MonsterT; unpack(): MonsterT;
@@ -538,15 +263,15 @@ export declare class MonsterT implements flatbuffers.IGeneratedObject {
mana: number; mana: number;
hp: number; hp: number;
name: string | Uint8Array | null; name: string | Uint8Array | null;
inventory: number[]; inventory: (number)[];
color: Color; color: Color;
testType: Any; testType: Any;
test: MonsterT | MyGame_Example2_MonsterT | TestSimpleTableWithEnumT | null; test: MonsterT | MyGame_Example2_MonsterT | TestSimpleTableWithEnumT | null;
test4: TestT[]; test4: (TestT)[];
testarrayofstring: string[]; testarrayofstring: (string)[];
testarrayoftables: MonsterT[]; testarrayoftables: (MonsterT)[];
enemy: MonsterT | null; enemy: MonsterT | null;
testnestedflatbuffer: number[]; testnestedflatbuffer: (number)[];
testempty: StatT | null; testempty: StatT | null;
testbool: boolean; testbool: boolean;
testhashs32Fnv1: number; testhashs32Fnv1: number;
@@ -557,37 +282,33 @@ export declare class MonsterT implements flatbuffers.IGeneratedObject {
testhashu32Fnv1a: number; testhashu32Fnv1a: number;
testhashs64Fnv1a: bigint; testhashs64Fnv1a: bigint;
testhashu64Fnv1a: bigint; testhashu64Fnv1a: bigint;
testarrayofbools: boolean[]; testarrayofbools: (boolean)[];
testf: number; testf: number;
testf2: number; testf2: number;
testf3: number; testf3: number;
testarrayofstring2: string[]; testarrayofstring2: (string)[];
testarrayofsortedstruct: AbilityT[]; testarrayofsortedstruct: (AbilityT)[];
flex: number[]; flex: (number)[];
test5: TestT[]; test5: (TestT)[];
vectorOfLongs: bigint[]; vectorOfLongs: (bigint)[];
vectorOfDoubles: number[]; vectorOfDoubles: (number)[];
parentNamespaceTest: InParentNamespaceT | null; parentNamespaceTest: InParentNamespaceT | null;
vectorOfReferrables: ReferrableT[]; vectorOfReferrables: (ReferrableT)[];
singleWeakReference: bigint; singleWeakReference: bigint;
vectorOfWeakReferences: bigint[]; vectorOfWeakReferences: (bigint)[];
vectorOfStrongReferrables: ReferrableT[]; vectorOfStrongReferrables: (ReferrableT)[];
coOwningReference: bigint; coOwningReference: bigint;
vectorOfCoOwningReferences: bigint[]; vectorOfCoOwningReferences: (bigint)[];
nonOwningReference: bigint; nonOwningReference: bigint;
vectorOfNonOwningReferences: bigint[]; vectorOfNonOwningReferences: (bigint)[];
anyUniqueType: AnyUniqueAliases; anyUniqueType: AnyUniqueAliases;
anyUnique: anyUnique: MonsterT | MyGame_Example2_MonsterT | TestSimpleTableWithEnumT | null;
| MonsterT
| MyGame_Example2_MonsterT
| TestSimpleTableWithEnumT
| null;
anyAmbiguousType: AnyAmbiguousAliases; anyAmbiguousType: AnyAmbiguousAliases;
anyAmbiguous: MonsterT | null; anyAmbiguous: MonsterT | null;
vectorOfEnums: Color[]; vectorOfEnums: (Color)[];
signedEnum: Race; signedEnum: Race;
testrequirednestedflatbuffer: number[]; testrequirednestedflatbuffer: (number)[];
scalarKeySortedTables: StatT[]; scalarKeySortedTables: (StatT)[];
nativeInline: TestT | null; nativeInline: TestT | null;
longEnumNonEnumDefault: bigint; longEnumNonEnumDefault: bigint;
longEnumNormalDefault: bigint; longEnumNormalDefault: bigint;
@@ -599,76 +320,6 @@ export declare class MonsterT implements flatbuffers.IGeneratedObject {
negativeInfDefault: number; negativeInfDefault: number;
negativeInfinityDefault: number; negativeInfinityDefault: number;
doubleInfDefault: number; doubleInfDefault: number;
constructor( constructor(pos?: Vec3T | null, mana?: number, hp?: number, name?: string | Uint8Array | null, inventory?: (number)[], color?: Color, testType?: Any, test?: MonsterT | MyGame_Example2_MonsterT | TestSimpleTableWithEnumT | null, test4?: (TestT)[], testarrayofstring?: (string)[], testarrayoftables?: (MonsterT)[], enemy?: MonsterT | null, testnestedflatbuffer?: (number)[], testempty?: StatT | null, testbool?: boolean, testhashs32Fnv1?: number, testhashu32Fnv1?: number, testhashs64Fnv1?: bigint, testhashu64Fnv1?: bigint, testhashs32Fnv1a?: number, testhashu32Fnv1a?: number, testhashs64Fnv1a?: bigint, testhashu64Fnv1a?: bigint, testarrayofbools?: (boolean)[], testf?: number, testf2?: number, testf3?: number, testarrayofstring2?: (string)[], testarrayofsortedstruct?: (AbilityT)[], flex?: (number)[], test5?: (TestT)[], vectorOfLongs?: (bigint)[], vectorOfDoubles?: (number)[], parentNamespaceTest?: InParentNamespaceT | null, vectorOfReferrables?: (ReferrableT)[], singleWeakReference?: bigint, vectorOfWeakReferences?: (bigint)[], vectorOfStrongReferrables?: (ReferrableT)[], coOwningReference?: bigint, vectorOfCoOwningReferences?: (bigint)[], nonOwningReference?: bigint, vectorOfNonOwningReferences?: (bigint)[], anyUniqueType?: AnyUniqueAliases, anyUnique?: MonsterT | MyGame_Example2_MonsterT | TestSimpleTableWithEnumT | null, anyAmbiguousType?: AnyAmbiguousAliases, anyAmbiguous?: MonsterT | null, vectorOfEnums?: (Color)[], signedEnum?: Race, testrequirednestedflatbuffer?: (number)[], scalarKeySortedTables?: (StatT)[], nativeInline?: TestT | null, longEnumNonEnumDefault?: bigint, longEnumNormalDefault?: bigint, nanDefault?: number, infDefault?: number, positiveInfDefault?: number, infinityDefault?: number, positiveInfinityDefault?: number, negativeInfDefault?: number, negativeInfinityDefault?: number, doubleInfDefault?: number);
pos?: Vec3T | null,
mana?: number,
hp?: number,
name?: string | Uint8Array | null,
inventory?: number[],
color?: Color,
testType?: Any,
test?:
| MonsterT
| MyGame_Example2_MonsterT
| TestSimpleTableWithEnumT
| null,
test4?: TestT[],
testarrayofstring?: string[],
testarrayoftables?: MonsterT[],
enemy?: MonsterT | null,
testnestedflatbuffer?: number[],
testempty?: StatT | null,
testbool?: boolean,
testhashs32Fnv1?: number,
testhashu32Fnv1?: number,
testhashs64Fnv1?: bigint,
testhashu64Fnv1?: bigint,
testhashs32Fnv1a?: number,
testhashu32Fnv1a?: number,
testhashs64Fnv1a?: bigint,
testhashu64Fnv1a?: bigint,
testarrayofbools?: boolean[],
testf?: number,
testf2?: number,
testf3?: number,
testarrayofstring2?: string[],
testarrayofsortedstruct?: AbilityT[],
flex?: number[],
test5?: TestT[],
vectorOfLongs?: bigint[],
vectorOfDoubles?: number[],
parentNamespaceTest?: InParentNamespaceT | null,
vectorOfReferrables?: ReferrableT[],
singleWeakReference?: bigint,
vectorOfWeakReferences?: bigint[],
vectorOfStrongReferrables?: ReferrableT[],
coOwningReference?: bigint,
vectorOfCoOwningReferences?: bigint[],
nonOwningReference?: bigint,
vectorOfNonOwningReferences?: bigint[],
anyUniqueType?: AnyUniqueAliases,
anyUnique?:
| MonsterT
| MyGame_Example2_MonsterT
| TestSimpleTableWithEnumT
| null,
anyAmbiguousType?: AnyAmbiguousAliases,
anyAmbiguous?: MonsterT | null,
vectorOfEnums?: Color[],
signedEnum?: Race,
testrequirednestedflatbuffer?: number[],
scalarKeySortedTables?: StatT[],
nativeInline?: TestT | null,
longEnumNonEnumDefault?: bigint,
longEnumNormalDefault?: bigint,
nanDefault?: number,
infDefault?: number,
positiveInfDefault?: number,
infinityDefault?: number,
positiveInfinityDefault?: number,
negativeInfDefault?: number,
negativeInfinityDefault?: number,
doubleInfDefault?: number,
);
pack(builder: flatbuffers.Builder): flatbuffers.Offset; pack(builder: flatbuffers.Builder): flatbuffers.Offset;
} }

View File

@@ -1,20 +1,17 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import { Ability } from './ability.js';
import {Ability} from '../../my-game/example/ability.js'; import { Any, unionToAny } from './any.js';
import {AnyAmbiguousAliases, unionToAnyAmbiguousAliases} from '../../my-game/example/any-ambiguous-aliases.js'; import { AnyAmbiguousAliases, unionToAnyAmbiguousAliases } from './any-ambiguous-aliases.js';
import {AnyUniqueAliases, unionToAnyUniqueAliases} from '../../my-game/example/any-unique-aliases.js'; import { AnyUniqueAliases, unionToAnyUniqueAliases } from './any-unique-aliases.js';
import {Any, unionToAny} from '../../my-game/example/any.js'; import { Color } from './color.js';
import {Color} from '../../my-game/example/color.js'; import { Race } from './race.js';
import {Race} from '../../my-game/example/race.js'; import { Referrable } from './referrable.js';
import {Referrable} from '../../my-game/example/referrable.js'; import { Stat } from './stat.js';
import {Stat} from '../../my-game/example/stat.js'; import { Test } from './test.js';
import {Test} from '../../my-game/example/test.js'; import { Vec3 } from './vec3.js';
import {Vec3} from '../../my-game/example/vec3.js'; import { InParentNamespace } from '../in-parent-namespace.js';
import {InParentNamespace} from '../../my-game/in-parent-namespace.js';
/** /**
* an example documentation comment: "monster object" * an example documentation comment: "monster object"
*/ */
@@ -29,21 +26,18 @@ export class Monster {
return this; return this;
} }
static getRootAsMonster(bb, obj) { static getRootAsMonster(bb, obj) {
return (obj || new Monster()) return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getSizePrefixedRootAsMonster(bb, obj) { static getSizePrefixedRootAsMonster(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new Monster()) return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static bufferHasIdentifier(bb) { static bufferHasIdentifier(bb) {
return bb.__has_identifier('MONS'); return bb.__has_identifier('MONS');
} }
pos(obj) { pos(obj) {
const offset = this.bb.__offset(this.bb_pos, 4); const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? (obj || new Vec3()).__init(this.bb_pos + offset, this.bb) : return offset ? (obj || new Vec3()).__init(this.bb_pos + offset, this.bb) : null;
null;
} }
mana() { mana() {
const offset = this.bb.__offset(this.bb_pos, 6); const offset = this.bb.__offset(this.bb_pos, 6);
@@ -71,14 +65,11 @@ export class Monster {
} }
name(optionalEncoding) { name(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 10); const offset = this.bb.__offset(this.bb_pos, 10);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : return this.bb.__string(this.bb_pos + offset, optionalEncoding);
null;
} }
inventory(index) { inventory(index) {
const offset = this.bb.__offset(this.bb_pos, 14); const offset = this.bb.__offset(this.bb_pos, 14);
return offset ? return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) :
0;
} }
inventoryLength() { inventoryLength() {
const offset = this.bb.__offset(this.bb_pos, 14); const offset = this.bb.__offset(this.bb_pos, 14);
@@ -86,12 +77,7 @@ export class Monster {
} }
inventoryArray() { inventoryArray() {
const offset = this.bb.__offset(this.bb_pos, 14); const offset = this.bb.__offset(this.bb_pos, 14);
return offset ? return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
new Uint8Array(
this.bb.bytes().buffer,
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
this.bb.__vector_len(this.bb_pos + offset)) :
null;
} }
color() { color() {
const offset = this.bb.__offset(this.bb_pos, 16); const offset = this.bb.__offset(this.bb_pos, 16);
@@ -115,11 +101,7 @@ export class Monster {
} }
test4(index, obj) { test4(index, obj) {
const offset = this.bb.__offset(this.bb_pos, 22); const offset = this.bb.__offset(this.bb_pos, 22);
return offset ? return offset ? (obj || new Test()).__init(this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) : null;
(obj || new Test())
.__init(
this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) :
null;
} }
test4Length() { test4Length() {
const offset = this.bb.__offset(this.bb_pos, 22); const offset = this.bb.__offset(this.bb_pos, 22);
@@ -127,10 +109,7 @@ export class Monster {
} }
testarrayofstring(index, optionalEncoding) { testarrayofstring(index, optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 24); const offset = this.bb.__offset(this.bb_pos, 24);
return offset ? this.bb.__string( return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
this.bb.__vector(this.bb_pos + offset) + index * 4,
optionalEncoding) :
null;
} }
testarrayofstringLength() { testarrayofstringLength() {
const offset = this.bb.__offset(this.bb_pos, 24); const offset = this.bb.__offset(this.bb_pos, 24);
@@ -142,13 +121,7 @@ export class Monster {
*/ */
testarrayoftables(index, obj) { testarrayoftables(index, obj) {
const offset = this.bb.__offset(this.bb_pos, 26); const offset = this.bb.__offset(this.bb_pos, 26);
return offset ? return offset ? (obj || new Monster()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
(obj || new Monster())
.__init(
this.bb.__indirect(
this.bb.__vector(this.bb_pos + offset) + index * 4),
this.bb) :
null;
} }
testarrayoftablesLength() { testarrayoftablesLength() {
const offset = this.bb.__offset(this.bb_pos, 26); const offset = this.bb.__offset(this.bb_pos, 26);
@@ -156,16 +129,11 @@ export class Monster {
} }
enemy(obj) { enemy(obj) {
const offset = this.bb.__offset(this.bb_pos, 28); const offset = this.bb.__offset(this.bb_pos, 28);
return offset ? return offset ? (obj || new Monster()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
(obj || new Monster())
.__init(this.bb.__indirect(this.bb_pos + offset), this.bb) :
null;
} }
testnestedflatbuffer(index) { testnestedflatbuffer(index) {
const offset = this.bb.__offset(this.bb_pos, 30); const offset = this.bb.__offset(this.bb_pos, 30);
return offset ? return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) :
0;
} }
testnestedflatbufferLength() { testnestedflatbufferLength() {
const offset = this.bb.__offset(this.bb_pos, 30); const offset = this.bb.__offset(this.bb_pos, 30);
@@ -173,19 +141,11 @@ export class Monster {
} }
testnestedflatbufferArray() { testnestedflatbufferArray() {
const offset = this.bb.__offset(this.bb_pos, 30); const offset = this.bb.__offset(this.bb_pos, 30);
return offset ? return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
new Uint8Array(
this.bb.bytes().buffer,
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
this.bb.__vector_len(this.bb_pos + offset)) :
null;
} }
testempty(obj) { testempty(obj) {
const offset = this.bb.__offset(this.bb_pos, 32); const offset = this.bb.__offset(this.bb_pos, 32);
return offset ? return offset ? (obj || new Stat()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
(obj || new Stat())
.__init(this.bb.__indirect(this.bb_pos + offset), this.bb) :
null;
} }
testbool() { testbool() {
const offset = this.bb.__offset(this.bb_pos, 34); const offset = this.bb.__offset(this.bb_pos, 34);
@@ -297,9 +257,7 @@ export class Monster {
} }
testarrayofbools(index) { testarrayofbools(index) {
const offset = this.bb.__offset(this.bb_pos, 52); const offset = this.bb.__offset(this.bb_pos, 52);
return offset ? return offset ? !!this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : false;
!!this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) :
false;
} }
testarrayofboolsLength() { testarrayofboolsLength() {
const offset = this.bb.__offset(this.bb_pos, 52); const offset = this.bb.__offset(this.bb_pos, 52);
@@ -307,12 +265,7 @@ export class Monster {
} }
testarrayofboolsArray() { testarrayofboolsArray() {
const offset = this.bb.__offset(this.bb_pos, 52); const offset = this.bb.__offset(this.bb_pos, 52);
return offset ? return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
new Int8Array(
this.bb.bytes().buffer,
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
this.bb.__vector_len(this.bb_pos + offset)) :
null;
} }
testf() { testf() {
const offset = this.bb.__offset(this.bb_pos, 54); const offset = this.bb.__offset(this.bb_pos, 54);
@@ -352,10 +305,7 @@ export class Monster {
} }
testarrayofstring2(index, optionalEncoding) { testarrayofstring2(index, optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 60); const offset = this.bb.__offset(this.bb_pos, 60);
return offset ? this.bb.__string( return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
this.bb.__vector(this.bb_pos + offset) + index * 4,
optionalEncoding) :
null;
} }
testarrayofstring2Length() { testarrayofstring2Length() {
const offset = this.bb.__offset(this.bb_pos, 60); const offset = this.bb.__offset(this.bb_pos, 60);
@@ -363,11 +313,7 @@ export class Monster {
} }
testarrayofsortedstruct(index, obj) { testarrayofsortedstruct(index, obj) {
const offset = this.bb.__offset(this.bb_pos, 62); const offset = this.bb.__offset(this.bb_pos, 62);
return offset ? return offset ? (obj || new Ability()).__init(this.bb.__vector(this.bb_pos + offset) + index * 8, this.bb) : null;
(obj || new Ability())
.__init(
this.bb.__vector(this.bb_pos + offset) + index * 8, this.bb) :
null;
} }
testarrayofsortedstructLength() { testarrayofsortedstructLength() {
const offset = this.bb.__offset(this.bb_pos, 62); const offset = this.bb.__offset(this.bb_pos, 62);
@@ -375,9 +321,7 @@ export class Monster {
} }
flex(index) { flex(index) {
const offset = this.bb.__offset(this.bb_pos, 64); const offset = this.bb.__offset(this.bb_pos, 64);
return offset ? return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) :
0;
} }
flexLength() { flexLength() {
const offset = this.bb.__offset(this.bb_pos, 64); const offset = this.bb.__offset(this.bb_pos, 64);
@@ -385,20 +329,11 @@ export class Monster {
} }
flexArray() { flexArray() {
const offset = this.bb.__offset(this.bb_pos, 64); const offset = this.bb.__offset(this.bb_pos, 64);
return offset ? return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
new Uint8Array(
this.bb.bytes().buffer,
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
this.bb.__vector_len(this.bb_pos + offset)) :
null;
} }
test5(index, obj) { test5(index, obj) {
const offset = this.bb.__offset(this.bb_pos, 66); const offset = this.bb.__offset(this.bb_pos, 66);
return offset ? return offset ? (obj || new Test()).__init(this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) : null;
(obj || new Test())
.__init(
this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) :
null;
} }
test5Length() { test5Length() {
const offset = this.bb.__offset(this.bb_pos, 66); const offset = this.bb.__offset(this.bb_pos, 66);
@@ -406,9 +341,7 @@ export class Monster {
} }
vectorOfLongs(index) { vectorOfLongs(index) {
const offset = this.bb.__offset(this.bb_pos, 68); const offset = this.bb.__offset(this.bb_pos, 68);
return offset ? return offset ? this.bb.readInt64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
this.bb.readInt64(this.bb.__vector(this.bb_pos + offset) + index * 8) :
BigInt(0);
} }
vectorOfLongsLength() { vectorOfLongsLength() {
const offset = this.bb.__offset(this.bb_pos, 68); const offset = this.bb.__offset(this.bb_pos, 68);
@@ -416,9 +349,7 @@ export class Monster {
} }
vectorOfDoubles(index) { vectorOfDoubles(index) {
const offset = this.bb.__offset(this.bb_pos, 70); const offset = this.bb.__offset(this.bb_pos, 70);
return offset ? this.bb.readFloat64( return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
this.bb.__vector(this.bb_pos + offset) + index * 8) :
0;
} }
vectorOfDoublesLength() { vectorOfDoublesLength() {
const offset = this.bb.__offset(this.bb_pos, 70); const offset = this.bb.__offset(this.bb_pos, 70);
@@ -426,29 +357,15 @@ export class Monster {
} }
vectorOfDoublesArray() { vectorOfDoublesArray() {
const offset = this.bb.__offset(this.bb_pos, 70); const offset = this.bb.__offset(this.bb_pos, 70);
return offset ? return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
new Float64Array(
this.bb.bytes().buffer,
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
this.bb.__vector_len(this.bb_pos + offset)) :
null;
} }
parentNamespaceTest(obj) { parentNamespaceTest(obj) {
const offset = this.bb.__offset(this.bb_pos, 72); const offset = this.bb.__offset(this.bb_pos, 72);
return offset ? return offset ? (obj || new InParentNamespace()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
(obj || new InParentNamespace())
.__init(this.bb.__indirect(this.bb_pos + offset), this.bb) :
null;
} }
vectorOfReferrables(index, obj) { vectorOfReferrables(index, obj) {
const offset = this.bb.__offset(this.bb_pos, 74); const offset = this.bb.__offset(this.bb_pos, 74);
return offset ? return offset ? (obj || new Referrable()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
(obj || new Referrable())
.__init(
this.bb.__indirect(
this.bb.__vector(this.bb_pos + offset) + index * 4),
this.bb) :
null;
} }
vectorOfReferrablesLength() { vectorOfReferrablesLength() {
const offset = this.bb.__offset(this.bb_pos, 74); const offset = this.bb.__offset(this.bb_pos, 74);
@@ -468,9 +385,7 @@ export class Monster {
} }
vectorOfWeakReferences(index) { vectorOfWeakReferences(index) {
const offset = this.bb.__offset(this.bb_pos, 78); const offset = this.bb.__offset(this.bb_pos, 78);
return offset ? return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) :
BigInt(0);
} }
vectorOfWeakReferencesLength() { vectorOfWeakReferencesLength() {
const offset = this.bb.__offset(this.bb_pos, 78); const offset = this.bb.__offset(this.bb_pos, 78);
@@ -478,13 +393,7 @@ export class Monster {
} }
vectorOfStrongReferrables(index, obj) { vectorOfStrongReferrables(index, obj) {
const offset = this.bb.__offset(this.bb_pos, 80); const offset = this.bb.__offset(this.bb_pos, 80);
return offset ? return offset ? (obj || new Referrable()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
(obj || new Referrable())
.__init(
this.bb.__indirect(
this.bb.__vector(this.bb_pos + offset) + index * 4),
this.bb) :
null;
} }
vectorOfStrongReferrablesLength() { vectorOfStrongReferrablesLength() {
const offset = this.bb.__offset(this.bb_pos, 80); const offset = this.bb.__offset(this.bb_pos, 80);
@@ -504,9 +413,7 @@ export class Monster {
} }
vectorOfCoOwningReferences(index) { vectorOfCoOwningReferences(index) {
const offset = this.bb.__offset(this.bb_pos, 84); const offset = this.bb.__offset(this.bb_pos, 84);
return offset ? return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) :
BigInt(0);
} }
vectorOfCoOwningReferencesLength() { vectorOfCoOwningReferencesLength() {
const offset = this.bb.__offset(this.bb_pos, 84); const offset = this.bb.__offset(this.bb_pos, 84);
@@ -526,9 +433,7 @@ export class Monster {
} }
vectorOfNonOwningReferences(index) { vectorOfNonOwningReferences(index) {
const offset = this.bb.__offset(this.bb_pos, 88); const offset = this.bb.__offset(this.bb_pos, 88);
return offset ? return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) :
BigInt(0);
} }
vectorOfNonOwningReferencesLength() { vectorOfNonOwningReferencesLength() {
const offset = this.bb.__offset(this.bb_pos, 88); const offset = this.bb.__offset(this.bb_pos, 88);
@@ -536,8 +441,7 @@ export class Monster {
} }
anyUniqueType() { anyUniqueType() {
const offset = this.bb.__offset(this.bb_pos, 90); const offset = this.bb.__offset(this.bb_pos, 90);
return offset ? this.bb.readUint8(this.bb_pos + offset) : return offset ? this.bb.readUint8(this.bb_pos + offset) : AnyUniqueAliases.NONE;
AnyUniqueAliases.NONE;
} }
anyUnique(obj) { anyUnique(obj) {
const offset = this.bb.__offset(this.bb_pos, 92); const offset = this.bb.__offset(this.bb_pos, 92);
@@ -545,8 +449,7 @@ export class Monster {
} }
anyAmbiguousType() { anyAmbiguousType() {
const offset = this.bb.__offset(this.bb_pos, 94); const offset = this.bb.__offset(this.bb_pos, 94);
return offset ? this.bb.readUint8(this.bb_pos + offset) : return offset ? this.bb.readUint8(this.bb_pos + offset) : AnyAmbiguousAliases.NONE;
AnyAmbiguousAliases.NONE;
} }
anyAmbiguous(obj) { anyAmbiguous(obj) {
const offset = this.bb.__offset(this.bb_pos, 96); const offset = this.bb.__offset(this.bb_pos, 96);
@@ -554,9 +457,7 @@ export class Monster {
} }
vectorOfEnums(index) { vectorOfEnums(index) {
const offset = this.bb.__offset(this.bb_pos, 98); const offset = this.bb.__offset(this.bb_pos, 98);
return offset ? return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : null;
this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) :
null;
} }
vectorOfEnumsLength() { vectorOfEnumsLength() {
const offset = this.bb.__offset(this.bb_pos, 98); const offset = this.bb.__offset(this.bb_pos, 98);
@@ -564,12 +465,7 @@ export class Monster {
} }
vectorOfEnumsArray() { vectorOfEnumsArray() {
const offset = this.bb.__offset(this.bb_pos, 98); const offset = this.bb.__offset(this.bb_pos, 98);
return offset ? return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
new Uint8Array(
this.bb.bytes().buffer,
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
this.bb.__vector_len(this.bb_pos + offset)) :
null;
} }
signedEnum() { signedEnum() {
const offset = this.bb.__offset(this.bb_pos, 100); const offset = this.bb.__offset(this.bb_pos, 100);
@@ -585,9 +481,7 @@ export class Monster {
} }
testrequirednestedflatbuffer(index) { testrequirednestedflatbuffer(index) {
const offset = this.bb.__offset(this.bb_pos, 102); const offset = this.bb.__offset(this.bb_pos, 102);
return offset ? return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) :
0;
} }
testrequirednestedflatbufferLength() { testrequirednestedflatbufferLength() {
const offset = this.bb.__offset(this.bb_pos, 102); const offset = this.bb.__offset(this.bb_pos, 102);
@@ -595,22 +489,11 @@ export class Monster {
} }
testrequirednestedflatbufferArray() { testrequirednestedflatbufferArray() {
const offset = this.bb.__offset(this.bb_pos, 102); const offset = this.bb.__offset(this.bb_pos, 102);
return offset ? return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
new Uint8Array(
this.bb.bytes().buffer,
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
this.bb.__vector_len(this.bb_pos + offset)) :
null;
} }
scalarKeySortedTables(index, obj) { scalarKeySortedTables(index, obj) {
const offset = this.bb.__offset(this.bb_pos, 104); const offset = this.bb.__offset(this.bb_pos, 104);
return offset ? return offset ? (obj || new Stat()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
(obj || new Stat())
.__init(
this.bb.__indirect(
this.bb.__vector(this.bb_pos + offset) + index * 4),
this.bb) :
null;
} }
scalarKeySortedTablesLength() { scalarKeySortedTablesLength() {
const offset = this.bb.__offset(this.bb_pos, 104); const offset = this.bb.__offset(this.bb_pos, 104);
@@ -618,8 +501,7 @@ export class Monster {
} }
nativeInline(obj) { nativeInline(obj) {
const offset = this.bb.__offset(this.bb_pos, 106); const offset = this.bb.__offset(this.bb_pos, 106);
return offset ? (obj || new Test()).__init(this.bb_pos + offset, this.bb) : return offset ? (obj || new Test()).__init(this.bb_pos + offset, this.bb) : null;
null;
} }
longEnumNonEnumDefault() { longEnumNonEnumDefault() {
const offset = this.bb.__offset(this.bb_pos, 108); const offset = this.bb.__offset(this.bb_pos, 108);
@@ -977,8 +859,7 @@ export class Monster {
static startVectorOfWeakReferencesVector(builder, numElems) { static startVectorOfWeakReferencesVector(builder, numElems) {
builder.startVector(8, numElems, 8); builder.startVector(8, numElems, 8);
} }
static addVectorOfStrongReferrables( static addVectorOfStrongReferrables(builder, vectorOfStrongReferrablesOffset) {
builder, vectorOfStrongReferrablesOffset) {
builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0); builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0);
} }
static createVectorOfStrongReferrablesVector(builder, data) { static createVectorOfStrongReferrablesVector(builder, data) {
@@ -994,8 +875,7 @@ export class Monster {
static addCoOwningReference(builder, coOwningReference) { static addCoOwningReference(builder, coOwningReference) {
builder.addFieldInt64(39, coOwningReference, BigInt('0')); builder.addFieldInt64(39, coOwningReference, BigInt('0'));
} }
static addVectorOfCoOwningReferences( static addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferencesOffset) {
builder, vectorOfCoOwningReferencesOffset) {
builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0); builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0);
} }
static createVectorOfCoOwningReferencesVector(builder, data) { static createVectorOfCoOwningReferencesVector(builder, data) {
@@ -1011,8 +891,7 @@ export class Monster {
static addNonOwningReference(builder, nonOwningReference) { static addNonOwningReference(builder, nonOwningReference) {
builder.addFieldInt64(41, nonOwningReference, BigInt('0')); builder.addFieldInt64(41, nonOwningReference, BigInt('0'));
} }
static addVectorOfNonOwningReferences( static addVectorOfNonOwningReferences(builder, vectorOfNonOwningReferencesOffset) {
builder, vectorOfNonOwningReferencesOffset) {
builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0); builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0);
} }
static createVectorOfNonOwningReferencesVector(builder, data) { static createVectorOfNonOwningReferencesVector(builder, data) {
@@ -1053,8 +932,7 @@ export class Monster {
static addSignedEnum(builder, signedEnum) { static addSignedEnum(builder, signedEnum) {
builder.addFieldInt8(48, signedEnum, Race.None); builder.addFieldInt8(48, signedEnum, Race.None);
} }
static addTestrequirednestedflatbuffer( static addTestrequirednestedflatbuffer(builder, testrequirednestedflatbufferOffset) {
builder, testrequirednestedflatbufferOffset) {
builder.addFieldOffset(49, testrequirednestedflatbufferOffset, 0); builder.addFieldOffset(49, testrequirednestedflatbufferOffset, 0);
} }
static createTestrequirednestedflatbufferVector(builder, data) { static createTestrequirednestedflatbufferVector(builder, data) {
@@ -1131,107 +1009,32 @@ export class Monster {
return Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer)); return Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer));
} }
unpack() { unpack() {
return new MonsterT( return new MonsterT((this.pos() !== null ? this.pos().unpack() : null), this.mana(), this.hp(), this.name(), this.bb.createScalarList(this.inventory.bind(this), this.inventoryLength()), this.color(), this.testType(), (() => {
(this.pos() !== null ? this.pos().unpack() : null), this.mana(),
this.hp(), this.name(),
this.bb.createScalarList(
this.inventory.bind(this), this.inventoryLength()),
this.color(), this.testType(), (() => {
const temp = unionToAny(this.testType(), this.test.bind(this)); const temp = unionToAny(this.testType(), this.test.bind(this));
if (temp === null) { if (temp === null) {
return null; return null;
} }
return temp.unpack(); return temp.unpack();
})(), })(), this.bb.createObjList(this.test4.bind(this), this.test4Length()), this.bb.createScalarList(this.testarrayofstring.bind(this), this.testarrayofstringLength()), this.bb.createObjList(this.testarrayoftables.bind(this), this.testarrayoftablesLength()), (this.enemy() !== null ? this.enemy().unpack() : null), this.bb.createScalarList(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength()), (this.testempty() !== null ? this.testempty().unpack() : null), this.testbool(), this.testhashs32Fnv1(), this.testhashu32Fnv1(), this.testhashs64Fnv1(), this.testhashu64Fnv1(), this.testhashs32Fnv1a(), this.testhashu32Fnv1a(), this.testhashs64Fnv1a(), this.testhashu64Fnv1a(), this.bb.createScalarList(this.testarrayofbools.bind(this), this.testarrayofboolsLength()), this.testf(), this.testf2(), this.testf3(), this.bb.createScalarList(this.testarrayofstring2.bind(this), this.testarrayofstring2Length()), this.bb.createObjList(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength()), this.bb.createScalarList(this.flex.bind(this), this.flexLength()), this.bb.createObjList(this.test5.bind(this), this.test5Length()), this.bb.createScalarList(this.vectorOfLongs.bind(this), this.vectorOfLongsLength()), this.bb.createScalarList(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength()), (this.parentNamespaceTest() !== null ? this.parentNamespaceTest().unpack() : null), this.bb.createObjList(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength()), this.singleWeakReference(), this.bb.createScalarList(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength()), this.bb.createObjList(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength()), this.coOwningReference(), this.bb.createScalarList(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength()), this.nonOwningReference(), this.bb.createScalarList(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength()), this.anyUniqueType(), (() => {
this.bb.createObjList(this.test4.bind(this), this.test4Length()), const temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this));
this.bb.createScalarList(
this.testarrayofstring.bind(this), this.testarrayofstringLength()),
this.bb.createObjList(
this.testarrayoftables.bind(this), this.testarrayoftablesLength()),
(this.enemy() !== null ? this.enemy().unpack() : null),
this.bb.createScalarList(
this.testnestedflatbuffer.bind(this),
this.testnestedflatbufferLength()),
(this.testempty() !== null ? this.testempty().unpack() : null),
this.testbool(), this.testhashs32Fnv1(), this.testhashu32Fnv1(),
this.testhashs64Fnv1(), this.testhashu64Fnv1(), this.testhashs32Fnv1a(),
this.testhashu32Fnv1a(), this.testhashs64Fnv1a(),
this.testhashu64Fnv1a(),
this.bb.createScalarList(
this.testarrayofbools.bind(this), this.testarrayofboolsLength()),
this.testf(), this.testf2(), this.testf3(),
this.bb.createScalarList(
this.testarrayofstring2.bind(this),
this.testarrayofstring2Length()),
this.bb.createObjList(
this.testarrayofsortedstruct.bind(this),
this.testarrayofsortedstructLength()),
this.bb.createScalarList(this.flex.bind(this), this.flexLength()),
this.bb.createObjList(this.test5.bind(this), this.test5Length()),
this.bb.createScalarList(
this.vectorOfLongs.bind(this), this.vectorOfLongsLength()),
this.bb.createScalarList(
this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength()),
(this.parentNamespaceTest() !== null ?
this.parentNamespaceTest().unpack() :
null),
this.bb.createObjList(
this.vectorOfReferrables.bind(this),
this.vectorOfReferrablesLength()),
this.singleWeakReference(),
this.bb.createScalarList(
this.vectorOfWeakReferences.bind(this),
this.vectorOfWeakReferencesLength()),
this.bb.createObjList(
this.vectorOfStrongReferrables.bind(this),
this.vectorOfStrongReferrablesLength()),
this.coOwningReference(),
this.bb.createScalarList(
this.vectorOfCoOwningReferences.bind(this),
this.vectorOfCoOwningReferencesLength()),
this.nonOwningReference(),
this.bb.createScalarList(
this.vectorOfNonOwningReferences.bind(this),
this.vectorOfNonOwningReferencesLength()),
this.anyUniqueType(), (() => {
const temp = unionToAnyUniqueAliases(
this.anyUniqueType(), this.anyUnique.bind(this));
if (temp === null) { if (temp === null) {
return null; return null;
} }
return temp.unpack(); return temp.unpack();
})(), })(), this.anyAmbiguousType(), (() => {
this.anyAmbiguousType(), (() => { const temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
const temp = unionToAnyAmbiguousAliases(
this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
if (temp === null) { if (temp === null) {
return null; return null;
} }
return temp.unpack(); return temp.unpack();
})(), })(), this.bb.createScalarList(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength()), this.signedEnum(), this.bb.createScalarList(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength()), this.bb.createObjList(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength()), (this.nativeInline() !== null ? this.nativeInline().unpack() : null), this.longEnumNonEnumDefault(), this.longEnumNormalDefault(), this.nanDefault(), this.infDefault(), this.positiveInfDefault(), this.infinityDefault(), this.positiveInfinityDefault(), this.negativeInfDefault(), this.negativeInfinityDefault(), this.doubleInfDefault());
this.bb.createScalarList(
this.vectorOfEnums.bind(this), this.vectorOfEnumsLength()),
this.signedEnum(),
this.bb.createScalarList(
this.testrequirednestedflatbuffer.bind(this),
this.testrequirednestedflatbufferLength()),
this.bb.createObjList(
this.scalarKeySortedTables.bind(this),
this.scalarKeySortedTablesLength()),
(this.nativeInline() !== null ? this.nativeInline().unpack() : null),
this.longEnumNonEnumDefault(), this.longEnumNormalDefault(),
this.nanDefault(), this.infDefault(), this.positiveInfDefault(),
this.infinityDefault(), this.positiveInfinityDefault(),
this.negativeInfDefault(), this.negativeInfinityDefault(),
this.doubleInfDefault());
} }
unpackTo(_o) { unpackTo(_o) {
_o.pos = (this.pos() !== null ? this.pos().unpack() : null); _o.pos = (this.pos() !== null ? this.pos().unpack() : null);
_o.mana = this.mana(); _o.mana = this.mana();
_o.hp = this.hp(); _o.hp = this.hp();
_o.name = this.name(); _o.name = this.name();
_o.inventory = this.bb.createScalarList( _o.inventory = this.bb.createScalarList(this.inventory.bind(this), this.inventoryLength());
this.inventory.bind(this), this.inventoryLength());
_o.color = this.color(); _o.color = this.color();
_o.testType = this.testType(); _o.testType = this.testType();
_o.test = (() => { _o.test = (() => {
@@ -1242,16 +1045,11 @@ export class Monster {
return temp.unpack(); return temp.unpack();
})(); })();
_o.test4 = this.bb.createObjList(this.test4.bind(this), this.test4Length()); _o.test4 = this.bb.createObjList(this.test4.bind(this), this.test4Length());
_o.testarrayofstring = this.bb.createScalarList( _o.testarrayofstring = this.bb.createScalarList(this.testarrayofstring.bind(this), this.testarrayofstringLength());
this.testarrayofstring.bind(this), this.testarrayofstringLength()); _o.testarrayoftables = this.bb.createObjList(this.testarrayoftables.bind(this), this.testarrayoftablesLength());
_o.testarrayoftables = this.bb.createObjList(
this.testarrayoftables.bind(this), this.testarrayoftablesLength());
_o.enemy = (this.enemy() !== null ? this.enemy().unpack() : null); _o.enemy = (this.enemy() !== null ? this.enemy().unpack() : null);
_o.testnestedflatbuffer = this.bb.createScalarList( _o.testnestedflatbuffer = this.bb.createScalarList(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength());
this.testnestedflatbuffer.bind(this), _o.testempty = (this.testempty() !== null ? this.testempty().unpack() : null);
this.testnestedflatbufferLength());
_o.testempty =
(this.testempty() !== null ? this.testempty().unpack() : null);
_o.testbool = this.testbool(); _o.testbool = this.testbool();
_o.testhashs32Fnv1 = this.testhashs32Fnv1(); _o.testhashs32Fnv1 = this.testhashs32Fnv1();
_o.testhashu32Fnv1 = this.testhashu32Fnv1(); _o.testhashu32Fnv1 = this.testhashu32Fnv1();
@@ -1261,47 +1059,28 @@ export class Monster {
_o.testhashu32Fnv1a = this.testhashu32Fnv1a(); _o.testhashu32Fnv1a = this.testhashu32Fnv1a();
_o.testhashs64Fnv1a = this.testhashs64Fnv1a(); _o.testhashs64Fnv1a = this.testhashs64Fnv1a();
_o.testhashu64Fnv1a = this.testhashu64Fnv1a(); _o.testhashu64Fnv1a = this.testhashu64Fnv1a();
_o.testarrayofbools = this.bb.createScalarList( _o.testarrayofbools = this.bb.createScalarList(this.testarrayofbools.bind(this), this.testarrayofboolsLength());
this.testarrayofbools.bind(this), this.testarrayofboolsLength());
_o.testf = this.testf(); _o.testf = this.testf();
_o.testf2 = this.testf2(); _o.testf2 = this.testf2();
_o.testf3 = this.testf3(); _o.testf3 = this.testf3();
_o.testarrayofstring2 = this.bb.createScalarList( _o.testarrayofstring2 = this.bb.createScalarList(this.testarrayofstring2.bind(this), this.testarrayofstring2Length());
this.testarrayofstring2.bind(this), this.testarrayofstring2Length()); _o.testarrayofsortedstruct = this.bb.createObjList(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength());
_o.testarrayofsortedstruct = this.bb.createObjList(
this.testarrayofsortedstruct.bind(this),
this.testarrayofsortedstructLength());
_o.flex = this.bb.createScalarList(this.flex.bind(this), this.flexLength()); _o.flex = this.bb.createScalarList(this.flex.bind(this), this.flexLength());
_o.test5 = this.bb.createObjList(this.test5.bind(this), this.test5Length()); _o.test5 = this.bb.createObjList(this.test5.bind(this), this.test5Length());
_o.vectorOfLongs = this.bb.createScalarList( _o.vectorOfLongs = this.bb.createScalarList(this.vectorOfLongs.bind(this), this.vectorOfLongsLength());
this.vectorOfLongs.bind(this), this.vectorOfLongsLength()); _o.vectorOfDoubles = this.bb.createScalarList(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength());
_o.vectorOfDoubles = this.bb.createScalarList( _o.parentNamespaceTest = (this.parentNamespaceTest() !== null ? this.parentNamespaceTest().unpack() : null);
this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength()); _o.vectorOfReferrables = this.bb.createObjList(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength());
_o.parentNamespaceTest =
(this.parentNamespaceTest() !== null ?
this.parentNamespaceTest().unpack() :
null);
_o.vectorOfReferrables = this.bb.createObjList(
this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength());
_o.singleWeakReference = this.singleWeakReference(); _o.singleWeakReference = this.singleWeakReference();
_o.vectorOfWeakReferences = this.bb.createScalarList( _o.vectorOfWeakReferences = this.bb.createScalarList(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength());
this.vectorOfWeakReferences.bind(this), _o.vectorOfStrongReferrables = this.bb.createObjList(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength());
this.vectorOfWeakReferencesLength());
_o.vectorOfStrongReferrables = this.bb.createObjList(
this.vectorOfStrongReferrables.bind(this),
this.vectorOfStrongReferrablesLength());
_o.coOwningReference = this.coOwningReference(); _o.coOwningReference = this.coOwningReference();
_o.vectorOfCoOwningReferences = this.bb.createScalarList( _o.vectorOfCoOwningReferences = this.bb.createScalarList(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength());
this.vectorOfCoOwningReferences.bind(this),
this.vectorOfCoOwningReferencesLength());
_o.nonOwningReference = this.nonOwningReference(); _o.nonOwningReference = this.nonOwningReference();
_o.vectorOfNonOwningReferences = this.bb.createScalarList( _o.vectorOfNonOwningReferences = this.bb.createScalarList(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength());
this.vectorOfNonOwningReferences.bind(this),
this.vectorOfNonOwningReferencesLength());
_o.anyUniqueType = this.anyUniqueType(); _o.anyUniqueType = this.anyUniqueType();
_o.anyUnique = (() => { _o.anyUnique = (() => {
const temp = unionToAnyUniqueAliases( const temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this));
this.anyUniqueType(), this.anyUnique.bind(this));
if (temp === null) { if (temp === null) {
return null; return null;
} }
@@ -1309,24 +1088,17 @@ export class Monster {
})(); })();
_o.anyAmbiguousType = this.anyAmbiguousType(); _o.anyAmbiguousType = this.anyAmbiguousType();
_o.anyAmbiguous = (() => { _o.anyAmbiguous = (() => {
const temp = unionToAnyAmbiguousAliases( const temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
if (temp === null) { if (temp === null) {
return null; return null;
} }
return temp.unpack(); return temp.unpack();
})(); })();
_o.vectorOfEnums = this.bb.createScalarList( _o.vectorOfEnums = this.bb.createScalarList(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength());
this.vectorOfEnums.bind(this), this.vectorOfEnumsLength());
_o.signedEnum = this.signedEnum(); _o.signedEnum = this.signedEnum();
_o.testrequirednestedflatbuffer = this.bb.createScalarList( _o.testrequirednestedflatbuffer = this.bb.createScalarList(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength());
this.testrequirednestedflatbuffer.bind(this), _o.scalarKeySortedTables = this.bb.createObjList(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength());
this.testrequirednestedflatbufferLength()); _o.nativeInline = (this.nativeInline() !== null ? this.nativeInline().unpack() : null);
_o.scalarKeySortedTables = this.bb.createObjList(
this.scalarKeySortedTables.bind(this),
this.scalarKeySortedTablesLength());
_o.nativeInline =
(this.nativeInline() !== null ? this.nativeInline().unpack() : null);
_o.longEnumNonEnumDefault = this.longEnumNonEnumDefault(); _o.longEnumNonEnumDefault = this.longEnumNonEnumDefault();
_o.longEnumNormalDefault = this.longEnumNormalDefault(); _o.longEnumNormalDefault = this.longEnumNormalDefault();
_o.nanDefault = this.nanDefault(); _o.nanDefault = this.nanDefault();
@@ -1340,31 +1112,7 @@ export class Monster {
} }
} }
export class MonsterT { export class MonsterT {
constructor( constructor(pos = null, mana = 150, hp = 100, name = null, inventory = [], color = Color.Blue, testType = Any.NONE, test = null, test4 = [], testarrayofstring = [], testarrayoftables = [], enemy = null, testnestedflatbuffer = [], testempty = null, testbool = false, testhashs32Fnv1 = 0, testhashu32Fnv1 = 0, testhashs64Fnv1 = BigInt('0'), testhashu64Fnv1 = BigInt('0'), testhashs32Fnv1a = 0, testhashu32Fnv1a = 0, testhashs64Fnv1a = BigInt('0'), testhashu64Fnv1a = BigInt('0'), testarrayofbools = [], testf = 3.14159, testf2 = 3.0, testf3 = 0.0, testarrayofstring2 = [], testarrayofsortedstruct = [], flex = [], test5 = [], vectorOfLongs = [], vectorOfDoubles = [], parentNamespaceTest = null, vectorOfReferrables = [], singleWeakReference = BigInt('0'), vectorOfWeakReferences = [], vectorOfStrongReferrables = [], coOwningReference = BigInt('0'), vectorOfCoOwningReferences = [], nonOwningReference = BigInt('0'), vectorOfNonOwningReferences = [], anyUniqueType = AnyUniqueAliases.NONE, anyUnique = null, anyAmbiguousType = AnyAmbiguousAliases.NONE, anyAmbiguous = null, vectorOfEnums = [], signedEnum = Race.None, testrequirednestedflatbuffer = [], scalarKeySortedTables = [], nativeInline = null, longEnumNonEnumDefault = BigInt('0'), longEnumNormalDefault = BigInt('2'), nanDefault = NaN, infDefault = Infinity, positiveInfDefault = Infinity, infinityDefault = Infinity, positiveInfinityDefault = Infinity, negativeInfDefault = -Infinity, negativeInfinityDefault = -Infinity, doubleInfDefault = Infinity) {
pos = null, mana = 150, hp = 100, name = null, inventory = [],
color = Color.Blue, testType = Any.NONE, test = null, test4 = [],
testarrayofstring = [], testarrayoftables = [], enemy = null,
testnestedflatbuffer = [], testempty = null, testbool = false,
testhashs32Fnv1 = 0, testhashu32Fnv1 = 0, testhashs64Fnv1 = BigInt('0'),
testhashu64Fnv1 = BigInt('0'), testhashs32Fnv1a = 0, testhashu32Fnv1a = 0,
testhashs64Fnv1a = BigInt('0'), testhashu64Fnv1a = BigInt('0'),
testarrayofbools = [], testf = 3.14159, testf2 = 3.0, testf3 = 0.0,
testarrayofstring2 = [], testarrayofsortedstruct = [], flex = [],
test5 = [], vectorOfLongs = [], vectorOfDoubles = [],
parentNamespaceTest = null, vectorOfReferrables = [],
singleWeakReference = BigInt('0'), vectorOfWeakReferences = [],
vectorOfStrongReferrables = [], coOwningReference = BigInt('0'),
vectorOfCoOwningReferences = [], nonOwningReference = BigInt('0'),
vectorOfNonOwningReferences = [], anyUniqueType = AnyUniqueAliases.NONE,
anyUnique = null, anyAmbiguousType = AnyAmbiguousAliases.NONE,
anyAmbiguous = null, vectorOfEnums = [], signedEnum = Race.None,
testrequirednestedflatbuffer = [], scalarKeySortedTables = [],
nativeInline = null, longEnumNonEnumDefault = BigInt('0'),
longEnumNormalDefault = BigInt('2'), nanDefault = NaN,
infDefault = Infinity, positiveInfDefault = Infinity,
infinityDefault = Infinity, positiveInfinityDefault = Infinity,
negativeInfDefault = -Infinity, negativeInfinityDefault = -Infinity,
doubleInfDefault = Infinity) {
this.pos = pos; this.pos = pos;
this.mana = mana; this.mana = mana;
this.hp = hp; this.hp = hp;
@@ -1431,58 +1179,30 @@ export class MonsterT {
const name = (this.name !== null ? builder.createString(this.name) : 0); const name = (this.name !== null ? builder.createString(this.name) : 0);
const inventory = Monster.createInventoryVector(builder, this.inventory); const inventory = Monster.createInventoryVector(builder, this.inventory);
const test = builder.createObjectOffset(this.test); const test = builder.createObjectOffset(this.test);
const test4 = const test4 = builder.createStructOffsetList(this.test4, Monster.startTest4Vector);
builder.createStructOffsetList(this.test4, Monster.startTest4Vector); const testarrayofstring = Monster.createTestarrayofstringVector(builder, builder.createObjectOffsetList(this.testarrayofstring));
const testarrayofstring = Monster.createTestarrayofstringVector( const testarrayoftables = Monster.createTestarrayoftablesVector(builder, builder.createObjectOffsetList(this.testarrayoftables));
builder, builder.createObjectOffsetList(this.testarrayofstring));
const testarrayoftables = Monster.createTestarrayoftablesVector(
builder, builder.createObjectOffsetList(this.testarrayoftables));
const enemy = (this.enemy !== null ? this.enemy.pack(builder) : 0); const enemy = (this.enemy !== null ? this.enemy.pack(builder) : 0);
const testnestedflatbuffer = Monster.createTestnestedflatbufferVector( const testnestedflatbuffer = Monster.createTestnestedflatbufferVector(builder, this.testnestedflatbuffer);
builder, this.testnestedflatbuffer); const testempty = (this.testempty !== null ? this.testempty.pack(builder) : 0);
const testempty = const testarrayofbools = Monster.createTestarrayofboolsVector(builder, this.testarrayofbools);
(this.testempty !== null ? this.testempty.pack(builder) : 0); const testarrayofstring2 = Monster.createTestarrayofstring2Vector(builder, builder.createObjectOffsetList(this.testarrayofstring2));
const testarrayofbools = const testarrayofsortedstruct = builder.createStructOffsetList(this.testarrayofsortedstruct, Monster.startTestarrayofsortedstructVector);
Monster.createTestarrayofboolsVector(builder, this.testarrayofbools);
const testarrayofstring2 = Monster.createTestarrayofstring2Vector(
builder, builder.createObjectOffsetList(this.testarrayofstring2));
const testarrayofsortedstruct = builder.createStructOffsetList(
this.testarrayofsortedstruct,
Monster.startTestarrayofsortedstructVector);
const flex = Monster.createFlexVector(builder, this.flex); const flex = Monster.createFlexVector(builder, this.flex);
const test5 = const test5 = builder.createStructOffsetList(this.test5, Monster.startTest5Vector);
builder.createStructOffsetList(this.test5, Monster.startTest5Vector); const vectorOfLongs = Monster.createVectorOfLongsVector(builder, this.vectorOfLongs);
const vectorOfLongs = const vectorOfDoubles = Monster.createVectorOfDoublesVector(builder, this.vectorOfDoubles);
Monster.createVectorOfLongsVector(builder, this.vectorOfLongs); const parentNamespaceTest = (this.parentNamespaceTest !== null ? this.parentNamespaceTest.pack(builder) : 0);
const vectorOfDoubles = const vectorOfReferrables = Monster.createVectorOfReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfReferrables));
Monster.createVectorOfDoublesVector(builder, this.vectorOfDoubles); const vectorOfWeakReferences = Monster.createVectorOfWeakReferencesVector(builder, this.vectorOfWeakReferences);
const parentNamespaceTest = const vectorOfStrongReferrables = Monster.createVectorOfStrongReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfStrongReferrables));
(this.parentNamespaceTest !== null ? const vectorOfCoOwningReferences = Monster.createVectorOfCoOwningReferencesVector(builder, this.vectorOfCoOwningReferences);
this.parentNamespaceTest.pack(builder) : const vectorOfNonOwningReferences = Monster.createVectorOfNonOwningReferencesVector(builder, this.vectorOfNonOwningReferences);
0);
const vectorOfReferrables = Monster.createVectorOfReferrablesVector(
builder, builder.createObjectOffsetList(this.vectorOfReferrables));
const vectorOfWeakReferences = Monster.createVectorOfWeakReferencesVector(
builder, this.vectorOfWeakReferences);
const vectorOfStrongReferrables =
Monster.createVectorOfStrongReferrablesVector(
builder,
builder.createObjectOffsetList(this.vectorOfStrongReferrables));
const vectorOfCoOwningReferences =
Monster.createVectorOfCoOwningReferencesVector(
builder, this.vectorOfCoOwningReferences);
const vectorOfNonOwningReferences =
Monster.createVectorOfNonOwningReferencesVector(
builder, this.vectorOfNonOwningReferences);
const anyUnique = builder.createObjectOffset(this.anyUnique); const anyUnique = builder.createObjectOffset(this.anyUnique);
const anyAmbiguous = builder.createObjectOffset(this.anyAmbiguous); const anyAmbiguous = builder.createObjectOffset(this.anyAmbiguous);
const vectorOfEnums = const vectorOfEnums = Monster.createVectorOfEnumsVector(builder, this.vectorOfEnums);
Monster.createVectorOfEnumsVector(builder, this.vectorOfEnums); const testrequirednestedflatbuffer = Monster.createTestrequirednestedflatbufferVector(builder, this.testrequirednestedflatbuffer);
const testrequirednestedflatbuffer = const scalarKeySortedTables = Monster.createScalarKeySortedTablesVector(builder, builder.createObjectOffsetList(this.scalarKeySortedTables));
Monster.createTestrequirednestedflatbufferVector(
builder, this.testrequirednestedflatbuffer);
const scalarKeySortedTables = Monster.createScalarKeySortedTablesVector(
builder, builder.createObjectOffsetList(this.scalarKeySortedTables));
Monster.startMonster(builder); Monster.startMonster(builder);
Monster.addPos(builder, (this.pos !== null ? this.pos.pack(builder) : 0)); Monster.addPos(builder, (this.pos !== null ? this.pos.pack(builder) : 0));
Monster.addMana(builder, this.mana); Monster.addMana(builder, this.mana);
@@ -1525,20 +1245,16 @@ export class MonsterT {
Monster.addCoOwningReference(builder, this.coOwningReference); Monster.addCoOwningReference(builder, this.coOwningReference);
Monster.addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferences); Monster.addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferences);
Monster.addNonOwningReference(builder, this.nonOwningReference); Monster.addNonOwningReference(builder, this.nonOwningReference);
Monster.addVectorOfNonOwningReferences( Monster.addVectorOfNonOwningReferences(builder, vectorOfNonOwningReferences);
builder, vectorOfNonOwningReferences);
Monster.addAnyUniqueType(builder, this.anyUniqueType); Monster.addAnyUniqueType(builder, this.anyUniqueType);
Monster.addAnyUnique(builder, anyUnique); Monster.addAnyUnique(builder, anyUnique);
Monster.addAnyAmbiguousType(builder, this.anyAmbiguousType); Monster.addAnyAmbiguousType(builder, this.anyAmbiguousType);
Monster.addAnyAmbiguous(builder, anyAmbiguous); Monster.addAnyAmbiguous(builder, anyAmbiguous);
Monster.addVectorOfEnums(builder, vectorOfEnums); Monster.addVectorOfEnums(builder, vectorOfEnums);
Monster.addSignedEnum(builder, this.signedEnum); Monster.addSignedEnum(builder, this.signedEnum);
Monster.addTestrequirednestedflatbuffer( Monster.addTestrequirednestedflatbuffer(builder, testrequirednestedflatbuffer);
builder, testrequirednestedflatbuffer);
Monster.addScalarKeySortedTables(builder, scalarKeySortedTables); Monster.addScalarKeySortedTables(builder, scalarKeySortedTables);
Monster.addNativeInline( Monster.addNativeInline(builder, (this.nativeInline !== null ? this.nativeInline.pack(builder) : 0));
builder,
(this.nativeInline !== null ? this.nativeInline.pack(builder) : 0));
Monster.addLongEnumNonEnumDefault(builder, this.longEnumNonEnumDefault); Monster.addLongEnumNonEnumDefault(builder, this.longEnumNonEnumDefault);
Monster.addLongEnumNormalDefault(builder, this.longEnumNormalDefault); Monster.addLongEnumNormalDefault(builder, this.longEnumNormalDefault);
Monster.addNanDefault(builder, this.nanDefault); Monster.addNanDefault(builder, this.nanDefault);

View File

@@ -24,7 +24,7 @@ import { InParentNamespace, InParentNamespaceT } from '../in-parent-namespace.js
*/ */
export class Monster implements flatbuffers.IUnpackableObject<MonsterT> { export class Monster implements flatbuffers.IUnpackableObject<MonsterT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):Monster { __init(i:number, bb:flatbuffers.ByteBuffer):Monster {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -817,27 +817,27 @@ static getFullyQualifiedName(): "MyGame.Example.Monster" {
return 'MyGame.Example.Monster'; return 'MyGame.Example.Monster';
} }
static startMonster(builder:flatbuffers.Builder) { static startMonster(builder:flatbuffers.Builder):void {
builder.startObject(62); builder.startObject(62);
} }
static addPos(builder:flatbuffers.Builder, posOffset:flatbuffers.Offset) { static addPos(builder:flatbuffers.Builder, posOffset:flatbuffers.Offset):void {
builder.addFieldStruct(0, posOffset, 0); builder.addFieldStruct(0, posOffset, 0);
} }
static addMana(builder:flatbuffers.Builder, mana:number) { static addMana(builder:flatbuffers.Builder, mana:number):void {
builder.addFieldInt16(1, mana, 150); builder.addFieldInt16(1, mana, 150);
} }
static addHp(builder:flatbuffers.Builder, hp:number) { static addHp(builder:flatbuffers.Builder, hp:number):void {
builder.addFieldInt16(2, hp, 100); builder.addFieldInt16(2, hp, 100);
} }
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) { static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset):void {
builder.addFieldOffset(3, nameOffset, 0); builder.addFieldOffset(3, nameOffset, 0);
} }
static addInventory(builder:flatbuffers.Builder, inventoryOffset:flatbuffers.Offset) { static addInventory(builder:flatbuffers.Builder, inventoryOffset:flatbuffers.Offset):void {
builder.addFieldOffset(5, inventoryOffset, 0); builder.addFieldOffset(5, inventoryOffset, 0);
} }
@@ -849,31 +849,31 @@ static createInventoryVector(builder:flatbuffers.Builder, data:number[]|Uint8Arr
return builder.endVector(); return builder.endVector();
} }
static startInventoryVector(builder:flatbuffers.Builder, numElems:number) { static startInventoryVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(1, numElems, 1); builder.startVector(1, numElems, 1);
} }
static addColor(builder:flatbuffers.Builder, color:Color) { static addColor(builder:flatbuffers.Builder, color:Color):void {
builder.addFieldInt8(6, color, Color.Blue); builder.addFieldInt8(6, color, Color.Blue);
} }
static addTestType(builder:flatbuffers.Builder, testType:Any) { static addTestType(builder:flatbuffers.Builder, testType:Any):void {
builder.addFieldInt8(7, testType, Any.NONE); builder.addFieldInt8(7, testType, Any.NONE);
} }
static addTest(builder:flatbuffers.Builder, testOffset:flatbuffers.Offset) { static addTest(builder:flatbuffers.Builder, testOffset:flatbuffers.Offset):void {
builder.addFieldOffset(8, testOffset, 0); builder.addFieldOffset(8, testOffset, 0);
} }
static addTest4(builder:flatbuffers.Builder, test4Offset:flatbuffers.Offset) { static addTest4(builder:flatbuffers.Builder, test4Offset:flatbuffers.Offset):void {
builder.addFieldOffset(9, test4Offset, 0); builder.addFieldOffset(9, test4Offset, 0);
} }
static startTest4Vector(builder:flatbuffers.Builder, numElems:number) { static startTest4Vector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 2); builder.startVector(4, numElems, 2);
} }
static addTestarrayofstring(builder:flatbuffers.Builder, testarrayofstringOffset:flatbuffers.Offset) { static addTestarrayofstring(builder:flatbuffers.Builder, testarrayofstringOffset:flatbuffers.Offset):void {
builder.addFieldOffset(10, testarrayofstringOffset, 0); builder.addFieldOffset(10, testarrayofstringOffset, 0);
} }
@@ -885,11 +885,11 @@ static createTestarrayofstringVector(builder:flatbuffers.Builder, data:flatbuffe
return builder.endVector(); return builder.endVector();
} }
static startTestarrayofstringVector(builder:flatbuffers.Builder, numElems:number) { static startTestarrayofstringVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 4); builder.startVector(4, numElems, 4);
} }
static addTestarrayoftables(builder:flatbuffers.Builder, testarrayoftablesOffset:flatbuffers.Offset) { static addTestarrayoftables(builder:flatbuffers.Builder, testarrayoftablesOffset:flatbuffers.Offset):void {
builder.addFieldOffset(11, testarrayoftablesOffset, 0); builder.addFieldOffset(11, testarrayoftablesOffset, 0);
} }
@@ -901,15 +901,15 @@ static createTestarrayoftablesVector(builder:flatbuffers.Builder, data:flatbuffe
return builder.endVector(); return builder.endVector();
} }
static startTestarrayoftablesVector(builder:flatbuffers.Builder, numElems:number) { static startTestarrayoftablesVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 4); builder.startVector(4, numElems, 4);
} }
static addEnemy(builder:flatbuffers.Builder, enemyOffset:flatbuffers.Offset) { static addEnemy(builder:flatbuffers.Builder, enemyOffset:flatbuffers.Offset):void {
builder.addFieldOffset(12, enemyOffset, 0); builder.addFieldOffset(12, enemyOffset, 0);
} }
static addTestnestedflatbuffer(builder:flatbuffers.Builder, testnestedflatbufferOffset:flatbuffers.Offset) { static addTestnestedflatbuffer(builder:flatbuffers.Builder, testnestedflatbufferOffset:flatbuffers.Offset):void {
builder.addFieldOffset(13, testnestedflatbufferOffset, 0); builder.addFieldOffset(13, testnestedflatbufferOffset, 0);
} }
@@ -921,51 +921,51 @@ static createTestnestedflatbufferVector(builder:flatbuffers.Builder, data:number
return builder.endVector(); return builder.endVector();
} }
static startTestnestedflatbufferVector(builder:flatbuffers.Builder, numElems:number) { static startTestnestedflatbufferVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(1, numElems, 1); builder.startVector(1, numElems, 1);
} }
static addTestempty(builder:flatbuffers.Builder, testemptyOffset:flatbuffers.Offset) { static addTestempty(builder:flatbuffers.Builder, testemptyOffset:flatbuffers.Offset):void {
builder.addFieldOffset(14, testemptyOffset, 0); builder.addFieldOffset(14, testemptyOffset, 0);
} }
static addTestbool(builder:flatbuffers.Builder, testbool:boolean) { static addTestbool(builder:flatbuffers.Builder, testbool:boolean):void {
builder.addFieldInt8(15, +testbool, +false); builder.addFieldInt8(15, +testbool, +false);
} }
static addTesthashs32Fnv1(builder:flatbuffers.Builder, testhashs32Fnv1:number) { static addTesthashs32Fnv1(builder:flatbuffers.Builder, testhashs32Fnv1:number):void {
builder.addFieldInt32(16, testhashs32Fnv1, 0); builder.addFieldInt32(16, testhashs32Fnv1, 0);
} }
static addTesthashu32Fnv1(builder:flatbuffers.Builder, testhashu32Fnv1:number) { static addTesthashu32Fnv1(builder:flatbuffers.Builder, testhashu32Fnv1:number):void {
builder.addFieldInt32(17, testhashu32Fnv1, 0); builder.addFieldInt32(17, testhashu32Fnv1, 0);
} }
static addTesthashs64Fnv1(builder:flatbuffers.Builder, testhashs64Fnv1:bigint) { static addTesthashs64Fnv1(builder:flatbuffers.Builder, testhashs64Fnv1:bigint):void {
builder.addFieldInt64(18, testhashs64Fnv1, BigInt('0')); builder.addFieldInt64(18, testhashs64Fnv1, BigInt('0'));
} }
static addTesthashu64Fnv1(builder:flatbuffers.Builder, testhashu64Fnv1:bigint) { static addTesthashu64Fnv1(builder:flatbuffers.Builder, testhashu64Fnv1:bigint):void {
builder.addFieldInt64(19, testhashu64Fnv1, BigInt('0')); builder.addFieldInt64(19, testhashu64Fnv1, BigInt('0'));
} }
static addTesthashs32Fnv1a(builder:flatbuffers.Builder, testhashs32Fnv1a:number) { static addTesthashs32Fnv1a(builder:flatbuffers.Builder, testhashs32Fnv1a:number):void {
builder.addFieldInt32(20, testhashs32Fnv1a, 0); builder.addFieldInt32(20, testhashs32Fnv1a, 0);
} }
static addTesthashu32Fnv1a(builder:flatbuffers.Builder, testhashu32Fnv1a:number) { static addTesthashu32Fnv1a(builder:flatbuffers.Builder, testhashu32Fnv1a:number):void {
builder.addFieldInt32(21, testhashu32Fnv1a, 0); builder.addFieldInt32(21, testhashu32Fnv1a, 0);
} }
static addTesthashs64Fnv1a(builder:flatbuffers.Builder, testhashs64Fnv1a:bigint) { static addTesthashs64Fnv1a(builder:flatbuffers.Builder, testhashs64Fnv1a:bigint):void {
builder.addFieldInt64(22, testhashs64Fnv1a, BigInt('0')); builder.addFieldInt64(22, testhashs64Fnv1a, BigInt('0'));
} }
static addTesthashu64Fnv1a(builder:flatbuffers.Builder, testhashu64Fnv1a:bigint) { static addTesthashu64Fnv1a(builder:flatbuffers.Builder, testhashu64Fnv1a:bigint):void {
builder.addFieldInt64(23, testhashu64Fnv1a, BigInt('0')); builder.addFieldInt64(23, testhashu64Fnv1a, BigInt('0'));
} }
static addTestarrayofbools(builder:flatbuffers.Builder, testarrayofboolsOffset:flatbuffers.Offset) { static addTestarrayofbools(builder:flatbuffers.Builder, testarrayofboolsOffset:flatbuffers.Offset):void {
builder.addFieldOffset(24, testarrayofboolsOffset, 0); builder.addFieldOffset(24, testarrayofboolsOffset, 0);
} }
@@ -977,23 +977,23 @@ static createTestarrayofboolsVector(builder:flatbuffers.Builder, data:boolean[])
return builder.endVector(); return builder.endVector();
} }
static startTestarrayofboolsVector(builder:flatbuffers.Builder, numElems:number) { static startTestarrayofboolsVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(1, numElems, 1); builder.startVector(1, numElems, 1);
} }
static addTestf(builder:flatbuffers.Builder, testf:number) { static addTestf(builder:flatbuffers.Builder, testf:number):void {
builder.addFieldFloat32(25, testf, 3.14159); builder.addFieldFloat32(25, testf, 3.14159);
} }
static addTestf2(builder:flatbuffers.Builder, testf2:number) { static addTestf2(builder:flatbuffers.Builder, testf2:number):void {
builder.addFieldFloat32(26, testf2, 3.0); builder.addFieldFloat32(26, testf2, 3.0);
} }
static addTestf3(builder:flatbuffers.Builder, testf3:number) { static addTestf3(builder:flatbuffers.Builder, testf3:number):void {
builder.addFieldFloat32(27, testf3, 0.0); builder.addFieldFloat32(27, testf3, 0.0);
} }
static addTestarrayofstring2(builder:flatbuffers.Builder, testarrayofstring2Offset:flatbuffers.Offset) { static addTestarrayofstring2(builder:flatbuffers.Builder, testarrayofstring2Offset:flatbuffers.Offset):void {
builder.addFieldOffset(28, testarrayofstring2Offset, 0); builder.addFieldOffset(28, testarrayofstring2Offset, 0);
} }
@@ -1005,19 +1005,19 @@ static createTestarrayofstring2Vector(builder:flatbuffers.Builder, data:flatbuff
return builder.endVector(); return builder.endVector();
} }
static startTestarrayofstring2Vector(builder:flatbuffers.Builder, numElems:number) { static startTestarrayofstring2Vector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 4); builder.startVector(4, numElems, 4);
} }
static addTestarrayofsortedstruct(builder:flatbuffers.Builder, testarrayofsortedstructOffset:flatbuffers.Offset) { static addTestarrayofsortedstruct(builder:flatbuffers.Builder, testarrayofsortedstructOffset:flatbuffers.Offset):void {
builder.addFieldOffset(29, testarrayofsortedstructOffset, 0); builder.addFieldOffset(29, testarrayofsortedstructOffset, 0);
} }
static startTestarrayofsortedstructVector(builder:flatbuffers.Builder, numElems:number) { static startTestarrayofsortedstructVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(8, numElems, 4); builder.startVector(8, numElems, 4);
} }
static addFlex(builder:flatbuffers.Builder, flexOffset:flatbuffers.Offset) { static addFlex(builder:flatbuffers.Builder, flexOffset:flatbuffers.Offset):void {
builder.addFieldOffset(30, flexOffset, 0); builder.addFieldOffset(30, flexOffset, 0);
} }
@@ -1029,19 +1029,19 @@ static createFlexVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):f
return builder.endVector(); return builder.endVector();
} }
static startFlexVector(builder:flatbuffers.Builder, numElems:number) { static startFlexVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(1, numElems, 1); builder.startVector(1, numElems, 1);
} }
static addTest5(builder:flatbuffers.Builder, test5Offset:flatbuffers.Offset) { static addTest5(builder:flatbuffers.Builder, test5Offset:flatbuffers.Offset):void {
builder.addFieldOffset(31, test5Offset, 0); builder.addFieldOffset(31, test5Offset, 0);
} }
static startTest5Vector(builder:flatbuffers.Builder, numElems:number) { static startTest5Vector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 2); builder.startVector(4, numElems, 2);
} }
static addVectorOfLongs(builder:flatbuffers.Builder, vectorOfLongsOffset:flatbuffers.Offset) { static addVectorOfLongs(builder:flatbuffers.Builder, vectorOfLongsOffset:flatbuffers.Offset):void {
builder.addFieldOffset(32, vectorOfLongsOffset, 0); builder.addFieldOffset(32, vectorOfLongsOffset, 0);
} }
@@ -1053,11 +1053,11 @@ static createVectorOfLongsVector(builder:flatbuffers.Builder, data:bigint[]):fla
return builder.endVector(); return builder.endVector();
} }
static startVectorOfLongsVector(builder:flatbuffers.Builder, numElems:number) { static startVectorOfLongsVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(8, numElems, 8); builder.startVector(8, numElems, 8);
} }
static addVectorOfDoubles(builder:flatbuffers.Builder, vectorOfDoublesOffset:flatbuffers.Offset) { static addVectorOfDoubles(builder:flatbuffers.Builder, vectorOfDoublesOffset:flatbuffers.Offset):void {
builder.addFieldOffset(33, vectorOfDoublesOffset, 0); builder.addFieldOffset(33, vectorOfDoublesOffset, 0);
} }
@@ -1074,15 +1074,15 @@ static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Fl
return builder.endVector(); return builder.endVector();
} }
static startVectorOfDoublesVector(builder:flatbuffers.Builder, numElems:number) { static startVectorOfDoublesVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(8, numElems, 8); builder.startVector(8, numElems, 8);
} }
static addParentNamespaceTest(builder:flatbuffers.Builder, parentNamespaceTestOffset:flatbuffers.Offset) { static addParentNamespaceTest(builder:flatbuffers.Builder, parentNamespaceTestOffset:flatbuffers.Offset):void {
builder.addFieldOffset(34, parentNamespaceTestOffset, 0); builder.addFieldOffset(34, parentNamespaceTestOffset, 0);
} }
static addVectorOfReferrables(builder:flatbuffers.Builder, vectorOfReferrablesOffset:flatbuffers.Offset) { static addVectorOfReferrables(builder:flatbuffers.Builder, vectorOfReferrablesOffset:flatbuffers.Offset):void {
builder.addFieldOffset(35, vectorOfReferrablesOffset, 0); builder.addFieldOffset(35, vectorOfReferrablesOffset, 0);
} }
@@ -1094,15 +1094,15 @@ static createVectorOfReferrablesVector(builder:flatbuffers.Builder, data:flatbuf
return builder.endVector(); return builder.endVector();
} }
static startVectorOfReferrablesVector(builder:flatbuffers.Builder, numElems:number) { static startVectorOfReferrablesVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 4); builder.startVector(4, numElems, 4);
} }
static addSingleWeakReference(builder:flatbuffers.Builder, singleWeakReference:bigint) { static addSingleWeakReference(builder:flatbuffers.Builder, singleWeakReference:bigint):void {
builder.addFieldInt64(36, singleWeakReference, BigInt('0')); builder.addFieldInt64(36, singleWeakReference, BigInt('0'));
} }
static addVectorOfWeakReferences(builder:flatbuffers.Builder, vectorOfWeakReferencesOffset:flatbuffers.Offset) { static addVectorOfWeakReferences(builder:flatbuffers.Builder, vectorOfWeakReferencesOffset:flatbuffers.Offset):void {
builder.addFieldOffset(37, vectorOfWeakReferencesOffset, 0); builder.addFieldOffset(37, vectorOfWeakReferencesOffset, 0);
} }
@@ -1114,11 +1114,11 @@ static createVectorOfWeakReferencesVector(builder:flatbuffers.Builder, data:bigi
return builder.endVector(); return builder.endVector();
} }
static startVectorOfWeakReferencesVector(builder:flatbuffers.Builder, numElems:number) { static startVectorOfWeakReferencesVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(8, numElems, 8); builder.startVector(8, numElems, 8);
} }
static addVectorOfStrongReferrables(builder:flatbuffers.Builder, vectorOfStrongReferrablesOffset:flatbuffers.Offset) { static addVectorOfStrongReferrables(builder:flatbuffers.Builder, vectorOfStrongReferrablesOffset:flatbuffers.Offset):void {
builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0); builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0);
} }
@@ -1130,15 +1130,15 @@ static createVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, data:f
return builder.endVector(); return builder.endVector();
} }
static startVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, numElems:number) { static startVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 4); builder.startVector(4, numElems, 4);
} }
static addCoOwningReference(builder:flatbuffers.Builder, coOwningReference:bigint) { static addCoOwningReference(builder:flatbuffers.Builder, coOwningReference:bigint):void {
builder.addFieldInt64(39, coOwningReference, BigInt('0')); builder.addFieldInt64(39, coOwningReference, BigInt('0'));
} }
static addVectorOfCoOwningReferences(builder:flatbuffers.Builder, vectorOfCoOwningReferencesOffset:flatbuffers.Offset) { static addVectorOfCoOwningReferences(builder:flatbuffers.Builder, vectorOfCoOwningReferencesOffset:flatbuffers.Offset):void {
builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0); builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0);
} }
@@ -1150,15 +1150,15 @@ static createVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, data:
return builder.endVector(); return builder.endVector();
} }
static startVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) { static startVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(8, numElems, 8); builder.startVector(8, numElems, 8);
} }
static addNonOwningReference(builder:flatbuffers.Builder, nonOwningReference:bigint) { static addNonOwningReference(builder:flatbuffers.Builder, nonOwningReference:bigint):void {
builder.addFieldInt64(41, nonOwningReference, BigInt('0')); builder.addFieldInt64(41, nonOwningReference, BigInt('0'));
} }
static addVectorOfNonOwningReferences(builder:flatbuffers.Builder, vectorOfNonOwningReferencesOffset:flatbuffers.Offset) { static addVectorOfNonOwningReferences(builder:flatbuffers.Builder, vectorOfNonOwningReferencesOffset:flatbuffers.Offset):void {
builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0); builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0);
} }
@@ -1170,27 +1170,27 @@ static createVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, data
return builder.endVector(); return builder.endVector();
} }
static startVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) { static startVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(8, numElems, 8); builder.startVector(8, numElems, 8);
} }
static addAnyUniqueType(builder:flatbuffers.Builder, anyUniqueType:AnyUniqueAliases) { static addAnyUniqueType(builder:flatbuffers.Builder, anyUniqueType:AnyUniqueAliases):void {
builder.addFieldInt8(43, anyUniqueType, AnyUniqueAliases.NONE); builder.addFieldInt8(43, anyUniqueType, AnyUniqueAliases.NONE);
} }
static addAnyUnique(builder:flatbuffers.Builder, anyUniqueOffset:flatbuffers.Offset) { static addAnyUnique(builder:flatbuffers.Builder, anyUniqueOffset:flatbuffers.Offset):void {
builder.addFieldOffset(44, anyUniqueOffset, 0); builder.addFieldOffset(44, anyUniqueOffset, 0);
} }
static addAnyAmbiguousType(builder:flatbuffers.Builder, anyAmbiguousType:AnyAmbiguousAliases) { static addAnyAmbiguousType(builder:flatbuffers.Builder, anyAmbiguousType:AnyAmbiguousAliases):void {
builder.addFieldInt8(45, anyAmbiguousType, AnyAmbiguousAliases.NONE); builder.addFieldInt8(45, anyAmbiguousType, AnyAmbiguousAliases.NONE);
} }
static addAnyAmbiguous(builder:flatbuffers.Builder, anyAmbiguousOffset:flatbuffers.Offset) { static addAnyAmbiguous(builder:flatbuffers.Builder, anyAmbiguousOffset:flatbuffers.Offset):void {
builder.addFieldOffset(46, anyAmbiguousOffset, 0); builder.addFieldOffset(46, anyAmbiguousOffset, 0);
} }
static addVectorOfEnums(builder:flatbuffers.Builder, vectorOfEnumsOffset:flatbuffers.Offset) { static addVectorOfEnums(builder:flatbuffers.Builder, vectorOfEnumsOffset:flatbuffers.Offset):void {
builder.addFieldOffset(47, vectorOfEnumsOffset, 0); builder.addFieldOffset(47, vectorOfEnumsOffset, 0);
} }
@@ -1202,15 +1202,15 @@ static createVectorOfEnumsVector(builder:flatbuffers.Builder, data:Color[]):flat
return builder.endVector(); return builder.endVector();
} }
static startVectorOfEnumsVector(builder:flatbuffers.Builder, numElems:number) { static startVectorOfEnumsVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(1, numElems, 1); builder.startVector(1, numElems, 1);
} }
static addSignedEnum(builder:flatbuffers.Builder, signedEnum:Race) { static addSignedEnum(builder:flatbuffers.Builder, signedEnum:Race):void {
builder.addFieldInt8(48, signedEnum, Race.None); builder.addFieldInt8(48, signedEnum, Race.None);
} }
static addTestrequirednestedflatbuffer(builder:flatbuffers.Builder, testrequirednestedflatbufferOffset:flatbuffers.Offset) { static addTestrequirednestedflatbuffer(builder:flatbuffers.Builder, testrequirednestedflatbufferOffset:flatbuffers.Offset):void {
builder.addFieldOffset(49, testrequirednestedflatbufferOffset, 0); builder.addFieldOffset(49, testrequirednestedflatbufferOffset, 0);
} }
@@ -1222,11 +1222,11 @@ static createTestrequirednestedflatbufferVector(builder:flatbuffers.Builder, dat
return builder.endVector(); return builder.endVector();
} }
static startTestrequirednestedflatbufferVector(builder:flatbuffers.Builder, numElems:number) { static startTestrequirednestedflatbufferVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(1, numElems, 1); builder.startVector(1, numElems, 1);
} }
static addScalarKeySortedTables(builder:flatbuffers.Builder, scalarKeySortedTablesOffset:flatbuffers.Offset) { static addScalarKeySortedTables(builder:flatbuffers.Builder, scalarKeySortedTablesOffset:flatbuffers.Offset):void {
builder.addFieldOffset(50, scalarKeySortedTablesOffset, 0); builder.addFieldOffset(50, scalarKeySortedTablesOffset, 0);
} }
@@ -1238,51 +1238,51 @@ static createScalarKeySortedTablesVector(builder:flatbuffers.Builder, data:flatb
return builder.endVector(); return builder.endVector();
} }
static startScalarKeySortedTablesVector(builder:flatbuffers.Builder, numElems:number) { static startScalarKeySortedTablesVector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(4, numElems, 4); builder.startVector(4, numElems, 4);
} }
static addNativeInline(builder:flatbuffers.Builder, nativeInlineOffset:flatbuffers.Offset) { static addNativeInline(builder:flatbuffers.Builder, nativeInlineOffset:flatbuffers.Offset):void {
builder.addFieldStruct(51, nativeInlineOffset, 0); builder.addFieldStruct(51, nativeInlineOffset, 0);
} }
static addLongEnumNonEnumDefault(builder:flatbuffers.Builder, longEnumNonEnumDefault:bigint) { static addLongEnumNonEnumDefault(builder:flatbuffers.Builder, longEnumNonEnumDefault:bigint):void {
builder.addFieldInt64(52, longEnumNonEnumDefault, BigInt('0')); builder.addFieldInt64(52, longEnumNonEnumDefault, BigInt('0'));
} }
static addLongEnumNormalDefault(builder:flatbuffers.Builder, longEnumNormalDefault:bigint) { static addLongEnumNormalDefault(builder:flatbuffers.Builder, longEnumNormalDefault:bigint):void {
builder.addFieldInt64(53, longEnumNormalDefault, BigInt('2')); builder.addFieldInt64(53, longEnumNormalDefault, BigInt('2'));
} }
static addNanDefault(builder:flatbuffers.Builder, nanDefault:number) { static addNanDefault(builder:flatbuffers.Builder, nanDefault:number):void {
builder.addFieldFloat32(54, nanDefault, NaN); builder.addFieldFloat32(54, nanDefault, NaN);
} }
static addInfDefault(builder:flatbuffers.Builder, infDefault:number) { static addInfDefault(builder:flatbuffers.Builder, infDefault:number):void {
builder.addFieldFloat32(55, infDefault, Infinity); builder.addFieldFloat32(55, infDefault, Infinity);
} }
static addPositiveInfDefault(builder:flatbuffers.Builder, positiveInfDefault:number) { static addPositiveInfDefault(builder:flatbuffers.Builder, positiveInfDefault:number):void {
builder.addFieldFloat32(56, positiveInfDefault, Infinity); builder.addFieldFloat32(56, positiveInfDefault, Infinity);
} }
static addInfinityDefault(builder:flatbuffers.Builder, infinityDefault:number) { static addInfinityDefault(builder:flatbuffers.Builder, infinityDefault:number):void {
builder.addFieldFloat32(57, infinityDefault, Infinity); builder.addFieldFloat32(57, infinityDefault, Infinity);
} }
static addPositiveInfinityDefault(builder:flatbuffers.Builder, positiveInfinityDefault:number) { static addPositiveInfinityDefault(builder:flatbuffers.Builder, positiveInfinityDefault:number):void {
builder.addFieldFloat32(58, positiveInfinityDefault, Infinity); builder.addFieldFloat32(58, positiveInfinityDefault, Infinity);
} }
static addNegativeInfDefault(builder:flatbuffers.Builder, negativeInfDefault:number) { static addNegativeInfDefault(builder:flatbuffers.Builder, negativeInfDefault:number):void {
builder.addFieldFloat32(59, negativeInfDefault, -Infinity); builder.addFieldFloat32(59, negativeInfDefault, -Infinity);
} }
static addNegativeInfinityDefault(builder:flatbuffers.Builder, negativeInfinityDefault:number) { static addNegativeInfinityDefault(builder:flatbuffers.Builder, negativeInfinityDefault:number):void {
builder.addFieldFloat32(60, negativeInfinityDefault, -Infinity); builder.addFieldFloat32(60, negativeInfinityDefault, -Infinity);
} }
static addDoubleInfDefault(builder:flatbuffers.Builder, doubleInfDefault:number) { static addDoubleInfDefault(builder:flatbuffers.Builder, doubleInfDefault:number):void {
builder.addFieldFloat64(61, doubleInfDefault, Infinity); builder.addFieldFloat64(61, doubleInfDefault, Infinity);
} }
@@ -1292,11 +1292,11 @@ static endMonster(builder:flatbuffers.Builder):flatbuffers.Offset {
return offset; return offset;
} }
static finishMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { static finishMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
builder.finish(offset, 'MONS'); builder.finish(offset, 'MONS');
} }
static finishSizePrefixedMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { static finishSizePrefixedMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
builder.finish(offset, 'MONS', true); builder.finish(offset, 'MONS', true);
} }

View File

@@ -2,5 +2,5 @@ export declare enum Race {
None = -1, None = -1,
Human = 0, Human = 0,
Dwarf = 1, Dwarf = 1,
Elf = 2, Elf = 2
} }

View File

@@ -1,10 +1,9 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export var Race; export var Race;
(function (Race) { (function (Race) {
Race[Race['None'] = -1] = 'None'; Race[Race["None"] = -1] = "None";
Race[Race['Human'] = 0] = 'Human'; Race[Race["Human"] = 0] = "Human";
Race[Race['Dwarf'] = 1] = 'Dwarf'; Race[Race["Dwarf"] = 1] = "Dwarf";
Race[Race['Elf'] = 2] = 'Elf'; Race[Race["Elf"] = 2] = "Elf";
})(Race || (Race = {})); })(Race || (Race = {}));

View File

@@ -1,28 +1,17 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export declare class Referrable export declare class Referrable implements flatbuffers.IUnpackableObject<ReferrableT> {
implements flatbuffers.IUnpackableObject<ReferrableT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): Referrable; __init(i: number, bb: flatbuffers.ByteBuffer): Referrable;
static getRootAsReferrable( static getRootAsReferrable(bb: flatbuffers.ByteBuffer, obj?: Referrable): Referrable;
bb: flatbuffers.ByteBuffer, static getSizePrefixedRootAsReferrable(bb: flatbuffers.ByteBuffer, obj?: Referrable): Referrable;
obj?: Referrable,
): Referrable;
static getSizePrefixedRootAsReferrable(
bb: flatbuffers.ByteBuffer,
obj?: Referrable,
): Referrable;
id(): bigint; id(): bigint;
mutate_id(value: bigint): boolean; mutate_id(value: bigint): boolean;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.Referrable";
static startReferrable(builder: flatbuffers.Builder): void; static startReferrable(builder: flatbuffers.Builder): void;
static addId(builder: flatbuffers.Builder, id: bigint): void; static addId(builder: flatbuffers.Builder, id: bigint): void;
static endReferrable(builder: flatbuffers.Builder): flatbuffers.Offset; static endReferrable(builder: flatbuffers.Builder): flatbuffers.Offset;
static createReferrable( static createReferrable(builder: flatbuffers.Builder, id: bigint): flatbuffers.Offset;
builder: flatbuffers.Builder,
id: bigint,
): flatbuffers.Offset;
serialize(): Uint8Array; serialize(): Uint8Array;
static deserialize(buffer: Uint8Array): Referrable; static deserialize(buffer: Uint8Array): Referrable;
unpack(): ReferrableT; unpack(): ReferrableT;

View File

@@ -1,6 +1,5 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export class Referrable { export class Referrable {
constructor() { constructor() {
@@ -13,13 +12,11 @@ export class Referrable {
return this; return this;
} }
static getRootAsReferrable(bb, obj) { static getRootAsReferrable(bb, obj) {
return (obj || new Referrable()) return (obj || new Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getSizePrefixedRootAsReferrable(bb, obj) { static getSizePrefixedRootAsReferrable(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new Referrable()) return (obj || new Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
id() { id() {
const offset = this.bb.__offset(this.bb_pos, 4); const offset = this.bb.__offset(this.bb_pos, 4);

View File

@@ -8,7 +8,7 @@ import * as flatbuffers from 'flatbuffers';
export class Referrable implements flatbuffers.IUnpackableObject<ReferrableT> { export class Referrable implements flatbuffers.IUnpackableObject<ReferrableT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):Referrable { __init(i:number, bb:flatbuffers.ByteBuffer):Referrable {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -44,11 +44,11 @@ static getFullyQualifiedName(): "MyGame.Example.Referrable" {
return 'MyGame.Example.Referrable'; return 'MyGame.Example.Referrable';
} }
static startReferrable(builder:flatbuffers.Builder) { static startReferrable(builder:flatbuffers.Builder):void {
builder.startObject(1); builder.startObject(1);
} }
static addId(builder:flatbuffers.Builder, id:bigint) { static addId(builder:flatbuffers.Builder, id:bigint):void {
builder.addFieldInt64(0, id, BigInt('0')); builder.addFieldInt64(0, id, BigInt('0'));
} }

View File

@@ -4,31 +4,20 @@ export declare class Stat implements flatbuffers.IUnpackableObject<StatT> {
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): Stat; __init(i: number, bb: flatbuffers.ByteBuffer): Stat;
static getRootAsStat(bb: flatbuffers.ByteBuffer, obj?: Stat): Stat; static getRootAsStat(bb: flatbuffers.ByteBuffer, obj?: Stat): Stat;
static getSizePrefixedRootAsStat( static getSizePrefixedRootAsStat(bb: flatbuffers.ByteBuffer, obj?: Stat): Stat;
bb: flatbuffers.ByteBuffer,
obj?: Stat,
): Stat;
id(): string | null; id(): string | null;
id(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; id(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
val(): bigint; val(): bigint;
mutate_val(value: bigint): boolean; mutate_val(value: bigint): boolean;
count(): number; count(): number;
mutate_count(value: number): boolean; mutate_count(value: number): boolean;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.Stat";
static startStat(builder: flatbuffers.Builder): void; static startStat(builder: flatbuffers.Builder): void;
static addId( static addId(builder: flatbuffers.Builder, idOffset: flatbuffers.Offset): void;
builder: flatbuffers.Builder,
idOffset: flatbuffers.Offset,
): void;
static addVal(builder: flatbuffers.Builder, val: bigint): void; static addVal(builder: flatbuffers.Builder, val: bigint): void;
static addCount(builder: flatbuffers.Builder, count: number): void; static addCount(builder: flatbuffers.Builder, count: number): void;
static endStat(builder: flatbuffers.Builder): flatbuffers.Offset; static endStat(builder: flatbuffers.Builder): flatbuffers.Offset;
static createStat( static createStat(builder: flatbuffers.Builder, idOffset: flatbuffers.Offset, val: bigint, count: number): flatbuffers.Offset;
builder: flatbuffers.Builder,
idOffset: flatbuffers.Offset,
val: bigint,
count: number,
): flatbuffers.Offset;
serialize(): Uint8Array; serialize(): Uint8Array;
static deserialize(buffer: Uint8Array): Stat; static deserialize(buffer: Uint8Array): Stat;
unpack(): StatT; unpack(): StatT;

View File

@@ -1,6 +1,5 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export class Stat { export class Stat {
constructor() { constructor() {
@@ -13,18 +12,15 @@ export class Stat {
return this; return this;
} }
static getRootAsStat(bb, obj) { static getRootAsStat(bb, obj) {
return (obj || new Stat()) return (obj || new Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getSizePrefixedRootAsStat(bb, obj) { static getSizePrefixedRootAsStat(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new Stat()) return (obj || new Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
id(optionalEncoding) { id(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 4); const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
null;
} }
val() { val() {
const offset = this.bb.__offset(this.bb_pos, 6); const offset = this.bb.__offset(this.bb_pos, 6);

View File

@@ -8,7 +8,7 @@ import * as flatbuffers from 'flatbuffers';
export class Stat implements flatbuffers.IUnpackableObject<StatT> { export class Stat implements flatbuffers.IUnpackableObject<StatT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):Stat { __init(i:number, bb:flatbuffers.ByteBuffer):Stat {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -67,19 +67,19 @@ static getFullyQualifiedName(): "MyGame.Example.Stat" {
return 'MyGame.Example.Stat'; return 'MyGame.Example.Stat';
} }
static startStat(builder:flatbuffers.Builder) { static startStat(builder:flatbuffers.Builder):void {
builder.startObject(3); builder.startObject(3);
} }
static addId(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset) { static addId(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset):void {
builder.addFieldOffset(0, idOffset, 0); builder.addFieldOffset(0, idOffset, 0);
} }
static addVal(builder:flatbuffers.Builder, val:bigint) { static addVal(builder:flatbuffers.Builder, val:bigint):void {
builder.addFieldInt64(1, val, BigInt('0')); builder.addFieldInt64(1, val, BigInt('0'));
} }
static addCount(builder:flatbuffers.Builder, count:number) { static addCount(builder:flatbuffers.Builder, count:number):void {
builder.addFieldInt16(2, count, 0); builder.addFieldInt16(2, count, 0);
} }

View File

@@ -1,32 +1,17 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import { import { StructOfStructs, StructOfStructsT } from './struct-of-structs.js';
StructOfStructs, export declare class StructOfStructsOfStructs implements flatbuffers.IUnpackableObject<StructOfStructsOfStructsT> {
StructOfStructsT,
} from '../../my-game/example/struct-of-structs.js';
export declare class StructOfStructsOfStructs
implements flatbuffers.IUnpackableObject<StructOfStructsOfStructsT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): StructOfStructsOfStructs; __init(i: number, bb: flatbuffers.ByteBuffer): StructOfStructsOfStructs;
a(obj?: StructOfStructs): StructOfStructs | null; a(obj?: StructOfStructs): StructOfStructs | null;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.StructOfStructsOfStructs";
static sizeOf(): number; static sizeOf(): number;
static createStructOfStructsOfStructs( static createStructOfStructsOfStructs(builder: flatbuffers.Builder, a_a_id: number, a_a_distance: number, a_b_a: number, a_b_b: number, a_c_id: number, a_c_distance: number): flatbuffers.Offset;
builder: flatbuffers.Builder,
a_a_id: number,
a_a_distance: number,
a_b_a: number,
a_b_b: number,
a_c_id: number,
a_c_distance: number,
): flatbuffers.Offset;
unpack(): StructOfStructsOfStructsT; unpack(): StructOfStructsOfStructsT;
unpackTo(_o: StructOfStructsOfStructsT): void; unpackTo(_o: StructOfStructsOfStructsT): void;
} }
export declare class StructOfStructsOfStructsT export declare class StructOfStructsOfStructsT implements flatbuffers.IGeneratedObject {
implements flatbuffers.IGeneratedObject
{
a: StructOfStructsT | null; a: StructOfStructsT | null;
constructor(a?: StructOfStructsT | null); constructor(a?: StructOfStructsT | null);
pack(builder: flatbuffers.Builder): flatbuffers.Offset; pack(builder: flatbuffers.Builder): flatbuffers.Offset;

View File

@@ -1,5 +1,5 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
import {StructOfStructs} from '../../my-game/example/struct-of-structs.js'; import { StructOfStructs } from './struct-of-structs.js';
export class StructOfStructsOfStructs { export class StructOfStructsOfStructs {
constructor() { constructor() {
this.bb = null; this.bb = null;
@@ -19,8 +19,7 @@ export class StructOfStructsOfStructs {
static sizeOf() { static sizeOf() {
return 20; return 20;
} }
static createStructOfStructsOfStructs( static createStructOfStructsOfStructs(builder, a_a_id, a_a_distance, a_b_a, a_b_b, a_c_id, a_c_distance) {
builder, a_a_id, a_a_distance, a_b_a, a_b_b, a_c_id, a_c_distance) {
builder.prep(4, 20); builder.prep(4, 20);
builder.prep(4, 20); builder.prep(4, 20);
builder.prep(4, 8); builder.prep(4, 8);
@@ -36,8 +35,7 @@ export class StructOfStructsOfStructs {
return builder.offset(); return builder.offset();
} }
unpack() { unpack() {
return new StructOfStructsOfStructsT( return new StructOfStructsOfStructsT((this.a() !== null ? this.a().unpack() : null));
(this.a() !== null ? this.a().unpack() : null));
} }
unpackTo(_o) { unpackTo(_o) {
_o.a = (this.a() !== null ? this.a().unpack() : null); _o.a = (this.a() !== null ? this.a().unpack() : null);
@@ -48,9 +46,6 @@ export class StructOfStructsOfStructsT {
this.a = a; this.a = a;
} }
pack(builder) { pack(builder) {
return StructOfStructsOfStructs.createStructOfStructsOfStructs( return StructOfStructsOfStructs.createStructOfStructsOfStructs(builder, (this.a?.a?.id ?? 0), (this.a?.a?.distance ?? 0), (this.a?.b?.a ?? 0), (this.a?.b?.b ?? 0), (this.a?.c?.id ?? 0), (this.a?.c?.distance ?? 0));
builder, (this.a?.a?.id ?? 0), (this.a?.a?.distance ?? 0),
(this.a?.b?.a ?? 0), (this.a?.b?.b ?? 0), (this.a?.c?.id ?? 0),
(this.a?.c?.distance ?? 0));
} }
} }

View File

@@ -9,7 +9,7 @@ import { StructOfStructs, StructOfStructsT } from './struct-of-structs.js';
export class StructOfStructsOfStructs implements flatbuffers.IUnpackableObject<StructOfStructsOfStructsT> { export class StructOfStructsOfStructs implements flatbuffers.IUnpackableObject<StructOfStructsOfStructsT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):StructOfStructsOfStructs { __init(i:number, bb:flatbuffers.ByteBuffer):StructOfStructsOfStructs {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;

View File

@@ -1,26 +1,16 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import {Ability, AbilityT} from '../../my-game/example/ability.js'; import { Ability, AbilityT } from './ability.js';
import {Test, TestT} from '../../my-game/example/test.js'; import { Test, TestT } from './test.js';
export declare class StructOfStructs export declare class StructOfStructs implements flatbuffers.IUnpackableObject<StructOfStructsT> {
implements flatbuffers.IUnpackableObject<StructOfStructsT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): StructOfStructs; __init(i: number, bb: flatbuffers.ByteBuffer): StructOfStructs;
a(obj?: Ability): Ability | null; a(obj?: Ability): Ability | null;
b(obj?: Test): Test | null; b(obj?: Test): Test | null;
c(obj?: Ability): Ability | null; c(obj?: Ability): Ability | null;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.StructOfStructs";
static sizeOf(): number; static sizeOf(): number;
static createStructOfStructs( static createStructOfStructs(builder: flatbuffers.Builder, a_id: number, a_distance: number, b_a: number, b_b: number, c_id: number, c_distance: number): flatbuffers.Offset;
builder: flatbuffers.Builder,
a_id: number,
a_distance: number,
b_a: number,
b_b: number,
c_id: number,
c_distance: number,
): flatbuffers.Offset;
unpack(): StructOfStructsT; unpack(): StructOfStructsT;
unpackTo(_o: StructOfStructsT): void; unpackTo(_o: StructOfStructsT): void;
} }

View File

@@ -1,6 +1,6 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
import {Ability} from '../../my-game/example/ability.js'; import { Ability } from './ability.js';
import {Test} from '../../my-game/example/test.js'; import { Test } from './test.js';
export class StructOfStructs { export class StructOfStructs {
constructor() { constructor() {
this.bb = null; this.bb = null;
@@ -26,8 +26,7 @@ export class StructOfStructs {
static sizeOf() { static sizeOf() {
return 20; return 20;
} }
static createStructOfStructs( static createStructOfStructs(builder, a_id, a_distance, b_a, b_b, c_id, c_distance) {
builder, a_id, a_distance, b_a, b_b, c_id, c_distance) {
builder.prep(4, 20); builder.prep(4, 20);
builder.prep(4, 8); builder.prep(4, 8);
builder.writeInt32(c_distance); builder.writeInt32(c_distance);
@@ -42,10 +41,7 @@ export class StructOfStructs {
return builder.offset(); return builder.offset();
} }
unpack() { unpack() {
return new StructOfStructsT( return new StructOfStructsT((this.a() !== null ? this.a().unpack() : null), (this.b() !== null ? this.b().unpack() : null), (this.c() !== null ? this.c().unpack() : null));
(this.a() !== null ? this.a().unpack() : null),
(this.b() !== null ? this.b().unpack() : null),
(this.c() !== null ? this.c().unpack() : null));
} }
unpackTo(_o) { unpackTo(_o) {
_o.a = (this.a() !== null ? this.a().unpack() : null); _o.a = (this.a() !== null ? this.a().unpack() : null);
@@ -60,8 +56,6 @@ export class StructOfStructsT {
this.c = c; this.c = c;
} }
pack(builder) { pack(builder) {
return StructOfStructs.createStructOfStructs( return StructOfStructs.createStructOfStructs(builder, (this.a?.id ?? 0), (this.a?.distance ?? 0), (this.b?.a ?? 0), (this.b?.b ?? 0), (this.c?.id ?? 0), (this.c?.distance ?? 0));
builder, (this.a?.id ?? 0), (this.a?.distance ?? 0), (this.b?.a ?? 0),
(this.b?.b ?? 0), (this.c?.id ?? 0), (this.c?.distance ?? 0));
} }
} }

View File

@@ -10,7 +10,7 @@ import { Test, TestT } from './test.js';
export class StructOfStructs implements flatbuffers.IUnpackableObject<StructOfStructsT> { export class StructOfStructs implements flatbuffers.IUnpackableObject<StructOfStructsT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):StructOfStructs { __init(i:number, bb:flatbuffers.ByteBuffer):StructOfStructs {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;

View File

@@ -1,39 +1,24 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import {Color} from '../../my-game/example/color.js'; import { Color } from './color.js';
export declare class TestSimpleTableWithEnum export declare class TestSimpleTableWithEnum implements flatbuffers.IUnpackableObject<TestSimpleTableWithEnumT> {
implements flatbuffers.IUnpackableObject<TestSimpleTableWithEnumT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): TestSimpleTableWithEnum; __init(i: number, bb: flatbuffers.ByteBuffer): TestSimpleTableWithEnum;
static getRootAsTestSimpleTableWithEnum( static getRootAsTestSimpleTableWithEnum(bb: flatbuffers.ByteBuffer, obj?: TestSimpleTableWithEnum): TestSimpleTableWithEnum;
bb: flatbuffers.ByteBuffer, static getSizePrefixedRootAsTestSimpleTableWithEnum(bb: flatbuffers.ByteBuffer, obj?: TestSimpleTableWithEnum): TestSimpleTableWithEnum;
obj?: TestSimpleTableWithEnum,
): TestSimpleTableWithEnum;
static getSizePrefixedRootAsTestSimpleTableWithEnum(
bb: flatbuffers.ByteBuffer,
obj?: TestSimpleTableWithEnum,
): TestSimpleTableWithEnum;
color(): Color; color(): Color;
mutate_color(value: Color): boolean; mutate_color(value: Color): boolean;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.TestSimpleTableWithEnum";
static startTestSimpleTableWithEnum(builder: flatbuffers.Builder): void; static startTestSimpleTableWithEnum(builder: flatbuffers.Builder): void;
static addColor(builder: flatbuffers.Builder, color: Color): void; static addColor(builder: flatbuffers.Builder, color: Color): void;
static endTestSimpleTableWithEnum( static endTestSimpleTableWithEnum(builder: flatbuffers.Builder): flatbuffers.Offset;
builder: flatbuffers.Builder, static createTestSimpleTableWithEnum(builder: flatbuffers.Builder, color: Color): flatbuffers.Offset;
): flatbuffers.Offset;
static createTestSimpleTableWithEnum(
builder: flatbuffers.Builder,
color: Color,
): flatbuffers.Offset;
serialize(): Uint8Array; serialize(): Uint8Array;
static deserialize(buffer: Uint8Array): TestSimpleTableWithEnum; static deserialize(buffer: Uint8Array): TestSimpleTableWithEnum;
unpack(): TestSimpleTableWithEnumT; unpack(): TestSimpleTableWithEnumT;
unpackTo(_o: TestSimpleTableWithEnumT): void; unpackTo(_o: TestSimpleTableWithEnumT): void;
} }
export declare class TestSimpleTableWithEnumT export declare class TestSimpleTableWithEnumT implements flatbuffers.IGeneratedObject {
implements flatbuffers.IGeneratedObject
{
color: Color; color: Color;
constructor(color?: Color); constructor(color?: Color);
pack(builder: flatbuffers.Builder): flatbuffers.Offset; pack(builder: flatbuffers.Builder): flatbuffers.Offset;

View File

@@ -1,10 +1,7 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import { Color } from './color.js';
import {Color} from '../../my-game/example/color.js';
export class TestSimpleTableWithEnum { export class TestSimpleTableWithEnum {
constructor() { constructor() {
this.bb = null; this.bb = null;
@@ -16,13 +13,11 @@ export class TestSimpleTableWithEnum {
return this; return this;
} }
static getRootAsTestSimpleTableWithEnum(bb, obj) { static getRootAsTestSimpleTableWithEnum(bb, obj) {
return (obj || new TestSimpleTableWithEnum()) return (obj || new TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getSizePrefixedRootAsTestSimpleTableWithEnum(bb, obj) { static getSizePrefixedRootAsTestSimpleTableWithEnum(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new TestSimpleTableWithEnum()) return (obj || new TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
color() { color() {
const offset = this.bb.__offset(this.bb_pos, 4); const offset = this.bb.__offset(this.bb_pos, 4);
@@ -58,8 +53,7 @@ export class TestSimpleTableWithEnum {
return this.bb.bytes(); return this.bb.bytes();
} }
static deserialize(buffer) { static deserialize(buffer) {
return TestSimpleTableWithEnum.getRootAsTestSimpleTableWithEnum( return TestSimpleTableWithEnum.getRootAsTestSimpleTableWithEnum(new flatbuffers.ByteBuffer(buffer));
new flatbuffers.ByteBuffer(buffer));
} }
unpack() { unpack() {
return new TestSimpleTableWithEnumT(this.color()); return new TestSimpleTableWithEnumT(this.color());
@@ -73,7 +67,6 @@ export class TestSimpleTableWithEnumT {
this.color = color; this.color = color;
} }
pack(builder) { pack(builder) {
return TestSimpleTableWithEnum.createTestSimpleTableWithEnum( return TestSimpleTableWithEnum.createTestSimpleTableWithEnum(builder, this.color);
builder, this.color);
} }
} }

View File

@@ -9,7 +9,7 @@ import { Color } from './color.js';
export class TestSimpleTableWithEnum implements flatbuffers.IUnpackableObject<TestSimpleTableWithEnumT> { export class TestSimpleTableWithEnum implements flatbuffers.IUnpackableObject<TestSimpleTableWithEnumT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):TestSimpleTableWithEnum { __init(i:number, bb:flatbuffers.ByteBuffer):TestSimpleTableWithEnum {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -45,11 +45,11 @@ static getFullyQualifiedName(): "MyGame.Example.TestSimpleTableWithEnum" {
return 'MyGame.Example.TestSimpleTableWithEnum'; return 'MyGame.Example.TestSimpleTableWithEnum';
} }
static startTestSimpleTableWithEnum(builder:flatbuffers.Builder) { static startTestSimpleTableWithEnum(builder:flatbuffers.Builder):void {
builder.startObject(1); builder.startObject(1);
} }
static addColor(builder:flatbuffers.Builder, color:Color) { static addColor(builder:flatbuffers.Builder, color:Color):void {
builder.addFieldInt8(0, color, Color.Green); builder.addFieldInt8(0, color, Color.Green);
} }

View File

@@ -7,13 +7,9 @@ export declare class Test implements flatbuffers.IUnpackableObject<TestT> {
mutate_a(value: number): boolean; mutate_a(value: number): boolean;
b(): number; b(): number;
mutate_b(value: number): boolean; mutate_b(value: number): boolean;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.Test";
static sizeOf(): number; static sizeOf(): number;
static createTest( static createTest(builder: flatbuffers.Builder, a: number, b: number): flatbuffers.Offset;
builder: flatbuffers.Builder,
a: number,
b: number,
): flatbuffers.Offset;
unpack(): TestT; unpack(): TestT;
unpackTo(_o: TestT): void; unpackTo(_o: TestT): void;
} }

View File

@@ -8,7 +8,7 @@ import * as flatbuffers from 'flatbuffers';
export class Test implements flatbuffers.IUnpackableObject<TestT> { export class Test implements flatbuffers.IUnpackableObject<TestT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):Test { __init(i:number, bb:flatbuffers.ByteBuffer):Test {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;

View File

@@ -1,18 +1,10 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export declare class TypeAliases export declare class TypeAliases implements flatbuffers.IUnpackableObject<TypeAliasesT> {
implements flatbuffers.IUnpackableObject<TypeAliasesT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): TypeAliases; __init(i: number, bb: flatbuffers.ByteBuffer): TypeAliases;
static getRootAsTypeAliases( static getRootAsTypeAliases(bb: flatbuffers.ByteBuffer, obj?: TypeAliases): TypeAliases;
bb: flatbuffers.ByteBuffer, static getSizePrefixedRootAsTypeAliases(bb: flatbuffers.ByteBuffer, obj?: TypeAliases): TypeAliases;
obj?: TypeAliases,
): TypeAliases;
static getSizePrefixedRootAsTypeAliases(
bb: flatbuffers.ByteBuffer,
obj?: TypeAliases,
): TypeAliases;
i8(): number; i8(): number;
mutate_i8(value: number): boolean; mutate_i8(value: number): boolean;
u8(): number; u8(): number;
@@ -39,7 +31,7 @@ export declare class TypeAliases
vf64(index: number): number | null; vf64(index: number): number | null;
vf64Length(): number; vf64Length(): number;
vf64Array(): Float64Array | null; vf64Array(): Float64Array | null;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.TypeAliases";
static startTypeAliases(builder: flatbuffers.Builder): void; static startTypeAliases(builder: flatbuffers.Builder): void;
static addI8(builder: flatbuffers.Builder, i8: number): void; static addI8(builder: flatbuffers.Builder, i8: number): void;
static addU8(builder: flatbuffers.Builder, u8: number): void; static addU8(builder: flatbuffers.Builder, u8: number): void;
@@ -51,54 +43,22 @@ export declare class TypeAliases
static addU64(builder: flatbuffers.Builder, u64: bigint): void; static addU64(builder: flatbuffers.Builder, u64: bigint): void;
static addF32(builder: flatbuffers.Builder, f32: number): void; static addF32(builder: flatbuffers.Builder, f32: number): void;
static addF64(builder: flatbuffers.Builder, f64: number): void; static addF64(builder: flatbuffers.Builder, f64: number): void;
static addV8( static addV8(builder: flatbuffers.Builder, v8Offset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static createV8Vector(builder: flatbuffers.Builder, data: number[] | Int8Array): flatbuffers.Offset;
v8Offset: flatbuffers.Offset,
): void;
static createV8Vector(
builder: flatbuffers.Builder,
data: number[] | Int8Array,
): flatbuffers.Offset;
/** /**
* @deprecated This Uint8Array overload will be removed in the future. * @deprecated This Uint8Array overload will be removed in the future.
*/ */
static createV8Vector( static createV8Vector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
builder: flatbuffers.Builder,
data: number[] | Uint8Array,
): flatbuffers.Offset;
static startV8Vector(builder: flatbuffers.Builder, numElems: number): void; static startV8Vector(builder: flatbuffers.Builder, numElems: number): void;
static addVf64( static addVf64(builder: flatbuffers.Builder, vf64Offset: flatbuffers.Offset): void;
builder: flatbuffers.Builder, static createVf64Vector(builder: flatbuffers.Builder, data: number[] | Float64Array): flatbuffers.Offset;
vf64Offset: flatbuffers.Offset,
): void;
static createVf64Vector(
builder: flatbuffers.Builder,
data: number[] | Float64Array,
): flatbuffers.Offset;
/** /**
* @deprecated This Uint8Array overload will be removed in the future. * @deprecated This Uint8Array overload will be removed in the future.
*/ */
static createVf64Vector( static createVf64Vector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
builder: flatbuffers.Builder,
data: number[] | Uint8Array,
): flatbuffers.Offset;
static startVf64Vector(builder: flatbuffers.Builder, numElems: number): void; static startVf64Vector(builder: flatbuffers.Builder, numElems: number): void;
static endTypeAliases(builder: flatbuffers.Builder): flatbuffers.Offset; static endTypeAliases(builder: flatbuffers.Builder): flatbuffers.Offset;
static createTypeAliases( static createTypeAliases(builder: flatbuffers.Builder, i8: number, u8: number, i16: number, u16: number, i32: number, u32: number, i64: bigint, u64: bigint, f32: number, f64: number, v8Offset: flatbuffers.Offset, vf64Offset: flatbuffers.Offset): flatbuffers.Offset;
builder: flatbuffers.Builder,
i8: number,
u8: number,
i16: number,
u16: number,
i32: number,
u32: number,
i64: bigint,
u64: bigint,
f32: number,
f64: number,
v8Offset: flatbuffers.Offset,
vf64Offset: flatbuffers.Offset,
): flatbuffers.Offset;
serialize(): Uint8Array; serialize(): Uint8Array;
static deserialize(buffer: Uint8Array): TypeAliases; static deserialize(buffer: Uint8Array): TypeAliases;
unpack(): TypeAliasesT; unpack(): TypeAliasesT;
@@ -115,21 +75,8 @@ export declare class TypeAliasesT implements flatbuffers.IGeneratedObject {
u64: bigint; u64: bigint;
f32: number; f32: number;
f64: number; f64: number;
v8: number[]; v8: (number)[];
vf64: number[]; vf64: (number)[];
constructor( constructor(i8?: number, u8?: number, i16?: number, u16?: number, i32?: number, u32?: number, i64?: bigint, u64?: bigint, f32?: number, f64?: number, v8?: (number)[], vf64?: (number)[]);
i8?: number,
u8?: number,
i16?: number,
u16?: number,
i32?: number,
u32?: number,
i64?: bigint,
u64?: bigint,
f32?: number,
f64?: number,
v8?: number[],
vf64?: number[],
);
pack(builder: flatbuffers.Builder): flatbuffers.Offset; pack(builder: flatbuffers.Builder): flatbuffers.Offset;
} }

View File

@@ -1,6 +1,5 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export class TypeAliases { export class TypeAliases {
constructor() { constructor() {
@@ -13,13 +12,11 @@ export class TypeAliases {
return this; return this;
} }
static getRootAsTypeAliases(bb, obj) { static getRootAsTypeAliases(bb, obj) {
return (obj || new TypeAliases()) return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getSizePrefixedRootAsTypeAliases(bb, obj) { static getSizePrefixedRootAsTypeAliases(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new TypeAliases()) return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
i8() { i8() {
const offset = this.bb.__offset(this.bb_pos, 4); const offset = this.bb.__offset(this.bb_pos, 4);
@@ -143,9 +140,7 @@ export class TypeAliases {
} }
v8(index) { v8(index) {
const offset = this.bb.__offset(this.bb_pos, 24); const offset = this.bb.__offset(this.bb_pos, 24);
return offset ? return offset ? this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) :
0;
} }
v8Length() { v8Length() {
const offset = this.bb.__offset(this.bb_pos, 24); const offset = this.bb.__offset(this.bb_pos, 24);
@@ -153,18 +148,11 @@ export class TypeAliases {
} }
v8Array() { v8Array() {
const offset = this.bb.__offset(this.bb_pos, 24); const offset = this.bb.__offset(this.bb_pos, 24);
return offset ? return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
new Int8Array(
this.bb.bytes().buffer,
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
this.bb.__vector_len(this.bb_pos + offset)) :
null;
} }
vf64(index) { vf64(index) {
const offset = this.bb.__offset(this.bb_pos, 26); const offset = this.bb.__offset(this.bb_pos, 26);
return offset ? this.bb.readFloat64( return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
this.bb.__vector(this.bb_pos + offset) + index * 8) :
0;
} }
vf64Length() { vf64Length() {
const offset = this.bb.__offset(this.bb_pos, 26); const offset = this.bb.__offset(this.bb_pos, 26);
@@ -172,12 +160,7 @@ export class TypeAliases {
} }
vf64Array() { vf64Array() {
const offset = this.bb.__offset(this.bb_pos, 26); const offset = this.bb.__offset(this.bb_pos, 26);
return offset ? return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
new Float64Array(
this.bb.bytes().buffer,
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
this.bb.__vector_len(this.bb_pos + offset)) :
null;
} }
static getFullyQualifiedName() { static getFullyQualifiedName() {
return 'MyGame.Example.TypeAliases'; return 'MyGame.Example.TypeAliases';
@@ -245,9 +228,7 @@ export class TypeAliases {
const offset = builder.endObject(); const offset = builder.endObject();
return offset; return offset;
} }
static createTypeAliases( static createTypeAliases(builder, i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, v8Offset, vf64Offset) {
builder, i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, v8Offset,
vf64Offset) {
TypeAliases.startTypeAliases(builder); TypeAliases.startTypeAliases(builder);
TypeAliases.addI8(builder, i8); TypeAliases.addI8(builder, i8);
TypeAliases.addU8(builder, u8); TypeAliases.addU8(builder, u8);
@@ -270,11 +251,7 @@ export class TypeAliases {
return TypeAliases.getRootAsTypeAliases(new flatbuffers.ByteBuffer(buffer)); return TypeAliases.getRootAsTypeAliases(new flatbuffers.ByteBuffer(buffer));
} }
unpack() { unpack() {
return new TypeAliasesT( return new TypeAliasesT(this.i8(), this.u8(), this.i16(), this.u16(), this.i32(), this.u32(), this.i64(), this.u64(), this.f32(), this.f64(), this.bb.createScalarList(this.v8.bind(this), this.v8Length()), this.bb.createScalarList(this.vf64.bind(this), this.vf64Length()));
this.i8(), this.u8(), this.i16(), this.u16(), this.i32(), this.u32(),
this.i64(), this.u64(), this.f32(), this.f64(),
this.bb.createScalarList(this.v8.bind(this), this.v8Length()),
this.bb.createScalarList(this.vf64.bind(this), this.vf64Length()));
} }
unpackTo(_o) { unpackTo(_o) {
_o.i8 = this.i8(); _o.i8 = this.i8();
@@ -292,9 +269,7 @@ export class TypeAliases {
} }
} }
export class TypeAliasesT { export class TypeAliasesT {
constructor( constructor(i8 = 0, u8 = 0, i16 = 0, u16 = 0, i32 = 0, u32 = 0, i64 = BigInt('0'), u64 = BigInt('0'), f32 = 0.0, f64 = 0.0, v8 = [], vf64 = []) {
i8 = 0, u8 = 0, i16 = 0, u16 = 0, i32 = 0, u32 = 0, i64 = BigInt('0'),
u64 = BigInt('0'), f32 = 0.0, f64 = 0.0, v8 = [], vf64 = []) {
this.i8 = i8; this.i8 = i8;
this.u8 = u8; this.u8 = u8;
this.i16 = i16; this.i16 = i16;
@@ -311,8 +286,6 @@ export class TypeAliasesT {
pack(builder) { pack(builder) {
const v8 = TypeAliases.createV8Vector(builder, this.v8); const v8 = TypeAliases.createV8Vector(builder, this.v8);
const vf64 = TypeAliases.createVf64Vector(builder, this.vf64); const vf64 = TypeAliases.createVf64Vector(builder, this.vf64);
return TypeAliases.createTypeAliases( return TypeAliases.createTypeAliases(builder, this.i8, this.u8, this.i16, this.u16, this.i32, this.u32, this.i64, this.u64, this.f32, this.f64, v8, vf64);
builder, this.i8, this.u8, this.i16, this.u16, this.i32, this.u32,
this.i64, this.u64, this.f32, this.f64, v8, vf64);
} }
} }

View File

@@ -8,7 +8,7 @@ import * as flatbuffers from 'flatbuffers';
export class TypeAliases implements flatbuffers.IUnpackableObject<TypeAliasesT> { export class TypeAliases implements flatbuffers.IUnpackableObject<TypeAliasesT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):TypeAliases { __init(i:number, bb:flatbuffers.ByteBuffer):TypeAliases {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -218,51 +218,51 @@ static getFullyQualifiedName(): "MyGame.Example.TypeAliases" {
return 'MyGame.Example.TypeAliases'; return 'MyGame.Example.TypeAliases';
} }
static startTypeAliases(builder:flatbuffers.Builder) { static startTypeAliases(builder:flatbuffers.Builder):void {
builder.startObject(12); builder.startObject(12);
} }
static addI8(builder:flatbuffers.Builder, i8:number) { static addI8(builder:flatbuffers.Builder, i8:number):void {
builder.addFieldInt8(0, i8, 0); builder.addFieldInt8(0, i8, 0);
} }
static addU8(builder:flatbuffers.Builder, u8:number) { static addU8(builder:flatbuffers.Builder, u8:number):void {
builder.addFieldInt8(1, u8, 0); builder.addFieldInt8(1, u8, 0);
} }
static addI16(builder:flatbuffers.Builder, i16:number) { static addI16(builder:flatbuffers.Builder, i16:number):void {
builder.addFieldInt16(2, i16, 0); builder.addFieldInt16(2, i16, 0);
} }
static addU16(builder:flatbuffers.Builder, u16:number) { static addU16(builder:flatbuffers.Builder, u16:number):void {
builder.addFieldInt16(3, u16, 0); builder.addFieldInt16(3, u16, 0);
} }
static addI32(builder:flatbuffers.Builder, i32:number) { static addI32(builder:flatbuffers.Builder, i32:number):void {
builder.addFieldInt32(4, i32, 0); builder.addFieldInt32(4, i32, 0);
} }
static addU32(builder:flatbuffers.Builder, u32:number) { static addU32(builder:flatbuffers.Builder, u32:number):void {
builder.addFieldInt32(5, u32, 0); builder.addFieldInt32(5, u32, 0);
} }
static addI64(builder:flatbuffers.Builder, i64:bigint) { static addI64(builder:flatbuffers.Builder, i64:bigint):void {
builder.addFieldInt64(6, i64, BigInt('0')); builder.addFieldInt64(6, i64, BigInt('0'));
} }
static addU64(builder:flatbuffers.Builder, u64:bigint) { static addU64(builder:flatbuffers.Builder, u64:bigint):void {
builder.addFieldInt64(7, u64, BigInt('0')); builder.addFieldInt64(7, u64, BigInt('0'));
} }
static addF32(builder:flatbuffers.Builder, f32:number) { static addF32(builder:flatbuffers.Builder, f32:number):void {
builder.addFieldFloat32(8, f32, 0.0); builder.addFieldFloat32(8, f32, 0.0);
} }
static addF64(builder:flatbuffers.Builder, f64:number) { static addF64(builder:flatbuffers.Builder, f64:number):void {
builder.addFieldFloat64(9, f64, 0.0); builder.addFieldFloat64(9, f64, 0.0);
} }
static addV8(builder:flatbuffers.Builder, v8Offset:flatbuffers.Offset) { static addV8(builder:flatbuffers.Builder, v8Offset:flatbuffers.Offset):void {
builder.addFieldOffset(10, v8Offset, 0); builder.addFieldOffset(10, v8Offset, 0);
} }
@@ -279,11 +279,11 @@ static createV8Vector(builder:flatbuffers.Builder, data:number[]|Int8Array|Uint8
return builder.endVector(); return builder.endVector();
} }
static startV8Vector(builder:flatbuffers.Builder, numElems:number) { static startV8Vector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(1, numElems, 1); builder.startVector(1, numElems, 1);
} }
static addVf64(builder:flatbuffers.Builder, vf64Offset:flatbuffers.Offset) { static addVf64(builder:flatbuffers.Builder, vf64Offset:flatbuffers.Offset):void {
builder.addFieldOffset(11, vf64Offset, 0); builder.addFieldOffset(11, vf64Offset, 0);
} }
@@ -300,7 +300,7 @@ static createVf64Vector(builder:flatbuffers.Builder, data:number[]|Float64Array|
return builder.endVector(); return builder.endVector();
} }
static startVf64Vector(builder:flatbuffers.Builder, numElems:number) { static startVf64Vector(builder:flatbuffers.Builder, numElems:number):void {
builder.startVector(8, numElems, 8); builder.startVector(8, numElems, 8);
} }

View File

@@ -1,6 +1,6 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import {Color} from '../../my-game/example/color.js'; import { Color } from './color.js';
import {Test, TestT} from '../../my-game/example/test.js'; import { Test, TestT } from './test.js';
export declare class Vec3 implements flatbuffers.IUnpackableObject<Vec3T> { export declare class Vec3 implements flatbuffers.IUnpackableObject<Vec3T> {
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
@@ -16,18 +16,9 @@ export declare class Vec3 implements flatbuffers.IUnpackableObject<Vec3T> {
test2(): Color; test2(): Color;
mutate_test2(value: Color): boolean; mutate_test2(value: Color): boolean;
test3(obj?: Test): Test | null; test3(obj?: Test): Test | null;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.Example.Vec3";
static sizeOf(): number; static sizeOf(): number;
static createVec3( static createVec3(builder: flatbuffers.Builder, x: number, y: number, z: number, test1: number, test2: Color, test3_a: number, test3_b: number): flatbuffers.Offset;
builder: flatbuffers.Builder,
x: number,
y: number,
z: number,
test1: number,
test2: Color,
test3_a: number,
test3_b: number,
): flatbuffers.Offset;
unpack(): Vec3T; unpack(): Vec3T;
unpackTo(_o: Vec3T): void; unpackTo(_o: Vec3T): void;
} }
@@ -38,13 +29,6 @@ export declare class Vec3T implements flatbuffers.IGeneratedObject {
test1: number; test1: number;
test2: Color; test2: Color;
test3: TestT | null; test3: TestT | null;
constructor( constructor(x?: number, y?: number, z?: number, test1?: number, test2?: Color, test3?: TestT | null);
x?: number,
y?: number,
z?: number,
test1?: number,
test2?: Color,
test3?: TestT | null,
);
pack(builder: flatbuffers.Builder): flatbuffers.Offset; pack(builder: flatbuffers.Builder): flatbuffers.Offset;
} }

View File

@@ -1,6 +1,6 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
import {Color} from '../../my-game/example/color.js'; import { Color } from './color.js';
import {Test} from '../../my-game/example/test.js'; import { Test } from './test.js';
export class Vec3 { export class Vec3 {
constructor() { constructor() {
this.bb = null; this.bb = null;
@@ -72,9 +72,7 @@ export class Vec3 {
return builder.offset(); return builder.offset();
} }
unpack() { unpack() {
return new Vec3T( return new Vec3T(this.x(), this.y(), this.z(), this.test1(), this.test2(), (this.test3() !== null ? this.test3().unpack() : null));
this.x(), this.y(), this.z(), this.test1(), this.test2(),
(this.test3() !== null ? this.test3().unpack() : null));
} }
unpackTo(_o) { unpackTo(_o) {
_o.x = this.x(); _o.x = this.x();
@@ -86,8 +84,7 @@ export class Vec3 {
} }
} }
export class Vec3T { export class Vec3T {
constructor( constructor(x = 0.0, y = 0.0, z = 0.0, test1 = 0.0, test2 = Color.Red, test3 = null) {
x = 0.0, y = 0.0, z = 0.0, test1 = 0.0, test2 = Color.Red, test3 = null) {
this.x = x; this.x = x;
this.y = y; this.y = y;
this.z = z; this.z = z;
@@ -96,8 +93,6 @@ export class Vec3T {
this.test3 = test3; this.test3 = test3;
} }
pack(builder) { pack(builder) {
return Vec3.createVec3( return Vec3.createVec3(builder, this.x, this.y, this.z, this.test1, this.test2, (this.test3?.a ?? 0), (this.test3?.b ?? 0));
builder, this.x, this.y, this.z, this.test1, this.test2,
(this.test3?.a ?? 0), (this.test3?.b ?? 0));
} }
} }

View File

@@ -10,7 +10,7 @@ import { Test, TestT } from './test.js';
export class Vec3 implements flatbuffers.IUnpackableObject<Vec3T> { export class Vec3 implements flatbuffers.IUnpackableObject<Vec3T> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):Vec3 { __init(i:number, bb:flatbuffers.ByteBuffer):Vec3 {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;

View File

@@ -1,4 +1,3 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export { Monster, MonsterT } from './example2/monster.js'; export { Monster, MonsterT } from './example2/monster.js';

View File

@@ -1,16 +1,11 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export declare class Monster export declare class Monster implements flatbuffers.IUnpackableObject<MonsterT> {
implements flatbuffers.IUnpackableObject<MonsterT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): Monster; __init(i: number, bb: flatbuffers.ByteBuffer): Monster;
static getRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster; static getRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster;
static getSizePrefixedRootAsMonster( static getSizePrefixedRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster;
bb: flatbuffers.ByteBuffer, static getFullyQualifiedName(): "MyGame.Example2.Monster";
obj?: Monster,
): Monster;
static getFullyQualifiedName(): string;
static startMonster(builder: flatbuffers.Builder): void; static startMonster(builder: flatbuffers.Builder): void;
static endMonster(builder: flatbuffers.Builder): flatbuffers.Offset; static endMonster(builder: flatbuffers.Builder): flatbuffers.Offset;
static createMonster(builder: flatbuffers.Builder): flatbuffers.Offset; static createMonster(builder: flatbuffers.Builder): flatbuffers.Offset;

View File

@@ -1,6 +1,5 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export class Monster { export class Monster {
constructor() { constructor() {
@@ -13,13 +12,11 @@ export class Monster {
return this; return this;
} }
static getRootAsMonster(bb, obj) { static getRootAsMonster(bb, obj) {
return (obj || new Monster()) return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getSizePrefixedRootAsMonster(bb, obj) { static getSizePrefixedRootAsMonster(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new Monster()) return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getFullyQualifiedName() { static getFullyQualifiedName() {
return 'MyGame.Example2.Monster'; return 'MyGame.Example2.Monster';

View File

@@ -8,7 +8,7 @@ import * as flatbuffers from 'flatbuffers';
export class Monster implements flatbuffers.IUnpackableObject<MonsterT> { export class Monster implements flatbuffers.IUnpackableObject<MonsterT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):Monster { __init(i:number, bb:flatbuffers.ByteBuffer):Monster {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -28,7 +28,7 @@ static getFullyQualifiedName(): "MyGame.Example2.Monster" {
return 'MyGame.Example2.Monster'; return 'MyGame.Example2.Monster';
} }
static startMonster(builder:flatbuffers.Builder) { static startMonster(builder:flatbuffers.Builder):void {
builder.startObject(0); builder.startObject(0);
} }

View File

@@ -1,32 +1,20 @@
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export declare class InParentNamespace export declare class InParentNamespace implements flatbuffers.IUnpackableObject<InParentNamespaceT> {
implements flatbuffers.IUnpackableObject<InParentNamespaceT>
{
bb: flatbuffers.ByteBuffer | null; bb: flatbuffers.ByteBuffer | null;
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): InParentNamespace; __init(i: number, bb: flatbuffers.ByteBuffer): InParentNamespace;
static getRootAsInParentNamespace( static getRootAsInParentNamespace(bb: flatbuffers.ByteBuffer, obj?: InParentNamespace): InParentNamespace;
bb: flatbuffers.ByteBuffer, static getSizePrefixedRootAsInParentNamespace(bb: flatbuffers.ByteBuffer, obj?: InParentNamespace): InParentNamespace;
obj?: InParentNamespace, static getFullyQualifiedName(): "MyGame.InParentNamespace";
): InParentNamespace;
static getSizePrefixedRootAsInParentNamespace(
bb: flatbuffers.ByteBuffer,
obj?: InParentNamespace,
): InParentNamespace;
static getFullyQualifiedName(): string;
static startInParentNamespace(builder: flatbuffers.Builder): void; static startInParentNamespace(builder: flatbuffers.Builder): void;
static endInParentNamespace(builder: flatbuffers.Builder): flatbuffers.Offset; static endInParentNamespace(builder: flatbuffers.Builder): flatbuffers.Offset;
static createInParentNamespace( static createInParentNamespace(builder: flatbuffers.Builder): flatbuffers.Offset;
builder: flatbuffers.Builder,
): flatbuffers.Offset;
serialize(): Uint8Array; serialize(): Uint8Array;
static deserialize(buffer: Uint8Array): InParentNamespace; static deserialize(buffer: Uint8Array): InParentNamespace;
unpack(): InParentNamespaceT; unpack(): InParentNamespaceT;
unpackTo(_o: InParentNamespaceT): void; unpackTo(_o: InParentNamespaceT): void;
} }
export declare class InParentNamespaceT export declare class InParentNamespaceT implements flatbuffers.IGeneratedObject {
implements flatbuffers.IGeneratedObject
{
constructor(); constructor();
pack(builder: flatbuffers.Builder): flatbuffers.Offset; pack(builder: flatbuffers.Builder): flatbuffers.Offset;
} }

View File

@@ -1,6 +1,5 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
export class InParentNamespace { export class InParentNamespace {
constructor() { constructor() {
@@ -13,13 +12,11 @@ export class InParentNamespace {
return this; return this;
} }
static getRootAsInParentNamespace(bb, obj) { static getRootAsInParentNamespace(bb, obj) {
return (obj || new InParentNamespace()) return (obj || new InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getSizePrefixedRootAsInParentNamespace(bb, obj) { static getSizePrefixedRootAsInParentNamespace(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new InParentNamespace()) return (obj || new InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getFullyQualifiedName() { static getFullyQualifiedName() {
return 'MyGame.InParentNamespace'; return 'MyGame.InParentNamespace';
@@ -39,8 +36,7 @@ export class InParentNamespace {
return this.bb.bytes(); return this.bb.bytes();
} }
static deserialize(buffer) { static deserialize(buffer) {
return InParentNamespace.getRootAsInParentNamespace( return InParentNamespace.getRootAsInParentNamespace(new flatbuffers.ByteBuffer(buffer));
new flatbuffers.ByteBuffer(buffer));
} }
unpack() { unpack() {
return new InParentNamespaceT(); return new InParentNamespaceT();

View File

@@ -8,7 +8,7 @@ import * as flatbuffers from 'flatbuffers';
export class InParentNamespace implements flatbuffers.IUnpackableObject<InParentNamespaceT> { export class InParentNamespace implements flatbuffers.IUnpackableObject<InParentNamespaceT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):InParentNamespace { __init(i:number, bb:flatbuffers.ByteBuffer):InParentNamespace {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -28,7 +28,7 @@ static getFullyQualifiedName(): "MyGame.InParentNamespace" {
return 'MyGame.InParentNamespace'; return 'MyGame.InParentNamespace';
} }
static startInParentNamespace(builder:flatbuffers.Builder) { static startInParentNamespace(builder:flatbuffers.Builder):void {
builder.startObject(0); builder.startObject(0);
} }

View File

@@ -1,6 +1,5 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export { FromInclude } from './other-name-space/from-include.js'; export { FromInclude } from './other-name-space/from-include.js';
export { TableB, TableBT } from './other-name-space/table-b.js'; export { TableB, TableBT } from './other-name-space/table-b.js';
export { Unused, UnusedT } from './other-name-space/unused.js'; export { Unused, UnusedT } from './other-name-space/unused.js';

View File

@@ -1,3 +1,3 @@
export declare enum FromInclude { export declare enum FromInclude {
IncludeVal = '0', IncludeVal = "0"
} }

View File

@@ -1,7 +1,6 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
export var FromInclude; export var FromInclude;
(function (FromInclude) { (function (FromInclude) {
FromInclude['IncludeVal'] = '0'; FromInclude["IncludeVal"] = "0";
})(FromInclude || (FromInclude = {})); })(FromInclude || (FromInclude = {}));

View File

@@ -3,5 +3,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
export enum FromInclude { export enum FromInclude {
IncludeVal = '0', IncludeVal = '0'
} }

View File

@@ -5,19 +5,13 @@ export declare class TableB implements flatbuffers.IUnpackableObject<TableBT> {
bb_pos: number; bb_pos: number;
__init(i: number, bb: flatbuffers.ByteBuffer): TableB; __init(i: number, bb: flatbuffers.ByteBuffer): TableB;
static getRootAsTableB(bb: flatbuffers.ByteBuffer, obj?: TableB): TableB; static getRootAsTableB(bb: flatbuffers.ByteBuffer, obj?: TableB): TableB;
static getSizePrefixedRootAsTableB( static getSizePrefixedRootAsTableB(bb: flatbuffers.ByteBuffer, obj?: TableB): TableB;
bb: flatbuffers.ByteBuffer,
obj?: TableB,
): TableB;
a(obj?: TableA): TableA | null; a(obj?: TableA): TableA | null;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.OtherNameSpace.TableB";
static startTableB(builder: flatbuffers.Builder): void; static startTableB(builder: flatbuffers.Builder): void;
static addA(builder: flatbuffers.Builder, aOffset: flatbuffers.Offset): void; static addA(builder: flatbuffers.Builder, aOffset: flatbuffers.Offset): void;
static endTableB(builder: flatbuffers.Builder): flatbuffers.Offset; static endTableB(builder: flatbuffers.Builder): flatbuffers.Offset;
static createTableB( static createTableB(builder: flatbuffers.Builder, aOffset: flatbuffers.Offset): flatbuffers.Offset;
builder: flatbuffers.Builder,
aOffset: flatbuffers.Offset,
): flatbuffers.Offset;
serialize(): Uint8Array; serialize(): Uint8Array;
static deserialize(buffer: Uint8Array): TableB; static deserialize(buffer: Uint8Array): TableB;
unpack(): TableBT; unpack(): TableBT;

View File

@@ -1,10 +1,7 @@
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
* @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers'; import * as flatbuffers from 'flatbuffers';
import { TableA } from '../../table-a.js'; import { TableA } from '../../table-a.js';
export class TableB { export class TableB {
constructor() { constructor() {
this.bb = null; this.bb = null;
@@ -16,20 +13,15 @@ export class TableB {
return this; return this;
} }
static getRootAsTableB(bb, obj) { static getRootAsTableB(bb, obj) {
return (obj || new TableB()) return (obj || new TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
static getSizePrefixedRootAsTableB(bb, obj) { static getSizePrefixedRootAsTableB(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new TableB()) return (obj || new TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
} }
a(obj) { a(obj) {
const offset = this.bb.__offset(this.bb_pos, 4); const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? return offset ? (obj || new TableA()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
(obj || new TableA())
.__init(this.bb.__indirect(this.bb_pos + offset), this.bb) :
null;
} }
static getFullyQualifiedName() { static getFullyQualifiedName() {
return 'MyGame.OtherNameSpace.TableB'; return 'MyGame.OtherNameSpace.TableB';

View File

@@ -6,9 +6,10 @@ import * as flatbuffers from 'flatbuffers';
import { TableA, TableAT } from '../../table-a.js'; import { TableA, TableAT } from '../../table-a.js';
export class TableB implements flatbuffers.IUnpackableObject<TableBT> { export class TableB implements flatbuffers.IUnpackableObject<TableBT> {
bb: flatbuffers.ByteBuffer|null = null; bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0; bb_pos: number = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):TableB { __init(i:number, bb:flatbuffers.ByteBuffer):TableB {
this.bb_pos = i; this.bb_pos = i;
this.bb = bb; this.bb = bb;
@@ -16,42 +17,28 @@ export class TableB implements flatbuffers.IUnpackableObject<TableBT> {
} }
static getRootAsTableB(bb:flatbuffers.ByteBuffer, obj?:TableB):TableB { static getRootAsTableB(bb:flatbuffers.ByteBuffer, obj?:TableB):TableB {
return (obj || new TableB()).__init( return (obj || new TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
bb.readInt32(bb.position()) + bb.position(),
bb,
);
} }
static getSizePrefixedRootAsTableB( static getSizePrefixedRootAsTableB(bb:flatbuffers.ByteBuffer, obj?:TableB):TableB {
bb: flatbuffers.ByteBuffer,
obj?: TableB,
): TableB {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new TableB()).__init( return (obj || new TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
bb.readInt32(bb.position()) + bb.position(),
bb,
);
} }
a(obj?:TableA):TableA|null { a(obj?:TableA):TableA|null {
const offset = this.bb!.__offset(this.bb_pos, 4); const offset = this.bb!.__offset(this.bb_pos, 4);
return offset return offset ? (obj || new TableA()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
? (obj || new TableA()).__init(
this.bb!.__indirect(this.bb_pos + offset),
this.bb!,
)
: null;
} }
static getFullyQualifiedName(): string { static getFullyQualifiedName(): "MyGame.OtherNameSpace.TableB" {
return 'MyGame.OtherNameSpace.TableB'; return 'MyGame.OtherNameSpace.TableB';
} }
static startTableB(builder: flatbuffers.Builder) { static startTableB(builder:flatbuffers.Builder):void {
builder.startObject(1); builder.startObject(1);
} }
static addA(builder: flatbuffers.Builder, aOffset: flatbuffers.Offset) { static addA(builder:flatbuffers.Builder, aOffset:flatbuffers.Offset):void {
builder.addFieldOffset(0, aOffset, 0); builder.addFieldOffset(0, aOffset, 0);
} }
@@ -60,10 +47,7 @@ export class TableB implements flatbuffers.IUnpackableObject<TableBT> {
return offset; return offset;
} }
static createTableB( static createTableB(builder:flatbuffers.Builder, aOffset:flatbuffers.Offset):flatbuffers.Offset {
builder: flatbuffers.Builder,
aOffset: flatbuffers.Offset,
): flatbuffers.Offset {
TableB.startTableB(builder); TableB.startTableB(builder);
TableB.addA(builder, aOffset); TableB.addA(builder, aOffset);
return TableB.endTableB(builder); return TableB.endTableB(builder);
@@ -74,24 +58,32 @@ export class TableB implements flatbuffers.IUnpackableObject<TableBT> {
} }
static deserialize(buffer: Uint8Array):TableB { static deserialize(buffer: Uint8Array):TableB {
return TableB.getRootAsTableB(new flatbuffers.ByteBuffer(buffer)); return TableB.getRootAsTableB(new flatbuffers.ByteBuffer(buffer))
} }
unpack(): TableBT { unpack(): TableBT {
return new TableBT(this.a() !== null ? this.a()!.unpack() : null); return new TableBT(
(this.a() !== null ? this.a()!.unpack() : null)
);
} }
unpackTo(_o: TableBT): void { unpackTo(_o: TableBT): void {
_o.a = this.a() !== null ? this.a()!.unpack() : null; _o.a = (this.a() !== null ? this.a()!.unpack() : null);
} }
} }
export class TableBT implements flatbuffers.IGeneratedObject { export class TableBT implements flatbuffers.IGeneratedObject {
constructor(public a: TableAT | null = null) {} constructor(
public a: TableAT|null = null
){}
pack(builder:flatbuffers.Builder): flatbuffers.Offset { pack(builder:flatbuffers.Builder): flatbuffers.Offset {
const a = this.a !== null ? this.a!.pack(builder) : 0; const a = (this.a !== null ? this.a!.pack(builder) : 0);
return TableB.createTableB(builder, a); return TableB.createTableB(builder,
a
);
} }
} }

View File

@@ -5,12 +5,9 @@ export declare class Unused implements flatbuffers.IUnpackableObject<UnusedT> {
__init(i: number, bb: flatbuffers.ByteBuffer): Unused; __init(i: number, bb: flatbuffers.ByteBuffer): Unused;
a(): number; a(): number;
mutate_a(value: number): boolean; mutate_a(value: number): boolean;
static getFullyQualifiedName(): string; static getFullyQualifiedName(): "MyGame.OtherNameSpace.Unused";
static sizeOf(): number; static sizeOf(): number;
static createUnused( static createUnused(builder: flatbuffers.Builder, a: number): flatbuffers.Offset;
builder: flatbuffers.Builder,
a: number,
): flatbuffers.Offset;
unpack(): UnusedT; unpack(): UnusedT;
unpackTo(_o: UnusedT): void; unpackTo(_o: UnusedT): void;
} }

Some files were not shown because too many files have changed in this diff Show More