forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cometd.d.ts
51 lines (33 loc) · 1.19 KB
/
cometd.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
39
40
41
42
43
44
45
46
47
48
49
50
51
// Type definitions for CometD 2.5.1
// Project: http://cometd.org
// Definitions by: Derek Cicerone <https://github.com/derekcicerone>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module CometD {
interface ConfigurationOptions {
url: string;
logLevel?: string;
maxConnections?: number;
backoffIncrement?: number;
maxBackoff?: number;
reverseIncomingExtensions?: boolean;
maxNetworkDelay?: number;
requestHeaders?: any;
appendMessageTypeToURL?: boolean;
autoBatch?: boolean;
}
}
interface CometD {
onListenerException: (exception: any, subscriptionHandle: any, isListener: boolean, message: string) => void;
init(options: CometD.ConfigurationOptions): void;
configure(config: CometD.ConfigurationOptions): void;
addListener(channel: string, listener: (message: any) => void): void;
removeListener(listener: (message: any) => void): void;
clearListeners(): void;
clearSubscriptions(): void;
handshake(handshake_params: any): void;
publish(channel: string, message: any): void;
disconnect(): void;
}
interface JQueryStatic {
cometd: CometD;
}