mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
More
This commit is contained in:
@@ -296,11 +296,11 @@ class TsGenerator : public BaseGenerator {
|
||||
auto fully_qualified_type_name =
|
||||
it.second.ns->GetFullyQualifiedName(type_name);
|
||||
auto is_struct = parser_.structs_.Lookup(fully_qualified_type_name);
|
||||
code += "export { " + type_name;
|
||||
code += "export {" + type_name;
|
||||
if (parser_.opts.generate_object_based_api && is_struct) {
|
||||
code += ", " + type_name + parser_.opts.object_suffix;
|
||||
}
|
||||
code += " } from '";
|
||||
code += "} from '";
|
||||
std::string import_extension =
|
||||
parser_.opts.ts_no_import_ext ? "" : ".js";
|
||||
code += base_name_rel + import_extension + "';\n";
|
||||
@@ -1040,7 +1040,7 @@ class TsGenerator : public BaseGenerator {
|
||||
std::string import_extension = parser_.opts.ts_no_import_ext ? "" : ".js";
|
||||
import.import_statement = "import { " + symbols_expression + " } from '" +
|
||||
rel_file_path + import_extension + "';";
|
||||
import.export_statement = "export { " + symbols_expression + " } from '." +
|
||||
import.export_statement = "export {" + symbols_expression + "} from '." +
|
||||
bare_file_path + import_extension + "';";
|
||||
import.dependency = &dependency;
|
||||
import.dependent = &dependent;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { ArrayStruct, ArrayStructT } from './example/array-struct.js';
|
||||
export { ArrayTable, ArrayTableT } from './example/array-table.js';
|
||||
export { InnerStruct, InnerStructT } from './example/inner-struct.js';
|
||||
export { NestedStruct, NestedStructT } from './example/nested-struct.js';
|
||||
export { OuterStruct, OuterStructT } from './example/outer-struct.js';
|
||||
export { TestEnum } from './example/test-enum.js';
|
||||
export {ArrayStruct, ArrayStructT} from './example/array-struct.js';
|
||||
export {ArrayTable, ArrayTableT} from './example/array-table.js';
|
||||
export {InnerStruct, InnerStructT} from './example/inner-struct.js';
|
||||
export {NestedStruct, NestedStructT} from './example/nested-struct.js';
|
||||
export {OuterStruct, OuterStructT} from './example/outer-struct.js';
|
||||
export {TestEnum} from './example/test-enum.js';
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Person } from './test/person.js';
|
||||
export {Person} from './test/person.js';
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { ABC } from './abc.js';
|
||||
export { EvenMoreDefaults, EvenMoreDefaultsT } from './even-more-defaults.js';
|
||||
export { EvenMoreStruct, EvenMoreStructT } from './even-more-struct.js';
|
||||
export {ABC} from './abc.js';
|
||||
export {EvenMoreDefaults, EvenMoreDefaultsT} from './even-more-defaults.js';
|
||||
export {EvenMoreStruct, EvenMoreStructT} from './even-more-struct.js';
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Abc } from './foobar/abc.js';
|
||||
export {Abc} from './foobar/abc.js';
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Person } from './c/person.js';
|
||||
export {Person} from './c/person.js';
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { TableA, TableAT } from './table-a.js';
|
||||
export {TableA, TableAT} from './table-a.js';
|
||||
export * as MyGame from './my-game.js';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { InParentNamespace, InParentNamespaceT } from './my-game/in-parent-namespace.js';
|
||||
export {InParentNamespace, InParentNamespaceT} from './my-game/in-parent-namespace.js';
|
||||
export * as Example from './my-game/example.js';
|
||||
export * as Example2 from './my-game/example2.js';
|
||||
export * as OtherNameSpace from './my-game/other-name-space.js';
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Ability, AbilityT } from './example/ability.js';
|
||||
export { Any } from './example/any.js';
|
||||
export { AnyAmbiguousAliases } from './example/any-ambiguous-aliases.js';
|
||||
export { AnyUniqueAliases } from './example/any-unique-aliases.js';
|
||||
export { Color } from './example/color.js';
|
||||
export { LongEnum } from './example/long-enum.js';
|
||||
export { Monster, MonsterT } from './example/monster.js';
|
||||
export { Race } from './example/race.js';
|
||||
export { Referrable, ReferrableT } from './example/referrable.js';
|
||||
export { Stat, StatT } from './example/stat.js';
|
||||
export { StructOfStructs, StructOfStructsT } from './example/struct-of-structs.js';
|
||||
export { StructOfStructsOfStructs, StructOfStructsOfStructsT } from './example/struct-of-structs-of-structs.js';
|
||||
export { Test, TestT } from './example/test.js';
|
||||
export { TestSimpleTableWithEnum, TestSimpleTableWithEnumT } from './example/test-simple-table-with-enum.js';
|
||||
export { TypeAliases, TypeAliasesT } from './example/type-aliases.js';
|
||||
export { Vec3, Vec3T } from './example/vec3.js';
|
||||
export {Ability, AbilityT} from './example/ability.js';
|
||||
export {Any} from './example/any.js';
|
||||
export {AnyAmbiguousAliases} from './example/any-ambiguous-aliases.js';
|
||||
export {AnyUniqueAliases} from './example/any-unique-aliases.js';
|
||||
export {Color} from './example/color.js';
|
||||
export {LongEnum} from './example/long-enum.js';
|
||||
export {Monster, MonsterT} from './example/monster.js';
|
||||
export {Race} from './example/race.js';
|
||||
export {Referrable, ReferrableT} from './example/referrable.js';
|
||||
export {Stat, StatT} from './example/stat.js';
|
||||
export {StructOfStructs, StructOfStructsT} from './example/struct-of-structs.js';
|
||||
export {StructOfStructsOfStructs, StructOfStructsOfStructsT} from './example/struct-of-structs-of-structs.js';
|
||||
export {Test, TestT} from './example/test.js';
|
||||
export {TestSimpleTableWithEnum, TestSimpleTableWithEnumT} from './example/test-simple-table-with-enum.js';
|
||||
export {TypeAliases, TypeAliasesT} from './example/type-aliases.js';
|
||||
export {Vec3, Vec3T} from './example/vec3.js';
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Monster, MonsterT } from './example2/monster.js';
|
||||
export {Monster, MonsterT} from './example2/monster.js';
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { FromInclude } from './other-name-space/from-include.js';
|
||||
export { TableB, TableBT } from './other-name-space/table-b.js';
|
||||
export { Unused, UnusedT } from './other-name-space/unused.js';
|
||||
export {FromInclude} from './other-name-space/from-include.js';
|
||||
export {TableB, TableBT} from './other-name-space/table-b.js';
|
||||
export {Unused, UnusedT} from './other-name-space/unused.js';
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { OptionalByte } from './optional-scalars/optional-byte';
|
||||
export { ScalarStuff } from './optional-scalars/scalar-stuff';
|
||||
export {OptionalByte} from './optional-scalars/optional-byte';
|
||||
export {ScalarStuff} from './optional-scalars/scalar-stuff';
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { NonZero } from './non-zero.js';
|
||||
export { NonZeroVectorTable, NonZeroVectorTableT } from './non-zero-vector-table.js';
|
||||
export {NonZero} from './non-zero.js';
|
||||
export {NonZeroVectorTable, NonZeroVectorTableT} from './non-zero-vector-table.js';
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { OptionalByte } from './optional-scalars/optional-byte.js';
|
||||
export { ScalarStuff } from './optional-scalars/scalar-stuff.js';
|
||||
export {OptionalByte} from './optional-scalars/optional-byte.js';
|
||||
export {ScalarStuff} from './optional-scalars/scalar-stuff.js';
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { AdvancedFeatures } from './reflection/advanced-features.js';
|
||||
export { BaseType } from './reflection/base-type.js';
|
||||
export { Enum, EnumT } from './reflection/enum.js';
|
||||
export { EnumVal, EnumValT } from './reflection/enum-val.js';
|
||||
export { Field, FieldT } from './reflection/field.js';
|
||||
export { KeyValue, KeyValueT } from './reflection/key-value.js';
|
||||
export { Object_ } from './reflection/object.js';
|
||||
export { RPCCall, RPCCallT } from './reflection/rpccall.js';
|
||||
export { Schema, SchemaT } from './reflection/schema.js';
|
||||
export { SchemaFile, SchemaFileT } from './reflection/schema-file.js';
|
||||
export { Service, ServiceT } from './reflection/service.js';
|
||||
export { Type, TypeT } from './reflection/type.js';
|
||||
export {AdvancedFeatures} from './reflection/advanced-features.js';
|
||||
export {BaseType} from './reflection/base-type.js';
|
||||
export {Enum, EnumT} from './reflection/enum.js';
|
||||
export {EnumVal, EnumValT} from './reflection/enum-val.js';
|
||||
export {Field, FieldT} from './reflection/field.js';
|
||||
export {KeyValue, KeyValueT} from './reflection/key-value.js';
|
||||
export {Object_} from './reflection/object.js';
|
||||
export {RPCCall, RPCCallT} from './reflection/rpccall.js';
|
||||
export {Schema, SchemaT} from './reflection/schema.js';
|
||||
export {SchemaFile, SchemaFileT} from './reflection/schema-file.js';
|
||||
export {Service, ServiceT} from './reflection/service.js';
|
||||
export {Type, TypeT} from './reflection/type.js';
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Info, InfoT } from './one/info.js';
|
||||
export {Info, InfoT} from './one/info.js';
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Header, HeaderT } from './three/header.js';
|
||||
export {Header, HeaderT} from './three/header.js';
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Identity, IdentityT } from './two/identity.js';
|
||||
export {Identity, IdentityT} from './two/identity.js';
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { OptionalByte } from './optional-scalars/optional-byte.js';
|
||||
export { ScalarStuff, ScalarStuffT } from './optional-scalars/scalar-stuff.js';
|
||||
export {OptionalByte} from './optional-scalars/optional-byte.js';
|
||||
export {ScalarStuff, ScalarStuffT} from './optional-scalars/scalar-stuff.js';
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Object_ } from './typescript/object.js';
|
||||
export { class_ } from './typescript/class.js';
|
||||
export {Object_} from './typescript/object.js';
|
||||
export {class_} from './typescript/class.js';
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { A, AT } from './union-underlying-type/a.js';
|
||||
export { ABC } from './union-underlying-type/abc.js';
|
||||
export { B, BT } from './union-underlying-type/b.js';
|
||||
export { C, CT } from './union-underlying-type/c.js';
|
||||
export { D, DT } from './union-underlying-type/d.js';
|
||||
export {A, AT} from './union-underlying-type/a.js';
|
||||
export {ABC} from './union-underlying-type/abc.js';
|
||||
export {B, BT} from './union-underlying-type/b.js';
|
||||
export {C, CT} from './union-underlying-type/c.js';
|
||||
export {D, DT} from './union-underlying-type/d.js';
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Attacker, AttackerT } from './attacker.js';
|
||||
export { BookReader, BookReaderT } from './book-reader.js';
|
||||
export { Character } from './character.js';
|
||||
export { FallingTub, FallingTubT } from './falling-tub.js';
|
||||
export { Gadget } from './gadget.js';
|
||||
export { HandFan, HandFanT } from './hand-fan.js';
|
||||
export { Movie, MovieT } from './movie.js';
|
||||
export { Rapunzel, RapunzelT } from './rapunzel.js';
|
||||
export {Attacker, AttackerT} from './attacker.js';
|
||||
export {BookReader, BookReaderT} from './book-reader.js';
|
||||
export {Character} from './character.js';
|
||||
export {FallingTub, FallingTubT} from './falling-tub.js';
|
||||
export {Gadget} from './gadget.js';
|
||||
export {HandFan, HandFanT} from './hand-fan.js';
|
||||
export {Movie, MovieT} from './movie.js';
|
||||
export {Rapunzel, RapunzelT} from './rapunzel.js';
|
||||
|
||||
@@ -47,7 +47,7 @@ __export(union_vector_exports, {
|
||||
});
|
||||
module.exports = __toCommonJS(union_vector_exports);
|
||||
|
||||
// union_vector/attacker.js
|
||||
// union_vector/attacker.ts
|
||||
var flatbuffers = __toESM(require("flatbuffers"), 1);
|
||||
var Attacker = class _Attacker {
|
||||
constructor() {
|
||||
@@ -97,7 +97,9 @@ var Attacker = class _Attacker {
|
||||
return _Attacker.endAttacker(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new AttackerT(this.swordAttackDamage());
|
||||
return new AttackerT(
|
||||
this.swordAttackDamage()
|
||||
);
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.swordAttackDamage = this.swordAttackDamage();
|
||||
@@ -108,11 +110,14 @@ var AttackerT = class {
|
||||
this.swordAttackDamage = swordAttackDamage;
|
||||
}
|
||||
pack(builder) {
|
||||
return Attacker.createAttacker(builder, this.swordAttackDamage);
|
||||
return Attacker.createAttacker(
|
||||
builder,
|
||||
this.swordAttackDamage
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
// union_vector/book-reader.js
|
||||
// union_vector/book-reader.ts
|
||||
var BookReader = class {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
@@ -142,7 +147,9 @@ var BookReader = class {
|
||||
return builder.offset();
|
||||
}
|
||||
unpack() {
|
||||
return new BookReaderT(this.booksRead());
|
||||
return new BookReaderT(
|
||||
this.booksRead()
|
||||
);
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.booksRead = this.booksRead();
|
||||
@@ -153,11 +160,14 @@ var BookReaderT = class {
|
||||
this.booksRead = booksRead;
|
||||
}
|
||||
pack(builder) {
|
||||
return BookReader.createBookReader(builder, this.booksRead);
|
||||
return BookReader.createBookReader(
|
||||
builder,
|
||||
this.booksRead
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
// union_vector/rapunzel.js
|
||||
// union_vector/rapunzel.ts
|
||||
var Rapunzel = class {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
@@ -187,7 +197,9 @@ var Rapunzel = class {
|
||||
return builder.offset();
|
||||
}
|
||||
unpack() {
|
||||
return new RapunzelT(this.hairLength());
|
||||
return new RapunzelT(
|
||||
this.hairLength()
|
||||
);
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.hairLength = this.hairLength();
|
||||
@@ -198,13 +210,15 @@ var RapunzelT = class {
|
||||
this.hairLength = hairLength;
|
||||
}
|
||||
pack(builder) {
|
||||
return Rapunzel.createRapunzel(builder, this.hairLength);
|
||||
return Rapunzel.createRapunzel(
|
||||
builder,
|
||||
this.hairLength
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
// union_vector/character.js
|
||||
var Character;
|
||||
(function(Character2) {
|
||||
// union_vector/character.ts
|
||||
var Character = /* @__PURE__ */ ((Character2) => {
|
||||
Character2[Character2["NONE"] = 0] = "NONE";
|
||||
Character2[Character2["MuLan"] = 1] = "MuLan";
|
||||
Character2[Character2["Rapunzel"] = 2] = "Rapunzel";
|
||||
@@ -212,7 +226,8 @@ var Character;
|
||||
Character2[Character2["BookFan"] = 4] = "BookFan";
|
||||
Character2[Character2["Other"] = 5] = "Other";
|
||||
Character2[Character2["Unused"] = 6] = "Unused";
|
||||
})(Character || (Character = {}));
|
||||
return Character2;
|
||||
})(Character || {});
|
||||
function unionToCharacter(type, accessor) {
|
||||
switch (Character[type]) {
|
||||
case "NONE":
|
||||
@@ -254,7 +269,7 @@ function unionListToCharacter(type, accessor, index) {
|
||||
}
|
||||
}
|
||||
|
||||
// union_vector/falling-tub.js
|
||||
// union_vector/falling-tub.ts
|
||||
var FallingTub = class {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
@@ -284,7 +299,9 @@ var FallingTub = class {
|
||||
return builder.offset();
|
||||
}
|
||||
unpack() {
|
||||
return new FallingTubT(this.weight());
|
||||
return new FallingTubT(
|
||||
this.weight()
|
||||
);
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.weight = this.weight();
|
||||
@@ -295,11 +312,14 @@ var FallingTubT = class {
|
||||
this.weight = weight;
|
||||
}
|
||||
pack(builder) {
|
||||
return FallingTub.createFallingTub(builder, this.weight);
|
||||
return FallingTub.createFallingTub(
|
||||
builder,
|
||||
this.weight
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
// union_vector/hand-fan.js
|
||||
// union_vector/hand-fan.ts
|
||||
var flatbuffers2 = __toESM(require("flatbuffers"), 1);
|
||||
var HandFan = class _HandFan {
|
||||
constructor() {
|
||||
@@ -349,7 +369,9 @@ var HandFan = class _HandFan {
|
||||
return _HandFan.endHandFan(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new HandFanT(this.length());
|
||||
return new HandFanT(
|
||||
this.length()
|
||||
);
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.length = this.length();
|
||||
@@ -360,19 +382,22 @@ var HandFanT = class {
|
||||
this.length = length;
|
||||
}
|
||||
pack(builder) {
|
||||
return HandFan.createHandFan(builder, this.length);
|
||||
return HandFan.createHandFan(
|
||||
builder,
|
||||
this.length
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
// union_vector/gadget.js
|
||||
var Gadget;
|
||||
(function(Gadget2) {
|
||||
// union_vector/gadget.ts
|
||||
var Gadget = /* @__PURE__ */ ((Gadget2) => {
|
||||
Gadget2[Gadget2["NONE"] = 0] = "NONE";
|
||||
Gadget2[Gadget2["FallingTub"] = 1] = "FallingTub";
|
||||
Gadget2[Gadget2["HandFan"] = 2] = "HandFan";
|
||||
})(Gadget || (Gadget = {}));
|
||||
return Gadget2;
|
||||
})(Gadget || {});
|
||||
|
||||
// union_vector/movie.js
|
||||
// union_vector/movie.ts
|
||||
var flatbuffers3 = __toESM(require("flatbuffers"), 1);
|
||||
var Movie = class _Movie {
|
||||
constructor() {
|
||||
@@ -396,7 +421,7 @@ var Movie = class _Movie {
|
||||
}
|
||||
mainCharacterType() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readUint8(this.bb_pos + offset) : Character.NONE;
|
||||
return offset ? this.bb.readUint8(this.bb_pos + offset) : 0 /* NONE */;
|
||||
}
|
||||
mainCharacter(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
@@ -429,7 +454,7 @@ var Movie = class _Movie {
|
||||
builder.startObject(4);
|
||||
}
|
||||
static addMainCharacterType(builder, mainCharacterType) {
|
||||
builder.addFieldInt8(0, mainCharacterType, Character.NONE);
|
||||
builder.addFieldInt8(0, mainCharacterType, 0 /* NONE */);
|
||||
}
|
||||
static addMainCharacter(builder, mainCharacterOffset) {
|
||||
builder.addFieldOffset(1, mainCharacterOffset, 0);
|
||||
@@ -479,34 +504,39 @@ var Movie = class _Movie {
|
||||
return _Movie.endMovie(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new MovieT(this.mainCharacterType(), (() => {
|
||||
const temp = unionToCharacter(this.mainCharacterType(), this.mainCharacter.bind(this));
|
||||
if (temp === null) {
|
||||
return null;
|
||||
}
|
||||
if (typeof temp === "string") {
|
||||
return temp;
|
||||
}
|
||||
return temp.unpack();
|
||||
})(), this.bb.createScalarList(this.charactersType.bind(this), this.charactersTypeLength()), (() => {
|
||||
const ret = [];
|
||||
for (let targetEnumIndex = 0; targetEnumIndex < this.charactersTypeLength(); ++targetEnumIndex) {
|
||||
const targetEnum = this.charactersType(targetEnumIndex);
|
||||
if (targetEnum === null || Character[targetEnum] === "NONE") {
|
||||
continue;
|
||||
}
|
||||
const temp = unionListToCharacter(targetEnum, this.characters.bind(this), targetEnumIndex);
|
||||
return new MovieT(
|
||||
this.mainCharacterType(),
|
||||
(() => {
|
||||
const temp = unionToCharacter(this.mainCharacterType(), this.mainCharacter.bind(this));
|
||||
if (temp === null) {
|
||||
continue;
|
||||
return null;
|
||||
}
|
||||
if (typeof temp === "string") {
|
||||
ret.push(temp);
|
||||
continue;
|
||||
return temp;
|
||||
}
|
||||
ret.push(temp.unpack());
|
||||
}
|
||||
return ret;
|
||||
})());
|
||||
return temp.unpack();
|
||||
})(),
|
||||
this.bb.createScalarList(this.charactersType.bind(this), this.charactersTypeLength()),
|
||||
(() => {
|
||||
const ret = [];
|
||||
for (let targetEnumIndex = 0; targetEnumIndex < this.charactersTypeLength(); ++targetEnumIndex) {
|
||||
const targetEnum = this.charactersType(targetEnumIndex);
|
||||
if (targetEnum === null || Character[targetEnum] === "NONE") {
|
||||
continue;
|
||||
}
|
||||
const temp = unionListToCharacter(targetEnum, this.characters.bind(this), targetEnumIndex);
|
||||
if (temp === null) {
|
||||
continue;
|
||||
}
|
||||
if (typeof temp === "string") {
|
||||
ret.push(temp);
|
||||
continue;
|
||||
}
|
||||
ret.push(temp.unpack());
|
||||
}
|
||||
return ret;
|
||||
})()
|
||||
);
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.mainCharacterType = this.mainCharacterType();
|
||||
@@ -543,7 +573,7 @@ var Movie = class _Movie {
|
||||
}
|
||||
};
|
||||
var MovieT = class {
|
||||
constructor(mainCharacterType = Character.NONE, mainCharacter = null, charactersType = [], characters = []) {
|
||||
constructor(mainCharacterType = 0 /* NONE */, mainCharacter = null, charactersType = [], characters = []) {
|
||||
this.mainCharacterType = mainCharacterType;
|
||||
this.mainCharacter = mainCharacter;
|
||||
this.charactersType = charactersType;
|
||||
@@ -553,6 +583,12 @@ var MovieT = class {
|
||||
const mainCharacter = builder.createObjectOffset(this.mainCharacter);
|
||||
const charactersType = Movie.createCharactersTypeVector(builder, this.charactersType);
|
||||
const characters = Movie.createCharactersVector(builder, builder.createObjectOffsetList(this.characters));
|
||||
return Movie.createMovie(builder, this.mainCharacterType, mainCharacter, charactersType, characters);
|
||||
return Movie.createMovie(
|
||||
builder,
|
||||
this.mainCharacterType,
|
||||
mainCharacter,
|
||||
charactersType,
|
||||
characters
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user