UNPKG

797 BTypeScriptView Raw
1import { Key } from 'path-to-regexp';
2import { RestRouterOptions } from './rest-router';
3import { ResolvedRoute, RouteEntry } from './route-entry';
4import { BaseRouter } from './router-base';
5/**
6 * Route entry with path-to-regexp
7 */
8interface RegExpRouteEntry extends RouteEntry {
9 regexp: RegExp;
10 keys: Key[];
11}
12/**
13 * Router implementation based on regexp matching
14 */
15export declare class RegExpRouter extends BaseRouter {
16 private routes;
17 private _sorted;
18 private _sort;
19 constructor(options?: RestRouterOptions);
20 protected addRouteWithPathVars(route: RouteEntry): void;
21 protected findRouteWithPathVars(verb: string, path: string): ResolvedRoute | undefined;
22 protected listRoutesWithPathVars(): RegExpRouteEntry[];
23 private _buildPathParams;
24}
25export {};