developerasun / myCodeBox-web

Open source code box for web developers.
Apache License 2.0
5 stars 0 forks source link

[RESEARCH] Typescript/keyword: declare #276

Open developerasun opened 2 years ago

developerasun commented 2 years ago

topic : understanding declare in Typescript

read this

To describe the shape of libraries not written in TypeScript, we need to declare the API that the library exposes. Because most JavaScript libraries expose only a few top-level objects, namespaces are a good way to represent them.

We call declarations that don’t define an implementation “ambient”. Typically these are defined in .d.ts files.

The popular library D3 defines its functionality in a global object called d3. Because this library is loaded through a Githubissues.

  • Githubissues is a development platform for aggregating issues.