@eolme/vma-router
Version:
Router for VK Mini Apps
24 lines (23 loc) • 869 B
TypeScript
import type * as ptr from 'path-to-regexp';
import type { Page, RouteParams } from '../types';
declare type CacheRecordPath = [ptr.PathFunction, Array<ptr.Token>];
declare type CacheRecordConvert = {
regexp: RegExp;
keys: Array<ptr.Token>;
};
export declare type MatchedPath = {
uri: string;
exact: boolean;
params: RouteParams;
};
export declare type ParsedPath = {
url: string;
params: RouteParams;
};
export declare function parsePage(page: Page): CacheRecordPath;
export declare function buildPage(page: Page, params?: RouteParams): string;
export declare function convertPage(page: Page): CacheRecordConvert;
export declare function matchPage(page: Page, path: string): MatchedPath;
export declare function parsePath(path: string): ParsedPath;
export declare function preventScrollRestoration(): void;
export {};