-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from Producement/js_to_ts
Fixed missing target from flatbuffers_js with flatbuffers_ts in flatbuffers
- Loading branch information
Showing
8 changed files
with
166 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// automatically generated by the FlatBuffers compiler, do not modify | ||
|
||
import * as flatbuffers from 'flatbuffers'; | ||
|
||
export class ArmorDecodeRequest { | ||
bb: flatbuffers.ByteBuffer|null = null; | ||
bb_pos = 0; | ||
__init(i:number, bb:flatbuffers.ByteBuffer):ArmorDecodeRequest { | ||
this.bb_pos = i; | ||
this.bb = bb; | ||
return this; | ||
} | ||
|
||
static getRootAsArmorDecodeRequest(bb:flatbuffers.ByteBuffer, obj?:ArmorDecodeRequest):ArmorDecodeRequest { | ||
return (obj || new ArmorDecodeRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | ||
} | ||
|
||
static getSizePrefixedRootAsArmorDecodeRequest(bb:flatbuffers.ByteBuffer, obj?:ArmorDecodeRequest):ArmorDecodeRequest { | ||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | ||
return (obj || new ArmorDecodeRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | ||
} | ||
|
||
packet():string|null | ||
packet(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null | ||
packet(optionalEncoding?:any):string|Uint8Array|null { | ||
const offset = this.bb!.__offset(this.bb_pos, 4); | ||
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; | ||
} | ||
|
||
static startArmorDecodeRequest(builder:flatbuffers.Builder) { | ||
builder.startObject(1); | ||
} | ||
|
||
static addPacket(builder:flatbuffers.Builder, packetOffset:flatbuffers.Offset) { | ||
builder.addFieldOffset(0, packetOffset, 0); | ||
} | ||
|
||
static endArmorDecodeRequest(builder:flatbuffers.Builder):flatbuffers.Offset { | ||
const offset = builder.endObject(); | ||
return offset; | ||
} | ||
|
||
static createArmorDecodeRequest(builder:flatbuffers.Builder, packetOffset:flatbuffers.Offset):flatbuffers.Offset { | ||
ArmorDecodeRequest.startArmorDecodeRequest(builder); | ||
ArmorDecodeRequest.addPacket(builder, packetOffset); | ||
return ArmorDecodeRequest.endArmorDecodeRequest(builder); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// automatically generated by the FlatBuffers compiler, do not modify | ||
|
||
import * as flatbuffers from 'flatbuffers'; | ||
|
||
export class ArmorEncodeRequest { | ||
bb: flatbuffers.ByteBuffer|null = null; | ||
bb_pos = 0; | ||
__init(i:number, bb:flatbuffers.ByteBuffer):ArmorEncodeRequest { | ||
this.bb_pos = i; | ||
this.bb = bb; | ||
return this; | ||
} | ||
|
||
static getRootAsArmorEncodeRequest(bb:flatbuffers.ByteBuffer, obj?:ArmorEncodeRequest):ArmorEncodeRequest { | ||
return (obj || new ArmorEncodeRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | ||
} | ||
|
||
static getSizePrefixedRootAsArmorEncodeRequest(bb:flatbuffers.ByteBuffer, obj?:ArmorEncodeRequest):ArmorEncodeRequest { | ||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | ||
return (obj || new ArmorEncodeRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | ||
} | ||
|
||
packet(index: number):number|null { | ||
const offset = this.bb!.__offset(this.bb_pos, 4); | ||
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0; | ||
} | ||
|
||
packetLength():number { | ||
const offset = this.bb!.__offset(this.bb_pos, 4); | ||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; | ||
} | ||
|
||
packetArray():Uint8Array|null { | ||
const offset = this.bb!.__offset(this.bb_pos, 4); | ||
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; | ||
} | ||
|
||
static startArmorEncodeRequest(builder:flatbuffers.Builder) { | ||
builder.startObject(1); | ||
} | ||
|
||
static addPacket(builder:flatbuffers.Builder, packetOffset:flatbuffers.Offset) { | ||
builder.addFieldOffset(0, packetOffset, 0); | ||
} | ||
|
||
static createPacketVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset { | ||
builder.startVector(1, data.length, 1); | ||
for (let i = data.length - 1; i >= 0; i--) { | ||
builder.addInt8(data[i]!); | ||
} | ||
return builder.endVector(); | ||
} | ||
|
||
static startPacketVector(builder:flatbuffers.Builder, numElems:number) { | ||
builder.startVector(1, numElems, 1); | ||
} | ||
|
||
static endArmorEncodeRequest(builder:flatbuffers.Builder):flatbuffers.Offset { | ||
const offset = builder.endObject(); | ||
return offset; | ||
} | ||
|
||
static createArmorEncodeRequest(builder:flatbuffers.Builder, packetOffset:flatbuffers.Offset):flatbuffers.Offset { | ||
ArmorEncodeRequest.startArmorEncodeRequest(builder); | ||
ArmorEncodeRequest.addPacket(builder, packetOffset); | ||
return ArmorEncodeRequest.endArmorEncodeRequest(builder); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters