import { YouTubePlayer } from 'youtube-player/dist/types'; import { Unpromisify } from './utils.js'; type YTAPI_Player = Unpromisify; interface YTAPI_API { Player: new (elementId: string | HTMLElement | Element, options: YTAPI_PlayerOptions) => YTAPI_Player; } interface YTAPI_PlayerOptions { width: number; height: number; videoId: string; host: string; playerVars: { autoplay: 0 | 1; cc_load_policy?: 1 | 0; cc_lang_pref?: string; color?: 'red' | 'white'; controls: 0 | 1 | 2; disablekb: 0 | 1; enablejsapi: 0 | 1; end?: number; fs: 0 | 1; hl?: string; iv_load_policy: 1 | 3; list?: string; listType?: 'search' | 'user_uploads' | 'playlist'; loop: 0 | 1; modestbranding?: 0 | 1; origin: string; playlist?: string; playsinline: 0 | 1; rel: 0 | 1; showinfo: 0 | 1; start?: number; wmode?: string; }; events: { onReady: () => void; onStateChange: (event: YTAPI_Event) => void; onPlaybackQualityChange: (event: YTAPI_Event) => void; onPlaybackRateChange: (event: YTAPI_Event) => void; onError: (event: YTAPI_Event) => void; }; } interface YTAPI_Event { data: Data; target: YTAPI_Player; } type YTAPI_PlaybackQuality = 'small' | 'medium' | 'large' | 'hd720' | 'hd1080' | 'highres' | 'default'; type YTAPI_PlaybackRate = 0.25 | 0.5 | 1 | 1.5 | 2; export { YTAPI_API, YTAPI_Event, YTAPI_PlaybackQuality, YTAPI_PlaybackRate, YTAPI_Player, YTAPI_PlayerOptions };