Check out example codes for "typescript add global variable to window". It will help you in understanding the concepts better.

Code Example 1

declare global {
    interface Window {
        FB:any;
    }
}

let FB = window.FB; // ok now

Learn ReactJs, React Native from akashmittal.com