declare global { interface Window { dataLayer: any; } } code example
Example: typescript add global variable to window
declare global {
interface Window {
FB:any;
}
}
let FB = window.FB; // ok now
declare global {
interface Window {
FB:any;
}
}
let FB = window.FB; // ok now