Commit 142401f5 authored by Kamil Rojewski's avatar Kamil Rojewski Committed by Wouter van Oortmerssen

Fix for strictPropertyInitialization for TS (#4540)

* Eclipse ignore

* TypeScript support

* Prefixing enums

* Test results

* Merged JS and TS generators

* Fixed AppVeyor build problems

* Fixed more AppVeyor build problems

* Fixed more AppVeyor build problems

* Changed TS flag to options struct

* Storing options by value

* Removed unneeded const

* Re-export support for unions

* Uint support

* Casting bools to numbers for mutation

* TS shell tests

* Reverted generates js test file to original version

* Backing up js tests and properly generating test data

* Not importing flatbuffers for TS test generation

* Not overwriting generated js for tests

* AppVeyor test fixes

* Generating the most strict TS code possible

* Not returning null when creating vectors

* Not returning null from struct contructors

* Vector of unions for ts/js

* Sanity check for languages

* Indentation fix + output test files

* Vectors of unions for php

* Fixes to union vector handling + tests

* Fix for strictPropertyInitialization
parent 67b29d4e
...@@ -361,12 +361,12 @@ static std::string GenType(const Type &type) { ...@@ -361,12 +361,12 @@ static std::string GenType(const Type &type) {
std::string GenGetter(const Type &type, const std::string &arguments) { std::string GenGetter(const Type &type, const std::string &arguments) {
switch (type.base_type) { switch (type.base_type) {
case BASE_TYPE_STRING: return "this.bb.__string" + arguments; case BASE_TYPE_STRING: return GenBBAccess() + ".__string" + arguments;
case BASE_TYPE_STRUCT: return "this.bb.__struct" + arguments; case BASE_TYPE_STRUCT: return GenBBAccess() + ".__struct" + arguments;
case BASE_TYPE_UNION: return "this.bb.__union" + arguments; case BASE_TYPE_UNION: return GenBBAccess() + ".__union" + arguments;
case BASE_TYPE_VECTOR: return GenGetter(type.VectorType(), arguments); case BASE_TYPE_VECTOR: return GenGetter(type.VectorType(), arguments);
default: { default: {
auto getter = "this.bb.read" + MakeCamel(GenType(type)) + arguments; auto getter = GenBBAccess() + ".read" + MakeCamel(GenType(type)) + arguments;
if (type.base_type == BASE_TYPE_BOOL) { if (type.base_type == BASE_TYPE_BOOL) {
getter = "!!" + getter; getter = "!!" + getter;
} }
...@@ -379,6 +379,10 @@ std::string GenGetter(const Type &type, const std::string &arguments) { ...@@ -379,6 +379,10 @@ std::string GenGetter(const Type &type, const std::string &arguments) {
} }
} }
std::string GenBBAccess() {
return lang_.language == IDLOptions::kTs ? "this.bb!" : "this.bb";
}
std::string GenDefaultValue(const Value &value, const std::string &context) { std::string GenDefaultValue(const Value &value, const std::string &context) {
if (value.type.enum_def) { if (value.type.enum_def) {
if (auto val = value.type.enum_def->ReverseLookup( if (auto val = value.type.enum_def->ReverseLookup(
...@@ -570,7 +574,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def, ...@@ -570,7 +574,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def,
code += " /**\n"; code += " /**\n";
code += " * @type {flatbuffers.ByteBuffer}\n"; code += " * @type {flatbuffers.ByteBuffer}\n";
code += " */\n"; code += " */\n";
code += " bb: flatbuffers.ByteBuffer;\n"; code += " bb: flatbuffers.ByteBuffer|null = null;\n";
code += "\n"; code += "\n";
code += " /**\n"; code += " /**\n";
code += " * @type {number}\n"; code += " * @type {number}\n";
...@@ -666,8 +670,9 @@ void GenStruct(const Parser &parser, StructDef &struct_def, ...@@ -666,8 +670,9 @@ void GenStruct(const Parser &parser, StructDef &struct_def,
it != struct_def.fields.vec.end(); ++it) { it != struct_def.fields.vec.end(); ++it) {
auto &field = **it; auto &field = **it;
if (field.deprecated) continue; if (field.deprecated) continue;
auto offset_prefix = " var offset = this.bb.__offset(this.bb_pos, " + auto offset_prefix = " var offset = " + GenBBAccess() +
NumToString(field.value.offset) + ");\n return offset ? "; ".__offset(this.bb_pos, " + NumToString(field.value.offset) +
");\n return offset ? ";
// Emit a scalar field // Emit a scalar field
if (IsScalar(field.value.type.base_type) || if (IsScalar(field.value.type.base_type) ||
...@@ -711,7 +716,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def, ...@@ -711,7 +716,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def,
index += ", optionalEncoding"; index += ", optionalEncoding";
} }
code += offset_prefix + GenGetter(field.value.type, code += offset_prefix + GenGetter(field.value.type,
"(" + index + ")") + " : " + GenDefaultValue(field.value, "this.bb"); "(" + index + ")") + " : " + GenDefaultValue(field.value, GenBBAccess());
code += ";\n"; code += ";\n";
} }
} }
...@@ -735,13 +740,13 @@ void GenStruct(const Parser &parser, StructDef &struct_def, ...@@ -735,13 +740,13 @@ void GenStruct(const Parser &parser, StructDef &struct_def,
if (struct_def.fixed) { if (struct_def.fixed) {
code += " return (obj || new " + type; code += " return (obj || new " + type;
code += ").__init(this.bb_pos"; code += ").__init(this.bb_pos";
code += MaybeAdd(field.value.offset) + ", this.bb);\n"; code += MaybeAdd(field.value.offset) + ", " + GenBBAccess() + ");\n";
} else { } else {
code += offset_prefix + "(obj || new " + type + ").__init("; code += offset_prefix + "(obj || new " + type + ").__init(";
code += field.value.type.struct_def->fixed code += field.value.type.struct_def->fixed
? "this.bb_pos + offset" ? "this.bb_pos + offset"
: "this.bb.__indirect(this.bb_pos + offset)"; : GenBBAccess() + ".__indirect(this.bb_pos + offset)";
code += ", this.bb) : null;\n"; code += ", " + GenBBAccess() + ") : null;\n";
} }
if (lang_.language == IDLOptions::kTs) { if (lang_.language == IDLOptions::kTs) {
...@@ -755,7 +760,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def, ...@@ -755,7 +760,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def,
auto vectortype = field.value.type.VectorType(); auto vectortype = field.value.type.VectorType();
auto vectortypename = GenTypeName(vectortype, false); auto vectortypename = GenTypeName(vectortype, false);
auto inline_size = InlineSize(vectortype); auto inline_size = InlineSize(vectortype);
auto index = "this.bb.__vector(this.bb_pos + offset) + index" + auto index = GenBBAccess() + ".__vector(this.bb_pos + offset) + index" +
MaybeScale(inline_size); MaybeScale(inline_size);
std::string args = "@param {number} index\n"; std::string args = "@param {number} index\n";
std::string ret_type; std::string ret_type;
...@@ -818,8 +823,8 @@ void GenStruct(const Parser &parser, StructDef &struct_def, ...@@ -818,8 +823,8 @@ void GenStruct(const Parser &parser, StructDef &struct_def,
code += ").__init("; code += ").__init(";
code += vectortype.struct_def->fixed code += vectortype.struct_def->fixed
? index ? index
: "this.bb.__indirect(" + index + ")"; : GenBBAccess() + ".__indirect(" + index + ")";
code += ", this.bb)"; code += ", " + GenBBAccess() + ")";
} else { } else {
if (is_union) { if (is_union) {
index = "obj, " + index; index = "obj, " + index;
...@@ -833,7 +838,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def, ...@@ -833,7 +838,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def,
code += "false"; code += "false";
} else if (field.value.type.element == BASE_TYPE_LONG || } else if (field.value.type.element == BASE_TYPE_LONG ||
field.value.type.element == BASE_TYPE_ULONG) { field.value.type.element == BASE_TYPE_ULONG) {
code += "this.bb.createLong(0, 0)"; code += GenBBAccess() + ".createLong(0, 0)";
} else if (IsScalar(field.value.type.element)) { } else if (IsScalar(field.value.type.element)) {
if (field.value.type.enum_def) { if (field.value.type.enum_def) {
code += "/** @type {" + code += "/** @type {" +
...@@ -899,15 +904,15 @@ void GenStruct(const Parser &parser, StructDef &struct_def, ...@@ -899,15 +904,15 @@ void GenStruct(const Parser &parser, StructDef &struct_def,
" = function(value) {\n"; " = function(value) {\n";
} }
code += " var offset = this.bb.__offset(this.bb_pos, " + code += " var offset = " + GenBBAccess() + ".__offset(this.bb_pos, " +
NumToString(field.value.offset) + ");\n\n"; NumToString(field.value.offset) + ");\n\n";
code += " if (offset === 0) {\n"; code += " if (offset === 0) {\n";
code += " return false;\n"; code += " return false;\n";
code += " }\n\n"; code += " }\n\n";
// special case for bools, which are treated as uint8 // special case for bools, which are treated as uint8
code += " this.bb.write" + MakeCamel(GenType(field.value.type)) + code += " " + GenBBAccess() + ".write" +
"(this.bb_pos + offset, "; MakeCamel(GenType(field.value.type)) + "(this.bb_pos + offset, ";
if (field.value.type.base_type == BASE_TYPE_BOOL && if (field.value.type.base_type == BASE_TYPE_BOOL &&
lang_.language == IDLOptions::kTs) { lang_.language == IDLOptions::kTs) {
code += "+"; code += "+";
...@@ -936,7 +941,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def, ...@@ -936,7 +941,7 @@ void GenStruct(const Parser &parser, StructDef &struct_def,
code += "Length = function() {\n" + offset_prefix; code += "Length = function() {\n" + offset_prefix;
} }
code += "this.bb.__vector_len(this.bb_pos + offset) : 0;\n};\n\n"; code += GenBBAccess() + ".__vector_len(this.bb_pos + offset) : 0;\n};\n\n";
if(parser_.opts.use_goog_js_export_format) { if(parser_.opts.use_goog_js_export_format) {
exports += "goog.exportProperty(" + object_name + ".prototype, '" + exports += "goog.exportProperty(" + object_name + ".prototype, '" +
...@@ -958,9 +963,10 @@ void GenStruct(const Parser &parser, StructDef &struct_def, ...@@ -958,9 +963,10 @@ void GenStruct(const Parser &parser, StructDef &struct_def,
code += "Array = function() {\n" + offset_prefix; code += "Array = function() {\n" + offset_prefix;
} }
code += "new " + GenType(vectorType) + "Array(this.bb.bytes().buffer, " code += "new " + GenType(vectorType) + "Array(" + GenBBAccess() +
"this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), " ".bytes().buffer, " + GenBBAccess() + ".bytes().byteOffset + " +
"this.bb.__vector_len(this.bb_pos + offset)) : null;\n};\n\n"; GenBBAccess() + ".__vector(this.bb_pos + offset), " +
GenBBAccess() + ".__vector_len(this.bb_pos + offset)) : null;\n};\n\n";
if(parser_.opts.use_goog_js_export_format) { if(parser_.opts.use_goog_js_export_format) {
exports += "goog.exportProperty(" + object_name + ".prototype, '" + exports += "goog.exportProperty(" + object_name + ".prototype, '" +
......
No preview for this file type
...@@ -29,7 +29,7 @@ export class InParentNamespace { ...@@ -29,7 +29,7 @@ export class InParentNamespace {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -81,7 +81,7 @@ export class Monster { ...@@ -81,7 +81,7 @@ export class Monster {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -133,7 +133,7 @@ export class Test { ...@@ -133,7 +133,7 @@ export class Test {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -154,7 +154,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):Test { ...@@ -154,7 +154,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):Test {
* @returns {number} * @returns {number}
*/ */
a():number { a():number {
return this.bb.readInt16(this.bb_pos); return this.bb!.readInt16(this.bb_pos);
}; };
/** /**
...@@ -162,13 +162,13 @@ a():number { ...@@ -162,13 +162,13 @@ a():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_a(value:number):boolean { mutate_a(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 0); var offset = this.bb!.__offset(this.bb_pos, 0);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt16(this.bb_pos + offset, value); this.bb!.writeInt16(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -176,7 +176,7 @@ mutate_a(value:number):boolean { ...@@ -176,7 +176,7 @@ mutate_a(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
b():number { b():number {
return this.bb.readInt8(this.bb_pos + 2); return this.bb!.readInt8(this.bb_pos + 2);
}; };
/** /**
...@@ -184,13 +184,13 @@ b():number { ...@@ -184,13 +184,13 @@ b():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_b(value:number):boolean { mutate_b(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 2); var offset = this.bb!.__offset(this.bb_pos, 2);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt8(this.bb_pos + offset, value); this.bb!.writeInt8(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -218,7 +218,7 @@ export class TestSimpleTableWithEnum { ...@@ -218,7 +218,7 @@ export class TestSimpleTableWithEnum {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -248,8 +248,8 @@ static getRootAsTestSimpleTableWithEnum(bb:flatbuffers.ByteBuffer, obj?:TestSimp ...@@ -248,8 +248,8 @@ static getRootAsTestSimpleTableWithEnum(bb:flatbuffers.ByteBuffer, obj?:TestSimp
* @returns {MyGame.Example.Color} * @returns {MyGame.Example.Color}
*/ */
color():MyGame.Example.Color { color():MyGame.Example.Color {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? /** @type {MyGame.Example.Color} */ (this.bb.readInt8(this.bb_pos + offset)) : MyGame.Example.Color.Green; return offset ? /** @type {MyGame.Example.Color} */ (this.bb!.readInt8(this.bb_pos + offset)) : MyGame.Example.Color.Green;
}; };
/** /**
...@@ -257,13 +257,13 @@ color():MyGame.Example.Color { ...@@ -257,13 +257,13 @@ color():MyGame.Example.Color {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_color(value:MyGame.Example.Color):boolean { mutate_color(value:MyGame.Example.Color):boolean {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt8(this.bb_pos + offset, value); this.bb!.writeInt8(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -301,7 +301,7 @@ export class Vec3 { ...@@ -301,7 +301,7 @@ export class Vec3 {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -322,7 +322,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):Vec3 { ...@@ -322,7 +322,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):Vec3 {
* @returns {number} * @returns {number}
*/ */
x():number { x():number {
return this.bb.readFloat32(this.bb_pos); return this.bb!.readFloat32(this.bb_pos);
}; };
/** /**
...@@ -330,13 +330,13 @@ x():number { ...@@ -330,13 +330,13 @@ x():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_x(value:number):boolean { mutate_x(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 0); var offset = this.bb!.__offset(this.bb_pos, 0);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb!.writeFloat32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -344,7 +344,7 @@ mutate_x(value:number):boolean { ...@@ -344,7 +344,7 @@ mutate_x(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
y():number { y():number {
return this.bb.readFloat32(this.bb_pos + 4); return this.bb!.readFloat32(this.bb_pos + 4);
}; };
/** /**
...@@ -352,13 +352,13 @@ y():number { ...@@ -352,13 +352,13 @@ y():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_y(value:number):boolean { mutate_y(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb!.writeFloat32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -366,7 +366,7 @@ mutate_y(value:number):boolean { ...@@ -366,7 +366,7 @@ mutate_y(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
z():number { z():number {
return this.bb.readFloat32(this.bb_pos + 8); return this.bb!.readFloat32(this.bb_pos + 8);
}; };
/** /**
...@@ -374,13 +374,13 @@ z():number { ...@@ -374,13 +374,13 @@ z():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_z(value:number):boolean { mutate_z(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 8); var offset = this.bb!.__offset(this.bb_pos, 8);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb!.writeFloat32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -388,7 +388,7 @@ mutate_z(value:number):boolean { ...@@ -388,7 +388,7 @@ mutate_z(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
test1():number { test1():number {
return this.bb.readFloat64(this.bb_pos + 16); return this.bb!.readFloat64(this.bb_pos + 16);
}; };
/** /**
...@@ -396,13 +396,13 @@ test1():number { ...@@ -396,13 +396,13 @@ test1():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_test1(value:number):boolean { mutate_test1(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 16); var offset = this.bb!.__offset(this.bb_pos, 16);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeFloat64(this.bb_pos + offset, value); this.bb!.writeFloat64(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -410,7 +410,7 @@ mutate_test1(value:number):boolean { ...@@ -410,7 +410,7 @@ mutate_test1(value:number):boolean {
* @returns {MyGame.Example.Color} * @returns {MyGame.Example.Color}
*/ */
test2():MyGame.Example.Color { test2():MyGame.Example.Color {
return /** @type {MyGame.Example.Color} */ (this.bb.readInt8(this.bb_pos + 24)); return /** @type {MyGame.Example.Color} */ (this.bb!.readInt8(this.bb_pos + 24));
}; };
/** /**
...@@ -418,13 +418,13 @@ test2():MyGame.Example.Color { ...@@ -418,13 +418,13 @@ test2():MyGame.Example.Color {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_test2(value:MyGame.Example.Color):boolean { mutate_test2(value:MyGame.Example.Color):boolean {
var offset = this.bb.__offset(this.bb_pos, 24); var offset = this.bb!.__offset(this.bb_pos, 24);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt8(this.bb_pos + offset, value); this.bb!.writeInt8(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -433,7 +433,7 @@ mutate_test2(value:MyGame.Example.Color):boolean { ...@@ -433,7 +433,7 @@ mutate_test2(value:MyGame.Example.Color):boolean {
* @returns {MyGame.Example.Test|null} * @returns {MyGame.Example.Test|null}
*/ */
test3(obj?:MyGame.Example.Test):MyGame.Example.Test|null { test3(obj?:MyGame.Example.Test):MyGame.Example.Test|null {
return (obj || new MyGame.Example.Test).__init(this.bb_pos + 26, this.bb); return (obj || new MyGame.Example.Test).__init(this.bb_pos + 26, this.bb!);
}; };
/** /**
...@@ -474,7 +474,7 @@ export class Ability { ...@@ -474,7 +474,7 @@ export class Ability {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -495,7 +495,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):Ability { ...@@ -495,7 +495,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):Ability {
* @returns {number} * @returns {number}
*/ */
id():number { id():number {
return this.bb.readUint32(this.bb_pos); return this.bb!.readUint32(this.bb_pos);
}; };
/** /**
...@@ -503,13 +503,13 @@ id():number { ...@@ -503,13 +503,13 @@ id():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_id(value:number):boolean { mutate_id(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 0); var offset = this.bb!.__offset(this.bb_pos, 0);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint32(this.bb_pos + offset, value); this.bb!.writeUint32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -517,7 +517,7 @@ mutate_id(value:number):boolean { ...@@ -517,7 +517,7 @@ mutate_id(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
distance():number { distance():number {
return this.bb.readUint32(this.bb_pos + 4); return this.bb!.readUint32(this.bb_pos + 4);
}; };
/** /**
...@@ -525,13 +525,13 @@ distance():number { ...@@ -525,13 +525,13 @@ distance():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_distance(value:number):boolean { mutate_distance(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint32(this.bb_pos + offset, value); this.bb!.writeUint32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -558,7 +558,7 @@ export class Stat { ...@@ -558,7 +558,7 @@ export class Stat {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -591,16 +591,16 @@ static getRootAsStat(bb:flatbuffers.ByteBuffer, obj?:Stat):Stat { ...@@ -591,16 +591,16 @@ static getRootAsStat(bb:flatbuffers.ByteBuffer, obj?:Stat):Stat {
id():string|null id():string|null
id(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null id(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
id(optionalEncoding?:any):string|Uint8Array|null { id(optionalEncoding?:any):string|Uint8Array|null {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}; };
/** /**
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
*/ */
val():flatbuffers.Long { val():flatbuffers.Long {
var offset = this.bb.__offset(this.bb_pos, 6); var offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0); return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0);
}; };
/** /**
...@@ -608,13 +608,13 @@ val():flatbuffers.Long { ...@@ -608,13 +608,13 @@ val():flatbuffers.Long {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_val(value:flatbuffers.Long):boolean { mutate_val(value:flatbuffers.Long):boolean {
var offset = this.bb.__offset(this.bb_pos, 6); var offset = this.bb!.__offset(this.bb_pos, 6);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt64(this.bb_pos + offset, value); this.bb!.writeInt64(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -622,8 +622,8 @@ mutate_val(value:flatbuffers.Long):boolean { ...@@ -622,8 +622,8 @@ mutate_val(value:flatbuffers.Long):boolean {
* @returns {number} * @returns {number}
*/ */
count():number { count():number {
var offset = this.bb.__offset(this.bb_pos, 8); var offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0; return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -631,13 +631,13 @@ count():number { ...@@ -631,13 +631,13 @@ count():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_count(value:number):boolean { mutate_count(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 8); var offset = this.bb!.__offset(this.bb_pos, 8);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint16(this.bb_pos + offset, value); this.bb!.writeUint16(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -693,7 +693,7 @@ export class Monster { ...@@ -693,7 +693,7 @@ export class Monster {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -732,16 +732,16 @@ static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean { ...@@ -732,16 +732,16 @@ static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean {
* @returns {MyGame.Example.Vec3|null} * @returns {MyGame.Example.Vec3|null}
*/ */
pos(obj?:MyGame.Example.Vec3):MyGame.Example.Vec3|null { pos(obj?:MyGame.Example.Vec3):MyGame.Example.Vec3|null {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? (obj || new MyGame.Example.Vec3).__init(this.bb_pos + offset, this.bb) : null; return offset ? (obj || new MyGame.Example.Vec3).__init(this.bb_pos + offset, this.bb!) : null;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
mana():number { mana():number {
var offset = this.bb.__offset(this.bb_pos, 6); var offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? this.bb.readInt16(this.bb_pos + offset) : 150; return offset ? this.bb!.readInt16(this.bb_pos + offset) : 150;
}; };
/** /**
...@@ -749,13 +749,13 @@ mana():number { ...@@ -749,13 +749,13 @@ mana():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_mana(value:number):boolean { mutate_mana(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 6); var offset = this.bb!.__offset(this.bb_pos, 6);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt16(this.bb_pos + offset, value); this.bb!.writeInt16(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -763,8 +763,8 @@ mutate_mana(value:number):boolean { ...@@ -763,8 +763,8 @@ mutate_mana(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
hp():number { hp():number {
var offset = this.bb.__offset(this.bb_pos, 8); var offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? this.bb.readInt16(this.bb_pos + offset) : 100; return offset ? this.bb!.readInt16(this.bb_pos + offset) : 100;
}; };
/** /**
...@@ -772,13 +772,13 @@ hp():number { ...@@ -772,13 +772,13 @@ hp():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_hp(value:number):boolean { mutate_hp(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 8); var offset = this.bb!.__offset(this.bb_pos, 8);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt16(this.bb_pos + offset, value); this.bb!.writeInt16(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -789,8 +789,8 @@ mutate_hp(value:number):boolean { ...@@ -789,8 +789,8 @@ mutate_hp(value:number):boolean {
name():string|null name():string|null
name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
name(optionalEncoding?:any):string|Uint8Array|null { name(optionalEncoding?:any):string|Uint8Array|null {
var offset = this.bb.__offset(this.bb_pos, 10); var offset = this.bb!.__offset(this.bb_pos, 10);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}; };
/** /**
...@@ -798,32 +798,32 @@ name(optionalEncoding?:any):string|Uint8Array|null { ...@@ -798,32 +798,32 @@ name(optionalEncoding?:any):string|Uint8Array|null {
* @returns {number} * @returns {number}
*/ */
inventory(index: number):number|null { inventory(index: number):number|null {
var offset = this.bb.__offset(this.bb_pos, 14); var offset = this.bb!.__offset(this.bb_pos, 14);
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0; return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
inventoryLength():number { inventoryLength():number {
var offset = this.bb.__offset(this.bb_pos, 14); var offset = this.bb!.__offset(this.bb_pos, 14);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
* @returns {Uint8Array} * @returns {Uint8Array}
*/ */
inventoryArray():Uint8Array|null { inventoryArray():Uint8Array|null {
var offset = this.bb.__offset(this.bb_pos, 14); var offset = this.bb!.__offset(this.bb_pos, 14);
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
}; };
/** /**
* @returns {MyGame.Example.Color} * @returns {MyGame.Example.Color}
*/ */
color():MyGame.Example.Color { color():MyGame.Example.Color {
var offset = this.bb.__offset(this.bb_pos, 16); var offset = this.bb!.__offset(this.bb_pos, 16);
return offset ? /** @type {MyGame.Example.Color} */ (this.bb.readInt8(this.bb_pos + offset)) : MyGame.Example.Color.Blue; return offset ? /** @type {MyGame.Example.Color} */ (this.bb!.readInt8(this.bb_pos + offset)) : MyGame.Example.Color.Blue;
}; };
/** /**
...@@ -831,13 +831,13 @@ color():MyGame.Example.Color { ...@@ -831,13 +831,13 @@ color():MyGame.Example.Color {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_color(value:MyGame.Example.Color):boolean { mutate_color(value:MyGame.Example.Color):boolean {
var offset = this.bb.__offset(this.bb_pos, 16); var offset = this.bb!.__offset(this.bb_pos, 16);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt8(this.bb_pos + offset, value); this.bb!.writeInt8(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -845,8 +845,8 @@ mutate_color(value:MyGame.Example.Color):boolean { ...@@ -845,8 +845,8 @@ mutate_color(value:MyGame.Example.Color):boolean {
* @returns {MyGame.Example.Any} * @returns {MyGame.Example.Any}
*/ */
testType():MyGame.Example.Any { testType():MyGame.Example.Any {
var offset = this.bb.__offset(this.bb_pos, 18); var offset = this.bb!.__offset(this.bb_pos, 18);
return offset ? /** @type {MyGame.Example.Any} */ (this.bb.readUint8(this.bb_pos + offset)) : MyGame.Example.Any.NONE; return offset ? /** @type {MyGame.Example.Any} */ (this.bb!.readUint8(this.bb_pos + offset)) : MyGame.Example.Any.NONE;
}; };
/** /**
...@@ -854,13 +854,13 @@ testType():MyGame.Example.Any { ...@@ -854,13 +854,13 @@ testType():MyGame.Example.Any {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_test_type(value:MyGame.Example.Any):boolean { mutate_test_type(value:MyGame.Example.Any):boolean {
var offset = this.bb.__offset(this.bb_pos, 18); var offset = this.bb!.__offset(this.bb_pos, 18);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint8(this.bb_pos + offset, value); this.bb!.writeUint8(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -869,8 +869,8 @@ mutate_test_type(value:MyGame.Example.Any):boolean { ...@@ -869,8 +869,8 @@ mutate_test_type(value:MyGame.Example.Any):boolean {
* @returns {?flatbuffers.Table} * @returns {?flatbuffers.Table}
*/ */
test<T extends flatbuffers.Table>(obj:T):T|null { test<T extends flatbuffers.Table>(obj:T):T|null {
var offset = this.bb.__offset(this.bb_pos, 20); var offset = this.bb!.__offset(this.bb_pos, 20);
return offset ? this.bb.__union(obj, this.bb_pos + offset) : null; return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
}; };
/** /**
...@@ -879,16 +879,16 @@ test<T extends flatbuffers.Table>(obj:T):T|null { ...@@ -879,16 +879,16 @@ test<T extends flatbuffers.Table>(obj:T):T|null {
* @returns {MyGame.Example.Test} * @returns {MyGame.Example.Test}
*/ */
test4(index: number, obj?:MyGame.Example.Test):MyGame.Example.Test|null { test4(index: number, obj?:MyGame.Example.Test):MyGame.Example.Test|null {
var offset = this.bb.__offset(this.bb_pos, 22); var offset = this.bb!.__offset(this.bb_pos, 22);
return offset ? (obj || new MyGame.Example.Test).__init(this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) : null; return offset ? (obj || new MyGame.Example.Test).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
test4Length():number { test4Length():number {
var offset = this.bb.__offset(this.bb_pos, 22); var offset = this.bb!.__offset(this.bb_pos, 22);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -899,16 +899,16 @@ test4Length():number { ...@@ -899,16 +899,16 @@ test4Length():number {
testarrayofstring(index: number):string testarrayofstring(index: number):string
testarrayofstring(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array testarrayofstring(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
testarrayofstring(index: number,optionalEncoding?:any):string|Uint8Array|null { testarrayofstring(index: number,optionalEncoding?:any):string|Uint8Array|null {
var offset = this.bb.__offset(this.bb_pos, 24); var offset = this.bb!.__offset(this.bb_pos, 24);
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
testarrayofstringLength():number { testarrayofstringLength():number {
var offset = this.bb.__offset(this.bb_pos, 24); var offset = this.bb!.__offset(this.bb_pos, 24);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -920,16 +920,16 @@ testarrayofstringLength():number { ...@@ -920,16 +920,16 @@ testarrayofstringLength():number {
* @returns {MyGame.Example.Monster} * @returns {MyGame.Example.Monster}
*/ */
testarrayoftables(index: number, obj?:MyGame.Example.Monster):MyGame.Example.Monster|null { testarrayoftables(index: number, obj?:MyGame.Example.Monster):MyGame.Example.Monster|null {
var offset = this.bb.__offset(this.bb_pos, 26); var offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? (obj || new MyGame.Example.Monster).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null; return offset ? (obj || new MyGame.Example.Monster).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
testarrayoftablesLength():number { testarrayoftablesLength():number {
var offset = this.bb.__offset(this.bb_pos, 26); var offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -937,8 +937,8 @@ testarrayoftablesLength():number { ...@@ -937,8 +937,8 @@ testarrayoftablesLength():number {
* @returns {MyGame.Example.Monster|null} * @returns {MyGame.Example.Monster|null}
*/ */
enemy(obj?:MyGame.Example.Monster):MyGame.Example.Monster|null { enemy(obj?:MyGame.Example.Monster):MyGame.Example.Monster|null {
var offset = this.bb.__offset(this.bb_pos, 28); var offset = this.bb!.__offset(this.bb_pos, 28);
return offset ? (obj || new MyGame.Example.Monster).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; return offset ? (obj || new MyGame.Example.Monster).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}; };
/** /**
...@@ -946,24 +946,24 @@ enemy(obj?:MyGame.Example.Monster):MyGame.Example.Monster|null { ...@@ -946,24 +946,24 @@ enemy(obj?:MyGame.Example.Monster):MyGame.Example.Monster|null {
* @returns {number} * @returns {number}
*/ */
testnestedflatbuffer(index: number):number|null { testnestedflatbuffer(index: number):number|null {
var offset = this.bb.__offset(this.bb_pos, 30); var offset = this.bb!.__offset(this.bb_pos, 30);
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0; return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
testnestedflatbufferLength():number { testnestedflatbufferLength():number {
var offset = this.bb.__offset(this.bb_pos, 30); var offset = this.bb!.__offset(this.bb_pos, 30);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
* @returns {Uint8Array} * @returns {Uint8Array}
*/ */
testnestedflatbufferArray():Uint8Array|null { testnestedflatbufferArray():Uint8Array|null {
var offset = this.bb.__offset(this.bb_pos, 30); var offset = this.bb!.__offset(this.bb_pos, 30);
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
}; };
/** /**
...@@ -971,16 +971,16 @@ testnestedflatbufferArray():Uint8Array|null { ...@@ -971,16 +971,16 @@ testnestedflatbufferArray():Uint8Array|null {
* @returns {MyGame.Example.Stat|null} * @returns {MyGame.Example.Stat|null}
*/ */
testempty(obj?:MyGame.Example.Stat):MyGame.Example.Stat|null { testempty(obj?:MyGame.Example.Stat):MyGame.Example.Stat|null {
var offset = this.bb.__offset(this.bb_pos, 32); var offset = this.bb!.__offset(this.bb_pos, 32);
return offset ? (obj || new MyGame.Example.Stat).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; return offset ? (obj || new MyGame.Example.Stat).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}; };
/** /**
* @returns {boolean} * @returns {boolean}
*/ */
testbool():boolean { testbool():boolean {
var offset = this.bb.__offset(this.bb_pos, 34); var offset = this.bb!.__offset(this.bb_pos, 34);
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false; return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
}; };
/** /**
...@@ -988,13 +988,13 @@ testbool():boolean { ...@@ -988,13 +988,13 @@ testbool():boolean {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testbool(value:boolean):boolean { mutate_testbool(value:boolean):boolean {
var offset = this.bb.__offset(this.bb_pos, 34); var offset = this.bb!.__offset(this.bb_pos, 34);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt8(this.bb_pos + offset, +value); this.bb!.writeInt8(this.bb_pos + offset, +value);
return true; return true;
}; };
...@@ -1002,8 +1002,8 @@ mutate_testbool(value:boolean):boolean { ...@@ -1002,8 +1002,8 @@ mutate_testbool(value:boolean):boolean {
* @returns {number} * @returns {number}
*/ */
testhashs32Fnv1():number { testhashs32Fnv1():number {
var offset = this.bb.__offset(this.bb_pos, 36); var offset = this.bb!.__offset(this.bb_pos, 36);
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0; return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -1011,13 +1011,13 @@ testhashs32Fnv1():number { ...@@ -1011,13 +1011,13 @@ testhashs32Fnv1():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testhashs32_fnv1(value:number):boolean { mutate_testhashs32_fnv1(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 36); var offset = this.bb!.__offset(this.bb_pos, 36);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt32(this.bb_pos + offset, value); this.bb!.writeInt32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1025,8 +1025,8 @@ mutate_testhashs32_fnv1(value:number):boolean { ...@@ -1025,8 +1025,8 @@ mutate_testhashs32_fnv1(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
testhashu32Fnv1():number { testhashu32Fnv1():number {
var offset = this.bb.__offset(this.bb_pos, 38); var offset = this.bb!.__offset(this.bb_pos, 38);
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -1034,13 +1034,13 @@ testhashu32Fnv1():number { ...@@ -1034,13 +1034,13 @@ testhashu32Fnv1():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testhashu32_fnv1(value:number):boolean { mutate_testhashu32_fnv1(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 38); var offset = this.bb!.__offset(this.bb_pos, 38);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint32(this.bb_pos + offset, value); this.bb!.writeUint32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1048,8 +1048,8 @@ mutate_testhashu32_fnv1(value:number):boolean { ...@@ -1048,8 +1048,8 @@ mutate_testhashu32_fnv1(value:number):boolean {
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
*/ */
testhashs64Fnv1():flatbuffers.Long { testhashs64Fnv1():flatbuffers.Long {
var offset = this.bb.__offset(this.bb_pos, 40); var offset = this.bb!.__offset(this.bb_pos, 40);
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0); return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0);
}; };
/** /**
...@@ -1057,13 +1057,13 @@ testhashs64Fnv1():flatbuffers.Long { ...@@ -1057,13 +1057,13 @@ testhashs64Fnv1():flatbuffers.Long {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testhashs64_fnv1(value:flatbuffers.Long):boolean { mutate_testhashs64_fnv1(value:flatbuffers.Long):boolean {
var offset = this.bb.__offset(this.bb_pos, 40); var offset = this.bb!.__offset(this.bb_pos, 40);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt64(this.bb_pos + offset, value); this.bb!.writeInt64(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1071,8 +1071,8 @@ mutate_testhashs64_fnv1(value:flatbuffers.Long):boolean { ...@@ -1071,8 +1071,8 @@ mutate_testhashs64_fnv1(value:flatbuffers.Long):boolean {
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
*/ */
testhashu64Fnv1():flatbuffers.Long { testhashu64Fnv1():flatbuffers.Long {
var offset = this.bb.__offset(this.bb_pos, 42); var offset = this.bb!.__offset(this.bb_pos, 42);
return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0); return offset ? this.bb!.readUint64(this.bb_pos + offset) : this.bb!.createLong(0, 0);
}; };
/** /**
...@@ -1080,13 +1080,13 @@ testhashu64Fnv1():flatbuffers.Long { ...@@ -1080,13 +1080,13 @@ testhashu64Fnv1():flatbuffers.Long {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testhashu64_fnv1(value:flatbuffers.Long):boolean { mutate_testhashu64_fnv1(value:flatbuffers.Long):boolean {
var offset = this.bb.__offset(this.bb_pos, 42); var offset = this.bb!.__offset(this.bb_pos, 42);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint64(this.bb_pos + offset, value); this.bb!.writeUint64(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1094,8 +1094,8 @@ mutate_testhashu64_fnv1(value:flatbuffers.Long):boolean { ...@@ -1094,8 +1094,8 @@ mutate_testhashu64_fnv1(value:flatbuffers.Long):boolean {
* @returns {number} * @returns {number}
*/ */
testhashs32Fnv1a():number { testhashs32Fnv1a():number {
var offset = this.bb.__offset(this.bb_pos, 44); var offset = this.bb!.__offset(this.bb_pos, 44);
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0; return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -1103,13 +1103,13 @@ testhashs32Fnv1a():number { ...@@ -1103,13 +1103,13 @@ testhashs32Fnv1a():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testhashs32_fnv1a(value:number):boolean { mutate_testhashs32_fnv1a(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 44); var offset = this.bb!.__offset(this.bb_pos, 44);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt32(this.bb_pos + offset, value); this.bb!.writeInt32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1117,8 +1117,8 @@ mutate_testhashs32_fnv1a(value:number):boolean { ...@@ -1117,8 +1117,8 @@ mutate_testhashs32_fnv1a(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
testhashu32Fnv1a():number { testhashu32Fnv1a():number {
var offset = this.bb.__offset(this.bb_pos, 46); var offset = this.bb!.__offset(this.bb_pos, 46);
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -1126,13 +1126,13 @@ testhashu32Fnv1a():number { ...@@ -1126,13 +1126,13 @@ testhashu32Fnv1a():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testhashu32_fnv1a(value:number):boolean { mutate_testhashu32_fnv1a(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 46); var offset = this.bb!.__offset(this.bb_pos, 46);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint32(this.bb_pos + offset, value); this.bb!.writeUint32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1140,8 +1140,8 @@ mutate_testhashu32_fnv1a(value:number):boolean { ...@@ -1140,8 +1140,8 @@ mutate_testhashu32_fnv1a(value:number):boolean {
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
*/ */
testhashs64Fnv1a():flatbuffers.Long { testhashs64Fnv1a():flatbuffers.Long {
var offset = this.bb.__offset(this.bb_pos, 48); var offset = this.bb!.__offset(this.bb_pos, 48);
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0); return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0);
}; };
/** /**
...@@ -1149,13 +1149,13 @@ testhashs64Fnv1a():flatbuffers.Long { ...@@ -1149,13 +1149,13 @@ testhashs64Fnv1a():flatbuffers.Long {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testhashs64_fnv1a(value:flatbuffers.Long):boolean { mutate_testhashs64_fnv1a(value:flatbuffers.Long):boolean {
var offset = this.bb.__offset(this.bb_pos, 48); var offset = this.bb!.__offset(this.bb_pos, 48);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt64(this.bb_pos + offset, value); this.bb!.writeInt64(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1163,8 +1163,8 @@ mutate_testhashs64_fnv1a(value:flatbuffers.Long):boolean { ...@@ -1163,8 +1163,8 @@ mutate_testhashs64_fnv1a(value:flatbuffers.Long):boolean {
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
*/ */
testhashu64Fnv1a():flatbuffers.Long { testhashu64Fnv1a():flatbuffers.Long {
var offset = this.bb.__offset(this.bb_pos, 50); var offset = this.bb!.__offset(this.bb_pos, 50);
return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0); return offset ? this.bb!.readUint64(this.bb_pos + offset) : this.bb!.createLong(0, 0);
}; };
/** /**
...@@ -1172,13 +1172,13 @@ testhashu64Fnv1a():flatbuffers.Long { ...@@ -1172,13 +1172,13 @@ testhashu64Fnv1a():flatbuffers.Long {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testhashu64_fnv1a(value:flatbuffers.Long):boolean { mutate_testhashu64_fnv1a(value:flatbuffers.Long):boolean {
var offset = this.bb.__offset(this.bb_pos, 50); var offset = this.bb!.__offset(this.bb_pos, 50);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint64(this.bb_pos + offset, value); this.bb!.writeUint64(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1187,32 +1187,32 @@ mutate_testhashu64_fnv1a(value:flatbuffers.Long):boolean { ...@@ -1187,32 +1187,32 @@ mutate_testhashu64_fnv1a(value:flatbuffers.Long):boolean {
* @returns {boolean} * @returns {boolean}
*/ */
testarrayofbools(index: number):boolean|null { testarrayofbools(index: number):boolean|null {
var offset = this.bb.__offset(this.bb_pos, 52); var offset = this.bb!.__offset(this.bb_pos, 52);
return offset ? !!this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : false; return offset ? !!this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : false;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
testarrayofboolsLength():number { testarrayofboolsLength():number {
var offset = this.bb.__offset(this.bb_pos, 52); var offset = this.bb!.__offset(this.bb_pos, 52);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
* @returns {Int8Array} * @returns {Int8Array}
*/ */
testarrayofboolsArray():Int8Array|null { testarrayofboolsArray():Int8Array|null {
var offset = this.bb.__offset(this.bb_pos, 52); var offset = this.bb!.__offset(this.bb_pos, 52);
return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; return offset ? new Int8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
testf():number { testf():number {
var offset = this.bb.__offset(this.bb_pos, 54); var offset = this.bb!.__offset(this.bb_pos, 54);
return offset ? this.bb.readFloat32(this.bb_pos + offset) : 3.14159; return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.14159;
}; };
/** /**
...@@ -1220,13 +1220,13 @@ testf():number { ...@@ -1220,13 +1220,13 @@ testf():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testf(value:number):boolean { mutate_testf(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 54); var offset = this.bb!.__offset(this.bb_pos, 54);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb!.writeFloat32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1234,8 +1234,8 @@ mutate_testf(value:number):boolean { ...@@ -1234,8 +1234,8 @@ mutate_testf(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
testf2():number { testf2():number {
var offset = this.bb.__offset(this.bb_pos, 56); var offset = this.bb!.__offset(this.bb_pos, 56);
return offset ? this.bb.readFloat32(this.bb_pos + offset) : 3.0; return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 3.0;
}; };
/** /**
...@@ -1243,13 +1243,13 @@ testf2():number { ...@@ -1243,13 +1243,13 @@ testf2():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testf2(value:number):boolean { mutate_testf2(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 56); var offset = this.bb!.__offset(this.bb_pos, 56);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb!.writeFloat32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1257,8 +1257,8 @@ mutate_testf2(value:number):boolean { ...@@ -1257,8 +1257,8 @@ mutate_testf2(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
testf3():number { testf3():number {
var offset = this.bb.__offset(this.bb_pos, 58); var offset = this.bb!.__offset(this.bb_pos, 58);
return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0; return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
}; };
/** /**
...@@ -1266,13 +1266,13 @@ testf3():number { ...@@ -1266,13 +1266,13 @@ testf3():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_testf3(value:number):boolean { mutate_testf3(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 58); var offset = this.bb!.__offset(this.bb_pos, 58);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb!.writeFloat32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1284,16 +1284,16 @@ mutate_testf3(value:number):boolean { ...@@ -1284,16 +1284,16 @@ mutate_testf3(value:number):boolean {
testarrayofstring2(index: number):string testarrayofstring2(index: number):string
testarrayofstring2(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array testarrayofstring2(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
testarrayofstring2(index: number,optionalEncoding?:any):string|Uint8Array|null { testarrayofstring2(index: number,optionalEncoding?:any):string|Uint8Array|null {
var offset = this.bb.__offset(this.bb_pos, 60); var offset = this.bb!.__offset(this.bb_pos, 60);
return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
testarrayofstring2Length():number { testarrayofstring2Length():number {
var offset = this.bb.__offset(this.bb_pos, 60); var offset = this.bb!.__offset(this.bb_pos, 60);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -1302,16 +1302,16 @@ testarrayofstring2Length():number { ...@@ -1302,16 +1302,16 @@ testarrayofstring2Length():number {
* @returns {MyGame.Example.Ability} * @returns {MyGame.Example.Ability}
*/ */
testarrayofsortedstruct(index: number, obj?:MyGame.Example.Ability):MyGame.Example.Ability|null { testarrayofsortedstruct(index: number, obj?:MyGame.Example.Ability):MyGame.Example.Ability|null {
var offset = this.bb.__offset(this.bb_pos, 62); var offset = this.bb!.__offset(this.bb_pos, 62);
return offset ? (obj || new MyGame.Example.Ability).__init(this.bb.__vector(this.bb_pos + offset) + index * 8, this.bb) : null; return offset ? (obj || new MyGame.Example.Ability).__init(this.bb!.__vector(this.bb_pos + offset) + index * 8, this.bb!) : null;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
testarrayofsortedstructLength():number { testarrayofsortedstructLength():number {
var offset = this.bb.__offset(this.bb_pos, 62); var offset = this.bb!.__offset(this.bb_pos, 62);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -1319,24 +1319,24 @@ testarrayofsortedstructLength():number { ...@@ -1319,24 +1319,24 @@ testarrayofsortedstructLength():number {
* @returns {number} * @returns {number}
*/ */
flex(index: number):number|null { flex(index: number):number|null {
var offset = this.bb.__offset(this.bb_pos, 64); var offset = this.bb!.__offset(this.bb_pos, 64);
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0; return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
flexLength():number { flexLength():number {
var offset = this.bb.__offset(this.bb_pos, 64); var offset = this.bb!.__offset(this.bb_pos, 64);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
* @returns {Uint8Array} * @returns {Uint8Array}
*/ */
flexArray():Uint8Array|null { flexArray():Uint8Array|null {
var offset = this.bb.__offset(this.bb_pos, 64); var offset = this.bb!.__offset(this.bb_pos, 64);
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
}; };
/** /**
...@@ -1345,16 +1345,16 @@ flexArray():Uint8Array|null { ...@@ -1345,16 +1345,16 @@ flexArray():Uint8Array|null {
* @returns {MyGame.Example.Test} * @returns {MyGame.Example.Test}
*/ */
test5(index: number, obj?:MyGame.Example.Test):MyGame.Example.Test|null { test5(index: number, obj?:MyGame.Example.Test):MyGame.Example.Test|null {
var offset = this.bb.__offset(this.bb_pos, 66); var offset = this.bb!.__offset(this.bb_pos, 66);
return offset ? (obj || new MyGame.Example.Test).__init(this.bb.__vector(this.bb_pos + offset) + index * 4, this.bb) : null; return offset ? (obj || new MyGame.Example.Test).__init(this.bb!.__vector(this.bb_pos + offset) + index * 4, this.bb!) : null;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
test5Length():number { test5Length():number {
var offset = this.bb.__offset(this.bb_pos, 66); var offset = this.bb!.__offset(this.bb_pos, 66);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -1362,16 +1362,16 @@ test5Length():number { ...@@ -1362,16 +1362,16 @@ test5Length():number {
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
*/ */
vectorOfLongs(index: number):flatbuffers.Long|null { vectorOfLongs(index: number):flatbuffers.Long|null {
var offset = this.bb.__offset(this.bb_pos, 68); var offset = this.bb!.__offset(this.bb_pos, 68);
return offset ? this.bb.readInt64(this.bb.__vector(this.bb_pos + offset) + index * 8) : this.bb.createLong(0, 0); return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : this.bb!.createLong(0, 0);
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
vectorOfLongsLength():number { vectorOfLongsLength():number {
var offset = this.bb.__offset(this.bb_pos, 68); var offset = this.bb!.__offset(this.bb_pos, 68);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -1379,24 +1379,24 @@ vectorOfLongsLength():number { ...@@ -1379,24 +1379,24 @@ vectorOfLongsLength():number {
* @returns {number} * @returns {number}
*/ */
vectorOfDoubles(index: number):number|null { vectorOfDoubles(index: number):number|null {
var offset = this.bb.__offset(this.bb_pos, 70); var offset = this.bb!.__offset(this.bb_pos, 70);
return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0; return offset ? this.bb!.readFloat64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : 0;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
vectorOfDoublesLength():number { vectorOfDoublesLength():number {
var offset = this.bb.__offset(this.bb_pos, 70); var offset = this.bb!.__offset(this.bb_pos, 70);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
* @returns {Float64Array} * @returns {Float64Array}
*/ */
vectorOfDoublesArray():Float64Array|null { vectorOfDoublesArray():Float64Array|null {
var offset = this.bb.__offset(this.bb_pos, 70); var offset = this.bb!.__offset(this.bb_pos, 70);
return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; return offset ? new Float64Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
}; };
/** /**
...@@ -1404,8 +1404,8 @@ vectorOfDoublesArray():Float64Array|null { ...@@ -1404,8 +1404,8 @@ vectorOfDoublesArray():Float64Array|null {
* @returns {MyGame.InParentNamespace|null} * @returns {MyGame.InParentNamespace|null}
*/ */
parentNamespaceTest(obj?:MyGame.InParentNamespace):MyGame.InParentNamespace|null { parentNamespaceTest(obj?:MyGame.InParentNamespace):MyGame.InParentNamespace|null {
var offset = this.bb.__offset(this.bb_pos, 72); var offset = this.bb!.__offset(this.bb_pos, 72);
return offset ? (obj || new MyGame.InParentNamespace).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; return offset ? (obj || new MyGame.InParentNamespace).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}; };
/** /**
...@@ -1928,7 +1928,7 @@ export class TypeAliases { ...@@ -1928,7 +1928,7 @@ export class TypeAliases {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -1958,8 +1958,8 @@ static getRootAsTypeAliases(bb:flatbuffers.ByteBuffer, obj?:TypeAliases):TypeAli ...@@ -1958,8 +1958,8 @@ static getRootAsTypeAliases(bb:flatbuffers.ByteBuffer, obj?:TypeAliases):TypeAli
* @returns {number} * @returns {number}
*/ */
i8():number { i8():number {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? this.bb.readInt8(this.bb_pos + offset) : 0; return offset ? this.bb!.readInt8(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -1967,13 +1967,13 @@ i8():number { ...@@ -1967,13 +1967,13 @@ i8():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_i8(value:number):boolean { mutate_i8(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt8(this.bb_pos + offset, value); this.bb!.writeInt8(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -1981,8 +1981,8 @@ mutate_i8(value:number):boolean { ...@@ -1981,8 +1981,8 @@ mutate_i8(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
u8():number { u8():number {
var offset = this.bb.__offset(this.bb_pos, 6); var offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? this.bb.readUint8(this.bb_pos + offset) : 0; return offset ? this.bb!.readUint8(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -1990,13 +1990,13 @@ u8():number { ...@@ -1990,13 +1990,13 @@ u8():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_u8(value:number):boolean { mutate_u8(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 6); var offset = this.bb!.__offset(this.bb_pos, 6);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint8(this.bb_pos + offset, value); this.bb!.writeUint8(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -2004,8 +2004,8 @@ mutate_u8(value:number):boolean { ...@@ -2004,8 +2004,8 @@ mutate_u8(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
i16():number { i16():number {
var offset = this.bb.__offset(this.bb_pos, 8); var offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -2013,13 +2013,13 @@ i16():number { ...@@ -2013,13 +2013,13 @@ i16():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_i16(value:number):boolean { mutate_i16(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 8); var offset = this.bb!.__offset(this.bb_pos, 8);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt16(this.bb_pos + offset, value); this.bb!.writeInt16(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -2027,8 +2027,8 @@ mutate_i16(value:number):boolean { ...@@ -2027,8 +2027,8 @@ mutate_i16(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
u16():number { u16():number {
var offset = this.bb.__offset(this.bb_pos, 10); var offset = this.bb!.__offset(this.bb_pos, 10);
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0; return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -2036,13 +2036,13 @@ u16():number { ...@@ -2036,13 +2036,13 @@ u16():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_u16(value:number):boolean { mutate_u16(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 10); var offset = this.bb!.__offset(this.bb_pos, 10);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint16(this.bb_pos + offset, value); this.bb!.writeUint16(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -2050,8 +2050,8 @@ mutate_u16(value:number):boolean { ...@@ -2050,8 +2050,8 @@ mutate_u16(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
i32():number { i32():number {
var offset = this.bb.__offset(this.bb_pos, 12); var offset = this.bb!.__offset(this.bb_pos, 12);
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0; return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -2059,13 +2059,13 @@ i32():number { ...@@ -2059,13 +2059,13 @@ i32():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_i32(value:number):boolean { mutate_i32(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 12); var offset = this.bb!.__offset(this.bb_pos, 12);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt32(this.bb_pos + offset, value); this.bb!.writeInt32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -2073,8 +2073,8 @@ mutate_i32(value:number):boolean { ...@@ -2073,8 +2073,8 @@ mutate_i32(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
u32():number { u32():number {
var offset = this.bb.__offset(this.bb_pos, 14); var offset = this.bb!.__offset(this.bb_pos, 14);
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -2082,13 +2082,13 @@ u32():number { ...@@ -2082,13 +2082,13 @@ u32():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_u32(value:number):boolean { mutate_u32(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 14); var offset = this.bb!.__offset(this.bb_pos, 14);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint32(this.bb_pos + offset, value); this.bb!.writeUint32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -2096,8 +2096,8 @@ mutate_u32(value:number):boolean { ...@@ -2096,8 +2096,8 @@ mutate_u32(value:number):boolean {
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
*/ */
i64():flatbuffers.Long { i64():flatbuffers.Long {
var offset = this.bb.__offset(this.bb_pos, 16); var offset = this.bb!.__offset(this.bb_pos, 16);
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0); return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0);
}; };
/** /**
...@@ -2105,13 +2105,13 @@ i64():flatbuffers.Long { ...@@ -2105,13 +2105,13 @@ i64():flatbuffers.Long {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_i64(value:flatbuffers.Long):boolean { mutate_i64(value:flatbuffers.Long):boolean {
var offset = this.bb.__offset(this.bb_pos, 16); var offset = this.bb!.__offset(this.bb_pos, 16);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt64(this.bb_pos + offset, value); this.bb!.writeInt64(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -2119,8 +2119,8 @@ mutate_i64(value:flatbuffers.Long):boolean { ...@@ -2119,8 +2119,8 @@ mutate_i64(value:flatbuffers.Long):boolean {
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
*/ */
u64():flatbuffers.Long { u64():flatbuffers.Long {
var offset = this.bb.__offset(this.bb_pos, 18); var offset = this.bb!.__offset(this.bb_pos, 18);
return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0); return offset ? this.bb!.readUint64(this.bb_pos + offset) : this.bb!.createLong(0, 0);
}; };
/** /**
...@@ -2128,13 +2128,13 @@ u64():flatbuffers.Long { ...@@ -2128,13 +2128,13 @@ u64():flatbuffers.Long {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_u64(value:flatbuffers.Long):boolean { mutate_u64(value:flatbuffers.Long):boolean {
var offset = this.bb.__offset(this.bb_pos, 18); var offset = this.bb!.__offset(this.bb_pos, 18);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint64(this.bb_pos + offset, value); this.bb!.writeUint64(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -2142,8 +2142,8 @@ mutate_u64(value:flatbuffers.Long):boolean { ...@@ -2142,8 +2142,8 @@ mutate_u64(value:flatbuffers.Long):boolean {
* @returns {number} * @returns {number}
*/ */
f32():number { f32():number {
var offset = this.bb.__offset(this.bb_pos, 20); var offset = this.bb!.__offset(this.bb_pos, 20);
return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0; return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
}; };
/** /**
...@@ -2151,13 +2151,13 @@ f32():number { ...@@ -2151,13 +2151,13 @@ f32():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_f32(value:number):boolean { mutate_f32(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 20); var offset = this.bb!.__offset(this.bb_pos, 20);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb!.writeFloat32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -2165,8 +2165,8 @@ mutate_f32(value:number):boolean { ...@@ -2165,8 +2165,8 @@ mutate_f32(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
f64():number { f64():number {
var offset = this.bb.__offset(this.bb_pos, 22); var offset = this.bb!.__offset(this.bb_pos, 22);
return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0; return offset ? this.bb!.readFloat64(this.bb_pos + offset) : 0.0;
}; };
/** /**
...@@ -2174,13 +2174,13 @@ f64():number { ...@@ -2174,13 +2174,13 @@ f64():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_f64(value:number):boolean { mutate_f64(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 22); var offset = this.bb!.__offset(this.bb_pos, 22);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeFloat64(this.bb_pos + offset, value); this.bb!.writeFloat64(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -2189,24 +2189,24 @@ mutate_f64(value:number):boolean { ...@@ -2189,24 +2189,24 @@ mutate_f64(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
v8(index: number):number|null { v8(index: number):number|null {
var offset = this.bb.__offset(this.bb_pos, 24); var offset = this.bb!.__offset(this.bb_pos, 24);
return offset ? this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : 0; return offset ? this.bb!.readInt8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
v8Length():number { v8Length():number {
var offset = this.bb.__offset(this.bb_pos, 24); var offset = this.bb!.__offset(this.bb_pos, 24);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
* @returns {Int8Array} * @returns {Int8Array}
*/ */
v8Array():Int8Array|null { v8Array():Int8Array|null {
var offset = this.bb.__offset(this.bb_pos, 24); var offset = this.bb!.__offset(this.bb_pos, 24);
return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; return offset ? new Int8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
}; };
/** /**
...@@ -2214,24 +2214,24 @@ v8Array():Int8Array|null { ...@@ -2214,24 +2214,24 @@ v8Array():Int8Array|null {
* @returns {number} * @returns {number}
*/ */
vf64(index: number):number|null { vf64(index: number):number|null {
var offset = this.bb.__offset(this.bb_pos, 26); var offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0; return offset ? this.bb!.readFloat64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : 0;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
vf64Length():number { vf64Length():number {
var offset = this.bb.__offset(this.bb_pos, 26); var offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
* @returns {Float64Array} * @returns {Float64Array}
*/ */
vf64Array():Float64Array|null { vf64Array():Float64Array|null {
var offset = this.bb.__offset(this.bb_pos, 26); var offset = this.bb!.__offset(this.bb_pos, 26);
return offset ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; return offset ? new Float64Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
}; };
/** /**
......
...@@ -18,7 +18,7 @@ export class TableInNestedNS { ...@@ -18,7 +18,7 @@ export class TableInNestedNS {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -48,8 +48,8 @@ static getRootAsTableInNestedNS(bb:flatbuffers.ByteBuffer, obj?:TableInNestedNS) ...@@ -48,8 +48,8 @@ static getRootAsTableInNestedNS(bb:flatbuffers.ByteBuffer, obj?:TableInNestedNS)
* @returns {number} * @returns {number}
*/ */
foo():number { foo():number {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0; return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -57,13 +57,13 @@ foo():number { ...@@ -57,13 +57,13 @@ foo():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_foo(value:number):boolean { mutate_foo(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt32(this.bb_pos + offset, value); this.bb!.writeInt32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -101,7 +101,7 @@ export class StructInNestedNS { ...@@ -101,7 +101,7 @@ export class StructInNestedNS {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -122,7 +122,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):StructInNestedNS { ...@@ -122,7 +122,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):StructInNestedNS {
* @returns {number} * @returns {number}
*/ */
a():number { a():number {
return this.bb.readInt32(this.bb_pos); return this.bb!.readInt32(this.bb_pos);
}; };
/** /**
...@@ -130,13 +130,13 @@ a():number { ...@@ -130,13 +130,13 @@ a():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_a(value:number):boolean { mutate_a(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 0); var offset = this.bb!.__offset(this.bb_pos, 0);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt32(this.bb_pos + offset, value); this.bb!.writeInt32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -144,7 +144,7 @@ mutate_a(value:number):boolean { ...@@ -144,7 +144,7 @@ mutate_a(value:number):boolean {
* @returns {number} * @returns {number}
*/ */
b():number { b():number {
return this.bb.readInt32(this.bb_pos + 4); return this.bb!.readInt32(this.bb_pos + 4);
}; };
/** /**
...@@ -152,13 +152,13 @@ b():number { ...@@ -152,13 +152,13 @@ b():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_b(value:number):boolean { mutate_b(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt32(this.bb_pos + offset, value); this.bb!.writeInt32(this.bb_pos + offset, value);
return true; return true;
}; };
......
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
import * as NS11563891686210618450 from "./namespace_test1_generated"; import * as NS9459827973991502386 from "./namespace_test1_generated";
/** /**
* @constructor * @constructor
*/ */
...@@ -9,7 +9,7 @@ export class TableInFirstNS { ...@@ -9,7 +9,7 @@ export class TableInFirstNS {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -39,31 +39,31 @@ static getRootAsTableInFirstNS(bb:flatbuffers.ByteBuffer, obj?:TableInFirstNS):T ...@@ -39,31 +39,31 @@ static getRootAsTableInFirstNS(bb:flatbuffers.ByteBuffer, obj?:TableInFirstNS):T
* @param {NamespaceA.NamespaceB.TableInNestedNS=} obj * @param {NamespaceA.NamespaceB.TableInNestedNS=} obj
* @returns {NamespaceA.NamespaceB.TableInNestedNS|null} * @returns {NamespaceA.NamespaceB.TableInNestedNS|null}
*/ */
fooTable(obj?:NS11563891686210618450.NamespaceA.NamespaceB.TableInNestedNS):NS11563891686210618450.NamespaceA.NamespaceB.TableInNestedNS|null { fooTable(obj?:NS9459827973991502386.NamespaceA.NamespaceB.TableInNestedNS):NS9459827973991502386.NamespaceA.NamespaceB.TableInNestedNS|null {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? (obj || new NS11563891686210618450.NamespaceA.NamespaceB.TableInNestedNS).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; return offset ? (obj || new NS9459827973991502386.NamespaceA.NamespaceB.TableInNestedNS).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}; };
/** /**
* @returns {NamespaceA.NamespaceB.EnumInNestedNS} * @returns {NamespaceA.NamespaceB.EnumInNestedNS}
*/ */
fooEnum():NS11563891686210618450.NamespaceA.NamespaceB.EnumInNestedNS { fooEnum():NS9459827973991502386.NamespaceA.NamespaceB.EnumInNestedNS {
var offset = this.bb.__offset(this.bb_pos, 6); var offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? /** @type {NamespaceA.NamespaceB.EnumInNestedNS} */ (this.bb.readInt8(this.bb_pos + offset)) : NS11563891686210618450.NamespaceA.NamespaceB.EnumInNestedNS.A; return offset ? /** @type {NamespaceA.NamespaceB.EnumInNestedNS} */ (this.bb!.readInt8(this.bb_pos + offset)) : NS9459827973991502386.NamespaceA.NamespaceB.EnumInNestedNS.A;
}; };
/** /**
* @param {NamespaceA.NamespaceB.EnumInNestedNS} value * @param {NamespaceA.NamespaceB.EnumInNestedNS} value
* @returns {boolean} * @returns {boolean}
*/ */
mutate_foo_enum(value:NS11563891686210618450.NamespaceA.NamespaceB.EnumInNestedNS):boolean { mutate_foo_enum(value:NS9459827973991502386.NamespaceA.NamespaceB.EnumInNestedNS):boolean {
var offset = this.bb.__offset(this.bb_pos, 6); var offset = this.bb!.__offset(this.bb_pos, 6);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt8(this.bb_pos + offset, value); this.bb!.writeInt8(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -71,9 +71,9 @@ mutate_foo_enum(value:NS11563891686210618450.NamespaceA.NamespaceB.EnumInNestedN ...@@ -71,9 +71,9 @@ mutate_foo_enum(value:NS11563891686210618450.NamespaceA.NamespaceB.EnumInNestedN
* @param {NamespaceA.NamespaceB.StructInNestedNS=} obj * @param {NamespaceA.NamespaceB.StructInNestedNS=} obj
* @returns {NamespaceA.NamespaceB.StructInNestedNS|null} * @returns {NamespaceA.NamespaceB.StructInNestedNS|null}
*/ */
fooStruct(obj?:NS11563891686210618450.NamespaceA.NamespaceB.StructInNestedNS):NS11563891686210618450.NamespaceA.NamespaceB.StructInNestedNS|null { fooStruct(obj?:NS9459827973991502386.NamespaceA.NamespaceB.StructInNestedNS):NS9459827973991502386.NamespaceA.NamespaceB.StructInNestedNS|null {
var offset = this.bb.__offset(this.bb_pos, 8); var offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? (obj || new NS11563891686210618450.NamespaceA.NamespaceB.StructInNestedNS).__init(this.bb_pos + offset, this.bb) : null; return offset ? (obj || new NS9459827973991502386.NamespaceA.NamespaceB.StructInNestedNS).__init(this.bb_pos + offset, this.bb!) : null;
}; };
/** /**
...@@ -95,8 +95,8 @@ static addFooTable(builder:flatbuffers.Builder, fooTableOffset:flatbuffers.Offse ...@@ -95,8 +95,8 @@ static addFooTable(builder:flatbuffers.Builder, fooTableOffset:flatbuffers.Offse
* @param {flatbuffers.Builder} builder * @param {flatbuffers.Builder} builder
* @param {NamespaceA.NamespaceB.EnumInNestedNS} fooEnum * @param {NamespaceA.NamespaceB.EnumInNestedNS} fooEnum
*/ */
static addFooEnum(builder:flatbuffers.Builder, fooEnum:NS11563891686210618450.NamespaceA.NamespaceB.EnumInNestedNS) { static addFooEnum(builder:flatbuffers.Builder, fooEnum:NS9459827973991502386.NamespaceA.NamespaceB.EnumInNestedNS) {
builder.addFieldInt8(1, fooEnum, NS11563891686210618450.NamespaceA.NamespaceB.EnumInNestedNS.A); builder.addFieldInt8(1, fooEnum, NS9459827973991502386.NamespaceA.NamespaceB.EnumInNestedNS.A);
}; };
/** /**
...@@ -126,7 +126,7 @@ export class TableInC { ...@@ -126,7 +126,7 @@ export class TableInC {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -157,8 +157,8 @@ static getRootAsTableInC(bb:flatbuffers.ByteBuffer, obj?:TableInC):TableInC { ...@@ -157,8 +157,8 @@ static getRootAsTableInC(bb:flatbuffers.ByteBuffer, obj?:TableInC):TableInC {
* @returns {NamespaceA.TableInFirstNS|null} * @returns {NamespaceA.TableInFirstNS|null}
*/ */
referToA1(obj?:NamespaceA.TableInFirstNS):NamespaceA.TableInFirstNS|null { referToA1(obj?:NamespaceA.TableInFirstNS):NamespaceA.TableInFirstNS|null {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? (obj || new NamespaceA.TableInFirstNS).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; return offset ? (obj || new NamespaceA.TableInFirstNS).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}; };
/** /**
...@@ -166,8 +166,8 @@ referToA1(obj?:NamespaceA.TableInFirstNS):NamespaceA.TableInFirstNS|null { ...@@ -166,8 +166,8 @@ referToA1(obj?:NamespaceA.TableInFirstNS):NamespaceA.TableInFirstNS|null {
* @returns {NamespaceA.SecondTableInA|null} * @returns {NamespaceA.SecondTableInA|null}
*/ */
referToA2(obj?:NamespaceA.SecondTableInA):NamespaceA.SecondTableInA|null { referToA2(obj?:NamespaceA.SecondTableInA):NamespaceA.SecondTableInA|null {
var offset = this.bb.__offset(this.bb_pos, 6); var offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? (obj || new NamespaceA.SecondTableInA).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; return offset ? (obj || new NamespaceA.SecondTableInA).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}; };
/** /**
...@@ -212,7 +212,7 @@ export class SecondTableInA { ...@@ -212,7 +212,7 @@ export class SecondTableInA {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -243,8 +243,8 @@ static getRootAsSecondTableInA(bb:flatbuffers.ByteBuffer, obj?:SecondTableInA):S ...@@ -243,8 +243,8 @@ static getRootAsSecondTableInA(bb:flatbuffers.ByteBuffer, obj?:SecondTableInA):S
* @returns {NamespaceC.TableInC|null} * @returns {NamespaceC.TableInC|null}
*/ */
referToC(obj?:NamespaceC.TableInC):NamespaceC.TableInC|null { referToC(obj?:NamespaceC.TableInC):NamespaceC.TableInC|null {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? (obj || new NamespaceC.TableInC).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; return offset ? (obj || new NamespaceC.TableInC).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}; };
/** /**
......
...@@ -20,7 +20,7 @@ export class Attacker { ...@@ -20,7 +20,7 @@ export class Attacker {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -50,8 +50,8 @@ static getRootAsAttacker(bb:flatbuffers.ByteBuffer, obj?:Attacker):Attacker { ...@@ -50,8 +50,8 @@ static getRootAsAttacker(bb:flatbuffers.ByteBuffer, obj?:Attacker):Attacker {
* @returns {number} * @returns {number}
*/ */
swordAttackDamage():number { swordAttackDamage():number {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0; return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}; };
/** /**
...@@ -59,13 +59,13 @@ swordAttackDamage():number { ...@@ -59,13 +59,13 @@ swordAttackDamage():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_sword_attack_damage(value:number):boolean { mutate_sword_attack_damage(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt32(this.bb_pos + offset, value); this.bb!.writeInt32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -101,7 +101,7 @@ export class Rapunzel { ...@@ -101,7 +101,7 @@ export class Rapunzel {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -122,7 +122,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):Rapunzel { ...@@ -122,7 +122,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):Rapunzel {
* @returns {number} * @returns {number}
*/ */
hairLength():number { hairLength():number {
return this.bb.readInt32(this.bb_pos); return this.bb!.readInt32(this.bb_pos);
}; };
/** /**
...@@ -130,13 +130,13 @@ hairLength():number { ...@@ -130,13 +130,13 @@ hairLength():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_hair_length(value:number):boolean { mutate_hair_length(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 0); var offset = this.bb!.__offset(this.bb_pos, 0);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt32(this.bb_pos + offset, value); this.bb!.writeInt32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -159,7 +159,7 @@ export class BookReader { ...@@ -159,7 +159,7 @@ export class BookReader {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -180,7 +180,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):BookReader { ...@@ -180,7 +180,7 @@ __init(i:number, bb:flatbuffers.ByteBuffer):BookReader {
* @returns {number} * @returns {number}
*/ */
booksRead():number { booksRead():number {
return this.bb.readInt32(this.bb_pos); return this.bb!.readInt32(this.bb_pos);
}; };
/** /**
...@@ -188,13 +188,13 @@ booksRead():number { ...@@ -188,13 +188,13 @@ booksRead():number {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_books_read(value:number):boolean { mutate_books_read(value:number):boolean {
var offset = this.bb.__offset(this.bb_pos, 0); var offset = this.bb!.__offset(this.bb_pos, 0);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeInt32(this.bb_pos + offset, value); this.bb!.writeInt32(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -217,7 +217,7 @@ export class Movie { ...@@ -217,7 +217,7 @@ export class Movie {
/** /**
* @type {flatbuffers.ByteBuffer} * @type {flatbuffers.ByteBuffer}
*/ */
bb: flatbuffers.ByteBuffer; bb: flatbuffers.ByteBuffer|null = null;
/** /**
* @type {number} * @type {number}
...@@ -255,8 +255,8 @@ static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean { ...@@ -255,8 +255,8 @@ static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean {
* @returns {Character} * @returns {Character}
*/ */
mainCharacterType():Character { mainCharacterType():Character {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? /** @type {Character} */ (this.bb.readUint8(this.bb_pos + offset)) : Character.NONE; return offset ? /** @type {Character} */ (this.bb!.readUint8(this.bb_pos + offset)) : Character.NONE;
}; };
/** /**
...@@ -264,13 +264,13 @@ mainCharacterType():Character { ...@@ -264,13 +264,13 @@ mainCharacterType():Character {
* @returns {boolean} * @returns {boolean}
*/ */
mutate_main_character_type(value:Character):boolean { mutate_main_character_type(value:Character):boolean {
var offset = this.bb.__offset(this.bb_pos, 4); var offset = this.bb!.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
} }
this.bb.writeUint8(this.bb_pos + offset, value); this.bb!.writeUint8(this.bb_pos + offset, value);
return true; return true;
}; };
...@@ -279,8 +279,8 @@ mutate_main_character_type(value:Character):boolean { ...@@ -279,8 +279,8 @@ mutate_main_character_type(value:Character):boolean {
* @returns {?flatbuffers.Table} * @returns {?flatbuffers.Table}
*/ */
mainCharacter<T extends flatbuffers.Table>(obj:T):T|null { mainCharacter<T extends flatbuffers.Table>(obj:T):T|null {
var offset = this.bb.__offset(this.bb_pos, 6); var offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? this.bb.__union(obj, this.bb_pos + offset) : null; return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
}; };
/** /**
...@@ -288,24 +288,24 @@ mainCharacter<T extends flatbuffers.Table>(obj:T):T|null { ...@@ -288,24 +288,24 @@ mainCharacter<T extends flatbuffers.Table>(obj:T):T|null {
* @returns {Character} * @returns {Character}
*/ */
charactersType(index: number):Character|null { charactersType(index: number):Character|null {
var offset = this.bb.__offset(this.bb_pos, 8); var offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? /** @type {Character} */ (this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index)) : /** @type {Character} */ (0); return offset ? /** @type {Character} */ (this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index)) : /** @type {Character} */ (0);
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
charactersTypeLength():number { charactersTypeLength():number {
var offset = this.bb.__offset(this.bb_pos, 8); var offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
* @returns {Uint8Array} * @returns {Uint8Array}
*/ */
charactersTypeArray():Uint8Array|null { charactersTypeArray():Uint8Array|null {
var offset = this.bb.__offset(this.bb_pos, 8); var offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
}; };
/** /**
...@@ -314,16 +314,16 @@ charactersTypeArray():Uint8Array|null { ...@@ -314,16 +314,16 @@ charactersTypeArray():Uint8Array|null {
* @returns {?flatbuffers.Table} * @returns {?flatbuffers.Table}
*/ */
characters<T extends flatbuffers.Table>(index: number, obj:T):T|null { characters<T extends flatbuffers.Table>(index: number, obj:T):T|null {
var offset = this.bb.__offset(this.bb_pos, 10); var offset = this.bb!.__offset(this.bb_pos, 10);
return offset ? this.bb.__union(obj, this.bb.__vector(this.bb_pos + offset) + index * 4) : null; return offset ? this.bb!.__union(obj, this.bb!.__vector(this.bb_pos + offset) + index * 4) : null;
}; };
/** /**
* @returns {number} * @returns {number}
*/ */
charactersLength():number { charactersLength():number {
var offset = this.bb.__offset(this.bb_pos, 10); var offset = this.bb!.__offset(this.bb_pos, 10);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}; };
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment