Updated to SignalR 2.2.0

This commit is contained in:
Giedrius Grabauskas
2016-03-07 15:15:26 +02:00
parent f6b8a7661e
commit dc09e291df
+17 -17
View File
@@ -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;
}
}