@nimel/directorr-router
Version:
Router store for directorr
22 lines (21 loc) • 858 B
TypeScript
import { Key } from 'path-to-regexp';
import { ParsedQuery } from 'query-string';
import { Params } from './types';
export declare const ANY_PATH = "(.*)";
export declare class Cache<K, V> {
store: Map<K, V>;
cacheSize: number;
constructor(cacheSize?: number);
set(key: K, value: V): Map<K, V>;
get(key: K): V | undefined;
has(key: K): boolean;
get size(): number;
}
export declare function matchPath(pathname: string, urlPattern: string, exact?: boolean, strict?: boolean): {
patterns: RegExpExecArray;
keys: Key[];
} | undefined;
export declare function calcParams(patterns: string[], keys: Key[]): Params;
export declare function calcPath(path: string, queryObject?: ParsedQuery): string;
export declare function generatePath(path?: string, params?: Readonly<{}>): string;
export declare function reloadWindow(): void;