import { type Draft } from "../draft.js"; import { type Flags } from "../utils/cli.js"; export interface InitOptions { name: string; templateDir: string; draftsDir: string; } export declare function initDraft(opts: InitOptions): { draftPath: string; filePath: string; }; export interface TextHighlight { /** [start, end) in UTF-16 code units over the caption text. */ range: [number, number]; /** RGB in 0..1; fround()ed to float32 internally to match CapCut. */ color: [number, number, number]; } export interface AddTextOptions { text: string; start: number; duration: number; fontSize?: number; color?: string; alignment?: number; x?: number; y?: number; trackName?: string; /** Keyword-highlight spans. When present, emits CapCut rich-text (multi-span). */ highlights?: TextHighlight[]; } /** * CapCut rich-text content: N contiguous, non-overlapping style spans covering * [0, text.length] in UTF-16 code units. Gaps use `baseColor`; each highlight * uses its own color. Colors are fround()ed to float32 to match CapCut's native * encoding. Functional/patcher shape: solid fill, no `alpha`, no `useLetterColor`. * (`buildTextContent` is left frozen for the single-span path → byte-identity.) */ export declare function buildRichTextContent(text: string, fontSize: number, baseColor: [number, number, number], highlights: TextHighlight[], baseStyle?: Record): string; export declare function addText(draft: Draft, _filePath: string, opts: AddTextOptions): { segmentId: string; materialId: string; trackId: string; }; export interface AddAudioOptions { path: string; start: number; duration: number; volume?: number; trackName?: string; } export declare function addAudio(draft: Draft, filePath: string, opts: AddAudioOptions): { segmentId: string; materialId: string; trackId: string; }; export interface AddVideoOptions { path: string; start: number; duration: number; type?: "video" | "photo"; width?: number; height?: number; trackName?: string; } export declare function addVideo(draft: Draft, filePath: string, opts: AddVideoOptions): { segmentId: string; materialId: string; trackId: string; }; export interface AddEffectOptions { resourceId: string; name: string; start: number; duration: number; value?: number; bindSegmentId?: string; } export declare function addEffect(draft: Draft, _filePath: string, opts: AddEffectOptions): { segmentId: string; materialId: string; trackId: string; }; export declare function cmdInit(positional: string[], flags: Flags): void; export declare function cmdAddAudio(draft: Draft, filePath: string, positional: string[], flags: Flags): void; export declare function cmdAddVideo(draft: Draft, filePath: string, positional: string[], flags: Flags): void; /** Default keyword-highlight color (gold-yellow [1.0, 0.84, 0.0]). */ export declare const DEFAULT_HIGHLIGHT_COLOR = "#FFD600"; export declare function cmdAddText(draft: Draft, filePath: string, positional: string[], flags: Flags): void; export interface CaptionCard { text: string; start: number; end: number; /** Optional keyword highlight range [start, end) in UTF-16 code units. */ hl?: [number, number]; /** Optional per-card highlight color (hex); falls back to opts.highlightColor. */ color?: string; } export interface ImportCaptionsOptions { cards: CaptionCard[]; trackName?: string; highlightColor?: string; fontSize?: number; color?: string; alignment?: number; /** Clone the style (font/strokes/shadows/size) of the target track's first caption. */ cloneStyle?: boolean; } /** * Batch-build word/keyword captions and REPLACE the named text track's segments * (1:1 with the inject_word_captions.py patcher). Old text materials are left * orphaned (unreferenced => invisible => zero deletion risk). Per-card `hl` * drives the highlight; `color` overrides the global highlight color. */ export declare function importCaptions(draft: Draft, _filePath: string, opts: ImportCaptionsOptions): { trackId: string; count: number; }; export declare function cmdImportCaptions(draft: Draft, filePath: string, positional: string[], flags: Flags): void; export declare function cmdAddEffect(draft: Draft, filePath: string, positional: string[], flags: Flags): void;