mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
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:
Vendored
+31
-20
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user