forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
XSockets.d.ts
38 lines (37 loc) · 1.43 KB
/
XSockets.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
35
36
37
38
// Type definitions for XSockets.NET 3.0
// Project: http://xsockets.net/
// Definitions by: Jeffery Grajkowski <https://github.com/pushplay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace XSockets {
export class WebSocket {
id: string;
constructor(url: string, subprotocol?: string, settings?: any);
on(event: string, handler: (data: any) => void, confirmation?: (arg: ConfirmationArgument) => void): void;
one(event: string, handler: (data: any) => void, confirmation?: (arg: ConfirmationArgument) => void): void;
many(event: string, times: number, handler: (data: any) => void, confirmation?: (arg: ConfirmationArgument) => void): void;
unbind(event: string): void;
publish(topic: string, data: any): void;
}
export interface ConfirmationArgument {
event: string;
}
export module Events {
export var close: string;
export var onBlob: string;
export var onError: string;
export module bindings {
export var completed: string;
}
export var open: string;
export module pubSub {
export var subscribe: string;
export var unsubscribe: string;
}
export module storage {
export var get: string;
export var getAll: string;
export var remove: string;
export var set: string;
}
}
}