mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 08:02:41 +00:00
bulk code format fix (#8707)
This commit is contained in:
2
tests/ts/longer-namespace/a/b/c.d.ts
vendored
2
tests/ts/longer-namespace/a/b/c.d.ts
vendored
@@ -1 +1 @@
|
||||
export { Person } from './c/person.js';
|
||||
export {Person} from './c/person.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
export { Person } from './c/person.js';
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any,
|
||||
* @typescript-eslint/no-non-null-assertion */
|
||||
export {Person} from './c/person.js';
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { Person } from './c/person.js';
|
||||
export {Person} from './c/person.js';
|
||||
|
||||
46
tests/ts/longer-namespace/a/b/c/person.d.ts
vendored
46
tests/ts/longer-namespace/a/b/c/person.d.ts
vendored
@@ -1,18 +1,34 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
export declare class Person {
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Person;
|
||||
static getRootAsPerson(bb: flatbuffers.ByteBuffer, obj?: Person): Person;
|
||||
static getSizePrefixedRootAsPerson(bb: flatbuffers.ByteBuffer, obj?: Person): Person;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
age(): number;
|
||||
static startPerson(builder: flatbuffers.Builder): void;
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
|
||||
static addAge(builder: flatbuffers.Builder, age: number): void;
|
||||
static endPerson(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static finishPersonBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||
static finishSizePrefixedPersonBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
|
||||
static createPerson(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset, age: number): flatbuffers.Offset;
|
||||
bb: flatbuffers.ByteBuffer | null;
|
||||
bb_pos: number;
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Person;
|
||||
static getRootAsPerson(bb: flatbuffers.ByteBuffer, obj?: Person): Person;
|
||||
static getSizePrefixedRootAsPerson(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Person,
|
||||
): Person;
|
||||
name(): string | null;
|
||||
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
||||
age(): number;
|
||||
static startPerson(builder: flatbuffers.Builder): void;
|
||||
static addName(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
): void;
|
||||
static addAge(builder: flatbuffers.Builder, age: number): void;
|
||||
static endPerson(builder: flatbuffers.Builder): flatbuffers.Offset;
|
||||
static finishPersonBuffer(
|
||||
builder: flatbuffers.Builder,
|
||||
offset: flatbuffers.Offset,
|
||||
): void;
|
||||
static finishSizePrefixedPersonBuffer(
|
||||
builder: flatbuffers.Builder,
|
||||
offset: flatbuffers.Offset,
|
||||
): void;
|
||||
static createPerson(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
age: number,
|
||||
): flatbuffers.Offset;
|
||||
}
|
||||
|
||||
@@ -1,54 +1,58 @@
|
||||
// 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 Person {
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsPerson(bb, obj) {
|
||||
return (obj || new Person()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsPerson(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Person()).__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;
|
||||
}
|
||||
age() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static startPerson(builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addAge(builder, age) {
|
||||
builder.addFieldInt16(1, age, 0);
|
||||
}
|
||||
static endPerson(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static finishPersonBuffer(builder, offset) {
|
||||
builder.finish(offset);
|
||||
}
|
||||
static finishSizePrefixedPersonBuffer(builder, offset) {
|
||||
builder.finish(offset, undefined, true);
|
||||
}
|
||||
static createPerson(builder, nameOffset, age) {
|
||||
Person.startPerson(builder);
|
||||
Person.addName(builder, nameOffset);
|
||||
Person.addAge(builder, age);
|
||||
return Person.endPerson(builder);
|
||||
}
|
||||
constructor() {
|
||||
this.bb = null;
|
||||
this.bb_pos = 0;
|
||||
}
|
||||
__init(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
static getRootAsPerson(bb, obj) {
|
||||
return (obj || new Person())
|
||||
.__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsPerson(bb, obj) {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Person())
|
||||
.__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;
|
||||
}
|
||||
age() {
|
||||
const offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
static startPerson(builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
static addName(builder, nameOffset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addAge(builder, age) {
|
||||
builder.addFieldInt16(1, age, 0);
|
||||
}
|
||||
static endPerson(builder) {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static finishPersonBuffer(builder, offset) {
|
||||
builder.finish(offset);
|
||||
}
|
||||
static finishSizePrefixedPersonBuffer(builder, offset) {
|
||||
builder.finish(offset, undefined, true);
|
||||
}
|
||||
static createPerson(builder, nameOffset, age) {
|
||||
Person.startPerson(builder);
|
||||
Person.addName(builder, nameOffset);
|
||||
Person.addAge(builder, age);
|
||||
return Person.endPerson(builder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,67 +4,86 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
|
||||
|
||||
export class Person {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb: flatbuffers.ByteBuffer | null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):Person {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
__init(i: number, bb: flatbuffers.ByteBuffer): Person {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsPerson(bb:flatbuffers.ByteBuffer, obj?:Person):Person {
|
||||
return (obj || new Person()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getRootAsPerson(bb: flatbuffers.ByteBuffer, obj?: Person): Person {
|
||||
return (obj || new Person()).__init(
|
||||
bb.readInt32(bb.position()) + bb.position(),
|
||||
bb,
|
||||
);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsPerson(bb:flatbuffers.ByteBuffer, obj?:Person):Person {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Person()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
static getSizePrefixedRootAsPerson(
|
||||
bb: flatbuffers.ByteBuffer,
|
||||
obj?: Person,
|
||||
): Person {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new Person()).__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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
age():number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
age(): number {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
static startPerson(builder:flatbuffers.Builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
static startPerson(builder: flatbuffers.Builder) {
|
||||
builder.startObject(2);
|
||||
}
|
||||
|
||||
static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {
|
||||
builder.addFieldOffset(0, nameOffset, 0);
|
||||
}
|
||||
|
||||
static addAge(builder:flatbuffers.Builder, age:number) {
|
||||
builder.addFieldInt16(1, age, 0);
|
||||
}
|
||||
static addAge(builder: flatbuffers.Builder, age: number) {
|
||||
builder.addFieldInt16(1, age, 0);
|
||||
}
|
||||
|
||||
static endPerson(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
static endPerson(builder: flatbuffers.Builder): flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
return offset;
|
||||
}
|
||||
|
||||
static finishPersonBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
|
||||
builder.finish(offset);
|
||||
}
|
||||
static finishPersonBuffer(
|
||||
builder: flatbuffers.Builder,
|
||||
offset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.finish(offset);
|
||||
}
|
||||
|
||||
static finishSizePrefixedPersonBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
|
||||
builder.finish(offset, undefined, true);
|
||||
}
|
||||
static finishSizePrefixedPersonBuffer(
|
||||
builder: flatbuffers.Builder,
|
||||
offset: flatbuffers.Offset,
|
||||
) {
|
||||
builder.finish(offset, undefined, true);
|
||||
}
|
||||
|
||||
static createPerson(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset, age:number):flatbuffers.Offset {
|
||||
Person.startPerson(builder);
|
||||
Person.addName(builder, nameOffset);
|
||||
Person.addAge(builder, age);
|
||||
return Person.endPerson(builder);
|
||||
}
|
||||
static createPerson(
|
||||
builder: flatbuffers.Builder,
|
||||
nameOffset: flatbuffers.Offset,
|
||||
age: number,
|
||||
): flatbuffers.Offset {
|
||||
Person.startPerson(builder);
|
||||
Person.addName(builder, nameOffset);
|
||||
Person.addAge(builder, age);
|
||||
return Person.endPerson(builder);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user