export type TabId = 'videos' | 'playlists' | 'shortcode' | 'help'; export type MediaItem = { payload_id: string; title?: string; image?: string; duration?: string; updated_at?: number | null; items?: number | string; type?: string; playlist_type?: number; description?: string; error?: string; id?: string; sources?: VideoSource[]; }; export type VideoSource = { file?: string; label?: string; type?: string; }; export type PlaybackMethod = 'autoplay' | 'clicktoplay'; export type InsertPayload = { type?: 'video' | 'playlist'; id?: string; shortcode?: string; title?: string; image?: string; preview_url?: string; /** Library video/playlist picks only; ShortCode-tab inserts carry attrs in `shortcode`. */ playbackmethod?: PlaybackMethod; /** Passed through from the OVP search result for external integrations (e.g. custom fields). */ description?: string; duration?: string; updated_at?: number | null; }; export type ModalOpenOptions = { tab?: TabId; context?: string; editorId?: string; trigger?: HTMLElement; defaults?: Partial; /** When false, hides the ShortCode tab regardless of context. */ enableShortcode?: boolean; }; export type VoltaxModalConfig = { debug?: boolean; ajaxUrl: string; nonce: string; guideUrl: string; playIconUrl: string; playlistPlaceholderUrl: string; enableVideoLibrary: boolean; pageSize: number; languages: Array<{ value: string; label: string; }>; categories: Array<{ value: string; label: string; group?: string; }>; playlistTypes?: Array<{ value: string; label: string; }>; pagenow?: string; i18n: { title: string; videos: string; playlists: string; shortcode: string; help: string; search: string; searching: string; refresh: string; language: string; category: string; playlistType: string; videosCount: string; playlistsCount: string; loadingMore: string; insert: string; cancel: string; close: string; contentId: string; type: string; video: string; playlist: string; noResults: string; requiredId: string; shortcodeInput: string; shortcodePlaceholder: string; shortcodeHelp: string; invalidShortcode: string; playback: string; autoplay: string; clickToPlay: string; }; }; declare global { interface Window { voltaxModalConfig?: VoltaxModalConfig; voltaxModal?: { open: ( options?: ModalOpenOptions ) => void; close: () => void; }; } } export {};