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

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -