Can TypeScript interact with jQuery without a definition file?

后端 未结 3 1867
广开言路
广开言路 2021-02-05 06:15

I have been attempting to get to know this new \'TypeScript\' stuff, and I am a bit curious on something.

Can it still work with existing javascript frameworks like jQuer

3条回答
  •  礼貌的吻别
    2021-02-05 06:25

    Yes you can. For example just write:

    declare var $;
    

    and you can basically use the JQuery framework without having to define anything else. This is also very handy when you are converting your existing libraries / porting code.

提交回复
热议问题