//#region src/dom/spotify/iframe-api.d.ts /** Everything the embed reports about playback, with times in milliseconds. */ interface SpotifyPlaybackState { isPaused: boolean; isBuffering: boolean; position: number; duration: number; } interface SpotifyPlaybackUpdateEvent { data: SpotifyPlaybackState; } interface SpotifyControllerApi { /** The iframe the controller drives, which it builds itself and swaps in for the target it was handed. */ iframeElement: HTMLIFrameElement; /** Swap the embedded entity, named as a `spotify::` URI. */ loadUri(uri: string): void; /** Play from the start of the entity. */ play(): void; /** Play from where the entity was paused. */ resume(): void; pause(): void; togglePlay(): void; seek(seconds: number): void; destroy(): void; addListener(type: 'ready', listener: () => void): void; addListener(type: 'playback_update', listener: (event: SpotifyPlaybackUpdateEvent) => void): void; } /** Options `createController` accepts; Spotify's own keys pass through untouched. */ interface SpotifyControllerOptions extends Record { uri?: string; width?: string | number; height?: string | number; } interface SpotifyIframeApi { /** Build a controller; `target` is replaced by an iframe of the controller's own, so hand it a placeholder. */ createController(target: HTMLElement, options: SpotifyControllerOptions, callback: (controller: SpotifyControllerApi) => void): void; } //#endregion export { SpotifyControllerApi, SpotifyIframeApi, SpotifyPlaybackState, SpotifyPlaybackUpdateEvent }; //# sourceMappingURL=iframe-api.d.ts.map