I am using asp.net mvc 4.5 project with typescript in client side. I have installed and configured signalR in the server side. In the client side i have installed signalr.TypeScript.DefinitelyTyped with jquery,
i have referred signalr by below in my typescript file on the top, ///
and i have created interface file for my hub,
interface SignalR {
ForecastHub: {
client: {
DeleteProject(projectId: number)
};
server: {
send(name: string, message: string)
};
};
}
and my main code in ts is below,
var client = $.connection.ForecastHub;
client.client.DeleteProject = function (projectId) {
alert(projectId);
};
$.connection.hub.start().done(function () {
});
in the runtime i am getting an error 'Cannot read property 'ForecastHub' of undefined'
so how to import signalr in the typescript ts. please provide solution to integrate signalR in typescript project.