typescript add function to window object code example
Example 1: Property 'editor' does not exist on type 'Window & typeof globalThis'.
declare global {
interface Window { MyNamespace: any; }
}
window.MyNamespace = window.MyNamespace || {};
Example 2: window typescript
(window as any).MyNamespace