import type { TTSConfig } from "./TTSService.js";
import type { ToolProviderConfig } from "./tools-config-normalizer.js";
import { type SREMathSpeechOptions } from "./tts/math-speech.js";
export type TTSLayoutMode = "reserved-row" | "expanding-row" | "floating-overlay" | "left-aligned";
export interface TTSHostToolbarLayout {
    mount: "before-buttons";
    controlsRow: {
        reserveSpace: boolean;
        expandWhenToolActive: boolean;
    };
}
export interface TTSSpeedOptionConfig {
    rate: number;
    label?: string;
    ariaLabel?: string;
}
export type TTSSpeedOption = number | TTSSpeedOptionConfig;
export interface NormalizedTTSSpeedOption {
    rate: number;
    label: string;
    ariaLabel: string;
}
export interface TTSRuntimeSettings {
    backend?: "browser" | "polly" | "google" | "server";
    serverProvider?: "polly" | "google" | "custom";
    provider?: "polly" | "google" | "custom";
    engine?: "standard" | "neural";
    sampleRate?: number;
    format?: "mp3" | "ogg" | "pcm";
    speechMarksMode?: "word" | "word+sentence";
    defaultVoice?: string;
    rate?: number;
    pitch?: number;
    apiEndpoint?: string;
    language?: string;
    transportMode?: "pie" | "custom";
    endpointMode?: "synthesizePath" | "rootPost";
    endpointValidationMode?: "voices" | "endpoint" | "none";
    includeAuthOnAssetFetch?: boolean;
    validateEndpoint?: boolean;
    cache?: boolean;
    speedRate?: "slow" | "medium" | "fast";
    lang_id?: string;
    /**
     * Optional inline TTS speed buttons.
     * - Omitted/non-array: default speed buttons are shown.
     * - Empty array: hide speed buttons.
     * - Arrays that sanitize to no valid values: default speed buttons are shown.
     * - Object entries can customize button text while preserving numeric rates.
     */
    speedOptions?: TTSSpeedOption[];
    layoutMode?: TTSLayoutMode;
    /**
     * Per-token highlighting of math expressions.
     * - `true` / omitted (default): when the spoken math aligns confidently to the
     *   rendered MathML, the formula is highlighted glyph by glyph; otherwise it
     *   safely falls back to a whole-formula block.
     * - `false`: every formula is highlighted as a single block (the fallback),
     *   never broken into per-token highlights. Prose word tracking is unaffected.
     */
    mathTokenHighlighting?: boolean;
    /**
     * Speech Rule Engine options for generated MathML speech. Hosts can use these
     * to tune SRE itself (for example ClearSpeak ImpliedTimes/Paren preferences)
     * instead of relying on toolkit-specific speech rewrites.
     */
    mathSpeech?: SREMathSpeechOptions;
}
export declare const normalizeTTSLayoutMode: (value: unknown, fallback?: TTSLayoutMode) => TTSLayoutMode;
/** Default inline TTS speed button multipliers (excluding 1.0×). */
export declare const DEFAULT_TTS_SPEED_OPTIONS: readonly number[];
export declare const normalizeTTSSpeedOptionConfigs: (value: unknown) => TTSSpeedOption[];
/**
 * Resolves inline toolbar speed options from host config.
 * - Omitted/non-array: default speed buttons.
 * - Empty array: hide speed buttons.
 * - Arrays that sanitize to no valid values: default speed buttons.
 * - 1.0× is never shown as a discrete speed button.
 */
export declare const normalizeTTSSpeedOptions: (value: unknown) => number[];
export declare const normalizeTTSSpeedControlOptions: (value: unknown) => NormalizedTTSSpeedOption[];
export declare const formatTTSSpeedOptionsAsText: (values: number[]) => string;
/**
 * Parse comma/semicolon-separated multipliers from settings UI text.
 * - Empty or whitespace-only string → hide speed buttons (`[]`).
 * - Non-empty text with no parseable finite numbers → same as invalid-only array config: defaults.
 */
export declare const parseTTSSpeedOptionsFromText: (text: string) => number[];
export declare const resolveTTSRuntimeSettings: (config: ToolProviderConfig | TTSRuntimeSettings | undefined) => TTSRuntimeSettings;
export declare const resolveTTSBackend: (config: TTSRuntimeSettings) => NonNullable<TTSRuntimeSettings["backend"]>;
export declare const resolveRuntimeProvider: (config: TTSRuntimeSettings, backend: NonNullable<TTSRuntimeSettings["backend"]>) => TTSRuntimeSettings["serverProvider"];
export declare const resolveTransportMode: (config: TTSRuntimeSettings, runtimeProvider: TTSRuntimeSettings["serverProvider"]) => NonNullable<TTSRuntimeSettings["transportMode"]>;
export declare const buildRuntimeTTSConfig: (config: TTSRuntimeSettings) => Partial<TTSConfig>;
export declare const resolveTTSLayoutMode: (config: TTSRuntimeSettings) => TTSLayoutMode;
export declare const resolveTTSHostToolbarLayout: (config: TTSRuntimeSettings) => TTSHostToolbarLayout;
