-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.d.ts
34 lines (34 loc) · 1.07 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
declare module 'socket.io-msgpack-parser' {
export class Encoder {
new()
encode(packet: any): ArrayBuffer
}
export class Decoder {
new()
add(obj: any): void
checkPacket(decoded: any): void
destroy(): void
decode(packet: any): any
// mixin from 'component-emitter'
addListener(event: string, listener: (...args: any[]) => void): this;
on(event: string, listener: (...args: any[]) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
removeListener(event: string, listener: (...args: any[]) => void): this;
removeEventListener(event: string): this;
off(event: string, listener: (...args: any[]) => void): this;
removeAllListeners(): this;
listeners(event: string): Function[];
emit(event: string, ...args: any[]): this;
hasListeners(event: string): boolean;
// known event
on(event: 'decoded', listener: (...args: any[]) => void): this;
}
export const protocol = 5
export enum PacketType {
CONNECT = 0,
DISCONNECT = 1,
EVENT = 2,
ACK = 3,
CONNECT_ERROR = 4,
}
}