UNPKG

nxkit

Version:

This is a collection of tools, independent of any other libraries

41 lines (40 loc) 963 B
declare type Buffer = Uint8Array; export declare enum Types { T_BIND = 241, T_EVENT = 242, T_CALL = 243, T_CALLBACK = 244, T_PING = 245, T_PONG = 246 } export declare const PING_BUFFER: Uint8Array; export declare const PONG_BUFFER: Uint8Array; export interface Data { type?: Types; service?: string; name?: string; data?: any; error?: Error; cb?: number; sender?: string; } export declare class DataBuilder { type?: Types; service?: string; name?: string; data?: any; error?: Error; cb?: number; sender?: string; constructor(opts: Data); static parse(packet: Buffer | string, isText: boolean, isGzip?: boolean): Promise<DataBuilder | undefined>; builder(isGzip?: boolean): Promise<Uint8Array>; toJSON(): any[]; isPing(): boolean; isPong(): boolean; isBind(): boolean; isEvent(): boolean; isCall(): boolean; isCallback(): boolean; } export {};