mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 03:26:22 +00:00
568 B
568 B
date | id | title |
---|---|---|
2020-09-30 | e1048c95-3baa-445e-a943-bff7b86a0f29 | Ambient Declarations |
Introduction
Ambient declarations allow you to safely use existing popular JavaScript libraries and incrementally migrate your JavaScript/CoffeeScript/Other-Compile-To-Js-Language project to TypeScript.
Declaration Files
Syntax is simple:
declare var foo: any
Declarations can be put in a .ts
or .d.ts
file, ie: global.d.ts
or
vendor.d.ts
Best Practices
- Use
.d.ts
- Use interfaces where possible