// This file was auto-generated by Fern from our API Definition.

import type * as Vapi from "../index.js";

/**
 * Optional timing metadata. Shape depends on `timing.type`:
 *
 * - `word-alignment` (ElevenLabs): per-character timing at playback
 *   cadence. words[] includes space entries. Best consumed by tracking
 *   a running character count: join timing.words, add to a char cursor,
 *   and highlight text up to that position. No interpolation needed.
 *
 * - `word-progress` (Minimax with voice.subtitleType: 'word'): cursor-
 *   based word count per TTS segment. Use wordsSpoken as the anchor,
 *   interpolate forward using segmentDurationMs or timing.words until
 *   the next event arrives.
 *
 * When absent, the event is a text-only fallback for providers without
 * word-level timing (e.g. Cartesia, Deepgram, Azure). Text emits once
 * per TTS chunk when audio is playing. Optionally interpolate a word
 * cursor at ~3.5 words/sec between events for approximate tracking.
 */
export type ClientMessageAssistantSpeechTiming =
    | Vapi.ClientMessageAssistantSpeechTiming.WordAlignment
    | Vapi.ClientMessageAssistantSpeechTiming.WordProgress;

export namespace ClientMessageAssistantSpeechTiming {
    export interface WordAlignment extends Vapi.AssistantSpeechWordAlignmentTiming {
        type: "word-alignment";
    }

    export interface WordProgress extends Vapi.AssistantSpeechWordProgressTiming {
        type: "word-progress";
    }
}
