import type { MediaType, Nxtpression, RenderPreset } from '../../common/index.ts';
export interface MediaRecords {
    "media.subtitles": MediaSubtitlesRecord;
    "media.subtitles?": MediaSubtitlesProvidedRecord;
    "media.transcribe": MediaTranscribeRecord;
    "media.transcribe?": MediaTranscribeProvidedRecord;
    "media.fonts?": MediaFonts;
    "media.consolidate": MediaConsolidateRecord;
}
export interface MediaSubtitlesRecord {
    defaultLanguage?: string;
    languages?: Record<string, string>;
    fontFaces?: SubtitleFontFace[];
}
export interface MediaSubtitlesProvidedRecord {
    defaultLanguage?: string;
    languages?: Record<string, string>;
    fontFaces?: SubtitleFontFace[];
}
export interface MediaTranscribeRecord {
    engines: Record<string, string>;
    languages: Record<string, string>;
    translate?: {
        languages: Record<string, string>;
    };
    replacers?: Record<string, TranscribeReplacer | TranscribeReplacer[]>;
}
export interface MediaTranscribeProvidedRecord {
    engines: Record<string, string>;
    languages: Record<string, string>;
    translate?: {
        languages: Record<string, string>;
    };
    replacers?: Record<string, TranscribeReplacer | TranscribeReplacer[]>;
}
export type TranscribeReplacer = TranscribeReplaceReplacer | TranscribeForEachWordReplacer;
export interface TranscribeReplaceReplacer {
    type?: "replace";
    /** Expression that should return RegExp or string arg to new RegExp */
    pattern: Nxtpression<unknown, {
        item: string;
    }>;
    replacement: Nxtpression<string | ((...args: unknown[]) => string), {
        item: string;
    }>;
    flags?: string;
    _comment?: string;
}
export interface TranscribeForEachWordReplacer {
    type: "items";
    items: string[];
    _comment?: string;
    replacers: Array<{
        /** Expression that should return RegExp or string arg to new RegExp */
        pattern: Nxtpression<unknown, {
            item: string;
        }>;
        replacement: Nxtpression<string | ((...args: unknown[]) => string), {
            item: string;
        }>;
        flags?: string;
        _comment?: string;
    }>;
}
export interface MediaConsolidateRecord {
    presets?: {
        [type in MediaType]: RenderPreset;
    };
}
export interface MediaFonts {
    fontFaces?: FontFace[];
    fontFamilyNames?: Array<FontFace["family"]>;
}
interface SubtitleFontFace {
    family: string;
    asset?: string;
    weight?: "normal" | "bold";
    style?: "normal" | "italic";
}
type Range = [
    number,
    number
];
export interface FontFace {
    name: string;
    family: string;
    asset: string;
    url: string;
    weight: number;
    style: "normal" | "italic";
    ranges: Range[];
}
export {};
