//#region ../core/dist/dev/core/i18n/locales.d.ts //#region src/core/i18n/locales.d.ts /** Non-English locale packs shipped with Video.js. */ declare const LOCALES: readonly ['ar', 'az', 'bs', 'bg', 'bn', 'ca', 'cs', 'cy', 'da', 'de', 'el', 'es', 'et', 'eu', 'fa', 'fi', 'fr', 'gd', 'gl', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lt', 'lv', 'mr', 'nb', 'nl', 'nn', 'ne', 'oc', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'te', 'th', 'tr', 'uk', 'vi', 'zh-CN', 'zh-TW']; //#endregion //#region ../core/dist/dev/core/i18n/params.generated.d.ts //#region src/core/i18n/params.generated.d.ts /** Generated by packages/core/scripts/generate-i18n-types.ts — do not edit. */ /** Generated translation parameter contract from the English catalogue. */ interface TranslationParams { 'buttons.play': never; 'buttons.pause': never; 'buttons.replay': never; 'buttons.mute': never; 'buttons.unmute': never; 'seek.forward': { seconds: string | number; }; 'seek.backward': { seconds: string | number; }; 'fullscreen.enter': never; 'fullscreen.exit': never; 'captions.enable': never; 'captions.disable': never; 'pip.enter': never; 'pip.exit': never; 'live.playing': never; 'live.seekToEdge': never; 'live.badge': never; 'cast.start': never; 'cast.stop': never; 'cast.connecting': never; 'airplay.start': never; 'airplay.stop': never; 'slider.seek': never; 'time.current': never; 'time.duration': never; 'time.remaining': never; 'time.elapsedSuffix': { duration: string | number; }; 'time.durationSuffix': { duration: string | number; }; 'time.remainingSuffix': { duration: string | number; }; 'time.showElapsed': { duration: string | number; }; 'time.showDuration': { duration: string | number; }; 'time.showRemaining': { duration: string | number; }; 'time.toggleElapsed': never; 'time.toggleDuration': never; 'time.position': { current: string | number; duration: string | number; }; 'time.unknown': never; 'playback.rate': { rate: string | number; }; 'volume.mutedValue': { percent: string | number; }; 'volume.muted': never; 'volume.label': never; 'volume.value': { value: string | number; }; 'status.captionsOn': never; 'status.captionsOff': never; 'status.paused': never; 'status.playing': never; 'status.fullscreen': never; 'status.pip': never; 'status.exitPip': never; 'status.seekedTo': { time: string | number; }; 'container.label': never; 'errors.aborted': never; 'errors.network': never; 'errors.decode': never; 'errors.source': never; 'errors.encrypted': never; 'errors.unplayable': never; 'errors.title': never; 'errors.unexpected': never; 'common.empty': never; 'common.ok': never; 'menu.settings': never; 'menu.quality': never; 'menu.audio': never; 'menu.default': never; 'menu.speed': never; 'menu.captions': never; 'menu.playbackRate': never; 'menu.back': never; 'menu.off': never; 'menu.auto': never; 'menu.autoWithLabel': { label: string | number; }; 'menu.subtitles': never; } //#endregion //#endregion //#region ../utils/dist/types/types.d.ts //#region src/types/types.d.ts /** @internal */ type UnionToIntersection = (U extends any ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never; /** * Matches strings that include the literal substring `Needle` (for example a `{param}` token). * * @internal */ type Contains = `${string}${Needle}${string}`; //#endregion //#region ../core/dist/dev/core/i18n/params.d.ts //#region src/core/i18n/params.d.ts /** BCP 47 language tag; built-ins are narrowed for autocomplete. */ type Locale = (typeof LOCALES)[number] | (string & {}); /** Nested shape used by authored locale files. */ interface Translations { readonly [key: string]: string | Translations | undefined; } type TranslationKey = keyof TranslationParams; type ParametricKey = { [Key in TranslationKey]: TranslationParams[Key] extends never ? never : Key; }[TranslationKey]; type ParametricTemplate = Params extends Record ? UnionToIntersection<{ [Name in keyof Params & string]: Contains<`{${Name}}`>; }[keyof Params & string]> : never; type ParametricTranslations = { [Key in ParametricKey]: ParametricTemplate; }; /** Player copy keyed by semantic key; all entries are optional overlays. */ type FlatTranslations = { [Key in TranslationKey]?: TranslationParams[Key] extends never ? string : Key extends keyof ParametricTranslations ? ParametricTranslations[Key] : string; } & Record; //#endregion //#region ../core/dist/dev/core/i18n/browser-translation.d.ts //#region src/core/i18n/browser-translation.d.ts /** @internal */ interface GetBrowserTranslationsOptions { /** * When true, call `Translator.create()` for `downloadable` / `downloading` (may download the on-device model). * Defaults to false — production providers only use pre-installed models. */ downloadIfNeeded?: boolean; /** Invoked when a model download starts and when `Translator.create()` resolves. */ onModelDownload?: { start?: (targetLanguage: string) => void; finish?: (targetLanguage: string) => void; }; } /** * First non-default tag in the lookup chain used as the browser translation target. * * @internal */ export declare function resolveBrowserTranslationTarget(locale: string): string | undefined; /** * Whether to invoke the Browser Translation API for this locale after lazy built-in loading. * * @internal */ export declare function shouldAttemptBrowserTranslation(locale: Locale, loadedLazyTags: readonly string[], translations?: Partial): boolean; /** * Translates English registry values via the on-device Browser Translation API when a pre-installed model is available. * Results are cached per target language tag. * * @internal */ export declare function getBrowserTranslations(locale: string, options?: GetBrowserTranslationsOptions): Promise>; //#endregion //#region ../core/dist/dev/core/i18n/load-locale.d.ts //#region src/core/i18n/load-locale.d.ts /** * Lazy-import the built-in locale pack for a tag, or its closest fallback in the {@link findLocaleKeys} chain. Resolves * to `undefined` when that chain reaches a registered locale first or no built-in pack matches. * * @param tag - BCP 47 tag to load, such as `fr-CA`. * @public */ export declare function loadLocale(tag: string): Promise | undefined>; //#endregion //#endregion //#region ../core/dist/dev/core/i18n/text.d.ts //#region src/core/i18n/text.d.ts interface Text { readonly key: string; readonly text: string; } /** * Whether a value is a text descriptor: a translation key with its English default. * * @param value - Value to check. * @public */ export declare function isText(value: unknown): value is Text; type TextParams = Record; //#endregion //#endregion //#region ../core/dist/dev/core/i18n/registry.d.ts /** * Most-specific-first BCP 47 lookup tags (normalized). Always ends with `en` when missing from the truncated chain. * * @example * `es-419-u-nu-latn` → `['es-419', 'es', 'en']` * * @param locale - BCP 47 tag to resolve. * @public */ export declare function findLocaleKeys(locale: Locale): Locale[]; /** * Register or merge translation strings for a BCP 47 locale tag. * * @param locale - BCP 47 tag (normalized to lowercase; unicode extensions stripped for the registry key). * @param translations - Partial nested locale values; merges with any existing layer for the tag. * @public */ export declare function registerI18n(locale: Locale, translations: Partial): void; /** * Return the merged registered translation map for a locale. Built-in English defaults are supplied by text * descriptors. * * @param locale - BCP 47 tag to resolve (e.g. `es-MX`, `zh-Hant-HK`). * @public */ export declare function getI18nTranslations(locale: Locale): FlatTranslations; /** * Subscribe to global registry mutations (for example after `registerI18n` or browser translation prefetch). * * @param callback - Invoked when any locale layer changes. * @public */ export declare function onI18nRegistryChange(callback: () => void): () => void; /** * Whether an exact locale tag has been registered via `registerI18n` (not whether lazy packs exist). * * @param locale - BCP 47 tag to test. * @public */ export declare function hasRegisteredLocale(locale: Locale): boolean; //#endregion //#region ../core/dist/dev/core/i18n/resolve-text.d.ts //#region src/core/i18n/resolve-text.d.ts /** @internal */ export declare function resolveText(text: Text | string): string; //#endregion //#endregion //#region ../core/dist/dev/core/i18n/translator.d.ts //#region src/core/i18n/translator.d.ts interface TranslationOptions { default?: string; } type Translator = { (key: Key, ...args: Key extends TranslationKey ? TranslationParams[Key] extends never ? [params?: TranslationOptions] : [params: TranslationParams[Key] & TranslationOptions] : [params?: TextParams & TranslationOptions]): string; (text: Text, params?: TextParams): string; }; /** * Builds a typed translator from a resolved translation map (typically from `getI18nTranslations`). * * @param translations - Merged translation map for the active locale. * @param locale - BCP 47 tag associated with the map (reserved for future locale-aware behavior). * @public */ export declare function createTranslator(translations: FlatTranslations, locale: Locale): Translator; //#endregion //#endregion //#region ../core/dist/dev/core/i18n/resolve-translation.d.ts //#region src/core/i18n/resolve-translation.d.ts type ResolveTranslationArgs = Key extends TranslationKey ? TranslationParams[Key] extends never ? [params?: TranslationOptions] : [params: TranslationParams[Key] & TranslationOptions] : [params?: Record & TranslationOptions]; /** * Translate a key with a translator, requiring the template params that key's English default declares. * * @param translator - Translator from `createTranslator`. * @param key - Translation key, such as `seek.forward`. * @param args - The key's template params, plus an optional `default` string. * @public */ export declare function resolveTranslation(translator: Translator, key: Key, ...args: ResolveTranslationArgs): string; //#endregion //#endregion //#region ../core/dist/dev/core/i18n/translate-text.d.ts //#region src/core/i18n/translate-text.d.ts /** * Translate a text descriptor with a translator, or interpolate its English default without one. A plain string is * returned as is. * * @param text - Text descriptor, or a string returned unchanged. * @param translator - Translator from `createTranslator`; omit it to use the English default. * @param params - Values for the text's `{placeholders}`. * @public */ export declare function translateText(text: Text | string, params?: TextParams): string; export declare function translateText(text: Text | string, translator: Translator | undefined, params?: TextParams): string; //#endregion //#endregion //#region ../utils/dist/i18n.d.ts //#region src/i18n/index.d.ts /** * Default locale used when no player or ambient locale is available. * * @internal */ export declare const DEFAULT_LOCALE = "en"; //#endregion export type { FlatTranslations, Locale, TranslationParams, Translator };