import {BufferWriter} from './writer'; import {BufferReader} from './reader'; export interface Struct { inject(obj: Struct): this; clone(): Struct; getSize(extra?): number; write(bw: BufferWriter, extra?): BufferWriter; read(br: BufferReader, extra?): this; toString(): string; fromString(str: string, extra?): this; getJSON(): {[name: string]: any}; fromJSON(json: {[name: string]: any}, extra?): this; fromOptions(options, extra?): this; from(options, extra?): this; format(): {[name: string]: any}; encode(extra?): Buffer; decode(data: Buffer, extra?): this; toHex(extra?): string; fromHex(str: string, extra?): this; toBase64(): string; fromBase64(str: string, extra?): this; toJSON(): {[name: string]: any}; /* * Aliases */ toWriter(bw: BufferWriter, extra?): BufferWriter; fromReader(br: BufferReader, extra?): this; toRaw(extra?): Buffer; fromRaw(data: Buffer, extra?): this; } export interface StructCtor { new(...args: any[]): T; read(br: BufferReader, extra?): T; decode(data: Buffer, extra?): T; fromHex(str: string, extra?): T; fromBase64(str: string, extra?): T; fromString(str: string, extra?): T; fromJSON(json: {[name: string]: any}, extra?): T; fromOptions(options, extra?): T; from(options, extra?): T; fromReader(br: BufferReader, extra?): T; fromRaw(data: Buffer, extra?): T; }