@humanspeak/svelte-motion
Version:
Framer Motion for Svelte 5. Declarative motion.<tag> components with AnimatePresence exit animations, gestures (hover, tap, drag, focus, in-view), variants, FLIP layout animations, shared-layout transitions, spring physics, and scroll-linked motion values
26 lines (25 loc) • 947 B
TypeScript
import type { FeatureBundle } from '../features';
/**
* Context value published by `<LazyMotion>` for descendant motion elements.
*/
export type LazyMotionContext = {
/** Returns the currently active feature bundle. */
getFeatures: () => FeatureBundle;
/** Returns whether an async bundle has finished loading. */
getIsLoaded: () => boolean;
/** Enables Framer Motion-style strict lazy usage checks. */
strict: boolean;
};
/**
* Reads the nearest LazyMotion context.
*
* @returns The active LazyMotion context, or undefined outside LazyMotion.
*/
export declare const getLazyMotionContext: () => LazyMotionContext | undefined;
/**
* Publishes a LazyMotion context for descendant motion elements.
*
* @param context - LazyMotion context to publish.
* @returns The same context value returned by Svelte's setContext.
*/
export declare const setLazyMotionContext: (context: LazyMotionContext) => LazyMotionContext;