import { type OutputFormat, type Clip, type AdSlot, type ExportOptions, type ExportResult } from '../types/editor'; /** * Imperative handle exposé par . Permet au consumer * d'ajouter des clips en cours d'édition (boucle record↔édit P0-J5) sans devoir * passer par un re-render avec `initialClips` (qui resterait le mount initial). * * @example * ```tsx * const editorRef = useRef(null) * * function onRecorderDone(blob: Blob, durationSec: number) { * editorRef.current?.insertVideoClip(blob, durationSec) * } * * * ``` */ export interface VideoEditorHandle { /** Insère un clip vidéo entre le clip sélectionné et le suivant (P0-J5 boucle record↔édit). */ insertVideoClip(blob: Blob, durationSec: number): Promise; /** Insère une image fixe. */ insertImage(file: File, durationSec?: number): Promise; /** Split le clip sélectionné au temps courant de la preview. */ splitAtCurrent(): void; /** Lecture du tableau de clips courant (snapshot read-only). */ getClips(): Clip[]; /** Déclenche l'export programmatique (équivaut au clic du bouton Export). */ exportClips(options: ExportOptions): Promise; } export interface VideoEditorProps { /** Raw recording to edit */ source: Blob | string; /** Called when the user finishes exporting */ onExport?: (result: { blob: Blob; url: string; filename: string; mime: string; }) => void; /** Default output format */ defaultFormat?: OutputFormat; /** Default output width in pixels */ defaultWidth?: number; /** * Server endpoint handling the final assembly with native ffmpeg. When * provided, the Export button POSTs a multipart manifest to this URL * instead of running ffmpeg.wasm client-side. Use it when COEP / memory * makes the browser path unreliable. */ exportUrl?: string; /** * Pre-built clip list (multi-image slideshow). Overrides auto-generated * clip from `source`. Each clip must have a valid sourceUrl. */ initialClips?: Clip[]; /** * Pre-populated blob map for initialClips sourceUrls. Passed through to * server-compose so it can skip fetch(blob:...). */ initialBlobMap?: Map; /** * Pre-loaded subtitles (from a saved project). */ initialSubtitles?: import('../types/editor').Subtitle[]; /** Restore "burn subtitles" checkbox from a saved project */ initialBurnSubtitles?: boolean; /** Restore burn language from a saved project */ initialBurnLang?: string; /** v1.11.24+ : logo / signature par défaut (URL + position + taille). * Le logo est fetch côté client puis appliqué en watermark à l'export. */ initialLogo?: { url?: string; position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; sizePct?: number; opacity?: number; marginPct?: number; }; /** * Called when user clicks "Save project" in the sidebar. Receives the * full serializable ProjectFile (clips + subtitles + settings) so the * host app can persist it however it likes (ORM/SQLite, JSON file, etc.). */ onSaveRequested?: (project: import('../types/editor').ProjectFile) => void | Promise; /** v2.0+ — Si fourni, expose un bouton "+ Ajouter un take" dans la barre * d'actions. Appelle ce callback à la demande. L'app peut alors ouvrir le * MultiTakeRecorder et, au retour, appeler `useVideoEditor.insertVideoClip(blob, durationSec)` * pour ajouter le nouveau take après le clip sélectionné. Boucle record↔édit. */ onAddTakeRequested?: () => void; /** v2.0.13+ — Restauration projet : ad slots pré-chargés. */ initialAdSlots?: AdSlot[]; /** v2.0.13+ — Restauration projet : pistes audio chaînées pré-chargées. * Chaque entrée a un `inlineData` base64 désérialisé en File au mount. */ initialAudioTracks?: Array<{ id: string; filename: string; inlineData?: string; mimeType?: string; durationSec?: number; startSec?: number; volume?: number; }>; /** v2.0.13+ — Restauration projet : nom du projet pré-rempli. */ initialProjectName?: string; } /** * Post-recording editor. Displayed after useScreenCapture() returns a blob. * Users can split, reorder, insert images, drop overlay stickers (heart, * smile, arrow, warning, forbidden, obligation, check), adjust speed and * duration, and export the final clip as webm / gif / mp4 via ffmpeg.wasm. * * Requires cross-origin isolation (COOP/COEP headers) and the optional * peer dependency `@ffmpeg/ffmpeg` installed in the host app. */ declare const VideoEditor: import("react").ForwardRefExoticComponent>; export default VideoEditor; //# sourceMappingURL=VideoEditor.d.ts.map