mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 19:33:56 +00:00
Improve TS types to support isolatedModules and isolatedDeclarations
This commit is contained in:
@@ -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";
|
||||||
|
|||||||
@@ -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
9
tests/ts/abc.ts
Normal 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
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
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';
|
||||||
export {NestedStruct, NestedStructT} from './example/nested-struct.js';
|
export { NestedStruct, NestedStructT } from './example/nested-struct.js';
|
||||||
export {OuterStruct, OuterStructT} from './example/outer-struct.js';
|
export { OuterStruct, OuterStructT } from './example/outer-struct.js';
|
||||||
export {TestEnum} from './example/test-enum.js';
|
export { TestEnum } from './example/test-enum.js';
|
||||||
|
|||||||
@@ -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 { 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';
|
export { NestedStruct, NestedStructT } from './example/nested-struct.js';
|
||||||
export {NestedStruct, NestedStructT} from './example/nested-struct.js';
|
export { OuterStruct, OuterStructT } from './example/outer-struct.js';
|
||||||
export {OuterStruct, OuterStructT} from './example/outer-struct.js';
|
export { TestEnum } from './example/test-enum.js';
|
||||||
export {TestEnum} from './example/test-enum.js';
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
/* 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 {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';
|
||||||
export {NestedStruct, NestedStructT} from './example/nested-struct.js';
|
export { NestedStruct, NestedStructT } from './example/nested-struct.js';
|
||||||
export {OuterStruct, OuterStructT} from './example/outer-struct.js';
|
export { OuterStruct, OuterStructT } from './example/outer-struct.js';
|
||||||
export {TestEnum} from './example/test-enum.js';
|
export { TestEnum } from './example/test-enum.js';
|
||||||
|
|||||||
@@ -1,53 +1,31 @@
|
|||||||
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';
|
bb: flatbuffers.ByteBuffer | null;
|
||||||
import {OuterStruct, OuterStructT} from '../../my-game/example/outer-struct.js';
|
bb_pos: number;
|
||||||
export declare class ArrayStruct
|
__init(i: number, bb: flatbuffers.ByteBuffer): ArrayStruct;
|
||||||
implements flatbuffers.IUnpackableObject<ArrayStructT>
|
aUnderscore(): number;
|
||||||
{
|
bUnderscore(index: number): number | null;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
c(): number;
|
||||||
bb_pos: number;
|
d(index: number, obj?: NestedStruct): NestedStruct | null;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): ArrayStruct;
|
e(): number;
|
||||||
aUnderscore(): number;
|
f(index: number, obj?: OuterStruct): OuterStruct | null;
|
||||||
bUnderscore(index: number): number | null;
|
g(index: number): bigint | null;
|
||||||
c(): number;
|
static getFullyQualifiedName(): "MyGame.Example.ArrayStruct";
|
||||||
d(index: number, obj?: NestedStruct): NestedStruct | null;
|
static sizeOf(): number;
|
||||||
e(): number;
|
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;
|
||||||
f(index: number, obj?: OuterStruct): OuterStruct | null;
|
unpack(): ArrayStructT;
|
||||||
g(index: number): bigint | null;
|
unpackTo(_o: ArrayStructT): void;
|
||||||
static getFullyQualifiedName(): string;
|
|
||||||
static sizeOf(): number;
|
|
||||||
static createArrayStruct(
|
|
||||||
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;
|
|
||||||
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,
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
bUnderscore?: number[],
|
|
||||||
c?: number,
|
|
||||||
d?: NestedStructT[],
|
|
||||||
e?: number,
|
|
||||||
f?: OuterStructT[],
|
|
||||||
g?: bigint[],
|
|
||||||
);
|
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,115 +1,98 @@
|
|||||||
// 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;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
|
||||||
__init(i, bb) {
|
|
||||||
this.bb_pos = i;
|
|
||||||
this.bb = bb;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
aUnderscore() {
|
|
||||||
return this.bb.readFloat32(this.bb_pos);
|
|
||||||
}
|
|
||||||
bUnderscore(index) {
|
|
||||||
return this.bb.readInt32(this.bb_pos + 4 + index * 4);
|
|
||||||
}
|
|
||||||
c() {
|
|
||||||
return this.bb.readInt8(this.bb_pos + 64);
|
|
||||||
}
|
|
||||||
d(index, obj) {
|
|
||||||
return (obj || new NestedStruct())
|
|
||||||
.__init(this.bb_pos + 72 + index * 1072, this.bb);
|
|
||||||
}
|
|
||||||
e() {
|
|
||||||
return this.bb.readInt32(this.bb_pos + 2216);
|
|
||||||
}
|
|
||||||
f(index, obj) {
|
|
||||||
return (obj || new OuterStruct())
|
|
||||||
.__init(this.bb_pos + 2224 + index * 208, this.bb);
|
|
||||||
}
|
|
||||||
g(index) {
|
|
||||||
return this.bb.readInt64(this.bb_pos + 2640 + index * 8);
|
|
||||||
}
|
|
||||||
static getFullyQualifiedName() {
|
|
||||||
return 'MyGame.Example.ArrayStruct';
|
|
||||||
}
|
|
||||||
static sizeOf() {
|
|
||||||
return 2656;
|
|
||||||
}
|
|
||||||
static createArrayStruct(builder, a_underscore, b_underscore, c, d, e, f, g) {
|
|
||||||
builder.prep(8, 2656);
|
|
||||||
for (let i = 1; i >= 0; --i) {
|
|
||||||
builder.writeInt64(BigInt(g?.[i] ?? 0));
|
|
||||||
}
|
}
|
||||||
for (let i = 1; i >= 0; --i) {
|
__init(i, bb) {
|
||||||
const item = f?.[i];
|
this.bb_pos = i;
|
||||||
if (item instanceof OuterStructT) {
|
this.bb = bb;
|
||||||
item.pack(builder);
|
return this;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
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.pad(4);
|
aUnderscore() {
|
||||||
builder.writeInt32(e);
|
return this.bb.readFloat32(this.bb_pos);
|
||||||
for (let i = 1; i >= 0; --i) {
|
|
||||||
const item = d?.[i];
|
|
||||||
if (item instanceof NestedStructT) {
|
|
||||||
item.pack(builder);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
NestedStruct.createNestedStruct(
|
|
||||||
builder, item?.a, item?.b, item?.cUnderscore, item?.dOuter, item?.e);
|
|
||||||
}
|
}
|
||||||
builder.pad(7);
|
bUnderscore(index) {
|
||||||
builder.writeInt8(c);
|
return this.bb.readInt32(this.bb_pos + 4 + index * 4);
|
||||||
for (let i = 14; i >= 0; --i) {
|
}
|
||||||
builder.writeInt32((b_underscore?.[i] ?? 0));
|
c() {
|
||||||
|
return this.bb.readInt8(this.bb_pos + 64);
|
||||||
|
}
|
||||||
|
d(index, obj) {
|
||||||
|
return (obj || new NestedStruct()).__init(this.bb_pos + 72 + index * 1072, this.bb);
|
||||||
|
}
|
||||||
|
e() {
|
||||||
|
return this.bb.readInt32(this.bb_pos + 2216);
|
||||||
|
}
|
||||||
|
f(index, obj) {
|
||||||
|
return (obj || new OuterStruct()).__init(this.bb_pos + 2224 + index * 208, this.bb);
|
||||||
|
}
|
||||||
|
g(index) {
|
||||||
|
return this.bb.readInt64(this.bb_pos + 2640 + index * 8);
|
||||||
|
}
|
||||||
|
static getFullyQualifiedName() {
|
||||||
|
return 'MyGame.Example.ArrayStruct';
|
||||||
|
}
|
||||||
|
static sizeOf() {
|
||||||
|
return 2656;
|
||||||
|
}
|
||||||
|
static createArrayStruct(builder, a_underscore, b_underscore, c, d, e, f, g) {
|
||||||
|
builder.prep(8, 2656);
|
||||||
|
for (let i = 1; i >= 0; --i) {
|
||||||
|
builder.writeInt64(BigInt(g?.[i] ?? 0));
|
||||||
|
}
|
||||||
|
for (let i = 1; i >= 0; --i) {
|
||||||
|
const item = f?.[i];
|
||||||
|
if (item instanceof OuterStructT) {
|
||||||
|
item.pack(builder);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
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.pad(4);
|
||||||
|
builder.writeInt32(e);
|
||||||
|
for (let i = 1; i >= 0; --i) {
|
||||||
|
const item = d?.[i];
|
||||||
|
if (item instanceof NestedStructT) {
|
||||||
|
item.pack(builder);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
NestedStruct.createNestedStruct(builder, item?.a, item?.b, item?.cUnderscore, item?.dOuter, item?.e);
|
||||||
|
}
|
||||||
|
builder.pad(7);
|
||||||
|
builder.writeInt8(c);
|
||||||
|
for (let i = 14; i >= 0; --i) {
|
||||||
|
builder.writeInt32((b_underscore?.[i] ?? 0));
|
||||||
|
}
|
||||||
|
builder.writeFloat32(a_underscore);
|
||||||
|
return builder.offset();
|
||||||
|
}
|
||||||
|
unpack() {
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
unpackTo(_o) {
|
||||||
|
_o.aUnderscore = this.aUnderscore();
|
||||||
|
_o.bUnderscore = this.bb.createScalarList(this.bUnderscore.bind(this), 15);
|
||||||
|
_o.c = this.c();
|
||||||
|
_o.d = this.bb.createObjList(this.d.bind(this), 2);
|
||||||
|
_o.e = this.e();
|
||||||
|
_o.f = this.bb.createObjList(this.f.bind(this), 2);
|
||||||
|
_o.g = this.bb.createScalarList(this.g.bind(this), 2);
|
||||||
}
|
}
|
||||||
builder.writeFloat32(a_underscore);
|
|
||||||
return builder.offset();
|
|
||||||
}
|
|
||||||
unpack() {
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
unpackTo(_o) {
|
|
||||||
_o.aUnderscore = this.aUnderscore();
|
|
||||||
_o.bUnderscore = this.bb.createScalarList(this.bUnderscore.bind(this), 15);
|
|
||||||
_o.c = this.c();
|
|
||||||
_o.d = this.bb.createObjList(this.d.bind(this), 2);
|
|
||||||
_o.e = this.e();
|
|
||||||
_o.f = this.bb.createObjList(this.f.bind(this), 2);
|
|
||||||
_o.g = this.bb.createScalarList(this.g.bind(this), 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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 = [],
|
this.aUnderscore = aUnderscore;
|
||||||
g = []) {
|
this.bUnderscore = bUnderscore;
|
||||||
this.aUnderscore = aUnderscore;
|
this.c = c;
|
||||||
this.bUnderscore = bUnderscore;
|
this.d = d;
|
||||||
this.c = c;
|
this.e = e;
|
||||||
this.d = d;
|
this.f = f;
|
||||||
this.e = e;
|
this.g = g;
|
||||||
this.f = f;
|
}
|
||||||
this.g = g;
|
pack(builder) {
|
||||||
}
|
return ArrayStruct.createArrayStruct(builder, this.aUnderscore, this.bUnderscore, this.c, this.d, this.e, this.f, this.g);
|
||||||
pack(builder) {
|
}
|
||||||
return ArrayStruct.createArrayStruct(
|
|
||||||
builder, this.aUnderscore, this.bUnderscore, this.c, this.d, this.e,
|
|
||||||
this.f, this.g);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,191 +4,165 @@
|
|||||||
|
|
||||||
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>
|
|
||||||
{
|
|
||||||
bb: flatbuffers.ByteBuffer | null = null;
|
|
||||||
bb_pos = 0;
|
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): ArrayStruct {
|
|
||||||
this.bb_pos = i;
|
|
||||||
this.bb = bb;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
aUnderscore(): number {
|
export class ArrayStruct implements flatbuffers.IUnpackableObject<ArrayStructT> {
|
||||||
return this.bb!.readFloat32(this.bb_pos);
|
bb: flatbuffers.ByteBuffer|null = null;
|
||||||
}
|
bb_pos: number = 0;
|
||||||
|
__init(i:number, bb:flatbuffers.ByteBuffer):ArrayStruct {
|
||||||
|
this.bb_pos = i;
|
||||||
|
this.bb = bb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
bUnderscore(index: number): number | null {
|
aUnderscore():number {
|
||||||
|
return this.bb!.readFloat32(this.bb_pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
bUnderscore(index: number):number|null {
|
||||||
return this.bb!.readInt32(this.bb_pos + 4 + index * 4);
|
return this.bb!.readInt32(this.bb_pos + 4 + index * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
c(): number {
|
c():number {
|
||||||
return this.bb!.readInt8(this.bb_pos + 64);
|
return this.bb!.readInt8(this.bb_pos + 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
||||||
return this.bb!.readInt32(this.bb_pos + 2216);
|
return this.bb!.readInt32(this.bb_pos + 2216);
|
||||||
}
|
}
|
||||||
|
|
||||||
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(): "MyGame.Example.ArrayStruct" {
|
||||||
|
return 'MyGame.Example.ArrayStruct';
|
||||||
|
}
|
||||||
|
|
||||||
|
static sizeOf():number {
|
||||||
|
return 2656;
|
||||||
|
}
|
||||||
|
|
||||||
|
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.prep(8, 2656);
|
||||||
|
|
||||||
|
for (let i = 1; i >= 0; --i) {
|
||||||
|
builder.writeInt64(BigInt(g?.[i] ?? 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static getFullyQualifiedName(): string {
|
|
||||||
return 'MyGame.Example.ArrayStruct';
|
|
||||||
}
|
|
||||||
|
|
||||||
static sizeOf(): number {
|
for (let i = 1; i >= 0; --i) {
|
||||||
return 2656;
|
const item = f?.[i];
|
||||||
}
|
|
||||||
|
|
||||||
static createArrayStruct(
|
if (item instanceof OuterStructT) {
|
||||||
builder: flatbuffers.Builder,
|
item.pack(builder);
|
||||||
a_underscore: number,
|
continue;
|
||||||
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);
|
|
||||||
|
|
||||||
for (let i = 1; i >= 0; --i) {
|
|
||||||
builder.writeInt64(BigInt(g?.[i] ?? 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 1; i >= 0; --i) {
|
OuterStruct.createOuterStruct(builder,
|
||||||
const item = f?.[i];
|
item?.a,
|
||||||
|
item?.b,
|
||||||
if (item instanceof OuterStructT) {
|
(item?.cUnderscore?.a ?? 0),
|
||||||
item.pack(builder);
|
(item?.cUnderscore?.b ?? []),
|
||||||
continue;
|
(item?.cUnderscore?.c ?? 0),
|
||||||
}
|
(item?.cUnderscore?.dUnderscore ?? BigInt(0)),
|
||||||
|
item?.d,
|
||||||
OuterStruct.createOuterStruct(
|
(item?.e?.a ?? 0),
|
||||||
builder,
|
(item?.e?.b ?? []),
|
||||||
item?.a,
|
(item?.e?.c ?? 0),
|
||||||
item?.b,
|
(item?.e?.dUnderscore ?? BigInt(0)),
|
||||||
item?.cUnderscore?.a ?? 0,
|
item?.f
|
||||||
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.writeInt32(e);
|
|
||||||
|
|
||||||
for (let i = 1; i >= 0; --i) {
|
|
||||||
const item = d?.[i];
|
|
||||||
|
|
||||||
if (item instanceof NestedStructT) {
|
|
||||||
item.pack(builder);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
NestedStruct.createNestedStruct(
|
|
||||||
builder,
|
|
||||||
item?.a,
|
|
||||||
item?.b,
|
|
||||||
item?.cUnderscore,
|
|
||||||
item?.dOuter,
|
|
||||||
item?.e,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.pad(7);
|
|
||||||
builder.writeInt8(c);
|
|
||||||
|
|
||||||
for (let i = 14; i >= 0; --i) {
|
|
||||||
builder.writeInt32(b_underscore?.[i] ?? 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.writeFloat32(a_underscore);
|
|
||||||
return builder.offset();
|
|
||||||
}
|
|
||||||
|
|
||||||
unpack(): ArrayStructT {
|
|
||||||
return new ArrayStructT(
|
|
||||||
this.aUnderscore(),
|
|
||||||
this.bb!.createScalarList<number>(this.bUnderscore.bind(this), 15),
|
|
||||||
this.c(),
|
|
||||||
this.bb!.createObjList<NestedStruct, NestedStructT>(this.d.bind(this), 2),
|
|
||||||
this.e(),
|
|
||||||
this.bb!.createObjList<OuterStruct, OuterStructT>(this.f.bind(this), 2),
|
|
||||||
this.bb!.createScalarList<bigint>(this.g.bind(this), 2),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
unpackTo(_o: ArrayStructT): void {
|
builder.pad(4);
|
||||||
_o.aUnderscore = this.aUnderscore();
|
builder.writeInt32(e);
|
||||||
_o.bUnderscore = this.bb!.createScalarList<number>(
|
|
||||||
this.bUnderscore.bind(this),
|
for (let i = 1; i >= 0; --i) {
|
||||||
15,
|
const item = d?.[i];
|
||||||
|
|
||||||
|
if (item instanceof NestedStructT) {
|
||||||
|
item.pack(builder);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
NestedStruct.createNestedStruct(builder,
|
||||||
|
item?.a,
|
||||||
|
item?.b,
|
||||||
|
item?.cUnderscore,
|
||||||
|
item?.dOuter,
|
||||||
|
item?.e
|
||||||
);
|
);
|
||||||
_o.c = this.c();
|
|
||||||
_o.d = this.bb!.createObjList<NestedStruct, NestedStructT>(
|
|
||||||
this.d.bind(this),
|
|
||||||
2,
|
|
||||||
);
|
|
||||||
_o.e = this.e();
|
|
||||||
_o.f = this.bb!.createObjList<OuterStruct, OuterStructT>(
|
|
||||||
this.f.bind(this),
|
|
||||||
2,
|
|
||||||
);
|
|
||||||
_o.g = this.bb!.createScalarList<bigint>(this.g.bind(this), 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
builder.pad(7);
|
||||||
|
builder.writeInt8(c);
|
||||||
|
|
||||||
|
for (let i = 14; i >= 0; --i) {
|
||||||
|
builder.writeInt32((b_underscore?.[i] ?? 0));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.writeFloat32(a_underscore);
|
||||||
|
return builder.offset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unpack(): ArrayStructT {
|
||||||
|
return new ArrayStructT(
|
||||||
|
this.aUnderscore(),
|
||||||
|
this.bb!.createScalarList<number>(this.bUnderscore.bind(this), 15),
|
||||||
|
this.c(),
|
||||||
|
this.bb!.createObjList<NestedStruct, NestedStructT>(this.d.bind(this), 2),
|
||||||
|
this.e(),
|
||||||
|
this.bb!.createObjList<OuterStruct, OuterStructT>(this.f.bind(this), 2),
|
||||||
|
this.bb!.createScalarList<bigint>(this.g.bind(this), 2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unpackTo(_o: ArrayStructT): void {
|
||||||
|
_o.aUnderscore = this.aUnderscore();
|
||||||
|
_o.bUnderscore = this.bb!.createScalarList<number>(this.bUnderscore.bind(this), 15);
|
||||||
|
_o.c = this.c();
|
||||||
|
_o.d = this.bb!.createObjList<NestedStruct, NestedStructT>(this.d.bind(this), 2);
|
||||||
|
_o.e = this.e();
|
||||||
|
_o.f = this.bb!.createObjList<OuterStruct, OuterStructT>(this.f.bind(this), 2);
|
||||||
|
_o.g = this.bb!.createScalarList<bigint>(this.g.bind(this), 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
|
||||||
return ArrayStruct.createArrayStruct(
|
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||||
builder,
|
return ArrayStruct.createArrayStruct(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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): ArrayTable;
|
||||||
bb_pos: number;
|
static getRootAsArrayTable(bb: flatbuffers.ByteBuffer, obj?: ArrayTable): ArrayTable;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): ArrayTable;
|
static getSizePrefixedRootAsArrayTable(bb: flatbuffers.ByteBuffer, obj?: ArrayTable): ArrayTable;
|
||||||
static getRootAsArrayTable(
|
static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean;
|
||||||
bb: flatbuffers.ByteBuffer,
|
a(): string | null;
|
||||||
obj?: ArrayTable,
|
a(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||||
): ArrayTable;
|
cUnderscore(obj?: ArrayStruct): ArrayStruct | null;
|
||||||
static getSizePrefixedRootAsArrayTable(
|
static getFullyQualifiedName(): "MyGame.Example.ArrayTable";
|
||||||
bb: flatbuffers.ByteBuffer,
|
static startArrayTable(builder: flatbuffers.Builder): void;
|
||||||
obj?: ArrayTable,
|
static addA(builder: flatbuffers.Builder, aOffset: flatbuffers.Offset): void;
|
||||||
): ArrayTable;
|
static addCUnderscore(builder: flatbuffers.Builder, cUnderscoreOffset: flatbuffers.Offset): void;
|
||||||
static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean;
|
static endArrayTable(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
a(): string | null;
|
static finishArrayTableBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||||
a(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
static finishSizePrefixedArrayTableBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||||
cUnderscore(obj?: ArrayStruct): ArrayStruct | null;
|
unpack(): ArrayTableT;
|
||||||
static getFullyQualifiedName(): string;
|
unpackTo(_o: ArrayTableT): void;
|
||||||
static startArrayTable(builder: flatbuffers.Builder): void;
|
|
||||||
static addA(builder: flatbuffers.Builder, aOffset: flatbuffers.Offset): void;
|
|
||||||
static addCUnderscore(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
cUnderscoreOffset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static endArrayTable(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
static finishArrayTableBuffer(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
offset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static finishSizePrefixedArrayTableBuffer(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
offset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
unpack(): ArrayTableT;
|
|
||||||
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,
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
cUnderscore?: ArrayStructT | null,
|
|
||||||
);
|
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,88 +1,75 @@
|
|||||||
// 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;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
}
|
||||||
__init(i, bb) {
|
__init(i, bb) {
|
||||||
this.bb_pos = i;
|
this.bb_pos = i;
|
||||||
this.bb = bb;
|
this.bb = bb;
|
||||||
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()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
return (obj || new ArrayTable())
|
}
|
||||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
static bufferHasIdentifier(bb) {
|
||||||
}
|
return bb.__has_identifier('RHUB');
|
||||||
static bufferHasIdentifier(bb) {
|
}
|
||||||
return bb.__has_identifier('RHUB');
|
a(optionalEncoding) {
|
||||||
}
|
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||||
a(optionalEncoding) {
|
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
}
|
||||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
cUnderscore(obj) {
|
||||||
null;
|
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||||
}
|
return offset ? (obj || new ArrayStruct()).__init(this.bb_pos + offset, this.bb) : null;
|
||||||
cUnderscore(obj) {
|
}
|
||||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
static getFullyQualifiedName() {
|
||||||
return offset ?
|
return 'MyGame.Example.ArrayTable';
|
||||||
(obj || new ArrayStruct()).__init(this.bb_pos + offset, this.bb) :
|
}
|
||||||
null;
|
static startArrayTable(builder) {
|
||||||
}
|
builder.startObject(2);
|
||||||
static getFullyQualifiedName() {
|
}
|
||||||
return 'MyGame.Example.ArrayTable';
|
static addA(builder, aOffset) {
|
||||||
}
|
builder.addFieldOffset(0, aOffset, 0);
|
||||||
static startArrayTable(builder) {
|
}
|
||||||
builder.startObject(2);
|
static addCUnderscore(builder, cUnderscoreOffset) {
|
||||||
}
|
builder.addFieldStruct(1, cUnderscoreOffset, 0);
|
||||||
static addA(builder, aOffset) {
|
}
|
||||||
builder.addFieldOffset(0, aOffset, 0);
|
static endArrayTable(builder) {
|
||||||
}
|
const offset = builder.endObject();
|
||||||
static addCUnderscore(builder, cUnderscoreOffset) {
|
return offset;
|
||||||
builder.addFieldStruct(1, cUnderscoreOffset, 0);
|
}
|
||||||
}
|
static finishArrayTableBuffer(builder, offset) {
|
||||||
static endArrayTable(builder) {
|
builder.finish(offset, 'RHUB');
|
||||||
const offset = builder.endObject();
|
}
|
||||||
return offset;
|
static finishSizePrefixedArrayTableBuffer(builder, offset) {
|
||||||
}
|
builder.finish(offset, 'RHUB', true);
|
||||||
static finishArrayTableBuffer(builder, offset) {
|
}
|
||||||
builder.finish(offset, 'RHUB');
|
unpack() {
|
||||||
}
|
return new ArrayTableT(this.a(), (this.cUnderscore() !== null ? this.cUnderscore().unpack() : null));
|
||||||
static finishSizePrefixedArrayTableBuffer(builder, offset) {
|
}
|
||||||
builder.finish(offset, 'RHUB', true);
|
unpackTo(_o) {
|
||||||
}
|
_o.a = this.a();
|
||||||
unpack() {
|
_o.cUnderscore = (this.cUnderscore() !== null ? this.cUnderscore().unpack() : null);
|
||||||
return new ArrayTableT(
|
}
|
||||||
this.a(),
|
|
||||||
(this.cUnderscore() !== null ? this.cUnderscore().unpack() : null));
|
|
||||||
}
|
|
||||||
unpackTo(_o) {
|
|
||||||
_o.a = this.a();
|
|
||||||
_o.cUnderscore =
|
|
||||||
(this.cUnderscore() !== null ? this.cUnderscore().unpack() : null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
export class ArrayTableT {
|
export class ArrayTableT {
|
||||||
constructor(a = null, cUnderscore = null) {
|
constructor(a = null, cUnderscore = null) {
|
||||||
this.a = a;
|
this.a = a;
|
||||||
this.cUnderscore = cUnderscore;
|
this.cUnderscore = cUnderscore;
|
||||||
}
|
}
|
||||||
pack(builder) {
|
pack(builder) {
|
||||||
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,
|
return ArrayTable.endArrayTable(builder);
|
||||||
(this.cUnderscore !== null ? this.cUnderscore.pack(builder) : 0));
|
}
|
||||||
return ArrayTable.endArrayTable(builder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,126 +4,101 @@
|
|||||||
|
|
||||||
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,
|
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||||
obj?: ArrayTable,
|
return (obj || new ArrayTable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
): ArrayTable {
|
}
|
||||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
||||||
return (obj || new ArrayTable()).__init(
|
|
||||||
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,
|
builder.addFieldStruct(1, cUnderscoreOffset, 0);
|
||||||
cUnderscoreOffset: flatbuffers.Offset,
|
}
|
||||||
) {
|
|
||||||
builder.addFieldStruct(1, cUnderscoreOffset, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static endArrayTable(builder: flatbuffers.Builder): flatbuffers.Offset {
|
static endArrayTable(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||||
const offset = builder.endObject();
|
const offset = builder.endObject();
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
static finishArrayTableBuffer(
|
static finishArrayTableBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
|
||||||
builder: flatbuffers.Builder,
|
builder.finish(offset, 'RHUB');
|
||||||
offset: flatbuffers.Offset,
|
}
|
||||||
) {
|
|
||||||
builder.finish(offset, 'RHUB');
|
|
||||||
}
|
|
||||||
|
|
||||||
static finishSizePrefixedArrayTableBuffer(
|
static finishSizePrefixedArrayTableBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
|
||||||
builder: flatbuffers.Builder,
|
builder.finish(offset, 'RHUB', true);
|
||||||
offset: flatbuffers.Offset,
|
}
|
||||||
) {
|
|
||||||
builder.finish(offset, 'RHUB', true);
|
|
||||||
}
|
|
||||||
|
|
||||||
unpack(): ArrayTableT {
|
|
||||||
return new ArrayTableT(
|
|
||||||
this.a(),
|
|
||||||
this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
unpackTo(_o: ArrayTableT): void {
|
unpack(): ArrayTableT {
|
||||||
_o.a = this.a();
|
return new ArrayTableT(
|
||||||
_o.cUnderscore =
|
this.a(),
|
||||||
this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null;
|
(this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null)
|
||||||
}
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unpackTo(_o: ArrayTableT): void {
|
||||||
|
_o.a = this.a();
|
||||||
|
_o.cUnderscore = (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 {
|
|
||||||
const a = this.a !== null ? builder.createString(this.a!) : 0;
|
|
||||||
|
|
||||||
ArrayTable.startArrayTable(builder);
|
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||||
ArrayTable.addA(builder, a);
|
const a = (this.a !== null ? builder.createString(this.a!) : 0);
|
||||||
ArrayTable.addCUnderscore(
|
|
||||||
builder,
|
|
||||||
this.cUnderscore !== null ? this.cUnderscore!.pack(builder) : 0,
|
|
||||||
);
|
|
||||||
|
|
||||||
return ArrayTable.endArrayTable(builder);
|
ArrayTable.startArrayTable(builder);
|
||||||
}
|
ArrayTable.addA(builder, a);
|
||||||
|
ArrayTable.addCUnderscore(builder, (this.cUnderscore !== null ? this.cUnderscore!.pack(builder) : 0));
|
||||||
|
|
||||||
|
return ArrayTable.endArrayTable(builder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,23 @@
|
|||||||
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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): InnerStruct;
|
||||||
bb_pos: number;
|
a(): number;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): InnerStruct;
|
b(index: number): number | null;
|
||||||
a(): number;
|
c(): number;
|
||||||
b(index: number): number | null;
|
dUnderscore(): bigint;
|
||||||
c(): number;
|
static getFullyQualifiedName(): "MyGame.Example.InnerStruct";
|
||||||
dUnderscore(): bigint;
|
static sizeOf(): number;
|
||||||
static getFullyQualifiedName(): string;
|
static createInnerStruct(builder: flatbuffers.Builder, a: number, b: number[], c: number, d_underscore: bigint): flatbuffers.Offset;
|
||||||
static sizeOf(): number;
|
unpack(): InnerStructT;
|
||||||
static createInnerStruct(
|
unpackTo(_o: InnerStructT): void;
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
a: number,
|
|
||||||
b: number[] | null,
|
|
||||||
c: number,
|
|
||||||
d_underscore: bigint,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
unpack(): InnerStructT;
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,64 +1,61 @@
|
|||||||
// automatically generated by the FlatBuffers compiler, do not modify
|
// automatically generated by the FlatBuffers compiler, do not modify
|
||||||
export class InnerStruct {
|
export class InnerStruct {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.bb = null;
|
this.bb = null;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
}
|
||||||
__init(i, bb) {
|
__init(i, bb) {
|
||||||
this.bb_pos = i;
|
this.bb_pos = i;
|
||||||
this.bb = bb;
|
this.bb = bb;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
a() {
|
a() {
|
||||||
return this.bb.readFloat64(this.bb_pos);
|
return this.bb.readFloat64(this.bb_pos);
|
||||||
}
|
}
|
||||||
b(index) {
|
b(index) {
|
||||||
return this.bb.readUint8(this.bb_pos + 8 + index);
|
return this.bb.readUint8(this.bb_pos + 8 + index);
|
||||||
}
|
}
|
||||||
c() {
|
c() {
|
||||||
return this.bb.readInt8(this.bb_pos + 21);
|
return this.bb.readInt8(this.bb_pos + 21);
|
||||||
}
|
}
|
||||||
dUnderscore() {
|
dUnderscore() {
|
||||||
return this.bb.readInt64(this.bb_pos + 24);
|
return this.bb.readInt64(this.bb_pos + 24);
|
||||||
}
|
}
|
||||||
static getFullyQualifiedName() {
|
static getFullyQualifiedName() {
|
||||||
return 'MyGame.Example.InnerStruct';
|
return 'MyGame.Example.InnerStruct';
|
||||||
}
|
}
|
||||||
static sizeOf() {
|
static sizeOf() {
|
||||||
return 32;
|
return 32;
|
||||||
}
|
}
|
||||||
static createInnerStruct(builder, a, b, c, d_underscore) {
|
static createInnerStruct(builder, a, b, c, d_underscore) {
|
||||||
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);
|
||||||
|
return builder.offset();
|
||||||
|
}
|
||||||
|
unpack() {
|
||||||
|
return new InnerStructT(this.a(), this.bb.createScalarList(this.b.bind(this), 13), this.c(), this.dUnderscore());
|
||||||
|
}
|
||||||
|
unpackTo(_o) {
|
||||||
|
_o.a = this.a();
|
||||||
|
_o.b = this.bb.createScalarList(this.b.bind(this), 13);
|
||||||
|
_o.c = this.c();
|
||||||
|
_o.dUnderscore = this.dUnderscore();
|
||||||
}
|
}
|
||||||
builder.writeFloat64(a);
|
|
||||||
return builder.offset();
|
|
||||||
}
|
|
||||||
unpack() {
|
|
||||||
return new InnerStructT(
|
|
||||||
this.a(), this.bb.createScalarList(this.b.bind(this), 13), this.c(),
|
|
||||||
this.dUnderscore());
|
|
||||||
}
|
|
||||||
unpackTo(_o) {
|
|
||||||
_o.a = this.a();
|
|
||||||
_o.b = this.bb.createScalarList(this.b.bind(this), 13);
|
|
||||||
_o.c = this.c();
|
|
||||||
_o.dUnderscore = this.dUnderscore();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
export class InnerStructT {
|
export class InnerStructT {
|
||||||
constructor(a = 0.0, b = [], c = 0, dUnderscore = BigInt('0')) {
|
constructor(a = 0.0, b = [], c = 0, dUnderscore = BigInt('0')) {
|
||||||
this.a = a;
|
this.a = a;
|
||||||
this.b = b;
|
this.b = b;
|
||||||
this.c = c;
|
this.c = c;
|
||||||
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);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,93 +4,90 @@
|
|||||||
|
|
||||||
import * as flatbuffers from 'flatbuffers';
|
import * as flatbuffers from 'flatbuffers';
|
||||||
|
|
||||||
export class InnerStruct
|
|
||||||
implements flatbuffers.IUnpackableObject<InnerStructT>
|
|
||||||
{
|
|
||||||
bb: flatbuffers.ByteBuffer | null = null;
|
|
||||||
bb_pos = 0;
|
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): InnerStruct {
|
|
||||||
this.bb_pos = i;
|
|
||||||
this.bb = bb;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
a(): number {
|
|
||||||
return this.bb!.readFloat64(this.bb_pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
b(index: number): number | null {
|
export class InnerStruct implements flatbuffers.IUnpackableObject<InnerStructT> {
|
||||||
|
bb: flatbuffers.ByteBuffer|null = null;
|
||||||
|
bb_pos: number = 0;
|
||||||
|
__init(i:number, bb:flatbuffers.ByteBuffer):InnerStruct {
|
||||||
|
this.bb_pos = i;
|
||||||
|
this.bb = bb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
a():number {
|
||||||
|
return this.bb!.readFloat64(this.bb_pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
b(index: number):number|null {
|
||||||
return this.bb!.readUint8(this.bb_pos + 8 + index);
|
return this.bb!.readUint8(this.bb_pos + 8 + index);
|
||||||
|
}
|
||||||
|
|
||||||
|
c():number {
|
||||||
|
return this.bb!.readInt8(this.bb_pos + 21);
|
||||||
|
}
|
||||||
|
|
||||||
|
dUnderscore():bigint {
|
||||||
|
return this.bb!.readInt64(this.bb_pos + 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
static getFullyQualifiedName(): "MyGame.Example.InnerStruct" {
|
||||||
|
return 'MyGame.Example.InnerStruct';
|
||||||
|
}
|
||||||
|
|
||||||
|
static sizeOf():number {
|
||||||
|
return 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
static createInnerStruct(builder:flatbuffers.Builder, a: number, b: number[], c: number, d_underscore: bigint):flatbuffers.Offset {
|
||||||
|
builder.prep(8, 32);
|
||||||
|
builder.writeInt64(BigInt(d_underscore ?? 0));
|
||||||
|
builder.pad(2);
|
||||||
|
builder.writeInt8(c);
|
||||||
|
|
||||||
|
for (let i = 12; i >= 0; --i) {
|
||||||
|
builder.writeInt8((b?.[i] ?? 0));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
c(): number {
|
builder.writeFloat64(a);
|
||||||
return this.bb!.readInt8(this.bb_pos + 21);
|
return builder.offset();
|
||||||
}
|
}
|
||||||
|
|
||||||
dUnderscore(): bigint {
|
|
||||||
return this.bb!.readInt64(this.bb_pos + 24);
|
|
||||||
}
|
|
||||||
|
|
||||||
static getFullyQualifiedName(): string {
|
unpack(): InnerStructT {
|
||||||
return 'MyGame.Example.InnerStruct';
|
return new InnerStructT(
|
||||||
}
|
this.a(),
|
||||||
|
this.bb!.createScalarList<number>(this.b.bind(this), 13),
|
||||||
|
this.c(),
|
||||||
|
this.dUnderscore()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
static sizeOf(): number {
|
|
||||||
return 32;
|
|
||||||
}
|
|
||||||
|
|
||||||
static createInnerStruct(
|
unpackTo(_o: InnerStructT): void {
|
||||||
builder: flatbuffers.Builder,
|
_o.a = this.a();
|
||||||
a: number,
|
_o.b = this.bb!.createScalarList<number>(this.b.bind(this), 13);
|
||||||
b: number[] | null,
|
_o.c = this.c();
|
||||||
c: number,
|
_o.dUnderscore = this.dUnderscore();
|
||||||
d_underscore: bigint,
|
}
|
||||||
): flatbuffers.Offset {
|
|
||||||
builder.prep(8, 32);
|
|
||||||
builder.writeInt64(BigInt(d_underscore ?? 0));
|
|
||||||
builder.pad(2);
|
|
||||||
builder.writeInt8(c);
|
|
||||||
|
|
||||||
for (let i = 12; i >= 0; --i) {
|
|
||||||
builder.writeInt8(b?.[i] ?? 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.writeFloat64(a);
|
|
||||||
return builder.offset();
|
|
||||||
}
|
|
||||||
|
|
||||||
unpack(): InnerStructT {
|
|
||||||
return new InnerStructT(
|
|
||||||
this.a(),
|
|
||||||
this.bb!.createScalarList<number>(this.b.bind(this), 13),
|
|
||||||
this.c(),
|
|
||||||
this.dUnderscore(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
unpackTo(_o: InnerStructT): void {
|
|
||||||
_o.a = this.a();
|
|
||||||
_o.b = this.bb!.createScalarList<number>(this.b.bind(this), 13);
|
|
||||||
_o.c = this.c();
|
|
||||||
_o.dUnderscore = this.dUnderscore();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
|
||||||
return InnerStruct.createInnerStruct(
|
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||||
builder,
|
return InnerStruct.createInnerStruct(builder,
|
||||||
this.a,
|
this.a,
|
||||||
this.b,
|
this.b,
|
||||||
this.c,
|
this.c,
|
||||||
this.dUnderscore,
|
this.dUnderscore
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,27 @@
|
|||||||
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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): NestedStruct;
|
||||||
bb_pos: number;
|
a(index: number): number | null;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): NestedStruct;
|
b(): TestEnum;
|
||||||
a(index: number): number | null;
|
cUnderscore(index: number): TestEnum | null;
|
||||||
b(): TestEnum;
|
dOuter(index: number, obj?: OuterStruct): OuterStruct | null;
|
||||||
cUnderscore(index: number): TestEnum | null;
|
e(index: number): bigint | null;
|
||||||
dOuter(index: number, obj?: OuterStruct): OuterStruct | null;
|
static getFullyQualifiedName(): "MyGame.Example.NestedStruct";
|
||||||
e(index: number): bigint | null;
|
static sizeOf(): number;
|
||||||
static getFullyQualifiedName(): string;
|
static createNestedStruct(builder: flatbuffers.Builder, a: number[], b: TestEnum, c_underscore: number[], d_outer: (any | OuterStructT)[], e: bigint[]): flatbuffers.Offset;
|
||||||
static sizeOf(): number;
|
unpack(): NestedStructT;
|
||||||
static createNestedStruct(
|
unpackTo(_o: NestedStructT): void;
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
a: number[] | null,
|
|
||||||
b: TestEnum,
|
|
||||||
c_underscore: number[] | null,
|
|
||||||
d_outer: (any | OuterStructT)[] | null,
|
|
||||||
e: bigint[] | null,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
unpack(): NestedStructT;
|
|
||||||
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[],
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
b?: TestEnum,
|
|
||||||
cUnderscore?: TestEnum[],
|
|
||||||
dOuter?: OuterStructT[],
|
|
||||||
e?: bigint[],
|
|
||||||
);
|
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,93 +1,80 @@
|
|||||||
// 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;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
|
||||||
__init(i, bb) {
|
|
||||||
this.bb_pos = i;
|
|
||||||
this.bb = bb;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
a(index) {
|
|
||||||
return this.bb.readInt32(this.bb_pos + 0 + index * 4);
|
|
||||||
}
|
|
||||||
b() {
|
|
||||||
return this.bb.readInt8(this.bb_pos + 8);
|
|
||||||
}
|
|
||||||
cUnderscore(index) {
|
|
||||||
return this.bb.readInt8(this.bb_pos + 9 + index);
|
|
||||||
}
|
|
||||||
dOuter(index, obj) {
|
|
||||||
return (obj || new OuterStruct())
|
|
||||||
.__init(this.bb_pos + 16 + index * 208, this.bb);
|
|
||||||
}
|
|
||||||
e(index) {
|
|
||||||
return this.bb.readInt64(this.bb_pos + 1056 + index * 8);
|
|
||||||
}
|
|
||||||
static getFullyQualifiedName() {
|
|
||||||
return 'MyGame.Example.NestedStruct';
|
|
||||||
}
|
|
||||||
static sizeOf() {
|
|
||||||
return 1072;
|
|
||||||
}
|
|
||||||
static createNestedStruct(builder, a, b, c_underscore, d_outer, e) {
|
|
||||||
builder.prep(8, 1072);
|
|
||||||
for (let i = 1; i >= 0; --i) {
|
|
||||||
builder.writeInt64(BigInt(e?.[i] ?? 0));
|
|
||||||
}
|
}
|
||||||
for (let i = 4; i >= 0; --i) {
|
__init(i, bb) {
|
||||||
const item = d_outer?.[i];
|
this.bb_pos = i;
|
||||||
if (item instanceof OuterStructT) {
|
this.bb = bb;
|
||||||
item.pack(builder);
|
return this;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
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.pad(5);
|
a(index) {
|
||||||
for (let i = 1; i >= 0; --i) {
|
return this.bb.readInt32(this.bb_pos + 0 + index * 4);
|
||||||
builder.writeInt8((c_underscore?.[i] ?? 0));
|
|
||||||
}
|
}
|
||||||
builder.writeInt8(b);
|
b() {
|
||||||
for (let i = 1; i >= 0; --i) {
|
return this.bb.readInt8(this.bb_pos + 8);
|
||||||
builder.writeInt32((a?.[i] ?? 0));
|
}
|
||||||
|
cUnderscore(index) {
|
||||||
|
return this.bb.readInt8(this.bb_pos + 9 + index);
|
||||||
|
}
|
||||||
|
dOuter(index, obj) {
|
||||||
|
return (obj || new OuterStruct()).__init(this.bb_pos + 16 + index * 208, this.bb);
|
||||||
|
}
|
||||||
|
e(index) {
|
||||||
|
return this.bb.readInt64(this.bb_pos + 1056 + index * 8);
|
||||||
|
}
|
||||||
|
static getFullyQualifiedName() {
|
||||||
|
return 'MyGame.Example.NestedStruct';
|
||||||
|
}
|
||||||
|
static sizeOf() {
|
||||||
|
return 1072;
|
||||||
|
}
|
||||||
|
static createNestedStruct(builder, a, b, c_underscore, d_outer, e) {
|
||||||
|
builder.prep(8, 1072);
|
||||||
|
for (let i = 1; i >= 0; --i) {
|
||||||
|
builder.writeInt64(BigInt(e?.[i] ?? 0));
|
||||||
|
}
|
||||||
|
for (let i = 4; i >= 0; --i) {
|
||||||
|
const item = d_outer?.[i];
|
||||||
|
if (item instanceof OuterStructT) {
|
||||||
|
item.pack(builder);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
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.pad(5);
|
||||||
|
for (let i = 1; i >= 0; --i) {
|
||||||
|
builder.writeInt8((c_underscore?.[i] ?? 0));
|
||||||
|
}
|
||||||
|
builder.writeInt8(b);
|
||||||
|
for (let i = 1; i >= 0; --i) {
|
||||||
|
builder.writeInt32((a?.[i] ?? 0));
|
||||||
|
}
|
||||||
|
return builder.offset();
|
||||||
|
}
|
||||||
|
unpack() {
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
unpackTo(_o) {
|
||||||
|
_o.a = this.bb.createScalarList(this.a.bind(this), 2);
|
||||||
|
_o.b = this.b();
|
||||||
|
_o.cUnderscore = this.bb.createScalarList(this.cUnderscore.bind(this), 2);
|
||||||
|
_o.dOuter = this.bb.createObjList(this.dOuter.bind(this), 5);
|
||||||
|
_o.e = this.bb.createScalarList(this.e.bind(this), 2);
|
||||||
}
|
}
|
||||||
return builder.offset();
|
|
||||||
}
|
|
||||||
unpack() {
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
unpackTo(_o) {
|
|
||||||
_o.a = this.bb.createScalarList(this.a.bind(this), 2);
|
|
||||||
_o.b = this.b();
|
|
||||||
_o.cUnderscore = this.bb.createScalarList(this.cUnderscore.bind(this), 2);
|
|
||||||
_o.dOuter = this.bb.createObjList(this.dOuter.bind(this), 5);
|
|
||||||
_o.e = this.bb.createScalarList(this.e.bind(this), 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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],
|
this.a = a;
|
||||||
dOuter = [], e = []) {
|
this.b = b;
|
||||||
this.a = a;
|
this.cUnderscore = cUnderscore;
|
||||||
this.b = b;
|
this.dOuter = dOuter;
|
||||||
this.cUnderscore = cUnderscore;
|
this.e = e;
|
||||||
this.dOuter = dOuter;
|
}
|
||||||
this.e = e;
|
pack(builder) {
|
||||||
}
|
return NestedStruct.createNestedStruct(builder, this.a, this.b, this.cUnderscore, this.dOuter, this.e);
|
||||||
pack(builder) {
|
}
|
||||||
return NestedStruct.createNestedStruct(
|
|
||||||
builder, this.a, this.b, this.cUnderscore, this.dOuter, this.e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,150 +4,134 @@
|
|||||||
|
|
||||||
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>
|
|
||||||
{
|
|
||||||
bb: flatbuffers.ByteBuffer | null = null;
|
|
||||||
bb_pos = 0;
|
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): NestedStruct {
|
|
||||||
this.bb_pos = i;
|
|
||||||
this.bb = bb;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
a(index: number): number | null {
|
export class NestedStruct implements flatbuffers.IUnpackableObject<NestedStructT> {
|
||||||
|
bb: flatbuffers.ByteBuffer|null = null;
|
||||||
|
bb_pos: number = 0;
|
||||||
|
__init(i:number, bb:flatbuffers.ByteBuffer):NestedStruct {
|
||||||
|
this.bb_pos = i;
|
||||||
|
this.bb = bb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
a(index: number):number|null {
|
||||||
return this.bb!.readInt32(this.bb_pos + 0 + index * 4);
|
return this.bb!.readInt32(this.bb_pos + 0 + index * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
b(): TestEnum {
|
b():TestEnum {
|
||||||
return this.bb!.readInt8(this.bb_pos + 8);
|
return this.bb!.readInt8(this.bb_pos + 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
cUnderscore(index: number): TestEnum | null {
|
cUnderscore(index: number):TestEnum|null {
|
||||||
return this.bb!.readInt8(this.bb_pos + 9 + index);
|
return this.bb!.readInt8(this.bb_pos + 9 + index);
|
||||||
}
|
}
|
||||||
|
|
||||||
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(): "MyGame.Example.NestedStruct" {
|
||||||
|
return 'MyGame.Example.NestedStruct';
|
||||||
|
}
|
||||||
|
|
||||||
|
static sizeOf():number {
|
||||||
|
return 1072;
|
||||||
|
}
|
||||||
|
|
||||||
|
static createNestedStruct(builder:flatbuffers.Builder, a: number[], b: TestEnum, c_underscore: number[], d_outer: (any|OuterStructT)[], e: bigint[]):flatbuffers.Offset {
|
||||||
|
builder.prep(8, 1072);
|
||||||
|
|
||||||
|
for (let i = 1; i >= 0; --i) {
|
||||||
|
builder.writeInt64(BigInt(e?.[i] ?? 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static getFullyQualifiedName(): string {
|
|
||||||
return 'MyGame.Example.NestedStruct';
|
|
||||||
}
|
|
||||||
|
|
||||||
static sizeOf(): number {
|
for (let i = 4; i >= 0; --i) {
|
||||||
return 1072;
|
const item = d_outer?.[i];
|
||||||
}
|
|
||||||
|
|
||||||
static createNestedStruct(
|
if (item instanceof OuterStructT) {
|
||||||
builder: flatbuffers.Builder,
|
item.pack(builder);
|
||||||
a: number[] | null,
|
continue;
|
||||||
b: TestEnum,
|
|
||||||
c_underscore: number[] | null,
|
|
||||||
d_outer: (any | OuterStructT)[] | null,
|
|
||||||
e: bigint[] | null,
|
|
||||||
): flatbuffers.Offset {
|
|
||||||
builder.prep(8, 1072);
|
|
||||||
|
|
||||||
for (let i = 1; i >= 0; --i) {
|
|
||||||
builder.writeInt64(BigInt(e?.[i] ?? 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 4; i >= 0; --i) {
|
OuterStruct.createOuterStruct(builder,
|
||||||
const item = d_outer?.[i];
|
item?.a,
|
||||||
|
item?.b,
|
||||||
if (item instanceof OuterStructT) {
|
(item?.cUnderscore?.a ?? 0),
|
||||||
item.pack(builder);
|
(item?.cUnderscore?.b ?? []),
|
||||||
continue;
|
(item?.cUnderscore?.c ?? 0),
|
||||||
}
|
(item?.cUnderscore?.dUnderscore ?? BigInt(0)),
|
||||||
|
item?.d,
|
||||||
OuterStruct.createOuterStruct(
|
(item?.e?.a ?? 0),
|
||||||
builder,
|
(item?.e?.b ?? []),
|
||||||
item?.a,
|
(item?.e?.c ?? 0),
|
||||||
item?.b,
|
(item?.e?.dUnderscore ?? BigInt(0)),
|
||||||
item?.cUnderscore?.a ?? 0,
|
item?.f
|
||||||
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);
|
|
||||||
|
|
||||||
for (let i = 1; i >= 0; --i) {
|
|
||||||
builder.writeInt8(c_underscore?.[i] ?? 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.writeInt8(b);
|
|
||||||
|
|
||||||
for (let i = 1; i >= 0; --i) {
|
|
||||||
builder.writeInt32(a?.[i] ?? 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return builder.offset();
|
|
||||||
}
|
|
||||||
|
|
||||||
unpack(): NestedStructT {
|
|
||||||
return new NestedStructT(
|
|
||||||
this.bb!.createScalarList<number>(this.a.bind(this), 2),
|
|
||||||
this.b(),
|
|
||||||
this.bb!.createScalarList<TestEnum>(this.cUnderscore.bind(this), 2),
|
|
||||||
this.bb!.createObjList<OuterStruct, OuterStructT>(
|
|
||||||
this.dOuter.bind(this),
|
|
||||||
5,
|
|
||||||
),
|
|
||||||
this.bb!.createScalarList<bigint>(this.e.bind(this), 2),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
unpackTo(_o: NestedStructT): void {
|
builder.pad(5);
|
||||||
_o.a = this.bb!.createScalarList<number>(this.a.bind(this), 2);
|
|
||||||
_o.b = this.b();
|
for (let i = 1; i >= 0; --i) {
|
||||||
_o.cUnderscore = this.bb!.createScalarList<TestEnum>(
|
builder.writeInt8((c_underscore?.[i] ?? 0));
|
||||||
this.cUnderscore.bind(this),
|
|
||||||
2,
|
|
||||||
);
|
|
||||||
_o.dOuter = this.bb!.createObjList<OuterStruct, OuterStructT>(
|
|
||||||
this.dOuter.bind(this),
|
|
||||||
5,
|
|
||||||
);
|
|
||||||
_o.e = this.bb!.createScalarList<bigint>(this.e.bind(this), 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
builder.writeInt8(b);
|
||||||
|
|
||||||
|
for (let i = 1; i >= 0; --i) {
|
||||||
|
builder.writeInt32((a?.[i] ?? 0));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder.offset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unpack(): NestedStructT {
|
||||||
|
return new NestedStructT(
|
||||||
|
this.bb!.createScalarList<number>(this.a.bind(this), 2),
|
||||||
|
this.b(),
|
||||||
|
this.bb!.createScalarList<TestEnum>(this.cUnderscore.bind(this), 2),
|
||||||
|
this.bb!.createObjList<OuterStruct, OuterStructT>(this.dOuter.bind(this), 5),
|
||||||
|
this.bb!.createScalarList<bigint>(this.e.bind(this), 2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unpackTo(_o: NestedStructT): void {
|
||||||
|
_o.a = this.bb!.createScalarList<number>(this.a.bind(this), 2);
|
||||||
|
_o.b = this.b();
|
||||||
|
_o.cUnderscore = this.bb!.createScalarList<TestEnum>(this.cUnderscore.bind(this), 2);
|
||||||
|
_o.dOuter = this.bb!.createObjList<OuterStruct, OuterStructT>(this.dOuter.bind(this), 5);
|
||||||
|
_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 {
|
|
||||||
return NestedStruct.createNestedStruct(
|
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||||
builder,
|
return NestedStruct.createNestedStruct(builder,
|
||||||
this.a,
|
this.a,
|
||||||
this.b,
|
this.b,
|
||||||
this.cUnderscore,
|
this.cUnderscore,
|
||||||
this.dOuter,
|
this.dOuter,
|
||||||
this.e,
|
this.e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,51 +1,28 @@
|
|||||||
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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): OuterStruct;
|
||||||
bb_pos: number;
|
a(): boolean;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): OuterStruct;
|
b(): number;
|
||||||
a(): boolean;
|
cUnderscore(obj?: InnerStruct): InnerStruct | null;
|
||||||
b(): number;
|
d(index: number, obj?: InnerStruct): InnerStruct | null;
|
||||||
cUnderscore(obj?: InnerStruct): InnerStruct | null;
|
e(obj?: InnerStruct): InnerStruct | null;
|
||||||
d(index: number, obj?: InnerStruct): InnerStruct | null;
|
f(index: number): number | null;
|
||||||
e(obj?: InnerStruct): InnerStruct | null;
|
static getFullyQualifiedName(): "MyGame.Example.OuterStruct";
|
||||||
f(index: number): number | null;
|
static sizeOf(): number;
|
||||||
static getFullyQualifiedName(): string;
|
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;
|
||||||
static sizeOf(): number;
|
unpack(): OuterStructT;
|
||||||
static createOuterStruct(
|
unpackTo(_o: OuterStructT): void;
|
||||||
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;
|
|
||||||
unpackTo(_o: OuterStructT): void;
|
|
||||||
}
|
}
|
||||||
export declare class OuterStructT implements flatbuffers.IGeneratedObject {
|
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,
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
b?: number,
|
|
||||||
cUnderscore?: InnerStructT | null,
|
|
||||||
d?: InnerStructT[],
|
|
||||||
e?: InnerStructT | null,
|
|
||||||
f?: number[],
|
|
||||||
);
|
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,111 +1,95 @@
|
|||||||
// 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;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
|
||||||
__init(i, bb) {
|
|
||||||
this.bb_pos = i;
|
|
||||||
this.bb = bb;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
a() {
|
|
||||||
return !!this.bb.readInt8(this.bb_pos);
|
|
||||||
}
|
|
||||||
b() {
|
|
||||||
return this.bb.readFloat64(this.bb_pos + 8);
|
|
||||||
}
|
|
||||||
cUnderscore(obj) {
|
|
||||||
return (obj || new InnerStruct()).__init(this.bb_pos + 16, this.bb);
|
|
||||||
}
|
|
||||||
d(index, obj) {
|
|
||||||
return (obj || new InnerStruct())
|
|
||||||
.__init(this.bb_pos + 48 + index * 32, this.bb);
|
|
||||||
}
|
|
||||||
e(obj) {
|
|
||||||
return (obj || new InnerStruct()).__init(this.bb_pos + 144, this.bb);
|
|
||||||
}
|
|
||||||
f(index) {
|
|
||||||
return this.bb.readFloat64(this.bb_pos + 176 + index * 8);
|
|
||||||
}
|
|
||||||
static getFullyQualifiedName() {
|
|
||||||
return 'MyGame.Example.OuterStruct';
|
|
||||||
}
|
|
||||||
static sizeOf() {
|
|
||||||
return 208;
|
|
||||||
}
|
|
||||||
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.prep(8, 208);
|
|
||||||
for (let i = 3; i >= 0; --i) {
|
|
||||||
builder.writeFloat64((f?.[i] ?? 0));
|
|
||||||
}
|
}
|
||||||
builder.prep(8, 32);
|
__init(i, bb) {
|
||||||
builder.writeInt64(BigInt(e_d_underscore ?? 0));
|
this.bb_pos = i;
|
||||||
builder.pad(2);
|
this.bb = bb;
|
||||||
builder.writeInt8(e_c);
|
return this;
|
||||||
for (let i = 12; i >= 0; --i) {
|
|
||||||
builder.writeInt8((e_b?.[i] ?? 0));
|
|
||||||
}
|
}
|
||||||
builder.writeFloat64(e_a);
|
a() {
|
||||||
for (let i = 2; i >= 0; --i) {
|
return !!this.bb.readInt8(this.bb_pos);
|
||||||
const item = d?.[i];
|
|
||||||
if (item instanceof InnerStructT) {
|
|
||||||
item.pack(builder);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
InnerStruct.createInnerStruct(
|
|
||||||
builder, item?.a, item?.b, item?.c, item?.dUnderscore);
|
|
||||||
}
|
}
|
||||||
builder.prep(8, 32);
|
b() {
|
||||||
builder.writeInt64(BigInt(c_underscore_d_underscore ?? 0));
|
return this.bb.readFloat64(this.bb_pos + 8);
|
||||||
builder.pad(2);
|
}
|
||||||
builder.writeInt8(c_underscore_c);
|
cUnderscore(obj) {
|
||||||
for (let i = 12; i >= 0; --i) {
|
return (obj || new InnerStruct()).__init(this.bb_pos + 16, this.bb);
|
||||||
builder.writeInt8((c_underscore_b?.[i] ?? 0));
|
}
|
||||||
|
d(index, obj) {
|
||||||
|
return (obj || new InnerStruct()).__init(this.bb_pos + 48 + index * 32, this.bb);
|
||||||
|
}
|
||||||
|
e(obj) {
|
||||||
|
return (obj || new InnerStruct()).__init(this.bb_pos + 144, this.bb);
|
||||||
|
}
|
||||||
|
f(index) {
|
||||||
|
return this.bb.readFloat64(this.bb_pos + 176 + index * 8);
|
||||||
|
}
|
||||||
|
static getFullyQualifiedName() {
|
||||||
|
return 'MyGame.Example.OuterStruct';
|
||||||
|
}
|
||||||
|
static sizeOf() {
|
||||||
|
return 208;
|
||||||
|
}
|
||||||
|
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.prep(8, 208);
|
||||||
|
for (let i = 3; i >= 0; --i) {
|
||||||
|
builder.writeFloat64((f?.[i] ?? 0));
|
||||||
|
}
|
||||||
|
builder.prep(8, 32);
|
||||||
|
builder.writeInt64(BigInt(e_d_underscore ?? 0));
|
||||||
|
builder.pad(2);
|
||||||
|
builder.writeInt8(e_c);
|
||||||
|
for (let i = 12; i >= 0; --i) {
|
||||||
|
builder.writeInt8((e_b?.[i] ?? 0));
|
||||||
|
}
|
||||||
|
builder.writeFloat64(e_a);
|
||||||
|
for (let i = 2; i >= 0; --i) {
|
||||||
|
const item = d?.[i];
|
||||||
|
if (item instanceof InnerStructT) {
|
||||||
|
item.pack(builder);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
InnerStruct.createInnerStruct(builder, item?.a, item?.b, item?.c, item?.dUnderscore);
|
||||||
|
}
|
||||||
|
builder.prep(8, 32);
|
||||||
|
builder.writeInt64(BigInt(c_underscore_d_underscore ?? 0));
|
||||||
|
builder.pad(2);
|
||||||
|
builder.writeInt8(c_underscore_c);
|
||||||
|
for (let i = 12; i >= 0; --i) {
|
||||||
|
builder.writeInt8((c_underscore_b?.[i] ?? 0));
|
||||||
|
}
|
||||||
|
builder.writeFloat64(c_underscore_a);
|
||||||
|
builder.writeFloat64(b);
|
||||||
|
builder.pad(7);
|
||||||
|
builder.writeInt8(Number(Boolean(a)));
|
||||||
|
return builder.offset();
|
||||||
|
}
|
||||||
|
unpack() {
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
unpackTo(_o) {
|
||||||
|
_o.a = this.a();
|
||||||
|
_o.b = this.b();
|
||||||
|
_o.cUnderscore = (this.cUnderscore() !== null ? this.cUnderscore().unpack() : null);
|
||||||
|
_o.d = this.bb.createObjList(this.d.bind(this), 3);
|
||||||
|
_o.e = (this.e() !== null ? this.e().unpack() : null);
|
||||||
|
_o.f = this.bb.createScalarList(this.f.bind(this), 4);
|
||||||
}
|
}
|
||||||
builder.writeFloat64(c_underscore_a);
|
|
||||||
builder.writeFloat64(b);
|
|
||||||
builder.pad(7);
|
|
||||||
builder.writeInt8(Number(Boolean(a)));
|
|
||||||
return builder.offset();
|
|
||||||
}
|
|
||||||
unpack() {
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
unpackTo(_o) {
|
|
||||||
_o.a = this.a();
|
|
||||||
_o.b = this.b();
|
|
||||||
_o.cUnderscore =
|
|
||||||
(this.cUnderscore() !== null ? this.cUnderscore().unpack() : null);
|
|
||||||
_o.d = this.bb.createObjList(this.d.bind(this), 3);
|
|
||||||
_o.e = (this.e() !== null ? this.e().unpack() : null);
|
|
||||||
_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;
|
this.d = d;
|
||||||
this.d = d;
|
this.e = e;
|
||||||
this.e = e;
|
this.f = f;
|
||||||
this.f = f;
|
}
|
||||||
}
|
pack(builder) {
|
||||||
pack(builder) {
|
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);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,169 +4,151 @@
|
|||||||
|
|
||||||
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>
|
|
||||||
{
|
|
||||||
bb: flatbuffers.ByteBuffer | null = null;
|
|
||||||
bb_pos = 0;
|
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): OuterStruct {
|
|
||||||
this.bb_pos = i;
|
|
||||||
this.bb = bb;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
a(): boolean {
|
export class OuterStruct implements flatbuffers.IUnpackableObject<OuterStructT> {
|
||||||
return !!this.bb!.readInt8(this.bb_pos);
|
bb: flatbuffers.ByteBuffer|null = null;
|
||||||
}
|
bb_pos: number = 0;
|
||||||
|
__init(i:number, bb:flatbuffers.ByteBuffer):OuterStruct {
|
||||||
|
this.bb_pos = i;
|
||||||
|
this.bb = bb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
b(): number {
|
a():boolean {
|
||||||
return this.bb!.readFloat64(this.bb_pos + 8);
|
return !!this.bb!.readInt8(this.bb_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
cUnderscore(obj?: InnerStruct): InnerStruct | null {
|
b():number {
|
||||||
return (obj || new InnerStruct()).__init(this.bb_pos + 16, this.bb!);
|
return this.bb!.readFloat64(this.bb_pos + 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
d(index: number, obj?: InnerStruct): InnerStruct | null {
|
cUnderscore(obj?:InnerStruct):InnerStruct|null {
|
||||||
return (obj || new InnerStruct()).__init(
|
return (obj || new InnerStruct()).__init(this.bb_pos + 16, this.bb!);
|
||||||
this.bb_pos + 48 + index * 32,
|
}
|
||||||
this.bb!,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
e(obj?: InnerStruct): InnerStruct | null {
|
d(index: number, obj?:InnerStruct):InnerStruct|null {
|
||||||
return (obj || new InnerStruct()).__init(this.bb_pos + 144, this.bb!);
|
return (obj || new InnerStruct()).__init(this.bb_pos + 48 + index * 32, this.bb!);
|
||||||
}
|
}
|
||||||
|
|
||||||
f(index: number): number | null {
|
e(obj?:InnerStruct):InnerStruct|null {
|
||||||
|
return (obj || new InnerStruct()).__init(this.bb_pos + 144, this.bb!);
|
||||||
|
}
|
||||||
|
|
||||||
|
f(index: number):number|null {
|
||||||
return this.bb!.readFloat64(this.bb_pos + 176 + index * 8);
|
return this.bb!.readFloat64(this.bb_pos + 176 + index * 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
static getFullyQualifiedName(): "MyGame.Example.OuterStruct" {
|
||||||
|
return 'MyGame.Example.OuterStruct';
|
||||||
|
}
|
||||||
|
|
||||||
|
static sizeOf():number {
|
||||||
|
return 208;
|
||||||
|
}
|
||||||
|
|
||||||
|
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.prep(8, 208);
|
||||||
|
|
||||||
|
for (let i = 3; i >= 0; --i) {
|
||||||
|
builder.writeFloat64((f?.[i] ?? 0));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static getFullyQualifiedName(): string {
|
builder.prep(8, 32);
|
||||||
return 'MyGame.Example.OuterStruct';
|
builder.writeInt64(BigInt(e_d_underscore ?? 0));
|
||||||
|
builder.pad(2);
|
||||||
|
builder.writeInt8(e_c);
|
||||||
|
|
||||||
|
for (let i = 12; i >= 0; --i) {
|
||||||
|
builder.writeInt8((e_b?.[i] ?? 0));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static sizeOf(): number {
|
builder.writeFloat64(e_a);
|
||||||
return 208;
|
|
||||||
}
|
|
||||||
|
|
||||||
static createOuterStruct(
|
for (let i = 2; i >= 0; --i) {
|
||||||
builder: flatbuffers.Builder,
|
const item = d?.[i];
|
||||||
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);
|
|
||||||
|
|
||||||
for (let i = 3; i >= 0; --i) {
|
if (item instanceof InnerStructT) {
|
||||||
builder.writeFloat64(f?.[i] ?? 0);
|
item.pack(builder);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.prep(8, 32);
|
InnerStruct.createInnerStruct(builder,
|
||||||
builder.writeInt64(BigInt(e_d_underscore ?? 0));
|
item?.a,
|
||||||
builder.pad(2);
|
item?.b,
|
||||||
builder.writeInt8(e_c);
|
item?.c,
|
||||||
|
item?.dUnderscore
|
||||||
for (let i = 12; i >= 0; --i) {
|
|
||||||
builder.writeInt8(e_b?.[i] ?? 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.writeFloat64(e_a);
|
|
||||||
|
|
||||||
for (let i = 2; i >= 0; --i) {
|
|
||||||
const item = d?.[i];
|
|
||||||
|
|
||||||
if (item instanceof InnerStructT) {
|
|
||||||
item.pack(builder);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
InnerStruct.createInnerStruct(
|
|
||||||
builder,
|
|
||||||
item?.a,
|
|
||||||
item?.b,
|
|
||||||
item?.c,
|
|
||||||
item?.dUnderscore,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.prep(8, 32);
|
|
||||||
builder.writeInt64(BigInt(c_underscore_d_underscore ?? 0));
|
|
||||||
builder.pad(2);
|
|
||||||
builder.writeInt8(c_underscore_c);
|
|
||||||
|
|
||||||
for (let i = 12; i >= 0; --i) {
|
|
||||||
builder.writeInt8(c_underscore_b?.[i] ?? 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.writeFloat64(c_underscore_a);
|
|
||||||
builder.writeFloat64(b);
|
|
||||||
builder.pad(7);
|
|
||||||
builder.writeInt8(Number(Boolean(a)));
|
|
||||||
return builder.offset();
|
|
||||||
}
|
|
||||||
|
|
||||||
unpack(): OuterStructT {
|
|
||||||
return new OuterStructT(
|
|
||||||
this.a(),
|
|
||||||
this.b(),
|
|
||||||
this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null,
|
|
||||||
this.bb!.createObjList<InnerStruct, InnerStructT>(this.d.bind(this), 3),
|
|
||||||
this.e() !== null ? this.e()!.unpack() : null,
|
|
||||||
this.bb!.createScalarList<number>(this.f.bind(this), 4),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
unpackTo(_o: OuterStructT): void {
|
builder.prep(8, 32);
|
||||||
_o.a = this.a();
|
builder.writeInt64(BigInt(c_underscore_d_underscore ?? 0));
|
||||||
_o.b = this.b();
|
builder.pad(2);
|
||||||
_o.cUnderscore =
|
builder.writeInt8(c_underscore_c);
|
||||||
this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null;
|
|
||||||
_o.d = this.bb!.createObjList<InnerStruct, InnerStructT>(
|
for (let i = 12; i >= 0; --i) {
|
||||||
this.d.bind(this),
|
builder.writeInt8((c_underscore_b?.[i] ?? 0));
|
||||||
3,
|
|
||||||
);
|
|
||||||
_o.e = this.e() !== null ? this.e()!.unpack() : null;
|
|
||||||
_o.f = this.bb!.createScalarList<number>(this.f.bind(this), 4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
builder.writeFloat64(c_underscore_a);
|
||||||
|
builder.writeFloat64(b);
|
||||||
|
builder.pad(7);
|
||||||
|
builder.writeInt8(Number(Boolean(a)));
|
||||||
|
return builder.offset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unpack(): OuterStructT {
|
||||||
|
return new OuterStructT(
|
||||||
|
this.a(),
|
||||||
|
this.b(),
|
||||||
|
(this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null),
|
||||||
|
this.bb!.createObjList<InnerStruct, InnerStructT>(this.d.bind(this), 3),
|
||||||
|
(this.e() !== null ? this.e()!.unpack() : null),
|
||||||
|
this.bb!.createScalarList<number>(this.f.bind(this), 4)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unpackTo(_o: OuterStructT): void {
|
||||||
|
_o.a = this.a();
|
||||||
|
_o.b = this.b();
|
||||||
|
_o.cUnderscore = (this.cUnderscore() !== null ? this.cUnderscore()!.unpack() : null);
|
||||||
|
_o.d = this.bb!.createObjList<InnerStruct, InnerStructT>(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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class OuterStructT implements flatbuffers.IGeneratedObject {
|
export class OuterStructT implements flatbuffers.IGeneratedObject {
|
||||||
constructor(
|
constructor(
|
||||||
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 {
|
|
||||||
return OuterStruct.createOuterStruct(
|
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||||
builder,
|
return OuterStruct.createOuterStruct(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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export declare enum TestEnum {
|
export declare enum TestEnum {
|
||||||
A = 0,
|
A = 0,
|
||||||
B = 1,
|
B = 1,
|
||||||
C = 2,
|
C = 2
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = {}));
|
||||||
|
|||||||
@@ -5,5 +5,5 @@
|
|||||||
export enum TestEnum {
|
export enum TestEnum {
|
||||||
A = 0,
|
A = 0,
|
||||||
B = 1,
|
B = 1,
|
||||||
C = 2,
|
C = 2
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
/* 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 {Person} from './test/person.js';
|
export { Person } from './test/person.js';
|
||||||
|
|||||||
@@ -4,86 +4,67 @@
|
|||||||
|
|
||||||
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;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
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(bb:flatbuffers.ByteBuffer, obj?:Person):Person {
|
||||||
}
|
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||||
|
return (obj || new Person()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
static getSizePrefixedRootAsPerson(
|
}
|
||||||
bb: flatbuffers.ByteBuffer,
|
|
||||||
obj?: Person,
|
name():string|null
|
||||||
): Person {
|
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
name(optionalEncoding?:any):string|Uint8Array|null {
|
||||||
return (obj || new Person()).__init(
|
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||||
bb.readInt32(bb.position()) + bb.position(),
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||||
bb,
|
}
|
||||||
);
|
|
||||||
}
|
age():number {
|
||||||
|
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||||
name(): string | null;
|
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
|
||||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
}
|
||||||
name(optionalEncoding?: any): string | Uint8Array | null {
|
|
||||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
static startPerson(builder:flatbuffers.Builder):void {
|
||||||
return offset
|
builder.startObject(2);
|
||||||
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
}
|
||||||
: null;
|
|
||||||
}
|
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset):void {
|
||||||
|
builder.addFieldOffset(0, nameOffset, 0);
|
||||||
age(): number {
|
}
|
||||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
||||||
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
|
static addAge(builder:flatbuffers.Builder, age:number):void {
|
||||||
}
|
builder.addFieldInt16(1, age, 0);
|
||||||
|
}
|
||||||
static startPerson(builder: flatbuffers.Builder) {
|
|
||||||
builder.startObject(2);
|
static endPerson(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||||
}
|
const offset = builder.endObject();
|
||||||
|
return offset;
|
||||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {
|
}
|
||||||
builder.addFieldOffset(0, nameOffset, 0);
|
|
||||||
}
|
static finishPersonBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
|
||||||
|
builder.finish(offset);
|
||||||
static addAge(builder: flatbuffers.Builder, age: number) {
|
}
|
||||||
builder.addFieldInt16(1, age, 0);
|
|
||||||
}
|
static finishSizePrefixedPersonBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
|
||||||
|
builder.finish(offset, undefined, true);
|
||||||
static endPerson(builder: flatbuffers.Builder): flatbuffers.Offset {
|
}
|
||||||
const offset = builder.endObject();
|
|
||||||
return offset;
|
static createPerson(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset, age:number):flatbuffers.Offset {
|
||||||
}
|
Person.startPerson(builder);
|
||||||
|
Person.addName(builder, nameOffset);
|
||||||
static finishPersonBuffer(
|
Person.addAge(builder, age);
|
||||||
builder: flatbuffers.Builder,
|
return Person.endPerson(builder);
|
||||||
offset: flatbuffers.Offset,
|
}
|
||||||
) {
|
|
||||||
builder.finish(offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
static finishSizePrefixedPersonBuffer(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
offset: flatbuffers.Offset,
|
|
||||||
) {
|
|
||||||
builder.finish(offset, undefined, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
static createPerson(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
nameOffset: flatbuffers.Offset,
|
|
||||||
age: number,
|
|
||||||
): flatbuffers.Offset {
|
|
||||||
Person.startPerson(builder);
|
|
||||||
Person.addName(builder, nameOffset);
|
|
||||||
Person.addAge(builder, age);
|
|
||||||
return Person.endPerson(builder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
473
tests/ts/even-more-defaults.ts
Normal file
473
tests/ts/even-more-defaults.ts
Normal 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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
64
tests/ts/even-more-struct.ts
Normal file
64
tests/ts/even-more-struct.ts
Normal 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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
7
tests/ts/even_more_defaults.ts
Normal file
7
tests/ts/even_more_defaults.ts
Normal 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';
|
||||||
2
tests/ts/foobar.d.ts
vendored
2
tests/ts/foobar.d.ts
vendored
@@ -1 +1 @@
|
|||||||
export {Abc} from './foobar/abc.js';
|
export { Abc } from './foobar/abc.js';
|
||||||
|
|||||||
@@ -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';
|
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
/* 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 {Abc} from './foobar/abc.js';
|
export { Abc } from './foobar/abc.js';
|
||||||
|
|||||||
2
tests/ts/foobar/abc.d.ts
vendored
2
tests/ts/foobar/abc.d.ts
vendored
@@ -1,3 +1,3 @@
|
|||||||
export declare enum Abc {
|
export declare enum Abc {
|
||||||
a = 0,
|
a = 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = {}));
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
2
tests/ts/foobar/class.d.ts
vendored
2
tests/ts/foobar/class.d.ts
vendored
@@ -1,3 +1,3 @@
|
|||||||
export declare enum class_ {
|
export declare enum class_ {
|
||||||
arguments_ = 0,
|
arguments_ = 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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_ = {}));
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,135 +4,131 @@
|
|||||||
|
|
||||||
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;
|
||||||
return this;
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
static getRootAsTab(bb:flatbuffers.ByteBuffer, obj?:Tab):Tab {
|
||||||
|
return (obj || new Tab()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
|
}
|
||||||
|
|
||||||
|
static getSizePrefixedRootAsTab(bb:flatbuffers.ByteBuffer, obj?:Tab):Tab {
|
||||||
|
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||||
|
return (obj || new Tab()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
|
}
|
||||||
|
|
||||||
|
abc():Abc {
|
||||||
|
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||||
|
return offset ? this.bb!.readInt32(this.bb_pos + offset) : Abc.a;
|
||||||
|
}
|
||||||
|
|
||||||
|
mutate_abc(value:Abc):boolean {
|
||||||
|
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||||
|
|
||||||
|
if (offset === 0) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getRootAsTab(bb: flatbuffers.ByteBuffer, obj?: Tab): Tab {
|
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||||
return (obj || new Tab()).__init(
|
return true;
|
||||||
bb.readInt32(bb.position()) + bb.position(),
|
}
|
||||||
bb,
|
|
||||||
);
|
arg():class_ {
|
||||||
|
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||||
|
return offset ? this.bb!.readInt32(this.bb_pos + offset) : class_.arguments_;
|
||||||
|
}
|
||||||
|
|
||||||
|
mutate_arg(value:class_):boolean {
|
||||||
|
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||||
|
|
||||||
|
if (offset === 0) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getSizePrefixedRootAsTab(bb: flatbuffers.ByteBuffer, obj?: Tab): Tab {
|
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
return true;
|
||||||
return (obj || new Tab()).__init(
|
}
|
||||||
bb.readInt32(bb.position()) + bb.position(),
|
|
||||||
bb,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
abc(): Abc {
|
name():string|null
|
||||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : Abc.a;
|
name(optionalEncoding?:any):string|Uint8Array|null {
|
||||||
}
|
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||||
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||||
|
}
|
||||||
|
|
||||||
mutate_abc(value: Abc): boolean {
|
static getFullyQualifiedName(): "foobar.Tab" {
|
||||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
return 'foobar.Tab';
|
||||||
|
}
|
||||||
|
|
||||||
if (offset === 0) {
|
static startTab(builder:flatbuffers.Builder):void {
|
||||||
return false;
|
builder.startObject(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
static addAbc(builder:flatbuffers.Builder, abc:Abc):void {
|
||||||
return true;
|
builder.addFieldInt32(0, abc, Abc.a);
|
||||||
}
|
}
|
||||||
|
|
||||||
arg(): class_ {
|
static addArg(builder:flatbuffers.Builder, arg:class_):void {
|
||||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
builder.addFieldInt32(1, arg, class_.arguments_);
|
||||||
return offset
|
}
|
||||||
? this.bb!.readInt32(this.bb_pos + offset)
|
|
||||||
: class_.arguments_;
|
|
||||||
}
|
|
||||||
|
|
||||||
mutate_arg(value: class_): boolean {
|
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset):void {
|
||||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
builder.addFieldOffset(2, nameOffset, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (offset === 0) {
|
static endTab(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||||
return false;
|
const offset = builder.endObject();
|
||||||
}
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
static createTab(builder:flatbuffers.Builder, abc:Abc, arg:class_, nameOffset:flatbuffers.Offset):flatbuffers.Offset {
|
||||||
return true;
|
Tab.startTab(builder);
|
||||||
}
|
Tab.addAbc(builder, abc);
|
||||||
|
Tab.addArg(builder, arg);
|
||||||
|
Tab.addName(builder, nameOffset);
|
||||||
|
return Tab.endTab(builder);
|
||||||
|
}
|
||||||
|
|
||||||
name(): string | null;
|
unpack(): TabT {
|
||||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
return new TabT(
|
||||||
name(optionalEncoding?: any): string | Uint8Array | null {
|
this.abc(),
|
||||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
this.arg(),
|
||||||
return offset
|
this.name()
|
||||||
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
);
|
||||||
: null;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static getFullyQualifiedName(): string {
|
|
||||||
return 'foobar.Tab';
|
|
||||||
}
|
|
||||||
|
|
||||||
static startTab(builder: flatbuffers.Builder) {
|
unpackTo(_o: TabT): void {
|
||||||
builder.startObject(3);
|
_o.abc = this.abc();
|
||||||
}
|
_o.arg = this.arg();
|
||||||
|
_o.name = this.name();
|
||||||
static addAbc(builder: flatbuffers.Builder, abc: Abc) {
|
}
|
||||||
builder.addFieldInt32(0, abc, Abc.a);
|
|
||||||
}
|
|
||||||
|
|
||||||
static addArg(builder: flatbuffers.Builder, arg: class_) {
|
|
||||||
builder.addFieldInt32(1, arg, class_.arguments_);
|
|
||||||
}
|
|
||||||
|
|
||||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {
|
|
||||||
builder.addFieldOffset(2, nameOffset, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static endTab(builder: flatbuffers.Builder): flatbuffers.Offset {
|
|
||||||
const offset = builder.endObject();
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
static createTab(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
abc: Abc,
|
|
||||||
arg: class_,
|
|
||||||
nameOffset: flatbuffers.Offset,
|
|
||||||
): flatbuffers.Offset {
|
|
||||||
Tab.startTab(builder);
|
|
||||||
Tab.addAbc(builder, abc);
|
|
||||||
Tab.addArg(builder, arg);
|
|
||||||
Tab.addName(builder, nameOffset);
|
|
||||||
return Tab.endTab(builder);
|
|
||||||
}
|
|
||||||
|
|
||||||
unpack(): TabT {
|
|
||||||
return new TabT(this.abc(), this.arg(), this.name());
|
|
||||||
}
|
|
||||||
|
|
||||||
unpackTo(_o: TabT): void {
|
|
||||||
_o.abc = this.abc();
|
|
||||||
_o.arg = this.arg();
|
|
||||||
_o.name = this.name();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TabT implements flatbuffers.IGeneratedObject {
|
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
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
tests/ts/longer-namespace/a/b/c.d.ts
vendored
2
tests/ts/longer-namespace/a/b/c.d.ts
vendored
@@ -1 +1 @@
|
|||||||
export {Person} from './c/person.js';
|
export { Person } from './c/person.js';
|
||||||
|
|||||||
@@ -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';
|
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
/* 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 {Person} from './c/person.js';
|
export { Person } from './c/person.js';
|
||||||
|
|||||||
46
tests/ts/longer-namespace/a/b/c/person.d.ts
vendored
46
tests/ts/longer-namespace/a/b/c/person.d.ts
vendored
@@ -1,34 +1,18 @@
|
|||||||
import * as flatbuffers from 'flatbuffers';
|
import * as flatbuffers from 'flatbuffers';
|
||||||
export declare class Person {
|
export declare class Person {
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
bb: flatbuffers.ByteBuffer | null;
|
||||||
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,
|
name(): string | null;
|
||||||
obj?: Person,
|
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||||
): Person;
|
age(): number;
|
||||||
name(): string | null;
|
static startPerson(builder: flatbuffers.Builder): void;
|
||||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
|
||||||
age(): number;
|
static addAge(builder: flatbuffers.Builder, age: number): void;
|
||||||
static startPerson(builder: flatbuffers.Builder): void;
|
static endPerson(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
static addName(
|
static finishPersonBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||||
builder: flatbuffers.Builder,
|
static finishSizePrefixedPersonBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||||
nameOffset: flatbuffers.Offset,
|
static createPerson(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset, age: number): flatbuffers.Offset;
|
||||||
): void;
|
|
||||||
static addAge(builder: flatbuffers.Builder, age: number): void;
|
|
||||||
static endPerson(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
static finishPersonBuffer(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
offset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static finishSizePrefixedPersonBuffer(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
offset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static createPerson(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
nameOffset: flatbuffers.Offset,
|
|
||||||
age: number,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,58 +1,54 @@
|
|||||||
// 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() {
|
||||||
this.bb = null;
|
this.bb = null;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
}
|
||||||
__init(i, bb) {
|
__init(i, bb) {
|
||||||
this.bb_pos = i;
|
this.bb_pos = i;
|
||||||
this.bb = bb;
|
this.bb = bb;
|
||||||
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()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
return (obj || new Person())
|
}
|
||||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
name(optionalEncoding) {
|
||||||
}
|
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||||
name(optionalEncoding) {
|
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
}
|
||||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
age() {
|
||||||
null;
|
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||||
}
|
return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;
|
||||||
age() {
|
}
|
||||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
static startPerson(builder) {
|
||||||
return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;
|
builder.startObject(2);
|
||||||
}
|
}
|
||||||
static startPerson(builder) {
|
static addName(builder, nameOffset) {
|
||||||
builder.startObject(2);
|
builder.addFieldOffset(0, nameOffset, 0);
|
||||||
}
|
}
|
||||||
static addName(builder, nameOffset) {
|
static addAge(builder, age) {
|
||||||
builder.addFieldOffset(0, nameOffset, 0);
|
builder.addFieldInt16(1, age, 0);
|
||||||
}
|
}
|
||||||
static addAge(builder, age) {
|
static endPerson(builder) {
|
||||||
builder.addFieldInt16(1, age, 0);
|
const offset = builder.endObject();
|
||||||
}
|
return offset;
|
||||||
static endPerson(builder) {
|
}
|
||||||
const offset = builder.endObject();
|
static finishPersonBuffer(builder, offset) {
|
||||||
return offset;
|
builder.finish(offset);
|
||||||
}
|
}
|
||||||
static finishPersonBuffer(builder, offset) {
|
static finishSizePrefixedPersonBuffer(builder, offset) {
|
||||||
builder.finish(offset);
|
builder.finish(offset, undefined, true);
|
||||||
}
|
}
|
||||||
static finishSizePrefixedPersonBuffer(builder, offset) {
|
static createPerson(builder, nameOffset, age) {
|
||||||
builder.finish(offset, undefined, true);
|
Person.startPerson(builder);
|
||||||
}
|
Person.addName(builder, nameOffset);
|
||||||
static createPerson(builder, nameOffset, age) {
|
Person.addAge(builder, age);
|
||||||
Person.startPerson(builder);
|
return Person.endPerson(builder);
|
||||||
Person.addName(builder, nameOffset);
|
}
|
||||||
Person.addAge(builder, age);
|
|
||||||
return Person.endPerson(builder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,86 +4,67 @@
|
|||||||
|
|
||||||
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;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
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(bb:flatbuffers.ByteBuffer, obj?:Person):Person {
|
||||||
}
|
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||||
|
return (obj || new Person()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
static getSizePrefixedRootAsPerson(
|
}
|
||||||
bb: flatbuffers.ByteBuffer,
|
|
||||||
obj?: Person,
|
name():string|null
|
||||||
): Person {
|
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
name(optionalEncoding?:any):string|Uint8Array|null {
|
||||||
return (obj || new Person()).__init(
|
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||||
bb.readInt32(bb.position()) + bb.position(),
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||||
bb,
|
}
|
||||||
);
|
|
||||||
}
|
age():number {
|
||||||
|
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||||
name(): string | null;
|
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
|
||||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
}
|
||||||
name(optionalEncoding?: any): string | Uint8Array | null {
|
|
||||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
static startPerson(builder:flatbuffers.Builder):void {
|
||||||
return offset
|
builder.startObject(2);
|
||||||
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
}
|
||||||
: null;
|
|
||||||
}
|
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset):void {
|
||||||
|
builder.addFieldOffset(0, nameOffset, 0);
|
||||||
age(): number {
|
}
|
||||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
||||||
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
|
static addAge(builder:flatbuffers.Builder, age:number):void {
|
||||||
}
|
builder.addFieldInt16(1, age, 0);
|
||||||
|
}
|
||||||
static startPerson(builder: flatbuffers.Builder) {
|
|
||||||
builder.startObject(2);
|
static endPerson(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||||
}
|
const offset = builder.endObject();
|
||||||
|
return offset;
|
||||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {
|
}
|
||||||
builder.addFieldOffset(0, nameOffset, 0);
|
|
||||||
}
|
static finishPersonBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
|
||||||
|
builder.finish(offset);
|
||||||
static addAge(builder: flatbuffers.Builder, age: number) {
|
}
|
||||||
builder.addFieldInt16(1, age, 0);
|
|
||||||
}
|
static finishSizePrefixedPersonBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset):void {
|
||||||
|
builder.finish(offset, undefined, true);
|
||||||
static endPerson(builder: flatbuffers.Builder): flatbuffers.Offset {
|
}
|
||||||
const offset = builder.endObject();
|
|
||||||
return offset;
|
static createPerson(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset, age:number):flatbuffers.Offset {
|
||||||
}
|
Person.startPerson(builder);
|
||||||
|
Person.addName(builder, nameOffset);
|
||||||
static finishPersonBuffer(
|
Person.addAge(builder, age);
|
||||||
builder: flatbuffers.Builder,
|
return Person.endPerson(builder);
|
||||||
offset: flatbuffers.Offset,
|
}
|
||||||
) {
|
|
||||||
builder.finish(offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
static finishSizePrefixedPersonBuffer(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
offset: flatbuffers.Offset,
|
|
||||||
) {
|
|
||||||
builder.finish(offset, undefined, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
static createPerson(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
nameOffset: flatbuffers.Offset,
|
|
||||||
age: number,
|
|
||||||
): flatbuffers.Offset {
|
|
||||||
Person.startPerson(builder);
|
|
||||||
Person.addName(builder, nameOffset);
|
|
||||||
Person.addAge(builder, age);
|
|
||||||
return Person.endPerson(builder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
2
tests/ts/monster_test.d.ts
vendored
2
tests/ts/monster_test.d.ts
vendored
@@ -1,2 +1,2 @@
|
|||||||
|
export { TableA, TableAT } from './table-a.js';
|
||||||
export * as MyGame from './my-game.js';
|
export * as MyGame from './my-game.js';
|
||||||
export {TableA, TableAT} from './table-a.js';
|
|
||||||
|
|||||||
@@ -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 { TableA, TableAT } from './table-a.js';
|
||||||
export * as MyGame from './my-game.js';
|
export * as MyGame from './my-game.js';
|
||||||
export {TableA, TableAT} from './table-a.js';
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
5
tests/ts/my-game.d.ts
vendored
5
tests/ts/my-game.d.ts
vendored
@@ -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';
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|||||||
41
tests/ts/my-game/example.d.ts
vendored
41
tests/ts/my-game/example.d.ts
vendored
@@ -1,25 +1,16 @@
|
|||||||
export {Ability, AbilityT} from './example/ability.js';
|
export { Ability, AbilityT } from './example/ability.js';
|
||||||
export {AnyAmbiguousAliases} from './example/any-ambiguous-aliases.js';
|
export { Any } from './example/any.js';
|
||||||
export {AnyUniqueAliases} from './example/any-unique-aliases.js';
|
export { AnyAmbiguousAliases } from './example/any-ambiguous-aliases.js';
|
||||||
export {Any} from './example/any.js';
|
export { AnyUniqueAliases } from './example/any-unique-aliases.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,
|
export { Test, TestT } from './example/test.js';
|
||||||
} from './example/struct-of-structs-of-structs.js';
|
export { TestSimpleTableWithEnum, TestSimpleTableWithEnumT } from './example/test-simple-table-with-enum.js';
|
||||||
export {
|
export { TypeAliases, TypeAliasesT } from './example/type-aliases.js';
|
||||||
StructOfStructs,
|
export { Vec3, Vec3T } from './example/vec3.js';
|
||||||
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 {TypeAliases, TypeAliasesT} from './example/type-aliases.js';
|
|
||||||
export {Vec3, Vec3T} from './example/vec3.js';
|
|
||||||
|
|||||||
@@ -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 { StructOfStructs, StructOfStructsT } from './example/struct-of-structs.js';
|
||||||
export {StructOfStructsOfStructs, StructOfStructsOfStructsT} from './example/struct-of-structs-of-structs.js';
|
export { StructOfStructsOfStructs, StructOfStructsOfStructsT } from './example/struct-of-structs-of-structs.js';
|
||||||
export {StructOfStructs, StructOfStructsT} from './example/struct-of-structs.js';
|
export { Test, TestT } from './example/test.js';
|
||||||
export {TestSimpleTableWithEnum, TestSimpleTableWithEnumT} from './example/test-simple-table-with-enum.js';
|
export { TestSimpleTableWithEnum, TestSimpleTableWithEnumT } from './example/test-simple-table-with-enum.js';
|
||||||
export {Test, TestT} from './example/test.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';
|
|
||||||
|
|||||||
40
tests/ts/my-game/example/ability.d.ts
vendored
40
tests/ts/my-game/example/ability.d.ts
vendored
@@ -1,27 +1,21 @@
|
|||||||
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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): Ability;
|
||||||
bb_pos: number;
|
id(): number;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): Ability;
|
mutate_id(value: number): boolean;
|
||||||
id(): number;
|
distance(): number;
|
||||||
mutate_id(value: number): boolean;
|
mutate_distance(value: number): boolean;
|
||||||
distance(): number;
|
static getFullyQualifiedName(): "MyGame.Example.Ability";
|
||||||
mutate_distance(value: number): boolean;
|
static sizeOf(): number;
|
||||||
static getFullyQualifiedName(): string;
|
static createAbility(builder: flatbuffers.Builder, id: number, distance: number): flatbuffers.Offset;
|
||||||
static sizeOf(): number;
|
unpack(): AbilityT;
|
||||||
static createAbility(
|
unpackTo(_o: AbilityT): void;
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
id: number,
|
|
||||||
distance: number,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
unpack(): AbilityT;
|
|
||||||
unpackTo(_o: AbilityT): void;
|
|
||||||
}
|
}
|
||||||
export declare class AbilityT implements flatbuffers.IGeneratedObject {
|
export declare class AbilityT implements flatbuffers.IGeneratedObject {
|
||||||
id: number;
|
id: number;
|
||||||
distance: number;
|
distance: number;
|
||||||
constructor(id?: number, distance?: number);
|
constructor(id?: number, distance?: number);
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,54 +1,54 @@
|
|||||||
// automatically generated by the FlatBuffers compiler, do not modify
|
// automatically generated by the FlatBuffers compiler, do not modify
|
||||||
export class Ability {
|
export class Ability {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.bb = null;
|
this.bb = null;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
}
|
||||||
__init(i, bb) {
|
__init(i, bb) {
|
||||||
this.bb_pos = i;
|
this.bb_pos = i;
|
||||||
this.bb = bb;
|
this.bb = bb;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
id() {
|
id() {
|
||||||
return this.bb.readUint32(this.bb_pos);
|
return this.bb.readUint32(this.bb_pos);
|
||||||
}
|
}
|
||||||
mutate_id(value) {
|
mutate_id(value) {
|
||||||
this.bb.writeUint32(this.bb_pos + 0, value);
|
this.bb.writeUint32(this.bb_pos + 0, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
distance() {
|
distance() {
|
||||||
return this.bb.readUint32(this.bb_pos + 4);
|
return this.bb.readUint32(this.bb_pos + 4);
|
||||||
}
|
}
|
||||||
mutate_distance(value) {
|
mutate_distance(value) {
|
||||||
this.bb.writeUint32(this.bb_pos + 4, value);
|
this.bb.writeUint32(this.bb_pos + 4, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
static getFullyQualifiedName() {
|
static getFullyQualifiedName() {
|
||||||
return 'MyGame.Example.Ability';
|
return 'MyGame.Example.Ability';
|
||||||
}
|
}
|
||||||
static sizeOf() {
|
static sizeOf() {
|
||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
static createAbility(builder, id, distance) {
|
static createAbility(builder, id, distance) {
|
||||||
builder.prep(4, 8);
|
builder.prep(4, 8);
|
||||||
builder.writeInt32(distance);
|
builder.writeInt32(distance);
|
||||||
builder.writeInt32(id);
|
builder.writeInt32(id);
|
||||||
return builder.offset();
|
return builder.offset();
|
||||||
}
|
}
|
||||||
unpack() {
|
unpack() {
|
||||||
return new AbilityT(this.id(), this.distance());
|
return new AbilityT(this.id(), this.distance());
|
||||||
}
|
}
|
||||||
unpackTo(_o) {
|
unpackTo(_o) {
|
||||||
_o.id = this.id();
|
_o.id = this.id();
|
||||||
_o.distance = this.distance();
|
_o.distance = this.distance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export class AbilityT {
|
export class AbilityT {
|
||||||
constructor(id = 0, distance = 0) {
|
constructor(id = 0, distance = 0) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.distance = distance;
|
this.distance = distance;
|
||||||
}
|
}
|
||||||
pack(builder) {
|
pack(builder) {
|
||||||
return Ability.createAbility(builder, this.id, this.distance);
|
return Ability.createAbility(builder, this.id, this.distance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
30
tests/ts/my-game/example/any-unique-aliases.d.ts
vendored
30
tests/ts/my-game/example/any-unique-aliases.d.ts
vendored
@@ -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;
|
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
30
tests/ts/my-game/example/any.d.ts
vendored
30
tests/ts/my-game/example/any.d.ts
vendored
@@ -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;
|
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
20
tests/ts/my-game/example/color.d.ts
vendored
20
tests/ts/my-game/example/color.d.ts
vendored
@@ -2,14 +2,14 @@
|
|||||||
* Composite components of Monster color.
|
* Composite components of Monster color.
|
||||||
*/
|
*/
|
||||||
export declare enum Color {
|
export declare enum Color {
|
||||||
Red = 1,
|
Red = 1,
|
||||||
/**
|
/**
|
||||||
* \brief color Green
|
* \brief color Green
|
||||||
* Green is bit_flag with value (1u << 1)
|
* Green is bit_flag with value (1u << 1)
|
||||||
*/
|
*/
|
||||||
Green = 2,
|
Green = 2,
|
||||||
/**
|
/**
|
||||||
* \brief color Blue (1u << 3)
|
* \brief color Blue (1u << 3)
|
||||||
*/
|
*/
|
||||||
Blue = 8,
|
Blue = 8
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = {}));
|
||||||
|
|||||||
6
tests/ts/my-game/example/long-enum.d.ts
vendored
6
tests/ts/my-game/example/long-enum.d.ts
vendored
@@ -1,5 +1,5 @@
|
|||||||
export declare enum LongEnum {
|
export declare enum LongEnum {
|
||||||
LongOne = '2',
|
LongOne = "2",
|
||||||
LongTwo = '4',
|
LongTwo = "4",
|
||||||
LongBig = '1099511627776',
|
LongBig = "1099511627776"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = {}));
|
||||||
|
|||||||
985
tests/ts/my-game/example/monster.d.ts
vendored
985
tests/ts/my-game/example/monster.d.ts
vendored
@@ -1,674 +1,325 @@
|
|||||||
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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): Monster;
|
||||||
bb_pos: number;
|
static getRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): Monster;
|
static getSizePrefixedRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster;
|
||||||
static getRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster;
|
static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean;
|
||||||
static getSizePrefixedRootAsMonster(
|
pos(obj?: Vec3): Vec3 | null;
|
||||||
bb: flatbuffers.ByteBuffer,
|
mana(): number;
|
||||||
obj?: Monster,
|
mutate_mana(value: number): boolean;
|
||||||
): Monster;
|
hp(): number;
|
||||||
static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean;
|
mutate_hp(value: number): boolean;
|
||||||
pos(obj?: Vec3): Vec3 | null;
|
name(): string;
|
||||||
mana(): number;
|
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
|
||||||
mutate_mana(value: number): boolean;
|
inventory(index: number): number | null;
|
||||||
hp(): number;
|
inventoryLength(): number;
|
||||||
mutate_hp(value: number): boolean;
|
inventoryArray(): Uint8Array | null;
|
||||||
name(): string | null;
|
color(): Color;
|
||||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
mutate_color(value: Color): boolean;
|
||||||
inventory(index: number): number | null;
|
testType(): Any;
|
||||||
inventoryLength(): number;
|
test<T extends flatbuffers.Table>(obj: any): any | null;
|
||||||
inventoryArray(): Uint8Array | null;
|
test4(index: number, obj?: Test): Test | null;
|
||||||
color(): Color;
|
test4Length(): number;
|
||||||
mutate_color(value: Color): boolean;
|
testarrayofstring(index: number): string;
|
||||||
testType(): Any;
|
testarrayofstring(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
|
||||||
test<T extends flatbuffers.Table>(obj: any): any | null;
|
testarrayofstringLength(): number;
|
||||||
test4(index: number, obj?: Test): Test | null;
|
/**
|
||||||
test4Length(): number;
|
* an example documentation comment: this will end up in the generated code
|
||||||
testarrayofstring(index: number): string;
|
* multiline too
|
||||||
testarrayofstring(
|
*/
|
||||||
index: number,
|
testarrayoftables(index: number, obj?: Monster): Monster | null;
|
||||||
optionalEncoding: flatbuffers.Encoding,
|
testarrayoftablesLength(): number;
|
||||||
): string | Uint8Array;
|
enemy(obj?: Monster): Monster | null;
|
||||||
testarrayofstringLength(): number;
|
testnestedflatbuffer(index: number): number | null;
|
||||||
/**
|
testnestedflatbufferLength(): number;
|
||||||
* an example documentation comment: this will end up in the generated code
|
testnestedflatbufferArray(): Uint8Array | null;
|
||||||
* multiline too
|
testempty(obj?: Stat): Stat | null;
|
||||||
*/
|
testbool(): boolean;
|
||||||
testarrayoftables(index: number, obj?: Monster): Monster | null;
|
mutate_testbool(value: boolean): boolean;
|
||||||
testarrayoftablesLength(): number;
|
testhashs32Fnv1(): number;
|
||||||
enemy(obj?: Monster): Monster | null;
|
mutate_testhashs32_fnv1(value: number): boolean;
|
||||||
testnestedflatbuffer(index: number): number | null;
|
testhashu32Fnv1(): number;
|
||||||
testnestedflatbufferLength(): number;
|
mutate_testhashu32_fnv1(value: number): boolean;
|
||||||
testnestedflatbufferArray(): Uint8Array | null;
|
testhashs64Fnv1(): bigint;
|
||||||
testempty(obj?: Stat): Stat | null;
|
mutate_testhashs64_fnv1(value: bigint): boolean;
|
||||||
testbool(): boolean;
|
testhashu64Fnv1(): bigint;
|
||||||
mutate_testbool(value: boolean): boolean;
|
mutate_testhashu64_fnv1(value: bigint): boolean;
|
||||||
testhashs32Fnv1(): number;
|
testhashs32Fnv1a(): number;
|
||||||
mutate_testhashs32_fnv1(value: number): boolean;
|
mutate_testhashs32_fnv1a(value: number): boolean;
|
||||||
testhashu32Fnv1(): number;
|
testhashu32Fnv1a(): number;
|
||||||
mutate_testhashu32_fnv1(value: number): boolean;
|
mutate_testhashu32_fnv1a(value: number): boolean;
|
||||||
testhashs64Fnv1(): bigint;
|
testhashs64Fnv1a(): bigint;
|
||||||
mutate_testhashs64_fnv1(value: bigint): boolean;
|
mutate_testhashs64_fnv1a(value: bigint): boolean;
|
||||||
testhashu64Fnv1(): bigint;
|
testhashu64Fnv1a(): bigint;
|
||||||
mutate_testhashu64_fnv1(value: bigint): boolean;
|
mutate_testhashu64_fnv1a(value: bigint): boolean;
|
||||||
testhashs32Fnv1a(): number;
|
testarrayofbools(index: number): boolean | null;
|
||||||
mutate_testhashs32_fnv1a(value: number): boolean;
|
testarrayofboolsLength(): number;
|
||||||
testhashu32Fnv1a(): number;
|
testarrayofboolsArray(): Int8Array | null;
|
||||||
mutate_testhashu32_fnv1a(value: number): boolean;
|
testf(): number;
|
||||||
testhashs64Fnv1a(): bigint;
|
mutate_testf(value: number): boolean;
|
||||||
mutate_testhashs64_fnv1a(value: bigint): boolean;
|
testf2(): number;
|
||||||
testhashu64Fnv1a(): bigint;
|
mutate_testf2(value: number): boolean;
|
||||||
mutate_testhashu64_fnv1a(value: bigint): boolean;
|
testf3(): number;
|
||||||
testarrayofbools(index: number): boolean | null;
|
mutate_testf3(value: number): boolean;
|
||||||
testarrayofboolsLength(): number;
|
testarrayofstring2(index: number): string;
|
||||||
testarrayofboolsArray(): Int8Array | null;
|
testarrayofstring2(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
|
||||||
testf(): number;
|
testarrayofstring2Length(): number;
|
||||||
mutate_testf(value: number): boolean;
|
testarrayofsortedstruct(index: number, obj?: Ability): Ability | null;
|
||||||
testf2(): number;
|
testarrayofsortedstructLength(): number;
|
||||||
mutate_testf2(value: number): boolean;
|
flex(index: number): number | null;
|
||||||
testf3(): number;
|
flexLength(): number;
|
||||||
mutate_testf3(value: number): boolean;
|
flexArray(): Uint8Array | null;
|
||||||
testarrayofstring2(index: number): string;
|
test5(index: number, obj?: Test): Test | null;
|
||||||
testarrayofstring2(
|
test5Length(): number;
|
||||||
index: number,
|
vectorOfLongs(index: number): bigint | null;
|
||||||
optionalEncoding: flatbuffers.Encoding,
|
vectorOfLongsLength(): number;
|
||||||
): string | Uint8Array;
|
vectorOfDoubles(index: number): number | null;
|
||||||
testarrayofstring2Length(): number;
|
vectorOfDoublesLength(): number;
|
||||||
testarrayofsortedstruct(index: number, obj?: Ability): Ability | null;
|
vectorOfDoublesArray(): Float64Array | null;
|
||||||
testarrayofsortedstructLength(): number;
|
parentNamespaceTest(obj?: InParentNamespace): InParentNamespace | null;
|
||||||
flex(index: number): number | null;
|
vectorOfReferrables(index: number, obj?: Referrable): Referrable | null;
|
||||||
flexLength(): number;
|
vectorOfReferrablesLength(): number;
|
||||||
flexArray(): Uint8Array | null;
|
singleWeakReference(): bigint;
|
||||||
test5(index: number, obj?: Test): Test | null;
|
mutate_single_weak_reference(value: bigint): boolean;
|
||||||
test5Length(): number;
|
vectorOfWeakReferences(index: number): bigint | null;
|
||||||
vectorOfLongs(index: number): bigint | null;
|
vectorOfWeakReferencesLength(): number;
|
||||||
vectorOfLongsLength(): number;
|
vectorOfStrongReferrables(index: number, obj?: Referrable): Referrable | null;
|
||||||
vectorOfDoubles(index: number): number | null;
|
vectorOfStrongReferrablesLength(): number;
|
||||||
vectorOfDoublesLength(): number;
|
coOwningReference(): bigint;
|
||||||
vectorOfDoublesArray(): Float64Array | null;
|
mutate_co_owning_reference(value: bigint): boolean;
|
||||||
parentNamespaceTest(obj?: InParentNamespace): InParentNamespace | null;
|
vectorOfCoOwningReferences(index: number): bigint | null;
|
||||||
vectorOfReferrables(index: number, obj?: Referrable): Referrable | null;
|
vectorOfCoOwningReferencesLength(): number;
|
||||||
vectorOfReferrablesLength(): number;
|
nonOwningReference(): bigint;
|
||||||
singleWeakReference(): bigint;
|
mutate_non_owning_reference(value: bigint): boolean;
|
||||||
mutate_single_weak_reference(value: bigint): boolean;
|
vectorOfNonOwningReferences(index: number): bigint | null;
|
||||||
vectorOfWeakReferences(index: number): bigint | null;
|
vectorOfNonOwningReferencesLength(): number;
|
||||||
vectorOfWeakReferencesLength(): number;
|
anyUniqueType(): AnyUniqueAliases;
|
||||||
vectorOfStrongReferrables(index: number, obj?: Referrable): Referrable | null;
|
anyUnique<T extends flatbuffers.Table>(obj: any): any | null;
|
||||||
vectorOfStrongReferrablesLength(): number;
|
anyAmbiguousType(): AnyAmbiguousAliases;
|
||||||
coOwningReference(): bigint;
|
anyAmbiguous<T extends flatbuffers.Table>(obj: any): any | null;
|
||||||
mutate_co_owning_reference(value: bigint): boolean;
|
vectorOfEnums(index: number): Color | null;
|
||||||
vectorOfCoOwningReferences(index: number): bigint | null;
|
vectorOfEnumsLength(): number;
|
||||||
vectorOfCoOwningReferencesLength(): number;
|
vectorOfEnumsArray(): Uint8Array | null;
|
||||||
nonOwningReference(): bigint;
|
signedEnum(): Race;
|
||||||
mutate_non_owning_reference(value: bigint): boolean;
|
mutate_signed_enum(value: Race): boolean;
|
||||||
vectorOfNonOwningReferences(index: number): bigint | null;
|
testrequirednestedflatbuffer(index: number): number | null;
|
||||||
vectorOfNonOwningReferencesLength(): number;
|
testrequirednestedflatbufferLength(): number;
|
||||||
anyUniqueType(): AnyUniqueAliases;
|
testrequirednestedflatbufferArray(): Uint8Array | null;
|
||||||
anyUnique<T extends flatbuffers.Table>(obj: any): any | null;
|
scalarKeySortedTables(index: number, obj?: Stat): Stat | null;
|
||||||
anyAmbiguousType(): AnyAmbiguousAliases;
|
scalarKeySortedTablesLength(): number;
|
||||||
anyAmbiguous<T extends flatbuffers.Table>(obj: any): any | null;
|
nativeInline(obj?: Test): Test | null;
|
||||||
vectorOfEnums(index: number): Color | null;
|
longEnumNonEnumDefault(): bigint;
|
||||||
vectorOfEnumsLength(): number;
|
mutate_long_enum_non_enum_default(value: bigint): boolean;
|
||||||
vectorOfEnumsArray(): Uint8Array | null;
|
longEnumNormalDefault(): bigint;
|
||||||
signedEnum(): Race;
|
mutate_long_enum_normal_default(value: bigint): boolean;
|
||||||
mutate_signed_enum(value: Race): boolean;
|
nanDefault(): number;
|
||||||
testrequirednestedflatbuffer(index: number): number | null;
|
mutate_nan_default(value: number): boolean;
|
||||||
testrequirednestedflatbufferLength(): number;
|
infDefault(): number;
|
||||||
testrequirednestedflatbufferArray(): Uint8Array | null;
|
mutate_inf_default(value: number): boolean;
|
||||||
scalarKeySortedTables(index: number, obj?: Stat): Stat | null;
|
positiveInfDefault(): number;
|
||||||
scalarKeySortedTablesLength(): number;
|
mutate_positive_inf_default(value: number): boolean;
|
||||||
nativeInline(obj?: Test): Test | null;
|
infinityDefault(): number;
|
||||||
longEnumNonEnumDefault(): bigint;
|
mutate_infinity_default(value: number): boolean;
|
||||||
mutate_long_enum_non_enum_default(value: bigint): boolean;
|
positiveInfinityDefault(): number;
|
||||||
longEnumNormalDefault(): bigint;
|
mutate_positive_infinity_default(value: number): boolean;
|
||||||
mutate_long_enum_normal_default(value: bigint): boolean;
|
negativeInfDefault(): number;
|
||||||
nanDefault(): number;
|
mutate_negative_inf_default(value: number): boolean;
|
||||||
mutate_nan_default(value: number): boolean;
|
negativeInfinityDefault(): number;
|
||||||
infDefault(): number;
|
mutate_negative_infinity_default(value: number): boolean;
|
||||||
mutate_inf_default(value: number): boolean;
|
doubleInfDefault(): number;
|
||||||
positiveInfDefault(): number;
|
mutate_double_inf_default(value: number): boolean;
|
||||||
mutate_positive_inf_default(value: number): boolean;
|
static getFullyQualifiedName(): "MyGame.Example.Monster";
|
||||||
infinityDefault(): number;
|
static startMonster(builder: flatbuffers.Builder): void;
|
||||||
mutate_infinity_default(value: number): boolean;
|
static addPos(builder: flatbuffers.Builder, posOffset: flatbuffers.Offset): void;
|
||||||
positiveInfinityDefault(): number;
|
static addMana(builder: flatbuffers.Builder, mana: number): void;
|
||||||
mutate_positive_infinity_default(value: number): boolean;
|
static addHp(builder: flatbuffers.Builder, hp: number): void;
|
||||||
negativeInfDefault(): number;
|
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
|
||||||
mutate_negative_inf_default(value: number): boolean;
|
static addInventory(builder: flatbuffers.Builder, inventoryOffset: flatbuffers.Offset): void;
|
||||||
negativeInfinityDefault(): number;
|
static createInventoryVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
|
||||||
mutate_negative_infinity_default(value: number): boolean;
|
static startInventoryVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
doubleInfDefault(): number;
|
static addColor(builder: flatbuffers.Builder, color: Color): void;
|
||||||
mutate_double_inf_default(value: number): boolean;
|
static addTestType(builder: flatbuffers.Builder, testType: Any): void;
|
||||||
static getFullyQualifiedName(): string;
|
static addTest(builder: flatbuffers.Builder, testOffset: flatbuffers.Offset): void;
|
||||||
static startMonster(builder: flatbuffers.Builder): void;
|
static addTest4(builder: flatbuffers.Builder, test4Offset: flatbuffers.Offset): void;
|
||||||
static addPos(
|
static startTest4Vector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
builder: flatbuffers.Builder,
|
static addTestarrayofstring(builder: flatbuffers.Builder, testarrayofstringOffset: flatbuffers.Offset): void;
|
||||||
posOffset: flatbuffers.Offset,
|
static createTestarrayofstringVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||||
): void;
|
static startTestarrayofstringVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
static addMana(builder: flatbuffers.Builder, mana: number): void;
|
static addTestarrayoftables(builder: flatbuffers.Builder, testarrayoftablesOffset: flatbuffers.Offset): void;
|
||||||
static addHp(builder: flatbuffers.Builder, hp: number): void;
|
static createTestarrayoftablesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||||
static addName(
|
static startTestarrayoftablesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
builder: flatbuffers.Builder,
|
static addEnemy(builder: flatbuffers.Builder, enemyOffset: flatbuffers.Offset): void;
|
||||||
nameOffset: flatbuffers.Offset,
|
static addTestnestedflatbuffer(builder: flatbuffers.Builder, testnestedflatbufferOffset: flatbuffers.Offset): void;
|
||||||
): void;
|
static createTestnestedflatbufferVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
|
||||||
static addInventory(
|
static startTestnestedflatbufferVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
builder: flatbuffers.Builder,
|
static addTestempty(builder: flatbuffers.Builder, testemptyOffset: flatbuffers.Offset): void;
|
||||||
inventoryOffset: flatbuffers.Offset,
|
static addTestbool(builder: flatbuffers.Builder, testbool: boolean): void;
|
||||||
): void;
|
static addTesthashs32Fnv1(builder: flatbuffers.Builder, testhashs32Fnv1: number): void;
|
||||||
static createInventoryVector(
|
static addTesthashu32Fnv1(builder: flatbuffers.Builder, testhashu32Fnv1: number): void;
|
||||||
builder: flatbuffers.Builder,
|
static addTesthashs64Fnv1(builder: flatbuffers.Builder, testhashs64Fnv1: bigint): void;
|
||||||
data: number[] | Uint8Array,
|
static addTesthashu64Fnv1(builder: flatbuffers.Builder, testhashu64Fnv1: bigint): void;
|
||||||
): flatbuffers.Offset;
|
static addTesthashs32Fnv1a(builder: flatbuffers.Builder, testhashs32Fnv1a: number): void;
|
||||||
static startInventoryVector(
|
static addTesthashu32Fnv1a(builder: flatbuffers.Builder, testhashu32Fnv1a: number): void;
|
||||||
builder: flatbuffers.Builder,
|
static addTesthashs64Fnv1a(builder: flatbuffers.Builder, testhashs64Fnv1a: bigint): void;
|
||||||
numElems: number,
|
static addTesthashu64Fnv1a(builder: flatbuffers.Builder, testhashu64Fnv1a: bigint): void;
|
||||||
): void;
|
static addTestarrayofbools(builder: flatbuffers.Builder, testarrayofboolsOffset: flatbuffers.Offset): void;
|
||||||
static addColor(builder: flatbuffers.Builder, color: Color): void;
|
static createTestarrayofboolsVector(builder: flatbuffers.Builder, data: boolean[]): flatbuffers.Offset;
|
||||||
static addTestType(builder: flatbuffers.Builder, testType: Any): void;
|
static startTestarrayofboolsVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
static addTest(
|
static addTestf(builder: flatbuffers.Builder, testf: number): void;
|
||||||
builder: flatbuffers.Builder,
|
static addTestf2(builder: flatbuffers.Builder, testf2: number): void;
|
||||||
testOffset: flatbuffers.Offset,
|
static addTestf3(builder: flatbuffers.Builder, testf3: number): void;
|
||||||
): void;
|
static addTestarrayofstring2(builder: flatbuffers.Builder, testarrayofstring2Offset: flatbuffers.Offset): void;
|
||||||
static addTest4(
|
static createTestarrayofstring2Vector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||||
builder: flatbuffers.Builder,
|
static startTestarrayofstring2Vector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
test4Offset: flatbuffers.Offset,
|
static addTestarrayofsortedstruct(builder: flatbuffers.Builder, testarrayofsortedstructOffset: flatbuffers.Offset): void;
|
||||||
): void;
|
static startTestarrayofsortedstructVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
static startTest4Vector(builder: flatbuffers.Builder, numElems: number): void;
|
static addFlex(builder: flatbuffers.Builder, flexOffset: flatbuffers.Offset): void;
|
||||||
static addTestarrayofstring(
|
static createFlexVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
|
||||||
builder: flatbuffers.Builder,
|
static startFlexVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
testarrayofstringOffset: flatbuffers.Offset,
|
static addTest5(builder: flatbuffers.Builder, test5Offset: flatbuffers.Offset): void;
|
||||||
): void;
|
static startTest5Vector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
static createTestarrayofstringVector(
|
static addVectorOfLongs(builder: flatbuffers.Builder, vectorOfLongsOffset: flatbuffers.Offset): void;
|
||||||
builder: flatbuffers.Builder,
|
static createVectorOfLongsVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset;
|
||||||
data: flatbuffers.Offset[],
|
static startVectorOfLongsVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
): flatbuffers.Offset;
|
static addVectorOfDoubles(builder: flatbuffers.Builder, vectorOfDoublesOffset: flatbuffers.Offset): void;
|
||||||
static startTestarrayofstringVector(
|
static createVectorOfDoublesVector(builder: flatbuffers.Builder, data: number[] | Float64Array): flatbuffers.Offset;
|
||||||
builder: flatbuffers.Builder,
|
/**
|
||||||
numElems: number,
|
* @deprecated This Uint8Array overload will be removed in the future.
|
||||||
): void;
|
*/
|
||||||
static addTestarrayoftables(
|
static createVectorOfDoublesVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
|
||||||
builder: flatbuffers.Builder,
|
static startVectorOfDoublesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
testarrayoftablesOffset: flatbuffers.Offset,
|
static addParentNamespaceTest(builder: flatbuffers.Builder, parentNamespaceTestOffset: flatbuffers.Offset): void;
|
||||||
): void;
|
static addVectorOfReferrables(builder: flatbuffers.Builder, vectorOfReferrablesOffset: flatbuffers.Offset): void;
|
||||||
static createTestarrayoftablesVector(
|
static createVectorOfReferrablesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||||
builder: flatbuffers.Builder,
|
static startVectorOfReferrablesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
data: flatbuffers.Offset[],
|
static addSingleWeakReference(builder: flatbuffers.Builder, singleWeakReference: bigint): void;
|
||||||
): flatbuffers.Offset;
|
static addVectorOfWeakReferences(builder: flatbuffers.Builder, vectorOfWeakReferencesOffset: flatbuffers.Offset): void;
|
||||||
static startTestarrayoftablesVector(
|
static createVectorOfWeakReferencesVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset;
|
||||||
builder: flatbuffers.Builder,
|
static startVectorOfWeakReferencesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
numElems: number,
|
static addVectorOfStrongReferrables(builder: flatbuffers.Builder, vectorOfStrongReferrablesOffset: flatbuffers.Offset): void;
|
||||||
): void;
|
static createVectorOfStrongReferrablesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||||
static addEnemy(
|
static startVectorOfStrongReferrablesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
builder: flatbuffers.Builder,
|
static addCoOwningReference(builder: flatbuffers.Builder, coOwningReference: bigint): void;
|
||||||
enemyOffset: flatbuffers.Offset,
|
static addVectorOfCoOwningReferences(builder: flatbuffers.Builder, vectorOfCoOwningReferencesOffset: flatbuffers.Offset): void;
|
||||||
): void;
|
static createVectorOfCoOwningReferencesVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset;
|
||||||
static addTestnestedflatbuffer(
|
static startVectorOfCoOwningReferencesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
builder: flatbuffers.Builder,
|
static addNonOwningReference(builder: flatbuffers.Builder, nonOwningReference: bigint): void;
|
||||||
testnestedflatbufferOffset: flatbuffers.Offset,
|
static addVectorOfNonOwningReferences(builder: flatbuffers.Builder, vectorOfNonOwningReferencesOffset: flatbuffers.Offset): void;
|
||||||
): void;
|
static createVectorOfNonOwningReferencesVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset;
|
||||||
static createTestnestedflatbufferVector(
|
static startVectorOfNonOwningReferencesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
builder: flatbuffers.Builder,
|
static addAnyUniqueType(builder: flatbuffers.Builder, anyUniqueType: AnyUniqueAliases): void;
|
||||||
data: number[] | Uint8Array,
|
static addAnyUnique(builder: flatbuffers.Builder, anyUniqueOffset: flatbuffers.Offset): void;
|
||||||
): flatbuffers.Offset;
|
static addAnyAmbiguousType(builder: flatbuffers.Builder, anyAmbiguousType: AnyAmbiguousAliases): void;
|
||||||
static startTestnestedflatbufferVector(
|
static addAnyAmbiguous(builder: flatbuffers.Builder, anyAmbiguousOffset: flatbuffers.Offset): void;
|
||||||
builder: flatbuffers.Builder,
|
static addVectorOfEnums(builder: flatbuffers.Builder, vectorOfEnumsOffset: flatbuffers.Offset): void;
|
||||||
numElems: number,
|
static createVectorOfEnumsVector(builder: flatbuffers.Builder, data: Color[]): flatbuffers.Offset;
|
||||||
): void;
|
static startVectorOfEnumsVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
static addTestempty(
|
static addSignedEnum(builder: flatbuffers.Builder, signedEnum: Race): void;
|
||||||
builder: flatbuffers.Builder,
|
static addTestrequirednestedflatbuffer(builder: flatbuffers.Builder, testrequirednestedflatbufferOffset: flatbuffers.Offset): void;
|
||||||
testemptyOffset: flatbuffers.Offset,
|
static createTestrequirednestedflatbufferVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
|
||||||
): void;
|
static startTestrequirednestedflatbufferVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
static addTestbool(builder: flatbuffers.Builder, testbool: boolean): void;
|
static addScalarKeySortedTables(builder: flatbuffers.Builder, scalarKeySortedTablesOffset: flatbuffers.Offset): void;
|
||||||
static addTesthashs32Fnv1(
|
static createScalarKeySortedTablesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||||
builder: flatbuffers.Builder,
|
static startScalarKeySortedTablesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
testhashs32Fnv1: number,
|
static addNativeInline(builder: flatbuffers.Builder, nativeInlineOffset: flatbuffers.Offset): void;
|
||||||
): void;
|
static addLongEnumNonEnumDefault(builder: flatbuffers.Builder, longEnumNonEnumDefault: bigint): void;
|
||||||
static addTesthashu32Fnv1(
|
static addLongEnumNormalDefault(builder: flatbuffers.Builder, longEnumNormalDefault: bigint): void;
|
||||||
builder: flatbuffers.Builder,
|
static addNanDefault(builder: flatbuffers.Builder, nanDefault: number): void;
|
||||||
testhashu32Fnv1: number,
|
static addInfDefault(builder: flatbuffers.Builder, infDefault: number): void;
|
||||||
): void;
|
static addPositiveInfDefault(builder: flatbuffers.Builder, positiveInfDefault: number): void;
|
||||||
static addTesthashs64Fnv1(
|
static addInfinityDefault(builder: flatbuffers.Builder, infinityDefault: number): void;
|
||||||
builder: flatbuffers.Builder,
|
static addPositiveInfinityDefault(builder: flatbuffers.Builder, positiveInfinityDefault: number): void;
|
||||||
testhashs64Fnv1: bigint,
|
static addNegativeInfDefault(builder: flatbuffers.Builder, negativeInfDefault: number): void;
|
||||||
): void;
|
static addNegativeInfinityDefault(builder: flatbuffers.Builder, negativeInfinityDefault: number): void;
|
||||||
static addTesthashu64Fnv1(
|
static addDoubleInfDefault(builder: flatbuffers.Builder, doubleInfDefault: number): void;
|
||||||
builder: flatbuffers.Builder,
|
static endMonster(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
testhashu64Fnv1: bigint,
|
static finishMonsterBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||||
): void;
|
static finishSizePrefixedMonsterBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||||
static addTesthashs32Fnv1a(
|
serialize(): Uint8Array;
|
||||||
builder: flatbuffers.Builder,
|
static deserialize(buffer: Uint8Array): Monster;
|
||||||
testhashs32Fnv1a: number,
|
unpack(): MonsterT;
|
||||||
): void;
|
unpackTo(_o: MonsterT): 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 addTestf2(builder: flatbuffers.Builder, testf2: number): void;
|
|
||||||
static addTestf3(builder: flatbuffers.Builder, testf3: number): void;
|
|
||||||
static addTestarrayofstring2(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
testarrayofstring2Offset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static createTestarrayofstring2Vector(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
data: 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 addTest5(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
test5Offset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static startTest5Vector(builder: flatbuffers.Builder, numElems: number): void;
|
|
||||||
static addVectorOfLongs(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
vectorOfLongsOffset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static createVectorOfLongsVector(
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
static createVectorOfDoublesVector(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
data: number[] | Uint8Array,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
static startVectorOfDoublesVector(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
numElems: number,
|
|
||||||
): void;
|
|
||||||
static addParentNamespaceTest(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
parentNamespaceTestOffset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static addVectorOfReferrables(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
vectorOfReferrablesOffset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static createVectorOfReferrablesVector(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
data: flatbuffers.Offset[],
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
static startVectorOfReferrablesVector(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
numElems: number,
|
|
||||||
): void;
|
|
||||||
static addSingleWeakReference(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
singleWeakReference: bigint,
|
|
||||||
): 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 addTestrequirednestedflatbuffer(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
testrequirednestedflatbufferOffset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static createTestrequirednestedflatbufferVector(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
data: number[] | Uint8Array,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
static startTestrequirednestedflatbufferVector(
|
|
||||||
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 addInfDefault(builder: flatbuffers.Builder, infDefault: number): void;
|
|
||||||
static addPositiveInfDefault(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
positiveInfDefault: number,
|
|
||||||
): void;
|
|
||||||
static addInfinityDefault(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
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 finishMonsterBuffer(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
offset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static finishSizePrefixedMonsterBuffer(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
offset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
serialize(): Uint8Array;
|
|
||||||
static deserialize(buffer: Uint8Array): Monster;
|
|
||||||
unpack(): MonsterT;
|
|
||||||
unpackTo(_o: MonsterT): void;
|
|
||||||
}
|
}
|
||||||
export declare class MonsterT implements flatbuffers.IGeneratedObject {
|
export declare class MonsterT implements flatbuffers.IGeneratedObject {
|
||||||
pos: Vec3T | null;
|
pos: Vec3T | null;
|
||||||
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;
|
||||||
testhashu32Fnv1: number;
|
testhashu32Fnv1: number;
|
||||||
testhashs64Fnv1: bigint;
|
testhashs64Fnv1: bigint;
|
||||||
testhashu64Fnv1: bigint;
|
testhashu64Fnv1: bigint;
|
||||||
testhashs32Fnv1a: number;
|
testhashs32Fnv1a: number;
|
||||||
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
|
anyAmbiguousType: AnyAmbiguousAliases;
|
||||||
| MyGame_Example2_MonsterT
|
anyAmbiguous: MonsterT | null;
|
||||||
| TestSimpleTableWithEnumT
|
vectorOfEnums: (Color)[];
|
||||||
| null;
|
signedEnum: Race;
|
||||||
anyAmbiguousType: AnyAmbiguousAliases;
|
testrequirednestedflatbuffer: (number)[];
|
||||||
anyAmbiguous: MonsterT | null;
|
scalarKeySortedTables: (StatT)[];
|
||||||
vectorOfEnums: Color[];
|
nativeInline: TestT | null;
|
||||||
signedEnum: Race;
|
longEnumNonEnumDefault: bigint;
|
||||||
testrequirednestedflatbuffer: number[];
|
longEnumNormalDefault: bigint;
|
||||||
scalarKeySortedTables: StatT[];
|
nanDefault: number;
|
||||||
nativeInline: TestT | null;
|
infDefault: number;
|
||||||
longEnumNonEnumDefault: bigint;
|
positiveInfDefault: number;
|
||||||
longEnumNormalDefault: bigint;
|
infinityDefault: number;
|
||||||
nanDefault: number;
|
positiveInfinityDefault: number;
|
||||||
infDefault: number;
|
negativeInfDefault: number;
|
||||||
positiveInfDefault: number;
|
negativeInfinityDefault: number;
|
||||||
infinityDefault: number;
|
doubleInfDefault: number;
|
||||||
positiveInfinityDefault: number;
|
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);
|
||||||
negativeInfDefault: number;
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
negativeInfinityDefault: number;
|
|
||||||
doubleInfDefault: number;
|
|
||||||
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,
|
|
||||||
);
|
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
tests/ts/my-game/example/race.d.ts
vendored
8
tests/ts/my-game/example/race.d.ts
vendored
@@ -1,6 +1,6 @@
|
|||||||
export declare enum Race {
|
export declare enum Race {
|
||||||
None = -1,
|
None = -1,
|
||||||
Human = 0,
|
Human = 0,
|
||||||
Dwarf = 1,
|
Dwarf = 1,
|
||||||
Elf = 2,
|
Elf = 2
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = {}));
|
||||||
|
|||||||
51
tests/ts/my-game/example/referrable.d.ts
vendored
51
tests/ts/my-game/example/referrable.d.ts
vendored
@@ -1,35 +1,24 @@
|
|||||||
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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): Referrable;
|
||||||
bb_pos: number;
|
static getRootAsReferrable(bb: flatbuffers.ByteBuffer, obj?: Referrable): Referrable;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): Referrable;
|
static getSizePrefixedRootAsReferrable(bb: flatbuffers.ByteBuffer, obj?: Referrable): Referrable;
|
||||||
static getRootAsReferrable(
|
id(): bigint;
|
||||||
bb: flatbuffers.ByteBuffer,
|
mutate_id(value: bigint): boolean;
|
||||||
obj?: Referrable,
|
static getFullyQualifiedName(): "MyGame.Example.Referrable";
|
||||||
): Referrable;
|
static startReferrable(builder: flatbuffers.Builder): void;
|
||||||
static getSizePrefixedRootAsReferrable(
|
static addId(builder: flatbuffers.Builder, id: bigint): void;
|
||||||
bb: flatbuffers.ByteBuffer,
|
static endReferrable(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
obj?: Referrable,
|
static createReferrable(builder: flatbuffers.Builder, id: bigint): flatbuffers.Offset;
|
||||||
): Referrable;
|
serialize(): Uint8Array;
|
||||||
id(): bigint;
|
static deserialize(buffer: Uint8Array): Referrable;
|
||||||
mutate_id(value: bigint): boolean;
|
unpack(): ReferrableT;
|
||||||
static getFullyQualifiedName(): string;
|
unpackTo(_o: ReferrableT): void;
|
||||||
static startReferrable(builder: flatbuffers.Builder): void;
|
|
||||||
static addId(builder: flatbuffers.Builder, id: bigint): void;
|
|
||||||
static endReferrable(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
static createReferrable(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
id: bigint,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
serialize(): Uint8Array;
|
|
||||||
static deserialize(buffer: Uint8Array): Referrable;
|
|
||||||
unpack(): ReferrableT;
|
|
||||||
unpackTo(_o: ReferrableT): void;
|
|
||||||
}
|
}
|
||||||
export declare class ReferrableT implements flatbuffers.IGeneratedObject {
|
export declare class ReferrableT implements flatbuffers.IGeneratedObject {
|
||||||
id: bigint;
|
id: bigint;
|
||||||
constructor(id?: bigint);
|
constructor(id?: bigint);
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,74 +1,71 @@
|
|||||||
// 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() {
|
||||||
this.bb = null;
|
this.bb = null;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
}
|
||||||
__init(i, bb) {
|
__init(i, bb) {
|
||||||
this.bb_pos = i;
|
this.bb_pos = i;
|
||||||
this.bb = bb;
|
this.bb = bb;
|
||||||
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()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
return (obj || new Referrable())
|
}
|
||||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
id() {
|
||||||
}
|
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||||
id() {
|
return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
|
||||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
}
|
||||||
return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
|
mutate_id(value) {
|
||||||
}
|
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||||
mutate_id(value) {
|
if (offset === 0) {
|
||||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
return false;
|
||||||
if (offset === 0) {
|
}
|
||||||
return false;
|
this.bb.writeUint64(this.bb_pos + offset, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
static getFullyQualifiedName() {
|
||||||
|
return 'MyGame.Example.Referrable';
|
||||||
|
}
|
||||||
|
static startReferrable(builder) {
|
||||||
|
builder.startObject(1);
|
||||||
|
}
|
||||||
|
static addId(builder, id) {
|
||||||
|
builder.addFieldInt64(0, id, BigInt('0'));
|
||||||
|
}
|
||||||
|
static endReferrable(builder) {
|
||||||
|
const offset = builder.endObject();
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
static createReferrable(builder, id) {
|
||||||
|
Referrable.startReferrable(builder);
|
||||||
|
Referrable.addId(builder, id);
|
||||||
|
return Referrable.endReferrable(builder);
|
||||||
|
}
|
||||||
|
serialize() {
|
||||||
|
return this.bb.bytes();
|
||||||
|
}
|
||||||
|
static deserialize(buffer) {
|
||||||
|
return Referrable.getRootAsReferrable(new flatbuffers.ByteBuffer(buffer));
|
||||||
|
}
|
||||||
|
unpack() {
|
||||||
|
return new ReferrableT(this.id());
|
||||||
|
}
|
||||||
|
unpackTo(_o) {
|
||||||
|
_o.id = this.id();
|
||||||
}
|
}
|
||||||
this.bb.writeUint64(this.bb_pos + offset, value);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
static getFullyQualifiedName() {
|
|
||||||
return 'MyGame.Example.Referrable';
|
|
||||||
}
|
|
||||||
static startReferrable(builder) {
|
|
||||||
builder.startObject(1);
|
|
||||||
}
|
|
||||||
static addId(builder, id) {
|
|
||||||
builder.addFieldInt64(0, id, BigInt('0'));
|
|
||||||
}
|
|
||||||
static endReferrable(builder) {
|
|
||||||
const offset = builder.endObject();
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
static createReferrable(builder, id) {
|
|
||||||
Referrable.startReferrable(builder);
|
|
||||||
Referrable.addId(builder, id);
|
|
||||||
return Referrable.endReferrable(builder);
|
|
||||||
}
|
|
||||||
serialize() {
|
|
||||||
return this.bb.bytes();
|
|
||||||
}
|
|
||||||
static deserialize(buffer) {
|
|
||||||
return Referrable.getRootAsReferrable(new flatbuffers.ByteBuffer(buffer));
|
|
||||||
}
|
|
||||||
unpack() {
|
|
||||||
return new ReferrableT(this.id());
|
|
||||||
}
|
|
||||||
unpackTo(_o) {
|
|
||||||
_o.id = this.id();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
export class ReferrableT {
|
export class ReferrableT {
|
||||||
constructor(id = BigInt('0')) {
|
constructor(id = BigInt('0')) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
pack(builder) {
|
pack(builder) {
|
||||||
return Referrable.createReferrable(builder, this.id);
|
return Referrable.createReferrable(builder, this.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
65
tests/ts/my-game/example/stat.d.ts
vendored
65
tests/ts/my-game/example/stat.d.ts
vendored
@@ -1,43 +1,32 @@
|
|||||||
import * as flatbuffers from 'flatbuffers';
|
import * as flatbuffers from 'flatbuffers';
|
||||||
export declare class Stat implements flatbuffers.IUnpackableObject<StatT> {
|
export declare class Stat implements flatbuffers.IUnpackableObject<StatT> {
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
bb: flatbuffers.ByteBuffer | null;
|
||||||
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,
|
id(): string | null;
|
||||||
obj?: Stat,
|
id(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||||
): Stat;
|
val(): bigint;
|
||||||
id(): string | null;
|
mutate_val(value: bigint): boolean;
|
||||||
id(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
count(): number;
|
||||||
val(): bigint;
|
mutate_count(value: number): boolean;
|
||||||
mutate_val(value: bigint): boolean;
|
static getFullyQualifiedName(): "MyGame.Example.Stat";
|
||||||
count(): number;
|
static startStat(builder: flatbuffers.Builder): void;
|
||||||
mutate_count(value: number): boolean;
|
static addId(builder: flatbuffers.Builder, idOffset: flatbuffers.Offset): void;
|
||||||
static getFullyQualifiedName(): string;
|
static addVal(builder: flatbuffers.Builder, val: bigint): void;
|
||||||
static startStat(builder: flatbuffers.Builder): void;
|
static addCount(builder: flatbuffers.Builder, count: number): void;
|
||||||
static addId(
|
static endStat(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
builder: flatbuffers.Builder,
|
static createStat(builder: flatbuffers.Builder, idOffset: flatbuffers.Offset, val: bigint, count: number): flatbuffers.Offset;
|
||||||
idOffset: flatbuffers.Offset,
|
serialize(): Uint8Array;
|
||||||
): void;
|
static deserialize(buffer: Uint8Array): Stat;
|
||||||
static addVal(builder: flatbuffers.Builder, val: bigint): void;
|
unpack(): StatT;
|
||||||
static addCount(builder: flatbuffers.Builder, count: number): void;
|
unpackTo(_o: StatT): void;
|
||||||
static endStat(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
static createStat(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
idOffset: flatbuffers.Offset,
|
|
||||||
val: bigint,
|
|
||||||
count: number,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
serialize(): Uint8Array;
|
|
||||||
static deserialize(buffer: Uint8Array): Stat;
|
|
||||||
unpack(): StatT;
|
|
||||||
unpackTo(_o: StatT): void;
|
|
||||||
}
|
}
|
||||||
export declare class StatT implements flatbuffers.IGeneratedObject {
|
export declare class StatT implements flatbuffers.IGeneratedObject {
|
||||||
id: string | Uint8Array | null;
|
id: string | Uint8Array | null;
|
||||||
val: bigint;
|
val: bigint;
|
||||||
count: number;
|
count: number;
|
||||||
constructor(id?: string | Uint8Array | null, val?: bigint, count?: number);
|
constructor(id?: string | Uint8Array | null, val?: bigint, count?: number);
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,104 +1,100 @@
|
|||||||
// 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() {
|
||||||
this.bb = null;
|
this.bb = null;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
|
||||||
__init(i, bb) {
|
|
||||||
this.bb_pos = i;
|
|
||||||
this.bb = bb;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
static getRootAsStat(bb, obj) {
|
|
||||||
return (obj || new Stat())
|
|
||||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
||||||
}
|
|
||||||
static getSizePrefixedRootAsStat(bb, obj) {
|
|
||||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
||||||
return (obj || new Stat())
|
|
||||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
||||||
}
|
|
||||||
id(optionalEncoding) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
|
||||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
|
||||||
null;
|
|
||||||
}
|
|
||||||
val() {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
||||||
return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
|
|
||||||
}
|
|
||||||
mutate_val(value) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
||||||
if (offset === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
this.bb.writeInt64(this.bb_pos + offset, value);
|
__init(i, bb) {
|
||||||
return true;
|
this.bb_pos = i;
|
||||||
}
|
this.bb = bb;
|
||||||
count() {
|
return this;
|
||||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
}
|
||||||
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
static getRootAsStat(bb, obj) {
|
||||||
}
|
return (obj || new Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
mutate_count(value) {
|
}
|
||||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
static getSizePrefixedRootAsStat(bb, obj) {
|
||||||
if (offset === 0) {
|
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||||
return false;
|
return (obj || new Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
|
}
|
||||||
|
id(optionalEncoding) {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||||
|
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||||
|
}
|
||||||
|
val() {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||||
|
return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
|
||||||
|
}
|
||||||
|
mutate_val(value) {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||||
|
if (offset === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.bb.writeInt64(this.bb_pos + offset, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
count() {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||||
|
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
||||||
|
}
|
||||||
|
mutate_count(value) {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||||
|
if (offset === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.bb.writeUint16(this.bb_pos + offset, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
static getFullyQualifiedName() {
|
||||||
|
return 'MyGame.Example.Stat';
|
||||||
|
}
|
||||||
|
static startStat(builder) {
|
||||||
|
builder.startObject(3);
|
||||||
|
}
|
||||||
|
static addId(builder, idOffset) {
|
||||||
|
builder.addFieldOffset(0, idOffset, 0);
|
||||||
|
}
|
||||||
|
static addVal(builder, val) {
|
||||||
|
builder.addFieldInt64(1, val, BigInt('0'));
|
||||||
|
}
|
||||||
|
static addCount(builder, count) {
|
||||||
|
builder.addFieldInt16(2, count, 0);
|
||||||
|
}
|
||||||
|
static endStat(builder) {
|
||||||
|
const offset = builder.endObject();
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
static createStat(builder, idOffset, val, count) {
|
||||||
|
Stat.startStat(builder);
|
||||||
|
Stat.addId(builder, idOffset);
|
||||||
|
Stat.addVal(builder, val);
|
||||||
|
Stat.addCount(builder, count);
|
||||||
|
return Stat.endStat(builder);
|
||||||
|
}
|
||||||
|
serialize() {
|
||||||
|
return this.bb.bytes();
|
||||||
|
}
|
||||||
|
static deserialize(buffer) {
|
||||||
|
return Stat.getRootAsStat(new flatbuffers.ByteBuffer(buffer));
|
||||||
|
}
|
||||||
|
unpack() {
|
||||||
|
return new StatT(this.id(), this.val(), this.count());
|
||||||
|
}
|
||||||
|
unpackTo(_o) {
|
||||||
|
_o.id = this.id();
|
||||||
|
_o.val = this.val();
|
||||||
|
_o.count = this.count();
|
||||||
}
|
}
|
||||||
this.bb.writeUint16(this.bb_pos + offset, value);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
static getFullyQualifiedName() {
|
|
||||||
return 'MyGame.Example.Stat';
|
|
||||||
}
|
|
||||||
static startStat(builder) {
|
|
||||||
builder.startObject(3);
|
|
||||||
}
|
|
||||||
static addId(builder, idOffset) {
|
|
||||||
builder.addFieldOffset(0, idOffset, 0);
|
|
||||||
}
|
|
||||||
static addVal(builder, val) {
|
|
||||||
builder.addFieldInt64(1, val, BigInt('0'));
|
|
||||||
}
|
|
||||||
static addCount(builder, count) {
|
|
||||||
builder.addFieldInt16(2, count, 0);
|
|
||||||
}
|
|
||||||
static endStat(builder) {
|
|
||||||
const offset = builder.endObject();
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
static createStat(builder, idOffset, val, count) {
|
|
||||||
Stat.startStat(builder);
|
|
||||||
Stat.addId(builder, idOffset);
|
|
||||||
Stat.addVal(builder, val);
|
|
||||||
Stat.addCount(builder, count);
|
|
||||||
return Stat.endStat(builder);
|
|
||||||
}
|
|
||||||
serialize() {
|
|
||||||
return this.bb.bytes();
|
|
||||||
}
|
|
||||||
static deserialize(buffer) {
|
|
||||||
return Stat.getRootAsStat(new flatbuffers.ByteBuffer(buffer));
|
|
||||||
}
|
|
||||||
unpack() {
|
|
||||||
return new StatT(this.id(), this.val(), this.count());
|
|
||||||
}
|
|
||||||
unpackTo(_o) {
|
|
||||||
_o.id = this.id();
|
|
||||||
_o.val = this.val();
|
|
||||||
_o.count = this.count();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
export class StatT {
|
export class StatT {
|
||||||
constructor(id = null, val = BigInt('0'), count = 0) {
|
constructor(id = null, val = BigInt('0'), count = 0) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.val = val;
|
this.val = val;
|
||||||
this.count = count;
|
this.count = count;
|
||||||
}
|
}
|
||||||
pack(builder) {
|
pack(builder) {
|
||||||
const id = (this.id !== null ? builder.createString(this.id) : 0);
|
const id = (this.id !== null ? builder.createString(this.id) : 0);
|
||||||
return Stat.createStat(builder, id, this.val, this.count);
|
return Stat.createStat(builder, id, this.val, this.count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,18 @@
|
|||||||
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,
|
bb: flatbuffers.ByteBuffer | null;
|
||||||
} from '../../my-game/example/struct-of-structs.js';
|
bb_pos: number;
|
||||||
export declare class StructOfStructsOfStructs
|
__init(i: number, bb: flatbuffers.ByteBuffer): StructOfStructsOfStructs;
|
||||||
implements flatbuffers.IUnpackableObject<StructOfStructsOfStructsT>
|
a(obj?: StructOfStructs): StructOfStructs | null;
|
||||||
{
|
static getFullyQualifiedName(): "MyGame.Example.StructOfStructsOfStructs";
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
static sizeOf(): number;
|
||||||
bb_pos: number;
|
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;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): StructOfStructsOfStructs;
|
unpack(): StructOfStructsOfStructsT;
|
||||||
a(obj?: StructOfStructs): StructOfStructs | null;
|
unpackTo(_o: StructOfStructsOfStructsT): void;
|
||||||
static getFullyQualifiedName(): string;
|
|
||||||
static sizeOf(): number;
|
|
||||||
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;
|
|
||||||
unpack(): StructOfStructsOfStructsT;
|
|
||||||
unpackTo(_o: StructOfStructsOfStructsT): void;
|
|
||||||
}
|
}
|
||||||
export declare class StructOfStructsOfStructsT
|
export declare class StructOfStructsOfStructsT implements flatbuffers.IGeneratedObject {
|
||||||
implements flatbuffers.IGeneratedObject
|
a: StructOfStructsT | null;
|
||||||
{
|
constructor(a?: StructOfStructsT | null);
|
||||||
a: StructOfStructsT | null;
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
constructor(a?: StructOfStructsT | null);
|
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,56 +1,51 @@
|
|||||||
// 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;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
}
|
||||||
__init(i, bb) {
|
__init(i, bb) {
|
||||||
this.bb_pos = i;
|
this.bb_pos = i;
|
||||||
this.bb = bb;
|
this.bb = bb;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
a(obj) {
|
a(obj) {
|
||||||
return (obj || new StructOfStructs()).__init(this.bb_pos, this.bb);
|
return (obj || new StructOfStructs()).__init(this.bb_pos, this.bb);
|
||||||
}
|
}
|
||||||
static getFullyQualifiedName() {
|
static getFullyQualifiedName() {
|
||||||
return 'MyGame.Example.StructOfStructsOfStructs';
|
return 'MyGame.Example.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);
|
builder.writeInt32(a_c_distance);
|
||||||
builder.writeInt32(a_c_distance);
|
builder.writeInt32(a_c_id);
|
||||||
builder.writeInt32(a_c_id);
|
builder.prep(2, 4);
|
||||||
builder.prep(2, 4);
|
builder.pad(1);
|
||||||
builder.pad(1);
|
builder.writeInt8(a_b_b);
|
||||||
builder.writeInt8(a_b_b);
|
builder.writeInt16(a_b_a);
|
||||||
builder.writeInt16(a_b_a);
|
builder.prep(4, 8);
|
||||||
builder.prep(4, 8);
|
builder.writeInt32(a_a_distance);
|
||||||
builder.writeInt32(a_a_distance);
|
builder.writeInt32(a_a_id);
|
||||||
builder.writeInt32(a_a_id);
|
return builder.offset();
|
||||||
return builder.offset();
|
}
|
||||||
}
|
unpack() {
|
||||||
unpack() {
|
return new StructOfStructsOfStructsT((this.a() !== null ? this.a().unpack() : null));
|
||||||
return new StructOfStructsOfStructsT(
|
}
|
||||||
(this.a() !== null ? this.a().unpack() : null));
|
unpackTo(_o) {
|
||||||
}
|
_o.a = (this.a() !== null ? this.a().unpack() : null);
|
||||||
unpackTo(_o) {
|
}
|
||||||
_o.a = (this.a() !== null ? this.a().unpack() : null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
export class StructOfStructsOfStructsT {
|
export class StructOfStructsOfStructsT {
|
||||||
constructor(a = null) {
|
constructor(a = null) {
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
48
tests/ts/my-game/example/struct-of-structs.d.ts
vendored
48
tests/ts/my-game/example/struct-of-structs.d.ts
vendored
@@ -1,33 +1,23 @@
|
|||||||
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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): StructOfStructs;
|
||||||
bb_pos: number;
|
a(obj?: Ability): Ability | null;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): StructOfStructs;
|
b(obj?: Test): Test | null;
|
||||||
a(obj?: Ability): Ability | null;
|
c(obj?: Ability): Ability | null;
|
||||||
b(obj?: Test): Test | null;
|
static getFullyQualifiedName(): "MyGame.Example.StructOfStructs";
|
||||||
c(obj?: Ability): Ability | null;
|
static sizeOf(): number;
|
||||||
static getFullyQualifiedName(): string;
|
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;
|
||||||
static sizeOf(): number;
|
unpack(): StructOfStructsT;
|
||||||
static createStructOfStructs(
|
unpackTo(_o: StructOfStructsT): void;
|
||||||
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;
|
|
||||||
unpackTo(_o: StructOfStructsT): void;
|
|
||||||
}
|
}
|
||||||
export declare class StructOfStructsT implements flatbuffers.IGeneratedObject {
|
export declare class StructOfStructsT implements flatbuffers.IGeneratedObject {
|
||||||
a: AbilityT | null;
|
a: AbilityT | null;
|
||||||
b: TestT | null;
|
b: TestT | null;
|
||||||
c: AbilityT | null;
|
c: AbilityT | null;
|
||||||
constructor(a?: AbilityT | null, b?: TestT | null, c?: AbilityT | null);
|
constructor(a?: AbilityT | null, b?: TestT | null, c?: AbilityT | null);
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,67 +1,61 @@
|
|||||||
// 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;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
}
|
||||||
__init(i, bb) {
|
__init(i, bb) {
|
||||||
this.bb_pos = i;
|
this.bb_pos = i;
|
||||||
this.bb = bb;
|
this.bb = bb;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
a(obj) {
|
a(obj) {
|
||||||
return (obj || new Ability()).__init(this.bb_pos, this.bb);
|
return (obj || new Ability()).__init(this.bb_pos, this.bb);
|
||||||
}
|
}
|
||||||
b(obj) {
|
b(obj) {
|
||||||
return (obj || new Test()).__init(this.bb_pos + 8, this.bb);
|
return (obj || new Test()).__init(this.bb_pos + 8, this.bb);
|
||||||
}
|
}
|
||||||
c(obj) {
|
c(obj) {
|
||||||
return (obj || new Ability()).__init(this.bb_pos + 12, this.bb);
|
return (obj || new Ability()).__init(this.bb_pos + 12, this.bb);
|
||||||
}
|
}
|
||||||
static getFullyQualifiedName() {
|
static getFullyQualifiedName() {
|
||||||
return 'MyGame.Example.StructOfStructs';
|
return 'MyGame.Example.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);
|
builder.writeInt32(c_id);
|
||||||
builder.writeInt32(c_id);
|
builder.prep(2, 4);
|
||||||
builder.prep(2, 4);
|
builder.pad(1);
|
||||||
builder.pad(1);
|
builder.writeInt8(b_b);
|
||||||
builder.writeInt8(b_b);
|
builder.writeInt16(b_a);
|
||||||
builder.writeInt16(b_a);
|
builder.prep(4, 8);
|
||||||
builder.prep(4, 8);
|
builder.writeInt32(a_distance);
|
||||||
builder.writeInt32(a_distance);
|
builder.writeInt32(a_id);
|
||||||
builder.writeInt32(a_id);
|
return builder.offset();
|
||||||
return builder.offset();
|
}
|
||||||
}
|
unpack() {
|
||||||
unpack() {
|
return new StructOfStructsT((this.a() !== null ? this.a().unpack() : null), (this.b() !== null ? this.b().unpack() : null), (this.c() !== null ? this.c().unpack() : null));
|
||||||
return new StructOfStructsT(
|
}
|
||||||
(this.a() !== null ? this.a().unpack() : null),
|
unpackTo(_o) {
|
||||||
(this.b() !== null ? this.b().unpack() : null),
|
_o.a = (this.a() !== null ? this.a().unpack() : null);
|
||||||
(this.c() !== null ? this.c().unpack() : null));
|
_o.b = (this.b() !== null ? this.b().unpack() : null);
|
||||||
}
|
_o.c = (this.c() !== null ? this.c().unpack() : null);
|
||||||
unpackTo(_o) {
|
}
|
||||||
_o.a = (this.a() !== null ? this.a().unpack() : null);
|
|
||||||
_o.b = (this.b() !== null ? this.b().unpack() : null);
|
|
||||||
_o.c = (this.c() !== null ? this.c().unpack() : null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
export class StructOfStructsT {
|
export class StructOfStructsT {
|
||||||
constructor(a = null, b = null, c = null) {
|
constructor(a = null, b = null, c = null) {
|
||||||
this.a = a;
|
this.a = a;
|
||||||
this.b = b;
|
this.b = b;
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -1,40 +1,25 @@
|
|||||||
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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): TestSimpleTableWithEnum;
|
||||||
bb_pos: number;
|
static getRootAsTestSimpleTableWithEnum(bb: flatbuffers.ByteBuffer, obj?: TestSimpleTableWithEnum): TestSimpleTableWithEnum;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): TestSimpleTableWithEnum;
|
static getSizePrefixedRootAsTestSimpleTableWithEnum(bb: flatbuffers.ByteBuffer, obj?: TestSimpleTableWithEnum): TestSimpleTableWithEnum;
|
||||||
static getRootAsTestSimpleTableWithEnum(
|
color(): Color;
|
||||||
bb: flatbuffers.ByteBuffer,
|
mutate_color(value: Color): boolean;
|
||||||
obj?: TestSimpleTableWithEnum,
|
static getFullyQualifiedName(): "MyGame.Example.TestSimpleTableWithEnum";
|
||||||
): TestSimpleTableWithEnum;
|
static startTestSimpleTableWithEnum(builder: flatbuffers.Builder): void;
|
||||||
static getSizePrefixedRootAsTestSimpleTableWithEnum(
|
static addColor(builder: flatbuffers.Builder, color: Color): void;
|
||||||
bb: flatbuffers.ByteBuffer,
|
static endTestSimpleTableWithEnum(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
obj?: TestSimpleTableWithEnum,
|
static createTestSimpleTableWithEnum(builder: flatbuffers.Builder, color: Color): flatbuffers.Offset;
|
||||||
): TestSimpleTableWithEnum;
|
serialize(): Uint8Array;
|
||||||
color(): Color;
|
static deserialize(buffer: Uint8Array): TestSimpleTableWithEnum;
|
||||||
mutate_color(value: Color): boolean;
|
unpack(): TestSimpleTableWithEnumT;
|
||||||
static getFullyQualifiedName(): string;
|
unpackTo(_o: TestSimpleTableWithEnumT): void;
|
||||||
static startTestSimpleTableWithEnum(builder: flatbuffers.Builder): void;
|
|
||||||
static addColor(builder: flatbuffers.Builder, color: Color): void;
|
|
||||||
static endTestSimpleTableWithEnum(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
static createTestSimpleTableWithEnum(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
color: Color,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
serialize(): Uint8Array;
|
|
||||||
static deserialize(buffer: Uint8Array): TestSimpleTableWithEnum;
|
|
||||||
unpack(): TestSimpleTableWithEnumT;
|
|
||||||
unpackTo(_o: TestSimpleTableWithEnumT): void;
|
|
||||||
}
|
}
|
||||||
export declare class TestSimpleTableWithEnumT
|
export declare class TestSimpleTableWithEnumT implements flatbuffers.IGeneratedObject {
|
||||||
implements flatbuffers.IGeneratedObject
|
color: Color;
|
||||||
{
|
constructor(color?: Color);
|
||||||
color: Color;
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
constructor(color?: Color);
|
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,79 +1,72 @@
|
|||||||
// 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;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
}
|
||||||
__init(i, bb) {
|
__init(i, bb) {
|
||||||
this.bb_pos = i;
|
this.bb_pos = i;
|
||||||
this.bb = bb;
|
this.bb = bb;
|
||||||
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()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
return (obj || new TestSimpleTableWithEnum())
|
}
|
||||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
color() {
|
||||||
}
|
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||||
color() {
|
return offset ? this.bb.readUint8(this.bb_pos + offset) : Color.Green;
|
||||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
}
|
||||||
return offset ? this.bb.readUint8(this.bb_pos + offset) : Color.Green;
|
mutate_color(value) {
|
||||||
}
|
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||||
mutate_color(value) {
|
if (offset === 0) {
|
||||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
return false;
|
||||||
if (offset === 0) {
|
}
|
||||||
return false;
|
this.bb.writeUint8(this.bb_pos + offset, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
static getFullyQualifiedName() {
|
||||||
|
return 'MyGame.Example.TestSimpleTableWithEnum';
|
||||||
|
}
|
||||||
|
static startTestSimpleTableWithEnum(builder) {
|
||||||
|
builder.startObject(1);
|
||||||
|
}
|
||||||
|
static addColor(builder, color) {
|
||||||
|
builder.addFieldInt8(0, color, Color.Green);
|
||||||
|
}
|
||||||
|
static endTestSimpleTableWithEnum(builder) {
|
||||||
|
const offset = builder.endObject();
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
static createTestSimpleTableWithEnum(builder, color) {
|
||||||
|
TestSimpleTableWithEnum.startTestSimpleTableWithEnum(builder);
|
||||||
|
TestSimpleTableWithEnum.addColor(builder, color);
|
||||||
|
return TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder);
|
||||||
|
}
|
||||||
|
serialize() {
|
||||||
|
return this.bb.bytes();
|
||||||
|
}
|
||||||
|
static deserialize(buffer) {
|
||||||
|
return TestSimpleTableWithEnum.getRootAsTestSimpleTableWithEnum(new flatbuffers.ByteBuffer(buffer));
|
||||||
|
}
|
||||||
|
unpack() {
|
||||||
|
return new TestSimpleTableWithEnumT(this.color());
|
||||||
|
}
|
||||||
|
unpackTo(_o) {
|
||||||
|
_o.color = this.color();
|
||||||
}
|
}
|
||||||
this.bb.writeUint8(this.bb_pos + offset, value);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
static getFullyQualifiedName() {
|
|
||||||
return 'MyGame.Example.TestSimpleTableWithEnum';
|
|
||||||
}
|
|
||||||
static startTestSimpleTableWithEnum(builder) {
|
|
||||||
builder.startObject(1);
|
|
||||||
}
|
|
||||||
static addColor(builder, color) {
|
|
||||||
builder.addFieldInt8(0, color, Color.Green);
|
|
||||||
}
|
|
||||||
static endTestSimpleTableWithEnum(builder) {
|
|
||||||
const offset = builder.endObject();
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
static createTestSimpleTableWithEnum(builder, color) {
|
|
||||||
TestSimpleTableWithEnum.startTestSimpleTableWithEnum(builder);
|
|
||||||
TestSimpleTableWithEnum.addColor(builder, color);
|
|
||||||
return TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder);
|
|
||||||
}
|
|
||||||
serialize() {
|
|
||||||
return this.bb.bytes();
|
|
||||||
}
|
|
||||||
static deserialize(buffer) {
|
|
||||||
return TestSimpleTableWithEnum.getRootAsTestSimpleTableWithEnum(
|
|
||||||
new flatbuffers.ByteBuffer(buffer));
|
|
||||||
}
|
|
||||||
unpack() {
|
|
||||||
return new TestSimpleTableWithEnumT(this.color());
|
|
||||||
}
|
|
||||||
unpackTo(_o) {
|
|
||||||
_o.color = this.color();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
export class TestSimpleTableWithEnumT {
|
export class TestSimpleTableWithEnumT {
|
||||||
constructor(color = Color.Green) {
|
constructor(color = Color.Green) {
|
||||||
this.color = color;
|
this.color = color;
|
||||||
}
|
}
|
||||||
pack(builder) {
|
pack(builder) {
|
||||||
return TestSimpleTableWithEnum.createTestSimpleTableWithEnum(
|
return TestSimpleTableWithEnum.createTestSimpleTableWithEnum(builder, this.color);
|
||||||
builder, this.color);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
36
tests/ts/my-game/example/test.d.ts
vendored
36
tests/ts/my-game/example/test.d.ts
vendored
@@ -1,25 +1,21 @@
|
|||||||
import * as flatbuffers from 'flatbuffers';
|
import * as flatbuffers from 'flatbuffers';
|
||||||
export declare class Test implements flatbuffers.IUnpackableObject<TestT> {
|
export declare class Test implements flatbuffers.IUnpackableObject<TestT> {
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
bb: flatbuffers.ByteBuffer | null;
|
||||||
bb_pos: number;
|
bb_pos: number;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): Test;
|
__init(i: number, bb: flatbuffers.ByteBuffer): Test;
|
||||||
a(): number;
|
a(): number;
|
||||||
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,
|
unpack(): TestT;
|
||||||
a: number,
|
unpackTo(_o: TestT): void;
|
||||||
b: number,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
unpack(): TestT;
|
|
||||||
unpackTo(_o: TestT): void;
|
|
||||||
}
|
}
|
||||||
export declare class TestT implements flatbuffers.IGeneratedObject {
|
export declare class TestT implements flatbuffers.IGeneratedObject {
|
||||||
a: number;
|
a: number;
|
||||||
b: number;
|
b: number;
|
||||||
constructor(a?: number, b?: number);
|
constructor(a?: number, b?: number);
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,55 +1,55 @@
|
|||||||
// automatically generated by the FlatBuffers compiler, do not modify
|
// automatically generated by the FlatBuffers compiler, do not modify
|
||||||
export class Test {
|
export class Test {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.bb = null;
|
this.bb = null;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
}
|
||||||
__init(i, bb) {
|
__init(i, bb) {
|
||||||
this.bb_pos = i;
|
this.bb_pos = i;
|
||||||
this.bb = bb;
|
this.bb = bb;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
a() {
|
a() {
|
||||||
return this.bb.readInt16(this.bb_pos);
|
return this.bb.readInt16(this.bb_pos);
|
||||||
}
|
}
|
||||||
mutate_a(value) {
|
mutate_a(value) {
|
||||||
this.bb.writeInt16(this.bb_pos + 0, value);
|
this.bb.writeInt16(this.bb_pos + 0, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
b() {
|
b() {
|
||||||
return this.bb.readInt8(this.bb_pos + 2);
|
return this.bb.readInt8(this.bb_pos + 2);
|
||||||
}
|
}
|
||||||
mutate_b(value) {
|
mutate_b(value) {
|
||||||
this.bb.writeInt8(this.bb_pos + 2, value);
|
this.bb.writeInt8(this.bb_pos + 2, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
static getFullyQualifiedName() {
|
static getFullyQualifiedName() {
|
||||||
return 'MyGame.Example.Test';
|
return 'MyGame.Example.Test';
|
||||||
}
|
}
|
||||||
static sizeOf() {
|
static sizeOf() {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
static createTest(builder, a, b) {
|
static createTest(builder, a, b) {
|
||||||
builder.prep(2, 4);
|
builder.prep(2, 4);
|
||||||
builder.pad(1);
|
builder.pad(1);
|
||||||
builder.writeInt8(b);
|
builder.writeInt8(b);
|
||||||
builder.writeInt16(a);
|
builder.writeInt16(a);
|
||||||
return builder.offset();
|
return builder.offset();
|
||||||
}
|
}
|
||||||
unpack() {
|
unpack() {
|
||||||
return new TestT(this.a(), this.b());
|
return new TestT(this.a(), this.b());
|
||||||
}
|
}
|
||||||
unpackTo(_o) {
|
unpackTo(_o) {
|
||||||
_o.a = this.a();
|
_o.a = this.a();
|
||||||
_o.b = this.b();
|
_o.b = this.b();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export class TestT {
|
export class TestT {
|
||||||
constructor(a = 0, b = 0) {
|
constructor(a = 0, b = 0) {
|
||||||
this.a = a;
|
this.a = a;
|
||||||
this.b = b;
|
this.b = b;
|
||||||
}
|
}
|
||||||
pack(builder) {
|
pack(builder) {
|
||||||
return Test.createTest(builder, this.a, this.b);
|
return Test.createTest(builder, this.a, this.b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
209
tests/ts/my-game/example/type-aliases.d.ts
vendored
209
tests/ts/my-game/example/type-aliases.d.ts
vendored
@@ -1,135 +1,82 @@
|
|||||||
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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): TypeAliases;
|
||||||
bb_pos: number;
|
static getRootAsTypeAliases(bb: flatbuffers.ByteBuffer, obj?: TypeAliases): TypeAliases;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): TypeAliases;
|
static getSizePrefixedRootAsTypeAliases(bb: flatbuffers.ByteBuffer, obj?: TypeAliases): TypeAliases;
|
||||||
static getRootAsTypeAliases(
|
i8(): number;
|
||||||
bb: flatbuffers.ByteBuffer,
|
mutate_i8(value: number): boolean;
|
||||||
obj?: TypeAliases,
|
u8(): number;
|
||||||
): TypeAliases;
|
mutate_u8(value: number): boolean;
|
||||||
static getSizePrefixedRootAsTypeAliases(
|
i16(): number;
|
||||||
bb: flatbuffers.ByteBuffer,
|
mutate_i16(value: number): boolean;
|
||||||
obj?: TypeAliases,
|
u16(): number;
|
||||||
): TypeAliases;
|
mutate_u16(value: number): boolean;
|
||||||
i8(): number;
|
i32(): number;
|
||||||
mutate_i8(value: number): boolean;
|
mutate_i32(value: number): boolean;
|
||||||
u8(): number;
|
u32(): number;
|
||||||
mutate_u8(value: number): boolean;
|
mutate_u32(value: number): boolean;
|
||||||
i16(): number;
|
i64(): bigint;
|
||||||
mutate_i16(value: number): boolean;
|
mutate_i64(value: bigint): boolean;
|
||||||
u16(): number;
|
u64(): bigint;
|
||||||
mutate_u16(value: number): boolean;
|
mutate_u64(value: bigint): boolean;
|
||||||
i32(): number;
|
f32(): number;
|
||||||
mutate_i32(value: number): boolean;
|
mutate_f32(value: number): boolean;
|
||||||
u32(): number;
|
f64(): number;
|
||||||
mutate_u32(value: number): boolean;
|
mutate_f64(value: number): boolean;
|
||||||
i64(): bigint;
|
v8(index: number): number | null;
|
||||||
mutate_i64(value: bigint): boolean;
|
v8Length(): number;
|
||||||
u64(): bigint;
|
v8Array(): Int8Array | null;
|
||||||
mutate_u64(value: bigint): boolean;
|
vf64(index: number): number | null;
|
||||||
f32(): number;
|
vf64Length(): number;
|
||||||
mutate_f32(value: number): boolean;
|
vf64Array(): Float64Array | null;
|
||||||
f64(): number;
|
static getFullyQualifiedName(): "MyGame.Example.TypeAliases";
|
||||||
mutate_f64(value: number): boolean;
|
static startTypeAliases(builder: flatbuffers.Builder): void;
|
||||||
v8(index: number): number | null;
|
static addI8(builder: flatbuffers.Builder, i8: number): void;
|
||||||
v8Length(): number;
|
static addU8(builder: flatbuffers.Builder, u8: number): void;
|
||||||
v8Array(): Int8Array | null;
|
static addI16(builder: flatbuffers.Builder, i16: number): void;
|
||||||
vf64(index: number): number | null;
|
static addU16(builder: flatbuffers.Builder, u16: number): void;
|
||||||
vf64Length(): number;
|
static addI32(builder: flatbuffers.Builder, i32: number): void;
|
||||||
vf64Array(): Float64Array | null;
|
static addU32(builder: flatbuffers.Builder, u32: number): void;
|
||||||
static getFullyQualifiedName(): string;
|
static addI64(builder: flatbuffers.Builder, i64: bigint): void;
|
||||||
static startTypeAliases(builder: flatbuffers.Builder): void;
|
static addU64(builder: flatbuffers.Builder, u64: bigint): void;
|
||||||
static addI8(builder: flatbuffers.Builder, i8: number): void;
|
static addF32(builder: flatbuffers.Builder, f32: number): void;
|
||||||
static addU8(builder: flatbuffers.Builder, u8: number): void;
|
static addF64(builder: flatbuffers.Builder, f64: number): void;
|
||||||
static addI16(builder: flatbuffers.Builder, i16: number): void;
|
static addV8(builder: flatbuffers.Builder, v8Offset: flatbuffers.Offset): void;
|
||||||
static addU16(builder: flatbuffers.Builder, u16: number): void;
|
static createV8Vector(builder: flatbuffers.Builder, data: number[] | Int8Array): flatbuffers.Offset;
|
||||||
static addI32(builder: flatbuffers.Builder, i32: number): void;
|
/**
|
||||||
static addU32(builder: flatbuffers.Builder, u32: number): void;
|
* @deprecated This Uint8Array overload will be removed in the future.
|
||||||
static addI64(builder: flatbuffers.Builder, i64: bigint): void;
|
*/
|
||||||
static addU64(builder: flatbuffers.Builder, u64: bigint): void;
|
static createV8Vector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
|
||||||
static addF32(builder: flatbuffers.Builder, f32: number): void;
|
static startV8Vector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
static addF64(builder: flatbuffers.Builder, f64: number): void;
|
static addVf64(builder: flatbuffers.Builder, vf64Offset: flatbuffers.Offset): void;
|
||||||
static addV8(
|
static createVf64Vector(builder: flatbuffers.Builder, data: number[] | Float64Array): flatbuffers.Offset;
|
||||||
builder: flatbuffers.Builder,
|
/**
|
||||||
v8Offset: flatbuffers.Offset,
|
* @deprecated This Uint8Array overload will be removed in the future.
|
||||||
): void;
|
*/
|
||||||
static createV8Vector(
|
static createVf64Vector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
|
||||||
builder: flatbuffers.Builder,
|
static startVf64Vector(builder: flatbuffers.Builder, numElems: number): void;
|
||||||
data: number[] | Int8Array,
|
static endTypeAliases(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
): flatbuffers.Offset;
|
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;
|
||||||
/**
|
serialize(): Uint8Array;
|
||||||
* @deprecated This Uint8Array overload will be removed in the future.
|
static deserialize(buffer: Uint8Array): TypeAliases;
|
||||||
*/
|
unpack(): TypeAliasesT;
|
||||||
static createV8Vector(
|
unpackTo(_o: TypeAliasesT): void;
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
data: number[] | Uint8Array,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
static startV8Vector(builder: flatbuffers.Builder, numElems: number): void;
|
|
||||||
static addVf64(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
vf64Offset: flatbuffers.Offset,
|
|
||||||
): void;
|
|
||||||
static createVf64Vector(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
data: number[] | Float64Array,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
/**
|
|
||||||
* @deprecated This Uint8Array overload will be removed in the future.
|
|
||||||
*/
|
|
||||||
static createVf64Vector(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
data: number[] | Uint8Array,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
static startVf64Vector(builder: flatbuffers.Builder, numElems: number): void;
|
|
||||||
static endTypeAliases(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
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;
|
|
||||||
serialize(): Uint8Array;
|
|
||||||
static deserialize(buffer: Uint8Array): TypeAliases;
|
|
||||||
unpack(): TypeAliasesT;
|
|
||||||
unpackTo(_o: TypeAliasesT): void;
|
|
||||||
}
|
}
|
||||||
export declare class TypeAliasesT implements flatbuffers.IGeneratedObject {
|
export declare class TypeAliasesT implements flatbuffers.IGeneratedObject {
|
||||||
i8: number;
|
i8: number;
|
||||||
u8: number;
|
u8: number;
|
||||||
i16: number;
|
i16: number;
|
||||||
u16: number;
|
u16: number;
|
||||||
i32: number;
|
i32: number;
|
||||||
u32: number;
|
u32: number;
|
||||||
i64: bigint;
|
i64: bigint;
|
||||||
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,
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,318 +1,291 @@
|
|||||||
// 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() {
|
||||||
this.bb = null;
|
this.bb = null;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
|
||||||
__init(i, bb) {
|
|
||||||
this.bb_pos = i;
|
|
||||||
this.bb = bb;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
static getRootAsTypeAliases(bb, obj) {
|
|
||||||
return (obj || new TypeAliases())
|
|
||||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
||||||
}
|
|
||||||
static getSizePrefixedRootAsTypeAliases(bb, obj) {
|
|
||||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
||||||
return (obj || new TypeAliases())
|
|
||||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
||||||
}
|
|
||||||
i8() {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
|
||||||
return offset ? this.bb.readInt8(this.bb_pos + offset) : 0;
|
|
||||||
}
|
|
||||||
mutate_i8(value) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
|
||||||
if (offset === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
this.bb.writeInt8(this.bb_pos + offset, value);
|
__init(i, bb) {
|
||||||
return true;
|
this.bb_pos = i;
|
||||||
}
|
this.bb = bb;
|
||||||
u8() {
|
return this;
|
||||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
||||||
return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
|
|
||||||
}
|
|
||||||
mutate_u8(value) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
||||||
if (offset === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
this.bb.writeUint8(this.bb_pos + offset, value);
|
static getRootAsTypeAliases(bb, obj) {
|
||||||
return true;
|
return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
}
|
|
||||||
i16() {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
||||||
return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;
|
|
||||||
}
|
|
||||||
mutate_i16(value) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
||||||
if (offset === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
this.bb.writeInt16(this.bb_pos + offset, value);
|
static getSizePrefixedRootAsTypeAliases(bb, obj) {
|
||||||
return true;
|
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||||
}
|
return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
u16() {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
||||||
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
|
||||||
}
|
|
||||||
mutate_u16(value) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
||||||
if (offset === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
this.bb.writeUint16(this.bb_pos + offset, value);
|
i8() {
|
||||||
return true;
|
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||||
}
|
return offset ? this.bb.readInt8(this.bb_pos + offset) : 0;
|
||||||
i32() {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
|
||||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
||||||
}
|
|
||||||
mutate_i32(value) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
|
||||||
if (offset === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
mutate_i8(value) {
|
||||||
return true;
|
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||||
}
|
if (offset === 0) {
|
||||||
u32() {
|
return false;
|
||||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
}
|
||||||
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
|
this.bb.writeInt8(this.bb_pos + offset, value);
|
||||||
}
|
return true;
|
||||||
mutate_u32(value) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
|
||||||
if (offset === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
this.bb.writeUint32(this.bb_pos + offset, value);
|
u8() {
|
||||||
return true;
|
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||||
}
|
return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
|
||||||
i64() {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
|
||||||
return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
|
|
||||||
}
|
|
||||||
mutate_i64(value) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
|
||||||
if (offset === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
this.bb.writeInt64(this.bb_pos + offset, value);
|
mutate_u8(value) {
|
||||||
return true;
|
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||||
}
|
if (offset === 0) {
|
||||||
u64() {
|
return false;
|
||||||
const offset = this.bb.__offset(this.bb_pos, 18);
|
}
|
||||||
return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
|
this.bb.writeUint8(this.bb_pos + offset, value);
|
||||||
}
|
return true;
|
||||||
mutate_u64(value) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 18);
|
|
||||||
if (offset === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
this.bb.writeUint64(this.bb_pos + offset, value);
|
i16() {
|
||||||
return true;
|
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||||
}
|
return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;
|
||||||
f32() {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
||||||
return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
|
|
||||||
}
|
|
||||||
mutate_f32(value) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
||||||
if (offset === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
this.bb.writeFloat32(this.bb_pos + offset, value);
|
mutate_i16(value) {
|
||||||
return true;
|
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||||
}
|
if (offset === 0) {
|
||||||
f64() {
|
return false;
|
||||||
const offset = this.bb.__offset(this.bb_pos, 22);
|
}
|
||||||
return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
|
this.bb.writeInt16(this.bb_pos + offset, value);
|
||||||
}
|
return true;
|
||||||
mutate_f64(value) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 22);
|
|
||||||
if (offset === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
this.bb.writeFloat64(this.bb_pos + offset, value);
|
u16() {
|
||||||
return true;
|
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||||
}
|
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
||||||
v8(index) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 24);
|
|
||||||
return offset ?
|
|
||||||
this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) :
|
|
||||||
0;
|
|
||||||
}
|
|
||||||
v8Length() {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 24);
|
|
||||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
||||||
}
|
|
||||||
v8Array() {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 24);
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
vf64(index) {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 26);
|
|
||||||
return offset ? this.bb.readFloat64(
|
|
||||||
this.bb.__vector(this.bb_pos + offset) + index * 8) :
|
|
||||||
0;
|
|
||||||
}
|
|
||||||
vf64Length() {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 26);
|
|
||||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
||||||
}
|
|
||||||
vf64Array() {
|
|
||||||
const offset = this.bb.__offset(this.bb_pos, 26);
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
static getFullyQualifiedName() {
|
|
||||||
return 'MyGame.Example.TypeAliases';
|
|
||||||
}
|
|
||||||
static startTypeAliases(builder) {
|
|
||||||
builder.startObject(12);
|
|
||||||
}
|
|
||||||
static addI8(builder, i8) {
|
|
||||||
builder.addFieldInt8(0, i8, 0);
|
|
||||||
}
|
|
||||||
static addU8(builder, u8) {
|
|
||||||
builder.addFieldInt8(1, u8, 0);
|
|
||||||
}
|
|
||||||
static addI16(builder, i16) {
|
|
||||||
builder.addFieldInt16(2, i16, 0);
|
|
||||||
}
|
|
||||||
static addU16(builder, u16) {
|
|
||||||
builder.addFieldInt16(3, u16, 0);
|
|
||||||
}
|
|
||||||
static addI32(builder, i32) {
|
|
||||||
builder.addFieldInt32(4, i32, 0);
|
|
||||||
}
|
|
||||||
static addU32(builder, u32) {
|
|
||||||
builder.addFieldInt32(5, u32, 0);
|
|
||||||
}
|
|
||||||
static addI64(builder, i64) {
|
|
||||||
builder.addFieldInt64(6, i64, BigInt('0'));
|
|
||||||
}
|
|
||||||
static addU64(builder, u64) {
|
|
||||||
builder.addFieldInt64(7, u64, BigInt('0'));
|
|
||||||
}
|
|
||||||
static addF32(builder, f32) {
|
|
||||||
builder.addFieldFloat32(8, f32, 0.0);
|
|
||||||
}
|
|
||||||
static addF64(builder, f64) {
|
|
||||||
builder.addFieldFloat64(9, f64, 0.0);
|
|
||||||
}
|
|
||||||
static addV8(builder, v8Offset) {
|
|
||||||
builder.addFieldOffset(10, v8Offset, 0);
|
|
||||||
}
|
|
||||||
static createV8Vector(builder, data) {
|
|
||||||
builder.startVector(1, data.length, 1);
|
|
||||||
for (let i = data.length - 1; i >= 0; i--) {
|
|
||||||
builder.addInt8(data[i]);
|
|
||||||
}
|
}
|
||||||
return builder.endVector();
|
mutate_u16(value) {
|
||||||
}
|
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||||
static startV8Vector(builder, numElems) {
|
if (offset === 0) {
|
||||||
builder.startVector(1, numElems, 1);
|
return false;
|
||||||
}
|
}
|
||||||
static addVf64(builder, vf64Offset) {
|
this.bb.writeUint16(this.bb_pos + offset, value);
|
||||||
builder.addFieldOffset(11, vf64Offset, 0);
|
return true;
|
||||||
}
|
}
|
||||||
static createVf64Vector(builder, data) {
|
i32() {
|
||||||
builder.startVector(8, data.length, 8);
|
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||||
for (let i = data.length - 1; i >= 0; i--) {
|
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||||
builder.addFloat64(data[i]);
|
}
|
||||||
|
mutate_i32(value) {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||||
|
if (offset === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
u32() {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||||
|
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
|
||||||
|
}
|
||||||
|
mutate_u32(value) {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||||
|
if (offset === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.bb.writeUint32(this.bb_pos + offset, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
i64() {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||||
|
return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
|
||||||
|
}
|
||||||
|
mutate_i64(value) {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||||
|
if (offset === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.bb.writeInt64(this.bb_pos + offset, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
u64() {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 18);
|
||||||
|
return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
|
||||||
|
}
|
||||||
|
mutate_u64(value) {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 18);
|
||||||
|
if (offset === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.bb.writeUint64(this.bb_pos + offset, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
f32() {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 20);
|
||||||
|
return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
|
||||||
|
}
|
||||||
|
mutate_f32(value) {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 20);
|
||||||
|
if (offset === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.bb.writeFloat32(this.bb_pos + offset, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
f64() {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 22);
|
||||||
|
return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
|
||||||
|
}
|
||||||
|
mutate_f64(value) {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 22);
|
||||||
|
if (offset === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.bb.writeFloat64(this.bb_pos + offset, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
v8(index) {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 24);
|
||||||
|
return offset ? this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
||||||
|
}
|
||||||
|
v8Length() {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 24);
|
||||||
|
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||||
|
}
|
||||||
|
v8Array() {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 24);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
vf64(index) {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 26);
|
||||||
|
return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
|
||||||
|
}
|
||||||
|
vf64Length() {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 26);
|
||||||
|
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||||
|
}
|
||||||
|
vf64Array() {
|
||||||
|
const offset = this.bb.__offset(this.bb_pos, 26);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
static getFullyQualifiedName() {
|
||||||
|
return 'MyGame.Example.TypeAliases';
|
||||||
|
}
|
||||||
|
static startTypeAliases(builder) {
|
||||||
|
builder.startObject(12);
|
||||||
|
}
|
||||||
|
static addI8(builder, i8) {
|
||||||
|
builder.addFieldInt8(0, i8, 0);
|
||||||
|
}
|
||||||
|
static addU8(builder, u8) {
|
||||||
|
builder.addFieldInt8(1, u8, 0);
|
||||||
|
}
|
||||||
|
static addI16(builder, i16) {
|
||||||
|
builder.addFieldInt16(2, i16, 0);
|
||||||
|
}
|
||||||
|
static addU16(builder, u16) {
|
||||||
|
builder.addFieldInt16(3, u16, 0);
|
||||||
|
}
|
||||||
|
static addI32(builder, i32) {
|
||||||
|
builder.addFieldInt32(4, i32, 0);
|
||||||
|
}
|
||||||
|
static addU32(builder, u32) {
|
||||||
|
builder.addFieldInt32(5, u32, 0);
|
||||||
|
}
|
||||||
|
static addI64(builder, i64) {
|
||||||
|
builder.addFieldInt64(6, i64, BigInt('0'));
|
||||||
|
}
|
||||||
|
static addU64(builder, u64) {
|
||||||
|
builder.addFieldInt64(7, u64, BigInt('0'));
|
||||||
|
}
|
||||||
|
static addF32(builder, f32) {
|
||||||
|
builder.addFieldFloat32(8, f32, 0.0);
|
||||||
|
}
|
||||||
|
static addF64(builder, f64) {
|
||||||
|
builder.addFieldFloat64(9, f64, 0.0);
|
||||||
|
}
|
||||||
|
static addV8(builder, v8Offset) {
|
||||||
|
builder.addFieldOffset(10, v8Offset, 0);
|
||||||
|
}
|
||||||
|
static createV8Vector(builder, data) {
|
||||||
|
builder.startVector(1, data.length, 1);
|
||||||
|
for (let i = data.length - 1; i >= 0; i--) {
|
||||||
|
builder.addInt8(data[i]);
|
||||||
|
}
|
||||||
|
return builder.endVector();
|
||||||
|
}
|
||||||
|
static startV8Vector(builder, numElems) {
|
||||||
|
builder.startVector(1, numElems, 1);
|
||||||
|
}
|
||||||
|
static addVf64(builder, vf64Offset) {
|
||||||
|
builder.addFieldOffset(11, vf64Offset, 0);
|
||||||
|
}
|
||||||
|
static createVf64Vector(builder, data) {
|
||||||
|
builder.startVector(8, data.length, 8);
|
||||||
|
for (let i = data.length - 1; i >= 0; i--) {
|
||||||
|
builder.addFloat64(data[i]);
|
||||||
|
}
|
||||||
|
return builder.endVector();
|
||||||
|
}
|
||||||
|
static startVf64Vector(builder, numElems) {
|
||||||
|
builder.startVector(8, numElems, 8);
|
||||||
|
}
|
||||||
|
static endTypeAliases(builder) {
|
||||||
|
const offset = builder.endObject();
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
static createTypeAliases(builder, i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, v8Offset, vf64Offset) {
|
||||||
|
TypeAliases.startTypeAliases(builder);
|
||||||
|
TypeAliases.addI8(builder, i8);
|
||||||
|
TypeAliases.addU8(builder, u8);
|
||||||
|
TypeAliases.addI16(builder, i16);
|
||||||
|
TypeAliases.addU16(builder, u16);
|
||||||
|
TypeAliases.addI32(builder, i32);
|
||||||
|
TypeAliases.addU32(builder, u32);
|
||||||
|
TypeAliases.addI64(builder, i64);
|
||||||
|
TypeAliases.addU64(builder, u64);
|
||||||
|
TypeAliases.addF32(builder, f32);
|
||||||
|
TypeAliases.addF64(builder, f64);
|
||||||
|
TypeAliases.addV8(builder, v8Offset);
|
||||||
|
TypeAliases.addVf64(builder, vf64Offset);
|
||||||
|
return TypeAliases.endTypeAliases(builder);
|
||||||
|
}
|
||||||
|
serialize() {
|
||||||
|
return this.bb.bytes();
|
||||||
|
}
|
||||||
|
static deserialize(buffer) {
|
||||||
|
return TypeAliases.getRootAsTypeAliases(new flatbuffers.ByteBuffer(buffer));
|
||||||
|
}
|
||||||
|
unpack() {
|
||||||
|
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()));
|
||||||
|
}
|
||||||
|
unpackTo(_o) {
|
||||||
|
_o.i8 = this.i8();
|
||||||
|
_o.u8 = this.u8();
|
||||||
|
_o.i16 = this.i16();
|
||||||
|
_o.u16 = this.u16();
|
||||||
|
_o.i32 = this.i32();
|
||||||
|
_o.u32 = this.u32();
|
||||||
|
_o.i64 = this.i64();
|
||||||
|
_o.u64 = this.u64();
|
||||||
|
_o.f32 = this.f32();
|
||||||
|
_o.f64 = this.f64();
|
||||||
|
_o.v8 = this.bb.createScalarList(this.v8.bind(this), this.v8Length());
|
||||||
|
_o.vf64 = this.bb.createScalarList(this.vf64.bind(this), this.vf64Length());
|
||||||
}
|
}
|
||||||
return builder.endVector();
|
|
||||||
}
|
|
||||||
static startVf64Vector(builder, numElems) {
|
|
||||||
builder.startVector(8, numElems, 8);
|
|
||||||
}
|
|
||||||
static endTypeAliases(builder) {
|
|
||||||
const offset = builder.endObject();
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
static createTypeAliases(
|
|
||||||
builder, i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, v8Offset,
|
|
||||||
vf64Offset) {
|
|
||||||
TypeAliases.startTypeAliases(builder);
|
|
||||||
TypeAliases.addI8(builder, i8);
|
|
||||||
TypeAliases.addU8(builder, u8);
|
|
||||||
TypeAliases.addI16(builder, i16);
|
|
||||||
TypeAliases.addU16(builder, u16);
|
|
||||||
TypeAliases.addI32(builder, i32);
|
|
||||||
TypeAliases.addU32(builder, u32);
|
|
||||||
TypeAliases.addI64(builder, i64);
|
|
||||||
TypeAliases.addU64(builder, u64);
|
|
||||||
TypeAliases.addF32(builder, f32);
|
|
||||||
TypeAliases.addF64(builder, f64);
|
|
||||||
TypeAliases.addV8(builder, v8Offset);
|
|
||||||
TypeAliases.addVf64(builder, vf64Offset);
|
|
||||||
return TypeAliases.endTypeAliases(builder);
|
|
||||||
}
|
|
||||||
serialize() {
|
|
||||||
return this.bb.bytes();
|
|
||||||
}
|
|
||||||
static deserialize(buffer) {
|
|
||||||
return TypeAliases.getRootAsTypeAliases(new flatbuffers.ByteBuffer(buffer));
|
|
||||||
}
|
|
||||||
unpack() {
|
|
||||||
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()));
|
|
||||||
}
|
|
||||||
unpackTo(_o) {
|
|
||||||
_o.i8 = this.i8();
|
|
||||||
_o.u8 = this.u8();
|
|
||||||
_o.i16 = this.i16();
|
|
||||||
_o.u16 = this.u16();
|
|
||||||
_o.i32 = this.i32();
|
|
||||||
_o.u32 = this.u32();
|
|
||||||
_o.i64 = this.i64();
|
|
||||||
_o.u64 = this.u64();
|
|
||||||
_o.f32 = this.f32();
|
|
||||||
_o.f64 = this.f64();
|
|
||||||
_o.v8 = this.bb.createScalarList(this.v8.bind(this), this.v8Length());
|
|
||||||
_o.vf64 = this.bb.createScalarList(this.vf64.bind(this), this.vf64Length());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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'),
|
this.i8 = i8;
|
||||||
u64 = BigInt('0'), f32 = 0.0, f64 = 0.0, v8 = [], vf64 = []) {
|
this.u8 = u8;
|
||||||
this.i8 = i8;
|
this.i16 = i16;
|
||||||
this.u8 = u8;
|
this.u16 = u16;
|
||||||
this.i16 = i16;
|
this.i32 = i32;
|
||||||
this.u16 = u16;
|
this.u32 = u32;
|
||||||
this.i32 = i32;
|
this.i64 = i64;
|
||||||
this.u32 = u32;
|
this.u64 = u64;
|
||||||
this.i64 = i64;
|
this.f32 = f32;
|
||||||
this.u64 = u64;
|
this.f64 = f64;
|
||||||
this.f32 = f32;
|
this.v8 = v8;
|
||||||
this.f64 = f64;
|
this.vf64 = vf64;
|
||||||
this.v8 = v8;
|
}
|
||||||
this.vf64 = vf64;
|
pack(builder) {
|
||||||
}
|
const v8 = TypeAliases.createV8Vector(builder, this.v8);
|
||||||
pack(builder) {
|
const vf64 = TypeAliases.createVf64Vector(builder, this.vf64);
|
||||||
const v8 = TypeAliases.createV8Vector(builder, this.v8);
|
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);
|
||||||
const vf64 = TypeAliases.createVf64Vector(builder, this.vf64);
|
}
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
74
tests/ts/my-game/example/vec3.d.ts
vendored
74
tests/ts/my-game/example/vec3.d.ts
vendored
@@ -1,50 +1,34 @@
|
|||||||
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;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): Vec3;
|
__init(i: number, bb: flatbuffers.ByteBuffer): Vec3;
|
||||||
x(): number;
|
x(): number;
|
||||||
mutate_x(value: number): boolean;
|
mutate_x(value: number): boolean;
|
||||||
y(): number;
|
y(): number;
|
||||||
mutate_y(value: number): boolean;
|
mutate_y(value: number): boolean;
|
||||||
z(): number;
|
z(): number;
|
||||||
mutate_z(value: number): boolean;
|
mutate_z(value: number): boolean;
|
||||||
test1(): number;
|
test1(): number;
|
||||||
mutate_test1(value: number): boolean;
|
mutate_test1(value: number): boolean;
|
||||||
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,
|
unpack(): Vec3T;
|
||||||
x: number,
|
unpackTo(_o: Vec3T): void;
|
||||||
y: number,
|
|
||||||
z: number,
|
|
||||||
test1: number,
|
|
||||||
test2: Color,
|
|
||||||
test3_a: number,
|
|
||||||
test3_b: number,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
unpack(): Vec3T;
|
|
||||||
unpackTo(_o: Vec3T): void;
|
|
||||||
}
|
}
|
||||||
export declare class Vec3T implements flatbuffers.IGeneratedObject {
|
export declare class Vec3T implements flatbuffers.IGeneratedObject {
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
z: number;
|
z: number;
|
||||||
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,
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
y?: number,
|
|
||||||
z?: number,
|
|
||||||
test1?: number,
|
|
||||||
test2?: Color,
|
|
||||||
test3?: TestT | null,
|
|
||||||
);
|
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,103 +1,98 @@
|
|||||||
// 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;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
}
|
||||||
__init(i, bb) {
|
__init(i, bb) {
|
||||||
this.bb_pos = i;
|
this.bb_pos = i;
|
||||||
this.bb = bb;
|
this.bb = bb;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
x() {
|
x() {
|
||||||
return this.bb.readFloat32(this.bb_pos);
|
return this.bb.readFloat32(this.bb_pos);
|
||||||
}
|
}
|
||||||
mutate_x(value) {
|
mutate_x(value) {
|
||||||
this.bb.writeFloat32(this.bb_pos + 0, value);
|
this.bb.writeFloat32(this.bb_pos + 0, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
y() {
|
y() {
|
||||||
return this.bb.readFloat32(this.bb_pos + 4);
|
return this.bb.readFloat32(this.bb_pos + 4);
|
||||||
}
|
}
|
||||||
mutate_y(value) {
|
mutate_y(value) {
|
||||||
this.bb.writeFloat32(this.bb_pos + 4, value);
|
this.bb.writeFloat32(this.bb_pos + 4, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
z() {
|
z() {
|
||||||
return this.bb.readFloat32(this.bb_pos + 8);
|
return this.bb.readFloat32(this.bb_pos + 8);
|
||||||
}
|
}
|
||||||
mutate_z(value) {
|
mutate_z(value) {
|
||||||
this.bb.writeFloat32(this.bb_pos + 8, value);
|
this.bb.writeFloat32(this.bb_pos + 8, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
test1() {
|
test1() {
|
||||||
return this.bb.readFloat64(this.bb_pos + 16);
|
return this.bb.readFloat64(this.bb_pos + 16);
|
||||||
}
|
}
|
||||||
mutate_test1(value) {
|
mutate_test1(value) {
|
||||||
this.bb.writeFloat64(this.bb_pos + 16, value);
|
this.bb.writeFloat64(this.bb_pos + 16, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
test2() {
|
test2() {
|
||||||
return this.bb.readUint8(this.bb_pos + 24);
|
return this.bb.readUint8(this.bb_pos + 24);
|
||||||
}
|
}
|
||||||
mutate_test2(value) {
|
mutate_test2(value) {
|
||||||
this.bb.writeUint8(this.bb_pos + 24, value);
|
this.bb.writeUint8(this.bb_pos + 24, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
test3(obj) {
|
test3(obj) {
|
||||||
return (obj || new Test()).__init(this.bb_pos + 26, this.bb);
|
return (obj || new Test()).__init(this.bb_pos + 26, this.bb);
|
||||||
}
|
}
|
||||||
static getFullyQualifiedName() {
|
static getFullyQualifiedName() {
|
||||||
return 'MyGame.Example.Vec3';
|
return 'MyGame.Example.Vec3';
|
||||||
}
|
}
|
||||||
static sizeOf() {
|
static sizeOf() {
|
||||||
return 32;
|
return 32;
|
||||||
}
|
}
|
||||||
static createVec3(builder, x, y, z, test1, test2, test3_a, test3_b) {
|
static createVec3(builder, x, y, z, test1, test2, test3_a, test3_b) {
|
||||||
builder.prep(8, 32);
|
builder.prep(8, 32);
|
||||||
builder.pad(2);
|
builder.pad(2);
|
||||||
builder.prep(2, 4);
|
builder.prep(2, 4);
|
||||||
builder.pad(1);
|
builder.pad(1);
|
||||||
builder.writeInt8(test3_b);
|
builder.writeInt8(test3_b);
|
||||||
builder.writeInt16(test3_a);
|
builder.writeInt16(test3_a);
|
||||||
builder.pad(1);
|
builder.pad(1);
|
||||||
builder.writeInt8(test2);
|
builder.writeInt8(test2);
|
||||||
builder.writeFloat64(test1);
|
builder.writeFloat64(test1);
|
||||||
builder.pad(4);
|
builder.pad(4);
|
||||||
builder.writeFloat32(z);
|
builder.writeFloat32(z);
|
||||||
builder.writeFloat32(y);
|
builder.writeFloat32(y);
|
||||||
builder.writeFloat32(x);
|
builder.writeFloat32(x);
|
||||||
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) {
|
||||||
}
|
_o.x = this.x();
|
||||||
unpackTo(_o) {
|
_o.y = this.y();
|
||||||
_o.x = this.x();
|
_o.z = this.z();
|
||||||
_o.y = this.y();
|
_o.test1 = this.test1();
|
||||||
_o.z = this.z();
|
_o.test2 = this.test2();
|
||||||
_o.test1 = this.test1();
|
_o.test3 = (this.test3() !== null ? this.test3().unpack() : null);
|
||||||
_o.test2 = this.test2();
|
}
|
||||||
_o.test3 = (this.test3() !== null ? this.test3().unpack() : null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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;
|
this.test1 = test1;
|
||||||
this.test1 = test1;
|
this.test2 = test2;
|
||||||
this.test2 = test2;
|
this.test3 = test3;
|
||||||
this.test3 = test3;
|
}
|
||||||
}
|
pack(builder) {
|
||||||
pack(builder) {
|
return Vec3.createVec3(builder, this.x, this.y, this.z, this.test1, this.test2, (this.test3?.a ?? 0), (this.test3?.b ?? 0));
|
||||||
return Vec3.createVec3(
|
}
|
||||||
builder, this.x, this.y, this.z, this.test1, this.test2,
|
|
||||||
(this.test3?.a ?? 0), (this.test3?.b ?? 0));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
2
tests/ts/my-game/example2.d.ts
vendored
2
tests/ts/my-game/example2.d.ts
vendored
@@ -1 +1 @@
|
|||||||
export {Monster, MonsterT} from './example2/monster.js';
|
export { Monster, MonsterT } from './example2/monster.js';
|
||||||
|
|||||||
@@ -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';
|
|
||||||
|
|||||||
37
tests/ts/my-game/example2/monster.d.ts
vendored
37
tests/ts/my-game/example2/monster.d.ts
vendored
@@ -1,25 +1,20 @@
|
|||||||
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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): Monster;
|
||||||
bb_pos: number;
|
static getRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): Monster;
|
static getSizePrefixedRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster;
|
||||||
static getRootAsMonster(bb: flatbuffers.ByteBuffer, obj?: Monster): Monster;
|
static getFullyQualifiedName(): "MyGame.Example2.Monster";
|
||||||
static getSizePrefixedRootAsMonster(
|
static startMonster(builder: flatbuffers.Builder): void;
|
||||||
bb: flatbuffers.ByteBuffer,
|
static endMonster(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
obj?: Monster,
|
static createMonster(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
): Monster;
|
serialize(): Uint8Array;
|
||||||
static getFullyQualifiedName(): string;
|
static deserialize(buffer: Uint8Array): Monster;
|
||||||
static startMonster(builder: flatbuffers.Builder): void;
|
unpack(): MonsterT;
|
||||||
static endMonster(builder: flatbuffers.Builder): flatbuffers.Offset;
|
unpackTo(_o: MonsterT): void;
|
||||||
static createMonster(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
serialize(): Uint8Array;
|
|
||||||
static deserialize(buffer: Uint8Array): Monster;
|
|
||||||
unpack(): MonsterT;
|
|
||||||
unpackTo(_o: MonsterT): void;
|
|
||||||
}
|
}
|
||||||
export declare class MonsterT implements flatbuffers.IGeneratedObject {
|
export declare class MonsterT implements flatbuffers.IGeneratedObject {
|
||||||
constructor();
|
constructor();
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,54 +1,51 @@
|
|||||||
// 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() {
|
||||||
this.bb = null;
|
this.bb = null;
|
||||||
this.bb_pos = 0;
|
this.bb_pos = 0;
|
||||||
}
|
}
|
||||||
__init(i, bb) {
|
__init(i, bb) {
|
||||||
this.bb_pos = i;
|
this.bb_pos = i;
|
||||||
this.bb = bb;
|
this.bb = bb;
|
||||||
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()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||||
return (obj || new Monster())
|
}
|
||||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
static getFullyQualifiedName() {
|
||||||
}
|
return 'MyGame.Example2.Monster';
|
||||||
static getFullyQualifiedName() {
|
}
|
||||||
return 'MyGame.Example2.Monster';
|
static startMonster(builder) {
|
||||||
}
|
builder.startObject(0);
|
||||||
static startMonster(builder) {
|
}
|
||||||
builder.startObject(0);
|
static endMonster(builder) {
|
||||||
}
|
const offset = builder.endObject();
|
||||||
static endMonster(builder) {
|
return offset;
|
||||||
const offset = builder.endObject();
|
}
|
||||||
return offset;
|
static createMonster(builder) {
|
||||||
}
|
Monster.startMonster(builder);
|
||||||
static createMonster(builder) {
|
return Monster.endMonster(builder);
|
||||||
Monster.startMonster(builder);
|
}
|
||||||
return Monster.endMonster(builder);
|
serialize() {
|
||||||
}
|
return this.bb.bytes();
|
||||||
serialize() {
|
}
|
||||||
return this.bb.bytes();
|
static deserialize(buffer) {
|
||||||
}
|
return Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer));
|
||||||
static deserialize(buffer) {
|
}
|
||||||
return Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer));
|
unpack() {
|
||||||
}
|
return new MonsterT();
|
||||||
unpack() {
|
}
|
||||||
return new MonsterT();
|
unpackTo(_o) { }
|
||||||
}
|
|
||||||
unpackTo(_o) {}
|
|
||||||
}
|
}
|
||||||
export class MonsterT {
|
export class MonsterT {
|
||||||
constructor() {}
|
constructor() { }
|
||||||
pack(builder) {
|
pack(builder) {
|
||||||
return Monster.createMonster(builder);
|
return Monster.createMonster(builder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
46
tests/ts/my-game/in-parent-namespace.d.ts
vendored
46
tests/ts/my-game/in-parent-namespace.d.ts
vendored
@@ -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_pos: number;
|
||||||
bb: flatbuffers.ByteBuffer | null;
|
__init(i: number, bb: flatbuffers.ByteBuffer): InParentNamespace;
|
||||||
bb_pos: number;
|
static getRootAsInParentNamespace(bb: flatbuffers.ByteBuffer, obj?: InParentNamespace): InParentNamespace;
|
||||||
__init(i: number, bb: flatbuffers.ByteBuffer): InParentNamespace;
|
static getSizePrefixedRootAsInParentNamespace(bb: flatbuffers.ByteBuffer, obj?: InParentNamespace): InParentNamespace;
|
||||||
static getRootAsInParentNamespace(
|
static getFullyQualifiedName(): "MyGame.InParentNamespace";
|
||||||
bb: flatbuffers.ByteBuffer,
|
static startInParentNamespace(builder: flatbuffers.Builder): void;
|
||||||
obj?: InParentNamespace,
|
static endInParentNamespace(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
): InParentNamespace;
|
static createInParentNamespace(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
static getSizePrefixedRootAsInParentNamespace(
|
serialize(): Uint8Array;
|
||||||
bb: flatbuffers.ByteBuffer,
|
static deserialize(buffer: Uint8Array): InParentNamespace;
|
||||||
obj?: InParentNamespace,
|
unpack(): InParentNamespaceT;
|
||||||
): InParentNamespace;
|
unpackTo(_o: InParentNamespaceT): void;
|
||||||
static getFullyQualifiedName(): string;
|
|
||||||
static startInParentNamespace(builder: flatbuffers.Builder): void;
|
|
||||||
static endInParentNamespace(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
static createInParentNamespace(
|
|
||||||
builder: flatbuffers.Builder,
|
|
||||||
): flatbuffers.Offset;
|
|
||||||
serialize(): Uint8Array;
|
|
||||||
static deserialize(buffer: Uint8Array): InParentNamespace;
|
|
||||||
unpack(): InParentNamespaceT;
|
|
||||||
unpackTo(_o: InParentNamespaceT): void;
|
|
||||||
}
|
}
|
||||||
export declare class InParentNamespaceT
|
export declare class InParentNamespaceT implements flatbuffers.IGeneratedObject {
|
||||||
implements flatbuffers.IGeneratedObject
|
constructor();
|
||||||
{
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||||
constructor();
|
|
||||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user