mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
TS: Add missing generate files (#8075)
Co-authored-by: Michael Le <michael.le647@gmail.com>
This commit is contained in:
@@ -387,7 +387,7 @@ var ArrayStructT = class {
|
||||
|
||||
// arrays_test_complex/my-game/example/array-table.js
|
||||
var flatbuffers = __toESM(require("flatbuffers"), 1);
|
||||
var ArrayTable = class {
|
||||
var ArrayTable = class _ArrayTable {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -398,11 +398,11 @@ var ArrayTable = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsArrayTable(bb, obj) {
|
||||
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 getSizePrefixedRootAsArrayTable(bb, obj) {
|
||||
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");
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { ArrayStruct, ArrayStructT } from './example/array-struct.js';
|
||||
export { ArrayTable, ArrayTableT } from './example/array-table.js';
|
||||
export { InnerStruct, InnerStructT } from './example/inner-struct.js';
|
||||
|
||||
@@ -1,5 +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 { ArrayStruct, ArrayStructT } from './example/array-struct.js';
|
||||
export { ArrayTable, ArrayTableT } from './example/array-table.js';
|
||||
export { InnerStruct, InnerStructT } from './example/inner-struct.js';
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { NestedStruct, NestedStructT } from '../../my-game/example/nested-struct.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { ArrayStruct } from '../../my-game/example/array-struct.js';
|
||||
export class ArrayTable {
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { ArrayStruct, ArrayStructT } from '../../my-game/example/array-struct.js';
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { OuterStruct, OuterStructT } from '../../my-game/example/outer-struct.js';
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { InnerStruct, InnerStructT } from '../../my-game/example/inner-struct.js';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// 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 var TestEnum;
|
||||
(function (TestEnum) {
|
||||
TestEnum[TestEnum["A"] = 0] = "A";
|
||||
TestEnum[TestEnum["B"] = 1] = "B";
|
||||
TestEnum[TestEnum["C"] = 2] = "C";
|
||||
})(TestEnum = TestEnum || (TestEnum = {}));
|
||||
})(TestEnum || (TestEnum = {}));
|
||||
|
||||
@@ -1,5 +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 enum TestEnum {
|
||||
A = 0,
|
||||
B = 1,
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
// 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 './foobar/abc.js';
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// 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 './foobar/abc.js';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// 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 var Abc;
|
||||
(function (Abc) {
|
||||
Abc[Abc["a"] = 0] = "a";
|
||||
})(Abc = Abc || (Abc = {}));
|
||||
})(Abc || (Abc = {}));
|
||||
|
||||
@@ -1,5 +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 enum Abc {
|
||||
a = 0
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// 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 var class_;
|
||||
(function (class_) {
|
||||
class_[class_["arguments_"] = 0] = "arguments_";
|
||||
})(class_ = class_ || (class_ = {}));
|
||||
})(class_ || (class_ = {}));
|
||||
|
||||
@@ -1,5 +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 enum class_ {
|
||||
arguments_ = 0
|
||||
}
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Abc } from '../foobar/abc.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// 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 { TableA, TableAT } from './table-a.js';
|
||||
export * as MyGame from './my-game.js';
|
||||
|
||||
@@ -41,7 +41,7 @@ var flatbuffers2 = __toESM(require("flatbuffers"), 1);
|
||||
|
||||
// my-game/other-name-space/table-b.js
|
||||
var flatbuffers = __toESM(require("flatbuffers"), 1);
|
||||
var TableB = class {
|
||||
var TableB = class _TableB {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -52,11 +52,11 @@ var TableB = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsTableB(bb, obj) {
|
||||
return (obj || new TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsTableB(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _TableB()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
a(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -76,15 +76,15 @@ var TableB = class {
|
||||
return offset;
|
||||
}
|
||||
static createTableB(builder, aOffset) {
|
||||
TableB.startTableB(builder);
|
||||
TableB.addA(builder, aOffset);
|
||||
return TableB.endTableB(builder);
|
||||
_TableB.startTableB(builder);
|
||||
_TableB.addA(builder, aOffset);
|
||||
return _TableB.endTableB(builder);
|
||||
}
|
||||
serialize() {
|
||||
return this.bb.bytes();
|
||||
}
|
||||
static deserialize(buffer) {
|
||||
return TableB.getRootAsTableB(new flatbuffers.ByteBuffer(buffer));
|
||||
return _TableB.getRootAsTableB(new flatbuffers.ByteBuffer(buffer));
|
||||
}
|
||||
unpack() {
|
||||
return new TableBT(this.a() !== null ? this.a().unpack() : null);
|
||||
@@ -104,7 +104,7 @@ var TableBT = class {
|
||||
};
|
||||
|
||||
// table-a.js
|
||||
var TableA = class {
|
||||
var TableA = class _TableA {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -115,11 +115,11 @@ var TableA = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsTableA(bb, obj) {
|
||||
return (obj || new TableA()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _TableA()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsTableA(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers2.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new TableA()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _TableA()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
b(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -139,15 +139,15 @@ var TableA = class {
|
||||
return offset;
|
||||
}
|
||||
static createTableA(builder, bOffset) {
|
||||
TableA.startTableA(builder);
|
||||
TableA.addB(builder, bOffset);
|
||||
return TableA.endTableA(builder);
|
||||
_TableA.startTableA(builder);
|
||||
_TableA.addB(builder, bOffset);
|
||||
return _TableA.endTableA(builder);
|
||||
}
|
||||
serialize() {
|
||||
return this.bb.bytes();
|
||||
}
|
||||
static deserialize(buffer) {
|
||||
return TableA.getRootAsTableA(new flatbuffers2.ByteBuffer(buffer));
|
||||
return _TableA.getRootAsTableA(new flatbuffers2.ByteBuffer(buffer));
|
||||
}
|
||||
unpack() {
|
||||
return new TableAT(this.b() !== null ? this.b().unpack() : null);
|
||||
@@ -178,7 +178,7 @@ __export(my_game_exports, {
|
||||
|
||||
// my-game/in-parent-namespace.js
|
||||
var flatbuffers3 = __toESM(require("flatbuffers"), 1);
|
||||
var InParentNamespace = class {
|
||||
var InParentNamespace = class _InParentNamespace {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -189,11 +189,11 @@ var InParentNamespace = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsInParentNamespace(bb, obj) {
|
||||
return (obj || new InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsInParentNamespace(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers3.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return "MyGame.InParentNamespace";
|
||||
@@ -206,14 +206,14 @@ var InParentNamespace = class {
|
||||
return offset;
|
||||
}
|
||||
static createInParentNamespace(builder) {
|
||||
InParentNamespace.startInParentNamespace(builder);
|
||||
return InParentNamespace.endInParentNamespace(builder);
|
||||
_InParentNamespace.startInParentNamespace(builder);
|
||||
return _InParentNamespace.endInParentNamespace(builder);
|
||||
}
|
||||
serialize() {
|
||||
return this.bb.bytes();
|
||||
}
|
||||
static deserialize(buffer) {
|
||||
return InParentNamespace.getRootAsInParentNamespace(new flatbuffers3.ByteBuffer(buffer));
|
||||
return _InParentNamespace.getRootAsInParentNamespace(new flatbuffers3.ByteBuffer(buffer));
|
||||
}
|
||||
unpack() {
|
||||
return new InParentNamespaceT();
|
||||
@@ -317,7 +317,7 @@ var AbilityT = class {
|
||||
|
||||
// my-game/example2/monster.js
|
||||
var flatbuffers4 = __toESM(require("flatbuffers"), 1);
|
||||
var Monster = class {
|
||||
var Monster = class _Monster {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -328,11 +328,11 @@ var Monster = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsMonster(bb, obj) {
|
||||
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 getSizePrefixedRootAsMonster(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers4.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";
|
||||
@@ -345,14 +345,14 @@ var Monster = class {
|
||||
return offset;
|
||||
}
|
||||
static createMonster(builder) {
|
||||
Monster.startMonster(builder);
|
||||
return Monster.endMonster(builder);
|
||||
_Monster.startMonster(builder);
|
||||
return _Monster.endMonster(builder);
|
||||
}
|
||||
serialize() {
|
||||
return this.bb.bytes();
|
||||
}
|
||||
static deserialize(buffer) {
|
||||
return Monster.getRootAsMonster(new flatbuffers4.ByteBuffer(buffer));
|
||||
return _Monster.getRootAsMonster(new flatbuffers4.ByteBuffer(buffer));
|
||||
}
|
||||
unpack() {
|
||||
return new MonsterT();
|
||||
@@ -406,7 +406,7 @@ var Color;
|
||||
})(Color = Color || (Color = {}));
|
||||
|
||||
// my-game/example/test-simple-table-with-enum.js
|
||||
var TestSimpleTableWithEnum = class {
|
||||
var TestSimpleTableWithEnum = class _TestSimpleTableWithEnum {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -417,11 +417,11 @@ var TestSimpleTableWithEnum = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsTestSimpleTableWithEnum(bb, obj) {
|
||||
return (obj || new TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsTestSimpleTableWithEnum(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers5.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);
|
||||
@@ -449,15 +449,15 @@ var TestSimpleTableWithEnum = class {
|
||||
return offset;
|
||||
}
|
||||
static createTestSimpleTableWithEnum(builder, color) {
|
||||
TestSimpleTableWithEnum.startTestSimpleTableWithEnum(builder);
|
||||
TestSimpleTableWithEnum.addColor(builder, color);
|
||||
return TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder);
|
||||
_TestSimpleTableWithEnum.startTestSimpleTableWithEnum(builder);
|
||||
_TestSimpleTableWithEnum.addColor(builder, color);
|
||||
return _TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder);
|
||||
}
|
||||
serialize() {
|
||||
return this.bb.bytes();
|
||||
}
|
||||
static deserialize(buffer) {
|
||||
return TestSimpleTableWithEnum.getRootAsTestSimpleTableWithEnum(new flatbuffers5.ByteBuffer(buffer));
|
||||
return _TestSimpleTableWithEnum.getRootAsTestSimpleTableWithEnum(new flatbuffers5.ByteBuffer(buffer));
|
||||
}
|
||||
unpack() {
|
||||
return new TestSimpleTableWithEnumT(this.color());
|
||||
@@ -509,7 +509,7 @@ var Race;
|
||||
|
||||
// my-game/example/referrable.js
|
||||
var flatbuffers6 = __toESM(require("flatbuffers"), 1);
|
||||
var Referrable = class {
|
||||
var Referrable = class _Referrable {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -520,11 +520,11 @@ var Referrable = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsReferrable(bb, obj) {
|
||||
return (obj || new Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsReferrable(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers6.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);
|
||||
@@ -552,15 +552,15 @@ var Referrable = class {
|
||||
return offset;
|
||||
}
|
||||
static createReferrable(builder, id) {
|
||||
Referrable.startReferrable(builder);
|
||||
Referrable.addId(builder, id);
|
||||
return Referrable.endReferrable(builder);
|
||||
_Referrable.startReferrable(builder);
|
||||
_Referrable.addId(builder, id);
|
||||
return _Referrable.endReferrable(builder);
|
||||
}
|
||||
serialize() {
|
||||
return this.bb.bytes();
|
||||
}
|
||||
static deserialize(buffer) {
|
||||
return Referrable.getRootAsReferrable(new flatbuffers6.ByteBuffer(buffer));
|
||||
return _Referrable.getRootAsReferrable(new flatbuffers6.ByteBuffer(buffer));
|
||||
}
|
||||
unpack() {
|
||||
return new ReferrableT(this.id());
|
||||
@@ -580,7 +580,7 @@ var ReferrableT = class {
|
||||
|
||||
// my-game/example/stat.js
|
||||
var flatbuffers7 = __toESM(require("flatbuffers"), 1);
|
||||
var Stat = class {
|
||||
var Stat = class _Stat {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -591,11 +591,11 @@ var Stat = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsStat(bb, obj) {
|
||||
return (obj || new Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsStat(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers7.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
id(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -645,17 +645,17 @@ var Stat = class {
|
||||
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);
|
||||
_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 flatbuffers7.ByteBuffer(buffer));
|
||||
return _Stat.getRootAsStat(new flatbuffers7.ByteBuffer(buffer));
|
||||
}
|
||||
unpack() {
|
||||
return new StatT(this.id(), this.val(), this.count());
|
||||
@@ -832,7 +832,7 @@ var Vec3T = class {
|
||||
};
|
||||
|
||||
// my-game/example/monster.js
|
||||
var Monster2 = class {
|
||||
var Monster2 = class _Monster {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -843,11 +843,11 @@ var Monster2 = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsMonster(bb, obj) {
|
||||
return (obj || new Monster2()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsMonster(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers8.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Monster2()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static bufferHasIdentifier(bb) {
|
||||
return bb.__has_identifier("MONS");
|
||||
@@ -938,7 +938,7 @@ var Monster2 = class {
|
||||
*/
|
||||
testarrayoftables(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 26);
|
||||
return offset ? (obj || new Monster2()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
return offset ? (obj || new _Monster()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
testarrayoftablesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 26);
|
||||
@@ -946,7 +946,7 @@ var Monster2 = class {
|
||||
}
|
||||
enemy(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 28);
|
||||
return offset ? (obj || new Monster2()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
return offset ? (obj || new _Monster()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
}
|
||||
testnestedflatbuffer(index) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 30);
|
||||
@@ -1823,7 +1823,7 @@ var Monster2 = class {
|
||||
return this.bb.bytes();
|
||||
}
|
||||
static deserialize(buffer) {
|
||||
return Monster2.getRootAsMonster(new flatbuffers8.ByteBuffer(buffer));
|
||||
return _Monster.getRootAsMonster(new flatbuffers8.ByteBuffer(buffer));
|
||||
}
|
||||
unpack() {
|
||||
return new MonsterT2(this.pos() !== null ? this.pos().unpack() : null, this.mana(), this.hp(), this.name(), this.bb.createScalarList(this.inventory.bind(this), this.inventoryLength()), this.color(), this.testType(), (() => {
|
||||
@@ -2230,7 +2230,7 @@ var StructOfStructsOfStructsT = class {
|
||||
|
||||
// my-game/example/type-aliases.js
|
||||
var flatbuffers9 = __toESM(require("flatbuffers"), 1);
|
||||
var TypeAliases = class {
|
||||
var TypeAliases = class _TypeAliases {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -2241,11 +2241,11 @@ var TypeAliases = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsTypeAliases(bb, obj) {
|
||||
return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsTypeAliases(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers9.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
i8() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -2458,26 +2458,26 @@ var TypeAliases = class {
|
||||
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);
|
||||
_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 flatbuffers9.ByteBuffer(buffer));
|
||||
return _TypeAliases.getRootAsTypeAliases(new flatbuffers9.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()));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { InParentNamespace, InParentNamespaceT } from './my-game/in-parent-namespace.js';
|
||||
export * as Example from './my-game/example.js';
|
||||
export * as Example2 from './my-game/example2.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { Ability, AbilityT } from './example/ability.js';
|
||||
export { Any } from './example/any.js';
|
||||
export { AnyAmbiguousAliases } from './example/any-ambiguous-aliases.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { Monster } from '../../my-game/example/monster.js';
|
||||
export var AnyAmbiguousAliases;
|
||||
(function (AnyAmbiguousAliases) {
|
||||
@@ -6,7 +7,7 @@ export var AnyAmbiguousAliases;
|
||||
AnyAmbiguousAliases[AnyAmbiguousAliases["M1"] = 1] = "M1";
|
||||
AnyAmbiguousAliases[AnyAmbiguousAliases["M2"] = 2] = "M2";
|
||||
AnyAmbiguousAliases[AnyAmbiguousAliases["M3"] = 3] = "M3";
|
||||
})(AnyAmbiguousAliases = AnyAmbiguousAliases || (AnyAmbiguousAliases = {}));
|
||||
})(AnyAmbiguousAliases || (AnyAmbiguousAliases = {}));
|
||||
export function unionToAnyAmbiguousAliases(type, accessor) {
|
||||
switch (AnyAmbiguousAliases[type]) {
|
||||
case 'NONE': return null;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { Monster as MyGame_Example2_Monster } from '../../my-game/example2/monster.js';
|
||||
import { Monster } from '../../my-game/example/monster.js';
|
||||
import { TestSimpleTableWithEnum } from '../../my-game/example/test-simple-table-with-enum.js';
|
||||
@@ -8,7 +9,7 @@ export var AnyUniqueAliases;
|
||||
AnyUniqueAliases[AnyUniqueAliases["M"] = 1] = "M";
|
||||
AnyUniqueAliases[AnyUniqueAliases["TS"] = 2] = "TS";
|
||||
AnyUniqueAliases[AnyUniqueAliases["M2"] = 3] = "M2";
|
||||
})(AnyUniqueAliases = AnyUniqueAliases || (AnyUniqueAliases = {}));
|
||||
})(AnyUniqueAliases || (AnyUniqueAliases = {}));
|
||||
export function unionToAnyUniqueAliases(type, accessor) {
|
||||
switch (AnyUniqueAliases[type]) {
|
||||
case 'NONE': return null;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { Monster as MyGame_Example2_Monster } from '../../my-game/example2/monster.js';
|
||||
import { Monster } from '../../my-game/example/monster.js';
|
||||
import { TestSimpleTableWithEnum } from '../../my-game/example/test-simple-table-with-enum.js';
|
||||
@@ -8,7 +9,7 @@ export var Any;
|
||||
Any[Any["Monster"] = 1] = "Monster";
|
||||
Any[Any["TestSimpleTableWithEnum"] = 2] = "TestSimpleTableWithEnum";
|
||||
Any[Any["MyGame_Example2_Monster"] = 3] = "MyGame_Example2_Monster";
|
||||
})(Any = Any || (Any = {}));
|
||||
})(Any || (Any = {}));
|
||||
export function unionToAny(type, accessor) {
|
||||
switch (Any[type]) {
|
||||
case 'NONE': return null;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 */
|
||||
/**
|
||||
* Composite components of Monster color.
|
||||
*/
|
||||
@@ -14,4 +15,4 @@ export var Color;
|
||||
* \brief color Blue (1u << 3)
|
||||
*/
|
||||
Color[Color["Blue"] = 8] = "Blue";
|
||||
})(Color = Color || (Color = {}));
|
||||
})(Color || (Color = {}));
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// 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 var LongEnum;
|
||||
(function (LongEnum) {
|
||||
LongEnum["LongOne"] = "2";
|
||||
LongEnum["LongTwo"] = "4";
|
||||
LongEnum["LongBig"] = "1099511627776";
|
||||
})(LongEnum = LongEnum || (LongEnum = {}));
|
||||
})(LongEnum || (LongEnum = {}));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { Ability } from '../../my-game/example/ability.js';
|
||||
import { Any, unionToAny } from '../../my-game/example/any.js';
|
||||
|
||||
@@ -1,8 +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 var Race;
|
||||
(function (Race) {
|
||||
Race[Race["None"] = -1] = "None";
|
||||
Race[Race["Human"] = 0] = "Human";
|
||||
Race[Race["Dwarf"] = 1] = "Dwarf";
|
||||
Race[Race["Elf"] = 2] = "Elf";
|
||||
})(Race = Race || (Race = {}));
|
||||
})(Race || (Race = {}));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 Referrable {
|
||||
constructor() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 Stat {
|
||||
constructor() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { Color } from '../../my-game/example/color.js';
|
||||
export class TestSimpleTableWithEnum {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 TypeAliases {
|
||||
constructor() {
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
// 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 { Monster, MonsterT } from './example2/monster.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 Monster {
|
||||
constructor() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 InParentNamespace {
|
||||
constructor() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { FromInclude } from './other-name-space/from-include.js';
|
||||
export { TableB, TableBT } from './other-name-space/table-b.js';
|
||||
export { Unused, UnusedT } from './other-name-space/unused.js';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// 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 var FromInclude;
|
||||
(function (FromInclude) {
|
||||
FromInclude["IncludeVal"] = "0";
|
||||
})(FromInclude = FromInclude || (FromInclude = {}));
|
||||
})(FromInclude || (FromInclude = {}));
|
||||
|
||||
@@ -1,5 +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 enum FromInclude {
|
||||
IncludeVal = '0'
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { TableA } from '../../table-a.js';
|
||||
export class TableB {
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { TableA, TableAT } from '../../table-a.js';
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// 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 { OptionalByte } from './optional-scalars/optional-byte';
|
||||
export { ScalarStuff } from './optional-scalars/scalar-stuff';
|
||||
|
||||
@@ -1,5 +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 enum OptionalByte {
|
||||
None = 0,
|
||||
One = 1,
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { OptionalByte } from '../optional-scalars/optional-byte';
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// 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 * as optional_scalars from './optional-scalars.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { AdvancedFeatures } from './reflection/advanced-features.js';
|
||||
export { BaseType } from './reflection/base-type.js';
|
||||
export { Enum, EnumT } from './reflection/enum.js';
|
||||
|
||||
@@ -1,5 +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 { AdvancedFeatures } from './reflection/advanced-features.js';
|
||||
export { BaseType } from './reflection/base-type.js';
|
||||
export { Enum, EnumT } from './reflection/enum.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 */
|
||||
/**
|
||||
* New schema language features that are not supported by old code generators.
|
||||
*/
|
||||
@@ -8,4 +9,4 @@ export var AdvancedFeatures;
|
||||
AdvancedFeatures["AdvancedUnionFeatures"] = "2";
|
||||
AdvancedFeatures["OptionalScalars"] = "4";
|
||||
AdvancedFeatures["DefaultVectorsAndStrings"] = "8";
|
||||
})(AdvancedFeatures = AdvancedFeatures || (AdvancedFeatures = {}));
|
||||
})(AdvancedFeatures || (AdvancedFeatures = {}));
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
/**
|
||||
* New schema language features that are not supported by old code generators.
|
||||
*/
|
||||
|
||||
3
tests/ts/reflection/base-type.d.ts
vendored
3
tests/ts/reflection/base-type.d.ts
vendored
@@ -17,5 +17,6 @@ export declare enum BaseType {
|
||||
Obj = 15,
|
||||
Union = 16,
|
||||
Array = 17,
|
||||
MaxBaseType = 18
|
||||
Vector64 = 18,
|
||||
MaxBaseType = 19
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 var BaseType;
|
||||
(function (BaseType) {
|
||||
BaseType[BaseType["None"] = 0] = "None";
|
||||
@@ -19,5 +20,6 @@ export var BaseType;
|
||||
BaseType[BaseType["Obj"] = 15] = "Obj";
|
||||
BaseType[BaseType["Union"] = 16] = "Union";
|
||||
BaseType[BaseType["Array"] = 17] = "Array";
|
||||
BaseType[BaseType["MaxBaseType"] = 18] = "MaxBaseType";
|
||||
})(BaseType = BaseType || (BaseType = {}));
|
||||
BaseType[BaseType["Vector64"] = 18] = "Vector64";
|
||||
BaseType[BaseType["MaxBaseType"] = 19] = "MaxBaseType";
|
||||
})(BaseType || (BaseType = {}));
|
||||
|
||||
@@ -1,5 +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 enum BaseType {
|
||||
None = 0,
|
||||
UType = 1,
|
||||
@@ -19,5 +21,6 @@ export enum BaseType {
|
||||
Obj = 15,
|
||||
Union = 16,
|
||||
Array = 17,
|
||||
MaxBaseType = 18
|
||||
Vector64 = 18,
|
||||
MaxBaseType = 19
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { KeyValue } from '../reflection/key-value.js';
|
||||
import { Type } from '../reflection/type.js';
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { EnumVal } from '../reflection/enum-val.js';
|
||||
import { KeyValue } from '../reflection/key-value.js';
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { EnumVal, EnumValT } from '../reflection/enum-val.js';
|
||||
|
||||
9
tests/ts/reflection/field.d.ts
vendored
9
tests/ts/reflection/field.d.ts
vendored
@@ -36,6 +36,11 @@ export declare class Field implements flatbuffers.IUnpackableObject<FieldT> {
|
||||
*/
|
||||
padding(): number;
|
||||
mutate_padding(value: number): boolean;
|
||||
/**
|
||||
* If the field uses 64-bit offsets.
|
||||
*/
|
||||
offset64(): boolean;
|
||||
mutate_offset64(value: boolean): boolean;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startField(builder: flatbuffers.Builder): void;
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
|
||||
@@ -55,6 +60,7 @@ export declare class Field implements flatbuffers.IUnpackableObject<FieldT> {
|
||||
static startDocumentationVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addOptional(builder: flatbuffers.Builder, optional: boolean): void;
|
||||
static addPadding(builder: flatbuffers.Builder, padding: number): void;
|
||||
static addOffset64(builder: flatbuffers.Builder, offset64: boolean): void;
|
||||
static endField(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
unpack(): FieldT;
|
||||
unpackTo(_o: FieldT): void;
|
||||
@@ -73,6 +79,7 @@ export declare class FieldT implements flatbuffers.IGeneratedObject {
|
||||
documentation: (string)[];
|
||||
optional: boolean;
|
||||
padding: number;
|
||||
constructor(name?: string | Uint8Array | null, type?: TypeT | null, id?: number, offset?: number, defaultInteger?: bigint, defaultReal?: number, deprecated?: boolean, required?: boolean, key?: boolean, attributes?: (KeyValueT)[], documentation?: (string)[], optional?: boolean, padding?: number);
|
||||
offset64: boolean;
|
||||
constructor(name?: string | Uint8Array | null, type?: TypeT | null, id?: number, offset?: number, defaultInteger?: bigint, defaultReal?: number, deprecated?: boolean, required?: boolean, key?: boolean, attributes?: (KeyValueT)[], documentation?: (string)[], optional?: boolean, padding?: number, offset64?: boolean);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { KeyValue } from '../reflection/key-value.js';
|
||||
import { Type } from '../reflection/type.js';
|
||||
@@ -154,11 +155,26 @@ export class Field {
|
||||
this.bb.writeUint16(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* If the field uses 64-bit offsets.
|
||||
*/
|
||||
offset64() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 30);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_offset64(value) {
|
||||
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() {
|
||||
return 'reflection.Field';
|
||||
}
|
||||
static startField(builder) {
|
||||
builder.startObject(13);
|
||||
builder.startObject(14);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
@@ -219,6 +235,9 @@ export class Field {
|
||||
static addPadding(builder, padding) {
|
||||
builder.addFieldInt16(12, padding, 0);
|
||||
}
|
||||
static addOffset64(builder, offset64) {
|
||||
builder.addFieldInt8(13, +offset64, +false);
|
||||
}
|
||||
static endField(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
@@ -226,7 +245,7 @@ export class Field {
|
||||
return offset;
|
||||
}
|
||||
unpack() {
|
||||
return new FieldT(this.name(), (this.type() !== null ? this.type().unpack() : null), this.id(), this.offset(), this.defaultInteger(), this.defaultReal(), this.deprecated(), this.required(), this.key(), this.bb.createObjList(this.attributes.bind(this), this.attributesLength()), this.bb.createScalarList(this.documentation.bind(this), this.documentationLength()), this.optional(), this.padding());
|
||||
return new FieldT(this.name(), (this.type() !== null ? this.type().unpack() : null), this.id(), this.offset(), this.defaultInteger(), this.defaultReal(), this.deprecated(), this.required(), this.key(), this.bb.createObjList(this.attributes.bind(this), this.attributesLength()), this.bb.createScalarList(this.documentation.bind(this), this.documentationLength()), this.optional(), this.padding(), this.offset64());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
@@ -242,10 +261,11 @@ export class Field {
|
||||
_o.documentation = this.bb.createScalarList(this.documentation.bind(this), this.documentationLength());
|
||||
_o.optional = this.optional();
|
||||
_o.padding = this.padding();
|
||||
_o.offset64 = this.offset64();
|
||||
}
|
||||
}
|
||||
export class FieldT {
|
||||
constructor(name = null, type = null, id = 0, offset = 0, defaultInteger = BigInt('0'), defaultReal = 0.0, deprecated = false, required = false, key = false, attributes = [], documentation = [], optional = false, padding = 0) {
|
||||
constructor(name = null, type = null, id = 0, offset = 0, defaultInteger = BigInt('0'), defaultReal = 0.0, deprecated = false, required = false, key = false, attributes = [], documentation = [], optional = false, padding = 0, offset64 = false) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.id = id;
|
||||
@@ -259,6 +279,7 @@ export class FieldT {
|
||||
this.documentation = documentation;
|
||||
this.optional = optional;
|
||||
this.padding = padding;
|
||||
this.offset64 = offset64;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
@@ -279,6 +300,7 @@ export class FieldT {
|
||||
Field.addDocumentation(builder, documentation);
|
||||
Field.addOptional(builder, this.optional);
|
||||
Field.addPadding(builder, this.padding);
|
||||
Field.addOffset64(builder, this.offset64);
|
||||
return Field.endField(builder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
@@ -205,12 +207,31 @@ mutate_padding(value:number):boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the field uses 64-bit offsets.
|
||||
*/
|
||||
offset64():boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 30);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
mutate_offset64(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():string {
|
||||
return 'reflection.Field';
|
||||
}
|
||||
|
||||
static startField(builder:flatbuffers.Builder) {
|
||||
builder.startObject(13);
|
||||
builder.startObject(14);
|
||||
}
|
||||
|
||||
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
|
||||
@@ -289,6 +310,10 @@ static addPadding(builder:flatbuffers.Builder, padding:number) {
|
||||
builder.addFieldInt16(12, padding, 0);
|
||||
}
|
||||
|
||||
static addOffset64(builder:flatbuffers.Builder, offset64:boolean) {
|
||||
builder.addFieldInt8(13, +offset64, +false);
|
||||
}
|
||||
|
||||
static endField(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // name
|
||||
@@ -311,7 +336,8 @@ unpack(): FieldT {
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
|
||||
this.optional(),
|
||||
this.padding()
|
||||
this.padding(),
|
||||
this.offset64()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -330,6 +356,7 @@ unpackTo(_o: FieldT): void {
|
||||
_o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
|
||||
_o.optional = this.optional();
|
||||
_o.padding = this.padding();
|
||||
_o.offset64 = this.offset64();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,7 +374,8 @@ constructor(
|
||||
public attributes: (KeyValueT)[] = [],
|
||||
public documentation: (string)[] = [],
|
||||
public optional: boolean = false,
|
||||
public padding: number = 0
|
||||
public padding: number = 0,
|
||||
public offset64: boolean = false
|
||||
){}
|
||||
|
||||
|
||||
@@ -371,6 +399,7 @@ pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
Field.addDocumentation(builder, documentation);
|
||||
Field.addOptional(builder, this.optional);
|
||||
Field.addPadding(builder, this.padding);
|
||||
Field.addOffset64(builder, this.offset64);
|
||||
|
||||
return Field.endField(builder);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 KeyValue {
|
||||
constructor() {
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { Field } from '../reflection/field.js';
|
||||
import { KeyValue } from '../reflection/key-value.js';
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Field, FieldT } from '../reflection/field.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { KeyValue } from '../reflection/key-value.js';
|
||||
import { Object_ } from '../reflection/object.js';
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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';
|
||||
/**
|
||||
* File specific information.
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { Enum } from '../reflection/enum.js';
|
||||
import { Object_ } from '../reflection/object.js';
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Enum, EnumT } from '../reflection/enum.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { KeyValue } from '../reflection/key-value.js';
|
||||
import { RPCCall } from '../reflection/rpccall.js';
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { BaseType } from '../reflection/base-type.js';
|
||||
export class Type {
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { BaseType } from '../reflection/base-type.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 { TableB } from './my-game/other-name-space/table-b.js';
|
||||
export class TableA {
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { TableB, TableBT } from './my-game/other-name-space/table-b.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// 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 { Object_ } from './typescript/object.js';
|
||||
export { class_ } from './typescript/class.js';
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// 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 { Object_ } from './typescript/object.js';
|
||||
export { class_ } from './typescript/class.js';
|
||||
|
||||
@@ -1,6 +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 var class_;
|
||||
(function (class_) {
|
||||
class_[class_["new_"] = 0] = "new_";
|
||||
class_[class_["instanceof_"] = 1] = "instanceof_";
|
||||
})(class_ = class_ || (class_ = {}));
|
||||
})(class_ || (class_ = {}));
|
||||
|
||||
@@ -1,5 +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 enum class_ {
|
||||
new_ = 0,
|
||||
instanceof_ = 1
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 '../foobar/abc.js';
|
||||
import { class_ as foobar_class_ } from '../foobar/class.js';
|
||||
|
||||
@@ -1,5 +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 */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Abc } from '../foobar/abc.js';
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// 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 * as foobar from './foobar.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// 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 * as foobar from './foobar.js';
|
||||
export * as reflection from './reflection.js';
|
||||
export * as typescript from './typescript.js';
|
||||
|
||||
@@ -1,5 +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 * as foobar from './foobar.js';
|
||||
export * as reflection from './reflection.js';
|
||||
export * as typescript from './typescript.js';
|
||||
|
||||
@@ -115,7 +115,7 @@ var flatbuffers3 = __toESM(require("flatbuffers"), 1);
|
||||
|
||||
// reflection/key-value.js
|
||||
var flatbuffers = __toESM(require("flatbuffers"), 1);
|
||||
var KeyValue = class {
|
||||
var KeyValue = class _KeyValue {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -126,11 +126,11 @@ var KeyValue = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsKeyValue(bb, obj) {
|
||||
return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsKeyValue(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
key(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -158,10 +158,10 @@ var KeyValue = class {
|
||||
return offset;
|
||||
}
|
||||
static createKeyValue(builder, keyOffset, valueOffset) {
|
||||
KeyValue.startKeyValue(builder);
|
||||
KeyValue.addKey(builder, keyOffset);
|
||||
KeyValue.addValue(builder, valueOffset);
|
||||
return KeyValue.endKeyValue(builder);
|
||||
_KeyValue.startKeyValue(builder);
|
||||
_KeyValue.addKey(builder, keyOffset);
|
||||
_KeyValue.addValue(builder, valueOffset);
|
||||
return _KeyValue.endKeyValue(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new KeyValueT(this.key(), this.value());
|
||||
@@ -185,7 +185,7 @@ var KeyValueT = class {
|
||||
|
||||
// reflection/type.js
|
||||
var flatbuffers2 = __toESM(require("flatbuffers"), 1);
|
||||
var Type = class {
|
||||
var Type = class _Type {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -196,11 +196,11 @@ var Type = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsType(bb, obj) {
|
||||
return (obj || new Type()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Type()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsType(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers2.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Type()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Type()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
baseType() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -309,14 +309,14 @@ var Type = class {
|
||||
return offset;
|
||||
}
|
||||
static createType(builder, baseType, element, index, fixedLength, baseSize, elementSize) {
|
||||
Type.startType(builder);
|
||||
Type.addBaseType(builder, baseType);
|
||||
Type.addElement(builder, element);
|
||||
Type.addIndex(builder, index);
|
||||
Type.addFixedLength(builder, fixedLength);
|
||||
Type.addBaseSize(builder, baseSize);
|
||||
Type.addElementSize(builder, elementSize);
|
||||
return Type.endType(builder);
|
||||
_Type.startType(builder);
|
||||
_Type.addBaseType(builder, baseType);
|
||||
_Type.addElement(builder, element);
|
||||
_Type.addIndex(builder, index);
|
||||
_Type.addFixedLength(builder, fixedLength);
|
||||
_Type.addBaseSize(builder, baseSize);
|
||||
_Type.addElementSize(builder, elementSize);
|
||||
return _Type.endType(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new TypeT(this.baseType(), this.element(), this.index(), this.fixedLength(), this.baseSize(), this.elementSize());
|
||||
@@ -345,7 +345,7 @@ var TypeT = class {
|
||||
};
|
||||
|
||||
// reflection/enum-val.js
|
||||
var EnumVal = class {
|
||||
var EnumVal = class _EnumVal {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -356,11 +356,11 @@ var EnumVal = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsEnumVal(bb, obj) {
|
||||
return (obj || new EnumVal()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _EnumVal()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsEnumVal(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers3.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new EnumVal()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _EnumVal()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -479,7 +479,7 @@ var EnumValT = class {
|
||||
};
|
||||
|
||||
// reflection/enum.js
|
||||
var Enum = class {
|
||||
var Enum = class _Enum {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -490,11 +490,11 @@ var Enum = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsEnum(bb, obj) {
|
||||
return (obj || new Enum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Enum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsEnum(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers4.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Enum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Enum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -652,7 +652,7 @@ var EnumT = class {
|
||||
|
||||
// reflection/field.js
|
||||
var flatbuffers5 = __toESM(require("flatbuffers"), 1);
|
||||
var Field = class {
|
||||
var Field = class _Field {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -663,11 +663,11 @@ var Field = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsField(bb, obj) {
|
||||
return (obj || new Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsField(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers5.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -935,7 +935,7 @@ var FieldT = class {
|
||||
|
||||
// reflection/object.js
|
||||
var flatbuffers6 = __toESM(require("flatbuffers"), 1);
|
||||
var Object_ = class {
|
||||
var Object_ = class _Object_ {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -946,11 +946,11 @@ var Object_ = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsObject(bb, obj) {
|
||||
return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsObject(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers6.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -1087,16 +1087,16 @@ var Object_ = class {
|
||||
return offset;
|
||||
}
|
||||
static createObject(builder, nameOffset, fieldsOffset, isStruct, minalign, bytesize, attributesOffset, documentationOffset, declarationFileOffset) {
|
||||
Object_.startObject(builder);
|
||||
Object_.addName(builder, nameOffset);
|
||||
Object_.addFields(builder, fieldsOffset);
|
||||
Object_.addIsStruct(builder, isStruct);
|
||||
Object_.addMinalign(builder, minalign);
|
||||
Object_.addBytesize(builder, bytesize);
|
||||
Object_.addAttributes(builder, attributesOffset);
|
||||
Object_.addDocumentation(builder, documentationOffset);
|
||||
Object_.addDeclarationFile(builder, declarationFileOffset);
|
||||
return Object_.endObject(builder);
|
||||
_Object_.startObject(builder);
|
||||
_Object_.addName(builder, nameOffset);
|
||||
_Object_.addFields(builder, fieldsOffset);
|
||||
_Object_.addIsStruct(builder, isStruct);
|
||||
_Object_.addMinalign(builder, minalign);
|
||||
_Object_.addBytesize(builder, bytesize);
|
||||
_Object_.addAttributes(builder, attributesOffset);
|
||||
_Object_.addDocumentation(builder, documentationOffset);
|
||||
_Object_.addDeclarationFile(builder, declarationFileOffset);
|
||||
return _Object_.endObject(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new Object_T(this.name(), this.bb.createObjList(this.fields.bind(this), this.fieldsLength()), this.isStruct(), this.minalign(), this.bytesize(), this.bb.createObjList(this.attributes.bind(this), this.attributesLength()), this.bb.createScalarList(this.documentation.bind(this), this.documentationLength()), this.declarationFile());
|
||||
@@ -1135,7 +1135,7 @@ var Object_T = class {
|
||||
|
||||
// reflection/rpccall.js
|
||||
var flatbuffers7 = __toESM(require("flatbuffers"), 1);
|
||||
var RPCCall = class {
|
||||
var RPCCall = class _RPCCall {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -1146,11 +1146,11 @@ var RPCCall = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsRPCCall(bb, obj) {
|
||||
return (obj || new RPCCall()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _RPCCall()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsRPCCall(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers7.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new RPCCall()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _RPCCall()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -1268,7 +1268,7 @@ var flatbuffers10 = __toESM(require("flatbuffers"), 1);
|
||||
|
||||
// reflection/schema-file.js
|
||||
var flatbuffers8 = __toESM(require("flatbuffers"), 1);
|
||||
var SchemaFile = class {
|
||||
var SchemaFile = class _SchemaFile {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -1279,11 +1279,11 @@ var SchemaFile = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsSchemaFile(bb, obj) {
|
||||
return (obj || new SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsSchemaFile(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers8.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
filename(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -1325,10 +1325,10 @@ var SchemaFile = class {
|
||||
return offset;
|
||||
}
|
||||
static createSchemaFile(builder, filenameOffset, includedFilenamesOffset) {
|
||||
SchemaFile.startSchemaFile(builder);
|
||||
SchemaFile.addFilename(builder, filenameOffset);
|
||||
SchemaFile.addIncludedFilenames(builder, includedFilenamesOffset);
|
||||
return SchemaFile.endSchemaFile(builder);
|
||||
_SchemaFile.startSchemaFile(builder);
|
||||
_SchemaFile.addFilename(builder, filenameOffset);
|
||||
_SchemaFile.addIncludedFilenames(builder, includedFilenamesOffset);
|
||||
return _SchemaFile.endSchemaFile(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new SchemaFileT(this.filename(), this.bb.createScalarList(this.includedFilenames.bind(this), this.includedFilenamesLength()));
|
||||
@@ -1352,7 +1352,7 @@ var SchemaFileT = class {
|
||||
|
||||
// reflection/service.js
|
||||
var flatbuffers9 = __toESM(require("flatbuffers"), 1);
|
||||
var Service = class {
|
||||
var Service = class _Service {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -1363,11 +1363,11 @@ var Service = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsService(bb, obj) {
|
||||
return (obj || new Service()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Service()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsService(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers9.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Service()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Service()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -1458,13 +1458,13 @@ var Service = class {
|
||||
return offset;
|
||||
}
|
||||
static createService(builder, nameOffset, callsOffset, attributesOffset, documentationOffset, declarationFileOffset) {
|
||||
Service.startService(builder);
|
||||
Service.addName(builder, nameOffset);
|
||||
Service.addCalls(builder, callsOffset);
|
||||
Service.addAttributes(builder, attributesOffset);
|
||||
Service.addDocumentation(builder, documentationOffset);
|
||||
Service.addDeclarationFile(builder, declarationFileOffset);
|
||||
return Service.endService(builder);
|
||||
_Service.startService(builder);
|
||||
_Service.addName(builder, nameOffset);
|
||||
_Service.addCalls(builder, callsOffset);
|
||||
_Service.addAttributes(builder, attributesOffset);
|
||||
_Service.addDocumentation(builder, documentationOffset);
|
||||
_Service.addDeclarationFile(builder, declarationFileOffset);
|
||||
return _Service.endService(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new ServiceT(this.name(), this.bb.createObjList(this.calls.bind(this), this.callsLength()), this.bb.createObjList(this.attributes.bind(this), this.attributesLength()), this.bb.createScalarList(this.documentation.bind(this), this.documentationLength()), this.declarationFile());
|
||||
@@ -1496,7 +1496,7 @@ var ServiceT = class {
|
||||
};
|
||||
|
||||
// reflection/schema.js
|
||||
var Schema = class {
|
||||
var Schema = class _Schema {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -1507,11 +1507,11 @@ var Schema = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsSchema(bb, obj) {
|
||||
return (obj || new Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsSchema(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers10.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static bufferHasIdentifier(bb) {
|
||||
return bb.__has_identifier("BFBS");
|
||||
@@ -1728,7 +1728,7 @@ var class_2;
|
||||
})(class_2 = class_2 || (class_2 = {}));
|
||||
|
||||
// typescript/object.js
|
||||
var Object_2 = class {
|
||||
var Object_2 = class _Object_ {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -1739,11 +1739,11 @@ var Object_2 = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsObject(bb, obj) {
|
||||
return (obj || new Object_2()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsObject(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers11.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Object_2()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
return_() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// 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 * as foobar from './foobar.js';
|
||||
|
||||
5
tests/ts/union-underlying-type.d.ts
vendored
Normal file
5
tests/ts/union-underlying-type.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { A, AT } from './union-underlying-type/a.js';
|
||||
export { ABC } from './union-underlying-type/abc.js';
|
||||
export { B, BT } from './union-underlying-type/b.js';
|
||||
export { C, CT } from './union-underlying-type/c.js';
|
||||
export { D, DT } from './union-underlying-type/d.js';
|
||||
7
tests/ts/union-underlying-type.js
Normal file
7
tests/ts/union-underlying-type.js
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 { A, AT } from './union-underlying-type/a.js';
|
||||
export { ABC } from './union-underlying-type/abc.js';
|
||||
export { B, BT } from './union-underlying-type/b.js';
|
||||
export { C, CT } from './union-underlying-type/c.js';
|
||||
export { D, DT } from './union-underlying-type/d.js';
|
||||
9
tests/ts/union-underlying-type.ts
Normal file
9
tests/ts/union-underlying-type.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 { A, AT } from './union-underlying-type/a.js';
|
||||
export { ABC } from './union-underlying-type/abc.js';
|
||||
export { B, BT } from './union-underlying-type/b.js';
|
||||
export { C, CT } from './union-underlying-type/c.js';
|
||||
export { D, DT } from './union-underlying-type/d.js';
|
||||
22
tests/ts/union-underlying-type/a.d.ts
vendored
Normal file
22
tests/ts/union-underlying-type/a.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export declare class A implements flatbuffers.IUnpackableObject<AT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): A;
|
||||
static getRootAsA(bb: flatbuffers.ByteBuffer, obj?: A): A;
|
||||
static getSizePrefixedRootAsA(bb: flatbuffers.ByteBuffer, obj?: A): A;
|
||||
a(): number;
|
||||
mutate_a(value: number): boolean;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startA(builder: flatbuffers.Builder): void;
|
||||
static addA(builder: flatbuffers.Builder, a: number): void;
|
||||
static endA(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createA(builder: flatbuffers.Builder, a: number): flatbuffers.Offset;
|
||||
unpack(): AT;
|
||||
unpackTo(_o: AT): void;
|
||||
}
|
||||
export declare class AT implements flatbuffers.IGeneratedObject {
|
||||
a: number;
|
||||
constructor(a?: number);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
65
tests/ts/union-underlying-type/a.js
Normal file
65
tests/ts/union-underlying-type/a.js
Normal file
@@ -0,0 +1,65 @@
|
||||
// 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 A {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsA(bb, obj) {
|
||||
return (obj || new A()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsA(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new A()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
a() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_a(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'UnionUnderlyingType.A';
|
||||
}
|
||||
static startA(builder) {
|
||||
builder.startObject(1);
|
||||
}
|
||||
static addA(builder, a) {
|
||||
builder.addFieldInt32(0, a, 0);
|
||||
}
|
||||
static endA(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static createA(builder, a) {
|
||||
A.startA(builder);
|
||||
A.addA(builder, a);
|
||||
return A.endA(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new AT(this.a());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.a = this.a();
|
||||
}
|
||||
}
|
||||
export class AT {
|
||||
constructor(a = 0) {
|
||||
this.a = a;
|
||||
}
|
||||
pack(builder) {
|
||||
return A.createA(builder, this.a);
|
||||
}
|
||||
}
|
||||
89
tests/ts/union-underlying-type/a.ts
Normal file
89
tests/ts/union-underlying-type/a.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
// 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 A implements flatbuffers.IUnpackableObject<AT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):A {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsA(bb:flatbuffers.ByteBuffer, obj?:A):A {
|
||||
return (obj || new A()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsA(bb:flatbuffers.ByteBuffer, obj?:A):A {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new A()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
a():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_a(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'UnionUnderlyingType.A';
|
||||
}
|
||||
|
||||
static startA(builder:flatbuffers.Builder) {
|
||||
builder.startObject(1);
|
||||
}
|
||||
|
||||
static addA(builder:flatbuffers.Builder, a:number) {
|
||||
builder.addFieldInt32(0, a, 0);
|
||||
}
|
||||
|
||||
static endA(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createA(builder:flatbuffers.Builder, a:number):flatbuffers.Offset {
|
||||
A.startA(builder);
|
||||
A.addA(builder, a);
|
||||
return A.endA(builder);
|
||||
}
|
||||
|
||||
unpack(): AT {
|
||||
return new AT(
|
||||
this.a()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: AT): void {
|
||||
_o.a = this.a();
|
||||
}
|
||||
}
|
||||
|
||||
export class AT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public a: number = 0
|
||||
){}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
return A.createA(builder,
|
||||
this.a
|
||||
);
|
||||
}
|
||||
}
|
||||
11
tests/ts/union-underlying-type/abc.d.ts
vendored
Normal file
11
tests/ts/union-underlying-type/abc.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { A } from '../union-underlying-type/a.js';
|
||||
import { B } from '../union-underlying-type/b.js';
|
||||
import { C } from '../union-underlying-type/c.js';
|
||||
export declare enum ABC {
|
||||
NONE = 0,
|
||||
A = 555,
|
||||
B = 666,
|
||||
C = 777
|
||||
}
|
||||
export declare function unionToAbc(type: ABC, accessor: (obj: A | B | C) => A | B | C | null): A | B | C | null;
|
||||
export declare function unionListToAbc(type: ABC, accessor: (index: number, obj: A | B | C) => A | B | C | null, index: number): A | B | C | null;
|
||||
30
tests/ts/union-underlying-type/abc.js
Normal file
30
tests/ts/union-underlying-type/abc.js
Normal file
@@ -0,0 +1,30 @@
|
||||
// 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 { A } from '../union-underlying-type/a.js';
|
||||
import { B } from '../union-underlying-type/b.js';
|
||||
import { C } from '../union-underlying-type/c.js';
|
||||
export var ABC;
|
||||
(function (ABC) {
|
||||
ABC[ABC["NONE"] = 0] = "NONE";
|
||||
ABC[ABC["A"] = 555] = "A";
|
||||
ABC[ABC["B"] = 666] = "B";
|
||||
ABC[ABC["C"] = 777] = "C";
|
||||
})(ABC || (ABC = {}));
|
||||
export function unionToAbc(type, accessor) {
|
||||
switch (ABC[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'A': return accessor(new A());
|
||||
case 'B': return accessor(new B());
|
||||
case 'C': return accessor(new C());
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
export function unionListToAbc(type, accessor, index) {
|
||||
switch (ABC[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'A': return accessor(index, new A());
|
||||
case 'B': return accessor(index, new B());
|
||||
case 'C': return accessor(index, new C());
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
42
tests/ts/union-underlying-type/abc.ts
Normal file
42
tests/ts/union-underlying-type/abc.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
// 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 { A, AT } from '../union-underlying-type/a.js';
|
||||
import { B, BT } from '../union-underlying-type/b.js';
|
||||
import { C, CT } from '../union-underlying-type/c.js';
|
||||
|
||||
|
||||
export enum ABC {
|
||||
NONE = 0,
|
||||
A = 555,
|
||||
B = 666,
|
||||
C = 777
|
||||
}
|
||||
|
||||
export function unionToAbc(
|
||||
type: ABC,
|
||||
accessor: (obj:A|B|C) => A|B|C|null
|
||||
): A|B|C|null {
|
||||
switch(ABC[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'A': return accessor(new A())! as A;
|
||||
case 'B': return accessor(new B())! as B;
|
||||
case 'C': return accessor(new C())! as C;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function unionListToAbc(
|
||||
type: ABC,
|
||||
accessor: (index: number, obj:A|B|C) => A|B|C|null,
|
||||
index: number
|
||||
): A|B|C|null {
|
||||
switch(ABC[type]) {
|
||||
case 'NONE': return null;
|
||||
case 'A': return accessor(index, new A())! as A;
|
||||
case 'B': return accessor(index, new B())! as B;
|
||||
case 'C': return accessor(index, new C())! as C;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
22
tests/ts/union-underlying-type/b.d.ts
vendored
Normal file
22
tests/ts/union-underlying-type/b.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export declare class B implements flatbuffers.IUnpackableObject<BT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): B;
|
||||
static getRootAsB(bb: flatbuffers.ByteBuffer, obj?: B): B;
|
||||
static getSizePrefixedRootAsB(bb: flatbuffers.ByteBuffer, obj?: B): B;
|
||||
b(): string | null;
|
||||
b(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startB(builder: flatbuffers.Builder): void;
|
||||
static addB(builder: flatbuffers.Builder, bOffset: flatbuffers.Offset): void;
|
||||
static endB(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createB(builder: flatbuffers.Builder, bOffset: flatbuffers.Offset): flatbuffers.Offset;
|
||||
unpack(): BT;
|
||||
unpackTo(_o: BT): void;
|
||||
}
|
||||
export declare class BT implements flatbuffers.IGeneratedObject {
|
||||
b: string | Uint8Array | null;
|
||||
constructor(b?: string | Uint8Array | null);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
58
tests/ts/union-underlying-type/b.js
Normal file
58
tests/ts/union-underlying-type/b.js
Normal file
@@ -0,0 +1,58 @@
|
||||
// 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 B {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsB(bb, obj) {
|
||||
return (obj || new B()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsB(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new B()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
b(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'UnionUnderlyingType.B';
|
||||
}
|
||||
static startB(builder) {
|
||||
builder.startObject(1);
|
||||
}
|
||||
static addB(builder, bOffset) {
|
||||
builder.addFieldOffset(0, bOffset, 0);
|
||||
}
|
||||
static endB(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static createB(builder, bOffset) {
|
||||
B.startB(builder);
|
||||
B.addB(builder, bOffset);
|
||||
return B.endB(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new BT(this.b());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.b = this.b();
|
||||
}
|
||||
}
|
||||
export class BT {
|
||||
constructor(b = null) {
|
||||
this.b = b;
|
||||
}
|
||||
pack(builder) {
|
||||
const b = (this.b !== null ? builder.createString(this.b) : 0);
|
||||
return B.createB(builder, b);
|
||||
}
|
||||
}
|
||||
82
tests/ts/union-underlying-type/b.ts
Normal file
82
tests/ts/union-underlying-type/b.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
// 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 B implements flatbuffers.IUnpackableObject<BT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):B {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsB(bb:flatbuffers.ByteBuffer, obj?:B):B {
|
||||
return (obj || new B()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsB(bb:flatbuffers.ByteBuffer, obj?:B):B {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new B()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
b():string|null
|
||||
b(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
b(optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'UnionUnderlyingType.B';
|
||||
}
|
||||
|
||||
static startB(builder:flatbuffers.Builder) {
|
||||
builder.startObject(1);
|
||||
}
|
||||
|
||||
static addB(builder:flatbuffers.Builder, bOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, bOffset, 0);
|
||||
}
|
||||
|
||||
static endB(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createB(builder:flatbuffers.Builder, bOffset:flatbuffers.Offset):flatbuffers.Offset {
|
||||
B.startB(builder);
|
||||
B.addB(builder, bOffset);
|
||||
return B.endB(builder);
|
||||
}
|
||||
|
||||
unpack(): BT {
|
||||
return new BT(
|
||||
this.b()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: BT): void {
|
||||
_o.b = this.b();
|
||||
}
|
||||
}
|
||||
|
||||
export class BT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public b: string|Uint8Array|null = null
|
||||
){}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const b = (this.b !== null ? builder.createString(this.b!) : 0);
|
||||
|
||||
return B.createB(builder,
|
||||
b
|
||||
);
|
||||
}
|
||||
}
|
||||
22
tests/ts/union-underlying-type/c.d.ts
vendored
Normal file
22
tests/ts/union-underlying-type/c.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export declare class C implements flatbuffers.IUnpackableObject<CT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): C;
|
||||
static getRootAsC(bb: flatbuffers.ByteBuffer, obj?: C): C;
|
||||
static getSizePrefixedRootAsC(bb: flatbuffers.ByteBuffer, obj?: C): C;
|
||||
c(): boolean;
|
||||
mutate_c(value: boolean): boolean;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startC(builder: flatbuffers.Builder): void;
|
||||
static addC(builder: flatbuffers.Builder, c: boolean): void;
|
||||
static endC(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createC(builder: flatbuffers.Builder, c: boolean): flatbuffers.Offset;
|
||||
unpack(): CT;
|
||||
unpackTo(_o: CT): void;
|
||||
}
|
||||
export declare class CT implements flatbuffers.IGeneratedObject {
|
||||
c: boolean;
|
||||
constructor(c?: boolean);
|
||||
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