UNPKG

@omicrxn/mercury

Version:

Mercury is a Svelte animation library powered by Motion. It simplifies complex animations with Svelte actions, provides layout and exit animations, and integrates seamlessly with Svelte features.

17 lines (16 loc) 1.06 kB
import type { AnimationPlaybackControls } from 'motion'; /** Parent element used to coordinate enter/exit timing within a slot. */ export declare const getPresenceScope: (element: HTMLElement) => HTMLElement; /** Whether a wait-mode exit is still running in this scope. */ export declare const hasPendingWaitExit: (element: HTMLElement) => boolean; /** Register a wait-mode exit so subsequent enters in the same scope defer. */ export declare const registerWaitExit: (element: HTMLElement) => void; /** Call when a wait-mode exit animation finishes or is cancelled. */ export declare const completeWaitExit: (element: HTMLElement) => void; /** * Run `fn` once any active wait-mode exit in this scope has finished. * Waits one macrotask so out:presence can register in the same commit. */ export declare const runAfterPendingExit: (element: HTMLElement, fn: () => void) => void; export declare const registerMercuryControls: (element: HTMLElement, controls: AnimationPlaybackControls) => void; export declare const stopMercury: (element: HTMLElement) => void;