[TS] Remove wrong and obsolete NS prefix use (#6604)

This commit is contained in:
Björn Harrtell
2021-05-03 21:04:34 +02:00
committed by GitHub
parent a27c7d8093
commit 60ff76630d
8 changed files with 391 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
// automatically generated by the FlatBuffers compiler, do not modify
export var EnumInNestedNS;
(function (EnumInNestedNS) {
EnumInNestedNS[EnumInNestedNS["A"] = 0] = "A";
EnumInNestedNS[EnumInNestedNS["B"] = 1] = "B";
EnumInNestedNS[EnumInNestedNS["C"] = 2] = "C";
})(EnumInNestedNS || (EnumInNestedNS = {}));

View File

@@ -0,0 +1,54 @@
// automatically generated by the FlatBuffers compiler, do not modify
export class StructInNestedNS {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
a() {
return this.bb.readInt32(this.bb_pos);
}
mutate_a(value) {
this.bb.writeInt32(this.bb_pos + 0, value);
return true;
}
b() {
return this.bb.readInt32(this.bb_pos + 4);
}
mutate_b(value) {
this.bb.writeInt32(this.bb_pos + 4, value);
return true;
}
static getFullyQualifiedName() {
return 'NamespaceA.NamespaceB.StructInNestedNS';
}
static sizeOf() {
return 8;
}
static createStructInNestedNS(builder, a, b) {
builder.prep(4, 8);
builder.writeInt32(b);
builder.writeInt32(a);
return builder.offset();
}
unpack() {
return new StructInNestedNST(this.a(), this.b());
}
unpackTo(_o) {
_o.a = this.a();
_o.b = this.b();
}
}
export class StructInNestedNST {
constructor(a = 0, b = 0) {
this.a = a;
this.b = b;
}
pack(builder) {
return StructInNestedNS.createStructInNestedNS(builder, this.a, this.b);
}
}

View File

@@ -0,0 +1,64 @@
// automatically generated by the FlatBuffers compiler, do not modify
import * as flatbuffers from 'flatbuffers';
export class TableInNestedNS {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsTableInNestedNS(bb, obj) {
return (obj || new TableInNestedNS()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsTableInNestedNS(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new TableInNestedNS()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
foo() {
const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
}
mutate_foo(value) {
const offset = this.bb.__offset(this.bb_pos, 4);
if (offset === 0) {
return false;
}
this.bb.writeInt32(this.bb_pos + offset, value);
return true;
}
static getFullyQualifiedName() {
return 'NamespaceA.NamespaceB.TableInNestedNS';
}
static startTableInNestedNS(builder) {
builder.startObject(1);
}
static addFoo(builder, foo) {
builder.addFieldInt32(0, foo, 0);
}
static endTableInNestedNS(builder) {
const offset = builder.endObject();
return offset;
}
static createTableInNestedNS(builder, foo) {
TableInNestedNS.startTableInNestedNS(builder);
TableInNestedNS.addFoo(builder, foo);
return TableInNestedNS.endTableInNestedNS(builder);
}
unpack() {
return new TableInNestedNST(this.foo());
}
unpackTo(_o) {
_o.foo = this.foo();
}
}
export class TableInNestedNST {
constructor(foo = 0) {
this.foo = foo;
}
pack(builder) {
return TableInNestedNS.createTableInNestedNS(builder, this.foo);
}
}

View File

@@ -0,0 +1,21 @@
// automatically generated by the FlatBuffers compiler, do not modify
import { TableInNestedNS } from '../../namespace-a/namespace-b/table-in-nested-n-s';
export var UnionInNestedNS;
(function (UnionInNestedNS) {
UnionInNestedNS[UnionInNestedNS["NONE"] = 0] = "NONE";
UnionInNestedNS[UnionInNestedNS["TableInNestedNS"] = 1] = "TableInNestedNS";
})(UnionInNestedNS || (UnionInNestedNS = {}));
export function unionToUnionInNestedNS(type, accessor) {
switch (UnionInNestedNS[type]) {
case 'NONE': return null;
case 'TableInNestedNS': return accessor(new TableInNestedNS());
default: return null;
}
}
export function unionListToUnionInNestedNS(type, accessor, index) {
switch (UnionInNestedNS[type]) {
case 'NONE': return null;
case 'TableInNestedNS': return accessor(index, new TableInNestedNS());
default: return null;
}
}