import { TimelineCommandResult, TimelineEditPreview, TimelineTrimEditCommand } from "@techsquidtv/canvas-timeline-core"; //#region src/hooks/clips/useTimelineClipTrim.d.ts /** Data captured when a clip edge starts a pointer trim. */ interface TimelineClipTrimStartInput { /** Clip whose edge will move. */ clipId: string; /** Edge being trimmed. */ edge: TimelineTrimEditCommand['edge']; /** Initial horizontal client coordinate. */ clientX: number; } /** Result returned by `useTimelineClipTrim`. */ interface UseTimelineClipTrimResult { /** Whether this hook owns an active trim gesture. */ trimming: boolean; /** Captures the clip edge and zoom, and prepares snapping. */ startClipTrim: (input: TimelineClipTrimStartInput) => TimelineCommandResult; /** Publishes a non-mutating preview using the captured start geometry. */ moveClipTrim: (input: Pick) => TimelineCommandResult; /** Revalidates and commits this gesture as one undo step. A click alone creates no edit. */ endClipTrim: () => TimelineCommandResult; /** Discards this gesture's preview and snap guides without changing the document. */ cancelClipTrim: () => TimelineCommandResult; } /** * Headless pointer trimming for custom DOM or canvas clip edges. * * Capture the pointer on your element after a successful start; forward moves, * pointer up, and cancellation to the corresponding commands. The hook captures * start geometry once, delegates snapping and edit policy to Core, and cancels * its preview on unmount. It has no DOM or per-frame state subscription. * Compose with `useTimelineEditPreview` for live preview UI. * * @returns Trim gesture state and start, move, commit, and cancel commands. * @example * ```tsx * const trim = useTimelineClipTrim(); * return