mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Updated to SignalR 2.2.0
This commit is contained in:
+17
-17
@@ -10,64 +10,64 @@ declare module ngSignalr {
|
||||
/**
|
||||
* Creates a new Hub connection
|
||||
*/
|
||||
new(hubName: string, options: HubOptions) : Hub
|
||||
new (hubName: string, options: HubOptions): Hub
|
||||
}
|
||||
|
||||
|
||||
class Hub {
|
||||
hubName: string;
|
||||
connection: SignalR;
|
||||
proxy: HubProxy;
|
||||
|
||||
connection: SignalR.Connection;
|
||||
proxy: SignalR.Hub.Proxy;
|
||||
|
||||
on(event: string, fn: (...args: any[]) => void): void;
|
||||
invoke(method: string, ...args: any[]): JQueryDeferred<any>;
|
||||
disconnect(): void;
|
||||
connect(): JQueryPromise<any>;
|
||||
}
|
||||
|
||||
|
||||
interface HubOptions {
|
||||
/**
|
||||
* Collection of client side callbacks
|
||||
*/
|
||||
listeners?: { [index: string] : (...args: any[]) => void };
|
||||
|
||||
listeners?: { [index: string]: (...args: any[]) => void };
|
||||
|
||||
/**
|
||||
* String array of server side methods which the client can call
|
||||
*/
|
||||
methods?: Array<string>;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the root path for the SignalR web service
|
||||
*/
|
||||
rootPath?: string;
|
||||
|
||||
|
||||
/**
|
||||
* Object representing additional query params to be sent on connection
|
||||
*/
|
||||
queryParams?: { [index: string] : string };
|
||||
|
||||
queryParams?: { [index: string]: string };
|
||||
|
||||
/**
|
||||
* Function to handle hub connection errors
|
||||
*/
|
||||
errorHandler?: (error: string) => void;
|
||||
|
||||
|
||||
/**
|
||||
* Enable/disable logging
|
||||
*/
|
||||
logging?: boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Use a shared global connection or create a new one just for this hub, defaults to true
|
||||
*/
|
||||
useSharedConnection?: boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Sets transport method (e.g 'longPolling' or ['webSockets', 'longPolling'] )
|
||||
*/
|
||||
transport?: any;
|
||||
|
||||
|
||||
/**
|
||||
* Function to handle hub connection state changed event
|
||||
*/
|
||||
stateChanged?: (state: SignalRStateChange) => void;
|
||||
stateChanged?: (state: SignalR.StateChanged) => void;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user