UNPKG

936 BTypeScriptView Raw
1import { RouteConfig } from './Route.js';
2import { CallLog } from './CallHistory.js';
3export type URLMatcherObject = {
4 begin?: string;
5 end?: string;
6 include?: string;
7 glob?: string;
8 express?: string;
9 path?: string;
10 regexp?: RegExp;
11};
12export type RouteMatcherUrl = string | RegExp | URL | URLMatcherObject;
13export type RouteMatcherFunction = (callLog: CallLog) => boolean;
14type MatcherGenerator = (route: RouteConfig) => RouteMatcherFunction;
15export type RouteMatcher = RouteMatcherUrl | RouteMatcherFunction;
16export type MatcherDefinition = {
17 name: string;
18 matcher: MatcherGenerator;
19 usesBody?: boolean;
20};
21export declare const isUrlMatcher: (matcher: RouteMatcher | RouteConfig) => matcher is RouteMatcherUrl;
22export declare const isFunctionMatcher: (matcher: RouteMatcher | RouteConfig) => matcher is RouteMatcherFunction;
23export declare const builtInMatchers: MatcherDefinition[];
24export {};