From 1e5bee16dc6e974f96183bcd6335cb34024f2afb Mon Sep 17 00:00:00 2001 From: Tristan Penman Date: Tue, 27 Aug 2019 01:23:21 +1000 Subject: [PATCH] Update typings for signalr-no-jquery to include stop method (#37759) --- types/signalr-no-jquery/index.d.ts | 30 ++++++++++--------- .../signalr-no-jquery-tests.ts | 2 ++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/types/signalr-no-jquery/index.d.ts b/types/signalr-no-jquery/index.d.ts index 55d4c6eddb..f8e1d7604e 100644 --- a/types/signalr-no-jquery/index.d.ts +++ b/types/signalr-no-jquery/index.d.ts @@ -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 { diff --git a/types/signalr-no-jquery/signalr-no-jquery-tests.ts b/types/signalr-no-jquery/signalr-no-jquery-tests.ts index 041e3605f2..f54f01d278 100644 --- a/types/signalr-no-jquery/signalr-no-jquery-tests.ts +++ b/types/signalr-no-jquery/signalr-no-jquery-tests.ts @@ -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);