import { type Draft } from "../draft.js"; import { type Flags } from "../utils/cli.js"; import { type FontMirror } from "../utils/mirror.js"; /** A per-span style block (font/strokes/shadows/size/bold…) grafted onto each span. */ export type SpanStyle = Record; /** Caption style preset (same schema as preset_captions_style.json). */ export interface CaptionStylePreset { text_material: Record; content_template: { text?: string; styles: Array>; }; segment: Record; } /** * Restyle a caption's `content` JSON: graft `spanStyle` onto every existing span * while preserving each span's `range` and `fill` (the keyword colors). Inverse * of clone-style (which preserves font, varies color). */ export declare function restyleContent(contentStr: string, spanStyle: SpanStyle): string; /** * Graft the preset's material-level fields (font_path, font_resource_id, fonts[], * has_shadow, shadow_x, border_x, is_rich_text…) onto a caption material and rebuild * its content span-aware. Pure: returns a new material, input untouched. * - clears `recognize_task_id` (else CapCut Auto-Captions regenerate + wipe the style) * - re-asserts `base_content`/`recognize_text` to the caption text AFTER grafting, * so the preset's empty values don't blank the source text (latent restyle.py bug) */ export declare function restyleMaterial(mat: Record, materialFields: Record, spanStyle: SpanStyle): Record; /** The per-span graft block = the preset's first content_template span minus its own fill + range. */ export declare function spanStyleFromPreset(preset: CaptionStylePreset): SpanStyle; /** Derive the sidecar-mirror font (path/id/resource_id) from a preset, or null if it carries no font. */ export declare function fontFromPreset(preset: CaptionStylePreset): FontMirror | null; export interface ApplyCaptionStyleOptions { preset: CaptionStylePreset; /** Restrict to one named text track; default = ALL text tracks (apply to every caption). */ trackName?: string; } /** * Apply a caption style preset to every caption on the target text track(s). * Scopes to materials REACHABLE from those tracks' segments (B-8) so orphaned * text materials left by import-captions are never touched. */ export declare function applyCaptionStyle(draft: Draft, filePath: string, opts: ApplyCaptionStyleOptions): { materialsPatched: number; segmentsPatched: number; mirrored: string[]; }; export declare function cmdRestyle(draft: Draft, filePath: string, _positional: string[], flags: Flags): void;