Tutorial by Examples

It is sometimes easiest to just declare a global of type any, especially in simple projects. If jQuery didn't have type declarations (it does), you could put declare var $: any; Now any use of $ will be typed any.
For more complicated projects, or in cases where you intend to gradually type a dependency, it may be cleaner to create a module. Using JQuery (although it does have typings available) as an example: // place in jquery.d.ts declare let $: any; export default $; And then in any file in your pr...
If you just want to indicate the intent of an import (so you don't want to declare a global) but don't wish to bother with any explicit definitions, you can import an ambient module. // in a declarations file (like declarations.d.ts) declare module "jquery"; // note that there are no ...

Page 1 of 1