the tswhy logo: a question mark in a box

tswhy‽

A community effort to enrich TypeScript diagnostics.

TS1035

Only ambient modules can use quoted names.

When defining a module that can be imported via the module keyword, it must be declared as an ambient module. The following is an error:

module "some-npm-module" {
  export function run();
}

Fix: Use the declare keyword.

Utilize the declare keyword before the module keyword:

declare module "some-npm-module" {
  export function run();
}