mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-23 19:01:47 +00:00
TS: Add missing generate files (#8075)
Co-authored-by: Michael Le <michael.le647@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export class Attacker {
|
||||
constructor() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import { Attacker } from './attacker.js';
|
||||
import { BookReader } from './book-reader.js';
|
||||
import { Rapunzel } from './rapunzel.js';
|
||||
@@ -11,7 +12,7 @@ export var Character;
|
||||
Character[Character["BookFan"] = 4] = "BookFan";
|
||||
Character[Character["Other"] = 5] = "Other";
|
||||
Character[Character["Unused"] = 6] = "Unused";
|
||||
})(Character = Character || (Character = {}));
|
||||
})(Character || (Character = {}));
|
||||
export function unionToCharacter(type, accessor) {
|
||||
switch (Character[type]) {
|
||||
case 'NONE': return null;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import { FallingTub } from './falling-tub.js';
|
||||
import { HandFan } from './hand-fan.js';
|
||||
export var Gadget;
|
||||
@@ -6,7 +7,7 @@ export var Gadget;
|
||||
Gadget[Gadget["NONE"] = 0] = "NONE";
|
||||
Gadget[Gadget["FallingTub"] = 1] = "FallingTub";
|
||||
Gadget[Gadget["HandFan"] = 2] = "HandFan";
|
||||
})(Gadget = Gadget || (Gadget = {}));
|
||||
})(Gadget || (Gadget = {}));
|
||||
export function unionToGadget(type, accessor) {
|
||||
switch (Gadget[type]) {
|
||||
case 'NONE': return null;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export class HandFan {
|
||||
constructor() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { Character, unionToCharacter, unionListToCharacter } from './character.js';
|
||||
export class Movie {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
export { Attacker, AttackerT } from './attacker.js';
|
||||
export { BookReader, BookReaderT } from './book-reader.js';
|
||||
export { Character } from './character.js';
|
||||
|
||||
@@ -49,7 +49,7 @@ module.exports = __toCommonJS(union_vector_exports);
|
||||
|
||||
// union_vector/attacker.js
|
||||
var flatbuffers = __toESM(require("flatbuffers"), 1);
|
||||
var Attacker = class {
|
||||
var Attacker = class _Attacker {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -60,11 +60,11 @@ var Attacker = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsAttacker(bb, obj) {
|
||||
return (obj || new Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsAttacker(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Attacker()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
swordAttackDamage() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -92,9 +92,9 @@ var Attacker = class {
|
||||
return offset;
|
||||
}
|
||||
static createAttacker(builder, swordAttackDamage) {
|
||||
Attacker.startAttacker(builder);
|
||||
Attacker.addSwordAttackDamage(builder, swordAttackDamage);
|
||||
return Attacker.endAttacker(builder);
|
||||
_Attacker.startAttacker(builder);
|
||||
_Attacker.addSwordAttackDamage(builder, swordAttackDamage);
|
||||
return _Attacker.endAttacker(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new AttackerT(this.swordAttackDamage());
|
||||
@@ -301,7 +301,7 @@ var FallingTubT = class {
|
||||
|
||||
// union_vector/hand-fan.js
|
||||
var flatbuffers2 = __toESM(require("flatbuffers"), 1);
|
||||
var HandFan = class {
|
||||
var HandFan = class _HandFan {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -312,11 +312,11 @@ var HandFan = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsHandFan(bb, obj) {
|
||||
return (obj || new HandFan()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _HandFan()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsHandFan(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers2.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new HandFan()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _HandFan()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
length() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
@@ -344,9 +344,9 @@ var HandFan = class {
|
||||
return offset;
|
||||
}
|
||||
static createHandFan(builder, length) {
|
||||
HandFan.startHandFan(builder);
|
||||
HandFan.addLength(builder, length);
|
||||
return HandFan.endHandFan(builder);
|
||||
_HandFan.startHandFan(builder);
|
||||
_HandFan.addLength(builder, length);
|
||||
return _HandFan.endHandFan(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new HandFanT(this.length());
|
||||
@@ -374,7 +374,7 @@ var Gadget;
|
||||
|
||||
// union_vector/movie.js
|
||||
var flatbuffers3 = __toESM(require("flatbuffers"), 1);
|
||||
var Movie = class {
|
||||
var Movie = class _Movie {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
@@ -385,11 +385,11 @@ var Movie = class {
|
||||
return this;
|
||||
}
|
||||
static getRootAsMovie(bb, obj) {
|
||||
return (obj || new Movie()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Movie()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsMovie(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers3.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Movie()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return (obj || new _Movie()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static bufferHasIdentifier(bb) {
|
||||
return bb.__has_identifier("MOVI");
|
||||
@@ -471,12 +471,12 @@ var Movie = class {
|
||||
builder.finish(offset, "MOVI", true);
|
||||
}
|
||||
static createMovie(builder, mainCharacterType, mainCharacterOffset, charactersTypeOffset, charactersOffset) {
|
||||
Movie.startMovie(builder);
|
||||
Movie.addMainCharacterType(builder, mainCharacterType);
|
||||
Movie.addMainCharacter(builder, mainCharacterOffset);
|
||||
Movie.addCharactersType(builder, charactersTypeOffset);
|
||||
Movie.addCharacters(builder, charactersOffset);
|
||||
return Movie.endMovie(builder);
|
||||
_Movie.startMovie(builder);
|
||||
_Movie.addMainCharacterType(builder, mainCharacterType);
|
||||
_Movie.addMainCharacter(builder, mainCharacterOffset);
|
||||
_Movie.addCharactersType(builder, charactersTypeOffset);
|
||||
_Movie.addCharacters(builder, charactersOffset);
|
||||
return _Movie.endMovie(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new MovieT(this.mainCharacterType(), (() => {
|
||||
|
||||
Reference in New Issue
Block a user