UNPKG

@jay-js/system

Version:

A powerful and flexible TypeScript library for UI, state management, lazy loading, routing and managing draggable elements in modern web applications.

22 lines (21 loc) 922 B
/** * Converts a route path to a regular expression pattern * @param {string} path - The route path to convert * @returns {RegExp} A regular expression that matches the route path */ export declare function pathToRegex(path: string): { regexp: RegExp; keys: import("path-to-regexp").Keys; }; /** * Creates a matcher function for a path pattern * @param {string} path - The route path pattern * @returns A matcher function that returns match information or null */ export declare function createMatcher(path: string): import("path-to-regexp").MatchFunction<Partial<Record<string, string | string[]>>>; /** * Creates a path generator function from a pattern * @param {string} path - The route path pattern * @returns A function that generates paths from parameters */ export declare function createPathGenerator(path: string): (params?: Partial<Record<string, string | string[]>> | undefined) => string;