jquery - How to augment JQueryStatic with SignalR methods -
i using typescript 2.0 , typed declaration file jquery. using signalr. signalr depends on jquery , adds properties it. example can write "$.connection.hub.logging = true;" signalr has added "connection" jquery.
the typed declaration file jquery defines interface jquerystatic not export jquerystatic because $ being exported. $ of type jquerystatic.
my question is, how write code using typescript 2.0 augments interface jquerystatic definition new property p1, "connection" example of?
here couple ways:
- make sure using latest version of signalr type definition. looks if signalr definition augmenting jquerystatic.
use typescript's declaration merging augment jquerystatic adding snippet below top of typescript file.
declare global { interface jquerystatic { signalr: signalr; connection: signalr; hubconnection: signalr.hub.hubcreator; } }
Comments
Post a Comment