Can TypeScript interact with jQuery without a definition file?

后端 未结 3 1870
广开言路
广开言路 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:39

    Typescript allows you to declare variables in the descired scope using the declare variable or declare function syntax (see Section 1.1 on page 9 in the language specification). However, using ambient declarations can only be a short-term solution since you will effectively loose all of Typescript's static type checking and hence one of the most important advantages of Typescript over Javascript.

提交回复
热议问题