Made SignalR compliant with --noImplicitAny

This commit is contained in:
Mike Keesey
2014-02-04 16:14:29 -08:00
parent 7480b03ef1
commit adf0467335
2 changed files with 11 additions and 10 deletions
+2 -2
View File
@@ -60,7 +60,7 @@ interface MyHubConnection extends HubConnection {
};
// My Hubs Server function:
server: {
send(message: string);
send(message: string): any;
};
}
@@ -107,7 +107,7 @@ function test_hubs() {
proxy.invoke('send', msg);
proxy.invoke('send', msg, room);
proxy.invoke('add', 1, 2)
.done(function (result) {
.done(function (result: any) {
console.log('The result is ' + result);
});
proxy.on('addMessage', function (msg?) {
+9 -8
View File
@@ -1,13 +1,14 @@
// Type definitions for SignalR 1.0
// Project: http://www.asp.net/signalr
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Modified by: T. Michael Keesey <https://github.com/keesey/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
interface HubMethod {
(callback: (data: string) => void );
(callback: (data: string) => void ): any;
}
interface SignalREvents {
@@ -75,8 +76,8 @@ interface HubProxy {
hubName: string;
init(connection: HubConnection, hubName: string): void;
hasSubscriptions(): boolean;
on(eventName: string, callback: (...msg) => void ): HubProxy;
off(eventName: string, callback: (msg) => void ): HubProxy;
on(eventName: string, callback: (...msg: any[]) => void ): HubProxy;
off(eventName: string, callback: (msg: any) => void ): HubProxy;
invoke(methodName: string, ...args: any[]): JQueryDeferred<any>;
}
@@ -88,18 +89,18 @@ interface HubConnectionSettings {
interface HubConnection extends SignalR {
//(url?: string, queryString?: any, logging?: boolean): HubConnection;
proxies;
received(callback: (data: { Id; Method; Hub; State; Args; }) => void ): HubConnection;
proxies: any;
received(callback: (data: { Id: any; Method: any; Hub: any; State: any; Args: any; }) => void ): HubConnection;
createHubProxy(hubName: string): HubProxy;
}
interface SignalRfn {
init(url, qs, logging);
init(url: any, qs: any, logging: any): any;
}
interface ConnectionSettings {
transport?;
callback?;
transport?: any;
callback?: any;
waitForPageLoad?: boolean;
jsonp?: boolean;
}