ts extend winndow code example
Example 1: typescript add global variable to window
declare global {
interface Window {
FB:any;
}
}
let FB = window.FB; // ok now
Example 2: window typescript
(window as any).MyNamespace
declare global {
interface Window {
FB:any;
}
}
let FB = window.FB; // ok now
(window as any).MyNamespace