/** * Timeline reordering — turn a current TimelineState + an agent-supplied * permutation into a list of FCPXML events that the host can re-import. * * Why this exists: neither Resolve nor Premiere expose a scriptable "move * clip from index N to index M" call. The portable workaround is to rebuild * the timeline as FCPXML and import it. This module is the pure, testable * core of that workaround. * * Ordering rules: * - Only video clips are reorderable (audio rides along with each video * clip's underlying asset). Audio-only timelines are out of scope here. * - `newOrder` is a list of clip IDs in the desired new order. Clips not * listed keep their original relative order and stack at the end. * - Throws if newOrder references a clipId that doesn't exist on the * current timeline (typo guard — silently dropping is worse). */ import type { TimelineState } from "../types.js"; import type { FcpxmlEvent } from "./fcpxml.js"; export interface ReorderInput { /** Current timeline state from host.getTimeline(). */ current: TimelineState; /** * Desired new order, as a list of clipIds. IDs not present here keep their * original relative order and append at the end. */ newOrder: string[]; /** * Map from clipId to absolute source media path. Required because * TimelineState's ClipInfo has an OPTIONAL sourcePath — when the host * adapter can't resolve it (e.g. CEP fallback), the agent supplies it. * If a ClipInfo already has sourcePath, the map entry is optional. */ sourcePathByClipId?: Record; } /** * Build the FcpxmlEvent[] list for the reordered timeline. Each event maps * to one video clip in the new order. Sequential record offsets are computed * by the FCPXML emitter (we don't pre-compute them here — that's its job). */ export declare function reorderToEvents(input: ReorderInput): FcpxmlEvent[]; //# sourceMappingURL=reorder.d.ts.map