| Start |
|---|
| Make a module that exports a default 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 (opens new window)) as an example: And then in any file in your project, you can import this definition with: After this import, If the library has multiple top-level variables, export and import by name instead: You can then import and use both names: |
| Declare an any global It is sometimes easiest to just declare a global of type If jQuery didn't have type declarations (it does (opens new window)), you could put Now any use of $ will be typed |
| Use an ambient module 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. You can then import from the ambient module. Anything imported from the declared module (like |
Read Article
https://develop.horje.com/learn/1434/reference