TypeScript · Classes and modules

Declaration file

Describes types for untyped JavaScript or global APIs in a .d.ts file.

Syntax
declare module "name"

Example

Example
declare function track(event: string): void;

More in this group

abstract class Access modifiers Class implements Namespace import readonly field Type-only import

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course