@ssgoi/core
Version:
Core animation engine for SSGOI - Native app-like page transitions with spring physics
24 lines • 894 B
TypeScript
import { Transition } from '../types';
/**
* Matches a path against a pattern
* Supports exact matches and wildcard patterns
*
* @example
* matchPath('/products', '/products') // true
* matchPath('/products/123', '/products/*') // true
* matchPath('/products/123', '/products') // false
* matchPath('/anything', '*') // true
*/
export declare function matchPath(path: string, pattern: string): boolean;
/**
* Finds a matching transition configuration for the given from and to paths
*
* First tries to find exact match for both from and to paths,
* then falls back to wildcard matches if no exact match is found.
*/
export declare function findMatchingTransition<TContext>(from: string, to: string, transitions: Array<{
from: string;
to: string;
transition: Transition<TContext>;
}>): Transition<TContext> | null;
//# sourceMappingURL=find-matching-transition.d.ts.map