import { G as GsapAnimation, A as ArcPathConfig, g as SplitAnimationsOptions, h as SplitAnimationsResult, a as ArcPathSegment } from './gsapSerialize-DQW1kZ2G.js'; import './types-ewozML_N.js'; import './gsapConstants.js'; declare function updateAnimationInScript(script: string, animationId: string, updates: Partial & { easeEach?: string; resetKeyframeEases?: boolean; }): string; /** * Shift every tween targeting `targetSelector` by `delta` seconds (clamped ≥0), * rewriting each call's position argument. Mirrors recast's shiftPositionsInScript * (used by timeline clip-move to keep GSAP positions in sync with the clip start). */ declare function shiftPositionsInScript(script: string, targetSelector: string, delta: number): string; /** * Linearly remap every tween targeting `targetSelector` from the old clip * [oldStart, oldDuration] onto the new [newStart, newDuration] (position and, * when present, duration scaled by the duration ratio). Mirrors recast's * scalePositionsInScript (used by timeline clip-resize). */ declare function scalePositionsInScript(script: string, targetSelector: string, oldStart: number, oldDuration: number, newStart: number, newDuration: number): string; declare function addAnimationToScript(script: string, animation: Omit): { script: string; id: string; }; declare function removeAnimationFromScript(script: string, animationId: string): string; /** * Enforce "exactly one position write per element". Position commits (drag, add * keyframe, static hold) must never leave the same selector with two conflicting * position representations (e.g. a degenerate `tl.to("#box",{duration:0,x,y})` * AND a `gsap.set("#box",{x,y})`) — the later one silently overrides the earlier, * so the element "can't move" / snaps / leaves residue on delete. * * Keeps `keepId` (the write the commit just edited); falls back to the LAST * position write in source order (the runtime-effective one) if `keepId` is stale. * Removes every OTHER pure-position write (`propertyGroup === "position"`, which * covers tl.to/from/fromTo flat-or-keyframed, tl.set, and standalone gsap.set, * including degenerate duration:0 tweens). Non-position writes for the same * selector (rotation / opacity / size / mixed) are left untouched. */ declare function dedupePositionWritesInScript(script: string, selector: string, keepId?: string): string; declare function updateKeyframeInScript(script: string, animationId: string, percentage: number, properties: Record, ease?: string): string; declare function addKeyframeToScript(script: string, animationId: string, percentage: number, properties: Record, ease?: string, backfillDefaults?: Record): string; declare function removeKeyframeFromScript(script: string, animationId: string, percentage: number): string; /** * Retime a keyframe: move the keyframe at `fromPercentage` to `toPercentage`, * PRESERVING its properties and per-keyframe ease (the Studio "Move to Playhead" * gesture). Re-sorts keyframes by percentage. No-op when the animation/keyframe * isn't found, the tween has no object-form keyframes, the move resolves onto the * same keyframe, or the destination is occupied. */ declare function moveKeyframeInScript(script: string, animationId: string, fromPercentage: number, toPercentage: number): string; /** * Resize a keyframed tween's window (boundary drag-to-retime): set the tween's * `position` (trailing position arg) + `duration`, and RE-KEY each existing * keyframe to its new percentage via `pctRemap` (each `{ from, to }` matches an * existing keyframe by its current tween-% and re-keys it to `to`). * * Unlike replace-with-keyframes (which rebuilds the keyframes object from a plain * array and loses author intent), this re-keys the percentage KEY in place and * leaves every value node, each keyframe's `_auto` + per-keyframe `ease`, the * keyframes-object `easeEach`, and the OUTER tween `ease` byte-for-byte verbatim. * No-op when the animation/keyframes can't be located. */ declare function resizeKeyframedTweenInScript(script: string, animationId: string, newPosition: number, newDuration: number, pctRemap: ReadonlyArray<{ from: number; to: number; }>): string; declare function removePropertyFromAnimation(script: string, animationId: string, property: string, from?: boolean): string; /** * Remove all keyframes from a tween, collapsing to a flat tween with one * keyframe's properties: the first for `from()`, the last otherwise (the * destination = the visible resting state). */ declare function removeAllKeyframesFromScript(script: string, animationId: string): string; /** * Convert a flat tween (to/from/fromTo) to percentage-keyframes format. * `resolvedFromValues` supplies the current DOM state: overrides the 0% endpoint * for `to()`, the 100% endpoint for `from()`, or merges into toProps for `fromTo()`. */ declare function convertToKeyframesFromScript(script: string, animationId: string, resolvedFromValues?: Record, setDuration?: number): string; /** * Replace a dynamic or static keyframes expression with a fully-resolved * percentage-keyframes object. Called when a user first edits a dynamically- * generated keyframe in the studio so it becomes statically editable. */ declare function materializeKeyframesFromScript(script: string, animationId: string, keyframes: Array<{ percentage: number; properties: Record; ease?: string; }>, easeEach?: string, resolvedSelector?: string): string; /** Insert a new keyframed `to()` call and return the new animation ID. */ declare function addAnimationWithKeyframesToScript(script: string, targetSelector: string, position: number, duration: number, keyframes: Array<{ percentage: number; properties: Record; ease?: string; auto?: boolean; }>, ease?: string, easeEach?: string): { script: string; id: string; }; /** * Split a mixed-property tween into one tween per property group (position, * scale, visual, etc.) so each group can be edited independently. * Returns the updated script and the IDs of the newly-created tweens. */ declare function splitIntoPropertyGroupsFromScript(script: string, animationId: string): { script: string; ids: string[]; }; declare function addLabelToScript(script: string, name: string, position: number): string; declare function removeLabelFromScript(script: string, name: string): string; declare function setArcPathInScript(script: string, animationId: string, config: ArcPathConfig): string; declare function updateArcSegmentInScript(script: string, animationId: string, segmentIndex: number, update: Partial): string; declare function updateMotionPathPointInScript(script: string, animationId: string, pointIndex: number, point: { x: number; y: number; }): string; declare function addMotionPathPointInScript(script: string, animationId: string, index: number, point: { x: number; y: number; }): string; declare function removeMotionPathPointInScript(script: string, animationId: string, index: number): string; declare function addMotionPathToScript(script: string, targetSelector: string, position: number, duration: number, point: { x: number; y: number; }, ease?: string): { script: string; id: string | null; }; declare function removeArcPathFromScript(script: string, animationId: string): string; /** Acorn-native, byte-preserving hold synchronization used after mutations. */ declare function syncPositionHoldsBeforeKeyframes(script: string): string; declare function splitAnimationsInScript(script: string, opts: SplitAnimationsOptions): SplitAnimationsResult; type UnrollElement = { selector: string; keyframes: Array<{ percentage: number; properties: Record; }>; easeEach?: string; }; /** * Replace a dynamic loop that generates multiple tween calls with individual * static `tl.to()` calls — one per element. Finds the loop containing the * animation and replaces the loop with unrolled static calls, preserving every * non-target statement in the loop body per iteration. */ declare function unrollDynamicAnimations(script: string, animationId: string, elements: UnrollElement[]): string; export { type UnrollElement, addAnimationToScript, addAnimationWithKeyframesToScript, addKeyframeToScript, addLabelToScript, addMotionPathPointInScript, addMotionPathToScript, convertToKeyframesFromScript, dedupePositionWritesInScript, materializeKeyframesFromScript, moveKeyframeInScript, removeAllKeyframesFromScript, removeAnimationFromScript, removeArcPathFromScript, removeKeyframeFromScript, removeLabelFromScript, removeMotionPathPointInScript, removePropertyFromAnimation, resizeKeyframedTweenInScript, scalePositionsInScript, setArcPathInScript, shiftPositionsInScript, splitAnimationsInScript, splitIntoPropertyGroupsFromScript, syncPositionHoldsBeforeKeyframes, unrollDynamicAnimations, updateAnimationInScript, updateArcSegmentInScript, updateKeyframeInScript, updateMotionPathPointInScript };