mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Fix SignalR declarations and files
This commit is contained in:
Vendored
+8
-11
@@ -23,13 +23,13 @@ interface SignalREvents {
|
||||
|
||||
interface SignalR {
|
||||
events: SignalREvents;
|
||||
connectionState: any; // ???
|
||||
connectionState: any;
|
||||
transports: any;
|
||||
|
||||
hub: HubConnection;
|
||||
id: string; // ???
|
||||
id: string;
|
||||
logging: bool;
|
||||
messageId: string; // ???
|
||||
messageId: string;
|
||||
url: string;
|
||||
|
||||
(url: string, queryString?: any, logging?: bool): SignalR;
|
||||
@@ -40,12 +40,12 @@ interface SignalR {
|
||||
changeState(connection: SignalR, expectedState: number, newState: number): bool;
|
||||
isDisconnecting(connection: SignalR): bool;
|
||||
|
||||
createHubProxy(hubName: string): SignalR;
|
||||
// createHubProxy(hubName: string): SignalR;
|
||||
|
||||
start(): SignalR;
|
||||
start(callback: () => void ): SignalR;
|
||||
start(settings: ConnectionSettings): SignalR;
|
||||
start(settings: ConnectionSettings, callback: () => void ): SignalR;
|
||||
start(): JQueryPromise;
|
||||
start(callback: () => void ): JQueryPromise;
|
||||
start(settings: ConnectionSettings): JQueryPromise;
|
||||
start(settings: ConnectionSettings, callback: () => void ): JQueryPromise;
|
||||
|
||||
|
||||
send(data: string): void;
|
||||
@@ -59,9 +59,6 @@ interface SignalR {
|
||||
connectionSlow(handler: () => void ): SignalR;
|
||||
sending(handler: () => void ): SignalR;
|
||||
reconnected(handler: () => void ): SignalR;
|
||||
|
||||
done(handler: () => void ): SignalR;
|
||||
fail(handler: () => void ): SignalR;
|
||||
}
|
||||
|
||||
interface HubProxy {
|
||||
|
||||
+12
-2
@@ -50,6 +50,16 @@ function test_connection() {
|
||||
});
|
||||
}
|
||||
|
||||
interface MyHubConnection extends HubConnection {
|
||||
someState: string;
|
||||
SomeFunction: Function;
|
||||
}
|
||||
|
||||
interface SignalR {
|
||||
chat: HubConnection;
|
||||
myHub: MyHubConnection;
|
||||
}
|
||||
|
||||
function test_hubs() {
|
||||
var chat = $.connection.chat;
|
||||
chat.client.addMessage = function (message) {
|
||||
@@ -69,7 +79,7 @@ function test_hubs() {
|
||||
function connectionReady() {
|
||||
alert("Done calling first hub serverside-function");
|
||||
};
|
||||
myHub.SomeClientFunction = function () {
|
||||
myHub.SomeFunction = function () {
|
||||
alert("serverside called 'Clients.SomeClientFunction()'");
|
||||
};
|
||||
$.connection.hub.error(function () {
|
||||
@@ -77,7 +87,7 @@ function test_hubs() {
|
||||
});
|
||||
$.connection.hub.start()
|
||||
.done(function () {
|
||||
myHub.SomeFunction(SomeParam)
|
||||
myHub.SomeFunction("whatever")
|
||||
.done(connectionReady);
|
||||
})
|
||||
.fail(function () {
|
||||
|
||||
Reference in New Issue
Block a user