第一种:
(window as any).aaa
第二种:
declare global { interface Window { aaa: any; } } window.aaa = window.aaa || {};
第三种:
interface MyWindow extends Window { aaa(): void; } declare var window: MyWindow;
第一种:
(window as any).aaa
第二种:
declare global { interface Window { aaa: any; } } window.aaa = window.aaa || {};
第三种:
interface MyWindow extends Window { aaa(): void; } declare var window: MyWindow;