Dependencies on Modules If your library depends on a module, use an import statement:
Global Functions Documentation You can call the function greet with a string
“Do”s and “Don’t”s Many common mistakes in declaration files can be easily avoided. The
/// <amd-module /> By default AMD modules are generated anonymous. This can lead to problems when other tools are used to
Indexable Types Similarly to how we can use interfaces to describe function types, we can also describe types that we can “index into” like
Union types Overview Union types are a powerful way to express a value that can be one of several types
Ambient Namespaces The popular library D3 defines its functionality in a global object called d3. Because this library is loaded
Publish to @types Packages on under the
Type assertions Sometimes you’ll end up in a situation where you’ll know more about a value than TypeScript does. Usually this will happen when
Multi-file namespaces Here, we’ll split our Validation namespace across many files. Even though the files are separate, they can
Page 6 of 29