mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
TS/JS: Export object based classes on entry (#7822)
* TS/JS: Export object based classes on entry
Along with the non object ones, for consistency. This is a regression
introduced recently.
Before:
`export { UpdateSettingsRequest } from './worker/update-settings-request.js';`
Now:
`export { UpdateSettingsRequest, UpdateSettingsRequestT } from './worker/update-settings-request.js';`
* only export object based classes for structs
Enums are not elegible.
---------
Co-authored-by: Björn Harrtell <bjornharrtell@users.noreply.github.com>
Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -255,7 +255,6 @@ class TsGenerator : public BaseGenerator {
|
||||
|
||||
for (const auto &it : ns_defs_) {
|
||||
code = "// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n";
|
||||
|
||||
// export all definitions in ns entry point module
|
||||
int export_counter = 0;
|
||||
for (const auto &def : it.second.definitions) {
|
||||
@@ -281,7 +280,14 @@ class TsGenerator : public BaseGenerator {
|
||||
base_name_rel += base_file_name;
|
||||
auto ts_file_path_rel = base_name_rel + ".ts";
|
||||
auto type_name = def.first;
|
||||
code += "export { " + type_name + " } from '";
|
||||
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;
|
||||
if (parser_.opts.generate_object_based_api && is_struct) {
|
||||
code += ", " + type_name + parser_.opts.object_suffix;
|
||||
}
|
||||
code += " } from '";
|
||||
std::string import_extension =
|
||||
parser_.opts.ts_no_import_ext ? "" : ".js";
|
||||
code += base_name_rel + import_extension + "';\n";
|
||||
|
||||
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
@@ -27,10 +31,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
||||
var example_exports = {};
|
||||
__export(example_exports, {
|
||||
ArrayStruct: () => ArrayStruct,
|
||||
ArrayStructT: () => ArrayStructT,
|
||||
ArrayTable: () => ArrayTable,
|
||||
ArrayTableT: () => ArrayTableT,
|
||||
InnerStruct: () => InnerStruct,
|
||||
InnerStructT: () => InnerStructT,
|
||||
NestedStruct: () => NestedStruct,
|
||||
NestedStructT: () => NestedStructT,
|
||||
OuterStruct: () => OuterStruct,
|
||||
OuterStructT: () => OuterStructT,
|
||||
TestEnum: () => TestEnum
|
||||
});
|
||||
module.exports = __toCommonJS(example_exports);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export { ArrayStruct } from './example/array-struct.js';
|
||||
export { ArrayTable } from './example/array-table.js';
|
||||
export { InnerStruct } from './example/inner-struct.js';
|
||||
export { NestedStruct } from './example/nested-struct.js';
|
||||
export { OuterStruct } from './example/outer-struct.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';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
export { ArrayStruct } from './example/array-struct.js';
|
||||
export { ArrayTable } from './example/array-table.js';
|
||||
export { InnerStruct } from './example/inner-struct.js';
|
||||
export { NestedStruct } from './example/nested-struct.js';
|
||||
export { OuterStruct } from './example/outer-struct.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';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
export { ArrayStruct } from './example/array-struct.js';
|
||||
export { ArrayTable } from './example/array-table.js';
|
||||
export { InnerStruct } from './example/inner-struct.js';
|
||||
export { NestedStruct } from './example/nested-struct.js';
|
||||
export { OuterStruct } from './example/outer-struct.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
tests/ts/monster_test.d.ts
vendored
2
tests/ts/monster_test.d.ts
vendored
@@ -1,2 +1,2 @@
|
||||
export { TableA } from './table-a.js';
|
||||
export { TableA, TableAT } from './table-a.js';
|
||||
export * as MyGame from './my-game.js';
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
export { TableA } from './table-a.js';
|
||||
export { TableA, TableAT } from './table-a.js';
|
||||
export * as MyGame from './my-game.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
export { TableA } from './table-a.js';
|
||||
export { TableA, TableAT } from './table-a.js';
|
||||
export * as MyGame from './my-game.js';
|
||||
|
||||
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
@@ -27,7 +31,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
||||
var monster_test_exports = {};
|
||||
__export(monster_test_exports, {
|
||||
MyGame: () => my_game_exports,
|
||||
TableA: () => TableA
|
||||
TableA: () => TableA,
|
||||
TableAT: () => TableAT
|
||||
});
|
||||
module.exports = __toCommonJS(monster_test_exports);
|
||||
|
||||
@@ -167,6 +172,7 @@ __export(my_game_exports, {
|
||||
Example: () => example_exports,
|
||||
Example2: () => example2_exports,
|
||||
InParentNamespace: () => InParentNamespace,
|
||||
InParentNamespaceT: () => InParentNamespaceT,
|
||||
OtherNameSpace: () => other_name_space_exports
|
||||
});
|
||||
|
||||
@@ -227,21 +233,31 @@ var InParentNamespaceT = class {
|
||||
var example_exports = {};
|
||||
__export(example_exports, {
|
||||
Ability: () => Ability,
|
||||
AbilityT: () => AbilityT,
|
||||
Any: () => Any,
|
||||
AnyAmbiguousAliases: () => AnyAmbiguousAliases,
|
||||
AnyUniqueAliases: () => AnyUniqueAliases,
|
||||
Color: () => Color,
|
||||
LongEnum: () => LongEnum,
|
||||
Monster: () => Monster2,
|
||||
MonsterT: () => MonsterT2,
|
||||
Race: () => Race,
|
||||
Referrable: () => Referrable,
|
||||
ReferrableT: () => ReferrableT,
|
||||
Stat: () => Stat,
|
||||
StatT: () => StatT,
|
||||
StructOfStructs: () => StructOfStructs,
|
||||
StructOfStructsOfStructs: () => StructOfStructsOfStructs,
|
||||
StructOfStructsOfStructsT: () => StructOfStructsOfStructsT,
|
||||
StructOfStructsT: () => StructOfStructsT,
|
||||
Test: () => Test,
|
||||
TestSimpleTableWithEnum: () => TestSimpleTableWithEnum,
|
||||
TestSimpleTableWithEnumT: () => TestSimpleTableWithEnumT,
|
||||
TestT: () => TestT,
|
||||
TypeAliases: () => TypeAliases,
|
||||
Vec3: () => Vec3
|
||||
TypeAliasesT: () => TypeAliasesT,
|
||||
Vec3: () => Vec3,
|
||||
Vec3T: () => Vec3T
|
||||
});
|
||||
|
||||
// my-game/example/ability.js
|
||||
@@ -916,6 +932,10 @@ var Monster2 = class {
|
||||
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 Monster2()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
@@ -2502,7 +2522,8 @@ var TypeAliasesT = class {
|
||||
// my-game/example2.js
|
||||
var example2_exports = {};
|
||||
__export(example2_exports, {
|
||||
Monster: () => Monster
|
||||
Monster: () => Monster,
|
||||
MonsterT: () => MonsterT
|
||||
});
|
||||
|
||||
// my-game/other-name-space.js
|
||||
@@ -2510,7 +2531,9 @@ var other_name_space_exports = {};
|
||||
__export(other_name_space_exports, {
|
||||
FromInclude: () => FromInclude,
|
||||
TableB: () => TableB,
|
||||
Unused: () => Unused
|
||||
TableBT: () => TableBT,
|
||||
Unused: () => Unused,
|
||||
UnusedT: () => UnusedT
|
||||
});
|
||||
|
||||
// my-game/other-name-space/from-include.js
|
||||
|
||||
2
tests/ts/my-game.d.ts
vendored
2
tests/ts/my-game.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
export { InParentNamespace } 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';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
export { InParentNamespace } 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';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
export { InParentNamespace } 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';
|
||||
|
||||
20
tests/ts/my-game/example.d.ts
vendored
20
tests/ts/my-game/example.d.ts
vendored
@@ -1,16 +1,16 @@
|
||||
export { Ability } from './example/ability.js';
|
||||
export { Ability, AbilityT } from './example/ability.js';
|
||||
export { Any } from './example/any.js';
|
||||
export { AnyAmbiguousAliases } from './example/any-ambiguous-aliases.js';
|
||||
export { AnyUniqueAliases } from './example/any-unique-aliases.js';
|
||||
export { Color } from './example/color.js';
|
||||
export { LongEnum } from './example/long-enum.js';
|
||||
export { Monster } from './example/monster.js';
|
||||
export { Monster, MonsterT } from './example/monster.js';
|
||||
export { Race } from './example/race.js';
|
||||
export { Referrable } from './example/referrable.js';
|
||||
export { Stat } from './example/stat.js';
|
||||
export { StructOfStructs } from './example/struct-of-structs.js';
|
||||
export { StructOfStructsOfStructs } from './example/struct-of-structs-of-structs.js';
|
||||
export { Test } from './example/test.js';
|
||||
export { TestSimpleTableWithEnum } from './example/test-simple-table-with-enum.js';
|
||||
export { TypeAliases } from './example/type-aliases.js';
|
||||
export { Vec3 } from './example/vec3.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';
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
export { Ability } from './example/ability.js';
|
||||
export { Ability, AbilityT } from './example/ability.js';
|
||||
export { Any } from './example/any.js';
|
||||
export { AnyAmbiguousAliases } from './example/any-ambiguous-aliases.js';
|
||||
export { AnyUniqueAliases } from './example/any-unique-aliases.js';
|
||||
export { Color } from './example/color.js';
|
||||
export { LongEnum } from './example/long-enum.js';
|
||||
export { Monster } from './example/monster.js';
|
||||
export { Monster, MonsterT } from './example/monster.js';
|
||||
export { Race } from './example/race.js';
|
||||
export { Referrable } from './example/referrable.js';
|
||||
export { Stat } from './example/stat.js';
|
||||
export { StructOfStructs } from './example/struct-of-structs.js';
|
||||
export { StructOfStructsOfStructs } from './example/struct-of-structs-of-structs.js';
|
||||
export { Test } from './example/test.js';
|
||||
export { TestSimpleTableWithEnum } from './example/test-simple-table-with-enum.js';
|
||||
export { TypeAliases } from './example/type-aliases.js';
|
||||
export { Vec3 } from './example/vec3.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';
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
export { Ability } from './example/ability.js';
|
||||
export { Ability, AbilityT } from './example/ability.js';
|
||||
export { Any } from './example/any.js';
|
||||
export { AnyAmbiguousAliases } from './example/any-ambiguous-aliases.js';
|
||||
export { AnyUniqueAliases } from './example/any-unique-aliases.js';
|
||||
export { Color } from './example/color.js';
|
||||
export { LongEnum } from './example/long-enum.js';
|
||||
export { Monster } from './example/monster.js';
|
||||
export { Monster, MonsterT } from './example/monster.js';
|
||||
export { Race } from './example/race.js';
|
||||
export { Referrable } from './example/referrable.js';
|
||||
export { Stat } from './example/stat.js';
|
||||
export { StructOfStructs } from './example/struct-of-structs.js';
|
||||
export { StructOfStructsOfStructs } from './example/struct-of-structs-of-structs.js';
|
||||
export { Test } from './example/test.js';
|
||||
export { TestSimpleTableWithEnum } from './example/test-simple-table-with-enum.js';
|
||||
export { TypeAliases } from './example/type-aliases.js';
|
||||
export { Vec3 } from './example/vec3.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
tests/ts/my-game/example2.d.ts
vendored
2
tests/ts/my-game/example2.d.ts
vendored
@@ -1 +1 @@
|
||||
export { Monster } from './example2/monster.js';
|
||||
export { Monster, MonsterT } from './example2/monster.js';
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
export { Monster } from './example2/monster.js';
|
||||
export { Monster, MonsterT } from './example2/monster.js';
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
export { Monster } from './example2/monster.js';
|
||||
export { Monster, MonsterT } from './example2/monster.js';
|
||||
|
||||
4
tests/ts/my-game/other-name-space.d.ts
vendored
4
tests/ts/my-game/other-name-space.d.ts
vendored
@@ -1,3 +1,3 @@
|
||||
export { FromInclude } from './other-name-space/from-include.js';
|
||||
export { TableB } from './other-name-space/table-b.js';
|
||||
export { Unused } from './other-name-space/unused.js';
|
||||
export { TableB, TableBT } from './other-name-space/table-b.js';
|
||||
export { Unused, UnusedT } from './other-name-space/unused.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
export { FromInclude } from './other-name-space/from-include.js';
|
||||
export { TableB } from './other-name-space/table-b.js';
|
||||
export { Unused } from './other-name-space/unused.js';
|
||||
export { TableB, TableBT } from './other-name-space/table-b.js';
|
||||
export { Unused, UnusedT } from './other-name-space/unused.js';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
export { FromInclude } from './other-name-space/from-include.js';
|
||||
export { TableB } from './other-name-space/table-b.js';
|
||||
export { Unused } from './other-name-space/unused.js';
|
||||
export { TableB, TableBT } from './other-name-space/table-b.js';
|
||||
export { Unused, UnusedT } from './other-name-space/unused.js';
|
||||
|
||||
18
tests/ts/reflection.d.ts
vendored
18
tests/ts/reflection.d.ts
vendored
@@ -1,12 +1,12 @@
|
||||
export { AdvancedFeatures } from './reflection/advanced-features.js';
|
||||
export { BaseType } from './reflection/base-type.js';
|
||||
export { Enum } from './reflection/enum.js';
|
||||
export { EnumVal } from './reflection/enum-val.js';
|
||||
export { Field } from './reflection/field.js';
|
||||
export { KeyValue } from './reflection/key-value.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 } from './reflection/rpccall.js';
|
||||
export { Schema } from './reflection/schema.js';
|
||||
export { SchemaFile } from './reflection/schema-file.js';
|
||||
export { Service } from './reflection/service.js';
|
||||
export { Type } from './reflection/type.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';
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
export { AdvancedFeatures } from './reflection/advanced-features.js';
|
||||
export { BaseType } from './reflection/base-type.js';
|
||||
export { Enum } from './reflection/enum.js';
|
||||
export { EnumVal } from './reflection/enum-val.js';
|
||||
export { Field } from './reflection/field.js';
|
||||
export { KeyValue } from './reflection/key-value.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 } from './reflection/rpccall.js';
|
||||
export { Schema } from './reflection/schema.js';
|
||||
export { SchemaFile } from './reflection/schema-file.js';
|
||||
export { Service } from './reflection/service.js';
|
||||
export { Type } from './reflection/type.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,13 +2,13 @@
|
||||
|
||||
export { AdvancedFeatures } from './reflection/advanced-features.js';
|
||||
export { BaseType } from './reflection/base-type.js';
|
||||
export { Enum } from './reflection/enum.js';
|
||||
export { EnumVal } from './reflection/enum-val.js';
|
||||
export { Field } from './reflection/field.js';
|
||||
export { KeyValue } from './reflection/key-value.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 } from './reflection/rpccall.js';
|
||||
export { Schema } from './reflection/schema.js';
|
||||
export { SchemaFile } from './reflection/schema-file.js';
|
||||
export { Service } from './reflection/service.js';
|
||||
export { Type } from './reflection/type.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';
|
||||
|
||||
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
@@ -50,15 +54,24 @@ __export(reflection_exports, {
|
||||
AdvancedFeatures: () => AdvancedFeatures,
|
||||
BaseType: () => BaseType,
|
||||
Enum: () => Enum,
|
||||
EnumT: () => EnumT,
|
||||
EnumVal: () => EnumVal,
|
||||
EnumValT: () => EnumValT,
|
||||
Field: () => Field,
|
||||
FieldT: () => FieldT,
|
||||
KeyValue: () => KeyValue,
|
||||
KeyValueT: () => KeyValueT,
|
||||
Object_: () => Object_,
|
||||
RPCCall: () => RPCCall,
|
||||
RPCCallT: () => RPCCallT,
|
||||
Schema: () => Schema,
|
||||
SchemaFile: () => SchemaFile,
|
||||
SchemaFileT: () => SchemaFileT,
|
||||
SchemaT: () => SchemaT,
|
||||
Service: () => Service,
|
||||
Type: () => Type
|
||||
ServiceT: () => ServiceT,
|
||||
Type: () => Type,
|
||||
TypeT: () => TypeT
|
||||
});
|
||||
|
||||
// reflection/advanced-features.js
|
||||
@@ -237,6 +250,9 @@ var Type = class {
|
||||
this.bb.writeUint16(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* The size (octets) of the `base_type` field.
|
||||
*/
|
||||
baseSize() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.readUint32(this.bb_pos + offset) : 4;
|
||||
@@ -249,6 +265,9 @@ var Type = class {
|
||||
this.bb.writeUint32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* The size (octets) of the `element` field, if present.
|
||||
*/
|
||||
elementSize() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
|
||||
@@ -770,6 +789,9 @@ var Field = class {
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Number of padding octets to always add after this field. Structs only.
|
||||
*/
|
||||
padding() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 28);
|
||||
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
||||
@@ -1542,6 +1564,10 @@ var Schema = class {
|
||||
this.bb.writeUint64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* All the files used in this compilation. Files are relative to where
|
||||
* flatc was invoked.
|
||||
*/
|
||||
fbsFiles(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 18);
|
||||
return offset ? (obj || new SchemaFile()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
|
||||
12
tests/ts/union_vector/union_vector.d.ts
vendored
12
tests/ts/union_vector/union_vector.d.ts
vendored
@@ -1,8 +1,8 @@
|
||||
export { Attacker } from './attacker.js';
|
||||
export { BookReader } from './book-reader.js';
|
||||
export { Attacker, AttackerT } from './attacker.js';
|
||||
export { BookReader, BookReaderT } from './book-reader.js';
|
||||
export { Character } from './character.js';
|
||||
export { FallingTub } from './falling-tub.js';
|
||||
export { FallingTub, FallingTubT } from './falling-tub.js';
|
||||
export { Gadget } from './gadget.js';
|
||||
export { HandFan } from './hand-fan.js';
|
||||
export { Movie } from './movie.js';
|
||||
export { Rapunzel } from './rapunzel.js';
|
||||
export { HandFan, HandFanT } from './hand-fan.js';
|
||||
export { Movie, MovieT } from './movie.js';
|
||||
export { Rapunzel, RapunzelT } from './rapunzel.js';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
export { Attacker } from './attacker.js';
|
||||
export { BookReader } from './book-reader.js';
|
||||
export { Attacker, AttackerT } from './attacker.js';
|
||||
export { BookReader, BookReaderT } from './book-reader.js';
|
||||
export { Character } from './character.js';
|
||||
export { FallingTub } from './falling-tub.js';
|
||||
export { FallingTub, FallingTubT } from './falling-tub.js';
|
||||
export { Gadget } from './gadget.js';
|
||||
export { HandFan } from './hand-fan.js';
|
||||
export { Movie } from './movie.js';
|
||||
export { Rapunzel } from './rapunzel.js';
|
||||
export { HandFan, HandFanT } from './hand-fan.js';
|
||||
export { Movie, MovieT } from './movie.js';
|
||||
export { Rapunzel, RapunzelT } from './rapunzel.js';
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
export { Attacker } from './attacker.js';
|
||||
export { BookReader } from './book-reader.js';
|
||||
export { Attacker, AttackerT } from './attacker.js';
|
||||
export { BookReader, BookReaderT } from './book-reader.js';
|
||||
export { Character } from './character.js';
|
||||
export { FallingTub } from './falling-tub.js';
|
||||
export { FallingTub, FallingTubT } from './falling-tub.js';
|
||||
export { Gadget } from './gadget.js';
|
||||
export { HandFan } from './hand-fan.js';
|
||||
export { Movie } from './movie.js';
|
||||
export { Rapunzel } from './rapunzel.js';
|
||||
export { HandFan, HandFanT } from './hand-fan.js';
|
||||
export { Movie, MovieT } from './movie.js';
|
||||
export { Rapunzel, RapunzelT } from './rapunzel.js';
|
||||
|
||||
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
@@ -27,13 +31,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
||||
var union_vector_exports = {};
|
||||
__export(union_vector_exports, {
|
||||
Attacker: () => Attacker,
|
||||
AttackerT: () => AttackerT,
|
||||
BookReader: () => BookReader,
|
||||
BookReaderT: () => BookReaderT,
|
||||
Character: () => Character,
|
||||
FallingTub: () => FallingTub,
|
||||
FallingTubT: () => FallingTubT,
|
||||
Gadget: () => Gadget,
|
||||
HandFan: () => HandFan,
|
||||
HandFanT: () => HandFanT,
|
||||
Movie: () => Movie,
|
||||
Rapunzel: () => Rapunzel
|
||||
MovieT: () => MovieT,
|
||||
Rapunzel: () => Rapunzel,
|
||||
RapunzelT: () => RapunzelT
|
||||
});
|
||||
module.exports = __toCommonJS(union_vector_exports);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user