import type { ActionOptions, LoadOptions, PluginCtorWithId } from '@nomercy-entertainment/nomercy-player-core'; import type { NMVideoPlayer } from '../index.js'; import type { Stretching, VideoPlaylistItem } from '../types.js'; import { Plugin } from '@nomercy-entertainment/nomercy-player-core'; interface V1SkipSegment { type: string; start: number; end: number; } interface V1SeasonSummary { season: number; episodes: number; seasonName?: string; } interface V1LegacyTrack { kind?: string; file?: string; label?: string; language?: string; type?: string; } declare module '../index.js' { interface NMVideoPlayer { /** @deprecated v1 shim — no v2 equivalent. Gates `enterFullscreen()` only; `fullscreen()` itself is never gated. */ allowFullscreen: boolean; /** @deprecated v1 shim — use `playState()`. */ readonly isPlaying: boolean; /** @deprecated v1 shim — `cycleAspectRatio()` cycles this fixed order internally; no public v2 accessor. */ stretchOptions: Stretching[]; /** @deprecated v1 shim — use `time(seconds)`. */ seek(seconds: number, opts?: ActionOptions): number; /** @deprecated v1 shim — use `playbackRate()`. */ speed(): number; /** @deprecated v1 shim — use `playbackRate(rate)`. */ speed(rate: number): void; /** @deprecated v1 shim — use `playbackRates()`. */ speeds(): number[]; /** @deprecated v1 shim — derive from `playbackRates().length > 1`. */ hasSpeeds(): boolean; /** @deprecated v1 shim — use `volumeState() === VolumeState.MUTED`. */ muted(): boolean; /** @deprecated v1 shim — use `mute()` / `unmute()`. */ muted(state: boolean): void; /** @deprecated v1 shim — no v2 equivalent. Reads the applied `videoElement.volume`. */ gain(): number; /** @deprecated v1 shim — use `fullscreen(true)`. */ enterFullscreen(): void; /** @deprecated v1 shim — use `fullscreen(false)`. */ exitFullscreen(): void; /** @deprecated v1 shim — no v2 equivalent. */ setAllowFullscreen(allowed: boolean): void; /** @deprecated v1 shim — use `aspectRatio()`. */ aspect(): Stretching; /** @deprecated v1 shim — use `aspectRatio(value)`. */ aspect(value: Stretching): void; /** @deprecated v1 shim — use `aspectRatio(value)`. */ setAspect(value: Stretching): void; /** @deprecated v1 shim — no-op. v2 tracks size via `ResizeObserver` automatically. */ resize(): void; /** @deprecated v1 shim — read `container.clientWidth`. */ width(): number; /** @deprecated v1 shim — read `container.clientHeight`. */ height(): number; /** @deprecated v1 shim — use `container`. */ element(): HTMLElement; /** @deprecated v1 shim — use `playState()`. */ state(): string; /** @deprecated v1 shim — use `time()`. */ currentTime(): number; /** @deprecated v1 shim — use `time(seconds)`. */ currentTime(seconds: number, opts?: ActionOptions): void; /** @deprecated v1 shim — read `videoElement.currentSrc` / `videoElement.src`. */ currentSrc(): string; /** @deprecated v1 shim — derive from `platform().pip`. */ hasPIP(): boolean; /** @deprecated v1 shim — use `pip(active)`. */ setFloatingPlayer(active: boolean): void; /** @deprecated v1 shim — use `subtitle()?.index`. */ subtitleIndex(): number; /** @deprecated v1 shim — search `subtitles()` by `language`. */ subtitleIndexBy(language: string): number; /** @deprecated v1 shim — derive from `subtitles().length > 0`. */ hasSubtitles(): boolean; /** @deprecated v1 shim — no v2 equivalent. Add the track to the playlist item's `tracks` field instead. */ subtitleFile(url: string, opts?: { language?: string; label?: string; }): Promise; /** @deprecated v1 shim — use `audioTrack()?.index`. */ audioTrackIndex(): number; /** @deprecated v1 shim — derive from `audioTracks().length > 0`. */ hasAudioTracks(): boolean; /** @deprecated v1 shim — search `audioTracks()` by `language`. */ audioTrackIndexByLanguage(language: string): number; /** @deprecated v1 shim — derive from `qualityLevels().length > 0`. */ hasQualities(): boolean; /** @deprecated v1 shim — no v2 equivalent. Add the chapters to the playlist item's `chapters` field instead. */ chapterFile(url: string): Promise; /** @deprecated v1 shim — use `chapter()?.title` / `chapters()[idx]?.title`. */ chapterText(idx?: number): string; /** @deprecated v1 shim — no v2 data model for skip segments yet. Always empty. */ skippers(): ReadonlyArray; /** @deprecated v1 shim — no v2 equivalent. Call `time(seconds)` at the boundary directly. */ skip(): void; /** @deprecated v1 shim — no v2 equivalent. Fetch the file yourself and call `time(seconds)` at the boundaries. */ skipFile(url: string): Promise; /** @deprecated v1 shim — use `queue()`. */ playlist(): ReadonlyArray; /** @deprecated v1 shim — use `queue(items, opts)`. */ playlist(items: T[], opts?: ActionOptions): void; /** @deprecated v1 shim — use `item()`. */ playlistItem(): T | Record; /** @deprecated v1 shim — use `index()`. */ playlistIndex(): number; /** @deprecated v1 shim — use `item(target, { autoplay: true })`. */ playVideo(target: T | string | number, opts?: LoadOptions): void; /** @deprecated v1 shim — use `queue(items, opts)`. */ setPlaylist(items: T[], opts?: ActionOptions): void; /** @deprecated v1 shim — find the index in `queue()` and call `item(index)`. */ setEpisode(season: number, episode: number, opts?: LoadOptions): void; /** @deprecated v1 shim — derive from `index() === 0`. */ isFirstPlaylistItem(): boolean; /** @deprecated v1 shim — derive from `index() === queueLength() - 1`. */ isLastPlaylistItem(): boolean; /** @deprecated v1 shim — derive from `queueLength() > 1`. */ hasPlaylists(): boolean; /** @deprecated v1 shim — no v2 equivalent. Group `queue()` by the item's `season` field. */ seasons(): ReadonlyArray; /** @deprecated v1 shim — no v2 equivalent. Read the item's raw `tracks` field. */ tracks(kind?: string): ReadonlyArray; /** @deprecated v1 shim — emit `'display-message'` / `'remove-message'` directly. */ displayMessage(text: string, ms?: number): void; /** @deprecated v1 shim — no v2 equivalent. Pure string utility. */ snakeToCamel(value: string): string; /** @deprecated v1 shim — no v2 equivalent. Pure string utility. */ spaceToCamel(value: string): string; /** @deprecated v1 shim — no v2 equivalent. Pure DOM utility. */ doubleTap(el: HTMLElement, callback: () => void, thresholdMs?: number): void; /** @deprecated v1 shim — no v2 equivalent. Pure DOM utility. */ appendScriptFilesToDocument(urls: ReadonlyArray): Promise; /** @deprecated v1 shim — use `t(key, vars)`. */ localize(key: string, vars?: Record): string; /** @deprecated v1 shim — use `translation(language(), key, value)`. */ addTranslation(key: string, value: string): void; /** @deprecated v1 shim — no v2 equivalent. Writes `document.title` directly. */ setTitle(title: string): void; /** @deprecated v1 shim — use `load({ id, url })`. */ loadSource(url: string, opts?: LoadOptions): Promise; /** @deprecated v1 shim — use `addPlugin(PluginClass, opts)`. */ registerPlugin

>(PluginClass: PluginCtorWithId & (new () => P), opts?: P['opts']): NMVideoPlayer; /** @deprecated v1 shim — use `addPlugin(PluginClass, opts)`. */ usePlugin

>(PluginClass: PluginCtorWithId & (new () => P), opts?: P['opts']): NMVideoPlayer; /** @deprecated v1 shim — use `getPluginById(id)`. */ plugin

(id: string): P | undefined; } } /** * Legacy API-surface shim for `nomercy-video-player` v1 consumers migrating to * v2. Attaches the old method names onto the player instance; every shim * delegates to the real v2 API and logs one deprecation line per call. * * Opt-in only — add via `player.addPlugin(V1VideoCompatPlugin)` before * `setup()`. Nothing here changes v2 behaviour for consumers that don't load * it. Delete this file (and its one export line in `src/index.ts`) once every * v1 consumer has migrated. */ export declare class V1VideoCompatPlugin extends Plugin { static readonly id: string; static readonly version: string; static readonly description: string; private _warn; use(): void; /** * v1 allowed a second `setup({ playlist, autoPlay })` call to swap sources * on a live player. v2's `setup()` guards against re-entry and throws. * Once the player is past `NOT_SETUP`, a repeat call queues the incoming * playlist and autoplays it instead of re-running the setup pipeline. */ private _installSetupShim; private _installTransportShims; private _installDisplayShims; private _installTrackShims; private _installSkipperShims; private _installPlaylistShims; private _installUtilityShims; private _installTranslationShims; private _installLifecycleShims; private _installEventBridges; } export {};