Update cometd.d.ts

transformed cometD module to interface. 

usage:
```
var cometd: CometD;
```

added some methods: *clearListeners, clearSubscriptions, handshake, disconnect*

added definition for jQuery: `$.cometd` returns CometD type
This commit is contained in:
Ika
2015-09-22 12:47:21 +04:00
parent f4beede5f5
commit dfa3539468
+31 -20
View File
@@ -5,26 +5,6 @@
declare module CometD {
var onListenerException: (exception: any, subscriptionHandle: any, isListener: boolean, message: string) => void;
function init(options: ConfigurationOptions): void;
function configure(config: ConfigurationOptions): void;
function addListener(channel: string, listener: (message: any) => void): void;
function removeListener(listener: (message: any) => void): void;
function clearListeners(): void;
function clearSubscriptions(): void;
function handshake(handshake_params: any): void;
function publish(channel: string, message: any): void;
function disconnect(): void;
interface ConfigurationOptions {
url: string;
logLevel?: string;
@@ -37,4 +17,35 @@ declare module CometD {
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;
}