Update typings for signalr-no-jquery to include stop method (#37759)

This commit is contained in:
Tristan Penman 2019-08-27 01:23:21 +10:00 committed by Sheetal Nandi
parent 15289fd4ac
commit 1e5bee16dc
2 changed files with 18 additions and 14 deletions

View File

@ -9,22 +9,24 @@ export function hubConnection(url?: string, options?: Options): Connection;
export function signalR(url?: string, qs?: any, logging?: any): any;
export interface Connection {
id: string;
proxies: { [hubName: string]: any };
transport: {
name: string,
supportsKeepAlive: SupportsKeepAliveHandler
};
id: string;
proxies: { [hubName: string]: any };
transport: {
name: string;
supportsKeepAlive: SupportsKeepAliveHandler;
};
/**
* Creates a new proxy object for the given hub connection that can be used to invoke
* methods on server hubs and handle client method invocation requests from the server.
*
* @param hubName The name of the hub on the server to create the proxy for.
*/
createHubProxy(hubName: string): Proxy;
/**
* Creates a new proxy object for the given hub connection that can be used to invoke
* methods on server hubs and handle client method invocation requests from the server.
*
* @param hubName The name of the hub on the server to create the proxy for.
*/
createHubProxy(hubName: string): Proxy;
start(options?: any, callback?: any): any;
start(options?: any, callback?: any): any;
stop(async?: boolean, notifyServer?: boolean): void;
}
export interface Proxy {

View File

@ -12,3 +12,5 @@ hubProxy.on('message', (message) => {
connection.start({ jsonp: true })
.done(() => { console.log('Now connected, connection ID=' + connection.id); })
.fail(() => { console.log('Could not connect'); });
connection.stop(false, false);