/** The bits of the wp global the panel touches: the media library. */ interface WpMediaFrame { open(): void; on(event: 'select', handler: () => void): void; state(): { get(key: 'selection'): { first(): { toJSON(): { id: number; url: string; alt?: string }; }; }; }; } interface Window { tinymce?: { get?: (id: string) => { getContent(): string; setContent?(html: string): void; isHidden(): boolean; } | null; }; /** wp-admin's tag box (tags-box.js): redraws the chips of a tags div from its hidden textarea. */ tagBox?: { quickClicks?: (tagsDiv: unknown) => void; }; jQuery?: (selector: string) => unknown; wp?: { media?: (options: { title: string; button: { text: string }; multiple: boolean; library: { type: string }; }) => WpMediaFrame; }; }