import { z } from "zod"; /** * Zod schema for one serialized subtitle block. */ export declare const TextBlockSchema: z.ZodObject<{ text: z.ZodString; time: z.ZodNumber; duration: z.ZodNumber; wordTimings: z.ZodOptional>; }, "strip", z.ZodTypeAny, { text: string; time: number; duration: number; wordTimings?: number[] | undefined; }, { text: string; time: number; duration: number; wordTimings?: number[] | undefined; }>; /** * Zod schema for a serialized subtitles asset. */ export declare const SubtitlesSchema: z.ZodObject<{ id: z.ZodString; language: z.ZodString; duration: z.ZodNumber; textBlocks: z.ZodArray>; }, "strip", z.ZodTypeAny, { text: string; time: number; duration: number; wordTimings?: number[] | undefined; }, { text: string; time: number; duration: number; wordTimings?: number[] | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { id: string; duration: number; language: string; textBlocks: { text: string; time: number; duration: number; wordTimings?: number[] | undefined; }[]; }, { id: string; duration: number; language: string; textBlocks: { text: string; time: number; duration: number; wordTimings?: number[] | undefined; }[]; }>; /** * One subtitle segment with timing and optional per-word timing information. */ export interface TextBlock { text: string; time: number; duration: number; wordTimings?: number[]; } interface SubtitlesOptions { language?: string; duration?: number; textBlocks?: TextBlock[]; } /** * Library subtitles asset composed of ordered timed text blocks. * * Besides storing subtitle content, this class keeps linked timeline subtitle clips in sync when * blocks are edited, inserted, removed, or when duration changes as a result of content edits. */ export declare class Subtitles { protected id: string; protected language: string; protected duration: number; protected textBlocks: TextBlock[]; constructor(options?: SubtitlesOptions); getId(): string; getLanguage(): string; getDuration(): number; getTextBlocks(): readonly TextBlock[]; /** * Inserts a subtitle block and updates dependent subtitle clips. * * @param textBlock Subtitle block to insert. * @param index Optional insertion index. Defaults to appending at the end. */ addTextBlock(textBlock: TextBlock, index?: number): void; /** * Removes a subtitle block by index and updates dependent subtitle clips. * * @param index Index of the block to remove. */ removeTextBlock(index: number): void; /** * Replaces the entire subtitle block list. * * @param textBlocks New ordered subtitle blocks. */ setTextBlocks(textBlocks: TextBlock[]): void; /** * Partially updates one subtitle block in place. * * @param index Index of the block to update. * @param textBlock Partial block fields to merge into the existing block. */ updateTextBlock(index: number, textBlock: Partial): void; /** * @deprecated - Language is not used and probably not be used */ setLanguage(language: string): void; /** * Recomputes the subtitles duration from the current block list. */ fitDurationToBlocks(): void; /** * Performs lightweight integrity checks on block ordering, timing, and overlap. */ validateTextBlocks(): void; /** * Pushes subtitle duration changes to every timeline clip linked to this subtitles asset. */ updateSubtitlesClips(): void; /** * Serializes the subtitles asset into project-safe data. * * @returns Serialized subtitles payload. */ serialize(): { id: string; duration: number; language: string; textBlocks: { text: string; time: number; duration: number; wordTimings?: number[] | undefined; }[]; }; /** * Reconstructs a subtitles asset from serialized data. * * @param data Serialized subtitles payload. * @returns Deserialized subtitles asset. */ static deserialize(data: object): Subtitles; /** * Creates a deep clone by round-tripping through serialized data. * * @returns Cloned subtitles asset. */ clone(): Subtitles; } export {};