import type { IStorage, SubtitleTrack } from '@nomercy-entertainment/nomercy-player-core'; /** Recorded when the viewer turns subtitles off, so a later item stays off. */ export declare const SUBTITLES_OFF = "off"; /** * The viewer's last chosen audio and subtitle language, carried from one item * to the next. * * A choice is a language, never a track index: an index means a different * language on every file, and the master playlist's own DEFAULT flag follows * the source's stream order, so neither survives an episode change. Remembering * the language is what makes the next episode open in the language the viewer * picked, whatever the encode declared. * * A caption choice is more than a language. A viewer who picked English SDH and * got plain English back was handed a different track under the same name, and * two renditions of the same language and variant can differ only by container * — an `.ass` carries the show's own styling where a `.vtt` does not. So the * variant and the format travel with the language. */ export declare class TrackLanguageMemory { private readonly storage?; private audio; private subtitle; constructor(storage?: IStorage | undefined); audioLanguage(): string | null; /** The caption choice, or `null` when the viewer has never made one. */ subtitleChoice(): SubtitleChoice | null; rememberAudio(language: string | null | undefined): void; /** Pass `SUBTITLES_OFF` for a deliberate off; `undefined` is not a choice. */ rememberSubtitle(choice: SubtitleTrack | typeof SUBTITLES_OFF | null | undefined): void; private read; private write; } /** A caption choice: a deliberate off, or the language / variant / format picked. */ export type SubtitleChoice = typeof SUBTITLES_OFF | SubtitleDescriptor; export interface SubtitleDescriptor { language: string; type?: string; format?: string; } /** The file's format, taken from its URL — the manifest does not carry one. */ export declare function formatOf(track: Pick): string | undefined; /** * The track that answers a caption choice, narrowest match first. * * A list filtered by device capability can drop the exact variant, and a viewer * is better served by the same language in a different flavour than by no * captions at all. Position is never consulted: it means a different track on * every file. The language step is passed in because the player owns the * prefix rules (`en` answering `en-US`). */ export declare function matchSubtitleTrack(tracks: ReadonlyArray, wanted: SubtitleDescriptor, matchLanguage: (languages: Array, wantedLanguage: string) => number): number;