mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-11 07:27:27 +00:00
bulk code format fix (#8707)
This commit is contained in:
8
tests/ts/reflection/advanced-features.d.ts
vendored
8
tests/ts/reflection/advanced-features.d.ts
vendored
@@ -2,8 +2,8 @@
|
||||
* New schema language features that are not supported by old code generators.
|
||||
*/
|
||||
export declare enum AdvancedFeatures {
|
||||
AdvancedArrayFeatures = "1",
|
||||
AdvancedUnionFeatures = "2",
|
||||
OptionalScalars = "4",
|
||||
DefaultVectorsAndStrings = "8"
|
||||
AdvancedArrayFeatures = '1',
|
||||
AdvancedUnionFeatures = '2',
|
||||
OptionalScalars = '4',
|
||||
DefaultVectorsAndStrings = '8',
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
// 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 */
|
||||
/* 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.
|
||||
*/
|
||||
export var AdvancedFeatures;
|
||||
(function (AdvancedFeatures) {
|
||||
AdvancedFeatures["AdvancedArrayFeatures"] = "1";
|
||||
AdvancedFeatures["AdvancedUnionFeatures"] = "2";
|
||||
AdvancedFeatures["OptionalScalars"] = "4";
|
||||
AdvancedFeatures["DefaultVectorsAndStrings"] = "8";
|
||||
(function(AdvancedFeatures) {
|
||||
AdvancedFeatures['AdvancedArrayFeatures'] = '1';
|
||||
AdvancedFeatures['AdvancedUnionFeatures'] = '2';
|
||||
AdvancedFeatures['OptionalScalars'] = '4';
|
||||
AdvancedFeatures['DefaultVectorsAndStrings'] = '8';
|
||||
})(AdvancedFeatures || (AdvancedFeatures = {}));
|
||||
|
||||
@@ -9,5 +9,5 @@ export enum AdvancedFeatures {
|
||||
AdvancedArrayFeatures = '1',
|
||||
AdvancedUnionFeatures = '2',
|
||||
OptionalScalars = '4',
|
||||
DefaultVectorsAndStrings = '8'
|
||||
DefaultVectorsAndStrings = '8',
|
||||
}
|
||||
|
||||
40
tests/ts/reflection/base-type.d.ts
vendored
40
tests/ts/reflection/base-type.d.ts
vendored
@@ -1,22 +1,22 @@
|
||||
export declare enum BaseType {
|
||||
None = 0,
|
||||
UType = 1,
|
||||
Bool = 2,
|
||||
Byte = 3,
|
||||
UByte = 4,
|
||||
Short = 5,
|
||||
UShort = 6,
|
||||
Int = 7,
|
||||
UInt = 8,
|
||||
Long = 9,
|
||||
ULong = 10,
|
||||
Float = 11,
|
||||
Double = 12,
|
||||
String = 13,
|
||||
Vector = 14,
|
||||
Obj = 15,
|
||||
Union = 16,
|
||||
Array = 17,
|
||||
Vector64 = 18,
|
||||
MaxBaseType = 19
|
||||
None = 0,
|
||||
UType = 1,
|
||||
Bool = 2,
|
||||
Byte = 3,
|
||||
UByte = 4,
|
||||
Short = 5,
|
||||
UShort = 6,
|
||||
Int = 7,
|
||||
UInt = 8,
|
||||
Long = 9,
|
||||
ULong = 10,
|
||||
Float = 11,
|
||||
Double = 12,
|
||||
String = 13,
|
||||
Vector = 14,
|
||||
Obj = 15,
|
||||
Union = 16,
|
||||
Array = 17,
|
||||
Vector64 = 18,
|
||||
MaxBaseType = 19,
|
||||
}
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
// 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 */
|
||||
/* 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";
|
||||
BaseType[BaseType["UType"] = 1] = "UType";
|
||||
BaseType[BaseType["Bool"] = 2] = "Bool";
|
||||
BaseType[BaseType["Byte"] = 3] = "Byte";
|
||||
BaseType[BaseType["UByte"] = 4] = "UByte";
|
||||
BaseType[BaseType["Short"] = 5] = "Short";
|
||||
BaseType[BaseType["UShort"] = 6] = "UShort";
|
||||
BaseType[BaseType["Int"] = 7] = "Int";
|
||||
BaseType[BaseType["UInt"] = 8] = "UInt";
|
||||
BaseType[BaseType["Long"] = 9] = "Long";
|
||||
BaseType[BaseType["ULong"] = 10] = "ULong";
|
||||
BaseType[BaseType["Float"] = 11] = "Float";
|
||||
BaseType[BaseType["Double"] = 12] = "Double";
|
||||
BaseType[BaseType["String"] = 13] = "String";
|
||||
BaseType[BaseType["Vector"] = 14] = "Vector";
|
||||
BaseType[BaseType["Obj"] = 15] = "Obj";
|
||||
BaseType[BaseType["Union"] = 16] = "Union";
|
||||
BaseType[BaseType["Array"] = 17] = "Array";
|
||||
BaseType[BaseType["Vector64"] = 18] = "Vector64";
|
||||
BaseType[BaseType["MaxBaseType"] = 19] = "MaxBaseType";
|
||||
(function(BaseType) {
|
||||
BaseType[BaseType['None'] = 0] = 'None';
|
||||
BaseType[BaseType['UType'] = 1] = 'UType';
|
||||
BaseType[BaseType['Bool'] = 2] = 'Bool';
|
||||
BaseType[BaseType['Byte'] = 3] = 'Byte';
|
||||
BaseType[BaseType['UByte'] = 4] = 'UByte';
|
||||
BaseType[BaseType['Short'] = 5] = 'Short';
|
||||
BaseType[BaseType['UShort'] = 6] = 'UShort';
|
||||
BaseType[BaseType['Int'] = 7] = 'Int';
|
||||
BaseType[BaseType['UInt'] = 8] = 'UInt';
|
||||
BaseType[BaseType['Long'] = 9] = 'Long';
|
||||
BaseType[BaseType['ULong'] = 10] = 'ULong';
|
||||
BaseType[BaseType['Float'] = 11] = 'Float';
|
||||
BaseType[BaseType['Double'] = 12] = 'Double';
|
||||
BaseType[BaseType['String'] = 13] = 'String';
|
||||
BaseType[BaseType['Vector'] = 14] = 'Vector';
|
||||
BaseType[BaseType['Obj'] = 15] = 'Obj';
|
||||
BaseType[BaseType['Union'] = 16] = 'Union';
|
||||
BaseType[BaseType['Array'] = 17] = 'Array';
|
||||
BaseType[BaseType['Vector64'] = 18] = 'Vector64';
|
||||
BaseType[BaseType['MaxBaseType'] = 19] = 'MaxBaseType';
|
||||
})(BaseType || (BaseType = {}));
|
||||
|
||||
@@ -22,5 +22,5 @@ export enum BaseType {
|
||||
Union = 16,
|
||||
Array = 17,
|
||||
Vector64 = 18,
|
||||
MaxBaseType = 19
|
||||
MaxBaseType = 19,
|
||||
}
|
||||
|
||||
116
tests/ts/reflection/enum-val.d.ts
vendored
116
tests/ts/reflection/enum-val.d.ts
vendored
@@ -1,43 +1,81 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
import { Type, TypeT } from '../reflection/type.js';
|
||||
export declare class EnumVal implements flatbuffers.IUnpackableObject<EnumValT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): EnumVal;
|
||||
static getRootAsEnumVal(bb: flatbuffers.ByteBuffer, obj?: EnumVal): EnumVal;
|
||||
static getSizePrefixedRootAsEnumVal(bb: flatbuffers.ByteBuffer, obj?: EnumVal): EnumVal;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
value(): bigint;
|
||||
mutate_value(value: bigint): boolean;
|
||||
unionType(obj?: Type): Type | null;
|
||||
documentation(index: number): string;
|
||||
documentation(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startEnumVal(builder: flatbuffers.Builder): void;
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
|
||||
static addValue(builder: flatbuffers.Builder, value: bigint): void;
|
||||
static addUnionType(builder: flatbuffers.Builder, unionTypeOffset: flatbuffers.Offset): void;
|
||||
static addDocumentation(builder: flatbuffers.Builder, documentationOffset: flatbuffers.Offset): void;
|
||||
static createDocumentationVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startDocumentationVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addAttributes(builder: flatbuffers.Builder, attributesOffset: flatbuffers.Offset): void;
|
||||
static createAttributesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startAttributesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static endEnumVal(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
unpack(): EnumValT;
|
||||
unpackTo(_o: EnumValT): void;
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
import {Type, TypeT} from '../reflection/type.js';
|
||||
export declare class EnumVal
|
||||
implements flatbuffers.IUnpackableObject<EnumValT>
|
||||
{
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): EnumVal;
|
||||
static getRootAsEnumVal(bb: flatbuffers.ByteBuffer, obj?: EnumVal): EnumVal;
|
||||
static getSizePrefixedRootAsEnumVal(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: EnumVal,
|
||||
): EnumVal;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
value(): bigint;
|
||||
mutate_value(value: bigint): boolean;
|
||||
unionType(obj?: Type): Type | null;
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startEnumVal(builder: flatbuffers.Builder): void;
|
||||
static addName(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addValue(builder: flatbuffers.Builder, value: bigint): void;
|
||||
static addUnionType(
|
||||
builder: flatbuffers.Builder,
|
||||
unionTypeOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static endEnumVal(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
unpack(): EnumValT;
|
||||
unpackTo(_o: EnumValT): void;
|
||||
}
|
||||
export declare class EnumValT implements flatbuffers.IGeneratedObject {
|
||||
name: string | Uint8Array | null;
|
||||
value: bigint;
|
||||
unionType: TypeT | null;
|
||||
documentation: (string)[];
|
||||
attributes: (KeyValueT)[];
|
||||
constructor(name?: string | Uint8Array | null, value?: bigint, unionType?: TypeT | null, documentation?: (string)[], attributes?: (KeyValueT)[]);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
name: string | Uint8Array | null;
|
||||
value: bigint;
|
||||
unionType: TypeT | null;
|
||||
documentation: string[];
|
||||
attributes: KeyValueT[];
|
||||
constructor(
|
||||
name?: string | Uint8Array | null,
|
||||
value?: bigint,
|
||||
unionType?: TypeT | null,
|
||||
documentation?: string[],
|
||||
attributes?: KeyValueT[],
|
||||
);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,137 +1,169 @@
|
||||
// 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 */
|
||||
/* 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';
|
||||
|
||||
import {KeyValue} from '../reflection/key-value.js';
|
||||
import {Type} from '../reflection/type.js';
|
||||
|
||||
export class EnumVal {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsEnumVal(bb, obj) {
|
||||
return (obj || new EnumVal())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsEnumVal(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new EnumVal())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
value() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
mutate_value(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
this.bb.writeInt64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
unionType(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ?
|
||||
(obj || new Type())
|
||||
.__init(this.bb.__indirect(this.bb_pos + offset), this.bb) :
|
||||
null;
|
||||
}
|
||||
documentation(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__string(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ?
|
||||
(obj || new KeyValue())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.EnumVal';
|
||||
}
|
||||
static startEnumVal(builder) {
|
||||
builder.startObject(6);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addValue(builder, value) {
|
||||
builder.addFieldInt64(1, value, BigInt('0'));
|
||||
}
|
||||
static addUnionType(builder, unionTypeOffset) {
|
||||
builder.addFieldOffset(3, unionTypeOffset, 0);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(4, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
static getRootAsEnumVal(bb, obj) {
|
||||
return (obj || new EnumVal()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsEnumVal(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new EnumVal()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
value() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
mutate_value(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;
|
||||
}
|
||||
unionType(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? (obj || new Type()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
}
|
||||
documentation(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.EnumVal';
|
||||
}
|
||||
static startEnumVal(builder) {
|
||||
builder.startObject(6);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addValue(builder, value) {
|
||||
builder.addFieldInt64(1, value, BigInt('0'));
|
||||
}
|
||||
static addUnionType(builder, unionTypeOffset) {
|
||||
builder.addFieldOffset(3, unionTypeOffset, 0);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(4, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(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 startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(5, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(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 startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static endEnumVal(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
return offset;
|
||||
}
|
||||
unpack() {
|
||||
return new EnumValT(this.name(), this.value(), (this.unionType() !== null ? this.unionType().unpack() : null), this.bb.createScalarList(this.documentation.bind(this), this.documentationLength()), this.bb.createObjList(this.attributes.bind(this), this.attributesLength()));
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.value = this.value();
|
||||
_o.unionType = (this.unionType() !== null ? this.unionType().unpack() : null);
|
||||
_o.documentation = this.bb.createScalarList(this.documentation.bind(this), this.documentationLength());
|
||||
_o.attributes = this.bb.createObjList(this.attributes.bind(this), this.attributesLength());
|
||||
return builder.endVector();
|
||||
}
|
||||
static startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(5, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(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 startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static endEnumVal(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
return offset;
|
||||
}
|
||||
unpack() {
|
||||
return new EnumValT(
|
||||
this.name(), this.value(),
|
||||
(this.unionType() !== null ? this.unionType().unpack() : null),
|
||||
this.bb.createScalarList(
|
||||
this.documentation.bind(this), this.documentationLength()),
|
||||
this.bb.createObjList(
|
||||
this.attributes.bind(this), this.attributesLength()));
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.value = this.value();
|
||||
_o.unionType =
|
||||
(this.unionType() !== null ? this.unionType().unpack() : null);
|
||||
_o.documentation = this.bb.createScalarList(
|
||||
this.documentation.bind(this), this.documentationLength());
|
||||
_o.attributes = this.bb.createObjList(
|
||||
this.attributes.bind(this), this.attributesLength());
|
||||
}
|
||||
}
|
||||
export class EnumValT {
|
||||
constructor(name = null, value = BigInt('0'), unionType = null, documentation = [], attributes = []) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.unionType = unionType;
|
||||
this.documentation = documentation;
|
||||
this.attributes = attributes;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const unionType = (this.unionType !== null ? this.unionType.pack(builder) : 0);
|
||||
const documentation = EnumVal.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
const attributes = EnumVal.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
EnumVal.startEnumVal(builder);
|
||||
EnumVal.addName(builder, name);
|
||||
EnumVal.addValue(builder, this.value);
|
||||
EnumVal.addUnionType(builder, unionType);
|
||||
EnumVal.addDocumentation(builder, documentation);
|
||||
EnumVal.addAttributes(builder, attributes);
|
||||
return EnumVal.endEnumVal(builder);
|
||||
}
|
||||
constructor(
|
||||
name = null, value = BigInt('0'), unionType = null, documentation = [],
|
||||
attributes = []) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.unionType = unionType;
|
||||
this.documentation = documentation;
|
||||
this.attributes = attributes;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const unionType =
|
||||
(this.unionType !== null ? this.unionType.pack(builder) : 0);
|
||||
const documentation = EnumVal.createDocumentationVector(
|
||||
builder, builder.createObjectOffsetList(this.documentation));
|
||||
const attributes = EnumVal.createAttributesVector(
|
||||
builder, builder.createObjectOffsetList(this.attributes));
|
||||
EnumVal.startEnumVal(builder);
|
||||
EnumVal.addName(builder, name);
|
||||
EnumVal.addValue(builder, this.value);
|
||||
EnumVal.addUnionType(builder, unionType);
|
||||
EnumVal.addDocumentation(builder, documentation);
|
||||
EnumVal.addAttributes(builder, attributes);
|
||||
return EnumVal.endEnumVal(builder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,180 +4,248 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
import { Type, TypeT } from '../reflection/type.js';
|
||||
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
import {Type, TypeT} from '../reflection/type.js';
|
||||
|
||||
export class EnumVal implements flatbuffers.IUnpackableObject<EnumValT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):EnumVal {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsEnumVal(bb:flatbuffers.ByteBuffer, obj?:EnumVal):EnumVal {
|
||||
return (obj || new EnumVal()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsEnumVal(bb:flatbuffers.ByteBuffer, obj?:EnumVal):EnumVal {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new EnumVal()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
name():string|null
|
||||
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
name(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;
|
||||
}
|
||||
|
||||
value():bigint {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
|
||||
mutate_value(value:bigint):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): EnumVal {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
this.bb!.writeInt64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
unionType(obj?:Type):Type|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? (obj || new Type()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
||||
}
|
||||
|
||||
documentation(index: number):string
|
||||
documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
|
||||
documentation(index: number,optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
documentationLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
attributes(index: number, obj?:KeyValue):KeyValue|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
attributesLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.EnumVal';
|
||||
}
|
||||
|
||||
static startEnumVal(builder:flatbuffers.Builder) {
|
||||
builder.startObject(6);
|
||||
}
|
||||
|
||||
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addValue(builder:flatbuffers.Builder, value:bigint) {
|
||||
builder.addFieldInt64(1, value, BigInt('0'));
|
||||
}
|
||||
|
||||
static addUnionType(builder:flatbuffers.Builder, unionTypeOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(3, unionTypeOffset, 0);
|
||||
}
|
||||
|
||||
static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(4, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(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]!);
|
||||
static getRootAsEnumVal(bb: flatbuffers.ByteBuffer, obj?: EnumVal): EnumVal {
|
||||
return (obj || new EnumVal()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(5, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(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]!);
|
||||
static getSizePrefixedRootAsEnumVal(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: EnumVal,
|
||||
): EnumVal {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new EnumVal()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startAttributesVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
name(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;
|
||||
}
|
||||
|
||||
static endEnumVal(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // name
|
||||
return offset;
|
||||
}
|
||||
value(): bigint {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
|
||||
mutate_value(value: bigint): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
|
||||
unpack(): EnumValT {
|
||||
return new EnumValT(
|
||||
this.name(),
|
||||
this.value(),
|
||||
(this.unionType() !== null ? this.unionType()!.unpack() : null),
|
||||
this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength())
|
||||
);
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
unpackTo(_o: EnumValT): void {
|
||||
_o.name = this.name();
|
||||
_o.value = this.value();
|
||||
_o.unionType = (this.unionType() !== null ? this.unionType()!.unpack() : null);
|
||||
_o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
|
||||
}
|
||||
unionType(obj?: Type): Type | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset
|
||||
? (obj || new Type()).__init(
|
||||
this.bb!.__indirect(this.bb_pos + offset),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding?: any,
|
||||
): string | Uint8Array | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset
|
||||
? this.bb!.__string(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
documentationLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset
|
||||
? (obj || new KeyValue()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
attributesLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName(): string {
|
||||
return 'reflection.EnumVal';
|
||||
}
|
||||
|
||||
static startEnumVal(builder: flatbuffers.Builder) {
|
||||
builder.startObject(6);
|
||||
}
|
||||
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addValue(builder: flatbuffers.Builder, value: bigint) {
|
||||
builder.addFieldInt64(1, value, BigInt('0'));
|
||||
}
|
||||
|
||||
static addUnionType(
|
||||
builder: flatbuffers.Builder,
|
||||
unionTypeOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(3, unionTypeOffset, 0);
|
||||
}
|
||||
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(4, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(
|
||||
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 startDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(5, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(
|
||||
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 startAttributesVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static endEnumVal(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
return offset;
|
||||
}
|
||||
|
||||
unpack(): EnumValT {
|
||||
return new EnumValT(
|
||||
this.name(),
|
||||
this.value(),
|
||||
this.unionType() !== null ? this.unionType()!.unpack() : null,
|
||||
this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
),
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
unpackTo(_o: EnumValT): void {
|
||||
_o.name = this.name();
|
||||
_o.value = this.value();
|
||||
_o.unionType =
|
||||
this.unionType() !== null ? this.unionType()!.unpack() : null;
|
||||
_o.documentation = this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
);
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class EnumValT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public name: string|Uint8Array|null = null,
|
||||
public value: bigint = BigInt('0'),
|
||||
public unionType: TypeT|null = null,
|
||||
public documentation: (string)[] = [],
|
||||
public attributes: (KeyValueT)[] = []
|
||||
){}
|
||||
constructor(
|
||||
public name: string | Uint8Array | null = null,
|
||||
public value: bigint = BigInt('0'),
|
||||
public unionType: TypeT | null = null,
|
||||
public documentation: string[] = [],
|
||||
public attributes: KeyValueT[] = [],
|
||||
) {}
|
||||
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = this.name !== null ? builder.createString(this.name!) : 0;
|
||||
const unionType =
|
||||
this.unionType !== null ? this.unionType!.pack(builder) : 0;
|
||||
const documentation = EnumVal.createDocumentationVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.documentation),
|
||||
);
|
||||
const attributes = EnumVal.createAttributesVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.attributes),
|
||||
);
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = (this.name !== null ? builder.createString(this.name!) : 0);
|
||||
const unionType = (this.unionType !== null ? this.unionType!.pack(builder) : 0);
|
||||
const documentation = EnumVal.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
const attributes = EnumVal.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
EnumVal.startEnumVal(builder);
|
||||
EnumVal.addName(builder, name);
|
||||
EnumVal.addValue(builder, this.value);
|
||||
EnumVal.addUnionType(builder, unionType);
|
||||
EnumVal.addDocumentation(builder, documentation);
|
||||
EnumVal.addAttributes(builder, attributes);
|
||||
|
||||
EnumVal.startEnumVal(builder);
|
||||
EnumVal.addName(builder, name);
|
||||
EnumVal.addValue(builder, this.value);
|
||||
EnumVal.addUnionType(builder, unionType);
|
||||
EnumVal.addDocumentation(builder, documentation);
|
||||
EnumVal.addAttributes(builder, attributes);
|
||||
|
||||
return EnumVal.endEnumVal(builder);
|
||||
}
|
||||
return EnumVal.endEnumVal(builder);
|
||||
}
|
||||
}
|
||||
|
||||
156
tests/ts/reflection/enum.d.ts
vendored
156
tests/ts/reflection/enum.d.ts
vendored
@@ -1,57 +1,109 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { EnumVal, EnumValT } from '../reflection/enum-val.js';
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
import { Type, TypeT } from '../reflection/type.js';
|
||||
import {EnumVal, EnumValT} from '../reflection/enum-val.js';
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
import {Type, TypeT} from '../reflection/type.js';
|
||||
export declare class Enum implements flatbuffers.IUnpackableObject<EnumT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Enum;
|
||||
static getRootAsEnum(bb: flatbuffers.ByteBuffer, obj?: Enum): Enum;
|
||||
static getSizePrefixedRootAsEnum(bb: flatbuffers.ByteBuffer, obj?: Enum): Enum;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
values(index: number, obj?: EnumVal): EnumVal | null;
|
||||
valuesLength(): number;
|
||||
isUnion(): boolean;
|
||||
mutate_is_union(value: boolean): boolean;
|
||||
underlyingType(obj?: Type): Type | null;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
documentation(index: number): string;
|
||||
documentation(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
/**
|
||||
* File that this Enum is declared in.
|
||||
*/
|
||||
declarationFile(): string | null;
|
||||
declarationFile(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startEnum(builder: flatbuffers.Builder): void;
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
|
||||
static addValues(builder: flatbuffers.Builder, valuesOffset: flatbuffers.Offset): void;
|
||||
static createValuesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startValuesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addIsUnion(builder: flatbuffers.Builder, isUnion: boolean): void;
|
||||
static addUnderlyingType(builder: flatbuffers.Builder, underlyingTypeOffset: flatbuffers.Offset): void;
|
||||
static addAttributes(builder: flatbuffers.Builder, attributesOffset: flatbuffers.Offset): void;
|
||||
static createAttributesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startAttributesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addDocumentation(builder: flatbuffers.Builder, documentationOffset: flatbuffers.Offset): void;
|
||||
static createDocumentationVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startDocumentationVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addDeclarationFile(builder: flatbuffers.Builder, declarationFileOffset: flatbuffers.Offset): void;
|
||||
static endEnum(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
unpack(): EnumT;
|
||||
unpackTo(_o: EnumT): void;
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Enum;
|
||||
static getRootAsEnum(bb: flatbuffers.ByteBuffer, obj?: Enum): Enum;
|
||||
static getSizePrefixedRootAsEnum(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Enum,
|
||||
): Enum;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
values(index: number, obj?: EnumVal): EnumVal | null;
|
||||
valuesLength(): number;
|
||||
isUnion(): boolean;
|
||||
mutate_is_union(value: boolean): boolean;
|
||||
underlyingType(obj?: Type): Type | null;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
/**
|
||||
* File that this Enum is declared in.
|
||||
*/
|
||||
declarationFile(): string | null;
|
||||
declarationFile(
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array | null;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startEnum(builder: flatbuffers.Builder): void;
|
||||
static addName(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addValues(
|
||||
builder: flatbuffers.Builder,
|
||||
valuesOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createValuesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startValuesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addIsUnion(builder: flatbuffers.Builder, isUnion: boolean): void;
|
||||
static addUnderlyingType(
|
||||
builder: flatbuffers.Builder,
|
||||
underlyingTypeOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addDeclarationFile(
|
||||
builder: flatbuffers.Builder,
|
||||
declarationFileOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static endEnum(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
unpack(): EnumT;
|
||||
unpackTo(_o: EnumT): void;
|
||||
}
|
||||
export declare class EnumT implements flatbuffers.IGeneratedObject {
|
||||
name: string | Uint8Array | null;
|
||||
values: (EnumValT)[];
|
||||
isUnion: boolean;
|
||||
underlyingType: TypeT | null;
|
||||
attributes: (KeyValueT)[];
|
||||
documentation: (string)[];
|
||||
declarationFile: string | Uint8Array | null;
|
||||
constructor(name?: string | Uint8Array | null, values?: (EnumValT)[], isUnion?: boolean, underlyingType?: TypeT | null, attributes?: (KeyValueT)[], documentation?: (string)[], declarationFile?: string | Uint8Array | null);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
name: string | Uint8Array | null;
|
||||
values: EnumValT[];
|
||||
isUnion: boolean;
|
||||
underlyingType: TypeT | null;
|
||||
attributes: KeyValueT[];
|
||||
documentation: string[];
|
||||
declarationFile: string | Uint8Array | null;
|
||||
constructor(
|
||||
name?: string | Uint8Array | null,
|
||||
values?: EnumValT[],
|
||||
isUnion?: boolean,
|
||||
underlyingType?: TypeT | null,
|
||||
attributes?: KeyValueT[],
|
||||
documentation?: string[],
|
||||
declarationFile?: string | Uint8Array | null,
|
||||
);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,176 +1,225 @@
|
||||
// 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 */
|
||||
/* 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';
|
||||
import { Type } from '../reflection/type.js';
|
||||
|
||||
import {EnumVal} from '../reflection/enum-val.js';
|
||||
import {KeyValue} from '../reflection/key-value.js';
|
||||
import {Type} from '../reflection/type.js';
|
||||
|
||||
export class Enum {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsEnum(bb, obj) {
|
||||
return (obj || new Enum())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsEnum(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Enum())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
values(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ?
|
||||
(obj || new EnumVal())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
valuesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
isUnion() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_is_union(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
underlyingType(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ?
|
||||
(obj || new Type())
|
||||
.__init(this.bb.__indirect(this.bb_pos + offset), this.bb) :
|
||||
null;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ?
|
||||
(obj || new KeyValue())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
documentation(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__string(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
declarationFile(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Enum';
|
||||
}
|
||||
static startEnum(builder) {
|
||||
builder.startObject(7);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addValues(builder, valuesOffset) {
|
||||
builder.addFieldOffset(1, valuesOffset, 0);
|
||||
}
|
||||
static createValuesVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
static getRootAsEnum(bb, obj) {
|
||||
return (obj || new Enum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return builder.endVector();
|
||||
}
|
||||
static startValuesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addIsUnion(builder, isUnion) {
|
||||
builder.addFieldInt8(2, +isUnion, +false);
|
||||
}
|
||||
static addUnderlyingType(builder, underlyingTypeOffset) {
|
||||
builder.addFieldOffset(3, underlyingTypeOffset, 0);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(4, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
static getSizePrefixedRootAsEnum(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Enum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
values(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new EnumVal()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
valuesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
isUnion() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_is_union(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
underlyingType(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? (obj || new Type()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
documentation(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
declarationFile(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Enum';
|
||||
}
|
||||
static startEnum(builder) {
|
||||
builder.startObject(7);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addValues(builder, valuesOffset) {
|
||||
builder.addFieldOffset(1, valuesOffset, 0);
|
||||
}
|
||||
static createValuesVector(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 startValuesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addIsUnion(builder, isUnion) {
|
||||
builder.addFieldInt8(2, +isUnion, +false);
|
||||
}
|
||||
static addUnderlyingType(builder, underlyingTypeOffset) {
|
||||
builder.addFieldOffset(3, underlyingTypeOffset, 0);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(4, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(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 startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(5, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(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 startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDeclarationFile(builder, declarationFileOffset) {
|
||||
builder.addFieldOffset(6, declarationFileOffset, 0);
|
||||
}
|
||||
static endEnum(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
builder.requiredField(offset, 6); // values
|
||||
builder.requiredField(offset, 10); // underlying_type
|
||||
return offset;
|
||||
}
|
||||
unpack() {
|
||||
return new EnumT(this.name(), this.bb.createObjList(this.values.bind(this), this.valuesLength()), this.isUnion(), (this.underlyingType() !== null ? this.underlyingType().unpack() : null), this.bb.createObjList(this.attributes.bind(this), this.attributesLength()), this.bb.createScalarList(this.documentation.bind(this), this.documentationLength()), this.declarationFile());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.values = this.bb.createObjList(this.values.bind(this), this.valuesLength());
|
||||
_o.isUnion = this.isUnion();
|
||||
_o.underlyingType = (this.underlyingType() !== null ? this.underlyingType().unpack() : null);
|
||||
_o.attributes = this.bb.createObjList(this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb.createScalarList(this.documentation.bind(this), this.documentationLength());
|
||||
_o.declarationFile = this.declarationFile();
|
||||
return builder.endVector();
|
||||
}
|
||||
static startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(5, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(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 startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDeclarationFile(builder, declarationFileOffset) {
|
||||
builder.addFieldOffset(6, declarationFileOffset, 0);
|
||||
}
|
||||
static endEnum(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
builder.requiredField(offset, 6); // values
|
||||
builder.requiredField(offset, 10); // underlying_type
|
||||
return offset;
|
||||
}
|
||||
unpack() {
|
||||
return new EnumT(
|
||||
this.name(),
|
||||
this.bb.createObjList(this.values.bind(this), this.valuesLength()),
|
||||
this.isUnion(),
|
||||
(this.underlyingType() !== null ? this.underlyingType().unpack() :
|
||||
null),
|
||||
this.bb.createObjList(
|
||||
this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb.createScalarList(
|
||||
this.documentation.bind(this), this.documentationLength()),
|
||||
this.declarationFile());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.values =
|
||||
this.bb.createObjList(this.values.bind(this), this.valuesLength());
|
||||
_o.isUnion = this.isUnion();
|
||||
_o.underlyingType =
|
||||
(this.underlyingType() !== null ? this.underlyingType().unpack() :
|
||||
null);
|
||||
_o.attributes = this.bb.createObjList(
|
||||
this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb.createScalarList(
|
||||
this.documentation.bind(this), this.documentationLength());
|
||||
_o.declarationFile = this.declarationFile();
|
||||
}
|
||||
}
|
||||
export class EnumT {
|
||||
constructor(name = null, values = [], isUnion = false, underlyingType = null, attributes = [], documentation = [], declarationFile = null) {
|
||||
this.name = name;
|
||||
this.values = values;
|
||||
this.isUnion = isUnion;
|
||||
this.underlyingType = underlyingType;
|
||||
this.attributes = attributes;
|
||||
this.documentation = documentation;
|
||||
this.declarationFile = declarationFile;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const values = Enum.createValuesVector(builder, builder.createObjectOffsetList(this.values));
|
||||
const underlyingType = (this.underlyingType !== null ? this.underlyingType.pack(builder) : 0);
|
||||
const attributes = Enum.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Enum.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
const declarationFile = (this.declarationFile !== null ? builder.createString(this.declarationFile) : 0);
|
||||
Enum.startEnum(builder);
|
||||
Enum.addName(builder, name);
|
||||
Enum.addValues(builder, values);
|
||||
Enum.addIsUnion(builder, this.isUnion);
|
||||
Enum.addUnderlyingType(builder, underlyingType);
|
||||
Enum.addAttributes(builder, attributes);
|
||||
Enum.addDocumentation(builder, documentation);
|
||||
Enum.addDeclarationFile(builder, declarationFile);
|
||||
return Enum.endEnum(builder);
|
||||
}
|
||||
constructor(
|
||||
name = null, values = [], isUnion = false, underlyingType = null,
|
||||
attributes = [], documentation = [], declarationFile = null) {
|
||||
this.name = name;
|
||||
this.values = values;
|
||||
this.isUnion = isUnion;
|
||||
this.underlyingType = underlyingType;
|
||||
this.attributes = attributes;
|
||||
this.documentation = documentation;
|
||||
this.declarationFile = declarationFile;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const values = Enum.createValuesVector(
|
||||
builder, builder.createObjectOffsetList(this.values));
|
||||
const underlyingType =
|
||||
(this.underlyingType !== null ? this.underlyingType.pack(builder) : 0);
|
||||
const attributes = Enum.createAttributesVector(
|
||||
builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Enum.createDocumentationVector(
|
||||
builder, builder.createObjectOffsetList(this.documentation));
|
||||
const declarationFile =
|
||||
(this.declarationFile !== null ?
|
||||
builder.createString(this.declarationFile) :
|
||||
0);
|
||||
Enum.startEnum(builder);
|
||||
Enum.addName(builder, name);
|
||||
Enum.addValues(builder, values);
|
||||
Enum.addIsUnion(builder, this.isUnion);
|
||||
Enum.addUnderlyingType(builder, underlyingType);
|
||||
Enum.addAttributes(builder, attributes);
|
||||
Enum.addDocumentation(builder, documentation);
|
||||
Enum.addDeclarationFile(builder, declarationFile);
|
||||
return Enum.endEnum(builder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,233 +4,333 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { EnumVal, EnumValT } from '../reflection/enum-val.js';
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
import { Type, TypeT } from '../reflection/type.js';
|
||||
|
||||
import {EnumVal, EnumValT} from '../reflection/enum-val.js';
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
import {Type, TypeT} from '../reflection/type.js';
|
||||
|
||||
export class Enum implements flatbuffers.IUnpackableObject<EnumT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Enum {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsEnum(bb:flatbuffers.ByteBuffer, obj?:Enum):Enum {
|
||||
return (obj || new Enum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsEnum(bb:flatbuffers.ByteBuffer, obj?:Enum):Enum {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Enum()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
name():string|null
|
||||
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
name(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;
|
||||
}
|
||||
|
||||
values(index: number, obj?:EnumVal):EnumVal|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new EnumVal()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
valuesLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
isUnion():boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
mutate_is_union(value:boolean):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Enum {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
underlyingType(obj?:Type):Type|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? (obj || new Type()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
||||
}
|
||||
|
||||
attributes(index: number, obj?:KeyValue):KeyValue|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
attributesLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
documentation(index: number):string
|
||||
documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
|
||||
documentation(index: number,optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
documentationLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* File that this Enum is declared in.
|
||||
*/
|
||||
declarationFile():string|null
|
||||
declarationFile(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
declarationFile(optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.Enum';
|
||||
}
|
||||
|
||||
static startEnum(builder:flatbuffers.Builder) {
|
||||
builder.startObject(7);
|
||||
}
|
||||
|
||||
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addValues(builder:flatbuffers.Builder, valuesOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(1, valuesOffset, 0);
|
||||
}
|
||||
|
||||
static createValuesVector(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]!);
|
||||
static getRootAsEnum(bb: flatbuffers.ByteBuffer, obj?: Enum): Enum {
|
||||
return (obj || new Enum()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startValuesVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addIsUnion(builder:flatbuffers.Builder, isUnion:boolean) {
|
||||
builder.addFieldInt8(2, +isUnion, +false);
|
||||
}
|
||||
|
||||
static addUnderlyingType(builder:flatbuffers.Builder, underlyingTypeOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(3, underlyingTypeOffset, 0);
|
||||
}
|
||||
|
||||
static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(4, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(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]!);
|
||||
static getSizePrefixedRootAsEnum(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Enum,
|
||||
): Enum {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Enum()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startAttributesVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(5, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(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]!);
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
name(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;
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
values(index: number, obj?: EnumVal): EnumVal | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset
|
||||
? (obj || new EnumVal()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
static addDeclarationFile(builder:flatbuffers.Builder, declarationFileOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(6, declarationFileOffset, 0);
|
||||
}
|
||||
valuesLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static endEnum(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // name
|
||||
builder.requiredField(offset, 6) // values
|
||||
builder.requiredField(offset, 10) // underlying_type
|
||||
return offset;
|
||||
}
|
||||
isUnion(): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
mutate_is_union(value: boolean): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
|
||||
unpack(): EnumT {
|
||||
return new EnumT(
|
||||
this.name(),
|
||||
this.bb!.createObjList<EnumVal, EnumValT>(this.values.bind(this), this.valuesLength()),
|
||||
this.isUnion(),
|
||||
(this.underlyingType() !== null ? this.underlyingType()!.unpack() : null),
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
|
||||
this.declarationFile()
|
||||
);
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
unpackTo(_o: EnumT): void {
|
||||
_o.name = this.name();
|
||||
_o.values = this.bb!.createObjList<EnumVal, EnumValT>(this.values.bind(this), this.valuesLength());
|
||||
_o.isUnion = this.isUnion();
|
||||
_o.underlyingType = (this.underlyingType() !== null ? this.underlyingType()!.unpack() : null);
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
|
||||
_o.declarationFile = this.declarationFile();
|
||||
}
|
||||
underlyingType(obj?: Type): Type | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset
|
||||
? (obj || new Type()).__init(
|
||||
this.bb!.__indirect(this.bb_pos + offset),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset
|
||||
? (obj || new KeyValue()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
attributesLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding?: any,
|
||||
): string | Uint8Array | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset
|
||||
? this.bb!.__string(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
documentationLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* File that this Enum is declared in.
|
||||
*/
|
||||
declarationFile(): string | null;
|
||||
declarationFile(
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array | null;
|
||||
declarationFile(optionalEncoding?: any): string | Uint8Array | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset
|
||||
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
||||
: null;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName(): string {
|
||||
return 'reflection.Enum';
|
||||
}
|
||||
|
||||
static startEnum(builder: flatbuffers.Builder) {
|
||||
builder.startObject(7);
|
||||
}
|
||||
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addValues(
|
||||
builder: flatbuffers.Builder,
|
||||
valuesOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(1, valuesOffset, 0);
|
||||
}
|
||||
|
||||
static createValuesVector(
|
||||
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 startValuesVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addIsUnion(builder: flatbuffers.Builder, isUnion: boolean) {
|
||||
builder.addFieldInt8(2, +isUnion, +false);
|
||||
}
|
||||
|
||||
static addUnderlyingType(
|
||||
builder: flatbuffers.Builder,
|
||||
underlyingTypeOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(3, underlyingTypeOffset, 0);
|
||||
}
|
||||
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(4, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(
|
||||
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 startAttributesVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(5, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(
|
||||
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 startDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDeclarationFile(
|
||||
builder: flatbuffers.Builder,
|
||||
declarationFileOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(6, declarationFileOffset, 0);
|
||||
}
|
||||
|
||||
static endEnum(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
builder.requiredField(offset, 6); // values
|
||||
builder.requiredField(offset, 10); // underlying_type
|
||||
return offset;
|
||||
}
|
||||
|
||||
unpack(): EnumT {
|
||||
return new EnumT(
|
||||
this.name(),
|
||||
this.bb!.createObjList<EnumVal, EnumValT>(
|
||||
this.values.bind(this),
|
||||
this.valuesLength(),
|
||||
),
|
||||
this.isUnion(),
|
||||
this.underlyingType() !== null ? this.underlyingType()!.unpack() : null,
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
),
|
||||
this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
),
|
||||
this.declarationFile(),
|
||||
);
|
||||
}
|
||||
|
||||
unpackTo(_o: EnumT): void {
|
||||
_o.name = this.name();
|
||||
_o.values = this.bb!.createObjList<EnumVal, EnumValT>(
|
||||
this.values.bind(this),
|
||||
this.valuesLength(),
|
||||
);
|
||||
_o.isUnion = this.isUnion();
|
||||
_o.underlyingType =
|
||||
this.underlyingType() !== null ? this.underlyingType()!.unpack() : null;
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
);
|
||||
_o.documentation = this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
);
|
||||
_o.declarationFile = this.declarationFile();
|
||||
}
|
||||
}
|
||||
|
||||
export class EnumT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public name: string|Uint8Array|null = null,
|
||||
public values: (EnumValT)[] = [],
|
||||
public isUnion: boolean = false,
|
||||
public underlyingType: TypeT|null = null,
|
||||
public attributes: (KeyValueT)[] = [],
|
||||
public documentation: (string)[] = [],
|
||||
public declarationFile: string|Uint8Array|null = null
|
||||
){}
|
||||
constructor(
|
||||
public name: string | Uint8Array | null = null,
|
||||
public values: EnumValT[] = [],
|
||||
public isUnion: boolean = false,
|
||||
public underlyingType: TypeT | null = null,
|
||||
public attributes: KeyValueT[] = [],
|
||||
public documentation: string[] = [],
|
||||
public declarationFile: string | Uint8Array | null = null,
|
||||
) {}
|
||||
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = this.name !== null ? builder.createString(this.name!) : 0;
|
||||
const values = Enum.createValuesVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.values),
|
||||
);
|
||||
const underlyingType =
|
||||
this.underlyingType !== null ? this.underlyingType!.pack(builder) : 0;
|
||||
const attributes = Enum.createAttributesVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.attributes),
|
||||
);
|
||||
const documentation = Enum.createDocumentationVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.documentation),
|
||||
);
|
||||
const declarationFile =
|
||||
this.declarationFile !== null
|
||||
? builder.createString(this.declarationFile!)
|
||||
: 0;
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = (this.name !== null ? builder.createString(this.name!) : 0);
|
||||
const values = Enum.createValuesVector(builder, builder.createObjectOffsetList(this.values));
|
||||
const underlyingType = (this.underlyingType !== null ? this.underlyingType!.pack(builder) : 0);
|
||||
const attributes = Enum.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Enum.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
const declarationFile = (this.declarationFile !== null ? builder.createString(this.declarationFile!) : 0);
|
||||
Enum.startEnum(builder);
|
||||
Enum.addName(builder, name);
|
||||
Enum.addValues(builder, values);
|
||||
Enum.addIsUnion(builder, this.isUnion);
|
||||
Enum.addUnderlyingType(builder, underlyingType);
|
||||
Enum.addAttributes(builder, attributes);
|
||||
Enum.addDocumentation(builder, documentation);
|
||||
Enum.addDeclarationFile(builder, declarationFile);
|
||||
|
||||
Enum.startEnum(builder);
|
||||
Enum.addName(builder, name);
|
||||
Enum.addValues(builder, values);
|
||||
Enum.addIsUnion(builder, this.isUnion);
|
||||
Enum.addUnderlyingType(builder, underlyingType);
|
||||
Enum.addAttributes(builder, attributes);
|
||||
Enum.addDocumentation(builder, documentation);
|
||||
Enum.addDeclarationFile(builder, declarationFile);
|
||||
|
||||
return Enum.endEnum(builder);
|
||||
}
|
||||
return Enum.endEnum(builder);
|
||||
}
|
||||
}
|
||||
|
||||
211
tests/ts/reflection/field.d.ts
vendored
211
tests/ts/reflection/field.d.ts
vendored
@@ -1,85 +1,136 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
import { Type, TypeT } from '../reflection/type.js';
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
import {Type, TypeT} from '../reflection/type.js';
|
||||
export declare class Field implements flatbuffers.IUnpackableObject<FieldT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Field;
|
||||
static getRootAsField(bb: flatbuffers.ByteBuffer, obj?: Field): Field;
|
||||
static getSizePrefixedRootAsField(bb: flatbuffers.ByteBuffer, obj?: Field): Field;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
type(obj?: Type): Type | null;
|
||||
id(): number;
|
||||
mutate_id(value: number): boolean;
|
||||
offset(): number;
|
||||
mutate_offset(value: number): boolean;
|
||||
defaultInteger(): bigint;
|
||||
mutate_default_integer(value: bigint): boolean;
|
||||
defaultReal(): number;
|
||||
mutate_default_real(value: number): boolean;
|
||||
deprecated(): boolean;
|
||||
mutate_deprecated(value: boolean): boolean;
|
||||
required(): boolean;
|
||||
mutate_required(value: boolean): boolean;
|
||||
key(): boolean;
|
||||
mutate_key(value: boolean): boolean;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
documentation(index: number): string;
|
||||
documentation(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
optional(): boolean;
|
||||
mutate_optional(value: boolean): boolean;
|
||||
/**
|
||||
* Number of padding octets to always add after this field. Structs only.
|
||||
*/
|
||||
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;
|
||||
static addType(builder: flatbuffers.Builder, typeOffset: flatbuffers.Offset): void;
|
||||
static addId(builder: flatbuffers.Builder, id: number): void;
|
||||
static addOffset(builder: flatbuffers.Builder, offset: number): void;
|
||||
static addDefaultInteger(builder: flatbuffers.Builder, defaultInteger: bigint): void;
|
||||
static addDefaultReal(builder: flatbuffers.Builder, defaultReal: number): void;
|
||||
static addDeprecated(builder: flatbuffers.Builder, deprecated: boolean): void;
|
||||
static addRequired(builder: flatbuffers.Builder, required: boolean): void;
|
||||
static addKey(builder: flatbuffers.Builder, key: boolean): void;
|
||||
static addAttributes(builder: flatbuffers.Builder, attributesOffset: flatbuffers.Offset): void;
|
||||
static createAttributesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startAttributesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addDocumentation(builder: flatbuffers.Builder, documentationOffset: flatbuffers.Offset): void;
|
||||
static createDocumentationVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
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;
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Field;
|
||||
static getRootAsField(bb: flatbuffers.ByteBuffer, obj?: Field): Field;
|
||||
static getSizePrefixedRootAsField(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Field,
|
||||
): Field;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
type(obj?: Type): Type | null;
|
||||
id(): number;
|
||||
mutate_id(value: number): boolean;
|
||||
offset(): number;
|
||||
mutate_offset(value: number): boolean;
|
||||
defaultInteger(): bigint;
|
||||
mutate_default_integer(value: bigint): boolean;
|
||||
defaultReal(): number;
|
||||
mutate_default_real(value: number): boolean;
|
||||
deprecated(): boolean;
|
||||
mutate_deprecated(value: boolean): boolean;
|
||||
required(): boolean;
|
||||
mutate_required(value: boolean): boolean;
|
||||
key(): boolean;
|
||||
mutate_key(value: boolean): boolean;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
optional(): boolean;
|
||||
mutate_optional(value: boolean): boolean;
|
||||
/**
|
||||
* Number of padding octets to always add after this field. Structs only.
|
||||
*/
|
||||
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;
|
||||
static addType(
|
||||
builder: flatbuffers.Builder,
|
||||
typeOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addId(builder: flatbuffers.Builder, id: number): void;
|
||||
static addOffset(builder: flatbuffers.Builder, offset: number): void;
|
||||
static addDefaultInteger(
|
||||
builder: flatbuffers.Builder,
|
||||
defaultInteger: bigint,
|
||||
): void;
|
||||
static addDefaultReal(
|
||||
builder: flatbuffers.Builder,
|
||||
defaultReal: number,
|
||||
): void;
|
||||
static addDeprecated(builder: flatbuffers.Builder, deprecated: boolean): void;
|
||||
static addRequired(builder: flatbuffers.Builder, required: boolean): void;
|
||||
static addKey(builder: flatbuffers.Builder, key: boolean): void;
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
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;
|
||||
}
|
||||
export declare class FieldT implements flatbuffers.IGeneratedObject {
|
||||
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;
|
||||
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,306 +1,340 @@
|
||||
// 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 */
|
||||
/* 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';
|
||||
|
||||
import {KeyValue} from '../reflection/key-value.js';
|
||||
import {Type} from '../reflection/type.js';
|
||||
|
||||
export class Field {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsField(bb, obj) {
|
||||
return (obj || new Field())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsField(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Field())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
type(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ?
|
||||
(obj || new Type())
|
||||
.__init(this.bb.__indirect(this.bb_pos + offset), this.bb) :
|
||||
null;
|
||||
}
|
||||
id() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_id(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
this.bb.writeUint16(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
offset() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_offset(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
static getRootAsField(bb, obj) {
|
||||
return (obj || new Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
this.bb.writeUint16(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
defaultInteger() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
mutate_default_integer(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
static getSizePrefixedRootAsField(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
this.bb.writeInt64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
defaultReal() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
|
||||
}
|
||||
mutate_default_real(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
this.bb.writeFloat64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
deprecated() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_deprecated(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
type(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new Type()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
required() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 18);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_required(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 18);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
id() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
key() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 20);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_key(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 20);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
mutate_id(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;
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 22);
|
||||
return offset ?
|
||||
(obj || new KeyValue())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 22);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
documentation(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;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 24);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
optional() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 26);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_optional(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 26);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
offset() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
||||
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;
|
||||
}
|
||||
mutate_padding(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 28);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
mutate_offset(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;
|
||||
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;
|
||||
}
|
||||
defaultInteger() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Field';
|
||||
}
|
||||
static startField(builder) {
|
||||
builder.startObject(14);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addType(builder, typeOffset) {
|
||||
builder.addFieldOffset(1, typeOffset, 0);
|
||||
}
|
||||
static addId(builder, id) {
|
||||
builder.addFieldInt16(2, id, 0);
|
||||
}
|
||||
static addOffset(builder, offset) {
|
||||
builder.addFieldInt16(3, offset, 0);
|
||||
}
|
||||
static addDefaultInteger(builder, defaultInteger) {
|
||||
builder.addFieldInt64(4, defaultInteger, BigInt('0'));
|
||||
}
|
||||
static addDefaultReal(builder, defaultReal) {
|
||||
builder.addFieldFloat64(5, defaultReal, 0.0);
|
||||
}
|
||||
static addDeprecated(builder, deprecated) {
|
||||
builder.addFieldInt8(6, +deprecated, +false);
|
||||
}
|
||||
static addRequired(builder, required) {
|
||||
builder.addFieldInt8(7, +required, +false);
|
||||
}
|
||||
static addKey(builder, key) {
|
||||
builder.addFieldInt8(8, +key, +false);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(9, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
mutate_default_integer(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
defaultReal() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
|
||||
}
|
||||
mutate_default_real(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeFloat64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
deprecated() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_deprecated(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
required() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 18);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_required(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 18);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
key() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 20);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_key(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 20);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 22);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 22);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
documentation(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;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 24);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
optional() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 26);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_optional(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 26);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
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;
|
||||
}
|
||||
mutate_padding(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 28);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
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(14);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addType(builder, typeOffset) {
|
||||
builder.addFieldOffset(1, typeOffset, 0);
|
||||
}
|
||||
static addId(builder, id) {
|
||||
builder.addFieldInt16(2, id, 0);
|
||||
}
|
||||
static addOffset(builder, offset) {
|
||||
builder.addFieldInt16(3, offset, 0);
|
||||
}
|
||||
static addDefaultInteger(builder, defaultInteger) {
|
||||
builder.addFieldInt64(4, defaultInteger, BigInt('0'));
|
||||
}
|
||||
static addDefaultReal(builder, defaultReal) {
|
||||
builder.addFieldFloat64(5, defaultReal, 0.0);
|
||||
}
|
||||
static addDeprecated(builder, deprecated) {
|
||||
builder.addFieldInt8(6, +deprecated, +false);
|
||||
}
|
||||
static addRequired(builder, required) {
|
||||
builder.addFieldInt8(7, +required, +false);
|
||||
}
|
||||
static addKey(builder, key) {
|
||||
builder.addFieldInt8(8, +key, +false);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(9, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(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 startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(10, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(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 startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addOptional(builder, optional) {
|
||||
builder.addFieldInt8(11, +optional, +false);
|
||||
}
|
||||
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
|
||||
builder.requiredField(offset, 6); // type
|
||||
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(), this.offset64());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.type = (this.type() !== null ? this.type().unpack() : null);
|
||||
_o.id = this.id();
|
||||
_o.offset = this.offset();
|
||||
_o.defaultInteger = this.defaultInteger();
|
||||
_o.defaultReal = this.defaultReal();
|
||||
_o.deprecated = this.deprecated();
|
||||
_o.required = this.required();
|
||||
_o.key = this.key();
|
||||
_o.attributes = this.bb.createObjList(this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb.createScalarList(this.documentation.bind(this), this.documentationLength());
|
||||
_o.optional = this.optional();
|
||||
_o.padding = this.padding();
|
||||
_o.offset64 = this.offset64();
|
||||
return builder.endVector();
|
||||
}
|
||||
static startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(10, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(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 startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addOptional(builder, optional) {
|
||||
builder.addFieldInt8(11, +optional, +false);
|
||||
}
|
||||
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
|
||||
builder.requiredField(offset, 6); // type
|
||||
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(), this.offset64());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.type = (this.type() !== null ? this.type().unpack() : null);
|
||||
_o.id = this.id();
|
||||
_o.offset = this.offset();
|
||||
_o.defaultInteger = this.defaultInteger();
|
||||
_o.defaultReal = this.defaultReal();
|
||||
_o.deprecated = this.deprecated();
|
||||
_o.required = this.required();
|
||||
_o.key = this.key();
|
||||
_o.attributes = this.bb.createObjList(
|
||||
this.attributes.bind(this), this.attributesLength());
|
||||
_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, offset64 = false) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.id = id;
|
||||
this.offset = offset;
|
||||
this.defaultInteger = defaultInteger;
|
||||
this.defaultReal = defaultReal;
|
||||
this.deprecated = deprecated;
|
||||
this.required = required;
|
||||
this.key = key;
|
||||
this.attributes = attributes;
|
||||
this.documentation = documentation;
|
||||
this.optional = optional;
|
||||
this.padding = padding;
|
||||
this.offset64 = offset64;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const type = (this.type !== null ? this.type.pack(builder) : 0);
|
||||
const attributes = Field.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Field.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
Field.startField(builder);
|
||||
Field.addName(builder, name);
|
||||
Field.addType(builder, type);
|
||||
Field.addId(builder, this.id);
|
||||
Field.addOffset(builder, this.offset);
|
||||
Field.addDefaultInteger(builder, this.defaultInteger);
|
||||
Field.addDefaultReal(builder, this.defaultReal);
|
||||
Field.addDeprecated(builder, this.deprecated);
|
||||
Field.addRequired(builder, this.required);
|
||||
Field.addKey(builder, this.key);
|
||||
Field.addAttributes(builder, attributes);
|
||||
Field.addDocumentation(builder, documentation);
|
||||
Field.addOptional(builder, this.optional);
|
||||
Field.addPadding(builder, this.padding);
|
||||
Field.addOffset64(builder, this.offset64);
|
||||
return Field.endField(builder);
|
||||
}
|
||||
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;
|
||||
this.offset = offset;
|
||||
this.defaultInteger = defaultInteger;
|
||||
this.defaultReal = defaultReal;
|
||||
this.deprecated = deprecated;
|
||||
this.required = required;
|
||||
this.key = key;
|
||||
this.attributes = attributes;
|
||||
this.documentation = documentation;
|
||||
this.optional = optional;
|
||||
this.padding = padding;
|
||||
this.offset64 = offset64;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const type = (this.type !== null ? this.type.pack(builder) : 0);
|
||||
const attributes = Field.createAttributesVector(
|
||||
builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Field.createDocumentationVector(
|
||||
builder, builder.createObjectOffsetList(this.documentation));
|
||||
Field.startField(builder);
|
||||
Field.addName(builder, name);
|
||||
Field.addType(builder, type);
|
||||
Field.addId(builder, this.id);
|
||||
Field.addOffset(builder, this.offset);
|
||||
Field.addDefaultInteger(builder, this.defaultInteger);
|
||||
Field.addDefaultReal(builder, this.defaultReal);
|
||||
Field.addDeprecated(builder, this.deprecated);
|
||||
Field.addRequired(builder, this.required);
|
||||
Field.addKey(builder, this.key);
|
||||
Field.addAttributes(builder, attributes);
|
||||
Field.addDocumentation(builder, documentation);
|
||||
Field.addOptional(builder, this.optional);
|
||||
Field.addPadding(builder, this.padding);
|
||||
Field.addOffset64(builder, this.offset64);
|
||||
return Field.endField(builder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,403 +4,469 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
import { Type, TypeT } from '../reflection/type.js';
|
||||
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
import {Type, TypeT} from '../reflection/type.js';
|
||||
|
||||
export class Field implements flatbuffers.IUnpackableObject<FieldT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Field {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsField(bb:flatbuffers.ByteBuffer, obj?:Field):Field {
|
||||
return (obj || new Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsField(bb:flatbuffers.ByteBuffer, obj?:Field):Field {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
name():string|null
|
||||
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
name(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;
|
||||
}
|
||||
|
||||
type(obj?:Type):Type|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new Type()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
||||
}
|
||||
|
||||
id():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_id(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Field {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
this.bb!.writeUint16(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
offset():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_offset(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
static getRootAsField(bb: flatbuffers.ByteBuffer, obj?: Field): Field {
|
||||
return (obj || new Field()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
this.bb!.writeUint16(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultInteger():bigint {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
|
||||
mutate_default_integer(value:bigint):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
static getSizePrefixedRootAsField(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Field,
|
||||
): Field {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Field()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
this.bb!.writeInt64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
defaultReal():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.readFloat64(this.bb_pos + offset) : 0.0;
|
||||
}
|
||||
|
||||
mutate_default_real(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
name(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;
|
||||
}
|
||||
|
||||
this.bb!.writeFloat64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
deprecated():boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
mutate_deprecated(value:boolean):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
type(obj?: Type): Type | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset
|
||||
? (obj || new Type()).__init(
|
||||
this.bb!.__indirect(this.bb_pos + offset),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
required():boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 18);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
mutate_required(value:boolean):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 18);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
id(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
mutate_id(value: number): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
|
||||
key():boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 20);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mutate_key(value:boolean):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 20);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
this.bb!.writeUint16(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
attributes(index: number, obj?:KeyValue):KeyValue|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 22);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
attributesLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 22);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
documentation(index: number):string
|
||||
documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
|
||||
documentation(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;
|
||||
}
|
||||
|
||||
documentationLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 24);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
optional():boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 26);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
mutate_optional(value:boolean):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 26);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
offset(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
mutate_offset(value: number): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
|
||||
/**
|
||||
* Number of padding octets to always add after this field. Structs only.
|
||||
*/
|
||||
padding():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 28);
|
||||
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mutate_padding(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 28);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
this.bb!.writeUint16(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
this.bb!.writeUint16(this.bb_pos + offset, value);
|
||||
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;
|
||||
defaultInteger(): bigint {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
mutate_default_integer(value: bigint): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.Field';
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static startField(builder:flatbuffers.Builder) {
|
||||
builder.startObject(14);
|
||||
}
|
||||
|
||||
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addType(builder:flatbuffers.Builder, typeOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(1, typeOffset, 0);
|
||||
}
|
||||
|
||||
static addId(builder:flatbuffers.Builder, id:number) {
|
||||
builder.addFieldInt16(2, id, 0);
|
||||
}
|
||||
|
||||
static addOffset(builder:flatbuffers.Builder, offset:number) {
|
||||
builder.addFieldInt16(3, offset, 0);
|
||||
}
|
||||
|
||||
static addDefaultInteger(builder:flatbuffers.Builder, defaultInteger:bigint) {
|
||||
builder.addFieldInt64(4, defaultInteger, BigInt('0'));
|
||||
}
|
||||
|
||||
static addDefaultReal(builder:flatbuffers.Builder, defaultReal:number) {
|
||||
builder.addFieldFloat64(5, defaultReal, 0.0);
|
||||
}
|
||||
|
||||
static addDeprecated(builder:flatbuffers.Builder, deprecated:boolean) {
|
||||
builder.addFieldInt8(6, +deprecated, +false);
|
||||
}
|
||||
|
||||
static addRequired(builder:flatbuffers.Builder, required:boolean) {
|
||||
builder.addFieldInt8(7, +required, +false);
|
||||
}
|
||||
|
||||
static addKey(builder:flatbuffers.Builder, key:boolean) {
|
||||
builder.addFieldInt8(8, +key, +false);
|
||||
}
|
||||
|
||||
static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(9, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(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]!);
|
||||
this.bb!.writeInt64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startAttributesVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(10, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(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]!);
|
||||
defaultReal(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.readFloat64(this.bb_pos + offset) : 0.0;
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
mutate_default_real(value: number): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
|
||||
static addOptional(builder:flatbuffers.Builder, optional:boolean) {
|
||||
builder.addFieldInt8(11, +optional, +false);
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static addPadding(builder:flatbuffers.Builder, padding:number) {
|
||||
builder.addFieldInt16(12, padding, 0);
|
||||
}
|
||||
this.bb!.writeFloat64(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static addOffset64(builder:flatbuffers.Builder, offset64:boolean) {
|
||||
builder.addFieldInt8(13, +offset64, +false);
|
||||
}
|
||||
deprecated(): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
static endField(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // name
|
||||
builder.requiredField(offset, 6) // type
|
||||
return offset;
|
||||
}
|
||||
mutate_deprecated(value: boolean): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
unpack(): FieldT {
|
||||
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<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
|
||||
this.optional(),
|
||||
this.padding(),
|
||||
this.offset64()
|
||||
);
|
||||
}
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
required(): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 18);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
unpackTo(_o: FieldT): void {
|
||||
_o.name = this.name();
|
||||
_o.type = (this.type() !== null ? this.type()!.unpack() : null);
|
||||
_o.id = this.id();
|
||||
_o.offset = this.offset();
|
||||
_o.defaultInteger = this.defaultInteger();
|
||||
_o.defaultReal = this.defaultReal();
|
||||
_o.deprecated = this.deprecated();
|
||||
_o.required = this.required();
|
||||
_o.key = this.key();
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
|
||||
_o.optional = this.optional();
|
||||
_o.padding = this.padding();
|
||||
_o.offset64 = this.offset64();
|
||||
}
|
||||
mutate_required(value: boolean): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 18);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
key(): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 20);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
mutate_key(value: boolean): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 20);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 22);
|
||||
return offset
|
||||
? (obj || new KeyValue()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
attributesLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 22);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentation(
|
||||
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;
|
||||
}
|
||||
|
||||
documentationLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 24);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
optional(): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 26);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
mutate_optional(value: boolean): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 26);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of padding octets to always add after this field. Structs only.
|
||||
*/
|
||||
padding(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 28);
|
||||
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_padding(value: number): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 28);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeUint16(this.bb_pos + offset, value);
|
||||
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(14);
|
||||
}
|
||||
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addType(builder: flatbuffers.Builder, typeOffset: flatbuffers.Offset) {
|
||||
builder.addFieldOffset(1, typeOffset, 0);
|
||||
}
|
||||
|
||||
static addId(builder: flatbuffers.Builder, id: number) {
|
||||
builder.addFieldInt16(2, id, 0);
|
||||
}
|
||||
|
||||
static addOffset(builder: flatbuffers.Builder, offset: number) {
|
||||
builder.addFieldInt16(3, offset, 0);
|
||||
}
|
||||
|
||||
static addDefaultInteger(
|
||||
builder: flatbuffers.Builder,
|
||||
defaultInteger: bigint,
|
||||
) {
|
||||
builder.addFieldInt64(4, defaultInteger, BigInt('0'));
|
||||
}
|
||||
|
||||
static addDefaultReal(builder: flatbuffers.Builder, defaultReal: number) {
|
||||
builder.addFieldFloat64(5, defaultReal, 0.0);
|
||||
}
|
||||
|
||||
static addDeprecated(builder: flatbuffers.Builder, deprecated: boolean) {
|
||||
builder.addFieldInt8(6, +deprecated, +false);
|
||||
}
|
||||
|
||||
static addRequired(builder: flatbuffers.Builder, required: boolean) {
|
||||
builder.addFieldInt8(7, +required, +false);
|
||||
}
|
||||
|
||||
static addKey(builder: flatbuffers.Builder, key: boolean) {
|
||||
builder.addFieldInt8(8, +key, +false);
|
||||
}
|
||||
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(9, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(
|
||||
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 startAttributesVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(10, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(
|
||||
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 startDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addOptional(builder: flatbuffers.Builder, optional: boolean) {
|
||||
builder.addFieldInt8(11, +optional, +false);
|
||||
}
|
||||
|
||||
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
|
||||
builder.requiredField(offset, 6); // type
|
||||
return offset;
|
||||
}
|
||||
|
||||
unpack(): FieldT {
|
||||
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<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
),
|
||||
this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
),
|
||||
this.optional(),
|
||||
this.padding(),
|
||||
this.offset64(),
|
||||
);
|
||||
}
|
||||
|
||||
unpackTo(_o: FieldT): void {
|
||||
_o.name = this.name();
|
||||
_o.type = this.type() !== null ? this.type()!.unpack() : null;
|
||||
_o.id = this.id();
|
||||
_o.offset = this.offset();
|
||||
_o.defaultInteger = this.defaultInteger();
|
||||
_o.defaultReal = this.defaultReal();
|
||||
_o.deprecated = this.deprecated();
|
||||
_o.required = this.required();
|
||||
_o.key = this.key();
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
);
|
||||
_o.documentation = this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
);
|
||||
_o.optional = this.optional();
|
||||
_o.padding = this.padding();
|
||||
_o.offset64 = this.offset64();
|
||||
}
|
||||
}
|
||||
|
||||
export class FieldT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public name: string|Uint8Array|null = null,
|
||||
public type: TypeT|null = null,
|
||||
public id: number = 0,
|
||||
public offset: number = 0,
|
||||
public defaultInteger: bigint = BigInt('0'),
|
||||
public defaultReal: number = 0.0,
|
||||
public deprecated: boolean = false,
|
||||
public required: boolean = false,
|
||||
public key: boolean = false,
|
||||
public attributes: (KeyValueT)[] = [],
|
||||
public documentation: (string)[] = [],
|
||||
public optional: boolean = false,
|
||||
public padding: number = 0,
|
||||
public offset64: boolean = false
|
||||
){}
|
||||
constructor(
|
||||
public name: string | Uint8Array | null = null,
|
||||
public type: TypeT | null = null,
|
||||
public id: number = 0,
|
||||
public offset: number = 0,
|
||||
public defaultInteger: bigint = BigInt('0'),
|
||||
public defaultReal: number = 0.0,
|
||||
public deprecated: boolean = false,
|
||||
public required: boolean = false,
|
||||
public key: boolean = false,
|
||||
public attributes: KeyValueT[] = [],
|
||||
public documentation: string[] = [],
|
||||
public optional: boolean = false,
|
||||
public padding: number = 0,
|
||||
public offset64: boolean = false,
|
||||
) {}
|
||||
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = this.name !== null ? builder.createString(this.name!) : 0;
|
||||
const type = this.type !== null ? this.type!.pack(builder) : 0;
|
||||
const attributes = Field.createAttributesVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.attributes),
|
||||
);
|
||||
const documentation = Field.createDocumentationVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.documentation),
|
||||
);
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = (this.name !== null ? builder.createString(this.name!) : 0);
|
||||
const type = (this.type !== null ? this.type!.pack(builder) : 0);
|
||||
const attributes = Field.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Field.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
Field.startField(builder);
|
||||
Field.addName(builder, name);
|
||||
Field.addType(builder, type);
|
||||
Field.addId(builder, this.id);
|
||||
Field.addOffset(builder, this.offset);
|
||||
Field.addDefaultInteger(builder, this.defaultInteger);
|
||||
Field.addDefaultReal(builder, this.defaultReal);
|
||||
Field.addDeprecated(builder, this.deprecated);
|
||||
Field.addRequired(builder, this.required);
|
||||
Field.addKey(builder, this.key);
|
||||
Field.addAttributes(builder, attributes);
|
||||
Field.addDocumentation(builder, documentation);
|
||||
Field.addOptional(builder, this.optional);
|
||||
Field.addPadding(builder, this.padding);
|
||||
Field.addOffset64(builder, this.offset64);
|
||||
|
||||
Field.startField(builder);
|
||||
Field.addName(builder, name);
|
||||
Field.addType(builder, type);
|
||||
Field.addId(builder, this.id);
|
||||
Field.addOffset(builder, this.offset);
|
||||
Field.addDefaultInteger(builder, this.defaultInteger);
|
||||
Field.addDefaultReal(builder, this.defaultReal);
|
||||
Field.addDeprecated(builder, this.deprecated);
|
||||
Field.addRequired(builder, this.required);
|
||||
Field.addKey(builder, this.key);
|
||||
Field.addAttributes(builder, attributes);
|
||||
Field.addDocumentation(builder, documentation);
|
||||
Field.addOptional(builder, this.optional);
|
||||
Field.addPadding(builder, this.padding);
|
||||
Field.addOffset64(builder, this.offset64);
|
||||
|
||||
return Field.endField(builder);
|
||||
}
|
||||
return Field.endField(builder);
|
||||
}
|
||||
}
|
||||
|
||||
65
tests/ts/reflection/key-value.d.ts
vendored
65
tests/ts/reflection/key-value.d.ts
vendored
@@ -1,26 +1,47 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export declare class KeyValue implements flatbuffers.IUnpackableObject<KeyValueT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): KeyValue;
|
||||
static getRootAsKeyValue(bb: flatbuffers.ByteBuffer, obj?: KeyValue): KeyValue;
|
||||
static getSizePrefixedRootAsKeyValue(bb: flatbuffers.ByteBuffer, obj?: KeyValue): KeyValue;
|
||||
key(): string | null;
|
||||
key(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
value(): string | null;
|
||||
value(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startKeyValue(builder: flatbuffers.Builder): void;
|
||||
static addKey(builder: flatbuffers.Builder, keyOffset: flatbuffers.Offset): void;
|
||||
static addValue(builder: flatbuffers.Builder, valueOffset: flatbuffers.Offset): void;
|
||||
static endKeyValue(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createKeyValue(builder: flatbuffers.Builder, keyOffset: flatbuffers.Offset, valueOffset: flatbuffers.Offset): flatbuffers.Offset;
|
||||
unpack(): KeyValueT;
|
||||
unpackTo(_o: KeyValueT): void;
|
||||
export declare class KeyValue
|
||||
implements flatbuffers.IUnpackableObject<KeyValueT>
|
||||
{
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): KeyValue;
|
||||
static getRootAsKeyValue(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: KeyValue,
|
||||
): KeyValue;
|
||||
static getSizePrefixedRootAsKeyValue(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: KeyValue,
|
||||
): KeyValue;
|
||||
key(): string | null;
|
||||
key(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
value(): string | null;
|
||||
value(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startKeyValue(builder: flatbuffers.Builder): void;
|
||||
static addKey(
|
||||
builder: flatbuffers.Builder,
|
||||
keyOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addValue(
|
||||
builder: flatbuffers.Builder,
|
||||
valueOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static endKeyValue(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createKeyValue(
|
||||
builder: flatbuffers.Builder,
|
||||
keyOffset: flatbuffers.Offset,
|
||||
valueOffset: flatbuffers.Offset,
|
||||
): flatbuffers.Offset;
|
||||
unpack(): KeyValueT;
|
||||
unpackTo(_o: KeyValueT): void;
|
||||
}
|
||||
export declare class KeyValueT implements flatbuffers.IGeneratedObject {
|
||||
key: string | Uint8Array | null;
|
||||
value: string | Uint8Array | null;
|
||||
constructor(key?: string | Uint8Array | null, value?: string | Uint8Array | null);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
key: string | Uint8Array | null;
|
||||
value: string | Uint8Array | null;
|
||||
constructor(
|
||||
key?: string | Uint8Array | null,
|
||||
value?: string | Uint8Array | null,
|
||||
);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,70 +1,75 @@
|
||||
// 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 */
|
||||
/* 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() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsKeyValue(bb, obj) {
|
||||
return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsKeyValue(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
key(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
value(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.KeyValue';
|
||||
}
|
||||
static startKeyValue(builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
static addKey(builder, keyOffset) {
|
||||
builder.addFieldOffset(0, keyOffset, 0);
|
||||
}
|
||||
static addValue(builder, valueOffset) {
|
||||
builder.addFieldOffset(1, valueOffset, 0);
|
||||
}
|
||||
static endKeyValue(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // key
|
||||
return offset;
|
||||
}
|
||||
static createKeyValue(builder, keyOffset, valueOffset) {
|
||||
KeyValue.startKeyValue(builder);
|
||||
KeyValue.addKey(builder, keyOffset);
|
||||
KeyValue.addValue(builder, valueOffset);
|
||||
return KeyValue.endKeyValue(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new KeyValueT(this.key(), this.value());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.key = this.key();
|
||||
_o.value = this.value();
|
||||
}
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsKeyValue(bb, obj) {
|
||||
return (obj || new KeyValue())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsKeyValue(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new KeyValue())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
key(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
value(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.KeyValue';
|
||||
}
|
||||
static startKeyValue(builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
static addKey(builder, keyOffset) {
|
||||
builder.addFieldOffset(0, keyOffset, 0);
|
||||
}
|
||||
static addValue(builder, valueOffset) {
|
||||
builder.addFieldOffset(1, valueOffset, 0);
|
||||
}
|
||||
static endKeyValue(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // key
|
||||
return offset;
|
||||
}
|
||||
static createKeyValue(builder, keyOffset, valueOffset) {
|
||||
KeyValue.startKeyValue(builder);
|
||||
KeyValue.addKey(builder, keyOffset);
|
||||
KeyValue.addValue(builder, valueOffset);
|
||||
return KeyValue.endKeyValue(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new KeyValueT(this.key(), this.value());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.key = this.key();
|
||||
_o.value = this.value();
|
||||
}
|
||||
}
|
||||
export class KeyValueT {
|
||||
constructor(key = null, value = null) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
pack(builder) {
|
||||
const key = (this.key !== null ? builder.createString(this.key) : 0);
|
||||
const value = (this.value !== null ? builder.createString(this.value) : 0);
|
||||
return KeyValue.createKeyValue(builder, key, value);
|
||||
}
|
||||
constructor(key = null, value = null) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
pack(builder) {
|
||||
const key = (this.key !== null ? builder.createString(this.key) : 0);
|
||||
const value = (this.value !== null ? builder.createString(this.value) : 0);
|
||||
return KeyValue.createKeyValue(builder, key, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,97 +4,110 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
export class KeyValue implements flatbuffers.IUnpackableObject<KeyValueT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):KeyValue {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): KeyValue {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsKeyValue(bb:flatbuffers.ByteBuffer, obj?:KeyValue):KeyValue {
|
||||
return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getRootAsKeyValue(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: KeyValue,
|
||||
): KeyValue {
|
||||
return (obj || new KeyValue()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsKeyValue(bb:flatbuffers.ByteBuffer, obj?:KeyValue):KeyValue {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsKeyValue(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: KeyValue,
|
||||
): KeyValue {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new KeyValue()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
key():string|null
|
||||
key(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
key(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;
|
||||
}
|
||||
key(): string | null;
|
||||
key(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
key(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;
|
||||
}
|
||||
|
||||
value():string|null
|
||||
value(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
value(optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
value(): string | null;
|
||||
value(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
value(optionalEncoding?: any): string | Uint8Array | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset
|
||||
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
||||
: null;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.KeyValue';
|
||||
}
|
||||
static getFullyQualifiedName(): string {
|
||||
return 'reflection.KeyValue';
|
||||
}
|
||||
|
||||
static startKeyValue(builder:flatbuffers.Builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
static startKeyValue(builder: flatbuffers.Builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
|
||||
static addKey(builder:flatbuffers.Builder, keyOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, keyOffset, 0);
|
||||
}
|
||||
static addKey(builder: flatbuffers.Builder, keyOffset: flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, keyOffset, 0);
|
||||
}
|
||||
|
||||
static addValue(builder:flatbuffers.Builder, valueOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(1, valueOffset, 0);
|
||||
}
|
||||
static addValue(
|
||||
builder: flatbuffers.Builder,
|
||||
valueOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(1, valueOffset, 0);
|
||||
}
|
||||
|
||||
static endKeyValue(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // key
|
||||
return offset;
|
||||
}
|
||||
static endKeyValue(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // key
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createKeyValue(builder:flatbuffers.Builder, keyOffset:flatbuffers.Offset, valueOffset:flatbuffers.Offset):flatbuffers.Offset {
|
||||
KeyValue.startKeyValue(builder);
|
||||
KeyValue.addKey(builder, keyOffset);
|
||||
KeyValue.addValue(builder, valueOffset);
|
||||
return KeyValue.endKeyValue(builder);
|
||||
}
|
||||
static createKeyValue(
|
||||
builder: flatbuffers.Builder,
|
||||
keyOffset: flatbuffers.Offset,
|
||||
valueOffset: flatbuffers.Offset,
|
||||
): flatbuffers.Offset {
|
||||
KeyValue.startKeyValue(builder);
|
||||
KeyValue.addKey(builder, keyOffset);
|
||||
KeyValue.addValue(builder, valueOffset);
|
||||
return KeyValue.endKeyValue(builder);
|
||||
}
|
||||
|
||||
unpack(): KeyValueT {
|
||||
return new KeyValueT(
|
||||
this.key(),
|
||||
this.value()
|
||||
);
|
||||
}
|
||||
unpack(): KeyValueT {
|
||||
return new KeyValueT(this.key(), this.value());
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: KeyValueT): void {
|
||||
_o.key = this.key();
|
||||
_o.value = this.value();
|
||||
}
|
||||
unpackTo(_o: KeyValueT): void {
|
||||
_o.key = this.key();
|
||||
_o.value = this.value();
|
||||
}
|
||||
}
|
||||
|
||||
export class KeyValueT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public key: string|Uint8Array|null = null,
|
||||
public value: string|Uint8Array|null = null
|
||||
){}
|
||||
constructor(
|
||||
public key: string | Uint8Array | null = null,
|
||||
public value: string | Uint8Array | null = null,
|
||||
) {}
|
||||
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const key = this.key !== null ? builder.createString(this.key!) : 0;
|
||||
const value = this.value !== null ? builder.createString(this.value!) : 0;
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const key = (this.key !== null ? builder.createString(this.key!) : 0);
|
||||
const value = (this.value !== null ? builder.createString(this.value!) : 0);
|
||||
|
||||
return KeyValue.createKeyValue(builder,
|
||||
key,
|
||||
value
|
||||
);
|
||||
}
|
||||
return KeyValue.createKeyValue(builder, key, value);
|
||||
}
|
||||
}
|
||||
|
||||
178
tests/ts/reflection/object.d.ts
vendored
178
tests/ts/reflection/object.d.ts
vendored
@@ -1,62 +1,124 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { Field, FieldT } from '../reflection/field.js';
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
export declare class Object_ implements flatbuffers.IUnpackableObject<Object_T> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Object_;
|
||||
static getRootAsObject(bb: flatbuffers.ByteBuffer, obj?: Object_): Object_;
|
||||
static getSizePrefixedRootAsObject(bb: flatbuffers.ByteBuffer, obj?: Object_): Object_;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
fields(index: number, obj?: Field): Field | null;
|
||||
fieldsLength(): number;
|
||||
isStruct(): boolean;
|
||||
mutate_is_struct(value: boolean): boolean;
|
||||
minalign(): number;
|
||||
mutate_minalign(value: number): boolean;
|
||||
bytesize(): number;
|
||||
mutate_bytesize(value: number): boolean;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
documentation(index: number): string;
|
||||
documentation(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
/**
|
||||
* File that this Object is declared in.
|
||||
*/
|
||||
declarationFile(): string | null;
|
||||
declarationFile(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startObject(builder: flatbuffers.Builder): void;
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
|
||||
static addFields(builder: flatbuffers.Builder, fieldsOffset: flatbuffers.Offset): void;
|
||||
static createFieldsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startFieldsVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addIsStruct(builder: flatbuffers.Builder, isStruct: boolean): void;
|
||||
static addMinalign(builder: flatbuffers.Builder, minalign: number): void;
|
||||
static addBytesize(builder: flatbuffers.Builder, bytesize: number): void;
|
||||
static addAttributes(builder: flatbuffers.Builder, attributesOffset: flatbuffers.Offset): void;
|
||||
static createAttributesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startAttributesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addDocumentation(builder: flatbuffers.Builder, documentationOffset: flatbuffers.Offset): void;
|
||||
static createDocumentationVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startDocumentationVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addDeclarationFile(builder: flatbuffers.Builder, declarationFileOffset: flatbuffers.Offset): void;
|
||||
static endObject(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createObject(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset, fieldsOffset: flatbuffers.Offset, isStruct: boolean, minalign: number, bytesize: number, attributesOffset: flatbuffers.Offset, documentationOffset: flatbuffers.Offset, declarationFileOffset: flatbuffers.Offset): flatbuffers.Offset;
|
||||
unpack(): Object_T;
|
||||
unpackTo(_o: Object_T): void;
|
||||
import {Field, FieldT} from '../reflection/field.js';
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
export declare class Object_
|
||||
implements flatbuffers.IUnpackableObject<Object_T>
|
||||
{
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Object_;
|
||||
static getRootAsObject(bb: flatbuffers.ByteBuffer, obj?: Object_): Object_;
|
||||
static getSizePrefixedRootAsObject(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Object_,
|
||||
): Object_;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
fields(index: number, obj?: Field): Field | null;
|
||||
fieldsLength(): number;
|
||||
isStruct(): boolean;
|
||||
mutate_is_struct(value: boolean): boolean;
|
||||
minalign(): number;
|
||||
mutate_minalign(value: number): boolean;
|
||||
bytesize(): number;
|
||||
mutate_bytesize(value: number): boolean;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
/**
|
||||
* File that this Object is declared in.
|
||||
*/
|
||||
declarationFile(): string | null;
|
||||
declarationFile(
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array | null;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startObject(builder: flatbuffers.Builder): void;
|
||||
static addName(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addFields(
|
||||
builder: flatbuffers.Builder,
|
||||
fieldsOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createFieldsVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startFieldsVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addIsStruct(builder: flatbuffers.Builder, isStruct: boolean): void;
|
||||
static addMinalign(builder: flatbuffers.Builder, minalign: number): void;
|
||||
static addBytesize(builder: flatbuffers.Builder, bytesize: number): void;
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addDeclarationFile(
|
||||
builder: flatbuffers.Builder,
|
||||
declarationFileOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static endObject(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createObject(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
fieldsOffset: flatbuffers.Offset,
|
||||
isStruct: boolean,
|
||||
minalign: number,
|
||||
bytesize: number,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
declarationFileOffset: flatbuffers.Offset,
|
||||
): flatbuffers.Offset;
|
||||
unpack(): Object_T;
|
||||
unpackTo(_o: Object_T): void;
|
||||
}
|
||||
export declare class Object_T implements flatbuffers.IGeneratedObject {
|
||||
name: string | Uint8Array | null;
|
||||
fields: (FieldT)[];
|
||||
isStruct: boolean;
|
||||
minalign: number;
|
||||
bytesize: number;
|
||||
attributes: (KeyValueT)[];
|
||||
documentation: (string)[];
|
||||
declarationFile: string | Uint8Array | null;
|
||||
constructor(name?: string | Uint8Array | null, fields?: (FieldT)[], isStruct?: boolean, minalign?: number, bytesize?: number, attributes?: (KeyValueT)[], documentation?: (string)[], declarationFile?: string | Uint8Array | null);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
name: string | Uint8Array | null;
|
||||
fields: FieldT[];
|
||||
isStruct: boolean;
|
||||
minalign: number;
|
||||
bytesize: number;
|
||||
attributes: KeyValueT[];
|
||||
documentation: string[];
|
||||
declarationFile: string | Uint8Array | null;
|
||||
constructor(
|
||||
name?: string | Uint8Array | null,
|
||||
fields?: FieldT[],
|
||||
isStruct?: boolean,
|
||||
minalign?: number,
|
||||
bytesize?: number,
|
||||
attributes?: KeyValueT[],
|
||||
documentation?: string[],
|
||||
declarationFile?: string | Uint8Array | null,
|
||||
);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,202 +1,247 @@
|
||||
// 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 */
|
||||
/* 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';
|
||||
|
||||
import {Field} from '../reflection/field.js';
|
||||
import {KeyValue} from '../reflection/key-value.js';
|
||||
|
||||
export class Object_ {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsObject(bb, obj) {
|
||||
return (obj || new Object_())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsObject(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Object_())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
fields(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ?
|
||||
(obj || new Field())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
fieldsLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
isStruct() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_is_struct(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
minalign() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_minalign(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
static getRootAsObject(bb, obj) {
|
||||
return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
bytesize() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_bytesize(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
static getSizePrefixedRootAsObject(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ?
|
||||
(obj || new KeyValue())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
documentation(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb.__string(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
declarationFile(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 18);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Object';
|
||||
}
|
||||
static startObject(builder) {
|
||||
builder.startObject(8);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addFields(builder, fieldsOffset) {
|
||||
builder.addFieldOffset(1, fieldsOffset, 0);
|
||||
}
|
||||
static createFieldsVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
return builder.endVector();
|
||||
}
|
||||
static startFieldsVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addIsStruct(builder, isStruct) {
|
||||
builder.addFieldInt8(2, +isStruct, +false);
|
||||
}
|
||||
static addMinalign(builder, minalign) {
|
||||
builder.addFieldInt32(3, minalign, 0);
|
||||
}
|
||||
static addBytesize(builder, bytesize) {
|
||||
builder.addFieldInt32(4, bytesize, 0);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(5, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
fields(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new Field()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
fieldsLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
isStruct() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
mutate_is_struct(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
minalign() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_minalign(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
bytesize() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_bytesize(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;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
documentation(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
declarationFile(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 18);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Object';
|
||||
}
|
||||
static startObject(builder) {
|
||||
builder.startObject(8);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addFields(builder, fieldsOffset) {
|
||||
builder.addFieldOffset(1, fieldsOffset, 0);
|
||||
}
|
||||
static createFieldsVector(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 startFieldsVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addIsStruct(builder, isStruct) {
|
||||
builder.addFieldInt8(2, +isStruct, +false);
|
||||
}
|
||||
static addMinalign(builder, minalign) {
|
||||
builder.addFieldInt32(3, minalign, 0);
|
||||
}
|
||||
static addBytesize(builder, bytesize) {
|
||||
builder.addFieldInt32(4, bytesize, 0);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(5, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(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 startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(6, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(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 startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDeclarationFile(builder, declarationFileOffset) {
|
||||
builder.addFieldOffset(7, declarationFileOffset, 0);
|
||||
}
|
||||
static endObject(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
builder.requiredField(offset, 6); // fields
|
||||
return offset;
|
||||
}
|
||||
static createObject(builder, nameOffset, fieldsOffset, isStruct, minalign, bytesize, attributesOffset, documentationOffset, declarationFileOffset) {
|
||||
Object_.startObject(builder);
|
||||
Object_.addName(builder, nameOffset);
|
||||
Object_.addFields(builder, fieldsOffset);
|
||||
Object_.addIsStruct(builder, isStruct);
|
||||
Object_.addMinalign(builder, minalign);
|
||||
Object_.addBytesize(builder, bytesize);
|
||||
Object_.addAttributes(builder, attributesOffset);
|
||||
Object_.addDocumentation(builder, documentationOffset);
|
||||
Object_.addDeclarationFile(builder, declarationFileOffset);
|
||||
return Object_.endObject(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new Object_T(this.name(), this.bb.createObjList(this.fields.bind(this), this.fieldsLength()), this.isStruct(), this.minalign(), this.bytesize(), this.bb.createObjList(this.attributes.bind(this), this.attributesLength()), this.bb.createScalarList(this.documentation.bind(this), this.documentationLength()), this.declarationFile());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.fields = this.bb.createObjList(this.fields.bind(this), this.fieldsLength());
|
||||
_o.isStruct = this.isStruct();
|
||||
_o.minalign = this.minalign();
|
||||
_o.bytesize = this.bytesize();
|
||||
_o.attributes = this.bb.createObjList(this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb.createScalarList(this.documentation.bind(this), this.documentationLength());
|
||||
_o.declarationFile = this.declarationFile();
|
||||
return builder.endVector();
|
||||
}
|
||||
static startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(6, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(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 startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDeclarationFile(builder, declarationFileOffset) {
|
||||
builder.addFieldOffset(7, declarationFileOffset, 0);
|
||||
}
|
||||
static endObject(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
builder.requiredField(offset, 6); // fields
|
||||
return offset;
|
||||
}
|
||||
static createObject(
|
||||
builder, nameOffset, fieldsOffset, isStruct, minalign, bytesize,
|
||||
attributesOffset, documentationOffset, declarationFileOffset) {
|
||||
Object_.startObject(builder);
|
||||
Object_.addName(builder, nameOffset);
|
||||
Object_.addFields(builder, fieldsOffset);
|
||||
Object_.addIsStruct(builder, isStruct);
|
||||
Object_.addMinalign(builder, minalign);
|
||||
Object_.addBytesize(builder, bytesize);
|
||||
Object_.addAttributes(builder, attributesOffset);
|
||||
Object_.addDocumentation(builder, documentationOffset);
|
||||
Object_.addDeclarationFile(builder, declarationFileOffset);
|
||||
return Object_.endObject(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new Object_T(
|
||||
this.name(),
|
||||
this.bb.createObjList(this.fields.bind(this), this.fieldsLength()),
|
||||
this.isStruct(), this.minalign(), this.bytesize(),
|
||||
this.bb.createObjList(
|
||||
this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb.createScalarList(
|
||||
this.documentation.bind(this), this.documentationLength()),
|
||||
this.declarationFile());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.fields =
|
||||
this.bb.createObjList(this.fields.bind(this), this.fieldsLength());
|
||||
_o.isStruct = this.isStruct();
|
||||
_o.minalign = this.minalign();
|
||||
_o.bytesize = this.bytesize();
|
||||
_o.attributes = this.bb.createObjList(
|
||||
this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb.createScalarList(
|
||||
this.documentation.bind(this), this.documentationLength());
|
||||
_o.declarationFile = this.declarationFile();
|
||||
}
|
||||
}
|
||||
export class Object_T {
|
||||
constructor(name = null, fields = [], isStruct = false, minalign = 0, bytesize = 0, attributes = [], documentation = [], declarationFile = null) {
|
||||
this.name = name;
|
||||
this.fields = fields;
|
||||
this.isStruct = isStruct;
|
||||
this.minalign = minalign;
|
||||
this.bytesize = bytesize;
|
||||
this.attributes = attributes;
|
||||
this.documentation = documentation;
|
||||
this.declarationFile = declarationFile;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const fields = Object_.createFieldsVector(builder, builder.createObjectOffsetList(this.fields));
|
||||
const attributes = Object_.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Object_.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
const declarationFile = (this.declarationFile !== null ? builder.createString(this.declarationFile) : 0);
|
||||
return Object_.createObject(builder, name, fields, this.isStruct, this.minalign, this.bytesize, attributes, documentation, declarationFile);
|
||||
}
|
||||
constructor(
|
||||
name = null, fields = [], isStruct = false, minalign = 0, bytesize = 0,
|
||||
attributes = [], documentation = [], declarationFile = null) {
|
||||
this.name = name;
|
||||
this.fields = fields;
|
||||
this.isStruct = isStruct;
|
||||
this.minalign = minalign;
|
||||
this.bytesize = bytesize;
|
||||
this.attributes = attributes;
|
||||
this.documentation = documentation;
|
||||
this.declarationFile = declarationFile;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const fields = Object_.createFieldsVector(
|
||||
builder, builder.createObjectOffsetList(this.fields));
|
||||
const attributes = Object_.createAttributesVector(
|
||||
builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Object_.createDocumentationVector(
|
||||
builder, builder.createObjectOffsetList(this.documentation));
|
||||
const declarationFile =
|
||||
(this.declarationFile !== null ?
|
||||
builder.createString(this.declarationFile) :
|
||||
0);
|
||||
return Object_.createObject(
|
||||
builder, name, fields, this.isStruct, this.minalign, this.bytesize,
|
||||
attributes, documentation, declarationFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,276 +4,378 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Field, FieldT } from '../reflection/field.js';
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
|
||||
import {Field, FieldT} from '../reflection/field.js';
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
|
||||
export class Object_ implements flatbuffers.IUnpackableObject<Object_T> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Object_ {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsObject(bb:flatbuffers.ByteBuffer, obj?:Object_):Object_ {
|
||||
return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsObject(bb:flatbuffers.ByteBuffer, obj?:Object_):Object_ {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
name():string|null
|
||||
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
name(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;
|
||||
}
|
||||
|
||||
fields(index: number, obj?:Field):Field|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new Field()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
fieldsLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
isStruct():boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
mutate_is_struct(value:boolean):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Object_ {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
minalign():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_minalign(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
static getRootAsObject(bb: flatbuffers.ByteBuffer, obj?: Object_): Object_ {
|
||||
return (obj || new Object_()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
bytesize():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_bytesize(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
static getSizePrefixedRootAsObject(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Object_,
|
||||
): Object_ {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Object_()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
attributes(index: number, obj?:KeyValue):KeyValue|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
attributesLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
documentation(index: number):string
|
||||
documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
|
||||
documentation(index: number,optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
documentationLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* File that this Object is declared in.
|
||||
*/
|
||||
declarationFile():string|null
|
||||
declarationFile(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
declarationFile(optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 18);
|
||||
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.Object';
|
||||
}
|
||||
|
||||
static startObject(builder:flatbuffers.Builder) {
|
||||
builder.startObject(8);
|
||||
}
|
||||
|
||||
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addFields(builder:flatbuffers.Builder, fieldsOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(1, fieldsOffset, 0);
|
||||
}
|
||||
|
||||
static createFieldsVector(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]!);
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
name(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;
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startFieldsVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addIsStruct(builder:flatbuffers.Builder, isStruct:boolean) {
|
||||
builder.addFieldInt8(2, +isStruct, +false);
|
||||
}
|
||||
|
||||
static addMinalign(builder:flatbuffers.Builder, minalign:number) {
|
||||
builder.addFieldInt32(3, minalign, 0);
|
||||
}
|
||||
|
||||
static addBytesize(builder:flatbuffers.Builder, bytesize:number) {
|
||||
builder.addFieldInt32(4, bytesize, 0);
|
||||
}
|
||||
|
||||
static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(5, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(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]!);
|
||||
fields(index: number, obj?: Field): Field | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset
|
||||
? (obj || new Field()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startAttributesVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(6, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(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]!);
|
||||
fieldsLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
isStruct(): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
||||
}
|
||||
|
||||
static addDeclarationFile(builder:flatbuffers.Builder, declarationFileOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(7, declarationFileOffset, 0);
|
||||
}
|
||||
mutate_is_struct(value: boolean): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
|
||||
static endObject(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // name
|
||||
builder.requiredField(offset, 6) // fields
|
||||
return offset;
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static createObject(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset, fieldsOffset:flatbuffers.Offset, isStruct:boolean, minalign:number, bytesize:number, attributesOffset:flatbuffers.Offset, documentationOffset:flatbuffers.Offset, declarationFileOffset:flatbuffers.Offset):flatbuffers.Offset {
|
||||
Object_.startObject(builder);
|
||||
Object_.addName(builder, nameOffset);
|
||||
Object_.addFields(builder, fieldsOffset);
|
||||
Object_.addIsStruct(builder, isStruct);
|
||||
Object_.addMinalign(builder, minalign);
|
||||
Object_.addBytesize(builder, bytesize);
|
||||
Object_.addAttributes(builder, attributesOffset);
|
||||
Object_.addDocumentation(builder, documentationOffset);
|
||||
Object_.addDeclarationFile(builder, declarationFileOffset);
|
||||
return Object_.endObject(builder);
|
||||
}
|
||||
this.bb!.writeInt8(this.bb_pos + offset, +value);
|
||||
return true;
|
||||
}
|
||||
|
||||
unpack(): Object_T {
|
||||
return new Object_T(
|
||||
this.name(),
|
||||
this.bb!.createObjList<Field, FieldT>(this.fields.bind(this), this.fieldsLength()),
|
||||
this.isStruct(),
|
||||
this.minalign(),
|
||||
this.bytesize(),
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
|
||||
this.declarationFile()
|
||||
);
|
||||
}
|
||||
minalign(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_minalign(value: number): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
|
||||
unpackTo(_o: Object_T): void {
|
||||
_o.name = this.name();
|
||||
_o.fields = this.bb!.createObjList<Field, FieldT>(this.fields.bind(this), this.fieldsLength());
|
||||
_o.isStruct = this.isStruct();
|
||||
_o.minalign = this.minalign();
|
||||
_o.bytesize = this.bytesize();
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
|
||||
_o.declarationFile = this.declarationFile();
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
bytesize(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_bytesize(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;
|
||||
}
|
||||
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset
|
||||
? (obj || new KeyValue()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
attributesLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding?: any,
|
||||
): string | Uint8Array | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset
|
||||
? this.bb!.__string(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
documentationLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* File that this Object is declared in.
|
||||
*/
|
||||
declarationFile(): string | null;
|
||||
declarationFile(
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array | null;
|
||||
declarationFile(optionalEncoding?: any): string | Uint8Array | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 18);
|
||||
return offset
|
||||
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
||||
: null;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName(): string {
|
||||
return 'reflection.Object';
|
||||
}
|
||||
|
||||
static startObject(builder: flatbuffers.Builder) {
|
||||
builder.startObject(8);
|
||||
}
|
||||
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addFields(
|
||||
builder: flatbuffers.Builder,
|
||||
fieldsOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(1, fieldsOffset, 0);
|
||||
}
|
||||
|
||||
static createFieldsVector(
|
||||
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 startFieldsVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addIsStruct(builder: flatbuffers.Builder, isStruct: boolean) {
|
||||
builder.addFieldInt8(2, +isStruct, +false);
|
||||
}
|
||||
|
||||
static addMinalign(builder: flatbuffers.Builder, minalign: number) {
|
||||
builder.addFieldInt32(3, minalign, 0);
|
||||
}
|
||||
|
||||
static addBytesize(builder: flatbuffers.Builder, bytesize: number) {
|
||||
builder.addFieldInt32(4, bytesize, 0);
|
||||
}
|
||||
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(5, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(
|
||||
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 startAttributesVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(6, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(
|
||||
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 startDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDeclarationFile(
|
||||
builder: flatbuffers.Builder,
|
||||
declarationFileOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(7, declarationFileOffset, 0);
|
||||
}
|
||||
|
||||
static endObject(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
builder.requiredField(offset, 6); // fields
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createObject(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
fieldsOffset: flatbuffers.Offset,
|
||||
isStruct: boolean,
|
||||
minalign: number,
|
||||
bytesize: number,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
declarationFileOffset: flatbuffers.Offset,
|
||||
): flatbuffers.Offset {
|
||||
Object_.startObject(builder);
|
||||
Object_.addName(builder, nameOffset);
|
||||
Object_.addFields(builder, fieldsOffset);
|
||||
Object_.addIsStruct(builder, isStruct);
|
||||
Object_.addMinalign(builder, minalign);
|
||||
Object_.addBytesize(builder, bytesize);
|
||||
Object_.addAttributes(builder, attributesOffset);
|
||||
Object_.addDocumentation(builder, documentationOffset);
|
||||
Object_.addDeclarationFile(builder, declarationFileOffset);
|
||||
return Object_.endObject(builder);
|
||||
}
|
||||
|
||||
unpack(): Object_T {
|
||||
return new Object_T(
|
||||
this.name(),
|
||||
this.bb!.createObjList<Field, FieldT>(
|
||||
this.fields.bind(this),
|
||||
this.fieldsLength(),
|
||||
),
|
||||
this.isStruct(),
|
||||
this.minalign(),
|
||||
this.bytesize(),
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
),
|
||||
this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
),
|
||||
this.declarationFile(),
|
||||
);
|
||||
}
|
||||
|
||||
unpackTo(_o: Object_T): void {
|
||||
_o.name = this.name();
|
||||
_o.fields = this.bb!.createObjList<Field, FieldT>(
|
||||
this.fields.bind(this),
|
||||
this.fieldsLength(),
|
||||
);
|
||||
_o.isStruct = this.isStruct();
|
||||
_o.minalign = this.minalign();
|
||||
_o.bytesize = this.bytesize();
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
);
|
||||
_o.documentation = this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
);
|
||||
_o.declarationFile = this.declarationFile();
|
||||
}
|
||||
}
|
||||
|
||||
export class Object_T implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public name: string|Uint8Array|null = null,
|
||||
public fields: (FieldT)[] = [],
|
||||
public isStruct: boolean = false,
|
||||
public minalign: number = 0,
|
||||
public bytesize: number = 0,
|
||||
public attributes: (KeyValueT)[] = [],
|
||||
public documentation: (string)[] = [],
|
||||
public declarationFile: string|Uint8Array|null = null
|
||||
){}
|
||||
constructor(
|
||||
public name: string | Uint8Array | null = null,
|
||||
public fields: FieldT[] = [],
|
||||
public isStruct: boolean = false,
|
||||
public minalign: number = 0,
|
||||
public bytesize: number = 0,
|
||||
public attributes: KeyValueT[] = [],
|
||||
public documentation: string[] = [],
|
||||
public declarationFile: string | Uint8Array | null = null,
|
||||
) {}
|
||||
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = this.name !== null ? builder.createString(this.name!) : 0;
|
||||
const fields = Object_.createFieldsVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.fields),
|
||||
);
|
||||
const attributes = Object_.createAttributesVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.attributes),
|
||||
);
|
||||
const documentation = Object_.createDocumentationVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.documentation),
|
||||
);
|
||||
const declarationFile =
|
||||
this.declarationFile !== null
|
||||
? builder.createString(this.declarationFile!)
|
||||
: 0;
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = (this.name !== null ? builder.createString(this.name!) : 0);
|
||||
const fields = Object_.createFieldsVector(builder, builder.createObjectOffsetList(this.fields));
|
||||
const attributes = Object_.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Object_.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
const declarationFile = (this.declarationFile !== null ? builder.createString(this.declarationFile!) : 0);
|
||||
|
||||
return Object_.createObject(builder,
|
||||
name,
|
||||
fields,
|
||||
this.isStruct,
|
||||
this.minalign,
|
||||
this.bytesize,
|
||||
attributes,
|
||||
documentation,
|
||||
declarationFile
|
||||
);
|
||||
}
|
||||
return Object_.createObject(
|
||||
builder,
|
||||
name,
|
||||
fields,
|
||||
this.isStruct,
|
||||
this.minalign,
|
||||
this.bytesize,
|
||||
attributes,
|
||||
documentation,
|
||||
declarationFile,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
117
tests/ts/reflection/rpccall.d.ts
vendored
117
tests/ts/reflection/rpccall.d.ts
vendored
@@ -1,42 +1,83 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
import { Object_, Object_T } from '../reflection/object.js';
|
||||
export declare class RPCCall implements flatbuffers.IUnpackableObject<RPCCallT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): RPCCall;
|
||||
static getRootAsRPCCall(bb: flatbuffers.ByteBuffer, obj?: RPCCall): RPCCall;
|
||||
static getSizePrefixedRootAsRPCCall(bb: flatbuffers.ByteBuffer, obj?: RPCCall): RPCCall;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
request(obj?: Object_): Object_ | null;
|
||||
response(obj?: Object_): Object_ | null;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
documentation(index: number): string;
|
||||
documentation(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startRPCCall(builder: flatbuffers.Builder): void;
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
|
||||
static addRequest(builder: flatbuffers.Builder, requestOffset: flatbuffers.Offset): void;
|
||||
static addResponse(builder: flatbuffers.Builder, responseOffset: flatbuffers.Offset): void;
|
||||
static addAttributes(builder: flatbuffers.Builder, attributesOffset: flatbuffers.Offset): void;
|
||||
static createAttributesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startAttributesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addDocumentation(builder: flatbuffers.Builder, documentationOffset: flatbuffers.Offset): void;
|
||||
static createDocumentationVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startDocumentationVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static endRPCCall(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
unpack(): RPCCallT;
|
||||
unpackTo(_o: RPCCallT): void;
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
import {Object_, Object_T} from '../reflection/object.js';
|
||||
export declare class RPCCall
|
||||
implements flatbuffers.IUnpackableObject<RPCCallT>
|
||||
{
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): RPCCall;
|
||||
static getRootAsRPCCall(bb: flatbuffers.ByteBuffer, obj?: RPCCall): RPCCall;
|
||||
static getSizePrefixedRootAsRPCCall(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: RPCCall,
|
||||
): RPCCall;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
request(obj?: Object_): Object_ | null;
|
||||
response(obj?: Object_): Object_ | null;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startRPCCall(builder: flatbuffers.Builder): void;
|
||||
static addName(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addRequest(
|
||||
builder: flatbuffers.Builder,
|
||||
requestOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addResponse(
|
||||
builder: flatbuffers.Builder,
|
||||
responseOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static endRPCCall(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
unpack(): RPCCallT;
|
||||
unpackTo(_o: RPCCallT): void;
|
||||
}
|
||||
export declare class RPCCallT implements flatbuffers.IGeneratedObject {
|
||||
name: string | Uint8Array | null;
|
||||
request: Object_T | null;
|
||||
response: Object_T | null;
|
||||
attributes: (KeyValueT)[];
|
||||
documentation: (string)[];
|
||||
constructor(name?: string | Uint8Array | null, request?: Object_T | null, response?: Object_T | null, attributes?: (KeyValueT)[], documentation?: (string)[]);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
name: string | Uint8Array | null;
|
||||
request: Object_T | null;
|
||||
response: Object_T | null;
|
||||
attributes: KeyValueT[];
|
||||
documentation: string[];
|
||||
constructor(
|
||||
name?: string | Uint8Array | null,
|
||||
request?: Object_T | null,
|
||||
response?: Object_T | null,
|
||||
attributes?: KeyValueT[],
|
||||
documentation?: string[],
|
||||
);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,132 +1,165 @@
|
||||
// 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 */
|
||||
/* 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';
|
||||
|
||||
import {KeyValue} from '../reflection/key-value.js';
|
||||
import {Object_} from '../reflection/object.js';
|
||||
|
||||
export class RPCCall {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsRPCCall(bb, obj) {
|
||||
return (obj || new RPCCall())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsRPCCall(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new RPCCall())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
request(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ?
|
||||
(obj || new Object_())
|
||||
.__init(this.bb.__indirect(this.bb_pos + offset), this.bb) :
|
||||
null;
|
||||
}
|
||||
response(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ?
|
||||
(obj || new Object_())
|
||||
.__init(this.bb.__indirect(this.bb_pos + offset), this.bb) :
|
||||
null;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ?
|
||||
(obj || new KeyValue())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
documentation(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__string(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.RPCCall';
|
||||
}
|
||||
static startRPCCall(builder) {
|
||||
builder.startObject(5);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addRequest(builder, requestOffset) {
|
||||
builder.addFieldOffset(1, requestOffset, 0);
|
||||
}
|
||||
static addResponse(builder, responseOffset) {
|
||||
builder.addFieldOffset(2, responseOffset, 0);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(3, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsRPCCall(bb, obj) {
|
||||
return (obj || new RPCCall()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsRPCCall(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new RPCCall()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
request(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new Object_()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
}
|
||||
response(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? (obj || new Object_()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
documentation(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.RPCCall';
|
||||
}
|
||||
static startRPCCall(builder) {
|
||||
builder.startObject(5);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addRequest(builder, requestOffset) {
|
||||
builder.addFieldOffset(1, requestOffset, 0);
|
||||
}
|
||||
static addResponse(builder, responseOffset) {
|
||||
builder.addFieldOffset(2, responseOffset, 0);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(3, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(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 startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(4, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(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 startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static endRPCCall(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
builder.requiredField(offset, 6); // request
|
||||
builder.requiredField(offset, 8); // response
|
||||
return offset;
|
||||
}
|
||||
unpack() {
|
||||
return new RPCCallT(this.name(), (this.request() !== null ? this.request().unpack() : null), (this.response() !== null ? this.response().unpack() : null), this.bb.createObjList(this.attributes.bind(this), this.attributesLength()), this.bb.createScalarList(this.documentation.bind(this), this.documentationLength()));
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.request = (this.request() !== null ? this.request().unpack() : null);
|
||||
_o.response = (this.response() !== null ? this.response().unpack() : null);
|
||||
_o.attributes = this.bb.createObjList(this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb.createScalarList(this.documentation.bind(this), this.documentationLength());
|
||||
return builder.endVector();
|
||||
}
|
||||
static startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(4, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(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 startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static endRPCCall(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
builder.requiredField(offset, 6); // request
|
||||
builder.requiredField(offset, 8); // response
|
||||
return offset;
|
||||
}
|
||||
unpack() {
|
||||
return new RPCCallT(
|
||||
this.name(), (this.request() !== null ? this.request().unpack() : null),
|
||||
(this.response() !== null ? this.response().unpack() : null),
|
||||
this.bb.createObjList(
|
||||
this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb.createScalarList(
|
||||
this.documentation.bind(this), this.documentationLength()));
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.request = (this.request() !== null ? this.request().unpack() : null);
|
||||
_o.response = (this.response() !== null ? this.response().unpack() : null);
|
||||
_o.attributes = this.bb.createObjList(
|
||||
this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb.createScalarList(
|
||||
this.documentation.bind(this), this.documentationLength());
|
||||
}
|
||||
}
|
||||
export class RPCCallT {
|
||||
constructor(name = null, request = null, response = null, attributes = [], documentation = []) {
|
||||
this.name = name;
|
||||
this.request = request;
|
||||
this.response = response;
|
||||
this.attributes = attributes;
|
||||
this.documentation = documentation;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const request = (this.request !== null ? this.request.pack(builder) : 0);
|
||||
const response = (this.response !== null ? this.response.pack(builder) : 0);
|
||||
const attributes = RPCCall.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = RPCCall.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
RPCCall.startRPCCall(builder);
|
||||
RPCCall.addName(builder, name);
|
||||
RPCCall.addRequest(builder, request);
|
||||
RPCCall.addResponse(builder, response);
|
||||
RPCCall.addAttributes(builder, attributes);
|
||||
RPCCall.addDocumentation(builder, documentation);
|
||||
return RPCCall.endRPCCall(builder);
|
||||
}
|
||||
constructor(
|
||||
name = null, request = null, response = null, attributes = [],
|
||||
documentation = []) {
|
||||
this.name = name;
|
||||
this.request = request;
|
||||
this.response = response;
|
||||
this.attributes = attributes;
|
||||
this.documentation = documentation;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const request = (this.request !== null ? this.request.pack(builder) : 0);
|
||||
const response = (this.response !== null ? this.response.pack(builder) : 0);
|
||||
const attributes = RPCCall.createAttributesVector(
|
||||
builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = RPCCall.createDocumentationVector(
|
||||
builder, builder.createObjectOffsetList(this.documentation));
|
||||
RPCCall.startRPCCall(builder);
|
||||
RPCCall.addName(builder, name);
|
||||
RPCCall.addRequest(builder, request);
|
||||
RPCCall.addResponse(builder, response);
|
||||
RPCCall.addAttributes(builder, attributes);
|
||||
RPCCall.addDocumentation(builder, documentation);
|
||||
return RPCCall.endRPCCall(builder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,172 +4,246 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
import { Object_, Object_T } from '../reflection/object.js';
|
||||
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
import {Object_, Object_T} from '../reflection/object.js';
|
||||
|
||||
export class RPCCall implements flatbuffers.IUnpackableObject<RPCCallT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):RPCCall {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsRPCCall(bb:flatbuffers.ByteBuffer, obj?:RPCCall):RPCCall {
|
||||
return (obj || new RPCCall()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsRPCCall(bb:flatbuffers.ByteBuffer, obj?:RPCCall):RPCCall {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new RPCCall()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
name():string|null
|
||||
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
name(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;
|
||||
}
|
||||
|
||||
request(obj?:Object_):Object_|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new Object_()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
||||
}
|
||||
|
||||
response(obj?:Object_):Object_|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? (obj || new Object_()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
||||
}
|
||||
|
||||
attributes(index: number, obj?:KeyValue):KeyValue|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
attributesLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
documentation(index: number):string
|
||||
documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
|
||||
documentation(index: number,optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
documentationLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.RPCCall';
|
||||
}
|
||||
|
||||
static startRPCCall(builder:flatbuffers.Builder) {
|
||||
builder.startObject(5);
|
||||
}
|
||||
|
||||
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addRequest(builder:flatbuffers.Builder, requestOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(1, requestOffset, 0);
|
||||
}
|
||||
|
||||
static addResponse(builder:flatbuffers.Builder, responseOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(2, responseOffset, 0);
|
||||
}
|
||||
|
||||
static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(3, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(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]!);
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): RPCCall {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startAttributesVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(4, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(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]!);
|
||||
static getRootAsRPCCall(bb: flatbuffers.ByteBuffer, obj?: RPCCall): RPCCall {
|
||||
return (obj || new RPCCall()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static getSizePrefixedRootAsRPCCall(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: RPCCall,
|
||||
): RPCCall {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new RPCCall()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
static endRPCCall(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // name
|
||||
builder.requiredField(offset, 6) // request
|
||||
builder.requiredField(offset, 8) // response
|
||||
return offset;
|
||||
}
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
name(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;
|
||||
}
|
||||
|
||||
request(obj?: Object_): Object_ | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset
|
||||
? (obj || new Object_()).__init(
|
||||
this.bb!.__indirect(this.bb_pos + offset),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
unpack(): RPCCallT {
|
||||
return new RPCCallT(
|
||||
this.name(),
|
||||
(this.request() !== null ? this.request()!.unpack() : null),
|
||||
(this.response() !== null ? this.response()!.unpack() : null),
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength())
|
||||
);
|
||||
}
|
||||
response(obj?: Object_): Object_ | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset
|
||||
? (obj || new Object_()).__init(
|
||||
this.bb!.__indirect(this.bb_pos + offset),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset
|
||||
? (obj || new KeyValue()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
unpackTo(_o: RPCCallT): void {
|
||||
_o.name = this.name();
|
||||
_o.request = (this.request() !== null ? this.request()!.unpack() : null);
|
||||
_o.response = (this.response() !== null ? this.response()!.unpack() : null);
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
|
||||
}
|
||||
attributesLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding?: any,
|
||||
): string | Uint8Array | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset
|
||||
? this.bb!.__string(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
documentationLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName(): string {
|
||||
return 'reflection.RPCCall';
|
||||
}
|
||||
|
||||
static startRPCCall(builder: flatbuffers.Builder) {
|
||||
builder.startObject(5);
|
||||
}
|
||||
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addRequest(
|
||||
builder: flatbuffers.Builder,
|
||||
requestOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(1, requestOffset, 0);
|
||||
}
|
||||
|
||||
static addResponse(
|
||||
builder: flatbuffers.Builder,
|
||||
responseOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(2, responseOffset, 0);
|
||||
}
|
||||
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(3, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(
|
||||
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 startAttributesVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(4, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(
|
||||
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 startDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static endRPCCall(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
builder.requiredField(offset, 6); // request
|
||||
builder.requiredField(offset, 8); // response
|
||||
return offset;
|
||||
}
|
||||
|
||||
unpack(): RPCCallT {
|
||||
return new RPCCallT(
|
||||
this.name(),
|
||||
this.request() !== null ? this.request()!.unpack() : null,
|
||||
this.response() !== null ? this.response()!.unpack() : null,
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
),
|
||||
this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
unpackTo(_o: RPCCallT): void {
|
||||
_o.name = this.name();
|
||||
_o.request = this.request() !== null ? this.request()!.unpack() : null;
|
||||
_o.response = this.response() !== null ? this.response()!.unpack() : null;
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
);
|
||||
_o.documentation = this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class RPCCallT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public name: string|Uint8Array|null = null,
|
||||
public request: Object_T|null = null,
|
||||
public response: Object_T|null = null,
|
||||
public attributes: (KeyValueT)[] = [],
|
||||
public documentation: (string)[] = []
|
||||
){}
|
||||
constructor(
|
||||
public name: string | Uint8Array | null = null,
|
||||
public request: Object_T | null = null,
|
||||
public response: Object_T | null = null,
|
||||
public attributes: KeyValueT[] = [],
|
||||
public documentation: string[] = [],
|
||||
) {}
|
||||
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = this.name !== null ? builder.createString(this.name!) : 0;
|
||||
const request = this.request !== null ? this.request!.pack(builder) : 0;
|
||||
const response = this.response !== null ? this.response!.pack(builder) : 0;
|
||||
const attributes = RPCCall.createAttributesVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.attributes),
|
||||
);
|
||||
const documentation = RPCCall.createDocumentationVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.documentation),
|
||||
);
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = (this.name !== null ? builder.createString(this.name!) : 0);
|
||||
const request = (this.request !== null ? this.request!.pack(builder) : 0);
|
||||
const response = (this.response !== null ? this.response!.pack(builder) : 0);
|
||||
const attributes = RPCCall.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = RPCCall.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
RPCCall.startRPCCall(builder);
|
||||
RPCCall.addName(builder, name);
|
||||
RPCCall.addRequest(builder, request);
|
||||
RPCCall.addResponse(builder, response);
|
||||
RPCCall.addAttributes(builder, attributes);
|
||||
RPCCall.addDocumentation(builder, documentation);
|
||||
|
||||
RPCCall.startRPCCall(builder);
|
||||
RPCCall.addName(builder, name);
|
||||
RPCCall.addRequest(builder, request);
|
||||
RPCCall.addResponse(builder, response);
|
||||
RPCCall.addAttributes(builder, attributes);
|
||||
RPCCall.addDocumentation(builder, documentation);
|
||||
|
||||
return RPCCall.endRPCCall(builder);
|
||||
}
|
||||
return RPCCall.endRPCCall(builder);
|
||||
}
|
||||
}
|
||||
|
||||
92
tests/ts/reflection/schema-file.d.ts
vendored
92
tests/ts/reflection/schema-file.d.ts
vendored
@@ -4,37 +4,67 @@ import * as flatbuffers from 'flatbuffers';
|
||||
* Symbols declared within a file may be recovered by iterating over all
|
||||
* symbols and examining the `declaration_file` field.
|
||||
*/
|
||||
export declare class SchemaFile implements flatbuffers.IUnpackableObject<SchemaFileT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): SchemaFile;
|
||||
static getRootAsSchemaFile(bb: flatbuffers.ByteBuffer, obj?: SchemaFile): SchemaFile;
|
||||
static getSizePrefixedRootAsSchemaFile(bb: flatbuffers.ByteBuffer, obj?: SchemaFile): SchemaFile;
|
||||
/**
|
||||
* Filename, relative to project root.
|
||||
*/
|
||||
filename(): string | null;
|
||||
filename(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
/**
|
||||
* Names of included files, relative to project root.
|
||||
*/
|
||||
includedFilenames(index: number): string;
|
||||
includedFilenames(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
|
||||
includedFilenamesLength(): number;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startSchemaFile(builder: flatbuffers.Builder): void;
|
||||
static addFilename(builder: flatbuffers.Builder, filenameOffset: flatbuffers.Offset): void;
|
||||
static addIncludedFilenames(builder: flatbuffers.Builder, includedFilenamesOffset: flatbuffers.Offset): void;
|
||||
static createIncludedFilenamesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startIncludedFilenamesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static endSchemaFile(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createSchemaFile(builder: flatbuffers.Builder, filenameOffset: flatbuffers.Offset, includedFilenamesOffset: flatbuffers.Offset): flatbuffers.Offset;
|
||||
unpack(): SchemaFileT;
|
||||
unpackTo(_o: SchemaFileT): void;
|
||||
export declare class SchemaFile
|
||||
implements flatbuffers.IUnpackableObject<SchemaFileT>
|
||||
{
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): SchemaFile;
|
||||
static getRootAsSchemaFile(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: SchemaFile,
|
||||
): SchemaFile;
|
||||
static getSizePrefixedRootAsSchemaFile(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: SchemaFile,
|
||||
): SchemaFile;
|
||||
/**
|
||||
* Filename, relative to project root.
|
||||
*/
|
||||
filename(): string | null;
|
||||
filename(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
/**
|
||||
* Names of included files, relative to project root.
|
||||
*/
|
||||
includedFilenames(index: number): string;
|
||||
includedFilenames(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
includedFilenamesLength(): number;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startSchemaFile(builder: flatbuffers.Builder): void;
|
||||
static addFilename(
|
||||
builder: flatbuffers.Builder,
|
||||
filenameOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addIncludedFilenames(
|
||||
builder: flatbuffers.Builder,
|
||||
includedFilenamesOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createIncludedFilenamesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startIncludedFilenamesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static endSchemaFile(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createSchemaFile(
|
||||
builder: flatbuffers.Builder,
|
||||
filenameOffset: flatbuffers.Offset,
|
||||
includedFilenamesOffset: flatbuffers.Offset,
|
||||
): flatbuffers.Offset;
|
||||
unpack(): SchemaFileT;
|
||||
unpackTo(_o: SchemaFileT): void;
|
||||
}
|
||||
export declare class SchemaFileT implements flatbuffers.IGeneratedObject {
|
||||
filename: string | Uint8Array | null;
|
||||
includedFilenames: (string)[];
|
||||
constructor(filename?: string | Uint8Array | null, includedFilenames?: (string)[]);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
filename: string | Uint8Array | null;
|
||||
includedFilenames: string[];
|
||||
constructor(
|
||||
filename?: string | Uint8Array | null,
|
||||
includedFilenames?: string[],
|
||||
);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// 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 */
|
||||
/* 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.
|
||||
@@ -7,83 +8,95 @@ import * as flatbuffers from 'flatbuffers';
|
||||
* symbols and examining the `declaration_file` field.
|
||||
*/
|
||||
export class SchemaFile {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsSchemaFile(bb, obj) {
|
||||
return (obj || new SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsSchemaFile(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
filename(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
includedFilenames(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
includedFilenamesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.SchemaFile';
|
||||
}
|
||||
static startSchemaFile(builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
static addFilename(builder, filenameOffset) {
|
||||
builder.addFieldOffset(0, filenameOffset, 0);
|
||||
}
|
||||
static addIncludedFilenames(builder, includedFilenamesOffset) {
|
||||
builder.addFieldOffset(1, includedFilenamesOffset, 0);
|
||||
}
|
||||
static createIncludedFilenamesVector(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 startIncludedFilenamesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static endSchemaFile(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // filename
|
||||
return offset;
|
||||
}
|
||||
static createSchemaFile(builder, filenameOffset, includedFilenamesOffset) {
|
||||
SchemaFile.startSchemaFile(builder);
|
||||
SchemaFile.addFilename(builder, filenameOffset);
|
||||
SchemaFile.addIncludedFilenames(builder, includedFilenamesOffset);
|
||||
return SchemaFile.endSchemaFile(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new SchemaFileT(this.filename(), this.bb.createScalarList(this.includedFilenames.bind(this), this.includedFilenamesLength()));
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.filename = this.filename();
|
||||
_o.includedFilenames = this.bb.createScalarList(this.includedFilenames.bind(this), this.includedFilenamesLength());
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsSchemaFile(bb, obj) {
|
||||
return (obj || new SchemaFile())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsSchemaFile(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new SchemaFile())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
filename(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
includedFilenames(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__string(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
includedFilenamesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.SchemaFile';
|
||||
}
|
||||
static startSchemaFile(builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
static addFilename(builder, filenameOffset) {
|
||||
builder.addFieldOffset(0, filenameOffset, 0);
|
||||
}
|
||||
static addIncludedFilenames(builder, includedFilenamesOffset) {
|
||||
builder.addFieldOffset(1, includedFilenamesOffset, 0);
|
||||
}
|
||||
static createIncludedFilenamesVector(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 startIncludedFilenamesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static endSchemaFile(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // filename
|
||||
return offset;
|
||||
}
|
||||
static createSchemaFile(builder, filenameOffset, includedFilenamesOffset) {
|
||||
SchemaFile.startSchemaFile(builder);
|
||||
SchemaFile.addFilename(builder, filenameOffset);
|
||||
SchemaFile.addIncludedFilenames(builder, includedFilenamesOffset);
|
||||
return SchemaFile.endSchemaFile(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new SchemaFileT(
|
||||
this.filename(),
|
||||
this.bb.createScalarList(
|
||||
this.includedFilenames.bind(this), this.includedFilenamesLength()));
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.filename = this.filename();
|
||||
_o.includedFilenames = this.bb.createScalarList(
|
||||
this.includedFilenames.bind(this), this.includedFilenamesLength());
|
||||
}
|
||||
}
|
||||
export class SchemaFileT {
|
||||
constructor(filename = null, includedFilenames = []) {
|
||||
this.filename = filename;
|
||||
this.includedFilenames = includedFilenames;
|
||||
}
|
||||
pack(builder) {
|
||||
const filename = (this.filename !== null ? builder.createString(this.filename) : 0);
|
||||
const includedFilenames = SchemaFile.createIncludedFilenamesVector(builder, builder.createObjectOffsetList(this.includedFilenames));
|
||||
return SchemaFile.createSchemaFile(builder, filename, includedFilenames);
|
||||
}
|
||||
constructor(filename = null, includedFilenames = []) {
|
||||
this.filename = filename;
|
||||
this.includedFilenames = includedFilenames;
|
||||
}
|
||||
pack(builder) {
|
||||
const filename =
|
||||
(this.filename !== null ? builder.createString(this.filename) : 0);
|
||||
const includedFilenames = SchemaFile.createIncludedFilenamesVector(
|
||||
builder, builder.createObjectOffsetList(this.includedFilenames));
|
||||
return SchemaFile.createSchemaFile(builder, filename, includedFilenames);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,125 +4,169 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* File specific information.
|
||||
* Symbols declared within a file may be recovered by iterating over all
|
||||
* symbols and examining the `declaration_file` field.
|
||||
*/
|
||||
export class SchemaFile implements flatbuffers.IUnpackableObject<SchemaFileT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):SchemaFile {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsSchemaFile(bb:flatbuffers.ByteBuffer, obj?:SchemaFile):SchemaFile {
|
||||
return (obj || new SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsSchemaFile(bb:flatbuffers.ByteBuffer, obj?:SchemaFile):SchemaFile {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filename, relative to project root.
|
||||
*/
|
||||
filename():string|null
|
||||
filename(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
filename(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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Names of included files, relative to project root.
|
||||
*/
|
||||
includedFilenames(index: number):string
|
||||
includedFilenames(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
|
||||
includedFilenames(index: number,optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
includedFilenamesLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.SchemaFile';
|
||||
}
|
||||
|
||||
static startSchemaFile(builder:flatbuffers.Builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
|
||||
static addFilename(builder:flatbuffers.Builder, filenameOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, filenameOffset, 0);
|
||||
}
|
||||
|
||||
static addIncludedFilenames(builder:flatbuffers.Builder, includedFilenamesOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(1, includedFilenamesOffset, 0);
|
||||
}
|
||||
|
||||
static createIncludedFilenamesVector(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]!);
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): SchemaFile {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startIncludedFilenamesVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static getRootAsSchemaFile(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: SchemaFile,
|
||||
): SchemaFile {
|
||||
return (obj || new SchemaFile()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
static endSchemaFile(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // filename
|
||||
return offset;
|
||||
}
|
||||
static getSizePrefixedRootAsSchemaFile(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: SchemaFile,
|
||||
): SchemaFile {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new SchemaFile()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
static createSchemaFile(builder:flatbuffers.Builder, filenameOffset:flatbuffers.Offset, includedFilenamesOffset:flatbuffers.Offset):flatbuffers.Offset {
|
||||
SchemaFile.startSchemaFile(builder);
|
||||
SchemaFile.addFilename(builder, filenameOffset);
|
||||
SchemaFile.addIncludedFilenames(builder, includedFilenamesOffset);
|
||||
return SchemaFile.endSchemaFile(builder);
|
||||
}
|
||||
/**
|
||||
* Filename, relative to project root.
|
||||
*/
|
||||
filename(): string | null;
|
||||
filename(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
filename(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;
|
||||
}
|
||||
|
||||
unpack(): SchemaFileT {
|
||||
return new SchemaFileT(
|
||||
this.filename(),
|
||||
this.bb!.createScalarList<string>(this.includedFilenames.bind(this), this.includedFilenamesLength())
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Names of included files, relative to project root.
|
||||
*/
|
||||
includedFilenames(index: number): string;
|
||||
includedFilenames(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
includedFilenames(
|
||||
index: number,
|
||||
optionalEncoding?: any,
|
||||
): string | Uint8Array | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset
|
||||
? this.bb!.__string(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
includedFilenamesLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
unpackTo(_o: SchemaFileT): void {
|
||||
_o.filename = this.filename();
|
||||
_o.includedFilenames = this.bb!.createScalarList<string>(this.includedFilenames.bind(this), this.includedFilenamesLength());
|
||||
}
|
||||
static getFullyQualifiedName(): string {
|
||||
return 'reflection.SchemaFile';
|
||||
}
|
||||
|
||||
static startSchemaFile(builder: flatbuffers.Builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
|
||||
static addFilename(
|
||||
builder: flatbuffers.Builder,
|
||||
filenameOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(0, filenameOffset, 0);
|
||||
}
|
||||
|
||||
static addIncludedFilenames(
|
||||
builder: flatbuffers.Builder,
|
||||
includedFilenamesOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(1, includedFilenamesOffset, 0);
|
||||
}
|
||||
|
||||
static createIncludedFilenamesVector(
|
||||
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 startIncludedFilenamesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static endSchemaFile(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // filename
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createSchemaFile(
|
||||
builder: flatbuffers.Builder,
|
||||
filenameOffset: flatbuffers.Offset,
|
||||
includedFilenamesOffset: flatbuffers.Offset,
|
||||
): flatbuffers.Offset {
|
||||
SchemaFile.startSchemaFile(builder);
|
||||
SchemaFile.addFilename(builder, filenameOffset);
|
||||
SchemaFile.addIncludedFilenames(builder, includedFilenamesOffset);
|
||||
return SchemaFile.endSchemaFile(builder);
|
||||
}
|
||||
|
||||
unpack(): SchemaFileT {
|
||||
return new SchemaFileT(
|
||||
this.filename(),
|
||||
this.bb!.createScalarList<string>(
|
||||
this.includedFilenames.bind(this),
|
||||
this.includedFilenamesLength(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
unpackTo(_o: SchemaFileT): void {
|
||||
_o.filename = this.filename();
|
||||
_o.includedFilenames = this.bb!.createScalarList<string>(
|
||||
this.includedFilenames.bind(this),
|
||||
this.includedFilenamesLength(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class SchemaFileT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public filename: string|Uint8Array|null = null,
|
||||
public includedFilenames: (string)[] = []
|
||||
){}
|
||||
constructor(
|
||||
public filename: string | Uint8Array | null = null,
|
||||
public includedFilenames: string[] = [],
|
||||
) {}
|
||||
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const filename =
|
||||
this.filename !== null ? builder.createString(this.filename!) : 0;
|
||||
const includedFilenames = SchemaFile.createIncludedFilenamesVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.includedFilenames),
|
||||
);
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const filename = (this.filename !== null ? builder.createString(this.filename!) : 0);
|
||||
const includedFilenames = SchemaFile.createIncludedFilenamesVector(builder, builder.createObjectOffsetList(this.includedFilenames));
|
||||
|
||||
return SchemaFile.createSchemaFile(builder,
|
||||
filename,
|
||||
includedFilenames
|
||||
);
|
||||
}
|
||||
return SchemaFile.createSchemaFile(builder, filename, includedFilenames);
|
||||
}
|
||||
}
|
||||
|
||||
187
tests/ts/reflection/schema.d.ts
vendored
187
tests/ts/reflection/schema.d.ts
vendored
@@ -1,67 +1,130 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { Enum, EnumT } from '../reflection/enum.js';
|
||||
import { Object_, Object_T } from '../reflection/object.js';
|
||||
import { SchemaFile, SchemaFileT } from '../reflection/schema-file.js';
|
||||
import { Service, ServiceT } from '../reflection/service.js';
|
||||
import {Enum, EnumT} from '../reflection/enum.js';
|
||||
import {Object_, Object_T} from '../reflection/object.js';
|
||||
import {SchemaFile, SchemaFileT} from '../reflection/schema-file.js';
|
||||
import {Service, ServiceT} from '../reflection/service.js';
|
||||
export declare class Schema implements flatbuffers.IUnpackableObject<SchemaT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Schema;
|
||||
static getRootAsSchema(bb: flatbuffers.ByteBuffer, obj?: Schema): Schema;
|
||||
static getSizePrefixedRootAsSchema(bb: flatbuffers.ByteBuffer, obj?: Schema): Schema;
|
||||
static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean;
|
||||
objects(index: number, obj?: Object_): Object_ | null;
|
||||
objectsLength(): number;
|
||||
enums(index: number, obj?: Enum): Enum | null;
|
||||
enumsLength(): number;
|
||||
fileIdent(): string | null;
|
||||
fileIdent(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
fileExt(): string | null;
|
||||
fileExt(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
rootTable(obj?: Object_): Object_ | null;
|
||||
services(index: number, obj?: Service): Service | null;
|
||||
servicesLength(): number;
|
||||
advancedFeatures(): bigint;
|
||||
mutate_advanced_features(value: bigint): boolean;
|
||||
/**
|
||||
* All the files used in this compilation. Files are relative to where
|
||||
* flatc was invoked.
|
||||
*/
|
||||
fbsFiles(index: number, obj?: SchemaFile): SchemaFile | null;
|
||||
fbsFilesLength(): number;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startSchema(builder: flatbuffers.Builder): void;
|
||||
static addObjects(builder: flatbuffers.Builder, objectsOffset: flatbuffers.Offset): void;
|
||||
static createObjectsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startObjectsVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addEnums(builder: flatbuffers.Builder, enumsOffset: flatbuffers.Offset): void;
|
||||
static createEnumsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startEnumsVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addFileIdent(builder: flatbuffers.Builder, fileIdentOffset: flatbuffers.Offset): void;
|
||||
static addFileExt(builder: flatbuffers.Builder, fileExtOffset: flatbuffers.Offset): void;
|
||||
static addRootTable(builder: flatbuffers.Builder, rootTableOffset: flatbuffers.Offset): void;
|
||||
static addServices(builder: flatbuffers.Builder, servicesOffset: flatbuffers.Offset): void;
|
||||
static createServicesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startServicesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addAdvancedFeatures(builder: flatbuffers.Builder, advancedFeatures: bigint): void;
|
||||
static addFbsFiles(builder: flatbuffers.Builder, fbsFilesOffset: flatbuffers.Offset): void;
|
||||
static createFbsFilesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startFbsFilesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static endSchema(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static finishSchemaBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||
static finishSizePrefixedSchemaBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||
unpack(): SchemaT;
|
||||
unpackTo(_o: SchemaT): void;
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Schema;
|
||||
static getRootAsSchema(bb: flatbuffers.ByteBuffer, obj?: Schema): Schema;
|
||||
static getSizePrefixedRootAsSchema(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Schema,
|
||||
): Schema;
|
||||
static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean;
|
||||
objects(index: number, obj?: Object_): Object_ | null;
|
||||
objectsLength(): number;
|
||||
enums(index: number, obj?: Enum): Enum | null;
|
||||
enumsLength(): number;
|
||||
fileIdent(): string | null;
|
||||
fileIdent(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
fileExt(): string | null;
|
||||
fileExt(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
rootTable(obj?: Object_): Object_ | null;
|
||||
services(index: number, obj?: Service): Service | null;
|
||||
servicesLength(): number;
|
||||
advancedFeatures(): bigint;
|
||||
mutate_advanced_features(value: bigint): boolean;
|
||||
/**
|
||||
* All the files used in this compilation. Files are relative to where
|
||||
* flatc was invoked.
|
||||
*/
|
||||
fbsFiles(index: number, obj?: SchemaFile): SchemaFile | null;
|
||||
fbsFilesLength(): number;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startSchema(builder: flatbuffers.Builder): void;
|
||||
static addObjects(
|
||||
builder: flatbuffers.Builder,
|
||||
objectsOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createObjectsVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startObjectsVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addEnums(
|
||||
builder: flatbuffers.Builder,
|
||||
enumsOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createEnumsVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startEnumsVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addFileIdent(
|
||||
builder: flatbuffers.Builder,
|
||||
fileIdentOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addFileExt(
|
||||
builder: flatbuffers.Builder,
|
||||
fileExtOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addRootTable(
|
||||
builder: flatbuffers.Builder,
|
||||
rootTableOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addServices(
|
||||
builder: flatbuffers.Builder,
|
||||
servicesOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createServicesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startServicesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addAdvancedFeatures(
|
||||
builder: flatbuffers.Builder,
|
||||
advancedFeatures: bigint,
|
||||
): void;
|
||||
static addFbsFiles(
|
||||
builder: flatbuffers.Builder,
|
||||
fbsFilesOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createFbsFilesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startFbsFilesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static endSchema(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static finishSchemaBuffer(
|
||||
builder: flatbuffers.Builder,
|
||||
offset: flatbuffers.Offset,
|
||||
): void;
|
||||
static finishSizePrefixedSchemaBuffer(
|
||||
builder: flatbuffers.Builder,
|
||||
offset: flatbuffers.Offset,
|
||||
): void;
|
||||
unpack(): SchemaT;
|
||||
unpackTo(_o: SchemaT): void;
|
||||
}
|
||||
export declare class SchemaT implements flatbuffers.IGeneratedObject {
|
||||
objects: (Object_T)[];
|
||||
enums: (EnumT)[];
|
||||
fileIdent: string | Uint8Array | null;
|
||||
fileExt: string | Uint8Array | null;
|
||||
rootTable: Object_T | null;
|
||||
services: (ServiceT)[];
|
||||
advancedFeatures: bigint;
|
||||
fbsFiles: (SchemaFileT)[];
|
||||
constructor(objects?: (Object_T)[], enums?: (EnumT)[], fileIdent?: string | Uint8Array | null, fileExt?: string | Uint8Array | null, rootTable?: Object_T | null, services?: (ServiceT)[], advancedFeatures?: bigint, fbsFiles?: (SchemaFileT)[]);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
objects: Object_T[];
|
||||
enums: EnumT[];
|
||||
fileIdent: string | Uint8Array | null;
|
||||
fileExt: string | Uint8Array | null;
|
||||
rootTable: Object_T | null;
|
||||
services: ServiceT[];
|
||||
advancedFeatures: bigint;
|
||||
fbsFiles: SchemaFileT[];
|
||||
constructor(
|
||||
objects?: Object_T[],
|
||||
enums?: EnumT[],
|
||||
fileIdent?: string | Uint8Array | null,
|
||||
fileExt?: string | Uint8Array | null,
|
||||
rootTable?: Object_T | null,
|
||||
services?: ServiceT[],
|
||||
advancedFeatures?: bigint,
|
||||
fbsFiles?: SchemaFileT[],
|
||||
);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,214 +1,269 @@
|
||||
// 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 */
|
||||
/* 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';
|
||||
import { SchemaFile } from '../reflection/schema-file.js';
|
||||
import { Service } from '../reflection/service.js';
|
||||
|
||||
import {Enum} from '../reflection/enum.js';
|
||||
import {Object_} from '../reflection/object.js';
|
||||
import {SchemaFile} from '../reflection/schema-file.js';
|
||||
import {Service} from '../reflection/service.js';
|
||||
|
||||
export class Schema {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsSchema(bb, obj) {
|
||||
return (obj || new Schema())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsSchema(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Schema())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static bufferHasIdentifier(bb) {
|
||||
return bb.__has_identifier('BFBS');
|
||||
}
|
||||
objects(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ?
|
||||
(obj || new Object_())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
objectsLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
enums(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ?
|
||||
(obj || new Enum())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
enumsLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
fileIdent(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
fileExt(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
rootTable(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ?
|
||||
(obj || new Object_())
|
||||
.__init(this.bb.__indirect(this.bb_pos + offset), this.bb) :
|
||||
null;
|
||||
}
|
||||
services(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ?
|
||||
(obj || new Service())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
servicesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
advancedFeatures() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
mutate_advanced_features(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
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;
|
||||
}
|
||||
fbsFilesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 18);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Schema';
|
||||
}
|
||||
static startSchema(builder) {
|
||||
builder.startObject(8);
|
||||
}
|
||||
static addObjects(builder, objectsOffset) {
|
||||
builder.addFieldOffset(0, objectsOffset, 0);
|
||||
}
|
||||
static createObjectsVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
static getRootAsSchema(bb, obj) {
|
||||
return (obj || new Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return builder.endVector();
|
||||
}
|
||||
static startObjectsVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addEnums(builder, enumsOffset) {
|
||||
builder.addFieldOffset(1, enumsOffset, 0);
|
||||
}
|
||||
static createEnumsVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
static getSizePrefixedRootAsSchema(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
return builder.endVector();
|
||||
}
|
||||
static startEnumsVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addFileIdent(builder, fileIdentOffset) {
|
||||
builder.addFieldOffset(2, fileIdentOffset, 0);
|
||||
}
|
||||
static addFileExt(builder, fileExtOffset) {
|
||||
builder.addFieldOffset(3, fileExtOffset, 0);
|
||||
}
|
||||
static addRootTable(builder, rootTableOffset) {
|
||||
builder.addFieldOffset(4, rootTableOffset, 0);
|
||||
}
|
||||
static addServices(builder, servicesOffset) {
|
||||
builder.addFieldOffset(5, servicesOffset, 0);
|
||||
}
|
||||
static createServicesVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
static bufferHasIdentifier(bb) {
|
||||
return bb.__has_identifier('BFBS');
|
||||
}
|
||||
objects(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? (obj || new Object_()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
objectsLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
enums(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new Enum()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
enumsLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
fileIdent(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
fileExt(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
rootTable(obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? (obj || new Object_()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
}
|
||||
services(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? (obj || new Service()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
servicesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
advancedFeatures() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
mutate_advanced_features(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 16);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
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;
|
||||
}
|
||||
fbsFilesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 18);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Schema';
|
||||
}
|
||||
static startSchema(builder) {
|
||||
builder.startObject(8);
|
||||
}
|
||||
static addObjects(builder, objectsOffset) {
|
||||
builder.addFieldOffset(0, objectsOffset, 0);
|
||||
}
|
||||
static createObjectsVector(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 startObjectsVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addEnums(builder, enumsOffset) {
|
||||
builder.addFieldOffset(1, enumsOffset, 0);
|
||||
}
|
||||
static createEnumsVector(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 startEnumsVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addFileIdent(builder, fileIdentOffset) {
|
||||
builder.addFieldOffset(2, fileIdentOffset, 0);
|
||||
}
|
||||
static addFileExt(builder, fileExtOffset) {
|
||||
builder.addFieldOffset(3, fileExtOffset, 0);
|
||||
}
|
||||
static addRootTable(builder, rootTableOffset) {
|
||||
builder.addFieldOffset(4, rootTableOffset, 0);
|
||||
}
|
||||
static addServices(builder, servicesOffset) {
|
||||
builder.addFieldOffset(5, servicesOffset, 0);
|
||||
}
|
||||
static createServicesVector(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 startServicesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addAdvancedFeatures(builder, advancedFeatures) {
|
||||
builder.addFieldInt64(6, advancedFeatures, BigInt('0'));
|
||||
}
|
||||
static addFbsFiles(builder, fbsFilesOffset) {
|
||||
builder.addFieldOffset(7, fbsFilesOffset, 0);
|
||||
}
|
||||
static createFbsFilesVector(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 startFbsFilesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static endSchema(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // objects
|
||||
builder.requiredField(offset, 6); // enums
|
||||
return offset;
|
||||
}
|
||||
static finishSchemaBuffer(builder, offset) {
|
||||
builder.finish(offset, 'BFBS');
|
||||
}
|
||||
static finishSizePrefixedSchemaBuffer(builder, offset) {
|
||||
builder.finish(offset, 'BFBS', true);
|
||||
}
|
||||
unpack() {
|
||||
return new SchemaT(this.bb.createObjList(this.objects.bind(this), this.objectsLength()), this.bb.createObjList(this.enums.bind(this), this.enumsLength()), this.fileIdent(), this.fileExt(), (this.rootTable() !== null ? this.rootTable().unpack() : null), this.bb.createObjList(this.services.bind(this), this.servicesLength()), this.advancedFeatures(), this.bb.createObjList(this.fbsFiles.bind(this), this.fbsFilesLength()));
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.objects = this.bb.createObjList(this.objects.bind(this), this.objectsLength());
|
||||
_o.enums = this.bb.createObjList(this.enums.bind(this), this.enumsLength());
|
||||
_o.fileIdent = this.fileIdent();
|
||||
_o.fileExt = this.fileExt();
|
||||
_o.rootTable = (this.rootTable() !== null ? this.rootTable().unpack() : null);
|
||||
_o.services = this.bb.createObjList(this.services.bind(this), this.servicesLength());
|
||||
_o.advancedFeatures = this.advancedFeatures();
|
||||
_o.fbsFiles = this.bb.createObjList(this.fbsFiles.bind(this), this.fbsFilesLength());
|
||||
return builder.endVector();
|
||||
}
|
||||
static startServicesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addAdvancedFeatures(builder, advancedFeatures) {
|
||||
builder.addFieldInt64(6, advancedFeatures, BigInt('0'));
|
||||
}
|
||||
static addFbsFiles(builder, fbsFilesOffset) {
|
||||
builder.addFieldOffset(7, fbsFilesOffset, 0);
|
||||
}
|
||||
static createFbsFilesVector(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 startFbsFilesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static endSchema(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // objects
|
||||
builder.requiredField(offset, 6); // enums
|
||||
return offset;
|
||||
}
|
||||
static finishSchemaBuffer(builder, offset) {
|
||||
builder.finish(offset, 'BFBS');
|
||||
}
|
||||
static finishSizePrefixedSchemaBuffer(builder, offset) {
|
||||
builder.finish(offset, 'BFBS', true);
|
||||
}
|
||||
unpack() {
|
||||
return new SchemaT(
|
||||
this.bb.createObjList(this.objects.bind(this), this.objectsLength()),
|
||||
this.bb.createObjList(this.enums.bind(this), this.enumsLength()),
|
||||
this.fileIdent(), this.fileExt(),
|
||||
(this.rootTable() !== null ? this.rootTable().unpack() : null),
|
||||
this.bb.createObjList(this.services.bind(this), this.servicesLength()),
|
||||
this.advancedFeatures(),
|
||||
this.bb.createObjList(this.fbsFiles.bind(this), this.fbsFilesLength()));
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.objects =
|
||||
this.bb.createObjList(this.objects.bind(this), this.objectsLength());
|
||||
_o.enums = this.bb.createObjList(this.enums.bind(this), this.enumsLength());
|
||||
_o.fileIdent = this.fileIdent();
|
||||
_o.fileExt = this.fileExt();
|
||||
_o.rootTable =
|
||||
(this.rootTable() !== null ? this.rootTable().unpack() : null);
|
||||
_o.services =
|
||||
this.bb.createObjList(this.services.bind(this), this.servicesLength());
|
||||
_o.advancedFeatures = this.advancedFeatures();
|
||||
_o.fbsFiles =
|
||||
this.bb.createObjList(this.fbsFiles.bind(this), this.fbsFilesLength());
|
||||
}
|
||||
}
|
||||
export class SchemaT {
|
||||
constructor(objects = [], enums = [], fileIdent = null, fileExt = null, rootTable = null, services = [], advancedFeatures = BigInt('0'), fbsFiles = []) {
|
||||
this.objects = objects;
|
||||
this.enums = enums;
|
||||
this.fileIdent = fileIdent;
|
||||
this.fileExt = fileExt;
|
||||
this.rootTable = rootTable;
|
||||
this.services = services;
|
||||
this.advancedFeatures = advancedFeatures;
|
||||
this.fbsFiles = fbsFiles;
|
||||
}
|
||||
pack(builder) {
|
||||
const objects = Schema.createObjectsVector(builder, builder.createObjectOffsetList(this.objects));
|
||||
const enums = Schema.createEnumsVector(builder, builder.createObjectOffsetList(this.enums));
|
||||
const fileIdent = (this.fileIdent !== null ? builder.createString(this.fileIdent) : 0);
|
||||
const fileExt = (this.fileExt !== null ? builder.createString(this.fileExt) : 0);
|
||||
const rootTable = (this.rootTable !== null ? this.rootTable.pack(builder) : 0);
|
||||
const services = Schema.createServicesVector(builder, builder.createObjectOffsetList(this.services));
|
||||
const fbsFiles = Schema.createFbsFilesVector(builder, builder.createObjectOffsetList(this.fbsFiles));
|
||||
Schema.startSchema(builder);
|
||||
Schema.addObjects(builder, objects);
|
||||
Schema.addEnums(builder, enums);
|
||||
Schema.addFileIdent(builder, fileIdent);
|
||||
Schema.addFileExt(builder, fileExt);
|
||||
Schema.addRootTable(builder, rootTable);
|
||||
Schema.addServices(builder, services);
|
||||
Schema.addAdvancedFeatures(builder, this.advancedFeatures);
|
||||
Schema.addFbsFiles(builder, fbsFiles);
|
||||
return Schema.endSchema(builder);
|
||||
}
|
||||
constructor(
|
||||
objects = [], enums = [], fileIdent = null, fileExt = null,
|
||||
rootTable = null, services = [], advancedFeatures = BigInt('0'),
|
||||
fbsFiles = []) {
|
||||
this.objects = objects;
|
||||
this.enums = enums;
|
||||
this.fileIdent = fileIdent;
|
||||
this.fileExt = fileExt;
|
||||
this.rootTable = rootTable;
|
||||
this.services = services;
|
||||
this.advancedFeatures = advancedFeatures;
|
||||
this.fbsFiles = fbsFiles;
|
||||
}
|
||||
pack(builder) {
|
||||
const objects = Schema.createObjectsVector(
|
||||
builder, builder.createObjectOffsetList(this.objects));
|
||||
const enums = Schema.createEnumsVector(
|
||||
builder, builder.createObjectOffsetList(this.enums));
|
||||
const fileIdent =
|
||||
(this.fileIdent !== null ? builder.createString(this.fileIdent) : 0);
|
||||
const fileExt =
|
||||
(this.fileExt !== null ? builder.createString(this.fileExt) : 0);
|
||||
const rootTable =
|
||||
(this.rootTable !== null ? this.rootTable.pack(builder) : 0);
|
||||
const services = Schema.createServicesVector(
|
||||
builder, builder.createObjectOffsetList(this.services));
|
||||
const fbsFiles = Schema.createFbsFilesVector(
|
||||
builder, builder.createObjectOffsetList(this.fbsFiles));
|
||||
Schema.startSchema(builder);
|
||||
Schema.addObjects(builder, objects);
|
||||
Schema.addEnums(builder, enums);
|
||||
Schema.addFileIdent(builder, fileIdent);
|
||||
Schema.addFileExt(builder, fileExt);
|
||||
Schema.addRootTable(builder, rootTable);
|
||||
Schema.addServices(builder, services);
|
||||
Schema.addAdvancedFeatures(builder, this.advancedFeatures);
|
||||
Schema.addFbsFiles(builder, fbsFiles);
|
||||
return Schema.endSchema(builder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,275 +4,399 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Enum, EnumT } from '../reflection/enum.js';
|
||||
import { Object_, Object_T } from '../reflection/object.js';
|
||||
import { SchemaFile, SchemaFileT } from '../reflection/schema-file.js';
|
||||
import { Service, ServiceT } from '../reflection/service.js';
|
||||
|
||||
import {Enum, EnumT} from '../reflection/enum.js';
|
||||
import {Object_, Object_T} from '../reflection/object.js';
|
||||
import {SchemaFile, SchemaFileT} from '../reflection/schema-file.js';
|
||||
import {Service, ServiceT} from '../reflection/service.js';
|
||||
|
||||
export class Schema implements flatbuffers.IUnpackableObject<SchemaT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Schema {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsSchema(bb:flatbuffers.ByteBuffer, obj?:Schema):Schema {
|
||||
return (obj || new Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsSchema(bb:flatbuffers.ByteBuffer, obj?:Schema):Schema {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean {
|
||||
return bb.__has_identifier('BFBS');
|
||||
}
|
||||
|
||||
objects(index: number, obj?:Object_):Object_|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? (obj || new Object_()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
objectsLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
enums(index: number, obj?:Enum):Enum|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new Enum()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
enumsLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
fileIdent():string|null
|
||||
fileIdent(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
fileIdent(optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
fileExt():string|null
|
||||
fileExt(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
fileExt(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;
|
||||
}
|
||||
|
||||
rootTable(obj?:Object_):Object_|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? (obj || new Object_()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
||||
}
|
||||
|
||||
services(index: number, obj?:Service):Service|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? (obj || new Service()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
servicesLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
advancedFeatures():bigint {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
|
||||
mutate_advanced_features(value:bigint):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Schema {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
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: number, obj?:SchemaFile):SchemaFile|null {
|
||||
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;
|
||||
}
|
||||
|
||||
fbsFilesLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 18);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.Schema';
|
||||
}
|
||||
|
||||
static startSchema(builder:flatbuffers.Builder) {
|
||||
builder.startObject(8);
|
||||
}
|
||||
|
||||
static addObjects(builder:flatbuffers.Builder, objectsOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, objectsOffset, 0);
|
||||
}
|
||||
|
||||
static createObjectsVector(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]!);
|
||||
static getRootAsSchema(bb: flatbuffers.ByteBuffer, obj?: Schema): Schema {
|
||||
return (obj || new Schema()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startObjectsVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addEnums(builder:flatbuffers.Builder, enumsOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(1, enumsOffset, 0);
|
||||
}
|
||||
|
||||
static createEnumsVector(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]!);
|
||||
static getSizePrefixedRootAsSchema(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Schema,
|
||||
): Schema {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Schema()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startEnumsVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addFileIdent(builder:flatbuffers.Builder, fileIdentOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(2, fileIdentOffset, 0);
|
||||
}
|
||||
|
||||
static addFileExt(builder:flatbuffers.Builder, fileExtOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(3, fileExtOffset, 0);
|
||||
}
|
||||
|
||||
static addRootTable(builder:flatbuffers.Builder, rootTableOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(4, rootTableOffset, 0);
|
||||
}
|
||||
|
||||
static addServices(builder:flatbuffers.Builder, servicesOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(5, servicesOffset, 0);
|
||||
}
|
||||
|
||||
static createServicesVector(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]!);
|
||||
static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean {
|
||||
return bb.__has_identifier('BFBS');
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startServicesVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addAdvancedFeatures(builder:flatbuffers.Builder, advancedFeatures:bigint) {
|
||||
builder.addFieldInt64(6, advancedFeatures, BigInt('0'));
|
||||
}
|
||||
|
||||
static addFbsFiles(builder:flatbuffers.Builder, fbsFilesOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(7, fbsFilesOffset, 0);
|
||||
}
|
||||
|
||||
static createFbsFilesVector(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]!);
|
||||
objects(index: number, obj?: Object_): Object_ | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset
|
||||
? (obj || new Object_()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startFbsFilesVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
objectsLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static endSchema(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // objects
|
||||
builder.requiredField(offset, 6) // enums
|
||||
return offset;
|
||||
}
|
||||
enums(index: number, obj?: Enum): Enum | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset
|
||||
? (obj || new Enum()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
static finishSchemaBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
|
||||
builder.finish(offset, 'BFBS');
|
||||
}
|
||||
enumsLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static finishSizePrefixedSchemaBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
|
||||
builder.finish(offset, 'BFBS', true);
|
||||
}
|
||||
fileIdent(): string | null;
|
||||
fileIdent(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
fileIdent(optionalEncoding?: any): string | Uint8Array | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset
|
||||
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
||||
: null;
|
||||
}
|
||||
|
||||
fileExt(): string | null;
|
||||
fileExt(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
fileExt(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;
|
||||
}
|
||||
|
||||
unpack(): SchemaT {
|
||||
return new SchemaT(
|
||||
this.bb!.createObjList<Object_, Object_T>(this.objects.bind(this), this.objectsLength()),
|
||||
this.bb!.createObjList<Enum, EnumT>(this.enums.bind(this), this.enumsLength()),
|
||||
this.fileIdent(),
|
||||
this.fileExt(),
|
||||
(this.rootTable() !== null ? this.rootTable()!.unpack() : null),
|
||||
this.bb!.createObjList<Service, ServiceT>(this.services.bind(this), this.servicesLength()),
|
||||
this.advancedFeatures(),
|
||||
this.bb!.createObjList<SchemaFile, SchemaFileT>(this.fbsFiles.bind(this), this.fbsFilesLength())
|
||||
);
|
||||
}
|
||||
rootTable(obj?: Object_): Object_ | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset
|
||||
? (obj || new Object_()).__init(
|
||||
this.bb!.__indirect(this.bb_pos + offset),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
services(index: number, obj?: Service): Service | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset
|
||||
? (obj || new Service()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
unpackTo(_o: SchemaT): void {
|
||||
_o.objects = this.bb!.createObjList<Object_, Object_T>(this.objects.bind(this), this.objectsLength());
|
||||
_o.enums = this.bb!.createObjList<Enum, EnumT>(this.enums.bind(this), this.enumsLength());
|
||||
_o.fileIdent = this.fileIdent();
|
||||
_o.fileExt = this.fileExt();
|
||||
_o.rootTable = (this.rootTable() !== null ? this.rootTable()!.unpack() : null);
|
||||
_o.services = this.bb!.createObjList<Service, ServiceT>(this.services.bind(this), this.servicesLength());
|
||||
_o.advancedFeatures = this.advancedFeatures();
|
||||
_o.fbsFiles = this.bb!.createObjList<SchemaFile, SchemaFileT>(this.fbsFiles.bind(this), this.fbsFilesLength());
|
||||
}
|
||||
servicesLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
advancedFeatures(): bigint {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
|
||||
mutate_advanced_features(value: bigint): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 16);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
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: number, obj?: SchemaFile): SchemaFile | null {
|
||||
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;
|
||||
}
|
||||
|
||||
fbsFilesLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 18);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName(): string {
|
||||
return 'reflection.Schema';
|
||||
}
|
||||
|
||||
static startSchema(builder: flatbuffers.Builder) {
|
||||
builder.startObject(8);
|
||||
}
|
||||
|
||||
static addObjects(
|
||||
builder: flatbuffers.Builder,
|
||||
objectsOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(0, objectsOffset, 0);
|
||||
}
|
||||
|
||||
static createObjectsVector(
|
||||
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 startObjectsVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addEnums(
|
||||
builder: flatbuffers.Builder,
|
||||
enumsOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(1, enumsOffset, 0);
|
||||
}
|
||||
|
||||
static createEnumsVector(
|
||||
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 startEnumsVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addFileIdent(
|
||||
builder: flatbuffers.Builder,
|
||||
fileIdentOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(2, fileIdentOffset, 0);
|
||||
}
|
||||
|
||||
static addFileExt(
|
||||
builder: flatbuffers.Builder,
|
||||
fileExtOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(3, fileExtOffset, 0);
|
||||
}
|
||||
|
||||
static addRootTable(
|
||||
builder: flatbuffers.Builder,
|
||||
rootTableOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(4, rootTableOffset, 0);
|
||||
}
|
||||
|
||||
static addServices(
|
||||
builder: flatbuffers.Builder,
|
||||
servicesOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(5, servicesOffset, 0);
|
||||
}
|
||||
|
||||
static createServicesVector(
|
||||
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 startServicesVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addAdvancedFeatures(
|
||||
builder: flatbuffers.Builder,
|
||||
advancedFeatures: bigint,
|
||||
) {
|
||||
builder.addFieldInt64(6, advancedFeatures, BigInt('0'));
|
||||
}
|
||||
|
||||
static addFbsFiles(
|
||||
builder: flatbuffers.Builder,
|
||||
fbsFilesOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(7, fbsFilesOffset, 0);
|
||||
}
|
||||
|
||||
static createFbsFilesVector(
|
||||
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 startFbsFilesVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static endSchema(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // objects
|
||||
builder.requiredField(offset, 6); // enums
|
||||
return offset;
|
||||
}
|
||||
|
||||
static finishSchemaBuffer(
|
||||
builder: flatbuffers.Builder,
|
||||
offset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.finish(offset, 'BFBS');
|
||||
}
|
||||
|
||||
static finishSizePrefixedSchemaBuffer(
|
||||
builder: flatbuffers.Builder,
|
||||
offset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.finish(offset, 'BFBS', true);
|
||||
}
|
||||
|
||||
unpack(): SchemaT {
|
||||
return new SchemaT(
|
||||
this.bb!.createObjList<Object_, Object_T>(
|
||||
this.objects.bind(this),
|
||||
this.objectsLength(),
|
||||
),
|
||||
this.bb!.createObjList<Enum, EnumT>(
|
||||
this.enums.bind(this),
|
||||
this.enumsLength(),
|
||||
),
|
||||
this.fileIdent(),
|
||||
this.fileExt(),
|
||||
this.rootTable() !== null ? this.rootTable()!.unpack() : null,
|
||||
this.bb!.createObjList<Service, ServiceT>(
|
||||
this.services.bind(this),
|
||||
this.servicesLength(),
|
||||
),
|
||||
this.advancedFeatures(),
|
||||
this.bb!.createObjList<SchemaFile, SchemaFileT>(
|
||||
this.fbsFiles.bind(this),
|
||||
this.fbsFilesLength(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
unpackTo(_o: SchemaT): void {
|
||||
_o.objects = this.bb!.createObjList<Object_, Object_T>(
|
||||
this.objects.bind(this),
|
||||
this.objectsLength(),
|
||||
);
|
||||
_o.enums = this.bb!.createObjList<Enum, EnumT>(
|
||||
this.enums.bind(this),
|
||||
this.enumsLength(),
|
||||
);
|
||||
_o.fileIdent = this.fileIdent();
|
||||
_o.fileExt = this.fileExt();
|
||||
_o.rootTable =
|
||||
this.rootTable() !== null ? this.rootTable()!.unpack() : null;
|
||||
_o.services = this.bb!.createObjList<Service, ServiceT>(
|
||||
this.services.bind(this),
|
||||
this.servicesLength(),
|
||||
);
|
||||
_o.advancedFeatures = this.advancedFeatures();
|
||||
_o.fbsFiles = this.bb!.createObjList<SchemaFile, SchemaFileT>(
|
||||
this.fbsFiles.bind(this),
|
||||
this.fbsFilesLength(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class SchemaT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public objects: (Object_T)[] = [],
|
||||
public enums: (EnumT)[] = [],
|
||||
public fileIdent: string|Uint8Array|null = null,
|
||||
public fileExt: string|Uint8Array|null = null,
|
||||
public rootTable: Object_T|null = null,
|
||||
public services: (ServiceT)[] = [],
|
||||
public advancedFeatures: bigint = BigInt('0'),
|
||||
public fbsFiles: (SchemaFileT)[] = []
|
||||
){}
|
||||
constructor(
|
||||
public objects: Object_T[] = [],
|
||||
public enums: EnumT[] = [],
|
||||
public fileIdent: string | Uint8Array | null = null,
|
||||
public fileExt: string | Uint8Array | null = null,
|
||||
public rootTable: Object_T | null = null,
|
||||
public services: ServiceT[] = [],
|
||||
public advancedFeatures: bigint = BigInt('0'),
|
||||
public fbsFiles: SchemaFileT[] = [],
|
||||
) {}
|
||||
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const objects = Schema.createObjectsVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.objects),
|
||||
);
|
||||
const enums = Schema.createEnumsVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.enums),
|
||||
);
|
||||
const fileIdent =
|
||||
this.fileIdent !== null ? builder.createString(this.fileIdent!) : 0;
|
||||
const fileExt =
|
||||
this.fileExt !== null ? builder.createString(this.fileExt!) : 0;
|
||||
const rootTable =
|
||||
this.rootTable !== null ? this.rootTable!.pack(builder) : 0;
|
||||
const services = Schema.createServicesVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.services),
|
||||
);
|
||||
const fbsFiles = Schema.createFbsFilesVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.fbsFiles),
|
||||
);
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const objects = Schema.createObjectsVector(builder, builder.createObjectOffsetList(this.objects));
|
||||
const enums = Schema.createEnumsVector(builder, builder.createObjectOffsetList(this.enums));
|
||||
const fileIdent = (this.fileIdent !== null ? builder.createString(this.fileIdent!) : 0);
|
||||
const fileExt = (this.fileExt !== null ? builder.createString(this.fileExt!) : 0);
|
||||
const rootTable = (this.rootTable !== null ? this.rootTable!.pack(builder) : 0);
|
||||
const services = Schema.createServicesVector(builder, builder.createObjectOffsetList(this.services));
|
||||
const fbsFiles = Schema.createFbsFilesVector(builder, builder.createObjectOffsetList(this.fbsFiles));
|
||||
Schema.startSchema(builder);
|
||||
Schema.addObjects(builder, objects);
|
||||
Schema.addEnums(builder, enums);
|
||||
Schema.addFileIdent(builder, fileIdent);
|
||||
Schema.addFileExt(builder, fileExt);
|
||||
Schema.addRootTable(builder, rootTable);
|
||||
Schema.addServices(builder, services);
|
||||
Schema.addAdvancedFeatures(builder, this.advancedFeatures);
|
||||
Schema.addFbsFiles(builder, fbsFiles);
|
||||
|
||||
Schema.startSchema(builder);
|
||||
Schema.addObjects(builder, objects);
|
||||
Schema.addEnums(builder, enums);
|
||||
Schema.addFileIdent(builder, fileIdent);
|
||||
Schema.addFileExt(builder, fileExt);
|
||||
Schema.addRootTable(builder, rootTable);
|
||||
Schema.addServices(builder, services);
|
||||
Schema.addAdvancedFeatures(builder, this.advancedFeatures);
|
||||
Schema.addFbsFiles(builder, fbsFiles);
|
||||
|
||||
return Schema.endSchema(builder);
|
||||
}
|
||||
return Schema.endSchema(builder);
|
||||
}
|
||||
}
|
||||
|
||||
145
tests/ts/reflection/service.d.ts
vendored
145
tests/ts/reflection/service.d.ts
vendored
@@ -1,50 +1,103 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
import { RPCCall, RPCCallT } from '../reflection/rpccall.js';
|
||||
export declare class Service implements flatbuffers.IUnpackableObject<ServiceT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Service;
|
||||
static getRootAsService(bb: flatbuffers.ByteBuffer, obj?: Service): Service;
|
||||
static getSizePrefixedRootAsService(bb: flatbuffers.ByteBuffer, obj?: Service): Service;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
calls(index: number, obj?: RPCCall): RPCCall | null;
|
||||
callsLength(): number;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
documentation(index: number): string;
|
||||
documentation(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
/**
|
||||
* File that this Service is declared in.
|
||||
*/
|
||||
declarationFile(): string | null;
|
||||
declarationFile(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startService(builder: flatbuffers.Builder): void;
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
|
||||
static addCalls(builder: flatbuffers.Builder, callsOffset: flatbuffers.Offset): void;
|
||||
static createCallsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startCallsVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addAttributes(builder: flatbuffers.Builder, attributesOffset: flatbuffers.Offset): void;
|
||||
static createAttributesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startAttributesVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addDocumentation(builder: flatbuffers.Builder, documentationOffset: flatbuffers.Offset): void;
|
||||
static createDocumentationVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
|
||||
static startDocumentationVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addDeclarationFile(builder: flatbuffers.Builder, declarationFileOffset: flatbuffers.Offset): void;
|
||||
static endService(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createService(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset, callsOffset: flatbuffers.Offset, attributesOffset: flatbuffers.Offset, documentationOffset: flatbuffers.Offset, declarationFileOffset: flatbuffers.Offset): flatbuffers.Offset;
|
||||
unpack(): ServiceT;
|
||||
unpackTo(_o: ServiceT): void;
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
import {RPCCall, RPCCallT} from '../reflection/rpccall.js';
|
||||
export declare class Service
|
||||
implements flatbuffers.IUnpackableObject<ServiceT>
|
||||
{
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Service;
|
||||
static getRootAsService(bb: flatbuffers.ByteBuffer, obj?: Service): Service;
|
||||
static getSizePrefixedRootAsService(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Service,
|
||||
): Service;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
calls(index: number, obj?: RPCCall): RPCCall | null;
|
||||
callsLength(): number;
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null;
|
||||
attributesLength(): number;
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentationLength(): number;
|
||||
/**
|
||||
* File that this Service is declared in.
|
||||
*/
|
||||
declarationFile(): string | null;
|
||||
declarationFile(
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array | null;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startService(builder: flatbuffers.Builder): void;
|
||||
static addName(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addCalls(
|
||||
builder: flatbuffers.Builder,
|
||||
callsOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createCallsVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startCallsVector(builder: flatbuffers.Builder, numElems: number): void;
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startAttributesVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
data: flatbuffers.Offset[],
|
||||
): flatbuffers.Offset;
|
||||
static startDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
): void;
|
||||
static addDeclarationFile(
|
||||
builder: flatbuffers.Builder,
|
||||
declarationFileOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static endService(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createService(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
callsOffset: flatbuffers.Offset,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
declarationFileOffset: flatbuffers.Offset,
|
||||
): flatbuffers.Offset;
|
||||
unpack(): ServiceT;
|
||||
unpackTo(_o: ServiceT): void;
|
||||
}
|
||||
export declare class ServiceT implements flatbuffers.IGeneratedObject {
|
||||
name: string | Uint8Array | null;
|
||||
calls: (RPCCallT)[];
|
||||
attributes: (KeyValueT)[];
|
||||
documentation: (string)[];
|
||||
declarationFile: string | Uint8Array | null;
|
||||
constructor(name?: string | Uint8Array | null, calls?: (RPCCallT)[], attributes?: (KeyValueT)[], documentation?: (string)[], declarationFile?: string | Uint8Array | null);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
name: string | Uint8Array | null;
|
||||
calls: RPCCallT[];
|
||||
attributes: KeyValueT[];
|
||||
documentation: string[];
|
||||
declarationFile: string | Uint8Array | null;
|
||||
constructor(
|
||||
name?: string | Uint8Array | null,
|
||||
calls?: RPCCallT[],
|
||||
attributes?: KeyValueT[],
|
||||
documentation?: string[],
|
||||
declarationFile?: string | Uint8Array | null,
|
||||
);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,147 +1,189 @@
|
||||
// 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 */
|
||||
/* 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';
|
||||
|
||||
import {KeyValue} from '../reflection/key-value.js';
|
||||
import {RPCCall} from '../reflection/rpccall.js';
|
||||
|
||||
export class Service {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsService(bb, obj) {
|
||||
return (obj || new Service())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsService(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Service())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
calls(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ?
|
||||
(obj || new RPCCall())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
callsLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ?
|
||||
(obj || new KeyValue())
|
||||
.__init(
|
||||
this.bb.__indirect(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4),
|
||||
this.bb) :
|
||||
null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
documentation(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__string(
|
||||
this.bb.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
declarationFile(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) :
|
||||
null;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Service';
|
||||
}
|
||||
static startService(builder) {
|
||||
builder.startObject(5);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addCalls(builder, callsOffset) {
|
||||
builder.addFieldOffset(1, callsOffset, 0);
|
||||
}
|
||||
static createCallsVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
return builder.endVector();
|
||||
}
|
||||
static startCallsVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(2, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(builder, data) {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]);
|
||||
}
|
||||
static getRootAsService(bb, obj) {
|
||||
return (obj || new Service()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsService(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Service()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
name(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
calls(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new RPCCall()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
callsLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
attributes(index, obj) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
|
||||
}
|
||||
attributesLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
documentation(index, optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
documentationLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
declarationFile(optionalEncoding) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Service';
|
||||
}
|
||||
static startService(builder) {
|
||||
builder.startObject(5);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addCalls(builder, callsOffset) {
|
||||
builder.addFieldOffset(1, callsOffset, 0);
|
||||
}
|
||||
static createCallsVector(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 startCallsVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addAttributes(builder, attributesOffset) {
|
||||
builder.addFieldOffset(2, attributesOffset, 0);
|
||||
}
|
||||
static createAttributesVector(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 startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(3, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(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 startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDeclarationFile(builder, declarationFileOffset) {
|
||||
builder.addFieldOffset(4, declarationFileOffset, 0);
|
||||
}
|
||||
static endService(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
return offset;
|
||||
}
|
||||
static createService(builder, nameOffset, callsOffset, attributesOffset, documentationOffset, declarationFileOffset) {
|
||||
Service.startService(builder);
|
||||
Service.addName(builder, nameOffset);
|
||||
Service.addCalls(builder, callsOffset);
|
||||
Service.addAttributes(builder, attributesOffset);
|
||||
Service.addDocumentation(builder, documentationOffset);
|
||||
Service.addDeclarationFile(builder, declarationFileOffset);
|
||||
return Service.endService(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new ServiceT(this.name(), this.bb.createObjList(this.calls.bind(this), this.callsLength()), this.bb.createObjList(this.attributes.bind(this), this.attributesLength()), this.bb.createScalarList(this.documentation.bind(this), this.documentationLength()), this.declarationFile());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.calls = this.bb.createObjList(this.calls.bind(this), this.callsLength());
|
||||
_o.attributes = this.bb.createObjList(this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb.createScalarList(this.documentation.bind(this), this.documentationLength());
|
||||
_o.declarationFile = this.declarationFile();
|
||||
return builder.endVector();
|
||||
}
|
||||
static startAttributesVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDocumentation(builder, documentationOffset) {
|
||||
builder.addFieldOffset(3, documentationOffset, 0);
|
||||
}
|
||||
static createDocumentationVector(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 startDocumentationVector(builder, numElems) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
static addDeclarationFile(builder, declarationFileOffset) {
|
||||
builder.addFieldOffset(4, declarationFileOffset, 0);
|
||||
}
|
||||
static endService(builder) {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
return offset;
|
||||
}
|
||||
static createService(
|
||||
builder, nameOffset, callsOffset, attributesOffset, documentationOffset,
|
||||
declarationFileOffset) {
|
||||
Service.startService(builder);
|
||||
Service.addName(builder, nameOffset);
|
||||
Service.addCalls(builder, callsOffset);
|
||||
Service.addAttributes(builder, attributesOffset);
|
||||
Service.addDocumentation(builder, documentationOffset);
|
||||
Service.addDeclarationFile(builder, declarationFileOffset);
|
||||
return Service.endService(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new ServiceT(
|
||||
this.name(),
|
||||
this.bb.createObjList(this.calls.bind(this), this.callsLength()),
|
||||
this.bb.createObjList(
|
||||
this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb.createScalarList(
|
||||
this.documentation.bind(this), this.documentationLength()),
|
||||
this.declarationFile());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.name = this.name();
|
||||
_o.calls = this.bb.createObjList(this.calls.bind(this), this.callsLength());
|
||||
_o.attributes = this.bb.createObjList(
|
||||
this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb.createScalarList(
|
||||
this.documentation.bind(this), this.documentationLength());
|
||||
_o.declarationFile = this.declarationFile();
|
||||
}
|
||||
}
|
||||
export class ServiceT {
|
||||
constructor(name = null, calls = [], attributes = [], documentation = [], declarationFile = null) {
|
||||
this.name = name;
|
||||
this.calls = calls;
|
||||
this.attributes = attributes;
|
||||
this.documentation = documentation;
|
||||
this.declarationFile = declarationFile;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const calls = Service.createCallsVector(builder, builder.createObjectOffsetList(this.calls));
|
||||
const attributes = Service.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Service.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
const declarationFile = (this.declarationFile !== null ? builder.createString(this.declarationFile) : 0);
|
||||
return Service.createService(builder, name, calls, attributes, documentation, declarationFile);
|
||||
}
|
||||
constructor(
|
||||
name = null, calls = [], attributes = [], documentation = [],
|
||||
declarationFile = null) {
|
||||
this.name = name;
|
||||
this.calls = calls;
|
||||
this.attributes = attributes;
|
||||
this.documentation = documentation;
|
||||
this.declarationFile = declarationFile;
|
||||
}
|
||||
pack(builder) {
|
||||
const name = (this.name !== null ? builder.createString(this.name) : 0);
|
||||
const calls = Service.createCallsVector(
|
||||
builder, builder.createObjectOffsetList(this.calls));
|
||||
const attributes = Service.createAttributesVector(
|
||||
builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Service.createDocumentationVector(
|
||||
builder, builder.createObjectOffsetList(this.documentation));
|
||||
const declarationFile =
|
||||
(this.declarationFile !== null ?
|
||||
builder.createString(this.declarationFile) :
|
||||
0);
|
||||
return Service.createService(
|
||||
builder, name, calls, attributes, documentation, declarationFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,200 +4,299 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { KeyValue, KeyValueT } from '../reflection/key-value.js';
|
||||
import { RPCCall, RPCCallT } from '../reflection/rpccall.js';
|
||||
|
||||
import {KeyValue, KeyValueT} from '../reflection/key-value.js';
|
||||
import {RPCCall, RPCCallT} from '../reflection/rpccall.js';
|
||||
|
||||
export class Service implements flatbuffers.IUnpackableObject<ServiceT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Service {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsService(bb:flatbuffers.ByteBuffer, obj?:Service):Service {
|
||||
return (obj || new Service()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsService(bb:flatbuffers.ByteBuffer, obj?:Service):Service {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Service()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
name():string|null
|
||||
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
name(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;
|
||||
}
|
||||
|
||||
calls(index: number, obj?:RPCCall):RPCCall|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? (obj || new RPCCall()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
callsLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
attributes(index: number, obj?:KeyValue):KeyValue|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
attributesLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
documentation(index: number):string
|
||||
documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
|
||||
documentation(index: number,optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
documentationLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* File that this Service is declared in.
|
||||
*/
|
||||
declarationFile():string|null
|
||||
declarationFile(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
||||
declarationFile(optionalEncoding?:any):string|Uint8Array|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.Service';
|
||||
}
|
||||
|
||||
static startService(builder:flatbuffers.Builder) {
|
||||
builder.startObject(5);
|
||||
}
|
||||
|
||||
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addCalls(builder:flatbuffers.Builder, callsOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(1, callsOffset, 0);
|
||||
}
|
||||
|
||||
static createCallsVector(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]!);
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Service {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startCallsVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(2, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(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]!);
|
||||
static getRootAsService(bb: flatbuffers.ByteBuffer, obj?: Service): Service {
|
||||
return (obj || new Service()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startAttributesVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(3, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(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]!);
|
||||
static getSizePrefixedRootAsService(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Service,
|
||||
): Service {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Service()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
name(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;
|
||||
}
|
||||
|
||||
static addDeclarationFile(builder:flatbuffers.Builder, declarationFileOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(4, declarationFileOffset, 0);
|
||||
}
|
||||
calls(index: number, obj?: RPCCall): RPCCall | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset
|
||||
? (obj || new RPCCall()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
static endService(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // name
|
||||
return offset;
|
||||
}
|
||||
callsLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static createService(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset, callsOffset:flatbuffers.Offset, attributesOffset:flatbuffers.Offset, documentationOffset:flatbuffers.Offset, declarationFileOffset:flatbuffers.Offset):flatbuffers.Offset {
|
||||
Service.startService(builder);
|
||||
Service.addName(builder, nameOffset);
|
||||
Service.addCalls(builder, callsOffset);
|
||||
Service.addAttributes(builder, attributesOffset);
|
||||
Service.addDocumentation(builder, documentationOffset);
|
||||
Service.addDeclarationFile(builder, declarationFileOffset);
|
||||
return Service.endService(builder);
|
||||
}
|
||||
attributes(index: number, obj?: KeyValue): KeyValue | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset
|
||||
? (obj || new KeyValue()).__init(
|
||||
this.bb!.__indirect(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
),
|
||||
this.bb!,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
unpack(): ServiceT {
|
||||
return new ServiceT(
|
||||
this.name(),
|
||||
this.bb!.createObjList<RPCCall, RPCCallT>(this.calls.bind(this), this.callsLength()),
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength()),
|
||||
this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength()),
|
||||
this.declarationFile()
|
||||
);
|
||||
}
|
||||
attributesLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
documentation(index: number): string;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array;
|
||||
documentation(
|
||||
index: number,
|
||||
optionalEncoding?: any,
|
||||
): string | Uint8Array | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset
|
||||
? this.bb!.__string(
|
||||
this.bb!.__vector(this.bb_pos + offset) + index * 4,
|
||||
optionalEncoding,
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
unpackTo(_o: ServiceT): void {
|
||||
_o.name = this.name();
|
||||
_o.calls = this.bb!.createObjList<RPCCall, RPCCallT>(this.calls.bind(this), this.callsLength());
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(this.attributes.bind(this), this.attributesLength());
|
||||
_o.documentation = this.bb!.createScalarList<string>(this.documentation.bind(this), this.documentationLength());
|
||||
_o.declarationFile = this.declarationFile();
|
||||
}
|
||||
documentationLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* File that this Service is declared in.
|
||||
*/
|
||||
declarationFile(): string | null;
|
||||
declarationFile(
|
||||
optionalEncoding: flatbuffers.Encoding,
|
||||
): string | Uint8Array | null;
|
||||
declarationFile(optionalEncoding?: any): string | Uint8Array | null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset
|
||||
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
||||
: null;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName(): string {
|
||||
return 'reflection.Service';
|
||||
}
|
||||
|
||||
static startService(builder: flatbuffers.Builder) {
|
||||
builder.startObject(5);
|
||||
}
|
||||
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addCalls(
|
||||
builder: flatbuffers.Builder,
|
||||
callsOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(1, callsOffset, 0);
|
||||
}
|
||||
|
||||
static createCallsVector(
|
||||
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 startCallsVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addAttributes(
|
||||
builder: flatbuffers.Builder,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(2, attributesOffset, 0);
|
||||
}
|
||||
|
||||
static createAttributesVector(
|
||||
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 startAttributesVector(builder: flatbuffers.Builder, numElems: number) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDocumentation(
|
||||
builder: flatbuffers.Builder,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(3, documentationOffset, 0);
|
||||
}
|
||||
|
||||
static createDocumentationVector(
|
||||
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 startDocumentationVector(
|
||||
builder: flatbuffers.Builder,
|
||||
numElems: number,
|
||||
) {
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addDeclarationFile(
|
||||
builder: flatbuffers.Builder,
|
||||
declarationFileOffset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.addFieldOffset(4, declarationFileOffset, 0);
|
||||
}
|
||||
|
||||
static endService(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4); // name
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createService(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
callsOffset: flatbuffers.Offset,
|
||||
attributesOffset: flatbuffers.Offset,
|
||||
documentationOffset: flatbuffers.Offset,
|
||||
declarationFileOffset: flatbuffers.Offset,
|
||||
): flatbuffers.Offset {
|
||||
Service.startService(builder);
|
||||
Service.addName(builder, nameOffset);
|
||||
Service.addCalls(builder, callsOffset);
|
||||
Service.addAttributes(builder, attributesOffset);
|
||||
Service.addDocumentation(builder, documentationOffset);
|
||||
Service.addDeclarationFile(builder, declarationFileOffset);
|
||||
return Service.endService(builder);
|
||||
}
|
||||
|
||||
unpack(): ServiceT {
|
||||
return new ServiceT(
|
||||
this.name(),
|
||||
this.bb!.createObjList<RPCCall, RPCCallT>(
|
||||
this.calls.bind(this),
|
||||
this.callsLength(),
|
||||
),
|
||||
this.bb!.createObjList<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
),
|
||||
this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
),
|
||||
this.declarationFile(),
|
||||
);
|
||||
}
|
||||
|
||||
unpackTo(_o: ServiceT): void {
|
||||
_o.name = this.name();
|
||||
_o.calls = this.bb!.createObjList<RPCCall, RPCCallT>(
|
||||
this.calls.bind(this),
|
||||
this.callsLength(),
|
||||
);
|
||||
_o.attributes = this.bb!.createObjList<KeyValue, KeyValueT>(
|
||||
this.attributes.bind(this),
|
||||
this.attributesLength(),
|
||||
);
|
||||
_o.documentation = this.bb!.createScalarList<string>(
|
||||
this.documentation.bind(this),
|
||||
this.documentationLength(),
|
||||
);
|
||||
_o.declarationFile = this.declarationFile();
|
||||
}
|
||||
}
|
||||
|
||||
export class ServiceT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public name: string|Uint8Array|null = null,
|
||||
public calls: (RPCCallT)[] = [],
|
||||
public attributes: (KeyValueT)[] = [],
|
||||
public documentation: (string)[] = [],
|
||||
public declarationFile: string|Uint8Array|null = null
|
||||
){}
|
||||
constructor(
|
||||
public name: string | Uint8Array | null = null,
|
||||
public calls: RPCCallT[] = [],
|
||||
public attributes: KeyValueT[] = [],
|
||||
public documentation: string[] = [],
|
||||
public declarationFile: string | Uint8Array | null = null,
|
||||
) {}
|
||||
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = this.name !== null ? builder.createString(this.name!) : 0;
|
||||
const calls = Service.createCallsVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.calls),
|
||||
);
|
||||
const attributes = Service.createAttributesVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.attributes),
|
||||
);
|
||||
const documentation = Service.createDocumentationVector(
|
||||
builder,
|
||||
builder.createObjectOffsetList(this.documentation),
|
||||
);
|
||||
const declarationFile =
|
||||
this.declarationFile !== null
|
||||
? builder.createString(this.declarationFile!)
|
||||
: 0;
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = (this.name !== null ? builder.createString(this.name!) : 0);
|
||||
const calls = Service.createCallsVector(builder, builder.createObjectOffsetList(this.calls));
|
||||
const attributes = Service.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes));
|
||||
const documentation = Service.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation));
|
||||
const declarationFile = (this.declarationFile !== null ? builder.createString(this.declarationFile!) : 0);
|
||||
|
||||
return Service.createService(builder,
|
||||
name,
|
||||
calls,
|
||||
attributes,
|
||||
documentation,
|
||||
declarationFile
|
||||
);
|
||||
}
|
||||
return Service.createService(
|
||||
builder,
|
||||
name,
|
||||
calls,
|
||||
attributes,
|
||||
documentation,
|
||||
declarationFile,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
112
tests/ts/reflection/type.d.ts
vendored
112
tests/ts/reflection/type.d.ts
vendored
@@ -1,49 +1,73 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
import { BaseType } from '../reflection/base-type.js';
|
||||
import {BaseType} from '../reflection/base-type.js';
|
||||
export declare class Type implements flatbuffers.IUnpackableObject<TypeT> {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Type;
|
||||
static getRootAsType(bb: flatbuffers.ByteBuffer, obj?: Type): Type;
|
||||
static getSizePrefixedRootAsType(bb: flatbuffers.ByteBuffer, obj?: Type): Type;
|
||||
baseType(): BaseType;
|
||||
mutate_base_type(value: BaseType): boolean;
|
||||
element(): BaseType;
|
||||
mutate_element(value: BaseType): boolean;
|
||||
index(): number;
|
||||
mutate_index(value: number): boolean;
|
||||
fixedLength(): number;
|
||||
mutate_fixed_length(value: number): boolean;
|
||||
/**
|
||||
* The size (octets) of the `base_type` field.
|
||||
*/
|
||||
baseSize(): number;
|
||||
mutate_base_size(value: number): boolean;
|
||||
/**
|
||||
* The size (octets) of the `element` field, if present.
|
||||
*/
|
||||
elementSize(): number;
|
||||
mutate_element_size(value: number): boolean;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startType(builder: flatbuffers.Builder): void;
|
||||
static addBaseType(builder: flatbuffers.Builder, baseType: BaseType): void;
|
||||
static addElement(builder: flatbuffers.Builder, element: BaseType): void;
|
||||
static addIndex(builder: flatbuffers.Builder, index: number): void;
|
||||
static addFixedLength(builder: flatbuffers.Builder, fixedLength: number): void;
|
||||
static addBaseSize(builder: flatbuffers.Builder, baseSize: number): void;
|
||||
static addElementSize(builder: flatbuffers.Builder, elementSize: number): void;
|
||||
static endType(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createType(builder: flatbuffers.Builder, baseType: BaseType, element: BaseType, index: number, fixedLength: number, baseSize: number, elementSize: number): flatbuffers.Offset;
|
||||
unpack(): TypeT;
|
||||
unpackTo(_o: TypeT): void;
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Type;
|
||||
static getRootAsType(bb: flatbuffers.ByteBuffer, obj?: Type): Type;
|
||||
static getSizePrefixedRootAsType(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Type,
|
||||
): Type;
|
||||
baseType(): BaseType;
|
||||
mutate_base_type(value: BaseType): boolean;
|
||||
element(): BaseType;
|
||||
mutate_element(value: BaseType): boolean;
|
||||
index(): number;
|
||||
mutate_index(value: number): boolean;
|
||||
fixedLength(): number;
|
||||
mutate_fixed_length(value: number): boolean;
|
||||
/**
|
||||
* The size (octets) of the `base_type` field.
|
||||
*/
|
||||
baseSize(): number;
|
||||
mutate_base_size(value: number): boolean;
|
||||
/**
|
||||
* The size (octets) of the `element` field, if present.
|
||||
*/
|
||||
elementSize(): number;
|
||||
mutate_element_size(value: number): boolean;
|
||||
static getFullyQualifiedName(): string;
|
||||
static startType(builder: flatbuffers.Builder): void;
|
||||
static addBaseType(builder: flatbuffers.Builder, baseType: BaseType): void;
|
||||
static addElement(builder: flatbuffers.Builder, element: BaseType): void;
|
||||
static addIndex(builder: flatbuffers.Builder, index: number): void;
|
||||
static addFixedLength(
|
||||
builder: flatbuffers.Builder,
|
||||
fixedLength: number,
|
||||
): void;
|
||||
static addBaseSize(builder: flatbuffers.Builder, baseSize: number): void;
|
||||
static addElementSize(
|
||||
builder: flatbuffers.Builder,
|
||||
elementSize: number,
|
||||
): void;
|
||||
static endType(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static createType(
|
||||
builder: flatbuffers.Builder,
|
||||
baseType: BaseType,
|
||||
element: BaseType,
|
||||
index: number,
|
||||
fixedLength: number,
|
||||
baseSize: number,
|
||||
elementSize: number,
|
||||
): flatbuffers.Offset;
|
||||
unpack(): TypeT;
|
||||
unpackTo(_o: TypeT): void;
|
||||
}
|
||||
export declare class TypeT implements flatbuffers.IGeneratedObject {
|
||||
baseType: BaseType;
|
||||
element: BaseType;
|
||||
index: number;
|
||||
fixedLength: number;
|
||||
baseSize: number;
|
||||
elementSize: number;
|
||||
constructor(baseType?: BaseType, element?: BaseType, index?: number, fixedLength?: number, baseSize?: number, elementSize?: number);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
baseType: BaseType;
|
||||
element: BaseType;
|
||||
index: number;
|
||||
fixedLength: number;
|
||||
baseSize: number;
|
||||
elementSize: number;
|
||||
constructor(
|
||||
baseType?: BaseType,
|
||||
element?: BaseType,
|
||||
index?: number,
|
||||
fixedLength?: number,
|
||||
baseSize?: number,
|
||||
elementSize?: number,
|
||||
);
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,162 +1,174 @@
|
||||
// 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 */
|
||||
/* 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';
|
||||
|
||||
import {BaseType} from '../reflection/base-type.js';
|
||||
|
||||
export class Type {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsType(bb, obj) {
|
||||
return (obj || new Type())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsType(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Type())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
baseType() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt8(this.bb_pos + offset) : BaseType.None;
|
||||
}
|
||||
mutate_base_type(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
this.bb.writeInt8(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
element() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.readInt8(this.bb_pos + offset) : BaseType.None;
|
||||
}
|
||||
mutate_element(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
static getRootAsType(bb, obj) {
|
||||
return (obj || new Type()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
this.bb.writeInt8(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
index() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : -1;
|
||||
}
|
||||
mutate_index(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
static getSizePrefixedRootAsType(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Type()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
fixedLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_fixed_length(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
baseType() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt8(this.bb_pos + offset) : BaseType.None;
|
||||
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;
|
||||
}
|
||||
mutate_base_size(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
mutate_base_type(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;
|
||||
}
|
||||
element() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.readInt8(this.bb_pos + offset) : BaseType.None;
|
||||
}
|
||||
mutate_element(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt8(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
index() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : -1;
|
||||
}
|
||||
mutate_index(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 8);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
this.bb.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
fixedLength() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
mutate_fixed_length(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;
|
||||
}
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
mutate_base_size(value) {
|
||||
const offset = this.bb.__offset(this.bb_pos, 12);
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
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;
|
||||
}
|
||||
mutate_element_size(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;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Type';
|
||||
}
|
||||
static startType(builder) {
|
||||
builder.startObject(6);
|
||||
}
|
||||
static addBaseType(builder, baseType) {
|
||||
builder.addFieldInt8(0, baseType, BaseType.None);
|
||||
}
|
||||
static addElement(builder, element) {
|
||||
builder.addFieldInt8(1, element, BaseType.None);
|
||||
}
|
||||
static addIndex(builder, index) {
|
||||
builder.addFieldInt32(2, index, -1);
|
||||
}
|
||||
static addFixedLength(builder, fixedLength) {
|
||||
builder.addFieldInt16(3, fixedLength, 0);
|
||||
}
|
||||
static addBaseSize(builder, baseSize) {
|
||||
builder.addFieldInt32(4, baseSize, 4);
|
||||
}
|
||||
static addElementSize(builder, elementSize) {
|
||||
builder.addFieldInt32(5, elementSize, 0);
|
||||
}
|
||||
static endType(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static createType(builder, baseType, element, index, fixedLength, baseSize, elementSize) {
|
||||
Type.startType(builder);
|
||||
Type.addBaseType(builder, baseType);
|
||||
Type.addElement(builder, element);
|
||||
Type.addIndex(builder, index);
|
||||
Type.addFixedLength(builder, fixedLength);
|
||||
Type.addBaseSize(builder, baseSize);
|
||||
Type.addElementSize(builder, elementSize);
|
||||
return Type.endType(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new TypeT(this.baseType(), this.element(), this.index(), this.fixedLength(), this.baseSize(), this.elementSize());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.baseType = this.baseType();
|
||||
_o.element = this.element();
|
||||
_o.index = this.index();
|
||||
_o.fixedLength = this.fixedLength();
|
||||
_o.baseSize = this.baseSize();
|
||||
_o.elementSize = this.elementSize();
|
||||
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;
|
||||
}
|
||||
mutate_element_size(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;
|
||||
}
|
||||
static getFullyQualifiedName() {
|
||||
return 'reflection.Type';
|
||||
}
|
||||
static startType(builder) {
|
||||
builder.startObject(6);
|
||||
}
|
||||
static addBaseType(builder, baseType) {
|
||||
builder.addFieldInt8(0, baseType, BaseType.None);
|
||||
}
|
||||
static addElement(builder, element) {
|
||||
builder.addFieldInt8(1, element, BaseType.None);
|
||||
}
|
||||
static addIndex(builder, index) {
|
||||
builder.addFieldInt32(2, index, -1);
|
||||
}
|
||||
static addFixedLength(builder, fixedLength) {
|
||||
builder.addFieldInt16(3, fixedLength, 0);
|
||||
}
|
||||
static addBaseSize(builder, baseSize) {
|
||||
builder.addFieldInt32(4, baseSize, 4);
|
||||
}
|
||||
static addElementSize(builder, elementSize) {
|
||||
builder.addFieldInt32(5, elementSize, 0);
|
||||
}
|
||||
static endType(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static createType(
|
||||
builder, baseType, element, index, fixedLength, baseSize, elementSize) {
|
||||
Type.startType(builder);
|
||||
Type.addBaseType(builder, baseType);
|
||||
Type.addElement(builder, element);
|
||||
Type.addIndex(builder, index);
|
||||
Type.addFixedLength(builder, fixedLength);
|
||||
Type.addBaseSize(builder, baseSize);
|
||||
Type.addElementSize(builder, elementSize);
|
||||
return Type.endType(builder);
|
||||
}
|
||||
unpack() {
|
||||
return new TypeT(
|
||||
this.baseType(), this.element(), this.index(), this.fixedLength(),
|
||||
this.baseSize(), this.elementSize());
|
||||
}
|
||||
unpackTo(_o) {
|
||||
_o.baseType = this.baseType();
|
||||
_o.element = this.element();
|
||||
_o.index = this.index();
|
||||
_o.fixedLength = this.fixedLength();
|
||||
_o.baseSize = this.baseSize();
|
||||
_o.elementSize = this.elementSize();
|
||||
}
|
||||
}
|
||||
export class TypeT {
|
||||
constructor(baseType = BaseType.None, element = BaseType.None, index = -1, fixedLength = 0, baseSize = 4, elementSize = 0) {
|
||||
this.baseType = baseType;
|
||||
this.element = element;
|
||||
this.index = index;
|
||||
this.fixedLength = fixedLength;
|
||||
this.baseSize = baseSize;
|
||||
this.elementSize = elementSize;
|
||||
}
|
||||
pack(builder) {
|
||||
return Type.createType(builder, this.baseType, this.element, this.index, this.fixedLength, this.baseSize, this.elementSize);
|
||||
}
|
||||
constructor(
|
||||
baseType = BaseType.None, element = BaseType.None, index = -1,
|
||||
fixedLength = 0, baseSize = 4, elementSize = 0) {
|
||||
this.baseType = baseType;
|
||||
this.element = element;
|
||||
this.index = index;
|
||||
this.fixedLength = fixedLength;
|
||||
this.baseSize = baseSize;
|
||||
this.elementSize = elementSize;
|
||||
}
|
||||
pack(builder) {
|
||||
return Type.createType(
|
||||
builder, this.baseType, this.element, this.index, this.fixedLength,
|
||||
this.baseSize, this.elementSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,218 +4,233 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { BaseType } from '../reflection/base-type.js';
|
||||
|
||||
import {BaseType} from '../reflection/base-type.js';
|
||||
|
||||
export class Type implements flatbuffers.IUnpackableObject<TypeT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Type {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsType(bb:flatbuffers.ByteBuffer, obj?:Type):Type {
|
||||
return (obj || new Type()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsType(bb:flatbuffers.ByteBuffer, obj?:Type):Type {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Type()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
baseType():BaseType {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readInt8(this.bb_pos + offset) : BaseType.None;
|
||||
}
|
||||
|
||||
mutate_base_type(value:BaseType):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Type {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
element():BaseType {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readInt8(this.bb_pos + offset) : BaseType.None;
|
||||
}
|
||||
|
||||
mutate_element(value:BaseType):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
static getRootAsType(bb: flatbuffers.ByteBuffer, obj?: Type): Type {
|
||||
return (obj || new Type()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
this.bb!.writeInt8(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
index():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : -1;
|
||||
}
|
||||
|
||||
mutate_index(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
static getSizePrefixedRootAsType(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Type,
|
||||
): Type {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Type()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
fixedLength():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_fixed_length(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
baseType(): BaseType {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readInt8(this.bb_pos + offset) : BaseType.None;
|
||||
}
|
||||
|
||||
this.bb!.writeUint16(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
mutate_base_type(value: BaseType): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
|
||||
/**
|
||||
* The size (octets) of the `base_type` field.
|
||||
*/
|
||||
baseSize():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 4;
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mutate_base_size(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
this.bb!.writeInt8(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
this.bb!.writeUint32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The size (octets) of the `element` field, if present.
|
||||
*/
|
||||
elementSize():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_element_size(value:number):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
element(): BaseType {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readInt8(this.bb_pos + offset) : BaseType.None;
|
||||
}
|
||||
|
||||
this.bb!.writeUint32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
mutate_element(value: BaseType): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'reflection.Type';
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static startType(builder:flatbuffers.Builder) {
|
||||
builder.startObject(6);
|
||||
}
|
||||
this.bb!.writeInt8(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static addBaseType(builder:flatbuffers.Builder, baseType:BaseType) {
|
||||
builder.addFieldInt8(0, baseType, BaseType.None);
|
||||
}
|
||||
index(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : -1;
|
||||
}
|
||||
|
||||
static addElement(builder:flatbuffers.Builder, element:BaseType) {
|
||||
builder.addFieldInt8(1, element, BaseType.None);
|
||||
}
|
||||
mutate_index(value: number): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
|
||||
static addIndex(builder:flatbuffers.Builder, index:number) {
|
||||
builder.addFieldInt32(2, index, -1);
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static addFixedLength(builder:flatbuffers.Builder, fixedLength:number) {
|
||||
builder.addFieldInt16(3, fixedLength, 0);
|
||||
}
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static addBaseSize(builder:flatbuffers.Builder, baseSize:number) {
|
||||
builder.addFieldInt32(4, baseSize, 4);
|
||||
}
|
||||
fixedLength(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static addElementSize(builder:flatbuffers.Builder, elementSize:number) {
|
||||
builder.addFieldInt32(5, elementSize, 0);
|
||||
}
|
||||
mutate_fixed_length(value: number): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 10);
|
||||
|
||||
static endType(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static createType(builder:flatbuffers.Builder, baseType:BaseType, element:BaseType, index:number, fixedLength:number, baseSize:number, elementSize:number):flatbuffers.Offset {
|
||||
Type.startType(builder);
|
||||
Type.addBaseType(builder, baseType);
|
||||
Type.addElement(builder, element);
|
||||
Type.addIndex(builder, index);
|
||||
Type.addFixedLength(builder, fixedLength);
|
||||
Type.addBaseSize(builder, baseSize);
|
||||
Type.addElementSize(builder, elementSize);
|
||||
return Type.endType(builder);
|
||||
}
|
||||
this.bb!.writeUint16(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
unpack(): TypeT {
|
||||
return new TypeT(
|
||||
this.baseType(),
|
||||
this.element(),
|
||||
this.index(),
|
||||
this.fixedLength(),
|
||||
this.baseSize(),
|
||||
this.elementSize()
|
||||
);
|
||||
}
|
||||
/**
|
||||
* The size (octets) of the `base_type` field.
|
||||
*/
|
||||
baseSize(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 4;
|
||||
}
|
||||
|
||||
mutate_base_size(value: number): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 12);
|
||||
|
||||
unpackTo(_o: TypeT): void {
|
||||
_o.baseType = this.baseType();
|
||||
_o.element = this.element();
|
||||
_o.index = this.index();
|
||||
_o.fixedLength = this.fixedLength();
|
||||
_o.baseSize = this.baseSize();
|
||||
_o.elementSize = this.elementSize();
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bb!.writeUint32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The size (octets) of the `element` field, if present.
|
||||
*/
|
||||
elementSize(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 14);
|
||||
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
mutate_element_size(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;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName(): string {
|
||||
return 'reflection.Type';
|
||||
}
|
||||
|
||||
static startType(builder: flatbuffers.Builder) {
|
||||
builder.startObject(6);
|
||||
}
|
||||
|
||||
static addBaseType(builder: flatbuffers.Builder, baseType: BaseType) {
|
||||
builder.addFieldInt8(0, baseType, BaseType.None);
|
||||
}
|
||||
|
||||
static addElement(builder: flatbuffers.Builder, element: BaseType) {
|
||||
builder.addFieldInt8(1, element, BaseType.None);
|
||||
}
|
||||
|
||||
static addIndex(builder: flatbuffers.Builder, index: number) {
|
||||
builder.addFieldInt32(2, index, -1);
|
||||
}
|
||||
|
||||
static addFixedLength(builder: flatbuffers.Builder, fixedLength: number) {
|
||||
builder.addFieldInt16(3, fixedLength, 0);
|
||||
}
|
||||
|
||||
static addBaseSize(builder: flatbuffers.Builder, baseSize: number) {
|
||||
builder.addFieldInt32(4, baseSize, 4);
|
||||
}
|
||||
|
||||
static addElementSize(builder: flatbuffers.Builder, elementSize: number) {
|
||||
builder.addFieldInt32(5, elementSize, 0);
|
||||
}
|
||||
|
||||
static endType(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createType(
|
||||
builder: flatbuffers.Builder,
|
||||
baseType: BaseType,
|
||||
element: BaseType,
|
||||
index: number,
|
||||
fixedLength: number,
|
||||
baseSize: number,
|
||||
elementSize: number,
|
||||
): flatbuffers.Offset {
|
||||
Type.startType(builder);
|
||||
Type.addBaseType(builder, baseType);
|
||||
Type.addElement(builder, element);
|
||||
Type.addIndex(builder, index);
|
||||
Type.addFixedLength(builder, fixedLength);
|
||||
Type.addBaseSize(builder, baseSize);
|
||||
Type.addElementSize(builder, elementSize);
|
||||
return Type.endType(builder);
|
||||
}
|
||||
|
||||
unpack(): TypeT {
|
||||
return new TypeT(
|
||||
this.baseType(),
|
||||
this.element(),
|
||||
this.index(),
|
||||
this.fixedLength(),
|
||||
this.baseSize(),
|
||||
this.elementSize(),
|
||||
);
|
||||
}
|
||||
|
||||
unpackTo(_o: TypeT): void {
|
||||
_o.baseType = this.baseType();
|
||||
_o.element = this.element();
|
||||
_o.index = this.index();
|
||||
_o.fixedLength = this.fixedLength();
|
||||
_o.baseSize = this.baseSize();
|
||||
_o.elementSize = this.elementSize();
|
||||
}
|
||||
}
|
||||
|
||||
export class TypeT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public baseType: BaseType = BaseType.None,
|
||||
public element: BaseType = BaseType.None,
|
||||
public index: number = -1,
|
||||
public fixedLength: number = 0,
|
||||
public baseSize: number = 4,
|
||||
public elementSize: number = 0
|
||||
){}
|
||||
constructor(
|
||||
public baseType: BaseType = BaseType.None,
|
||||
public element: BaseType = BaseType.None,
|
||||
public index: number = -1,
|
||||
public fixedLength: number = 0,
|
||||
public baseSize: number = 4,
|
||||
public elementSize: number = 0,
|
||||
) {}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
return Type.createType(builder,
|
||||
this.baseType,
|
||||
this.element,
|
||||
this.index,
|
||||
this.fixedLength,
|
||||
this.baseSize,
|
||||
this.elementSize
|
||||
);
|
||||
}
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
return Type.createType(
|
||||
builder,
|
||||
this.baseType,
|
||||
this.element,
|
||||
this.index,
|
||||
this.fixedLength,
|
||||
this.baseSize,
|
||||
this.elementSize,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user