Reputation: 1240
Imagine I have a class
export class Foo
{
methodX():string
{
}
}
window.foo = new Foo();
and I have my window interface what is the workaround to add Foo in window interface
interface Window {
foo:Foo;
}
this is working for internal modules but not for external modules.
Upvotes: 0
Views: 152
Reputation: 1870
You cannot use ambient interfaces in internal modules, so declare interface in separate file:
interface IFoo {
methodX(): string;
}
interface Window {
foo: IFoo;
}
Upvotes: 1