(
script: string,
animationId: string,
updates: Partial<GsapAnimation> & { easeEach?: string; resetKeyframeEases?: boolean },
)
| 1416 | } |
| 1417 | |
| 1418 | export function updateAnimationInScript( |
| 1419 | script: string, |
| 1420 | animationId: string, |
| 1421 | updates: Partial<GsapAnimation> & { easeEach?: string; resetKeyframeEases?: boolean }, |
| 1422 | ): string { |
| 1423 | let parsed: ParsedGsapAst; |
| 1424 | try { |
| 1425 | parsed = parseGsapAst(script); |
| 1426 | } catch (e) { |
| 1427 | console.warn("[gsap-parser] updateAnimationInScript parse failed:", e); |
| 1428 | return script; |
| 1429 | } |
| 1430 | const target = parsed.located.find((l) => l.id === animationId); |
| 1431 | if (!target) return script; |
| 1432 | applyUpdatesToCall(target.call, updates); |
| 1433 | return recast.print(parsed.ast).code; |
| 1434 | } |
| 1435 | |
| 1436 | export function shiftPositionsInScript( |
| 1437 | script: string, |
no test coverage detected