Squashed 'third_party/flatbuffers/' changes from e5f331db9..bc44fad35

bc44fad35 UnPackTo disable merge by default (#7527)
4fca4dc60 [TS/JS] Move TS tests to dedicated folder and deps upgrade (#7508)
036032373 Bump junit from 4.13 to 4.13.1 in /java (#7526)
89dfb43f3 Replace `bash JavaTest.sh` with `mvn test` (#7500)
c49aff4b6 enabled cpp17 tests in CI (#7524)
56e60223c prevent force_align attribute on enums (#7523)
89b1f5aa1 remove travis config (#7522)
b90159823 [Java][Flexbuffers] Add API to add nullables into the buffer. (#7521)
8cdc6a288 Install BuildFlatBuffers.cmake (#7519)
a67e35aff Moves all of the swift test code into tests/swift (#7509)
f124e41ae Updated Readme
4c954181c [Java][FlexBuffers] throwing exception for untyped fixed vectors (#7507)
7f7547737 [Android] Remove maven dependency of flatbuffers and use source folder (#7503)
a79d61ea8 Fixes issue with cocoapods failing to be published because of docc (#7505)
d465b39c3 [CMake]: fix breaking find_package change (#7499) (#7502)
c5a609dc2 [C#] Prepares for official Nuget release (#7496)
5634dc3d0 [ISSUE-6268] returns NaN insteadof nan (#7498)
37e37b8ca Updates cocoapods version (#7497)
8fd4534fb update android multidex setting (#7495)
d5427da52 Disable Android Build (#7494)
06c5c7ed0 FlatBuffers Version 2.0.8 (#7492)
b190ce11b Verifier Refinements (#7490)
bf5d23230 Namer applied to Typescript generator (#7488)
ce382d6dd [TS/JS] Add rollup and config to generate iife flatbuffers bundle (#7449)
41d9add7e C++: Add option to skip verifying nested flatbuffers (#7489)
6a8742754 [C++] support native_inline attribute for vector of tables (#7479)
694add668 Refactor test.cpp (#7487)
7edf8c908 Update scorecard to 1.1.2
b86387442 Fix typos (#7483)
e2eb5ee67 Include <array> head in stl_emulation.h (#7480)
994502b6d Version number in file package.json updated to 2.0.7 (#7476)
fa41e8367 [C++] Fixed crash when copying table with empty shared strings (#7477)
799cc8f7b Use type traits for specialization (#7475)
b7eb44147 Disable RTTI and rework use in idl_gen_ts.cpp (#7474)
8d01c5859 CMake project version detection made more robust (#7473)
237e8b71f Moved compiler warnings around (#7471)
eeb8fd60d Include builder.addOffset for vector of structs (#7470)
fef2ffc4d Use schema include name for keep-prefix (#7469)
8367664f1 Flatbuffers Version 2.0.7 (#7462)
d6f06c33f Reworked keep prefix (#7456)
627e8bf36 update grpc version (#7457)
883c42b7d disabling unpackto optimization (#7459)
7aae0af30 Remove old GRPC bash script and convert to python3 (#7454)
b057aa917 Grouped anonymous namespaces together, (#7455)
f1b26ff7f Change to GetTypeName (#7453)
9610a666b Generate SLSA signatures for Released zip files (#7450)
1e0f75a64 [WIP] speedup (#7452)
82b75407a Wrap types in namespace for --ts-flat-files and --gen-all (#7451)
f7c511957 Audit and fixups for GCC and Clang (#7212)
a66de58af Partial support for --ts-flat-files and --gen-all (#7446)
a3508f36d [Kotlin] Make sure namespace path exist for code generation (#7357)
137fec716 Stop using __has_trivial_copy on recent clang versions. (#7443)
214125e41 [C#] Rework how sorted vectors are looked up (#7441)
44a7dc999 Define minimum buffer size (#7440)
3cc2daa78 make_span overloads for pointer to vector (#7374) (#7435)
fa1174aa7 [TypeScript] Fix namespaceless schema generation (#7432)
83d4e2a10 Add checks to verifier (#7438)
8a09f3fb0 Fix FlexBuffers JS/TS bug https://github.com/google/flatbuffers/issues/6934 (#7434)
9dbe819ef Add flatc python tests to CI (#7437)
67c414958 Update TypeScriptTest.py to work better cross platform (#7436)
8b8c7dbdf Update gitingore to reflect name change (#7431)
2ee20a5f3 Remove auto including locale functions (#7430)
4be605604 [C++] Set StructDef::has_key property when deserializing from binary schema (#7386) (#7428)
fc5d86f1e [C++] Make template parameter in stl_emulation.h more explicit to avoid conflicts with cpprestsdk U macro (#7424)
9dce287ad Issue#6959 :Updated Automatically generated rust files. (#7425)
7798be3bb avoid zero-as-null-pointer warning (#7423)
966362e07 [C++] Vector of Tables equality (#7415)
a89c279ed [golang] Perform keyword escaping after case conversion (#7421)
a212b3c03 Turn of fail fast for C++ CI
9230f600d Remove stringop-overflow from error (#7422)
c79362156 [golang] Add support for text parsing with json struct tags (#7353)
ee2ced236 Moved TypeScriptTests to python script (#7411)
468c00a3f Rebased: grpc/compiler: Respect filename suffix and extension during code generation (#7414)
47c757f71 Add tests for flatc (#7405)
9a5ff8900 Add FLATBUFFERS_STRICT_MODE (#7408)
950444a34 [TS] Use TextEncoder and TextDecoder (#7400)
30d76198c Compilation issue msys2 #7399 (#7409)
cce3a66f0 Delete .travis directory
8d1cc6ac7 Revert "Compilation issue msys2 (#7403)" (#7407)
5b207639a Update readme.md
359e0f9d6 Revert "grpc/compiler: Respect filename suffix and extension during code generation (#7343)" (#7406)
ebbed0513 Delete cpp-linter.yml
aa395e5a5 (#7323) Rename CMake files according to project name (#7378)
32328075d Fix error msg format when generate GRPC failed (#7350)
97e89c5ac grpc/compiler: Respect filename suffix and extension during code generation (#7343)
5f6672be4 Fix Clang-Cl compile on Windows (#7308)
28e858c85 [TS/Bazel] Minor improvements to typescript.bzl (#7300)
987bebe67 [TS] fix incorrect reverse when writting array of structs (#7271)
ec0129369 Fix FlexBuffers Verifier tracking vectors reuse at wrong offset
50dd385b3 Add missing const (#7401)
da702cfd8 Compilation issue msys2 (#7403)
6e2791640 keep-prefix keeps relative pathing (#7394)
52fce5e53 fix(#7360): grpc used deprecated functions (#7361)
b7f13cd8e cpp_generator: comment out unused parameter to avoid warnings (#7381)
e42985e5a Updated Newtonsoft.Json to 13.0.1 (#7393)
0a8064637 Fix references to LICENSE file (#7377)
b9eea76a8 [Dart] Implement putBool to fix errors when serializing structs with bools (#7359)
1b9030015 Bump Newtonsoft.Json from 12.0.3 to 13.0.1 in /tests/FlatBuffers.Test (#7363)
83a43fc79 Reenable optional json (#7352)
5f0137602 Only include direct included filed (#7348)
9a1913a87 Revert "Implement optional scalars for JSON (#7322)" (#7351)
b4647beb8 Revert "Move reflection_ts_fbs into a separate directory (#7342)" (#7349)
d6060977a Remove asserting in verifier for flattests
987aa5b5e move -Wextra-semi to GCC 8.0+
42acdb63c [TS] Don't generate self-imports with --ts-flat-file (#7340)
0cc1aeb8c [golang] Create missing namespace directory structure (#7324) (#7325)
ba6c67170 [Kotlin] Remove download benchmark files dependency (#7314)
d2f33fc45 Disable Android on Linux CI build
0d1b72cbc [TS] fix ts import path issue (#7298)
9fce2fbf2 replace io/ioutil to os (#7281)
a18ea40d6 Implement optional scalars for JSON (#7322)
090caa280 Move reflection_ts_fbs into a separate directory (#7342)
49e1ea333 Implement optional scalars for Python (#7318)
11a198870 Started implementation for private flags in rust (#7269)
967df08b1 Adds full supposed for Wasm in the swift lib (#7328)
9aa08a429 Use keep case for Rust union discriminant type. (#7321)
9e8c758f5 Add explicit return types to lobster generated code (#7312)
74a25536b Add size check to fix out of bounds read risk (#7304)
12917af8a Update Rust docs page (#7296)
1ea2472f7 [swift] add had<ArrayName> property for arrays to check presence in a message (#7280)
0fe13cb28 Remove span ConstIterator/cbegin()/cend(). (#7295)
385dddc66 Namerkot (#7245)
750dde766 Make `flatc` generate Rust files not requiring `std` (#7273)
9917a168c [swift] Make swift module public (#7274)
76d3cca19 Rust: fix a name conflict when building with "no_std" feature (#7268)
c86e6d0e3 json inf parsing
d34dc32c2 fix include order
234d86c92 fixed off-by-one in parser
746c73b91 Add Annotations for Monster schema and example buffer
0bbfd4b2e fixes for annotator
716521953 Update readme.md (#7257)
a45f564cf [performance] Add aggressive systematic inlining in ByteBuffer and FlatBufferBuilder (#7253)
9d45a6403 more google merge fixes
ccfb4c20b Handle +/-inf in protos (#7256)
7bcd857b8 Specialize CreateVector with std::initializer_list (#7254)
23c8ab34c Swift update performance benchmark infrastructure (#7255)
70002dc5c various fixes for google merge
6e0e79f24 Add test for nested buffer verifier (#7252)
b856368d7 Turn off go modules temporary until we get a proper fix (#7251)
e37156a30 Keep the underlying storage capacity when clearing the FlatBufferBuilder. Gives a significant performance boost for serialisation of many small messages. (#7250)
a10b0e546 Java namer variable keep case (#7249)
275b73994 allow overriding FLATBUFFERS_MAX_ALIGNMENT
9d1ce9a10 Add parameter back to EndVector (#7246)
79afe6c3d Make Java namespaces keep case by default (#7243)
c6dbb2230 Add write permissions for labeller
18bacd3ea Expand test to make sure {}-initializers are properly understood by template. (#7242)
a2c913aec Add -Wnon-virtual-dtor
67b33b294 set workflows permissions to read-only (#7239)
7b5fd2bd0 [Kotlin] Fix key lookup returning null clashing with default value (#7237)
7181d7770 [Java] Fix key lookup returning null clashing with default value (#7236)
7f663b120 Allow CreateVectorOfStrings() to work with any string-type. (#7238)
173ebb694 Fixes a bug where the create function doesnt optional + required items (#7228)
d65823948 [Kotlin] Update gradle to 7.4.1 and simplify config files. (#7231)
ab4bf59e8 remove toascii (#7234)
eee44bbb2 disable cpp-linter (#7229)
a63fa51a1 Create cpp-linter.yml (#7208)
2049e5210 Adds a way to verify/exposes Entities ids (#7221)
832c618f5 Adds implementation flag for swift (#7202)
14615699f Started to migrate to target_compile_options (#7222)
20aad0c41 [C++] stl_emulation span::count_ is not const anymore (#7226) (#7227)
f083b33f2 code gen flexbuffer verifier (#7207)
bf17df346 [C++] generate sorted #include directives (#7213)
35281dedb Fix for [C++] flatc generates invalid Code in the default constructor for structs, when --cpp-field-case-style is used #7209 (#7211)
c9651b742 Add overloads for C# ByteBuffer/FlatBufferBuilder to allow adding vector blocks from ArraySegments or IntPtr (#7193)
26c3b3ada Update codeql.yml
da6e1b985 Update codeql.yml
ad27d751e Added Oss fuzz badge
0aab623cb Create codeql.yml
6a446bdd8 maximize parallel builds in CI (#7206)
21fb5cbbc Create scorecards.yml
0da6f9486 [C++] Static assert on Flatbuffers Version (#7203)
59e971308 reduce fuzzing time to 1 minute in CI
40866a892 fixed padding in struct for annotated binary (#7199)
b71d968fa Apply Namer prefix/suffix to other generators (#7197)
fac0d7be0 Apply Namer to Java. (#7194)
6c5603fd9 [C#] Fix collision of field name and type name (#7149)
2d21853a7 monster fuzzer fix for json default scalars
fec1a8d01 [swift] Add bazel configuration for Swift (#7195)
7fd857623 structured comments (#7192)
a4cb1599d Namerdart (#7187)
ae4ce7265 fuzzed binary annotator (#7188)
e2be0c0b0 Handle root offset and root table vtable invalidation (#7177)
2ad408697 [TS] Fix generation of struct members in object api (#7148)
4213d9105 VerifySizePrefixed (reflection::Schema) and GetAnySizePrefixedRoot added (#7181)
5a13f622c Correctly parse lists of enums in Dart generated code (#7157)
23a7e4e0b Adds no-includes flags to the swift code generator (#7182)
eeb49c275 Move flatbuffer_ts_library to typescript.bzl (#7183)
824763b31 Typo in flatc options (warning-as-errors instead of warnings-as-errors) (#7180)
d3aeee32b Annotated Flatbuffer Binary (#7174)
0bceba24d [Lua] Apply Namer to Lua (#7171)
b8c77d404 Make inclusion of header <optional> opt-out via macro (#7168)
8468eab83 Namersw (#7167)
2b2e8d4ae Nameroverloads (#7164)
b80b32bfa Use DESCRIPTION only if CMake version >= 3.9 (#7166)

Change-Id: Ic2681dabb1a798b7515e62753ee06aecb9933260
git-subtree-dir: third_party/flatbuffers
git-subtree-split: bc44fad35271e43fd7a79b4d691ac9e41708797f
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/tests/ts/my-game/example/ability.js b/tests/ts/my-game/example/ability.js
new file mode 100644
index 0000000..4d7d3db
--- /dev/null
+++ b/tests/ts/my-game/example/ability.js
@@ -0,0 +1,54 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+export class Ability {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    id() {
+        return this.bb.readUint32(this.bb_pos);
+    }
+    mutate_id(value) {
+        this.bb.writeUint32(this.bb_pos + 0, value);
+        return true;
+    }
+    distance() {
+        return this.bb.readUint32(this.bb_pos + 4);
+    }
+    mutate_distance(value) {
+        this.bb.writeUint32(this.bb_pos + 4, value);
+        return true;
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_Example_Ability';
+    }
+    static sizeOf() {
+        return 8;
+    }
+    static createAbility(builder, id, distance) {
+        builder.prep(4, 8);
+        builder.writeInt32(distance);
+        builder.writeInt32(id);
+        return builder.offset();
+    }
+    unpack() {
+        return new AbilityT(this.id(), this.distance());
+    }
+    unpackTo(_o) {
+        _o.id = this.id();
+        _o.distance = this.distance();
+    }
+}
+export class AbilityT {
+    constructor(id = 0, distance = 0) {
+        this.id = id;
+        this.distance = distance;
+    }
+    pack(builder) {
+        return Ability.createAbility(builder, this.id, this.distance);
+    }
+}
diff --git a/tests/ts/my-game/example/ability.ts b/tests/ts/my-game/example/ability.ts
new file mode 100644
index 0000000..36b0eb8
--- /dev/null
+++ b/tests/ts/my-game/example/ability.ts
@@ -0,0 +1,77 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+
+
+export class Ability {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):Ability {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+id():number {
+  return this.bb!.readUint32(this.bb_pos);
+}
+
+mutate_id(value:number):boolean {
+  this.bb!.writeUint32(this.bb_pos + 0, value);
+  return true;
+}
+
+distance():number {
+  return this.bb!.readUint32(this.bb_pos + 4);
+}
+
+mutate_distance(value:number):boolean {
+  this.bb!.writeUint32(this.bb_pos + 4, value);
+  return true;
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_Example_Ability';
+}
+
+static sizeOf():number {
+  return 8;
+}
+
+static createAbility(builder:flatbuffers.Builder, id: number, distance: number):flatbuffers.Offset {
+  builder.prep(4, 8);
+  builder.writeInt32(distance);
+  builder.writeInt32(id);
+  return builder.offset();
+}
+
+
+unpack(): AbilityT {
+  return new AbilityT(
+    this.id(),
+    this.distance()
+  );
+}
+
+
+unpackTo(_o: AbilityT): void {
+  _o.id = this.id();
+  _o.distance = this.distance();
+}
+}
+
+export class AbilityT {
+constructor(
+  public id: number = 0,
+  public distance: number = 0
+){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  return Ability.createAbility(builder,
+    this.id,
+    this.distance
+  );
+}
+}
diff --git a/tests/ts/my-game/example/any-ambiguous-aliases.js b/tests/ts/my-game/example/any-ambiguous-aliases.js
new file mode 100644
index 0000000..ca81908
--- /dev/null
+++ b/tests/ts/my-game/example/any-ambiguous-aliases.js
@@ -0,0 +1,27 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import { Monster } from '../../my-game/example/monster.js';
+export var AnyAmbiguousAliases;
+(function (AnyAmbiguousAliases) {
+    AnyAmbiguousAliases[AnyAmbiguousAliases["NONE"] = 0] = "NONE";
+    AnyAmbiguousAliases[AnyAmbiguousAliases["M1"] = 1] = "M1";
+    AnyAmbiguousAliases[AnyAmbiguousAliases["M2"] = 2] = "M2";
+    AnyAmbiguousAliases[AnyAmbiguousAliases["M3"] = 3] = "M3";
+})(AnyAmbiguousAliases || (AnyAmbiguousAliases = {}));
+export function unionToAnyAmbiguousAliases(type, accessor) {
+    switch (AnyAmbiguousAliases[type]) {
+        case 'NONE': return null;
+        case 'M1': return accessor(new Monster());
+        case 'M2': return accessor(new Monster());
+        case 'M3': return accessor(new Monster());
+        default: return null;
+    }
+}
+export function unionListToAnyAmbiguousAliases(type, accessor, index) {
+    switch (AnyAmbiguousAliases[type]) {
+        case 'NONE': return null;
+        case 'M1': return accessor(index, new Monster());
+        case 'M2': return accessor(index, new Monster());
+        case 'M3': return accessor(index, new Monster());
+        default: return null;
+    }
+}
diff --git a/tests/ts/my-game/example/any-ambiguous-aliases.ts b/tests/ts/my-game/example/any-ambiguous-aliases.ts
new file mode 100644
index 0000000..a7a63b7
--- /dev/null
+++ b/tests/ts/my-game/example/any-ambiguous-aliases.ts
@@ -0,0 +1,38 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import { Monster, MonsterT } from '../../my-game/example/monster.js';
+
+
+export enum AnyAmbiguousAliases {
+  NONE = 0,
+  M1 = 1,
+  M2 = 2,
+  M3 = 3
+}
+
+export function unionToAnyAmbiguousAliases(
+  type: AnyAmbiguousAliases,
+  accessor: (obj:Monster) => Monster|null
+): Monster|null {
+  switch(AnyAmbiguousAliases[type]) {
+    case 'NONE': return null; 
+    case 'M1': return accessor(new Monster())! as Monster;
+    case 'M2': return accessor(new Monster())! as Monster;
+    case 'M3': return accessor(new Monster())! as Monster;
+    default: return null;
+  }
+}
+
+export function unionListToAnyAmbiguousAliases(
+  type: AnyAmbiguousAliases, 
+  accessor: (index: number, obj:Monster) => Monster|null, 
+  index: number
+): Monster|null {
+  switch(AnyAmbiguousAliases[type]) {
+    case 'NONE': return null; 
+    case 'M1': return accessor(index, new Monster())! as Monster;
+    case 'M2': return accessor(index, new Monster())! as Monster;
+    case 'M3': return accessor(index, new Monster())! as Monster;
+    default: return null;
+  }
+}
diff --git a/tests/ts/my-game/example/any-unique-aliases.js b/tests/ts/my-game/example/any-unique-aliases.js
new file mode 100644
index 0000000..d1ac6bf
--- /dev/null
+++ b/tests/ts/my-game/example/any-unique-aliases.js
@@ -0,0 +1,29 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+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';
+export var AnyUniqueAliases;
+(function (AnyUniqueAliases) {
+    AnyUniqueAliases[AnyUniqueAliases["NONE"] = 0] = "NONE";
+    AnyUniqueAliases[AnyUniqueAliases["M"] = 1] = "M";
+    AnyUniqueAliases[AnyUniqueAliases["TS"] = 2] = "TS";
+    AnyUniqueAliases[AnyUniqueAliases["M2"] = 3] = "M2";
+})(AnyUniqueAliases || (AnyUniqueAliases = {}));
+export function unionToAnyUniqueAliases(type, accessor) {
+    switch (AnyUniqueAliases[type]) {
+        case 'NONE': return null;
+        case 'M': return accessor(new Monster());
+        case 'TS': return accessor(new TestSimpleTableWithEnum());
+        case 'M2': return accessor(new MyGame_Example2_Monster());
+        default: return null;
+    }
+}
+export function unionListToAnyUniqueAliases(type, accessor, index) {
+    switch (AnyUniqueAliases[type]) {
+        case 'NONE': return null;
+        case 'M': return accessor(index, new Monster());
+        case 'TS': return accessor(index, new TestSimpleTableWithEnum());
+        case 'M2': return accessor(index, new MyGame_Example2_Monster());
+        default: return null;
+    }
+}
diff --git a/tests/ts/my-game/example/any-unique-aliases.ts b/tests/ts/my-game/example/any-unique-aliases.ts
new file mode 100644
index 0000000..16aa378
--- /dev/null
+++ b/tests/ts/my-game/example/any-unique-aliases.ts
@@ -0,0 +1,40 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import { Monster as MyGame_Example2_Monster, MonsterT as MyGame_Example2_MonsterT } from '../../my-game/example2/monster.js';
+import { Monster, MonsterT } from '../../my-game/example/monster.js';
+import { TestSimpleTableWithEnum, TestSimpleTableWithEnumT } from '../../my-game/example/test-simple-table-with-enum.js';
+
+
+export enum AnyUniqueAliases {
+  NONE = 0,
+  M = 1,
+  TS = 2,
+  M2 = 3
+}
+
+export function unionToAnyUniqueAliases(
+  type: AnyUniqueAliases,
+  accessor: (obj:Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum) => Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum|null
+): Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum|null {
+  switch(AnyUniqueAliases[type]) {
+    case 'NONE': return null; 
+    case 'M': return accessor(new Monster())! as Monster;
+    case 'TS': return accessor(new TestSimpleTableWithEnum())! as TestSimpleTableWithEnum;
+    case 'M2': return accessor(new MyGame_Example2_Monster())! as MyGame_Example2_Monster;
+    default: return null;
+  }
+}
+
+export function unionListToAnyUniqueAliases(
+  type: AnyUniqueAliases, 
+  accessor: (index: number, obj:Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum) => Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum|null, 
+  index: number
+): Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum|null {
+  switch(AnyUniqueAliases[type]) {
+    case 'NONE': return null; 
+    case 'M': return accessor(index, new Monster())! as Monster;
+    case 'TS': return accessor(index, new TestSimpleTableWithEnum())! as TestSimpleTableWithEnum;
+    case 'M2': return accessor(index, new MyGame_Example2_Monster())! as MyGame_Example2_Monster;
+    default: return null;
+  }
+}
diff --git a/tests/ts/my-game/example/any.js b/tests/ts/my-game/example/any.js
new file mode 100644
index 0000000..27be8f4
--- /dev/null
+++ b/tests/ts/my-game/example/any.js
@@ -0,0 +1,29 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+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';
+export var Any;
+(function (Any) {
+    Any[Any["NONE"] = 0] = "NONE";
+    Any[Any["Monster"] = 1] = "Monster";
+    Any[Any["TestSimpleTableWithEnum"] = 2] = "TestSimpleTableWithEnum";
+    Any[Any["MyGame_Example2_Monster"] = 3] = "MyGame_Example2_Monster";
+})(Any || (Any = {}));
+export function unionToAny(type, accessor) {
+    switch (Any[type]) {
+        case 'NONE': return null;
+        case 'Monster': return accessor(new Monster());
+        case 'TestSimpleTableWithEnum': return accessor(new TestSimpleTableWithEnum());
+        case 'MyGame_Example2_Monster': return accessor(new MyGame_Example2_Monster());
+        default: return null;
+    }
+}
+export function unionListToAny(type, accessor, index) {
+    switch (Any[type]) {
+        case 'NONE': return null;
+        case 'Monster': return accessor(index, new Monster());
+        case 'TestSimpleTableWithEnum': return accessor(index, new TestSimpleTableWithEnum());
+        case 'MyGame_Example2_Monster': return accessor(index, new MyGame_Example2_Monster());
+        default: return null;
+    }
+}
diff --git a/tests/ts/my-game/example/any.ts b/tests/ts/my-game/example/any.ts
new file mode 100644
index 0000000..de1cbfd
--- /dev/null
+++ b/tests/ts/my-game/example/any.ts
@@ -0,0 +1,40 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import { Monster as MyGame_Example2_Monster, MonsterT as MyGame_Example2_MonsterT } from '../../my-game/example2/monster.js';
+import { Monster, MonsterT } from '../../my-game/example/monster.js';
+import { TestSimpleTableWithEnum, TestSimpleTableWithEnumT } from '../../my-game/example/test-simple-table-with-enum.js';
+
+
+export enum Any {
+  NONE = 0,
+  Monster = 1,
+  TestSimpleTableWithEnum = 2,
+  MyGame_Example2_Monster = 3
+}
+
+export function unionToAny(
+  type: Any,
+  accessor: (obj:Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum) => Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum|null
+): Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum|null {
+  switch(Any[type]) {
+    case 'NONE': return null; 
+    case 'Monster': return accessor(new Monster())! as Monster;
+    case 'TestSimpleTableWithEnum': return accessor(new TestSimpleTableWithEnum())! as TestSimpleTableWithEnum;
+    case 'MyGame_Example2_Monster': return accessor(new MyGame_Example2_Monster())! as MyGame_Example2_Monster;
+    default: return null;
+  }
+}
+
+export function unionListToAny(
+  type: Any, 
+  accessor: (index: number, obj:Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum) => Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum|null, 
+  index: number
+): Monster|MyGame_Example2_Monster|TestSimpleTableWithEnum|null {
+  switch(Any[type]) {
+    case 'NONE': return null; 
+    case 'Monster': return accessor(index, new Monster())! as Monster;
+    case 'TestSimpleTableWithEnum': return accessor(index, new TestSimpleTableWithEnum())! as TestSimpleTableWithEnum;
+    case 'MyGame_Example2_Monster': return accessor(index, new MyGame_Example2_Monster())! as MyGame_Example2_Monster;
+    default: return null;
+  }
+}
diff --git a/tests/ts/my-game/example/color.js b/tests/ts/my-game/example/color.js
new file mode 100644
index 0000000..f95f75e
--- /dev/null
+++ b/tests/ts/my-game/example/color.js
@@ -0,0 +1,17 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+/**
+ * Composite components of Monster color.
+ */
+export var Color;
+(function (Color) {
+    Color[Color["Red"] = 1] = "Red";
+    /**
+     * \brief color Green
+     * Green is bit_flag with value (1u << 1)
+     */
+    Color[Color["Green"] = 2] = "Green";
+    /**
+     * \brief color Blue (1u << 3)
+     */
+    Color[Color["Blue"] = 8] = "Blue";
+})(Color || (Color = {}));
diff --git a/tests/ts/my-game/example/color.ts b/tests/ts/my-game/example/color.ts
new file mode 100644
index 0000000..8ce58da
--- /dev/null
+++ b/tests/ts/my-game/example/color.ts
@@ -0,0 +1,19 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+/**
+ * Composite components of Monster color.
+ */
+export enum Color {
+  Red = 1,
+
+  /**
+   * \brief color Green
+   * Green is bit_flag with value (1u << 1)
+   */
+  Green = 2,
+
+  /**
+   * \brief color Blue (1u << 3)
+   */
+  Blue = 8
+}
diff --git a/tests/ts/my-game/example/long-enum.js b/tests/ts/my-game/example/long-enum.js
new file mode 100644
index 0000000..040d8a6
--- /dev/null
+++ b/tests/ts/my-game/example/long-enum.js
@@ -0,0 +1,7 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+export var LongEnum;
+(function (LongEnum) {
+    LongEnum["LongOne"] = "2";
+    LongEnum["LongTwo"] = "4";
+    LongEnum["LongBig"] = "1099511627776";
+})(LongEnum || (LongEnum = {}));
diff --git a/tests/ts/my-game/example/long-enum.ts b/tests/ts/my-game/example/long-enum.ts
new file mode 100644
index 0000000..31ea188
--- /dev/null
+++ b/tests/ts/my-game/example/long-enum.ts
@@ -0,0 +1,7 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+export enum LongEnum {
+  LongOne = '2',
+  LongTwo = '4',
+  LongBig = '1099511627776'
+}
diff --git a/tests/ts/my-game/example/monster.js b/tests/ts/my-game/example/monster.js
new file mode 100644
index 0000000..e4ef970
--- /dev/null
+++ b/tests/ts/my-game/example/monster.js
@@ -0,0 +1,1125 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import * as flatbuffers from 'flatbuffers';
+import { Ability } from '../../my-game/example/ability.js';
+import { Any, unionToAny } from '../../my-game/example/any.js';
+import { AnyAmbiguousAliases, unionToAnyAmbiguousAliases } from '../../my-game/example/any-ambiguous-aliases.js';
+import { AnyUniqueAliases, unionToAnyUniqueAliases } from '../../my-game/example/any-unique-aliases.js';
+import { Color } from '../../my-game/example/color.js';
+import { Race } from '../../my-game/example/race.js';
+import { Referrable } from '../../my-game/example/referrable.js';
+import { Stat } from '../../my-game/example/stat.js';
+import { Test } from '../../my-game/example/test.js';
+import { Vec3 } from '../../my-game/example/vec3.js';
+import { InParentNamespace } from '../../my-game/in-parent-namespace.js';
+/**
+ * an example documentation comment: "monster object"
+ */
+export class Monster {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    static getRootAsMonster(bb, obj) {
+        return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    static getSizePrefixedRootAsMonster(bb, obj) {
+        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+        return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    static bufferHasIdentifier(bb) {
+        return bb.__has_identifier('MONS');
+    }
+    pos(obj) {
+        const offset = this.bb.__offset(this.bb_pos, 4);
+        return offset ? (obj || new Vec3()).__init(this.bb_pos + offset, this.bb) : null;
+    }
+    mana() {
+        const offset = this.bb.__offset(this.bb_pos, 6);
+        return offset ? this.bb.readInt16(this.bb_pos + offset) : 150;
+    }
+    mutate_mana(value) {
+        const offset = this.bb.__offset(this.bb_pos, 6);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt16(this.bb_pos + offset, value);
+        return true;
+    }
+    hp() {
+        const offset = this.bb.__offset(this.bb_pos, 8);
+        return offset ? this.bb.readInt16(this.bb_pos + offset) : 100;
+    }
+    mutate_hp(value) {
+        const offset = this.bb.__offset(this.bb_pos, 8);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt16(this.bb_pos + offset, value);
+        return true;
+    }
+    name(optionalEncoding) {
+        const offset = this.bb.__offset(this.bb_pos, 10);
+        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
+    }
+    inventory(index) {
+        const offset = this.bb.__offset(this.bb_pos, 14);
+        return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
+    }
+    inventoryLength() {
+        const offset = this.bb.__offset(this.bb_pos, 14);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    inventoryArray() {
+        const offset = this.bb.__offset(this.bb_pos, 14);
+        return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
+    }
+    color() {
+        const offset = this.bb.__offset(this.bb_pos, 16);
+        return offset ? this.bb.readUint8(this.bb_pos + offset) : Color.Blue;
+    }
+    mutate_color(value) {
+        const offset = this.bb.__offset(this.bb_pos, 16);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint8(this.bb_pos + offset, value);
+        return true;
+    }
+    testType() {
+        const offset = this.bb.__offset(this.bb_pos, 18);
+        return offset ? this.bb.readUint8(this.bb_pos + offset) : Any.NONE;
+    }
+    test(obj) {
+        const offset = this.bb.__offset(this.bb_pos, 20);
+        return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
+    }
+    test4(index, obj) {
+        const offset = this.bb.__offset(this.bb_pos, 22);
+        return offset ? (obj || new Test()).__init(this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) : null;
+    }
+    test4Length() {
+        const offset = this.bb.__offset(this.bb_pos, 22);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    testarrayofstring(index, optionalEncoding) {
+        const offset = this.bb.__offset(this.bb_pos, 24);
+        return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
+    }
+    testarrayofstringLength() {
+        const offset = this.bb.__offset(this.bb_pos, 24);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    /**
+     * an example documentation comment: this will end up in the generated code
+     * multiline too
+     */
+    testarrayoftables(index, obj) {
+        const offset = this.bb.__offset(this.bb_pos, 26);
+        return offset ? (obj || new Monster()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
+    }
+    testarrayoftablesLength() {
+        const offset = this.bb.__offset(this.bb_pos, 26);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    enemy(obj) {
+        const offset = this.bb.__offset(this.bb_pos, 28);
+        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);
+        return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
+    }
+    testnestedflatbufferLength() {
+        const offset = this.bb.__offset(this.bb_pos, 30);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    testnestedflatbufferArray() {
+        const offset = this.bb.__offset(this.bb_pos, 30);
+        return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
+    }
+    testempty(obj) {
+        const offset = this.bb.__offset(this.bb_pos, 32);
+        return offset ? (obj || new Stat()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
+    }
+    testbool() {
+        const offset = this.bb.__offset(this.bb_pos, 34);
+        return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
+    }
+    mutate_testbool(value) {
+        const offset = this.bb.__offset(this.bb_pos, 34);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt8(this.bb_pos + offset, +value);
+        return true;
+    }
+    testhashs32Fnv1() {
+        const offset = this.bb.__offset(this.bb_pos, 36);
+        return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
+    }
+    mutate_testhashs32_fnv1(value) {
+        const offset = this.bb.__offset(this.bb_pos, 36);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt32(this.bb_pos + offset, value);
+        return true;
+    }
+    testhashu32Fnv1() {
+        const offset = this.bb.__offset(this.bb_pos, 38);
+        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
+    }
+    mutate_testhashu32_fnv1(value) {
+        const offset = this.bb.__offset(this.bb_pos, 38);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint32(this.bb_pos + offset, value);
+        return true;
+    }
+    testhashs64Fnv1() {
+        const offset = this.bb.__offset(this.bb_pos, 40);
+        return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_testhashs64_fnv1(value) {
+        const offset = this.bb.__offset(this.bb_pos, 40);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt64(this.bb_pos + offset, value);
+        return true;
+    }
+    testhashu64Fnv1() {
+        const offset = this.bb.__offset(this.bb_pos, 42);
+        return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_testhashu64_fnv1(value) {
+        const offset = this.bb.__offset(this.bb_pos, 42);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint64(this.bb_pos + offset, value);
+        return true;
+    }
+    testhashs32Fnv1a() {
+        const offset = this.bb.__offset(this.bb_pos, 44);
+        return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
+    }
+    mutate_testhashs32_fnv1a(value) {
+        const offset = this.bb.__offset(this.bb_pos, 44);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt32(this.bb_pos + offset, value);
+        return true;
+    }
+    testhashu32Fnv1a() {
+        const offset = this.bb.__offset(this.bb_pos, 46);
+        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
+    }
+    mutate_testhashu32_fnv1a(value) {
+        const offset = this.bb.__offset(this.bb_pos, 46);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint32(this.bb_pos + offset, value);
+        return true;
+    }
+    testhashs64Fnv1a() {
+        const offset = this.bb.__offset(this.bb_pos, 48);
+        return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_testhashs64_fnv1a(value) {
+        const offset = this.bb.__offset(this.bb_pos, 48);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt64(this.bb_pos + offset, value);
+        return true;
+    }
+    testhashu64Fnv1a() {
+        const offset = this.bb.__offset(this.bb_pos, 50);
+        return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_testhashu64_fnv1a(value) {
+        const offset = this.bb.__offset(this.bb_pos, 50);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint64(this.bb_pos + offset, value);
+        return true;
+    }
+    testarrayofbools(index) {
+        const offset = this.bb.__offset(this.bb_pos, 52);
+        return offset ? !!this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : false;
+    }
+    testarrayofboolsLength() {
+        const offset = this.bb.__offset(this.bb_pos, 52);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    testarrayofboolsArray() {
+        const offset = this.bb.__offset(this.bb_pos, 52);
+        return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
+    }
+    testf() {
+        const offset = this.bb.__offset(this.bb_pos, 54);
+        return offset ? this.bb.readFloat32(this.bb_pos + offset) : 3.14159;
+    }
+    mutate_testf(value) {
+        const offset = this.bb.__offset(this.bb_pos, 54);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeFloat32(this.bb_pos + offset, value);
+        return true;
+    }
+    testf2() {
+        const offset = this.bb.__offset(this.bb_pos, 56);
+        return offset ? this.bb.readFloat32(this.bb_pos + offset) : 3.0;
+    }
+    mutate_testf2(value) {
+        const offset = this.bb.__offset(this.bb_pos, 56);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeFloat32(this.bb_pos + offset, value);
+        return true;
+    }
+    testf3() {
+        const offset = this.bb.__offset(this.bb_pos, 58);
+        return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
+    }
+    mutate_testf3(value) {
+        const offset = this.bb.__offset(this.bb_pos, 58);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeFloat32(this.bb_pos + offset, value);
+        return true;
+    }
+    testarrayofstring2(index, optionalEncoding) {
+        const offset = this.bb.__offset(this.bb_pos, 60);
+        return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
+    }
+    testarrayofstring2Length() {
+        const offset = this.bb.__offset(this.bb_pos, 60);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    testarrayofsortedstruct(index, obj) {
+        const offset = this.bb.__offset(this.bb_pos, 62);
+        return offset ? (obj || new Ability()).__init(this.bb.__vector(this.bb_pos + offset) + index * 8, this.bb) : null;
+    }
+    testarrayofsortedstructLength() {
+        const offset = this.bb.__offset(this.bb_pos, 62);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    flex(index) {
+        const offset = this.bb.__offset(this.bb_pos, 64);
+        return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
+    }
+    flexLength() {
+        const offset = this.bb.__offset(this.bb_pos, 64);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    flexArray() {
+        const offset = this.bb.__offset(this.bb_pos, 64);
+        return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
+    }
+    test5(index, obj) {
+        const offset = this.bb.__offset(this.bb_pos, 66);
+        return offset ? (obj || new Test()).__init(this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) : null;
+    }
+    test5Length() {
+        const offset = this.bb.__offset(this.bb_pos, 66);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    vectorOfLongs(index) {
+        const offset = this.bb.__offset(this.bb_pos, 68);
+        return offset ? this.bb.readInt64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+    }
+    vectorOfLongsLength() {
+        const offset = this.bb.__offset(this.bb_pos, 68);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    vectorOfDoubles(index) {
+        const offset = this.bb.__offset(this.bb_pos, 70);
+        return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
+    }
+    vectorOfDoublesLength() {
+        const offset = this.bb.__offset(this.bb_pos, 70);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    vectorOfDoublesArray() {
+        const offset = this.bb.__offset(this.bb_pos, 70);
+        return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
+    }
+    parentNamespaceTest(obj) {
+        const offset = this.bb.__offset(this.bb_pos, 72);
+        return offset ? (obj || new InParentNamespace()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
+    }
+    vectorOfReferrables(index, obj) {
+        const offset = this.bb.__offset(this.bb_pos, 74);
+        return offset ? (obj || new Referrable()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
+    }
+    vectorOfReferrablesLength() {
+        const offset = this.bb.__offset(this.bb_pos, 74);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    singleWeakReference() {
+        const offset = this.bb.__offset(this.bb_pos, 76);
+        return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_single_weak_reference(value) {
+        const offset = this.bb.__offset(this.bb_pos, 76);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint64(this.bb_pos + offset, value);
+        return true;
+    }
+    vectorOfWeakReferences(index) {
+        const offset = this.bb.__offset(this.bb_pos, 78);
+        return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+    }
+    vectorOfWeakReferencesLength() {
+        const offset = this.bb.__offset(this.bb_pos, 78);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    vectorOfStrongReferrables(index, obj) {
+        const offset = this.bb.__offset(this.bb_pos, 80);
+        return offset ? (obj || new Referrable()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
+    }
+    vectorOfStrongReferrablesLength() {
+        const offset = this.bb.__offset(this.bb_pos, 80);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    coOwningReference() {
+        const offset = this.bb.__offset(this.bb_pos, 82);
+        return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_co_owning_reference(value) {
+        const offset = this.bb.__offset(this.bb_pos, 82);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint64(this.bb_pos + offset, value);
+        return true;
+    }
+    vectorOfCoOwningReferences(index) {
+        const offset = this.bb.__offset(this.bb_pos, 84);
+        return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+    }
+    vectorOfCoOwningReferencesLength() {
+        const offset = this.bb.__offset(this.bb_pos, 84);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    nonOwningReference() {
+        const offset = this.bb.__offset(this.bb_pos, 86);
+        return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_non_owning_reference(value) {
+        const offset = this.bb.__offset(this.bb_pos, 86);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint64(this.bb_pos + offset, value);
+        return true;
+    }
+    vectorOfNonOwningReferences(index) {
+        const offset = this.bb.__offset(this.bb_pos, 88);
+        return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+    }
+    vectorOfNonOwningReferencesLength() {
+        const offset = this.bb.__offset(this.bb_pos, 88);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    anyUniqueType() {
+        const offset = this.bb.__offset(this.bb_pos, 90);
+        return offset ? this.bb.readUint8(this.bb_pos + offset) : AnyUniqueAliases.NONE;
+    }
+    anyUnique(obj) {
+        const offset = this.bb.__offset(this.bb_pos, 92);
+        return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
+    }
+    anyAmbiguousType() {
+        const offset = this.bb.__offset(this.bb_pos, 94);
+        return offset ? this.bb.readUint8(this.bb_pos + offset) : AnyAmbiguousAliases.NONE;
+    }
+    anyAmbiguous(obj) {
+        const offset = this.bb.__offset(this.bb_pos, 96);
+        return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
+    }
+    vectorOfEnums(index) {
+        const offset = this.bb.__offset(this.bb_pos, 98);
+        return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
+    }
+    vectorOfEnumsLength() {
+        const offset = this.bb.__offset(this.bb_pos, 98);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    vectorOfEnumsArray() {
+        const offset = this.bb.__offset(this.bb_pos, 98);
+        return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
+    }
+    signedEnum() {
+        const offset = this.bb.__offset(this.bb_pos, 100);
+        return offset ? this.bb.readInt8(this.bb_pos + offset) : Race.None;
+    }
+    mutate_signed_enum(value) {
+        const offset = this.bb.__offset(this.bb_pos, 100);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt8(this.bb_pos + offset, value);
+        return true;
+    }
+    testrequirednestedflatbuffer(index) {
+        const offset = this.bb.__offset(this.bb_pos, 102);
+        return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
+    }
+    testrequirednestedflatbufferLength() {
+        const offset = this.bb.__offset(this.bb_pos, 102);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    testrequirednestedflatbufferArray() {
+        const offset = this.bb.__offset(this.bb_pos, 102);
+        return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
+    }
+    scalarKeySortedTables(index, obj) {
+        const offset = this.bb.__offset(this.bb_pos, 104);
+        return offset ? (obj || new Stat()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
+    }
+    scalarKeySortedTablesLength() {
+        const offset = this.bb.__offset(this.bb_pos, 104);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    nativeInline(obj) {
+        const offset = this.bb.__offset(this.bb_pos, 106);
+        return offset ? (obj || new Test()).__init(this.bb_pos + offset, this.bb) : null;
+    }
+    longEnumNonEnumDefault() {
+        const offset = this.bb.__offset(this.bb_pos, 108);
+        return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_long_enum_non_enum_default(value) {
+        const offset = this.bb.__offset(this.bb_pos, 108);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint64(this.bb_pos + offset, value);
+        return true;
+    }
+    longEnumNormalDefault() {
+        const offset = this.bb.__offset(this.bb_pos, 110);
+        return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('2');
+    }
+    mutate_long_enum_normal_default(value) {
+        const offset = this.bb.__offset(this.bb_pos, 110);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint64(this.bb_pos + offset, value);
+        return true;
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_Example_Monster';
+    }
+    static startMonster(builder) {
+        builder.startObject(54);
+    }
+    static addPos(builder, posOffset) {
+        builder.addFieldStruct(0, posOffset, 0);
+    }
+    static addMana(builder, mana) {
+        builder.addFieldInt16(1, mana, 150);
+    }
+    static addHp(builder, hp) {
+        builder.addFieldInt16(2, hp, 100);
+    }
+    static addName(builder, nameOffset) {
+        builder.addFieldOffset(3, nameOffset, 0);
+    }
+    static addInventory(builder, inventoryOffset) {
+        builder.addFieldOffset(5, inventoryOffset, 0);
+    }
+    static createInventoryVector(builder, data) {
+        builder.startVector(1, data.length, 1);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addInt8(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startInventoryVector(builder, numElems) {
+        builder.startVector(1, numElems, 1);
+    }
+    static addColor(builder, color) {
+        builder.addFieldInt8(6, color, Color.Blue);
+    }
+    static addTestType(builder, testType) {
+        builder.addFieldInt8(7, testType, Any.NONE);
+    }
+    static addTest(builder, testOffset) {
+        builder.addFieldOffset(8, testOffset, 0);
+    }
+    static addTest4(builder, test4Offset) {
+        builder.addFieldOffset(9, test4Offset, 0);
+    }
+    static startTest4Vector(builder, numElems) {
+        builder.startVector(4, numElems, 2);
+    }
+    static addTestarrayofstring(builder, testarrayofstringOffset) {
+        builder.addFieldOffset(10, testarrayofstringOffset, 0);
+    }
+    static createTestarrayofstringVector(builder, data) {
+        builder.startVector(4, data.length, 4);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addOffset(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startTestarrayofstringVector(builder, numElems) {
+        builder.startVector(4, numElems, 4);
+    }
+    static addTestarrayoftables(builder, testarrayoftablesOffset) {
+        builder.addFieldOffset(11, testarrayoftablesOffset, 0);
+    }
+    static createTestarrayoftablesVector(builder, data) {
+        builder.startVector(4, data.length, 4);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addOffset(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startTestarrayoftablesVector(builder, numElems) {
+        builder.startVector(4, numElems, 4);
+    }
+    static addEnemy(builder, enemyOffset) {
+        builder.addFieldOffset(12, enemyOffset, 0);
+    }
+    static addTestnestedflatbuffer(builder, testnestedflatbufferOffset) {
+        builder.addFieldOffset(13, testnestedflatbufferOffset, 0);
+    }
+    static createTestnestedflatbufferVector(builder, data) {
+        builder.startVector(1, data.length, 1);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addInt8(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startTestnestedflatbufferVector(builder, numElems) {
+        builder.startVector(1, numElems, 1);
+    }
+    static addTestempty(builder, testemptyOffset) {
+        builder.addFieldOffset(14, testemptyOffset, 0);
+    }
+    static addTestbool(builder, testbool) {
+        builder.addFieldInt8(15, +testbool, +false);
+    }
+    static addTesthashs32Fnv1(builder, testhashs32Fnv1) {
+        builder.addFieldInt32(16, testhashs32Fnv1, 0);
+    }
+    static addTesthashu32Fnv1(builder, testhashu32Fnv1) {
+        builder.addFieldInt32(17, testhashu32Fnv1, 0);
+    }
+    static addTesthashs64Fnv1(builder, testhashs64Fnv1) {
+        builder.addFieldInt64(18, testhashs64Fnv1, BigInt('0'));
+    }
+    static addTesthashu64Fnv1(builder, testhashu64Fnv1) {
+        builder.addFieldInt64(19, testhashu64Fnv1, BigInt('0'));
+    }
+    static addTesthashs32Fnv1a(builder, testhashs32Fnv1a) {
+        builder.addFieldInt32(20, testhashs32Fnv1a, 0);
+    }
+    static addTesthashu32Fnv1a(builder, testhashu32Fnv1a) {
+        builder.addFieldInt32(21, testhashu32Fnv1a, 0);
+    }
+    static addTesthashs64Fnv1a(builder, testhashs64Fnv1a) {
+        builder.addFieldInt64(22, testhashs64Fnv1a, BigInt('0'));
+    }
+    static addTesthashu64Fnv1a(builder, testhashu64Fnv1a) {
+        builder.addFieldInt64(23, testhashu64Fnv1a, BigInt('0'));
+    }
+    static addTestarrayofbools(builder, testarrayofboolsOffset) {
+        builder.addFieldOffset(24, testarrayofboolsOffset, 0);
+    }
+    static createTestarrayofboolsVector(builder, data) {
+        builder.startVector(1, data.length, 1);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addInt8(+data[i]);
+        }
+        return builder.endVector();
+    }
+    static startTestarrayofboolsVector(builder, numElems) {
+        builder.startVector(1, numElems, 1);
+    }
+    static addTestf(builder, testf) {
+        builder.addFieldFloat32(25, testf, 3.14159);
+    }
+    static addTestf2(builder, testf2) {
+        builder.addFieldFloat32(26, testf2, 3.0);
+    }
+    static addTestf3(builder, testf3) {
+        builder.addFieldFloat32(27, testf3, 0.0);
+    }
+    static addTestarrayofstring2(builder, testarrayofstring2Offset) {
+        builder.addFieldOffset(28, testarrayofstring2Offset, 0);
+    }
+    static createTestarrayofstring2Vector(builder, data) {
+        builder.startVector(4, data.length, 4);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addOffset(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startTestarrayofstring2Vector(builder, numElems) {
+        builder.startVector(4, numElems, 4);
+    }
+    static addTestarrayofsortedstruct(builder, testarrayofsortedstructOffset) {
+        builder.addFieldOffset(29, testarrayofsortedstructOffset, 0);
+    }
+    static startTestarrayofsortedstructVector(builder, numElems) {
+        builder.startVector(8, numElems, 4);
+    }
+    static addFlex(builder, flexOffset) {
+        builder.addFieldOffset(30, flexOffset, 0);
+    }
+    static createFlexVector(builder, data) {
+        builder.startVector(1, data.length, 1);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addInt8(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startFlexVector(builder, numElems) {
+        builder.startVector(1, numElems, 1);
+    }
+    static addTest5(builder, test5Offset) {
+        builder.addFieldOffset(31, test5Offset, 0);
+    }
+    static startTest5Vector(builder, numElems) {
+        builder.startVector(4, numElems, 2);
+    }
+    static addVectorOfLongs(builder, vectorOfLongsOffset) {
+        builder.addFieldOffset(32, vectorOfLongsOffset, 0);
+    }
+    static createVectorOfLongsVector(builder, data) {
+        builder.startVector(8, data.length, 8);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addInt64(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startVectorOfLongsVector(builder, numElems) {
+        builder.startVector(8, numElems, 8);
+    }
+    static addVectorOfDoubles(builder, vectorOfDoublesOffset) {
+        builder.addFieldOffset(33, vectorOfDoublesOffset, 0);
+    }
+    static createVectorOfDoublesVector(builder, data) {
+        builder.startVector(8, data.length, 8);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addFloat64(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startVectorOfDoublesVector(builder, numElems) {
+        builder.startVector(8, numElems, 8);
+    }
+    static addParentNamespaceTest(builder, parentNamespaceTestOffset) {
+        builder.addFieldOffset(34, parentNamespaceTestOffset, 0);
+    }
+    static addVectorOfReferrables(builder, vectorOfReferrablesOffset) {
+        builder.addFieldOffset(35, vectorOfReferrablesOffset, 0);
+    }
+    static createVectorOfReferrablesVector(builder, data) {
+        builder.startVector(4, data.length, 4);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addOffset(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startVectorOfReferrablesVector(builder, numElems) {
+        builder.startVector(4, numElems, 4);
+    }
+    static addSingleWeakReference(builder, singleWeakReference) {
+        builder.addFieldInt64(36, singleWeakReference, BigInt('0'));
+    }
+    static addVectorOfWeakReferences(builder, vectorOfWeakReferencesOffset) {
+        builder.addFieldOffset(37, vectorOfWeakReferencesOffset, 0);
+    }
+    static createVectorOfWeakReferencesVector(builder, data) {
+        builder.startVector(8, data.length, 8);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addInt64(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startVectorOfWeakReferencesVector(builder, numElems) {
+        builder.startVector(8, numElems, 8);
+    }
+    static addVectorOfStrongReferrables(builder, vectorOfStrongReferrablesOffset) {
+        builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0);
+    }
+    static createVectorOfStrongReferrablesVector(builder, data) {
+        builder.startVector(4, data.length, 4);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addOffset(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startVectorOfStrongReferrablesVector(builder, numElems) {
+        builder.startVector(4, numElems, 4);
+    }
+    static addCoOwningReference(builder, coOwningReference) {
+        builder.addFieldInt64(39, coOwningReference, BigInt('0'));
+    }
+    static addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferencesOffset) {
+        builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0);
+    }
+    static createVectorOfCoOwningReferencesVector(builder, data) {
+        builder.startVector(8, data.length, 8);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addInt64(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startVectorOfCoOwningReferencesVector(builder, numElems) {
+        builder.startVector(8, numElems, 8);
+    }
+    static addNonOwningReference(builder, nonOwningReference) {
+        builder.addFieldInt64(41, nonOwningReference, BigInt('0'));
+    }
+    static addVectorOfNonOwningReferences(builder, vectorOfNonOwningReferencesOffset) {
+        builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0);
+    }
+    static createVectorOfNonOwningReferencesVector(builder, data) {
+        builder.startVector(8, data.length, 8);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addInt64(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startVectorOfNonOwningReferencesVector(builder, numElems) {
+        builder.startVector(8, numElems, 8);
+    }
+    static addAnyUniqueType(builder, anyUniqueType) {
+        builder.addFieldInt8(43, anyUniqueType, AnyUniqueAliases.NONE);
+    }
+    static addAnyUnique(builder, anyUniqueOffset) {
+        builder.addFieldOffset(44, anyUniqueOffset, 0);
+    }
+    static addAnyAmbiguousType(builder, anyAmbiguousType) {
+        builder.addFieldInt8(45, anyAmbiguousType, AnyAmbiguousAliases.NONE);
+    }
+    static addAnyAmbiguous(builder, anyAmbiguousOffset) {
+        builder.addFieldOffset(46, anyAmbiguousOffset, 0);
+    }
+    static addVectorOfEnums(builder, vectorOfEnumsOffset) {
+        builder.addFieldOffset(47, vectorOfEnumsOffset, 0);
+    }
+    static createVectorOfEnumsVector(builder, data) {
+        builder.startVector(1, data.length, 1);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addInt8(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startVectorOfEnumsVector(builder, numElems) {
+        builder.startVector(1, numElems, 1);
+    }
+    static addSignedEnum(builder, signedEnum) {
+        builder.addFieldInt8(48, signedEnum, Race.None);
+    }
+    static addTestrequirednestedflatbuffer(builder, testrequirednestedflatbufferOffset) {
+        builder.addFieldOffset(49, testrequirednestedflatbufferOffset, 0);
+    }
+    static createTestrequirednestedflatbufferVector(builder, data) {
+        builder.startVector(1, data.length, 1);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addInt8(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startTestrequirednestedflatbufferVector(builder, numElems) {
+        builder.startVector(1, numElems, 1);
+    }
+    static addScalarKeySortedTables(builder, scalarKeySortedTablesOffset) {
+        builder.addFieldOffset(50, scalarKeySortedTablesOffset, 0);
+    }
+    static createScalarKeySortedTablesVector(builder, data) {
+        builder.startVector(4, data.length, 4);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addOffset(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startScalarKeySortedTablesVector(builder, numElems) {
+        builder.startVector(4, numElems, 4);
+    }
+    static addNativeInline(builder, nativeInlineOffset) {
+        builder.addFieldStruct(51, nativeInlineOffset, 0);
+    }
+    static addLongEnumNonEnumDefault(builder, longEnumNonEnumDefault) {
+        builder.addFieldInt64(52, longEnumNonEnumDefault, BigInt('0'));
+    }
+    static addLongEnumNormalDefault(builder, longEnumNormalDefault) {
+        builder.addFieldInt64(53, longEnumNormalDefault, BigInt('2'));
+    }
+    static endMonster(builder) {
+        const offset = builder.endObject();
+        builder.requiredField(offset, 10); // name
+        return offset;
+    }
+    static finishMonsterBuffer(builder, offset) {
+        builder.finish(offset, 'MONS');
+    }
+    static finishSizePrefixedMonsterBuffer(builder, offset) {
+        builder.finish(offset, 'MONS', true);
+    }
+    serialize() {
+        return this.bb.bytes();
+    }
+    static deserialize(buffer) {
+        return Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer));
+    }
+    unpack() {
+        return new MonsterT((this.pos() !== null ? this.pos().unpack() : null), this.mana(), this.hp(), this.name(), this.bb.createScalarList(this.inventory.bind(this), this.inventoryLength()), this.color(), this.testType(), (() => {
+            let temp = unionToAny(this.testType(), this.test.bind(this));
+            if (temp === null) {
+                return null;
+            }
+            return temp.unpack();
+        })(), this.bb.createObjList(this.test4.bind(this), this.test4Length()), this.bb.createScalarList(this.testarrayofstring.bind(this), this.testarrayofstringLength()), this.bb.createObjList(this.testarrayoftables.bind(this), this.testarrayoftablesLength()), (this.enemy() !== null ? this.enemy().unpack() : null), this.bb.createScalarList(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength()), (this.testempty() !== null ? this.testempty().unpack() : null), this.testbool(), this.testhashs32Fnv1(), this.testhashu32Fnv1(), this.testhashs64Fnv1(), this.testhashu64Fnv1(), this.testhashs32Fnv1a(), this.testhashu32Fnv1a(), this.testhashs64Fnv1a(), this.testhashu64Fnv1a(), this.bb.createScalarList(this.testarrayofbools.bind(this), this.testarrayofboolsLength()), this.testf(), this.testf2(), this.testf3(), this.bb.createScalarList(this.testarrayofstring2.bind(this), this.testarrayofstring2Length()), this.bb.createObjList(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength()), this.bb.createScalarList(this.flex.bind(this), this.flexLength()), this.bb.createObjList(this.test5.bind(this), this.test5Length()), this.bb.createScalarList(this.vectorOfLongs.bind(this), this.vectorOfLongsLength()), this.bb.createScalarList(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength()), (this.parentNamespaceTest() !== null ? this.parentNamespaceTest().unpack() : null), this.bb.createObjList(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength()), this.singleWeakReference(), this.bb.createScalarList(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength()), this.bb.createObjList(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength()), this.coOwningReference(), this.bb.createScalarList(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength()), this.nonOwningReference(), this.bb.createScalarList(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength()), this.anyUniqueType(), (() => {
+            let temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this));
+            if (temp === null) {
+                return null;
+            }
+            return temp.unpack();
+        })(), this.anyAmbiguousType(), (() => {
+            let temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
+            if (temp === null) {
+                return null;
+            }
+            return temp.unpack();
+        })(), this.bb.createScalarList(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength()), this.signedEnum(), this.bb.createScalarList(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength()), this.bb.createObjList(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength()), (this.nativeInline() !== null ? this.nativeInline().unpack() : null), this.longEnumNonEnumDefault(), this.longEnumNormalDefault());
+    }
+    unpackTo(_o) {
+        _o.pos = (this.pos() !== null ? this.pos().unpack() : null);
+        _o.mana = this.mana();
+        _o.hp = this.hp();
+        _o.name = this.name();
+        _o.inventory = this.bb.createScalarList(this.inventory.bind(this), this.inventoryLength());
+        _o.color = this.color();
+        _o.testType = this.testType();
+        _o.test = (() => {
+            let temp = unionToAny(this.testType(), this.test.bind(this));
+            if (temp === null) {
+                return null;
+            }
+            return temp.unpack();
+        })();
+        _o.test4 = this.bb.createObjList(this.test4.bind(this), this.test4Length());
+        _o.testarrayofstring = this.bb.createScalarList(this.testarrayofstring.bind(this), this.testarrayofstringLength());
+        _o.testarrayoftables = this.bb.createObjList(this.testarrayoftables.bind(this), this.testarrayoftablesLength());
+        _o.enemy = (this.enemy() !== null ? this.enemy().unpack() : null);
+        _o.testnestedflatbuffer = this.bb.createScalarList(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength());
+        _o.testempty = (this.testempty() !== null ? this.testempty().unpack() : null);
+        _o.testbool = this.testbool();
+        _o.testhashs32Fnv1 = this.testhashs32Fnv1();
+        _o.testhashu32Fnv1 = this.testhashu32Fnv1();
+        _o.testhashs64Fnv1 = this.testhashs64Fnv1();
+        _o.testhashu64Fnv1 = this.testhashu64Fnv1();
+        _o.testhashs32Fnv1a = this.testhashs32Fnv1a();
+        _o.testhashu32Fnv1a = this.testhashu32Fnv1a();
+        _o.testhashs64Fnv1a = this.testhashs64Fnv1a();
+        _o.testhashu64Fnv1a = this.testhashu64Fnv1a();
+        _o.testarrayofbools = this.bb.createScalarList(this.testarrayofbools.bind(this), this.testarrayofboolsLength());
+        _o.testf = this.testf();
+        _o.testf2 = this.testf2();
+        _o.testf3 = this.testf3();
+        _o.testarrayofstring2 = this.bb.createScalarList(this.testarrayofstring2.bind(this), this.testarrayofstring2Length());
+        _o.testarrayofsortedstruct = this.bb.createObjList(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength());
+        _o.flex = this.bb.createScalarList(this.flex.bind(this), this.flexLength());
+        _o.test5 = this.bb.createObjList(this.test5.bind(this), this.test5Length());
+        _o.vectorOfLongs = this.bb.createScalarList(this.vectorOfLongs.bind(this), this.vectorOfLongsLength());
+        _o.vectorOfDoubles = this.bb.createScalarList(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength());
+        _o.parentNamespaceTest = (this.parentNamespaceTest() !== null ? this.parentNamespaceTest().unpack() : null);
+        _o.vectorOfReferrables = this.bb.createObjList(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength());
+        _o.singleWeakReference = this.singleWeakReference();
+        _o.vectorOfWeakReferences = this.bb.createScalarList(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength());
+        _o.vectorOfStrongReferrables = this.bb.createObjList(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength());
+        _o.coOwningReference = this.coOwningReference();
+        _o.vectorOfCoOwningReferences = this.bb.createScalarList(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength());
+        _o.nonOwningReference = this.nonOwningReference();
+        _o.vectorOfNonOwningReferences = this.bb.createScalarList(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength());
+        _o.anyUniqueType = this.anyUniqueType();
+        _o.anyUnique = (() => {
+            let temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this));
+            if (temp === null) {
+                return null;
+            }
+            return temp.unpack();
+        })();
+        _o.anyAmbiguousType = this.anyAmbiguousType();
+        _o.anyAmbiguous = (() => {
+            let temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
+            if (temp === null) {
+                return null;
+            }
+            return temp.unpack();
+        })();
+        _o.vectorOfEnums = this.bb.createScalarList(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength());
+        _o.signedEnum = this.signedEnum();
+        _o.testrequirednestedflatbuffer = this.bb.createScalarList(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength());
+        _o.scalarKeySortedTables = this.bb.createObjList(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength());
+        _o.nativeInline = (this.nativeInline() !== null ? this.nativeInline().unpack() : null);
+        _o.longEnumNonEnumDefault = this.longEnumNonEnumDefault();
+        _o.longEnumNormalDefault = this.longEnumNormalDefault();
+    }
+}
+export class MonsterT {
+    constructor(pos = null, mana = 150, hp = 100, name = null, inventory = [], color = Color.Blue, testType = Any.NONE, test = null, test4 = [], testarrayofstring = [], testarrayoftables = [], enemy = null, testnestedflatbuffer = [], testempty = null, testbool = false, testhashs32Fnv1 = 0, testhashu32Fnv1 = 0, testhashs64Fnv1 = BigInt('0'), testhashu64Fnv1 = BigInt('0'), testhashs32Fnv1a = 0, testhashu32Fnv1a = 0, testhashs64Fnv1a = BigInt('0'), testhashu64Fnv1a = BigInt('0'), testarrayofbools = [], testf = 3.14159, testf2 = 3.0, testf3 = 0.0, testarrayofstring2 = [], testarrayofsortedstruct = [], flex = [], test5 = [], vectorOfLongs = [], vectorOfDoubles = [], parentNamespaceTest = null, vectorOfReferrables = [], singleWeakReference = BigInt('0'), vectorOfWeakReferences = [], vectorOfStrongReferrables = [], coOwningReference = BigInt('0'), vectorOfCoOwningReferences = [], nonOwningReference = BigInt('0'), vectorOfNonOwningReferences = [], anyUniqueType = AnyUniqueAliases.NONE, anyUnique = null, anyAmbiguousType = AnyAmbiguousAliases.NONE, anyAmbiguous = null, vectorOfEnums = [], signedEnum = Race.None, testrequirednestedflatbuffer = [], scalarKeySortedTables = [], nativeInline = null, longEnumNonEnumDefault = BigInt('0'), longEnumNormalDefault = BigInt('2')) {
+        this.pos = pos;
+        this.mana = mana;
+        this.hp = hp;
+        this.name = name;
+        this.inventory = inventory;
+        this.color = color;
+        this.testType = testType;
+        this.test = test;
+        this.test4 = test4;
+        this.testarrayofstring = testarrayofstring;
+        this.testarrayoftables = testarrayoftables;
+        this.enemy = enemy;
+        this.testnestedflatbuffer = testnestedflatbuffer;
+        this.testempty = testempty;
+        this.testbool = testbool;
+        this.testhashs32Fnv1 = testhashs32Fnv1;
+        this.testhashu32Fnv1 = testhashu32Fnv1;
+        this.testhashs64Fnv1 = testhashs64Fnv1;
+        this.testhashu64Fnv1 = testhashu64Fnv1;
+        this.testhashs32Fnv1a = testhashs32Fnv1a;
+        this.testhashu32Fnv1a = testhashu32Fnv1a;
+        this.testhashs64Fnv1a = testhashs64Fnv1a;
+        this.testhashu64Fnv1a = testhashu64Fnv1a;
+        this.testarrayofbools = testarrayofbools;
+        this.testf = testf;
+        this.testf2 = testf2;
+        this.testf3 = testf3;
+        this.testarrayofstring2 = testarrayofstring2;
+        this.testarrayofsortedstruct = testarrayofsortedstruct;
+        this.flex = flex;
+        this.test5 = test5;
+        this.vectorOfLongs = vectorOfLongs;
+        this.vectorOfDoubles = vectorOfDoubles;
+        this.parentNamespaceTest = parentNamespaceTest;
+        this.vectorOfReferrables = vectorOfReferrables;
+        this.singleWeakReference = singleWeakReference;
+        this.vectorOfWeakReferences = vectorOfWeakReferences;
+        this.vectorOfStrongReferrables = vectorOfStrongReferrables;
+        this.coOwningReference = coOwningReference;
+        this.vectorOfCoOwningReferences = vectorOfCoOwningReferences;
+        this.nonOwningReference = nonOwningReference;
+        this.vectorOfNonOwningReferences = vectorOfNonOwningReferences;
+        this.anyUniqueType = anyUniqueType;
+        this.anyUnique = anyUnique;
+        this.anyAmbiguousType = anyAmbiguousType;
+        this.anyAmbiguous = anyAmbiguous;
+        this.vectorOfEnums = vectorOfEnums;
+        this.signedEnum = signedEnum;
+        this.testrequirednestedflatbuffer = testrequirednestedflatbuffer;
+        this.scalarKeySortedTables = scalarKeySortedTables;
+        this.nativeInline = nativeInline;
+        this.longEnumNonEnumDefault = longEnumNonEnumDefault;
+        this.longEnumNormalDefault = longEnumNormalDefault;
+    }
+    pack(builder) {
+        const name = (this.name !== null ? builder.createString(this.name) : 0);
+        const inventory = Monster.createInventoryVector(builder, this.inventory);
+        const test = builder.createObjectOffset(this.test);
+        const test4 = builder.createStructOffsetList(this.test4, Monster.startTest4Vector);
+        const testarrayofstring = Monster.createTestarrayofstringVector(builder, builder.createObjectOffsetList(this.testarrayofstring));
+        const testarrayoftables = Monster.createTestarrayoftablesVector(builder, builder.createObjectOffsetList(this.testarrayoftables));
+        const enemy = (this.enemy !== null ? this.enemy.pack(builder) : 0);
+        const testnestedflatbuffer = Monster.createTestnestedflatbufferVector(builder, this.testnestedflatbuffer);
+        const testempty = (this.testempty !== null ? this.testempty.pack(builder) : 0);
+        const testarrayofbools = Monster.createTestarrayofboolsVector(builder, this.testarrayofbools);
+        const testarrayofstring2 = Monster.createTestarrayofstring2Vector(builder, builder.createObjectOffsetList(this.testarrayofstring2));
+        const testarrayofsortedstruct = builder.createStructOffsetList(this.testarrayofsortedstruct, Monster.startTestarrayofsortedstructVector);
+        const flex = Monster.createFlexVector(builder, this.flex);
+        const test5 = builder.createStructOffsetList(this.test5, Monster.startTest5Vector);
+        const vectorOfLongs = Monster.createVectorOfLongsVector(builder, this.vectorOfLongs);
+        const vectorOfDoubles = Monster.createVectorOfDoublesVector(builder, this.vectorOfDoubles);
+        const parentNamespaceTest = (this.parentNamespaceTest !== null ? this.parentNamespaceTest.pack(builder) : 0);
+        const vectorOfReferrables = Monster.createVectorOfReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfReferrables));
+        const vectorOfWeakReferences = Monster.createVectorOfWeakReferencesVector(builder, this.vectorOfWeakReferences);
+        const vectorOfStrongReferrables = Monster.createVectorOfStrongReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfStrongReferrables));
+        const vectorOfCoOwningReferences = Monster.createVectorOfCoOwningReferencesVector(builder, this.vectorOfCoOwningReferences);
+        const vectorOfNonOwningReferences = Monster.createVectorOfNonOwningReferencesVector(builder, this.vectorOfNonOwningReferences);
+        const anyUnique = builder.createObjectOffset(this.anyUnique);
+        const anyAmbiguous = builder.createObjectOffset(this.anyAmbiguous);
+        const vectorOfEnums = Monster.createVectorOfEnumsVector(builder, this.vectorOfEnums);
+        const testrequirednestedflatbuffer = Monster.createTestrequirednestedflatbufferVector(builder, this.testrequirednestedflatbuffer);
+        const scalarKeySortedTables = Monster.createScalarKeySortedTablesVector(builder, builder.createObjectOffsetList(this.scalarKeySortedTables));
+        Monster.startMonster(builder);
+        Monster.addPos(builder, (this.pos !== null ? this.pos.pack(builder) : 0));
+        Monster.addMana(builder, this.mana);
+        Monster.addHp(builder, this.hp);
+        Monster.addName(builder, name);
+        Monster.addInventory(builder, inventory);
+        Monster.addColor(builder, this.color);
+        Monster.addTestType(builder, this.testType);
+        Monster.addTest(builder, test);
+        Monster.addTest4(builder, test4);
+        Monster.addTestarrayofstring(builder, testarrayofstring);
+        Monster.addTestarrayoftables(builder, testarrayoftables);
+        Monster.addEnemy(builder, enemy);
+        Monster.addTestnestedflatbuffer(builder, testnestedflatbuffer);
+        Monster.addTestempty(builder, testempty);
+        Monster.addTestbool(builder, this.testbool);
+        Monster.addTesthashs32Fnv1(builder, this.testhashs32Fnv1);
+        Monster.addTesthashu32Fnv1(builder, this.testhashu32Fnv1);
+        Monster.addTesthashs64Fnv1(builder, this.testhashs64Fnv1);
+        Monster.addTesthashu64Fnv1(builder, this.testhashu64Fnv1);
+        Monster.addTesthashs32Fnv1a(builder, this.testhashs32Fnv1a);
+        Monster.addTesthashu32Fnv1a(builder, this.testhashu32Fnv1a);
+        Monster.addTesthashs64Fnv1a(builder, this.testhashs64Fnv1a);
+        Monster.addTesthashu64Fnv1a(builder, this.testhashu64Fnv1a);
+        Monster.addTestarrayofbools(builder, testarrayofbools);
+        Monster.addTestf(builder, this.testf);
+        Monster.addTestf2(builder, this.testf2);
+        Monster.addTestf3(builder, this.testf3);
+        Monster.addTestarrayofstring2(builder, testarrayofstring2);
+        Monster.addTestarrayofsortedstruct(builder, testarrayofsortedstruct);
+        Monster.addFlex(builder, flex);
+        Monster.addTest5(builder, test5);
+        Monster.addVectorOfLongs(builder, vectorOfLongs);
+        Monster.addVectorOfDoubles(builder, vectorOfDoubles);
+        Monster.addParentNamespaceTest(builder, parentNamespaceTest);
+        Monster.addVectorOfReferrables(builder, vectorOfReferrables);
+        Monster.addSingleWeakReference(builder, this.singleWeakReference);
+        Monster.addVectorOfWeakReferences(builder, vectorOfWeakReferences);
+        Monster.addVectorOfStrongReferrables(builder, vectorOfStrongReferrables);
+        Monster.addCoOwningReference(builder, this.coOwningReference);
+        Monster.addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferences);
+        Monster.addNonOwningReference(builder, this.nonOwningReference);
+        Monster.addVectorOfNonOwningReferences(builder, vectorOfNonOwningReferences);
+        Monster.addAnyUniqueType(builder, this.anyUniqueType);
+        Monster.addAnyUnique(builder, anyUnique);
+        Monster.addAnyAmbiguousType(builder, this.anyAmbiguousType);
+        Monster.addAnyAmbiguous(builder, anyAmbiguous);
+        Monster.addVectorOfEnums(builder, vectorOfEnums);
+        Monster.addSignedEnum(builder, this.signedEnum);
+        Monster.addTestrequirednestedflatbuffer(builder, testrequirednestedflatbuffer);
+        Monster.addScalarKeySortedTables(builder, scalarKeySortedTables);
+        Monster.addNativeInline(builder, (this.nativeInline !== null ? this.nativeInline.pack(builder) : 0));
+        Monster.addLongEnumNonEnumDefault(builder, this.longEnumNonEnumDefault);
+        Monster.addLongEnumNormalDefault(builder, this.longEnumNormalDefault);
+        return Monster.endMonster(builder);
+    }
+}
diff --git a/tests/ts/my-game/example/monster.ts b/tests/ts/my-game/example/monster.ts
new file mode 100644
index 0000000..63e5768
--- /dev/null
+++ b/tests/ts/my-game/example/monster.ts
@@ -0,0 +1,1434 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+import { Monster as MyGame_Example2_Monster, MonsterT as MyGame_Example2_MonsterT } from '../../my-game/example2/monster.js';
+import { Ability, AbilityT } from '../../my-game/example/ability.js';
+import { Any, unionToAny, unionListToAny } from '../../my-game/example/any.js';
+import { AnyAmbiguousAliases, unionToAnyAmbiguousAliases, unionListToAnyAmbiguousAliases } from '../../my-game/example/any-ambiguous-aliases.js';
+import { AnyUniqueAliases, unionToAnyUniqueAliases, unionListToAnyUniqueAliases } from '../../my-game/example/any-unique-aliases.js';
+import { Color } from '../../my-game/example/color.js';
+import { Race } from '../../my-game/example/race.js';
+import { Referrable, ReferrableT } from '../../my-game/example/referrable.js';
+import { Stat, StatT } from '../../my-game/example/stat.js';
+import { Test, TestT } from '../../my-game/example/test.js';
+import { TestSimpleTableWithEnum, TestSimpleTableWithEnumT } from '../../my-game/example/test-simple-table-with-enum.js';
+import { Vec3, Vec3T } from '../../my-game/example/vec3.js';
+import { InParentNamespace, InParentNamespaceT } from '../../my-game/in-parent-namespace.js';
+
+
+/**
+ * an example documentation comment: "monster object"
+ */
+export class Monster {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):Monster {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+static getRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:Monster):Monster {
+  return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+static getSizePrefixedRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:Monster):Monster {
+  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+  return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean {
+  return bb.__has_identifier('MONS');
+}
+
+pos(obj?:Vec3):Vec3|null {
+  const offset = this.bb!.__offset(this.bb_pos, 4);
+  return offset ? (obj || new Vec3()).__init(this.bb_pos + offset, this.bb!) : null;
+}
+
+mana():number {
+  const offset = this.bb!.__offset(this.bb_pos, 6);
+  return offset ? this.bb!.readInt16(this.bb_pos + offset) : 150;
+}
+
+mutate_mana(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 6);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt16(this.bb_pos + offset, value);
+  return true;
+}
+
+hp():number {
+  const offset = this.bb!.__offset(this.bb_pos, 8);
+  return offset ? this.bb!.readInt16(this.bb_pos + offset) : 100;
+}
+
+mutate_hp(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 8);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt16(this.bb_pos + offset, value);
+  return true;
+}
+
+name():string|null
+name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
+name(optionalEncoding?:any):string|Uint8Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 10);
+  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
+}
+
+inventory(index: number):number|null {
+  const offset = this.bb!.__offset(this.bb_pos, 14);
+  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
+}
+
+inventoryLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 14);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+inventoryArray():Uint8Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 14);
+  return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
+}
+
+color():Color {
+  const offset = this.bb!.__offset(this.bb_pos, 16);
+  return offset ? this.bb!.readUint8(this.bb_pos + offset) : Color.Blue;
+}
+
+mutate_color(value:Color):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 16);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint8(this.bb_pos + offset, value);
+  return true;
+}
+
+testType():Any {
+  const offset = this.bb!.__offset(this.bb_pos, 18);
+  return offset ? this.bb!.readUint8(this.bb_pos + offset) : Any.NONE;
+}
+
+test<T extends flatbuffers.Table>(obj:any):any|null {
+  const offset = this.bb!.__offset(this.bb_pos, 20);
+  return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
+}
+
+test4(index: number, obj?:Test):Test|null {
+  const offset = this.bb!.__offset(this.bb_pos, 22);
+  return offset ? (obj || new Test()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null;
+}
+
+test4Length():number {
+  const offset = this.bb!.__offset(this.bb_pos, 22);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+testarrayofstring(index: number):string
+testarrayofstring(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
+testarrayofstring(index: number,optionalEncoding?:any):string|Uint8Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 24);
+  return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
+}
+
+testarrayofstringLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 24);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+/**
+ * an example documentation comment: this will end up in the generated code
+ * multiline too
+ */
+testarrayoftables(index: number, obj?:Monster):Monster|null {
+  const offset = this.bb!.__offset(this.bb_pos, 26);
+  return offset ? (obj || new Monster()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
+}
+
+testarrayoftablesLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 26);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+enemy(obj?:Monster):Monster|null {
+  const offset = this.bb!.__offset(this.bb_pos, 28);
+  return offset ? (obj || new Monster()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
+}
+
+testnestedflatbuffer(index: number):number|null {
+  const offset = this.bb!.__offset(this.bb_pos, 30);
+  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
+}
+
+testnestedflatbufferLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 30);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+testnestedflatbufferArray():Uint8Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 30);
+  return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
+}
+
+testempty(obj?:Stat):Stat|null {
+  const offset = this.bb!.__offset(this.bb_pos, 32);
+  return offset ? (obj || new Stat()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
+}
+
+testbool():boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 34);
+  return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
+}
+
+mutate_testbool(value:boolean):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 34);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt8(this.bb_pos + offset, +value);
+  return true;
+}
+
+testhashs32Fnv1():number {
+  const offset = this.bb!.__offset(this.bb_pos, 36);
+  return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
+}
+
+mutate_testhashs32_fnv1(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 36);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt32(this.bb_pos + offset, value);
+  return true;
+}
+
+testhashu32Fnv1():number {
+  const offset = this.bb!.__offset(this.bb_pos, 38);
+  return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
+}
+
+mutate_testhashu32_fnv1(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 38);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint32(this.bb_pos + offset, value);
+  return true;
+}
+
+testhashs64Fnv1():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 40);
+  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_testhashs64_fnv1(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 40);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt64(this.bb_pos + offset, value);
+  return true;
+}
+
+testhashu64Fnv1():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 42);
+  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_testhashu64_fnv1(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 42);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint64(this.bb_pos + offset, value);
+  return true;
+}
+
+testhashs32Fnv1a():number {
+  const offset = this.bb!.__offset(this.bb_pos, 44);
+  return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
+}
+
+mutate_testhashs32_fnv1a(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 44);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt32(this.bb_pos + offset, value);
+  return true;
+}
+
+testhashu32Fnv1a():number {
+  const offset = this.bb!.__offset(this.bb_pos, 46);
+  return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
+}
+
+mutate_testhashu32_fnv1a(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 46);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint32(this.bb_pos + offset, value);
+  return true;
+}
+
+testhashs64Fnv1a():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 48);
+  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_testhashs64_fnv1a(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 48);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt64(this.bb_pos + offset, value);
+  return true;
+}
+
+testhashu64Fnv1a():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 50);
+  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_testhashu64_fnv1a(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 50);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint64(this.bb_pos + offset, value);
+  return true;
+}
+
+testarrayofbools(index: number):boolean|null {
+  const offset = this.bb!.__offset(this.bb_pos, 52);
+  return offset ? !!this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : false;
+}
+
+testarrayofboolsLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 52);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+testarrayofboolsArray():Int8Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 52);
+  return offset ? new Int8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
+}
+
+testf():number {
+  const offset = this.bb!.__offset(this.bb_pos, 54);
+  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.14159;
+}
+
+mutate_testf(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 54);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeFloat32(this.bb_pos + offset, value);
+  return true;
+}
+
+testf2():number {
+  const offset = this.bb!.__offset(this.bb_pos, 56);
+  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.0;
+}
+
+mutate_testf2(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 56);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeFloat32(this.bb_pos + offset, value);
+  return true;
+}
+
+testf3():number {
+  const offset = this.bb!.__offset(this.bb_pos, 58);
+  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
+}
+
+mutate_testf3(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 58);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeFloat32(this.bb_pos + offset, value);
+  return true;
+}
+
+testarrayofstring2(index: number):string
+testarrayofstring2(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
+testarrayofstring2(index: number,optionalEncoding?:any):string|Uint8Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 60);
+  return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
+}
+
+testarrayofstring2Length():number {
+  const offset = this.bb!.__offset(this.bb_pos, 60);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+testarrayofsortedstruct(index: number, obj?:Ability):Ability|null {
+  const offset = this.bb!.__offset(this.bb_pos, 62);
+  return offset ? (obj || new Ability()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 8, this.bb!) : null;
+}
+
+testarrayofsortedstructLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 62);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+flex(index: number):number|null {
+  const offset = this.bb!.__offset(this.bb_pos, 64);
+  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
+}
+
+flexLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 64);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+flexArray():Uint8Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 64);
+  return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
+}
+
+test5(index: number, obj?:Test):Test|null {
+  const offset = this.bb!.__offset(this.bb_pos, 66);
+  return offset ? (obj || new Test()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null;
+}
+
+test5Length():number {
+  const offset = this.bb!.__offset(this.bb_pos, 66);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+vectorOfLongs(index: number):bigint|null {
+  const offset = this.bb!.__offset(this.bb_pos, 68);
+  return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+}
+
+vectorOfLongsLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 68);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+vectorOfDoubles(index: number):number|null {
+  const offset = this.bb!.__offset(this.bb_pos, 70);
+  return offset ? this.bb!.readFloat64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : 0;
+}
+
+vectorOfDoublesLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 70);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+vectorOfDoublesArray():Float64Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 70);
+  return offset ? new Float64Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
+}
+
+parentNamespaceTest(obj?:InParentNamespace):InParentNamespace|null {
+  const offset = this.bb!.__offset(this.bb_pos, 72);
+  return offset ? (obj || new InParentNamespace()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
+}
+
+vectorOfReferrables(index: number, obj?:Referrable):Referrable|null {
+  const offset = this.bb!.__offset(this.bb_pos, 74);
+  return offset ? (obj || new Referrable()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
+}
+
+vectorOfReferrablesLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 74);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+singleWeakReference():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 76);
+  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_single_weak_reference(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 76);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint64(this.bb_pos + offset, value);
+  return true;
+}
+
+vectorOfWeakReferences(index: number):bigint|null {
+  const offset = this.bb!.__offset(this.bb_pos, 78);
+  return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+}
+
+vectorOfWeakReferencesLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 78);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+vectorOfStrongReferrables(index: number, obj?:Referrable):Referrable|null {
+  const offset = this.bb!.__offset(this.bb_pos, 80);
+  return offset ? (obj || new Referrable()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
+}
+
+vectorOfStrongReferrablesLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 80);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+coOwningReference():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 82);
+  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_co_owning_reference(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 82);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint64(this.bb_pos + offset, value);
+  return true;
+}
+
+vectorOfCoOwningReferences(index: number):bigint|null {
+  const offset = this.bb!.__offset(this.bb_pos, 84);
+  return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+}
+
+vectorOfCoOwningReferencesLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 84);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+nonOwningReference():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 86);
+  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_non_owning_reference(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 86);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint64(this.bb_pos + offset, value);
+  return true;
+}
+
+vectorOfNonOwningReferences(index: number):bigint|null {
+  const offset = this.bb!.__offset(this.bb_pos, 88);
+  return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
+}
+
+vectorOfNonOwningReferencesLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 88);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+anyUniqueType():AnyUniqueAliases {
+  const offset = this.bb!.__offset(this.bb_pos, 90);
+  return offset ? this.bb!.readUint8(this.bb_pos + offset) : AnyUniqueAliases.NONE;
+}
+
+anyUnique<T extends flatbuffers.Table>(obj:any):any|null {
+  const offset = this.bb!.__offset(this.bb_pos, 92);
+  return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
+}
+
+anyAmbiguousType():AnyAmbiguousAliases {
+  const offset = this.bb!.__offset(this.bb_pos, 94);
+  return offset ? this.bb!.readUint8(this.bb_pos + offset) : AnyAmbiguousAliases.NONE;
+}
+
+anyAmbiguous<T extends flatbuffers.Table>(obj:any):any|null {
+  const offset = this.bb!.__offset(this.bb_pos, 96);
+  return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
+}
+
+vectorOfEnums(index: number):Color|null {
+  const offset = this.bb!.__offset(this.bb_pos, 98);
+  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
+}
+
+vectorOfEnumsLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 98);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+vectorOfEnumsArray():Uint8Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 98);
+  return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
+}
+
+signedEnum():Race {
+  const offset = this.bb!.__offset(this.bb_pos, 100);
+  return offset ? this.bb!.readInt8(this.bb_pos + offset) : Race.None;
+}
+
+mutate_signed_enum(value:Race):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 100);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt8(this.bb_pos + offset, value);
+  return true;
+}
+
+testrequirednestedflatbuffer(index: number):number|null {
+  const offset = this.bb!.__offset(this.bb_pos, 102);
+  return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
+}
+
+testrequirednestedflatbufferLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 102);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+testrequirednestedflatbufferArray():Uint8Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 102);
+  return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
+}
+
+scalarKeySortedTables(index: number, obj?:Stat):Stat|null {
+  const offset = this.bb!.__offset(this.bb_pos, 104);
+  return offset ? (obj || new Stat()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
+}
+
+scalarKeySortedTablesLength():number {
+  const offset = this.bb!.__offset(this.bb_pos, 104);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+nativeInline(obj?:Test):Test|null {
+  const offset = this.bb!.__offset(this.bb_pos, 106);
+  return offset ? (obj || new Test()).__init(this.bb_pos + offset, this.bb!) : null;
+}
+
+longEnumNonEnumDefault():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 108);
+  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_long_enum_non_enum_default(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 108);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint64(this.bb_pos + offset, value);
+  return true;
+}
+
+longEnumNormalDefault():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 110);
+  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('2');
+}
+
+mutate_long_enum_normal_default(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 110);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint64(this.bb_pos + offset, value);
+  return true;
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_Example_Monster';
+}
+
+static startMonster(builder:flatbuffers.Builder) {
+  builder.startObject(54);
+}
+
+static addPos(builder:flatbuffers.Builder, posOffset:flatbuffers.Offset) {
+  builder.addFieldStruct(0, posOffset, 0);
+}
+
+static addMana(builder:flatbuffers.Builder, mana:number) {
+  builder.addFieldInt16(1, mana, 150);
+}
+
+static addHp(builder:flatbuffers.Builder, hp:number) {
+  builder.addFieldInt16(2, hp, 100);
+}
+
+static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(3, nameOffset, 0);
+}
+
+static addInventory(builder:flatbuffers.Builder, inventoryOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(5, inventoryOffset, 0);
+}
+
+static createInventoryVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
+  builder.startVector(1, data.length, 1);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addInt8(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startInventoryVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(1, numElems, 1);
+}
+
+static addColor(builder:flatbuffers.Builder, color:Color) {
+  builder.addFieldInt8(6, color, Color.Blue);
+}
+
+static addTestType(builder:flatbuffers.Builder, testType:Any) {
+  builder.addFieldInt8(7, testType, Any.NONE);
+}
+
+static addTest(builder:flatbuffers.Builder, testOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(8, testOffset, 0);
+}
+
+static addTest4(builder:flatbuffers.Builder, test4Offset:flatbuffers.Offset) {
+  builder.addFieldOffset(9, test4Offset, 0);
+}
+
+static startTest4Vector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(4, numElems, 2);
+}
+
+static addTestarrayofstring(builder:flatbuffers.Builder, testarrayofstringOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(10, testarrayofstringOffset, 0);
+}
+
+static createTestarrayofstringVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
+  builder.startVector(4, data.length, 4);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addOffset(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startTestarrayofstringVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(4, numElems, 4);
+}
+
+static addTestarrayoftables(builder:flatbuffers.Builder, testarrayoftablesOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(11, testarrayoftablesOffset, 0);
+}
+
+static createTestarrayoftablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
+  builder.startVector(4, data.length, 4);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addOffset(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startTestarrayoftablesVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(4, numElems, 4);
+}
+
+static addEnemy(builder:flatbuffers.Builder, enemyOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(12, enemyOffset, 0);
+}
+
+static addTestnestedflatbuffer(builder:flatbuffers.Builder, testnestedflatbufferOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(13, testnestedflatbufferOffset, 0);
+}
+
+static createTestnestedflatbufferVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
+  builder.startVector(1, data.length, 1);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addInt8(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startTestnestedflatbufferVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(1, numElems, 1);
+}
+
+static addTestempty(builder:flatbuffers.Builder, testemptyOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(14, testemptyOffset, 0);
+}
+
+static addTestbool(builder:flatbuffers.Builder, testbool:boolean) {
+  builder.addFieldInt8(15, +testbool, +false);
+}
+
+static addTesthashs32Fnv1(builder:flatbuffers.Builder, testhashs32Fnv1:number) {
+  builder.addFieldInt32(16, testhashs32Fnv1, 0);
+}
+
+static addTesthashu32Fnv1(builder:flatbuffers.Builder, testhashu32Fnv1:number) {
+  builder.addFieldInt32(17, testhashu32Fnv1, 0);
+}
+
+static addTesthashs64Fnv1(builder:flatbuffers.Builder, testhashs64Fnv1:bigint) {
+  builder.addFieldInt64(18, testhashs64Fnv1, BigInt('0'));
+}
+
+static addTesthashu64Fnv1(builder:flatbuffers.Builder, testhashu64Fnv1:bigint) {
+  builder.addFieldInt64(19, testhashu64Fnv1, BigInt('0'));
+}
+
+static addTesthashs32Fnv1a(builder:flatbuffers.Builder, testhashs32Fnv1a:number) {
+  builder.addFieldInt32(20, testhashs32Fnv1a, 0);
+}
+
+static addTesthashu32Fnv1a(builder:flatbuffers.Builder, testhashu32Fnv1a:number) {
+  builder.addFieldInt32(21, testhashu32Fnv1a, 0);
+}
+
+static addTesthashs64Fnv1a(builder:flatbuffers.Builder, testhashs64Fnv1a:bigint) {
+  builder.addFieldInt64(22, testhashs64Fnv1a, BigInt('0'));
+}
+
+static addTesthashu64Fnv1a(builder:flatbuffers.Builder, testhashu64Fnv1a:bigint) {
+  builder.addFieldInt64(23, testhashu64Fnv1a, BigInt('0'));
+}
+
+static addTestarrayofbools(builder:flatbuffers.Builder, testarrayofboolsOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(24, testarrayofboolsOffset, 0);
+}
+
+static createTestarrayofboolsVector(builder:flatbuffers.Builder, data:boolean[]):flatbuffers.Offset {
+  builder.startVector(1, data.length, 1);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addInt8(+data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startTestarrayofboolsVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(1, numElems, 1);
+}
+
+static addTestf(builder:flatbuffers.Builder, testf:number) {
+  builder.addFieldFloat32(25, testf, 3.14159);
+}
+
+static addTestf2(builder:flatbuffers.Builder, testf2:number) {
+  builder.addFieldFloat32(26, testf2, 3.0);
+}
+
+static addTestf3(builder:flatbuffers.Builder, testf3:number) {
+  builder.addFieldFloat32(27, testf3, 0.0);
+}
+
+static addTestarrayofstring2(builder:flatbuffers.Builder, testarrayofstring2Offset:flatbuffers.Offset) {
+  builder.addFieldOffset(28, testarrayofstring2Offset, 0);
+}
+
+static createTestarrayofstring2Vector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
+  builder.startVector(4, data.length, 4);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addOffset(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startTestarrayofstring2Vector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(4, numElems, 4);
+}
+
+static addTestarrayofsortedstruct(builder:flatbuffers.Builder, testarrayofsortedstructOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(29, testarrayofsortedstructOffset, 0);
+}
+
+static startTestarrayofsortedstructVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(8, numElems, 4);
+}
+
+static addFlex(builder:flatbuffers.Builder, flexOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(30, flexOffset, 0);
+}
+
+static createFlexVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
+  builder.startVector(1, data.length, 1);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addInt8(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startFlexVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(1, numElems, 1);
+}
+
+static addTest5(builder:flatbuffers.Builder, test5Offset:flatbuffers.Offset) {
+  builder.addFieldOffset(31, test5Offset, 0);
+}
+
+static startTest5Vector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(4, numElems, 2);
+}
+
+static addVectorOfLongs(builder:flatbuffers.Builder, vectorOfLongsOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(32, vectorOfLongsOffset, 0);
+}
+
+static createVectorOfLongsVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
+  builder.startVector(8, data.length, 8);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addInt64(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startVectorOfLongsVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(8, numElems, 8);
+}
+
+static addVectorOfDoubles(builder:flatbuffers.Builder, vectorOfDoublesOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(33, vectorOfDoublesOffset, 0);
+}
+
+static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Float64Array):flatbuffers.Offset;
+/**
+ * @deprecated This Uint8Array overload will be removed in the future.
+ */
+static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
+static createVectorOfDoublesVector(builder:flatbuffers.Builder, data:number[]|Float64Array|Uint8Array):flatbuffers.Offset {
+  builder.startVector(8, data.length, 8);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addFloat64(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startVectorOfDoublesVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(8, numElems, 8);
+}
+
+static addParentNamespaceTest(builder:flatbuffers.Builder, parentNamespaceTestOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(34, parentNamespaceTestOffset, 0);
+}
+
+static addVectorOfReferrables(builder:flatbuffers.Builder, vectorOfReferrablesOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(35, vectorOfReferrablesOffset, 0);
+}
+
+static createVectorOfReferrablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
+  builder.startVector(4, data.length, 4);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addOffset(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startVectorOfReferrablesVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(4, numElems, 4);
+}
+
+static addSingleWeakReference(builder:flatbuffers.Builder, singleWeakReference:bigint) {
+  builder.addFieldInt64(36, singleWeakReference, BigInt('0'));
+}
+
+static addVectorOfWeakReferences(builder:flatbuffers.Builder, vectorOfWeakReferencesOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(37, vectorOfWeakReferencesOffset, 0);
+}
+
+static createVectorOfWeakReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
+  builder.startVector(8, data.length, 8);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addInt64(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startVectorOfWeakReferencesVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(8, numElems, 8);
+}
+
+static addVectorOfStrongReferrables(builder:flatbuffers.Builder, vectorOfStrongReferrablesOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(38, vectorOfStrongReferrablesOffset, 0);
+}
+
+static createVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
+  builder.startVector(4, data.length, 4);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addOffset(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startVectorOfStrongReferrablesVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(4, numElems, 4);
+}
+
+static addCoOwningReference(builder:flatbuffers.Builder, coOwningReference:bigint) {
+  builder.addFieldInt64(39, coOwningReference, BigInt('0'));
+}
+
+static addVectorOfCoOwningReferences(builder:flatbuffers.Builder, vectorOfCoOwningReferencesOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(40, vectorOfCoOwningReferencesOffset, 0);
+}
+
+static createVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
+  builder.startVector(8, data.length, 8);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addInt64(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startVectorOfCoOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(8, numElems, 8);
+}
+
+static addNonOwningReference(builder:flatbuffers.Builder, nonOwningReference:bigint) {
+  builder.addFieldInt64(41, nonOwningReference, BigInt('0'));
+}
+
+static addVectorOfNonOwningReferences(builder:flatbuffers.Builder, vectorOfNonOwningReferencesOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(42, vectorOfNonOwningReferencesOffset, 0);
+}
+
+static createVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, data:bigint[]):flatbuffers.Offset {
+  builder.startVector(8, data.length, 8);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addInt64(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startVectorOfNonOwningReferencesVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(8, numElems, 8);
+}
+
+static addAnyUniqueType(builder:flatbuffers.Builder, anyUniqueType:AnyUniqueAliases) {
+  builder.addFieldInt8(43, anyUniqueType, AnyUniqueAliases.NONE);
+}
+
+static addAnyUnique(builder:flatbuffers.Builder, anyUniqueOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(44, anyUniqueOffset, 0);
+}
+
+static addAnyAmbiguousType(builder:flatbuffers.Builder, anyAmbiguousType:AnyAmbiguousAliases) {
+  builder.addFieldInt8(45, anyAmbiguousType, AnyAmbiguousAliases.NONE);
+}
+
+static addAnyAmbiguous(builder:flatbuffers.Builder, anyAmbiguousOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(46, anyAmbiguousOffset, 0);
+}
+
+static addVectorOfEnums(builder:flatbuffers.Builder, vectorOfEnumsOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(47, vectorOfEnumsOffset, 0);
+}
+
+static createVectorOfEnumsVector(builder:flatbuffers.Builder, data:Color[]):flatbuffers.Offset {
+  builder.startVector(1, data.length, 1);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addInt8(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startVectorOfEnumsVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(1, numElems, 1);
+}
+
+static addSignedEnum(builder:flatbuffers.Builder, signedEnum:Race) {
+  builder.addFieldInt8(48, signedEnum, Race.None);
+}
+
+static addTestrequirednestedflatbuffer(builder:flatbuffers.Builder, testrequirednestedflatbufferOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(49, testrequirednestedflatbufferOffset, 0);
+}
+
+static createTestrequirednestedflatbufferVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
+  builder.startVector(1, data.length, 1);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addInt8(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startTestrequirednestedflatbufferVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(1, numElems, 1);
+}
+
+static addScalarKeySortedTables(builder:flatbuffers.Builder, scalarKeySortedTablesOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(50, scalarKeySortedTablesOffset, 0);
+}
+
+static createScalarKeySortedTablesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
+  builder.startVector(4, data.length, 4);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addOffset(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startScalarKeySortedTablesVector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(4, numElems, 4);
+}
+
+static addNativeInline(builder:flatbuffers.Builder, nativeInlineOffset:flatbuffers.Offset) {
+  builder.addFieldStruct(51, nativeInlineOffset, 0);
+}
+
+static addLongEnumNonEnumDefault(builder:flatbuffers.Builder, longEnumNonEnumDefault:bigint) {
+  builder.addFieldInt64(52, longEnumNonEnumDefault, BigInt('0'));
+}
+
+static addLongEnumNormalDefault(builder:flatbuffers.Builder, longEnumNormalDefault:bigint) {
+  builder.addFieldInt64(53, longEnumNormalDefault, BigInt('2'));
+}
+
+static endMonster(builder:flatbuffers.Builder):flatbuffers.Offset {
+  const offset = builder.endObject();
+  builder.requiredField(offset, 10) // name
+  return offset;
+}
+
+static finishMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
+  builder.finish(offset, 'MONS');
+}
+
+static finishSizePrefixedMonsterBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
+  builder.finish(offset, 'MONS', true);
+}
+
+
+serialize():Uint8Array {
+  return this.bb!.bytes();
+}
+
+static deserialize(buffer: Uint8Array):Monster {
+  return Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer))
+}
+
+unpack(): MonsterT {
+  return new MonsterT(
+    (this.pos() !== null ? this.pos()!.unpack() : null),
+    this.mana(),
+    this.hp(),
+    this.name(),
+    this.bb!.createScalarList(this.inventory.bind(this), this.inventoryLength()),
+    this.color(),
+    this.testType(),
+    (() => {
+      let temp = unionToAny(this.testType(), this.test.bind(this));
+      if(temp === null) { return null; }
+      return temp.unpack()
+  })(),
+    this.bb!.createObjList(this.test4.bind(this), this.test4Length()),
+    this.bb!.createScalarList(this.testarrayofstring.bind(this), this.testarrayofstringLength()),
+    this.bb!.createObjList(this.testarrayoftables.bind(this), this.testarrayoftablesLength()),
+    (this.enemy() !== null ? this.enemy()!.unpack() : null),
+    this.bb!.createScalarList(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength()),
+    (this.testempty() !== null ? this.testempty()!.unpack() : null),
+    this.testbool(),
+    this.testhashs32Fnv1(),
+    this.testhashu32Fnv1(),
+    this.testhashs64Fnv1(),
+    this.testhashu64Fnv1(),
+    this.testhashs32Fnv1a(),
+    this.testhashu32Fnv1a(),
+    this.testhashs64Fnv1a(),
+    this.testhashu64Fnv1a(),
+    this.bb!.createScalarList(this.testarrayofbools.bind(this), this.testarrayofboolsLength()),
+    this.testf(),
+    this.testf2(),
+    this.testf3(),
+    this.bb!.createScalarList(this.testarrayofstring2.bind(this), this.testarrayofstring2Length()),
+    this.bb!.createObjList(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength()),
+    this.bb!.createScalarList(this.flex.bind(this), this.flexLength()),
+    this.bb!.createObjList(this.test5.bind(this), this.test5Length()),
+    this.bb!.createScalarList(this.vectorOfLongs.bind(this), this.vectorOfLongsLength()),
+    this.bb!.createScalarList(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength()),
+    (this.parentNamespaceTest() !== null ? this.parentNamespaceTest()!.unpack() : null),
+    this.bb!.createObjList(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength()),
+    this.singleWeakReference(),
+    this.bb!.createScalarList(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength()),
+    this.bb!.createObjList(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength()),
+    this.coOwningReference(),
+    this.bb!.createScalarList(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength()),
+    this.nonOwningReference(),
+    this.bb!.createScalarList(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength()),
+    this.anyUniqueType(),
+    (() => {
+      let temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this));
+      if(temp === null) { return null; }
+      return temp.unpack()
+  })(),
+    this.anyAmbiguousType(),
+    (() => {
+      let temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
+      if(temp === null) { return null; }
+      return temp.unpack()
+  })(),
+    this.bb!.createScalarList(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength()),
+    this.signedEnum(),
+    this.bb!.createScalarList(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength()),
+    this.bb!.createObjList(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength()),
+    (this.nativeInline() !== null ? this.nativeInline()!.unpack() : null),
+    this.longEnumNonEnumDefault(),
+    this.longEnumNormalDefault()
+  );
+}
+
+
+unpackTo(_o: MonsterT): void {
+  _o.pos = (this.pos() !== null ? this.pos()!.unpack() : null);
+  _o.mana = this.mana();
+  _o.hp = this.hp();
+  _o.name = this.name();
+  _o.inventory = this.bb!.createScalarList(this.inventory.bind(this), this.inventoryLength());
+  _o.color = this.color();
+  _o.testType = this.testType();
+  _o.test = (() => {
+      let temp = unionToAny(this.testType(), this.test.bind(this));
+      if(temp === null) { return null; }
+      return temp.unpack()
+  })();
+  _o.test4 = this.bb!.createObjList(this.test4.bind(this), this.test4Length());
+  _o.testarrayofstring = this.bb!.createScalarList(this.testarrayofstring.bind(this), this.testarrayofstringLength());
+  _o.testarrayoftables = this.bb!.createObjList(this.testarrayoftables.bind(this), this.testarrayoftablesLength());
+  _o.enemy = (this.enemy() !== null ? this.enemy()!.unpack() : null);
+  _o.testnestedflatbuffer = this.bb!.createScalarList(this.testnestedflatbuffer.bind(this), this.testnestedflatbufferLength());
+  _o.testempty = (this.testempty() !== null ? this.testempty()!.unpack() : null);
+  _o.testbool = this.testbool();
+  _o.testhashs32Fnv1 = this.testhashs32Fnv1();
+  _o.testhashu32Fnv1 = this.testhashu32Fnv1();
+  _o.testhashs64Fnv1 = this.testhashs64Fnv1();
+  _o.testhashu64Fnv1 = this.testhashu64Fnv1();
+  _o.testhashs32Fnv1a = this.testhashs32Fnv1a();
+  _o.testhashu32Fnv1a = this.testhashu32Fnv1a();
+  _o.testhashs64Fnv1a = this.testhashs64Fnv1a();
+  _o.testhashu64Fnv1a = this.testhashu64Fnv1a();
+  _o.testarrayofbools = this.bb!.createScalarList(this.testarrayofbools.bind(this), this.testarrayofboolsLength());
+  _o.testf = this.testf();
+  _o.testf2 = this.testf2();
+  _o.testf3 = this.testf3();
+  _o.testarrayofstring2 = this.bb!.createScalarList(this.testarrayofstring2.bind(this), this.testarrayofstring2Length());
+  _o.testarrayofsortedstruct = this.bb!.createObjList(this.testarrayofsortedstruct.bind(this), this.testarrayofsortedstructLength());
+  _o.flex = this.bb!.createScalarList(this.flex.bind(this), this.flexLength());
+  _o.test5 = this.bb!.createObjList(this.test5.bind(this), this.test5Length());
+  _o.vectorOfLongs = this.bb!.createScalarList(this.vectorOfLongs.bind(this), this.vectorOfLongsLength());
+  _o.vectorOfDoubles = this.bb!.createScalarList(this.vectorOfDoubles.bind(this), this.vectorOfDoublesLength());
+  _o.parentNamespaceTest = (this.parentNamespaceTest() !== null ? this.parentNamespaceTest()!.unpack() : null);
+  _o.vectorOfReferrables = this.bb!.createObjList(this.vectorOfReferrables.bind(this), this.vectorOfReferrablesLength());
+  _o.singleWeakReference = this.singleWeakReference();
+  _o.vectorOfWeakReferences = this.bb!.createScalarList(this.vectorOfWeakReferences.bind(this), this.vectorOfWeakReferencesLength());
+  _o.vectorOfStrongReferrables = this.bb!.createObjList(this.vectorOfStrongReferrables.bind(this), this.vectorOfStrongReferrablesLength());
+  _o.coOwningReference = this.coOwningReference();
+  _o.vectorOfCoOwningReferences = this.bb!.createScalarList(this.vectorOfCoOwningReferences.bind(this), this.vectorOfCoOwningReferencesLength());
+  _o.nonOwningReference = this.nonOwningReference();
+  _o.vectorOfNonOwningReferences = this.bb!.createScalarList(this.vectorOfNonOwningReferences.bind(this), this.vectorOfNonOwningReferencesLength());
+  _o.anyUniqueType = this.anyUniqueType();
+  _o.anyUnique = (() => {
+      let temp = unionToAnyUniqueAliases(this.anyUniqueType(), this.anyUnique.bind(this));
+      if(temp === null) { return null; }
+      return temp.unpack()
+  })();
+  _o.anyAmbiguousType = this.anyAmbiguousType();
+  _o.anyAmbiguous = (() => {
+      let temp = unionToAnyAmbiguousAliases(this.anyAmbiguousType(), this.anyAmbiguous.bind(this));
+      if(temp === null) { return null; }
+      return temp.unpack()
+  })();
+  _o.vectorOfEnums = this.bb!.createScalarList(this.vectorOfEnums.bind(this), this.vectorOfEnumsLength());
+  _o.signedEnum = this.signedEnum();
+  _o.testrequirednestedflatbuffer = this.bb!.createScalarList(this.testrequirednestedflatbuffer.bind(this), this.testrequirednestedflatbufferLength());
+  _o.scalarKeySortedTables = this.bb!.createObjList(this.scalarKeySortedTables.bind(this), this.scalarKeySortedTablesLength());
+  _o.nativeInline = (this.nativeInline() !== null ? this.nativeInline()!.unpack() : null);
+  _o.longEnumNonEnumDefault = this.longEnumNonEnumDefault();
+  _o.longEnumNormalDefault = this.longEnumNormalDefault();
+}
+}
+
+export class MonsterT {
+constructor(
+  public pos: Vec3T|null = null,
+  public mana: number = 150,
+  public hp: number = 100,
+  public name: string|Uint8Array|null = null,
+  public inventory: (number)[] = [],
+  public color: Color = Color.Blue,
+  public testType: Any = Any.NONE,
+  public test: MonsterT|MyGame_Example2_MonsterT|TestSimpleTableWithEnumT|null = null,
+  public test4: (TestT)[] = [],
+  public testarrayofstring: (string)[] = [],
+  public testarrayoftables: (MonsterT)[] = [],
+  public enemy: MonsterT|null = null,
+  public testnestedflatbuffer: (number)[] = [],
+  public testempty: StatT|null = null,
+  public testbool: boolean = false,
+  public testhashs32Fnv1: number = 0,
+  public testhashu32Fnv1: number = 0,
+  public testhashs64Fnv1: bigint = BigInt('0'),
+  public testhashu64Fnv1: bigint = BigInt('0'),
+  public testhashs32Fnv1a: number = 0,
+  public testhashu32Fnv1a: number = 0,
+  public testhashs64Fnv1a: bigint = BigInt('0'),
+  public testhashu64Fnv1a: bigint = BigInt('0'),
+  public testarrayofbools: (boolean)[] = [],
+  public testf: number = 3.14159,
+  public testf2: number = 3.0,
+  public testf3: number = 0.0,
+  public testarrayofstring2: (string)[] = [],
+  public testarrayofsortedstruct: (AbilityT)[] = [],
+  public flex: (number)[] = [],
+  public test5: (TestT)[] = [],
+  public vectorOfLongs: (bigint)[] = [],
+  public vectorOfDoubles: (number)[] = [],
+  public parentNamespaceTest: InParentNamespaceT|null = null,
+  public vectorOfReferrables: (ReferrableT)[] = [],
+  public singleWeakReference: bigint = BigInt('0'),
+  public vectorOfWeakReferences: (bigint)[] = [],
+  public vectorOfStrongReferrables: (ReferrableT)[] = [],
+  public coOwningReference: bigint = BigInt('0'),
+  public vectorOfCoOwningReferences: (bigint)[] = [],
+  public nonOwningReference: bigint = BigInt('0'),
+  public vectorOfNonOwningReferences: (bigint)[] = [],
+  public anyUniqueType: AnyUniqueAliases = AnyUniqueAliases.NONE,
+  public anyUnique: MonsterT|MyGame_Example2_MonsterT|TestSimpleTableWithEnumT|null = null,
+  public anyAmbiguousType: AnyAmbiguousAliases = AnyAmbiguousAliases.NONE,
+  public anyAmbiguous: MonsterT|null = null,
+  public vectorOfEnums: (Color)[] = [],
+  public signedEnum: Race = Race.None,
+  public testrequirednestedflatbuffer: (number)[] = [],
+  public scalarKeySortedTables: (StatT)[] = [],
+  public nativeInline: TestT|null = null,
+  public longEnumNonEnumDefault: bigint = BigInt('0'),
+  public longEnumNormalDefault: bigint = BigInt('2')
+){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  const name = (this.name !== null ? builder.createString(this.name!) : 0);
+  const inventory = Monster.createInventoryVector(builder, this.inventory);
+  const test = builder.createObjectOffset(this.test);
+  const test4 = builder.createStructOffsetList(this.test4, Monster.startTest4Vector);
+  const testarrayofstring = Monster.createTestarrayofstringVector(builder, builder.createObjectOffsetList(this.testarrayofstring));
+  const testarrayoftables = Monster.createTestarrayoftablesVector(builder, builder.createObjectOffsetList(this.testarrayoftables));
+  const enemy = (this.enemy !== null ? this.enemy!.pack(builder) : 0);
+  const testnestedflatbuffer = Monster.createTestnestedflatbufferVector(builder, this.testnestedflatbuffer);
+  const testempty = (this.testempty !== null ? this.testempty!.pack(builder) : 0);
+  const testarrayofbools = Monster.createTestarrayofboolsVector(builder, this.testarrayofbools);
+  const testarrayofstring2 = Monster.createTestarrayofstring2Vector(builder, builder.createObjectOffsetList(this.testarrayofstring2));
+  const testarrayofsortedstruct = builder.createStructOffsetList(this.testarrayofsortedstruct, Monster.startTestarrayofsortedstructVector);
+  const flex = Monster.createFlexVector(builder, this.flex);
+  const test5 = builder.createStructOffsetList(this.test5, Monster.startTest5Vector);
+  const vectorOfLongs = Monster.createVectorOfLongsVector(builder, this.vectorOfLongs);
+  const vectorOfDoubles = Monster.createVectorOfDoublesVector(builder, this.vectorOfDoubles);
+  const parentNamespaceTest = (this.parentNamespaceTest !== null ? this.parentNamespaceTest!.pack(builder) : 0);
+  const vectorOfReferrables = Monster.createVectorOfReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfReferrables));
+  const vectorOfWeakReferences = Monster.createVectorOfWeakReferencesVector(builder, this.vectorOfWeakReferences);
+  const vectorOfStrongReferrables = Monster.createVectorOfStrongReferrablesVector(builder, builder.createObjectOffsetList(this.vectorOfStrongReferrables));
+  const vectorOfCoOwningReferences = Monster.createVectorOfCoOwningReferencesVector(builder, this.vectorOfCoOwningReferences);
+  const vectorOfNonOwningReferences = Monster.createVectorOfNonOwningReferencesVector(builder, this.vectorOfNonOwningReferences);
+  const anyUnique = builder.createObjectOffset(this.anyUnique);
+  const anyAmbiguous = builder.createObjectOffset(this.anyAmbiguous);
+  const vectorOfEnums = Monster.createVectorOfEnumsVector(builder, this.vectorOfEnums);
+  const testrequirednestedflatbuffer = Monster.createTestrequirednestedflatbufferVector(builder, this.testrequirednestedflatbuffer);
+  const scalarKeySortedTables = Monster.createScalarKeySortedTablesVector(builder, builder.createObjectOffsetList(this.scalarKeySortedTables));
+
+  Monster.startMonster(builder);
+  Monster.addPos(builder, (this.pos !== null ? this.pos!.pack(builder) : 0));
+  Monster.addMana(builder, this.mana);
+  Monster.addHp(builder, this.hp);
+  Monster.addName(builder, name);
+  Monster.addInventory(builder, inventory);
+  Monster.addColor(builder, this.color);
+  Monster.addTestType(builder, this.testType);
+  Monster.addTest(builder, test);
+  Monster.addTest4(builder, test4);
+  Monster.addTestarrayofstring(builder, testarrayofstring);
+  Monster.addTestarrayoftables(builder, testarrayoftables);
+  Monster.addEnemy(builder, enemy);
+  Monster.addTestnestedflatbuffer(builder, testnestedflatbuffer);
+  Monster.addTestempty(builder, testempty);
+  Monster.addTestbool(builder, this.testbool);
+  Monster.addTesthashs32Fnv1(builder, this.testhashs32Fnv1);
+  Monster.addTesthashu32Fnv1(builder, this.testhashu32Fnv1);
+  Monster.addTesthashs64Fnv1(builder, this.testhashs64Fnv1);
+  Monster.addTesthashu64Fnv1(builder, this.testhashu64Fnv1);
+  Monster.addTesthashs32Fnv1a(builder, this.testhashs32Fnv1a);
+  Monster.addTesthashu32Fnv1a(builder, this.testhashu32Fnv1a);
+  Monster.addTesthashs64Fnv1a(builder, this.testhashs64Fnv1a);
+  Monster.addTesthashu64Fnv1a(builder, this.testhashu64Fnv1a);
+  Monster.addTestarrayofbools(builder, testarrayofbools);
+  Monster.addTestf(builder, this.testf);
+  Monster.addTestf2(builder, this.testf2);
+  Monster.addTestf3(builder, this.testf3);
+  Monster.addTestarrayofstring2(builder, testarrayofstring2);
+  Monster.addTestarrayofsortedstruct(builder, testarrayofsortedstruct);
+  Monster.addFlex(builder, flex);
+  Monster.addTest5(builder, test5);
+  Monster.addVectorOfLongs(builder, vectorOfLongs);
+  Monster.addVectorOfDoubles(builder, vectorOfDoubles);
+  Monster.addParentNamespaceTest(builder, parentNamespaceTest);
+  Monster.addVectorOfReferrables(builder, vectorOfReferrables);
+  Monster.addSingleWeakReference(builder, this.singleWeakReference);
+  Monster.addVectorOfWeakReferences(builder, vectorOfWeakReferences);
+  Monster.addVectorOfStrongReferrables(builder, vectorOfStrongReferrables);
+  Monster.addCoOwningReference(builder, this.coOwningReference);
+  Monster.addVectorOfCoOwningReferences(builder, vectorOfCoOwningReferences);
+  Monster.addNonOwningReference(builder, this.nonOwningReference);
+  Monster.addVectorOfNonOwningReferences(builder, vectorOfNonOwningReferences);
+  Monster.addAnyUniqueType(builder, this.anyUniqueType);
+  Monster.addAnyUnique(builder, anyUnique);
+  Monster.addAnyAmbiguousType(builder, this.anyAmbiguousType);
+  Monster.addAnyAmbiguous(builder, anyAmbiguous);
+  Monster.addVectorOfEnums(builder, vectorOfEnums);
+  Monster.addSignedEnum(builder, this.signedEnum);
+  Monster.addTestrequirednestedflatbuffer(builder, testrequirednestedflatbuffer);
+  Monster.addScalarKeySortedTables(builder, scalarKeySortedTables);
+  Monster.addNativeInline(builder, (this.nativeInline !== null ? this.nativeInline!.pack(builder) : 0));
+  Monster.addLongEnumNonEnumDefault(builder, this.longEnumNonEnumDefault);
+  Monster.addLongEnumNormalDefault(builder, this.longEnumNormalDefault);
+
+  return Monster.endMonster(builder);
+}
+}
diff --git a/tests/ts/my-game/example/race.js b/tests/ts/my-game/example/race.js
new file mode 100644
index 0000000..74f5105
--- /dev/null
+++ b/tests/ts/my-game/example/race.js
@@ -0,0 +1,8 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+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 = {}));
diff --git a/tests/ts/my-game/example/race.ts b/tests/ts/my-game/example/race.ts
new file mode 100644
index 0000000..8cb9654
--- /dev/null
+++ b/tests/ts/my-game/example/race.ts
@@ -0,0 +1,8 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+export enum Race {
+  None = -1,
+  Human = 0,
+  Dwarf = 1,
+  Elf = 2
+}
diff --git a/tests/ts/my-game/example/referrable.js b/tests/ts/my-game/example/referrable.js
new file mode 100644
index 0000000..367034b
--- /dev/null
+++ b/tests/ts/my-game/example/referrable.js
@@ -0,0 +1,70 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import * as flatbuffers from 'flatbuffers';
+export class Referrable {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    static getRootAsReferrable(bb, obj) {
+        return (obj || new Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    static getSizePrefixedRootAsReferrable(bb, obj) {
+        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+        return (obj || new Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    id() {
+        const offset = this.bb.__offset(this.bb_pos, 4);
+        return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_id(value) {
+        const offset = this.bb.__offset(this.bb_pos, 4);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint64(this.bb_pos + offset, value);
+        return true;
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_Example_Referrable';
+    }
+    static startReferrable(builder) {
+        builder.startObject(1);
+    }
+    static addId(builder, id) {
+        builder.addFieldInt64(0, id, BigInt('0'));
+    }
+    static endReferrable(builder) {
+        const offset = builder.endObject();
+        return offset;
+    }
+    static createReferrable(builder, id) {
+        Referrable.startReferrable(builder);
+        Referrable.addId(builder, id);
+        return Referrable.endReferrable(builder);
+    }
+    serialize() {
+        return this.bb.bytes();
+    }
+    static deserialize(buffer) {
+        return Referrable.getRootAsReferrable(new flatbuffers.ByteBuffer(buffer));
+    }
+    unpack() {
+        return new ReferrableT(this.id());
+    }
+    unpackTo(_o) {
+        _o.id = this.id();
+    }
+}
+export class ReferrableT {
+    constructor(id = BigInt('0')) {
+        this.id = id;
+    }
+    pack(builder) {
+        return Referrable.createReferrable(builder, this.id);
+    }
+}
diff --git a/tests/ts/my-game/example/referrable.ts b/tests/ts/my-game/example/referrable.ts
new file mode 100644
index 0000000..ec02980
--- /dev/null
+++ b/tests/ts/my-game/example/referrable.ts
@@ -0,0 +1,95 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+
+
+export class Referrable {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):Referrable {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+static getRootAsReferrable(bb:flatbuffers.ByteBuffer, obj?:Referrable):Referrable {
+  return (obj || new Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+static getSizePrefixedRootAsReferrable(bb:flatbuffers.ByteBuffer, obj?:Referrable):Referrable {
+  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+  return (obj || new Referrable()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+id():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 4);
+  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_id(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 4);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint64(this.bb_pos + offset, value);
+  return true;
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_Example_Referrable';
+}
+
+static startReferrable(builder:flatbuffers.Builder) {
+  builder.startObject(1);
+}
+
+static addId(builder:flatbuffers.Builder, id:bigint) {
+  builder.addFieldInt64(0, id, BigInt('0'));
+}
+
+static endReferrable(builder:flatbuffers.Builder):flatbuffers.Offset {
+  const offset = builder.endObject();
+  return offset;
+}
+
+static createReferrable(builder:flatbuffers.Builder, id:bigint):flatbuffers.Offset {
+  Referrable.startReferrable(builder);
+  Referrable.addId(builder, id);
+  return Referrable.endReferrable(builder);
+}
+
+serialize():Uint8Array {
+  return this.bb!.bytes();
+}
+
+static deserialize(buffer: Uint8Array):Referrable {
+  return Referrable.getRootAsReferrable(new flatbuffers.ByteBuffer(buffer))
+}
+
+unpack(): ReferrableT {
+  return new ReferrableT(
+    this.id()
+  );
+}
+
+
+unpackTo(_o: ReferrableT): void {
+  _o.id = this.id();
+}
+}
+
+export class ReferrableT {
+constructor(
+  public id: bigint = BigInt('0')
+){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  return Referrable.createReferrable(builder,
+    this.id
+  );
+}
+}
diff --git a/tests/ts/my-game/example/stat.js b/tests/ts/my-game/example/stat.js
new file mode 100644
index 0000000..43b569f
--- /dev/null
+++ b/tests/ts/my-game/example/stat.js
@@ -0,0 +1,99 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import * as flatbuffers from 'flatbuffers';
+export class Stat {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    static getRootAsStat(bb, obj) {
+        return (obj || new Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    static getSizePrefixedRootAsStat(bb, obj) {
+        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+        return (obj || new Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    id(optionalEncoding) {
+        const offset = this.bb.__offset(this.bb_pos, 4);
+        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
+    }
+    val() {
+        const offset = this.bb.__offset(this.bb_pos, 6);
+        return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_val(value) {
+        const offset = this.bb.__offset(this.bb_pos, 6);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt64(this.bb_pos + offset, value);
+        return true;
+    }
+    count() {
+        const offset = this.bb.__offset(this.bb_pos, 8);
+        return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
+    }
+    mutate_count(value) {
+        const offset = this.bb.__offset(this.bb_pos, 8);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint16(this.bb_pos + offset, value);
+        return true;
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_Example_Stat';
+    }
+    static startStat(builder) {
+        builder.startObject(3);
+    }
+    static addId(builder, idOffset) {
+        builder.addFieldOffset(0, idOffset, 0);
+    }
+    static addVal(builder, val) {
+        builder.addFieldInt64(1, val, BigInt('0'));
+    }
+    static addCount(builder, count) {
+        builder.addFieldInt16(2, count, 0);
+    }
+    static endStat(builder) {
+        const offset = builder.endObject();
+        return offset;
+    }
+    static createStat(builder, idOffset, val, count) {
+        Stat.startStat(builder);
+        Stat.addId(builder, idOffset);
+        Stat.addVal(builder, val);
+        Stat.addCount(builder, count);
+        return Stat.endStat(builder);
+    }
+    serialize() {
+        return this.bb.bytes();
+    }
+    static deserialize(buffer) {
+        return Stat.getRootAsStat(new flatbuffers.ByteBuffer(buffer));
+    }
+    unpack() {
+        return new StatT(this.id(), this.val(), this.count());
+    }
+    unpackTo(_o) {
+        _o.id = this.id();
+        _o.val = this.val();
+        _o.count = this.count();
+    }
+}
+export class StatT {
+    constructor(id = null, val = BigInt('0'), count = 0) {
+        this.id = id;
+        this.val = val;
+        this.count = count;
+    }
+    pack(builder) {
+        const id = (this.id !== null ? builder.createString(this.id) : 0);
+        return Stat.createStat(builder, id, this.val, this.count);
+    }
+}
diff --git a/tests/ts/my-game/example/stat.ts b/tests/ts/my-game/example/stat.ts
new file mode 100644
index 0000000..e452599
--- /dev/null
+++ b/tests/ts/my-game/example/stat.ts
@@ -0,0 +1,138 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+
+
+export class Stat {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):Stat {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+static getRootAsStat(bb:flatbuffers.ByteBuffer, obj?:Stat):Stat {
+  return (obj || new Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+static getSizePrefixedRootAsStat(bb:flatbuffers.ByteBuffer, obj?:Stat):Stat {
+  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+  return (obj || new Stat()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+id():string|null
+id(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
+id(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;
+}
+
+val():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 6);
+  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_val(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 6);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt64(this.bb_pos + offset, value);
+  return true;
+}
+
+count():number {
+  const offset = this.bb!.__offset(this.bb_pos, 8);
+  return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
+}
+
+mutate_count(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 8);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint16(this.bb_pos + offset, value);
+  return true;
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_Example_Stat';
+}
+
+static startStat(builder:flatbuffers.Builder) {
+  builder.startObject(3);
+}
+
+static addId(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset) {
+  builder.addFieldOffset(0, idOffset, 0);
+}
+
+static addVal(builder:flatbuffers.Builder, val:bigint) {
+  builder.addFieldInt64(1, val, BigInt('0'));
+}
+
+static addCount(builder:flatbuffers.Builder, count:number) {
+  builder.addFieldInt16(2, count, 0);
+}
+
+static endStat(builder:flatbuffers.Builder):flatbuffers.Offset {
+  const offset = builder.endObject();
+  return offset;
+}
+
+static createStat(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset, val:bigint, count:number):flatbuffers.Offset {
+  Stat.startStat(builder);
+  Stat.addId(builder, idOffset);
+  Stat.addVal(builder, val);
+  Stat.addCount(builder, count);
+  return Stat.endStat(builder);
+}
+
+serialize():Uint8Array {
+  return this.bb!.bytes();
+}
+
+static deserialize(buffer: Uint8Array):Stat {
+  return Stat.getRootAsStat(new flatbuffers.ByteBuffer(buffer))
+}
+
+unpack(): StatT {
+  return new StatT(
+    this.id(),
+    this.val(),
+    this.count()
+  );
+}
+
+
+unpackTo(_o: StatT): void {
+  _o.id = this.id();
+  _o.val = this.val();
+  _o.count = this.count();
+}
+}
+
+export class StatT {
+constructor(
+  public id: string|Uint8Array|null = null,
+  public val: bigint = BigInt('0'),
+  public count: number = 0
+){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  const id = (this.id !== null ? builder.createString(this.id!) : 0);
+
+  return Stat.createStat(builder,
+    id,
+    this.val,
+    this.count
+  );
+}
+}
diff --git a/tests/ts/my-game/example/struct-of-structs-of-structs.js b/tests/ts/my-game/example/struct-of-structs-of-structs.js
new file mode 100644
index 0000000..a5fbc66
--- /dev/null
+++ b/tests/ts/my-game/example/struct-of-structs-of-structs.js
@@ -0,0 +1,52 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import { StructOfStructs } from '../../my-game/example/struct-of-structs.js';
+export class StructOfStructsOfStructs {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    a(obj) {
+        return (obj || new StructOfStructs()).__init(this.bb_pos, this.bb);
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_Example_StructOfStructsOfStructs';
+    }
+    static sizeOf() {
+        return 20;
+    }
+    static createStructOfStructsOfStructs(builder, a_a_id, a_a_distance, a_b_a, a_b_b, a_c_id, a_c_distance) {
+        builder.prep(4, 20);
+        builder.prep(4, 20);
+        builder.prep(4, 8);
+        builder.writeInt32(a_c_distance);
+        builder.writeInt32(a_c_id);
+        builder.prep(2, 4);
+        builder.pad(1);
+        builder.writeInt8(a_b_b);
+        builder.writeInt16(a_b_a);
+        builder.prep(4, 8);
+        builder.writeInt32(a_a_distance);
+        builder.writeInt32(a_a_id);
+        return builder.offset();
+    }
+    unpack() {
+        return new StructOfStructsOfStructsT((this.a() !== null ? this.a().unpack() : null));
+    }
+    unpackTo(_o) {
+        _o.a = (this.a() !== null ? this.a().unpack() : null);
+    }
+}
+export class StructOfStructsOfStructsT {
+    constructor(a = null) {
+        this.a = a;
+    }
+    pack(builder) {
+        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _p, _q, _r, _s, _t, _u;
+        return StructOfStructsOfStructs.createStructOfStructsOfStructs(builder, ((_c = (_b = (_a = this.a) === null || _a === void 0 ? void 0 : _a.a) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : 0), ((_f = (_e = (_d = this.a) === null || _d === void 0 ? void 0 : _d.a) === null || _e === void 0 ? void 0 : _e.distance) !== null && _f !== void 0 ? _f : 0), ((_j = (_h = (_g = this.a) === null || _g === void 0 ? void 0 : _g.b) === null || _h === void 0 ? void 0 : _h.a) !== null && _j !== void 0 ? _j : 0), ((_m = (_l = (_k = this.a) === null || _k === void 0 ? void 0 : _k.b) === null || _l === void 0 ? void 0 : _l.b) !== null && _m !== void 0 ? _m : 0), ((_r = (_q = (_p = this.a) === null || _p === void 0 ? void 0 : _p.c) === null || _q === void 0 ? void 0 : _q.id) !== null && _r !== void 0 ? _r : 0), ((_u = (_t = (_s = this.a) === null || _s === void 0 ? void 0 : _s.c) === null || _t === void 0 ? void 0 : _t.distance) !== null && _u !== void 0 ? _u : 0));
+    }
+}
diff --git a/tests/ts/my-game/example/struct-of-structs-of-structs.ts b/tests/ts/my-game/example/struct-of-structs-of-structs.ts
new file mode 100644
index 0000000..52efc12
--- /dev/null
+++ b/tests/ts/my-game/example/struct-of-structs-of-structs.ts
@@ -0,0 +1,74 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+import { StructOfStructs, StructOfStructsT } from '../../my-game/example/struct-of-structs.js';
+
+
+export class StructOfStructsOfStructs {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):StructOfStructsOfStructs {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+a(obj?:StructOfStructs):StructOfStructs|null {
+  return (obj || new StructOfStructs()).__init(this.bb_pos, this.bb!);
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_Example_StructOfStructsOfStructs';
+}
+
+static sizeOf():number {
+  return 20;
+}
+
+static createStructOfStructsOfStructs(builder:flatbuffers.Builder, a_a_id: number, a_a_distance: number, a_b_a: number, a_b_b: number, a_c_id: number, a_c_distance: number):flatbuffers.Offset {
+  builder.prep(4, 20);
+  builder.prep(4, 20);
+  builder.prep(4, 8);
+  builder.writeInt32(a_c_distance);
+  builder.writeInt32(a_c_id);
+  builder.prep(2, 4);
+  builder.pad(1);
+  builder.writeInt8(a_b_b);
+  builder.writeInt16(a_b_a);
+  builder.prep(4, 8);
+  builder.writeInt32(a_a_distance);
+  builder.writeInt32(a_a_id);
+  return builder.offset();
+}
+
+
+unpack(): StructOfStructsOfStructsT {
+  return new StructOfStructsOfStructsT(
+    (this.a() !== null ? this.a()!.unpack() : null)
+  );
+}
+
+
+unpackTo(_o: StructOfStructsOfStructsT): void {
+  _o.a = (this.a() !== null ? this.a()!.unpack() : null);
+}
+}
+
+export class StructOfStructsOfStructsT {
+constructor(
+  public a: StructOfStructsT|null = null
+){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  return StructOfStructsOfStructs.createStructOfStructsOfStructs(builder,
+    (this.a?.a?.id ?? 0),
+    (this.a?.a?.distance ?? 0),
+    (this.a?.b?.a ?? 0),
+    (this.a?.b?.b ?? 0),
+    (this.a?.c?.id ?? 0),
+    (this.a?.c?.distance ?? 0)
+  );
+}
+}
diff --git a/tests/ts/my-game/example/struct-of-structs.js b/tests/ts/my-game/example/struct-of-structs.js
new file mode 100644
index 0000000..66aadc8
--- /dev/null
+++ b/tests/ts/my-game/example/struct-of-structs.js
@@ -0,0 +1,62 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import { Ability } from '../../my-game/example/ability.js';
+import { Test } from '../../my-game/example/test.js';
+export class StructOfStructs {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    a(obj) {
+        return (obj || new Ability()).__init(this.bb_pos, this.bb);
+    }
+    b(obj) {
+        return (obj || new Test()).__init(this.bb_pos + 8, this.bb);
+    }
+    c(obj) {
+        return (obj || new Ability()).__init(this.bb_pos + 12, this.bb);
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_Example_StructOfStructs';
+    }
+    static sizeOf() {
+        return 20;
+    }
+    static createStructOfStructs(builder, a_id, a_distance, b_a, b_b, c_id, c_distance) {
+        builder.prep(4, 20);
+        builder.prep(4, 8);
+        builder.writeInt32(c_distance);
+        builder.writeInt32(c_id);
+        builder.prep(2, 4);
+        builder.pad(1);
+        builder.writeInt8(b_b);
+        builder.writeInt16(b_a);
+        builder.prep(4, 8);
+        builder.writeInt32(a_distance);
+        builder.writeInt32(a_id);
+        return builder.offset();
+    }
+    unpack() {
+        return new StructOfStructsT((this.a() !== null ? this.a().unpack() : null), (this.b() !== null ? this.b().unpack() : null), (this.c() !== null ? this.c().unpack() : null));
+    }
+    unpackTo(_o) {
+        _o.a = (this.a() !== null ? this.a().unpack() : null);
+        _o.b = (this.b() !== null ? this.b().unpack() : null);
+        _o.c = (this.c() !== null ? this.c().unpack() : null);
+    }
+}
+export class StructOfStructsT {
+    constructor(a = null, b = null, c = null) {
+        this.a = a;
+        this.b = b;
+        this.c = c;
+    }
+    pack(builder) {
+        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
+        return StructOfStructs.createStructOfStructs(builder, ((_b = (_a = this.a) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 0), ((_d = (_c = this.a) === null || _c === void 0 ? void 0 : _c.distance) !== null && _d !== void 0 ? _d : 0), ((_f = (_e = this.b) === null || _e === void 0 ? void 0 : _e.a) !== null && _f !== void 0 ? _f : 0), ((_h = (_g = this.b) === null || _g === void 0 ? void 0 : _g.b) !== null && _h !== void 0 ? _h : 0), ((_k = (_j = this.c) === null || _j === void 0 ? void 0 : _j.id) !== null && _k !== void 0 ? _k : 0), ((_m = (_l = this.c) === null || _l === void 0 ? void 0 : _l.distance) !== null && _m !== void 0 ? _m : 0));
+    }
+}
diff --git a/tests/ts/my-game/example/struct-of-structs.ts b/tests/ts/my-game/example/struct-of-structs.ts
new file mode 100644
index 0000000..749a73c
--- /dev/null
+++ b/tests/ts/my-game/example/struct-of-structs.ts
@@ -0,0 +1,88 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+import { Ability, AbilityT } from '../../my-game/example/ability.js';
+import { Test, TestT } from '../../my-game/example/test.js';
+
+
+export class StructOfStructs {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):StructOfStructs {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+a(obj?:Ability):Ability|null {
+  return (obj || new Ability()).__init(this.bb_pos, this.bb!);
+}
+
+b(obj?:Test):Test|null {
+  return (obj || new Test()).__init(this.bb_pos + 8, this.bb!);
+}
+
+c(obj?:Ability):Ability|null {
+  return (obj || new Ability()).__init(this.bb_pos + 12, this.bb!);
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_Example_StructOfStructs';
+}
+
+static sizeOf():number {
+  return 20;
+}
+
+static createStructOfStructs(builder:flatbuffers.Builder, a_id: number, a_distance: number, b_a: number, b_b: number, c_id: number, c_distance: number):flatbuffers.Offset {
+  builder.prep(4, 20);
+  builder.prep(4, 8);
+  builder.writeInt32(c_distance);
+  builder.writeInt32(c_id);
+  builder.prep(2, 4);
+  builder.pad(1);
+  builder.writeInt8(b_b);
+  builder.writeInt16(b_a);
+  builder.prep(4, 8);
+  builder.writeInt32(a_distance);
+  builder.writeInt32(a_id);
+  return builder.offset();
+}
+
+
+unpack(): StructOfStructsT {
+  return new StructOfStructsT(
+    (this.a() !== null ? this.a()!.unpack() : null),
+    (this.b() !== null ? this.b()!.unpack() : null),
+    (this.c() !== null ? this.c()!.unpack() : null)
+  );
+}
+
+
+unpackTo(_o: StructOfStructsT): void {
+  _o.a = (this.a() !== null ? this.a()!.unpack() : null);
+  _o.b = (this.b() !== null ? this.b()!.unpack() : null);
+  _o.c = (this.c() !== null ? this.c()!.unpack() : null);
+}
+}
+
+export class StructOfStructsT {
+constructor(
+  public a: AbilityT|null = null,
+  public b: TestT|null = null,
+  public c: AbilityT|null = null
+){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  return StructOfStructs.createStructOfStructs(builder,
+    (this.a?.id ?? 0),
+    (this.a?.distance ?? 0),
+    (this.b?.a ?? 0),
+    (this.b?.b ?? 0),
+    (this.c?.id ?? 0),
+    (this.c?.distance ?? 0)
+  );
+}
+}
diff --git a/tests/ts/my-game/example/test-simple-table-with-enum.js b/tests/ts/my-game/example/test-simple-table-with-enum.js
new file mode 100644
index 0000000..3690fee
--- /dev/null
+++ b/tests/ts/my-game/example/test-simple-table-with-enum.js
@@ -0,0 +1,71 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import * as flatbuffers from 'flatbuffers';
+import { Color } from '../../my-game/example/color.js';
+export class TestSimpleTableWithEnum {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    static getRootAsTestSimpleTableWithEnum(bb, obj) {
+        return (obj || new TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    static getSizePrefixedRootAsTestSimpleTableWithEnum(bb, obj) {
+        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+        return (obj || new TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    color() {
+        const offset = this.bb.__offset(this.bb_pos, 4);
+        return offset ? this.bb.readUint8(this.bb_pos + offset) : Color.Green;
+    }
+    mutate_color(value) {
+        const offset = this.bb.__offset(this.bb_pos, 4);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint8(this.bb_pos + offset, value);
+        return true;
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_Example_TestSimpleTableWithEnum';
+    }
+    static startTestSimpleTableWithEnum(builder) {
+        builder.startObject(1);
+    }
+    static addColor(builder, color) {
+        builder.addFieldInt8(0, color, Color.Green);
+    }
+    static endTestSimpleTableWithEnum(builder) {
+        const offset = builder.endObject();
+        return offset;
+    }
+    static createTestSimpleTableWithEnum(builder, color) {
+        TestSimpleTableWithEnum.startTestSimpleTableWithEnum(builder);
+        TestSimpleTableWithEnum.addColor(builder, color);
+        return TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder);
+    }
+    serialize() {
+        return this.bb.bytes();
+    }
+    static deserialize(buffer) {
+        return TestSimpleTableWithEnum.getRootAsTestSimpleTableWithEnum(new flatbuffers.ByteBuffer(buffer));
+    }
+    unpack() {
+        return new TestSimpleTableWithEnumT(this.color());
+    }
+    unpackTo(_o) {
+        _o.color = this.color();
+    }
+}
+export class TestSimpleTableWithEnumT {
+    constructor(color = Color.Green) {
+        this.color = color;
+    }
+    pack(builder) {
+        return TestSimpleTableWithEnum.createTestSimpleTableWithEnum(builder, this.color);
+    }
+}
diff --git a/tests/ts/my-game/example/test-simple-table-with-enum.ts b/tests/ts/my-game/example/test-simple-table-with-enum.ts
new file mode 100644
index 0000000..cfca00b
--- /dev/null
+++ b/tests/ts/my-game/example/test-simple-table-with-enum.ts
@@ -0,0 +1,96 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+import { Color } from '../../my-game/example/color.js';
+
+
+export class TestSimpleTableWithEnum {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):TestSimpleTableWithEnum {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+static getRootAsTestSimpleTableWithEnum(bb:flatbuffers.ByteBuffer, obj?:TestSimpleTableWithEnum):TestSimpleTableWithEnum {
+  return (obj || new TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+static getSizePrefixedRootAsTestSimpleTableWithEnum(bb:flatbuffers.ByteBuffer, obj?:TestSimpleTableWithEnum):TestSimpleTableWithEnum {
+  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+  return (obj || new TestSimpleTableWithEnum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+color():Color {
+  const offset = this.bb!.__offset(this.bb_pos, 4);
+  return offset ? this.bb!.readUint8(this.bb_pos + offset) : Color.Green;
+}
+
+mutate_color(value:Color):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 4);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint8(this.bb_pos + offset, value);
+  return true;
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_Example_TestSimpleTableWithEnum';
+}
+
+static startTestSimpleTableWithEnum(builder:flatbuffers.Builder) {
+  builder.startObject(1);
+}
+
+static addColor(builder:flatbuffers.Builder, color:Color) {
+  builder.addFieldInt8(0, color, Color.Green);
+}
+
+static endTestSimpleTableWithEnum(builder:flatbuffers.Builder):flatbuffers.Offset {
+  const offset = builder.endObject();
+  return offset;
+}
+
+static createTestSimpleTableWithEnum(builder:flatbuffers.Builder, color:Color):flatbuffers.Offset {
+  TestSimpleTableWithEnum.startTestSimpleTableWithEnum(builder);
+  TestSimpleTableWithEnum.addColor(builder, color);
+  return TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder);
+}
+
+serialize():Uint8Array {
+  return this.bb!.bytes();
+}
+
+static deserialize(buffer: Uint8Array):TestSimpleTableWithEnum {
+  return TestSimpleTableWithEnum.getRootAsTestSimpleTableWithEnum(new flatbuffers.ByteBuffer(buffer))
+}
+
+unpack(): TestSimpleTableWithEnumT {
+  return new TestSimpleTableWithEnumT(
+    this.color()
+  );
+}
+
+
+unpackTo(_o: TestSimpleTableWithEnumT): void {
+  _o.color = this.color();
+}
+}
+
+export class TestSimpleTableWithEnumT {
+constructor(
+  public color: Color = Color.Green
+){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  return TestSimpleTableWithEnum.createTestSimpleTableWithEnum(builder,
+    this.color
+  );
+}
+}
diff --git a/tests/ts/my-game/example/test.js b/tests/ts/my-game/example/test.js
new file mode 100644
index 0000000..9c43619
--- /dev/null
+++ b/tests/ts/my-game/example/test.js
@@ -0,0 +1,55 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+export class Test {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    a() {
+        return this.bb.readInt16(this.bb_pos);
+    }
+    mutate_a(value) {
+        this.bb.writeInt16(this.bb_pos + 0, value);
+        return true;
+    }
+    b() {
+        return this.bb.readInt8(this.bb_pos + 2);
+    }
+    mutate_b(value) {
+        this.bb.writeInt8(this.bb_pos + 2, value);
+        return true;
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_Example_Test';
+    }
+    static sizeOf() {
+        return 4;
+    }
+    static createTest(builder, a, b) {
+        builder.prep(2, 4);
+        builder.pad(1);
+        builder.writeInt8(b);
+        builder.writeInt16(a);
+        return builder.offset();
+    }
+    unpack() {
+        return new TestT(this.a(), this.b());
+    }
+    unpackTo(_o) {
+        _o.a = this.a();
+        _o.b = this.b();
+    }
+}
+export class TestT {
+    constructor(a = 0, b = 0) {
+        this.a = a;
+        this.b = b;
+    }
+    pack(builder) {
+        return Test.createTest(builder, this.a, this.b);
+    }
+}
diff --git a/tests/ts/my-game/example/test.ts b/tests/ts/my-game/example/test.ts
new file mode 100644
index 0000000..b3d84ee
--- /dev/null
+++ b/tests/ts/my-game/example/test.ts
@@ -0,0 +1,78 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+
+
+export class Test {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):Test {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+a():number {
+  return this.bb!.readInt16(this.bb_pos);
+}
+
+mutate_a(value:number):boolean {
+  this.bb!.writeInt16(this.bb_pos + 0, value);
+  return true;
+}
+
+b():number {
+  return this.bb!.readInt8(this.bb_pos + 2);
+}
+
+mutate_b(value:number):boolean {
+  this.bb!.writeInt8(this.bb_pos + 2, value);
+  return true;
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_Example_Test';
+}
+
+static sizeOf():number {
+  return 4;
+}
+
+static createTest(builder:flatbuffers.Builder, a: number, b: number):flatbuffers.Offset {
+  builder.prep(2, 4);
+  builder.pad(1);
+  builder.writeInt8(b);
+  builder.writeInt16(a);
+  return builder.offset();
+}
+
+
+unpack(): TestT {
+  return new TestT(
+    this.a(),
+    this.b()
+  );
+}
+
+
+unpackTo(_o: TestT): void {
+  _o.a = this.a();
+  _o.b = this.b();
+}
+}
+
+export class TestT {
+constructor(
+  public a: number = 0,
+  public b: number = 0
+){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  return Test.createTest(builder,
+    this.a,
+    this.b
+  );
+}
+}
diff --git a/tests/ts/my-game/example/type-aliases.js b/tests/ts/my-game/example/type-aliases.js
new file mode 100644
index 0000000..a4b5f89
--- /dev/null
+++ b/tests/ts/my-game/example/type-aliases.js
@@ -0,0 +1,290 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import * as flatbuffers from 'flatbuffers';
+export class TypeAliases {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    static getRootAsTypeAliases(bb, obj) {
+        return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    static getSizePrefixedRootAsTypeAliases(bb, obj) {
+        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+        return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    i8() {
+        const offset = this.bb.__offset(this.bb_pos, 4);
+        return offset ? this.bb.readInt8(this.bb_pos + offset) : 0;
+    }
+    mutate_i8(value) {
+        const offset = this.bb.__offset(this.bb_pos, 4);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt8(this.bb_pos + offset, value);
+        return true;
+    }
+    u8() {
+        const offset = this.bb.__offset(this.bb_pos, 6);
+        return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
+    }
+    mutate_u8(value) {
+        const offset = this.bb.__offset(this.bb_pos, 6);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint8(this.bb_pos + offset, value);
+        return true;
+    }
+    i16() {
+        const offset = this.bb.__offset(this.bb_pos, 8);
+        return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;
+    }
+    mutate_i16(value) {
+        const offset = this.bb.__offset(this.bb_pos, 8);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt16(this.bb_pos + offset, value);
+        return true;
+    }
+    u16() {
+        const offset = this.bb.__offset(this.bb_pos, 10);
+        return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
+    }
+    mutate_u16(value) {
+        const offset = this.bb.__offset(this.bb_pos, 10);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint16(this.bb_pos + offset, value);
+        return true;
+    }
+    i32() {
+        const offset = this.bb.__offset(this.bb_pos, 12);
+        return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
+    }
+    mutate_i32(value) {
+        const offset = this.bb.__offset(this.bb_pos, 12);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt32(this.bb_pos + offset, value);
+        return true;
+    }
+    u32() {
+        const offset = this.bb.__offset(this.bb_pos, 14);
+        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
+    }
+    mutate_u32(value) {
+        const offset = this.bb.__offset(this.bb_pos, 14);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint32(this.bb_pos + offset, value);
+        return true;
+    }
+    i64() {
+        const offset = this.bb.__offset(this.bb_pos, 16);
+        return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_i64(value) {
+        const offset = this.bb.__offset(this.bb_pos, 16);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeInt64(this.bb_pos + offset, value);
+        return true;
+    }
+    u64() {
+        const offset = this.bb.__offset(this.bb_pos, 18);
+        return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
+    }
+    mutate_u64(value) {
+        const offset = this.bb.__offset(this.bb_pos, 18);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeUint64(this.bb_pos + offset, value);
+        return true;
+    }
+    f32() {
+        const offset = this.bb.__offset(this.bb_pos, 20);
+        return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
+    }
+    mutate_f32(value) {
+        const offset = this.bb.__offset(this.bb_pos, 20);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeFloat32(this.bb_pos + offset, value);
+        return true;
+    }
+    f64() {
+        const offset = this.bb.__offset(this.bb_pos, 22);
+        return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
+    }
+    mutate_f64(value) {
+        const offset = this.bb.__offset(this.bb_pos, 22);
+        if (offset === 0) {
+            return false;
+        }
+        this.bb.writeFloat64(this.bb_pos + offset, value);
+        return true;
+    }
+    v8(index) {
+        const offset = this.bb.__offset(this.bb_pos, 24);
+        return offset ? this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
+    }
+    v8Length() {
+        const offset = this.bb.__offset(this.bb_pos, 24);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    v8Array() {
+        const offset = this.bb.__offset(this.bb_pos, 24);
+        return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
+    }
+    vf64(index) {
+        const offset = this.bb.__offset(this.bb_pos, 26);
+        return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
+    }
+    vf64Length() {
+        const offset = this.bb.__offset(this.bb_pos, 26);
+        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
+    }
+    vf64Array() {
+        const offset = this.bb.__offset(this.bb_pos, 26);
+        return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_Example_TypeAliases';
+    }
+    static startTypeAliases(builder) {
+        builder.startObject(12);
+    }
+    static addI8(builder, i8) {
+        builder.addFieldInt8(0, i8, 0);
+    }
+    static addU8(builder, u8) {
+        builder.addFieldInt8(1, u8, 0);
+    }
+    static addI16(builder, i16) {
+        builder.addFieldInt16(2, i16, 0);
+    }
+    static addU16(builder, u16) {
+        builder.addFieldInt16(3, u16, 0);
+    }
+    static addI32(builder, i32) {
+        builder.addFieldInt32(4, i32, 0);
+    }
+    static addU32(builder, u32) {
+        builder.addFieldInt32(5, u32, 0);
+    }
+    static addI64(builder, i64) {
+        builder.addFieldInt64(6, i64, BigInt('0'));
+    }
+    static addU64(builder, u64) {
+        builder.addFieldInt64(7, u64, BigInt('0'));
+    }
+    static addF32(builder, f32) {
+        builder.addFieldFloat32(8, f32, 0.0);
+    }
+    static addF64(builder, f64) {
+        builder.addFieldFloat64(9, f64, 0.0);
+    }
+    static addV8(builder, v8Offset) {
+        builder.addFieldOffset(10, v8Offset, 0);
+    }
+    static createV8Vector(builder, data) {
+        builder.startVector(1, data.length, 1);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addInt8(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startV8Vector(builder, numElems) {
+        builder.startVector(1, numElems, 1);
+    }
+    static addVf64(builder, vf64Offset) {
+        builder.addFieldOffset(11, vf64Offset, 0);
+    }
+    static createVf64Vector(builder, data) {
+        builder.startVector(8, data.length, 8);
+        for (let i = data.length - 1; i >= 0; i--) {
+            builder.addFloat64(data[i]);
+        }
+        return builder.endVector();
+    }
+    static startVf64Vector(builder, numElems) {
+        builder.startVector(8, numElems, 8);
+    }
+    static endTypeAliases(builder) {
+        const offset = builder.endObject();
+        return offset;
+    }
+    static createTypeAliases(builder, i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, v8Offset, vf64Offset) {
+        TypeAliases.startTypeAliases(builder);
+        TypeAliases.addI8(builder, i8);
+        TypeAliases.addU8(builder, u8);
+        TypeAliases.addI16(builder, i16);
+        TypeAliases.addU16(builder, u16);
+        TypeAliases.addI32(builder, i32);
+        TypeAliases.addU32(builder, u32);
+        TypeAliases.addI64(builder, i64);
+        TypeAliases.addU64(builder, u64);
+        TypeAliases.addF32(builder, f32);
+        TypeAliases.addF64(builder, f64);
+        TypeAliases.addV8(builder, v8Offset);
+        TypeAliases.addVf64(builder, vf64Offset);
+        return TypeAliases.endTypeAliases(builder);
+    }
+    serialize() {
+        return this.bb.bytes();
+    }
+    static deserialize(buffer) {
+        return TypeAliases.getRootAsTypeAliases(new flatbuffers.ByteBuffer(buffer));
+    }
+    unpack() {
+        return new TypeAliasesT(this.i8(), this.u8(), this.i16(), this.u16(), this.i32(), this.u32(), this.i64(), this.u64(), this.f32(), this.f64(), this.bb.createScalarList(this.v8.bind(this), this.v8Length()), this.bb.createScalarList(this.vf64.bind(this), this.vf64Length()));
+    }
+    unpackTo(_o) {
+        _o.i8 = this.i8();
+        _o.u8 = this.u8();
+        _o.i16 = this.i16();
+        _o.u16 = this.u16();
+        _o.i32 = this.i32();
+        _o.u32 = this.u32();
+        _o.i64 = this.i64();
+        _o.u64 = this.u64();
+        _o.f32 = this.f32();
+        _o.f64 = this.f64();
+        _o.v8 = this.bb.createScalarList(this.v8.bind(this), this.v8Length());
+        _o.vf64 = this.bb.createScalarList(this.vf64.bind(this), this.vf64Length());
+    }
+}
+export class TypeAliasesT {
+    constructor(i8 = 0, u8 = 0, i16 = 0, u16 = 0, i32 = 0, u32 = 0, i64 = BigInt('0'), u64 = BigInt('0'), f32 = 0.0, f64 = 0.0, v8 = [], vf64 = []) {
+        this.i8 = i8;
+        this.u8 = u8;
+        this.i16 = i16;
+        this.u16 = u16;
+        this.i32 = i32;
+        this.u32 = u32;
+        this.i64 = i64;
+        this.u64 = u64;
+        this.f32 = f32;
+        this.f64 = f64;
+        this.v8 = v8;
+        this.vf64 = vf64;
+    }
+    pack(builder) {
+        const v8 = TypeAliases.createV8Vector(builder, this.v8);
+        const vf64 = TypeAliases.createVf64Vector(builder, this.vf64);
+        return TypeAliases.createTypeAliases(builder, this.i8, this.u8, this.i16, this.u16, this.i32, this.u32, this.i64, this.u64, this.f32, this.f64, v8, vf64);
+    }
+}
diff --git a/tests/ts/my-game/example/type-aliases.ts b/tests/ts/my-game/example/type-aliases.ts
new file mode 100644
index 0000000..805c8cf
--- /dev/null
+++ b/tests/ts/my-game/example/type-aliases.ts
@@ -0,0 +1,405 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+
+
+export class TypeAliases {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):TypeAliases {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+static getRootAsTypeAliases(bb:flatbuffers.ByteBuffer, obj?:TypeAliases):TypeAliases {
+  return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+static getSizePrefixedRootAsTypeAliases(bb:flatbuffers.ByteBuffer, obj?:TypeAliases):TypeAliases {
+  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+  return (obj || new TypeAliases()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+i8():number {
+  const offset = this.bb!.__offset(this.bb_pos, 4);
+  return offset ? this.bb!.readInt8(this.bb_pos + offset) : 0;
+}
+
+mutate_i8(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 4);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt8(this.bb_pos + offset, value);
+  return true;
+}
+
+u8():number {
+  const offset = this.bb!.__offset(this.bb_pos, 6);
+  return offset ? this.bb!.readUint8(this.bb_pos + offset) : 0;
+}
+
+mutate_u8(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 6);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint8(this.bb_pos + offset, value);
+  return true;
+}
+
+i16():number {
+  const offset = this.bb!.__offset(this.bb_pos, 8);
+  return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
+}
+
+mutate_i16(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 8);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt16(this.bb_pos + offset, value);
+  return true;
+}
+
+u16():number {
+  const offset = this.bb!.__offset(this.bb_pos, 10);
+  return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
+}
+
+mutate_u16(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 10);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint16(this.bb_pos + offset, value);
+  return true;
+}
+
+i32():number {
+  const offset = this.bb!.__offset(this.bb_pos, 12);
+  return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
+}
+
+mutate_i32(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 12);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt32(this.bb_pos + offset, value);
+  return true;
+}
+
+u32():number {
+  const offset = this.bb!.__offset(this.bb_pos, 14);
+  return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
+}
+
+mutate_u32(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 14);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint32(this.bb_pos + offset, value);
+  return true;
+}
+
+i64():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 16);
+  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_i64(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 16);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeInt64(this.bb_pos + offset, value);
+  return true;
+}
+
+u64():bigint {
+  const offset = this.bb!.__offset(this.bb_pos, 18);
+  return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
+}
+
+mutate_u64(value:bigint):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 18);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeUint64(this.bb_pos + offset, value);
+  return true;
+}
+
+f32():number {
+  const offset = this.bb!.__offset(this.bb_pos, 20);
+  return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
+}
+
+mutate_f32(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 20);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeFloat32(this.bb_pos + offset, value);
+  return true;
+}
+
+f64():number {
+  const offset = this.bb!.__offset(this.bb_pos, 22);
+  return offset ? this.bb!.readFloat64(this.bb_pos + offset) : 0.0;
+}
+
+mutate_f64(value:number):boolean {
+  const offset = this.bb!.__offset(this.bb_pos, 22);
+
+  if (offset === 0) {
+    return false;
+  }
+
+  this.bb!.writeFloat64(this.bb_pos + offset, value);
+  return true;
+}
+
+v8(index: number):number|null {
+  const offset = this.bb!.__offset(this.bb_pos, 24);
+  return offset ? this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
+}
+
+v8Length():number {
+  const offset = this.bb!.__offset(this.bb_pos, 24);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+v8Array():Int8Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 24);
+  return offset ? new Int8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
+}
+
+vf64(index: number):number|null {
+  const offset = this.bb!.__offset(this.bb_pos, 26);
+  return offset ? this.bb!.readFloat64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : 0;
+}
+
+vf64Length():number {
+  const offset = this.bb!.__offset(this.bb_pos, 26);
+  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
+}
+
+vf64Array():Float64Array|null {
+  const offset = this.bb!.__offset(this.bb_pos, 26);
+  return offset ? new Float64Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_Example_TypeAliases';
+}
+
+static startTypeAliases(builder:flatbuffers.Builder) {
+  builder.startObject(12);
+}
+
+static addI8(builder:flatbuffers.Builder, i8:number) {
+  builder.addFieldInt8(0, i8, 0);
+}
+
+static addU8(builder:flatbuffers.Builder, u8:number) {
+  builder.addFieldInt8(1, u8, 0);
+}
+
+static addI16(builder:flatbuffers.Builder, i16:number) {
+  builder.addFieldInt16(2, i16, 0);
+}
+
+static addU16(builder:flatbuffers.Builder, u16:number) {
+  builder.addFieldInt16(3, u16, 0);
+}
+
+static addI32(builder:flatbuffers.Builder, i32:number) {
+  builder.addFieldInt32(4, i32, 0);
+}
+
+static addU32(builder:flatbuffers.Builder, u32:number) {
+  builder.addFieldInt32(5, u32, 0);
+}
+
+static addI64(builder:flatbuffers.Builder, i64:bigint) {
+  builder.addFieldInt64(6, i64, BigInt('0'));
+}
+
+static addU64(builder:flatbuffers.Builder, u64:bigint) {
+  builder.addFieldInt64(7, u64, BigInt('0'));
+}
+
+static addF32(builder:flatbuffers.Builder, f32:number) {
+  builder.addFieldFloat32(8, f32, 0.0);
+}
+
+static addF64(builder:flatbuffers.Builder, f64:number) {
+  builder.addFieldFloat64(9, f64, 0.0);
+}
+
+static addV8(builder:flatbuffers.Builder, v8Offset:flatbuffers.Offset) {
+  builder.addFieldOffset(10, v8Offset, 0);
+}
+
+static createV8Vector(builder:flatbuffers.Builder, data:number[]|Int8Array):flatbuffers.Offset;
+/**
+ * @deprecated This Uint8Array overload will be removed in the future.
+ */
+static createV8Vector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
+static createV8Vector(builder:flatbuffers.Builder, data:number[]|Int8Array|Uint8Array):flatbuffers.Offset {
+  builder.startVector(1, data.length, 1);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addInt8(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startV8Vector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(1, numElems, 1);
+}
+
+static addVf64(builder:flatbuffers.Builder, vf64Offset:flatbuffers.Offset) {
+  builder.addFieldOffset(11, vf64Offset, 0);
+}
+
+static createVf64Vector(builder:flatbuffers.Builder, data:number[]|Float64Array):flatbuffers.Offset;
+/**
+ * @deprecated This Uint8Array overload will be removed in the future.
+ */
+static createVf64Vector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
+static createVf64Vector(builder:flatbuffers.Builder, data:number[]|Float64Array|Uint8Array):flatbuffers.Offset {
+  builder.startVector(8, data.length, 8);
+  for (let i = data.length - 1; i >= 0; i--) {
+    builder.addFloat64(data[i]!);
+  }
+  return builder.endVector();
+}
+
+static startVf64Vector(builder:flatbuffers.Builder, numElems:number) {
+  builder.startVector(8, numElems, 8);
+}
+
+static endTypeAliases(builder:flatbuffers.Builder):flatbuffers.Offset {
+  const offset = builder.endObject();
+  return offset;
+}
+
+static createTypeAliases(builder:flatbuffers.Builder, i8:number, u8:number, i16:number, u16:number, i32:number, u32:number, i64:bigint, u64:bigint, f32:number, f64:number, v8Offset:flatbuffers.Offset, vf64Offset:flatbuffers.Offset):flatbuffers.Offset {
+  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():Uint8Array {
+  return this.bb!.bytes();
+}
+
+static deserialize(buffer: Uint8Array):TypeAliases {
+  return TypeAliases.getRootAsTypeAliases(new flatbuffers.ByteBuffer(buffer))
+}
+
+unpack(): TypeAliasesT {
+  return new TypeAliasesT(
+    this.i8(),
+    this.u8(),
+    this.i16(),
+    this.u16(),
+    this.i32(),
+    this.u32(),
+    this.i64(),
+    this.u64(),
+    this.f32(),
+    this.f64(),
+    this.bb!.createScalarList(this.v8.bind(this), this.v8Length()),
+    this.bb!.createScalarList(this.vf64.bind(this), this.vf64Length())
+  );
+}
+
+
+unpackTo(_o: TypeAliasesT): void {
+  _o.i8 = this.i8();
+  _o.u8 = this.u8();
+  _o.i16 = this.i16();
+  _o.u16 = this.u16();
+  _o.i32 = this.i32();
+  _o.u32 = this.u32();
+  _o.i64 = this.i64();
+  _o.u64 = this.u64();
+  _o.f32 = this.f32();
+  _o.f64 = this.f64();
+  _o.v8 = this.bb!.createScalarList(this.v8.bind(this), this.v8Length());
+  _o.vf64 = this.bb!.createScalarList(this.vf64.bind(this), this.vf64Length());
+}
+}
+
+export class TypeAliasesT {
+constructor(
+  public i8: number = 0,
+  public u8: number = 0,
+  public i16: number = 0,
+  public u16: number = 0,
+  public i32: number = 0,
+  public u32: number = 0,
+  public i64: bigint = BigInt('0'),
+  public u64: bigint = BigInt('0'),
+  public f32: number = 0.0,
+  public f64: number = 0.0,
+  public v8: (number)[] = [],
+  public vf64: (number)[] = []
+){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  const v8 = TypeAliases.createV8Vector(builder, this.v8);
+  const vf64 = TypeAliases.createVf64Vector(builder, this.vf64);
+
+  return TypeAliases.createTypeAliases(builder,
+    this.i8,
+    this.u8,
+    this.i16,
+    this.u16,
+    this.i32,
+    this.u32,
+    this.i64,
+    this.u64,
+    this.f32,
+    this.f64,
+    v8,
+    vf64
+  );
+}
+}
diff --git a/tests/ts/my-game/example/vec3.js b/tests/ts/my-game/example/vec3.js
new file mode 100644
index 0000000..cae64eb
--- /dev/null
+++ b/tests/ts/my-game/example/vec3.js
@@ -0,0 +1,98 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import { Test } from '../../my-game/example/test.js';
+export class Vec3 {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    x() {
+        return this.bb.readFloat32(this.bb_pos);
+    }
+    mutate_x(value) {
+        this.bb.writeFloat32(this.bb_pos + 0, value);
+        return true;
+    }
+    y() {
+        return this.bb.readFloat32(this.bb_pos + 4);
+    }
+    mutate_y(value) {
+        this.bb.writeFloat32(this.bb_pos + 4, value);
+        return true;
+    }
+    z() {
+        return this.bb.readFloat32(this.bb_pos + 8);
+    }
+    mutate_z(value) {
+        this.bb.writeFloat32(this.bb_pos + 8, value);
+        return true;
+    }
+    test1() {
+        return this.bb.readFloat64(this.bb_pos + 16);
+    }
+    mutate_test1(value) {
+        this.bb.writeFloat64(this.bb_pos + 16, value);
+        return true;
+    }
+    test2() {
+        return this.bb.readUint8(this.bb_pos + 24);
+    }
+    mutate_test2(value) {
+        this.bb.writeUint8(this.bb_pos + 24, value);
+        return true;
+    }
+    test3(obj) {
+        return (obj || new Test()).__init(this.bb_pos + 26, this.bb);
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_Example_Vec3';
+    }
+    static sizeOf() {
+        return 32;
+    }
+    static createVec3(builder, x, y, z, test1, test2, test3_a, test3_b) {
+        builder.prep(8, 32);
+        builder.pad(2);
+        builder.prep(2, 4);
+        builder.pad(1);
+        builder.writeInt8(test3_b);
+        builder.writeInt16(test3_a);
+        builder.pad(1);
+        builder.writeInt8(test2);
+        builder.writeFloat64(test1);
+        builder.pad(4);
+        builder.writeFloat32(z);
+        builder.writeFloat32(y);
+        builder.writeFloat32(x);
+        return builder.offset();
+    }
+    unpack() {
+        return new Vec3T(this.x(), this.y(), this.z(), this.test1(), this.test2(), (this.test3() !== null ? this.test3().unpack() : null));
+    }
+    unpackTo(_o) {
+        _o.x = this.x();
+        _o.y = this.y();
+        _o.z = this.z();
+        _o.test1 = this.test1();
+        _o.test2 = this.test2();
+        _o.test3 = (this.test3() !== null ? this.test3().unpack() : null);
+    }
+}
+export class Vec3T {
+    constructor(x = 0.0, y = 0.0, z = 0.0, test1 = 0.0, test2 = 0, test3 = null) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+        this.test1 = test1;
+        this.test2 = test2;
+        this.test3 = test3;
+    }
+    pack(builder) {
+        var _a, _b, _c, _d;
+        return Vec3.createVec3(builder, this.x, this.y, this.z, this.test1, this.test2, ((_b = (_a = this.test3) === null || _a === void 0 ? void 0 : _a.a) !== null && _b !== void 0 ? _b : 0), ((_d = (_c = this.test3) === null || _c === void 0 ? void 0 : _c.b) !== null && _d !== void 0 ? _d : 0));
+    }
+}
diff --git a/tests/ts/my-game/example/vec3.ts b/tests/ts/my-game/example/vec3.ts
new file mode 100644
index 0000000..bc4c473
--- /dev/null
+++ b/tests/ts/my-game/example/vec3.ts
@@ -0,0 +1,137 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+import { Color } from '../../my-game/example/color.js';
+import { Test, TestT } from '../../my-game/example/test.js';
+
+
+export class Vec3 {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):Vec3 {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+x():number {
+  return this.bb!.readFloat32(this.bb_pos);
+}
+
+mutate_x(value:number):boolean {
+  this.bb!.writeFloat32(this.bb_pos + 0, value);
+  return true;
+}
+
+y():number {
+  return this.bb!.readFloat32(this.bb_pos + 4);
+}
+
+mutate_y(value:number):boolean {
+  this.bb!.writeFloat32(this.bb_pos + 4, value);
+  return true;
+}
+
+z():number {
+  return this.bb!.readFloat32(this.bb_pos + 8);
+}
+
+mutate_z(value:number):boolean {
+  this.bb!.writeFloat32(this.bb_pos + 8, value);
+  return true;
+}
+
+test1():number {
+  return this.bb!.readFloat64(this.bb_pos + 16);
+}
+
+mutate_test1(value:number):boolean {
+  this.bb!.writeFloat64(this.bb_pos + 16, value);
+  return true;
+}
+
+test2():Color {
+  return this.bb!.readUint8(this.bb_pos + 24);
+}
+
+mutate_test2(value:Color):boolean {
+  this.bb!.writeUint8(this.bb_pos + 24, value);
+  return true;
+}
+
+test3(obj?:Test):Test|null {
+  return (obj || new Test()).__init(this.bb_pos + 26, this.bb!);
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_Example_Vec3';
+}
+
+static sizeOf():number {
+  return 32;
+}
+
+static createVec3(builder:flatbuffers.Builder, x: number, y: number, z: number, test1: number, test2: Color, test3_a: number, test3_b: number):flatbuffers.Offset {
+  builder.prep(8, 32);
+  builder.pad(2);
+  builder.prep(2, 4);
+  builder.pad(1);
+  builder.writeInt8(test3_b);
+  builder.writeInt16(test3_a);
+  builder.pad(1);
+  builder.writeInt8(test2);
+  builder.writeFloat64(test1);
+  builder.pad(4);
+  builder.writeFloat32(z);
+  builder.writeFloat32(y);
+  builder.writeFloat32(x);
+  return builder.offset();
+}
+
+
+unpack(): Vec3T {
+  return new Vec3T(
+    this.x(),
+    this.y(),
+    this.z(),
+    this.test1(),
+    this.test2(),
+    (this.test3() !== null ? this.test3()!.unpack() : null)
+  );
+}
+
+
+unpackTo(_o: Vec3T): void {
+  _o.x = this.x();
+  _o.y = this.y();
+  _o.z = this.z();
+  _o.test1 = this.test1();
+  _o.test2 = this.test2();
+  _o.test3 = (this.test3() !== null ? this.test3()!.unpack() : null);
+}
+}
+
+export class Vec3T {
+constructor(
+  public x: number = 0.0,
+  public y: number = 0.0,
+  public z: number = 0.0,
+  public test1: number = 0.0,
+  public test2: Color = 0,
+  public test3: TestT|null = null
+){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  return Vec3.createVec3(builder,
+    this.x,
+    this.y,
+    this.z,
+    this.test1,
+    this.test2,
+    (this.test3?.a ?? 0),
+    (this.test3?.b ?? 0)
+  );
+}
+}
diff --git a/tests/ts/my-game/example2/monster.js b/tests/ts/my-game/example2/monster.js
new file mode 100644
index 0000000..f50a2c8
--- /dev/null
+++ b/tests/ts/my-game/example2/monster.js
@@ -0,0 +1,50 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import * as flatbuffers from 'flatbuffers';
+export class Monster {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    static getRootAsMonster(bb, obj) {
+        return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    static getSizePrefixedRootAsMonster(bb, obj) {
+        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+        return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_Example2_Monster';
+    }
+    static startMonster(builder) {
+        builder.startObject(0);
+    }
+    static endMonster(builder) {
+        const offset = builder.endObject();
+        return offset;
+    }
+    static createMonster(builder) {
+        Monster.startMonster(builder);
+        return Monster.endMonster(builder);
+    }
+    serialize() {
+        return this.bb.bytes();
+    }
+    static deserialize(buffer) {
+        return Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer));
+    }
+    unpack() {
+        return new MonsterT();
+    }
+    unpackTo(_o) { }
+}
+export class MonsterT {
+    constructor() { }
+    pack(builder) {
+        return Monster.createMonster(builder);
+    }
+}
diff --git a/tests/ts/my-game/example2/monster.ts b/tests/ts/my-game/example2/monster.ts
new file mode 100644
index 0000000..7240476
--- /dev/null
+++ b/tests/ts/my-game/example2/monster.ts
@@ -0,0 +1,66 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+
+
+export class Monster {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):Monster {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+static getRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:Monster):Monster {
+  return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+static getSizePrefixedRootAsMonster(bb:flatbuffers.ByteBuffer, obj?:Monster):Monster {
+  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+  return (obj || new Monster()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_Example2_Monster';
+}
+
+static startMonster(builder:flatbuffers.Builder) {
+  builder.startObject(0);
+}
+
+static endMonster(builder:flatbuffers.Builder):flatbuffers.Offset {
+  const offset = builder.endObject();
+  return offset;
+}
+
+static createMonster(builder:flatbuffers.Builder):flatbuffers.Offset {
+  Monster.startMonster(builder);
+  return Monster.endMonster(builder);
+}
+
+serialize():Uint8Array {
+  return this.bb!.bytes();
+}
+
+static deserialize(buffer: Uint8Array):Monster {
+  return Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer))
+}
+
+unpack(): MonsterT {
+  return new MonsterT();
+}
+
+
+unpackTo(_o: MonsterT): void {}
+}
+
+export class MonsterT {
+constructor(){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  return Monster.createMonster(builder);
+}
+}
diff --git a/tests/ts/my-game/in-parent-namespace.js b/tests/ts/my-game/in-parent-namespace.js
new file mode 100644
index 0000000..24b0ed7
--- /dev/null
+++ b/tests/ts/my-game/in-parent-namespace.js
@@ -0,0 +1,50 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+import * as flatbuffers from 'flatbuffers';
+export class InParentNamespace {
+    constructor() {
+        this.bb = null;
+        this.bb_pos = 0;
+    }
+    __init(i, bb) {
+        this.bb_pos = i;
+        this.bb = bb;
+        return this;
+    }
+    static getRootAsInParentNamespace(bb, obj) {
+        return (obj || new InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    static getSizePrefixedRootAsInParentNamespace(bb, obj) {
+        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+        return (obj || new InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+    }
+    static getFullyQualifiedName() {
+        return 'MyGame_InParentNamespace';
+    }
+    static startInParentNamespace(builder) {
+        builder.startObject(0);
+    }
+    static endInParentNamespace(builder) {
+        const offset = builder.endObject();
+        return offset;
+    }
+    static createInParentNamespace(builder) {
+        InParentNamespace.startInParentNamespace(builder);
+        return InParentNamespace.endInParentNamespace(builder);
+    }
+    serialize() {
+        return this.bb.bytes();
+    }
+    static deserialize(buffer) {
+        return InParentNamespace.getRootAsInParentNamespace(new flatbuffers.ByteBuffer(buffer));
+    }
+    unpack() {
+        return new InParentNamespaceT();
+    }
+    unpackTo(_o) { }
+}
+export class InParentNamespaceT {
+    constructor() { }
+    pack(builder) {
+        return InParentNamespace.createInParentNamespace(builder);
+    }
+}
diff --git a/tests/ts/my-game/in-parent-namespace.ts b/tests/ts/my-game/in-parent-namespace.ts
new file mode 100644
index 0000000..0de94df
--- /dev/null
+++ b/tests/ts/my-game/in-parent-namespace.ts
@@ -0,0 +1,66 @@
+// automatically generated by the FlatBuffers compiler, do not modify
+
+import * as flatbuffers from 'flatbuffers';
+
+
+
+export class InParentNamespace {
+  bb: flatbuffers.ByteBuffer|null = null;
+  bb_pos = 0;
+  __init(i:number, bb:flatbuffers.ByteBuffer):InParentNamespace {
+  this.bb_pos = i;
+  this.bb = bb;
+  return this;
+}
+
+static getRootAsInParentNamespace(bb:flatbuffers.ByteBuffer, obj?:InParentNamespace):InParentNamespace {
+  return (obj || new InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+static getSizePrefixedRootAsInParentNamespace(bb:flatbuffers.ByteBuffer, obj?:InParentNamespace):InParentNamespace {
+  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
+  return (obj || new InParentNamespace()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
+}
+
+static getFullyQualifiedName():string {
+  return 'MyGame_InParentNamespace';
+}
+
+static startInParentNamespace(builder:flatbuffers.Builder) {
+  builder.startObject(0);
+}
+
+static endInParentNamespace(builder:flatbuffers.Builder):flatbuffers.Offset {
+  const offset = builder.endObject();
+  return offset;
+}
+
+static createInParentNamespace(builder:flatbuffers.Builder):flatbuffers.Offset {
+  InParentNamespace.startInParentNamespace(builder);
+  return InParentNamespace.endInParentNamespace(builder);
+}
+
+serialize():Uint8Array {
+  return this.bb!.bytes();
+}
+
+static deserialize(buffer: Uint8Array):InParentNamespace {
+  return InParentNamespace.getRootAsInParentNamespace(new flatbuffers.ByteBuffer(buffer))
+}
+
+unpack(): InParentNamespaceT {
+  return new InParentNamespaceT();
+}
+
+
+unpackTo(_o: InParentNamespaceT): void {}
+}
+
+export class InParentNamespaceT {
+constructor(){}
+
+
+pack(builder:flatbuffers.Builder): flatbuffers.Offset {
+  return InParentNamespace.createInParentNamespace(builder);
+}
+}