mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-20 15:45:05 +00:00
bulk code format fix (#8707)
This commit is contained in:
2
tests/ts/foobar/abc.d.ts
vendored
2
tests/ts/foobar/abc.d.ts
vendored
@@ -1,3 +1,3 @@
|
||||
export declare enum Abc {
|
||||
a = 0
|
||||
a = 0,
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any,
|
||||
* @typescript-eslint/no-non-null-assertion */
|
||||
export var Abc;
|
||||
(function (Abc) {
|
||||
Abc[Abc["a"] = 0] = "a";
|
||||
(function(Abc) {
|
||||
Abc[Abc['a'] = 0] = 'a';
|
||||
})(Abc || (Abc = {}));
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export enum Abc {
|
||||
a = 0
|
||||
a = 0,
|
||||
}
|
||||
|
||||
2
tests/ts/foobar/class.d.ts
vendored
2
tests/ts/foobar/class.d.ts
vendored
@@ -1,3 +1,3 @@
|
||||
export declare enum class_ {
|
||||
arguments_ = 0
|
||||
arguments_ = 0,
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any,
|
||||
* @typescript-eslint/no-non-null-assertion */
|
||||
export var class_;
|
||||
(function (class_) {
|
||||
class_[class_["arguments_"] = 0] = "arguments_";
|
||||
(function(class_) {
|
||||
class_[class_['arguments_'] = 0] = 'arguments_';
|
||||
})(class_ || (class_ = {}));
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export enum class_ {
|
||||
arguments_ = 0
|
||||
arguments_ = 0,
|
||||
}
|
||||
|
||||
@@ -4,131 +4,135 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Abc } from '../foobar/abc.js';
|
||||
import { class_ } from '../foobar/class.js';
|
||||
|
||||
import {Abc} from '../foobar/abc.js';
|
||||
import {class_} from '../foobar/class.js';
|
||||
|
||||
export class Tab implements flatbuffers.IUnpackableObject<TabT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Tab {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsTab(bb:flatbuffers.ByteBuffer, obj?:Tab):Tab {
|
||||
return (obj || new Tab()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsTab(bb:flatbuffers.ByteBuffer, obj?:Tab):Tab {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Tab()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
abc():Abc {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : Abc.a;
|
||||
}
|
||||
|
||||
mutate_abc(value:Abc):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Tab {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
arg():class_ {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : class_.arguments_;
|
||||
}
|
||||
|
||||
mutate_arg(value:class_):boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
static getRootAsTab(bb: flatbuffers.ByteBuffer, obj?: Tab): Tab {
|
||||
return (obj || new Tab()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
static getSizePrefixedRootAsTab(bb: flatbuffers.ByteBuffer, obj?: Tab): Tab {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Tab()).__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, 8);
|
||||
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
||||
}
|
||||
abc(): Abc {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb!.readInt32(this.bb_pos + offset) : Abc.a;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName():string {
|
||||
return 'foobar.Tab';
|
||||
}
|
||||
mutate_abc(value: Abc): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
|
||||
static startTab(builder:flatbuffers.Builder) {
|
||||
builder.startObject(3);
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static addAbc(builder:flatbuffers.Builder, abc:Abc) {
|
||||
builder.addFieldInt32(0, abc, Abc.a);
|
||||
}
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
static addArg(builder:flatbuffers.Builder, arg:class_) {
|
||||
builder.addFieldInt32(1, arg, class_.arguments_);
|
||||
}
|
||||
arg(): class_ {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset
|
||||
? this.bb!.readInt32(this.bb_pos + offset)
|
||||
: class_.arguments_;
|
||||
}
|
||||
|
||||
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(2, nameOffset, 0);
|
||||
}
|
||||
mutate_arg(value: class_): boolean {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
|
||||
static endTab(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
if (offset === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static createTab(builder:flatbuffers.Builder, abc:Abc, arg:class_, nameOffset:flatbuffers.Offset):flatbuffers.Offset {
|
||||
Tab.startTab(builder);
|
||||
Tab.addAbc(builder, abc);
|
||||
Tab.addArg(builder, arg);
|
||||
Tab.addName(builder, nameOffset);
|
||||
return Tab.endTab(builder);
|
||||
}
|
||||
this.bb!.writeInt32(this.bb_pos + offset, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
unpack(): TabT {
|
||||
return new TabT(
|
||||
this.abc(),
|
||||
this.arg(),
|
||||
this.name()
|
||||
);
|
||||
}
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
name(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;
|
||||
}
|
||||
|
||||
static getFullyQualifiedName(): string {
|
||||
return 'foobar.Tab';
|
||||
}
|
||||
|
||||
unpackTo(_o: TabT): void {
|
||||
_o.abc = this.abc();
|
||||
_o.arg = this.arg();
|
||||
_o.name = this.name();
|
||||
}
|
||||
static startTab(builder: flatbuffers.Builder) {
|
||||
builder.startObject(3);
|
||||
}
|
||||
|
||||
static addAbc(builder: flatbuffers.Builder, abc: Abc) {
|
||||
builder.addFieldInt32(0, abc, Abc.a);
|
||||
}
|
||||
|
||||
static addArg(builder: flatbuffers.Builder, arg: class_) {
|
||||
builder.addFieldInt32(1, arg, class_.arguments_);
|
||||
}
|
||||
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {
|
||||
builder.addFieldOffset(2, nameOffset, 0);
|
||||
}
|
||||
|
||||
static endTab(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createTab(
|
||||
builder: flatbuffers.Builder,
|
||||
abc: Abc,
|
||||
arg: class_,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
): flatbuffers.Offset {
|
||||
Tab.startTab(builder);
|
||||
Tab.addAbc(builder, abc);
|
||||
Tab.addArg(builder, arg);
|
||||
Tab.addName(builder, nameOffset);
|
||||
return Tab.endTab(builder);
|
||||
}
|
||||
|
||||
unpack(): TabT {
|
||||
return new TabT(this.abc(), this.arg(), this.name());
|
||||
}
|
||||
|
||||
unpackTo(_o: TabT): void {
|
||||
_o.abc = this.abc();
|
||||
_o.arg = this.arg();
|
||||
_o.name = this.name();
|
||||
}
|
||||
}
|
||||
|
||||
export class TabT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public abc: Abc = Abc.a,
|
||||
public arg: class_ = class_.arguments_,
|
||||
public name: string|Uint8Array|null = null
|
||||
){}
|
||||
constructor(
|
||||
public abc: Abc = Abc.a,
|
||||
public arg: class_ = class_.arguments_,
|
||||
public name: string | Uint8Array | null = null,
|
||||
) {}
|
||||
|
||||
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = this.name !== null ? builder.createString(this.name!) : 0;
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const name = (this.name !== null ? builder.createString(this.name!) : 0);
|
||||
|
||||
return Tab.createTab(builder,
|
||||
this.abc,
|
||||
this.arg,
|
||||
name
|
||||
);
|
||||
}
|
||||
return Tab.createTab(builder, this.abc, this.arg, name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user