@ssgoi/core
Version:
Core animation engine for SSGOI - Native app-like page transitions with spring physics
36 lines • 1.22 kB
TypeScript
import { TransitionCallback } from '../types';
declare const SCOPE_ATTR = "data-ssgoi-scope";
declare const SCOPE_READY_ATTR = "data-ssgoi-scope-ready";
/**
* Creates a transition scope that controls child transition behavior.
*
* When a child transition has `scope: 'local'`:
* - If child mounts simultaneously with scope → skip IN animation
* - If child unmounts simultaneously with scope → skip OUT animation
* - If child mounts/unmounts while scope is stable → run animation
*
* @returns A ref callback to attach to the scope container element
*
* @example
* ```tsx
* // React
* <div ref={createTransitionScope()} style={{ display: 'contents' }}>
* <div ref={transition(fadeIn(), { scope: 'local' })}>
* Content
* </div>
* </div>
* ```
*/
export declare function createTransitionScope(): TransitionCallback;
/**
* Check if scope element is ready (mounted and initial render complete)
* @internal
*/
export declare function isScopeReady(scope: Element): boolean;
/**
* Find the closest transition scope element
* @internal
*/
export declare function findScope(element: Element): Element | null;
export { SCOPE_ATTR, SCOPE_READY_ATTR };
//# sourceMappingURL=transition-scope.d.ts.map