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:

  1. make sure using latest version of signalr type definition. looks if signalr definition augmenting jquerystatic.

  1. 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

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -