import { ComputedRef, Ref } from 'vue'; import { BaseAnchorAnimationOptions, BaseAnchorAnimationType, BaseAnchorExitGeometry } from './types'; type BaseAnchorSide = 'top' | 'bottom' | 'left' | 'right'; type BaseAnchorAlignment = 'start' | 'end' | 'center'; /** * `outlineColor` and `triggerRadius` stay optional after resolution: an unset * outline colour means "read the border token", an unset radius means "measure * the reference". Both are resolved against the DOM, which this module cannot see. */ export type ResolvedBaseAnchorExitGeometry = Required; export type ResolvedBaseAnchorAnimation = Required> & { outlineColor?: string; triggerRadius?: number; exit: ResolvedBaseAnchorExitGeometry; }; interface BaseAnchorMotionOptions { clipRef: Ref; contentRef: Ref; arrowRef: Ref; side: ComputedRef; /** Cross-axis alignment of the resolved placement; anchors `expand`'s transform origin. */ alignment: ComputedRef; arrowSize: ComputedRef; showArrow: ComputedRef; animation: ComputedRef; panelBackground: ComputedRef; useCard: ComputedRef; keepAliveContent: ComputedRef; isOpen: ComputedRef; isCurrentRun: (runId: number) => boolean; setMounted: (value: boolean) => void; /** The leave visuals have settled; the host may park a retained floating root. */ onCloseSettled: () => void; setPanelSurfaceMoving: (value: boolean) => void; pulsePanelSurfaceMoving: (duration?: number) => void; /** * Measure the liquid stage and show it. Returning false means the drop cannot * be animated here (no layout, reduced motion, missing nodes) and the caller * should snap to the end state instead. */ prepareLiquid: (direction: 'open' | 'close') => boolean; /** * Write one frame of goo geometry for progress `p` (0 closed, 1 open). * `velocity` is |dp| per unit of normalised time — 1.0 is a linear ramp — * and drives the `bead` pinch. */ applyLiquidFrame: (p: number, velocity?: number) => void; /** Clear per-item inline opacity; hide the stage when the anchor ends up closed. */ settleLiquid: (open: boolean) => void; /** * True when the user asked for reduced motion. The gsap-driven types (transfer, * boom, opacity) snap to their end state; liquid handles this inside prepareLiquid. */ prefersReducedMotion: () => boolean; } /** `drip` and `bead` share one engine; only the sheet's width behaviour differs. */ export declare function isLiquidType(type: BaseAnchorAnimationType): boolean; /** * How far past its content a growing panel may stretch, in pixels, at * EXPAND_BOUNCE_REFERENCE_HEIGHT and below. A spring overshoots in proportion * to what it moves, so at one damping the bounce scaled with the panel: ~10% of * its height, 12px on a three-row menu and 40px on a 420px list. On a menu that * reads as rubber, not as a settle. */ export declare const EXPAND_BOUNCE_PX = 6; /** * The bounce budget for a panel `height` pixels tall. Flat up to the reference * height, then growing with the square root of the height. Holding taller panels * at the same 6px read as stiff from five rows (206px) up, while letting the * bounce grow in proportion is the rubber this replaced; the square root lands * in between: ~7.6px at five rows, ~10.4px at ten (394px). */ export declare function expandBounceBudget(height: number): number; /** * The default expand spring for a panel `height` pixels tall. Up to the height * where EXPAND_SPRING's overshoot fits the bounce budget this is EXPAND_SPRING * itself. Past it, damping rises just enough to hold the stretch at the budget * (see expandBounceBudget), and stiffness rises with it so the panel still * first reaches full size at the same moment: the attack is untouched, only the * overshoot shrinks and the settle shortens. */ export declare function expandSpringFor(height: number): { omega: number; zeta: number; }; export declare function useBaseAnchorMotion(options: BaseAnchorMotionOptions): { animateClose: (currentRunId: number) => Promise; animateOpen: (currentRunId: number) => Promise; bouncePad: ComputedRef<{ paddingBottom?: undefined; paddingTop?: undefined; paddingLeft?: undefined; paddingRight?: undefined; } | { paddingBottom: string; paddingTop?: undefined; paddingLeft?: undefined; paddingRight?: undefined; } | { paddingTop: string; paddingBottom?: undefined; paddingLeft?: undefined; paddingRight?: undefined; } | { paddingLeft: string; paddingBottom?: undefined; paddingTop?: undefined; paddingRight?: undefined; } | { paddingRight: string; paddingBottom?: undefined; paddingTop?: undefined; paddingLeft?: undefined; }>; clearTimeline: () => void; effectiveAnimationType: ComputedRef; /** * True while the drop owns the frame loop. The follow watcher uses this to * stay out of the way: `runLiquid` already re-measures and rewrites the whole * stage every frame, so refreshing it from a second loop is pure duplicate work. */ hasActiveLiquidRun: () => boolean; hasActiveTimeline: () => boolean; resolvedAnimation: ComputedRef; settleOpenVisualStateForFollow: () => void; usesBeadMotion: ComputedRef; usesLiquidMotion: ComputedRef; }; export {};