mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-18 12:44:25 +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 */
|
||||
/**
|
||||
* New schema language features that are not supported by old code generators.
|
||||
*/
|
||||
@@ -8,4 +9,4 @@ export var AdvancedFeatures;
|
||||
AdvancedFeatures["AdvancedUnionFeatures"] = "2";
|
||||
AdvancedFeatures["OptionalScalars"] = "4";
|
||||
AdvancedFeatures["DefaultVectorsAndStrings"] = "8";
|
||||
})(AdvancedFeatures = AdvancedFeatures || (AdvancedFeatures = {}));
|
||||
})(AdvancedFeatures || (AdvancedFeatures = {}));
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
/**
|
||||
* New schema language features that are not supported by old code generators.
|
||||
*/
|
||||
|
||||
3
tests/ts/reflection/base-type.d.ts
vendored
3
tests/ts/reflection/base-type.d.ts
vendored
@@ -17,5 +17,6 @@ export declare enum BaseType {
|
||||
Obj = 15,
|
||||
Union = 16,
|
||||
Array = 17,
|
||||
MaxBaseType = 18
|
||||
Vector64 = 18,
|
||||
MaxBaseType = 19
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
export var BaseType;
|
||||
(function (BaseType) {
|
||||
BaseType[BaseType["None"] = 0] = "None";
|
||||
@@ -19,5 +20,6 @@ export var BaseType;
|
||||
BaseType[BaseType["Obj"] = 15] = "Obj";
|
||||
BaseType[BaseType["Union"] = 16] = "Union";
|
||||
BaseType[BaseType["Array"] = 17] = "Array";
|
||||
BaseType[BaseType["MaxBaseType"] = 18] = "MaxBaseType";
|
||||
})(BaseType = BaseType || (BaseType = {}));
|
||||
BaseType[BaseType["Vector64"] = 18] = "Vector64";
|
||||
BaseType[BaseType["MaxBaseType"] = 19] = "MaxBaseType";
|
||||
})(BaseType || (BaseType = {}));
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export enum BaseType {
|
||||
None = 0,
|
||||
UType = 1,
|
||||
@@ -19,5 +21,6 @@ export enum BaseType {
|
||||
Obj = 15,
|
||||
Union = 16,
|
||||
Array = 17,
|
||||
MaxBaseType = 18
|
||||
Vector64 = 18,
|
||||
MaxBaseType = 19
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { KeyValue } from '../reflection/key-value.js';
|
||||
import { Type } from '../reflection/type.js';
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { EnumVal } from '../reflection/enum-val.js';
|
||||
import { KeyValue } from '../reflection/key-value.js';
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { EnumVal, EnumValT } from '../reflection/enum-val.js';
|
||||
|
||||
9
tests/ts/reflection/field.d.ts
vendored
9
tests/ts/reflection/field.d.ts
vendored
@@ -36,6 +36,11 @@ export declare class Field implements flatbuffers.IUnpackableObject<FieldT> {
|
||||
*/
|
||||
padding(): number;
|
||||
mutate_padding(value: number): boolean;
|
||||
/**
|
||||
* If the field uses 64-bit offsets.
|
||||
*/
|
||||
offset64(): boolean;
|
||||
mutate_offset64(value: boolean): boolean;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startField(builder: flatbuffers.Builder): void;
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
|
||||
@@ -55,6 +60,7 @@ export declare class Field implements flatbuffers.IUnpackableObject<FieldT> {
|
||||
static startDocumentationVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addOptional(builder: flatbuffers.Builder, optional: boolean): void;
|
||||
static addPadding(builder: flatbuffers.Builder, padding: number): void;
|
||||
static addOffset64(builder: flatbuffers.Builder, offset64: boolean): void;
|
||||
static endField(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
unpack(): FieldT;
|
||||
unpackTo(_o: FieldT): void;
|
||||
@@ -73,6 +79,7 @@ export declare class FieldT implements flatbuffers.IGeneratedObject {
|
||||
documentation: (string)[];
|
||||
optional: boolean;
|
||||
padding: number;
|
||||
constructor(name?: string | Uint8Array | null, type?: TypeT | null, id?: number, offset?: number, defaultInteger?: bigint, defaultReal?: number, deprecated?: boolean, required?: boolean, key?: boolean, attributes?: (KeyValueT)[], documentation?: (string)[], optional?: boolean, padding?: number);
|
||||
offset64: boolean;
|
||||
constructor(name?: string | Uint8Array | null, type?: TypeT | null, id?: number, offset?: number, defaultInteger?: bigint, defaultReal?: number, deprecated?: boolean, required?: boolean, key?: boolean, attributes?: (KeyValueT)[], documentation?: (string)[], optional?: boolean, padding?: number, offset64?: boolean);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { KeyValue } from '../reflection/key-value.js';
|
||||
import { Type } from '../reflection/type.js';
|
||||
@@ -154,11 +155,26 @@ export class Field {
|
||||
this.bb.writeUint16(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* If the field uses 64-bit offsets.
|
||||
*/
|
||||
offset64() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 30);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_offset64(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 30);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Field';
|
||||
}
|
||||
static startField(builder) {
|
||||
builder.startObject(13);
|
||||
builder.startObject(14);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
@@ -219,6 +235,9 @@ export class Field {
|
||||
static addPadding(builder, padding) {
|
||||
builder.addFieldInt16(12, padding, 0);
|
||||
}
|
||||
static addOffset64(builder, offset64) {
|
||||
builder.addFieldInt8(13, +offset64, +false);
|
||||
}
|
||||
static endField(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
@@ -226,7 +245,7 @@ export class Field {
|
||||
return offset;
|
||||
}
|
||||
unpack() {
|
||||
return new FieldT(this.name(), (this.type() !== null ? this.type().unpack() : null), this.id(), this.offset(), this.defaultInteger(), this.defaultReal(), this.deprecated(), this.required(), this.key(), this.bb.createObjList(this.attributes.bind(this), this.attributesLength()), this.bb.createScalarList(this.documentation.bind(this), this.documentationLength()), this.optional(), this.padding());
|
||||
return new FieldT(this.name(), (this.type() !== null ? this.type().unpack() : null), this.id(), this.offset(), this.defaultInteger(), this.defaultReal(), this.deprecated(), this.required(), this.key(), this.bb.createObjList(this.attributes.bind(this), this.attributesLength()), this.bb.createScalarList(this.documentation.bind(this), this.documentationLength()), this.optional(), this.padding(), this.offset64());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
@@ -242,10 +261,11 @@ export class Field {
|
||||
_o.documentation = this.bb.createScalarList(this.documentation.bind(this), this.documentationLength());
|
||||
_o.optional = this.optional();
|
||||
_o.padding = this.padding();
|
||||
_o.offset64 = this.offset64();
|
||||
}
|
||||
}
|
||||
export class FieldT {
|
||||
constructor(name = null, type = null, id = 0, offset = 0, defaultInteger = BigInt('0'), defaultReal = 0.0, deprecated = false, required = false, key = false, attributes = [], documentation = [], optional = false, padding = 0) {
|
||||
constructor(name = null, type = null, id = 0, offset = 0, defaultInteger = BigInt('0'), defaultReal = 0.0, deprecated = false, required = false, key = false, attributes = [], documentation = [], optional = false, padding = 0, offset64 = false) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.id = id;
|
||||
@@ -259,6 +279,7 @@ export class FieldT {
|
||||
this.documentation = documentation;
|
||||
this.optional = optional;
|
||||
this.padding = padding;
|
||||
this.offset64 = offset64;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
@@ -279,6 +300,7 @@ export class FieldT {
|
||||
Field.addDocumentation(builder, documentation);
|
||||
Field.addOptional(builder, this.optional);
|
||||
Field.addPadding(builder, this.padding);
|
||||
Field.addOffset64(builder, this.offset64);
|
||||
return Field.endField(builder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
@@ -205,12 +207,31 @@ mutate_padding(value:number):boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the field uses 64-bit offsets.
|
||||
*/
|
||||
offset64():boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 30);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
mutate_offset64(value:boolean):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 30);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.Field';
|
||||
}
|
||||
|
||||
static startField(builder:flatbuffers.Builder) {
|
||||
builder.startObject(13);
|
||||
builder.startObject(14);
|
||||
}
|
||||
|
||||
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
|
||||
@@ -289,6 +310,10 @@ static addPadding(builder:flatbuffers.Builder, padding:number) {
|
||||
builder.addFieldInt16(12, padding, 0);
|
||||
}
|
||||
|
||||
static addOffset64(builder:flatbuffers.Builder, offset64:boolean) {
|
||||
builder.addFieldInt8(13, +offset64, +false);
|
||||
}
|
||||
|
||||
static endField(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // name
|
||||
@@ -311,7 +336,8 @@ unpack(): FieldT {
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
|
||||
this.optional(),
|
||||
this.padding()
|
||||
this.padding(),
|
||||
this.offset64()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -330,6 +356,7 @@ unpackTo(_o: FieldT): void {
|
||||
_o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
|
||||
_o.optional = this.optional();
|
||||
_o.padding = this.padding();
|
||||
_o.offset64 = this.offset64();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,7 +374,8 @@ constructor(
|
||||
public attributes: (KeyValueT)[] = [],
|
||||
public documentation: (string)[] = [],
|
||||
public optional: boolean = false,
|
||||
public padding: number = 0
|
||||
public padding: number = 0,
|
||||
public offset64: boolean = false
|
||||
){}
|
||||
|
||||
|
||||
@@ -371,6 +399,7 @@ pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
Field.addDocumentation(builder, documentation);
|
||||
Field.addOptional(builder, this.optional);
|
||||
Field.addPadding(builder, this.padding);
|
||||
Field.addOffset64(builder, this.offset64);
|
||||
|
||||
return Field.endField(builder);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export class KeyValue {
|
||||
constructor() {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { Field } from '../reflection/field.js';
|
||||
import { KeyValue } from '../reflection/key-value.js';
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Field, FieldT } from '../reflection/field.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { KeyValue } from '../reflection/key-value.js';
|
||||
import { Object_ } from '../reflection/object.js';
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
/**
|
||||
* File specific information.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { Enum } from '../reflection/enum.js';
|
||||
import { Object_ } from '../reflection/object.js';
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Enum, EnumT } from '../reflection/enum.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { KeyValue } from '../reflection/key-value.js';
|
||||
import { RPCCall } from '../reflection/rpccall.js';
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { BaseType } from '../reflection/base-type.js';
|
||||
export class Type {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { BaseType } from '../reflection/base-type.js';
|
||||
|
||||
Reference in New Issue
Block a user