If I use interface and export class in same typescript file then I'm getting exception like follows.
Sample Code:
interface Window {
Test: string;
}
window.Test = "cool";
export class Person {
name: string;
constructor(name: string) {
this.name = name;
}
print(): void {
console.log(this.name);
}
}
Exception : Property 'Test' does not exist on type 'Window & typeof globalThis'.ts(2339)
if I remove class definition then error banishes. I googled for many hours but unable to find the reason. Could someone describe the reason behind this?
PS: I'm a newbie to Typescript and I'm exploring it to integrate it to my existing project. Pardon me, If my question is too amateurish.