import type { MotionStateContext, Options } from "../types/index.js"; import type { DOMKeyframesDefinition, VisualElement, VisualElementOptions } from "motion-dom"; import type { Feature } from "../features/feature.js"; import type { StateType } from "../features/animation/animation.js"; import type { PresenceContext } from "../components/animate-presence/presence.svelte.js"; export declare const mountedStates: WeakMap; /** * Core class that manages animation state and orchestrates animations. * Handles component lifecycle methods in the correct order based on component tree position. */ export declare class MotionState { type: "html" | "svg"; element: HTMLElement | SVGElement | null; parent?: MotionState; isExiting: boolean; presenceContainer: HTMLElement | null; /** * Svelte-specific: set by the Motion component when inside an AnimatePresence * wait-mode gate. While it returns true, the entering element holds its * initial values instead of running its mount animation. */ isEnterBlocked?: () => boolean; /** * Svelte-specific: marked when this element was hidden by the wait-mode gate, * so the enter animation is replayed once the gate opens. */ enterWasGated: boolean; options: Options & { presenceContext?: PresenceContext; features?: Array; }; private children?; latestValues: DOMKeyframesDefinition; private features; visualElement: VisualElement; constructor(options: Options, parent?: MotionState); private _context; get context(): MotionStateContext; /** * Initialize features from options and global lazy features * Features are stored by key to avoid duplicate instantiation */ updateFeatures(): void; updateOptions(options: Options): void; mount(element: HTMLElement | SVGElement): void; beforeUnmount(): void; unmount(): void; beforeUpdate(): void; update(): void; tryExitComplete(): void; setActive(name: StateType, isActive: boolean): void; /** * Svelte-specific: flip an animation type's active flag without triggering animations. * Used by AnimatePresence wait-mode gating, where an entering element must not adopt * its animate styles until blocking exits have finished. */ setActiveNoAnimate(name: StateType, isActive: boolean): void; /** * Svelte-specific: replay the enter animation from initial values. * Used by AnimatePresence wait-mode when the gate opens. The element was * hidden (display:none) while blocked, and its mount animation may have * already started or completed underneath — so we jump back to the resolved * initial values, reset the animation state, and run a fresh pass. */ enterFromInitial(): void; /** * Svelte-specific: read whether an animation type is currently active. * Replaces the old `activeStates` record. */ isActive(name: StateType): boolean; isMounted(): boolean; /** * Create and attach a visual element using the given renderer. */ initVisualElement(renderer: (tag: string, options: VisualElementOptions) => VisualElement): void; getSnapshot(options: Options, isPresent?: boolean): void; didUpdate(): void; }