interface Document { fonts?: { ready?: Promise; addEventListener?( type: "loading" | "loadingdone" | "loadingerror", listener: (this: Document, ev: Event) => any, ): void; }; } interface Window { ClipboardItem: any; } interface Clipboard extends EventTarget { write(data: any[]): Promise; } type Mutable = { -readonly [P in keyof T]: T[P]; }; type ResolutionType any> = T extends ( ...args: any ) => Promise ? R : any;