Skip to content

Instantly share code, notes, and snippets.

@subash-a
Last active January 21, 2016 10:53
Show Gist options
  • Save subash-a/62397f16b3a05fdf625a to your computer and use it in GitHub Desktop.
Save subash-a/62397f16b3a05fdf625a to your computer and use it in GitHub Desktop.
interface BinaryWriterStatic {
new(): BinaryWriter;
}
interface BinaryWriter {
writeString(): void;
writeUint64(): void;
}
interface BinaryReaderStatic {
new(bytes: Uint8Array): BinaryReader;
}
interface BinaryReader {
readString(): string;
readUint64(): number;
isEndGroup(): boolean;
nextField(): void;
getFieldNumber(): number;
skipField(): void;
}
// methods contained in a general message object
interface MessageTypeStatic {
deserializeBinary(bytes: Uint8Array): MessageType;
deserializeBinaryFromReader(msg: MessageType, reader: BinaryReader): MessageType;
serializeBinary(): Uint8Array;
serializeBinaryToWriter(writer: BinaryWriter): Uint8Array;
new(opt?: Array<Object>): MessageType;
}
interface MessageType {
cloneMessage(): this;
toObject(includeInstance: boolean, msg: this): Object;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment