Here’s how to declare modules in Typescript:

Declaring any of the external modules having no exposed types or values:

declare module 'Foo' {
   var x: any;
   export = x;
}

For declaring individual classes

declare module 'Foo' {
   export type cls = any;
   export var cls: any;
}

BY Best Interview Question ON 12 May 2020

Suggest An Answer