forked from ipald/nativescript-socket.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
31 lines (24 loc) · 1.09 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
import { Common, SocketOptions, enableDebug, disableDebug } from "./socketio.common";
export { SocketOptions, enableDebug, disableDebug };
export declare class SocketIO extends Common {
private ios: any;
private android: any;
constructor(uri: string, options?: SocketOptions);
readonly connected: boolean;
readonly disconnected: boolean;
connect(): void;
disconnect(): void;
open(): void;
close(): void;
on(event: string, callback: (...payload: Array<any>) => any): this;
once(event: string, callback: (...payload: Array<any>) => any): this;
off(event: string, callback?: Function): this;
emit(event: string, ...payload: Array<any>): this;
addEventListener(event: string, callback: (...payload: Array<any>) => any) : this;
removeListener(event: string, callback?: Function): this;
removeEventListener(event: string, callback?: Function): this;
removeAllListeners(): this;
// listeners(event: string): Function[];
// hasListeners(event: string): boolean;
}
export declare function connect(uri: string, options?: SocketOptions): SocketIO;