-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjDamnSmallRouter.d.ts
26 lines (26 loc) · 1013 Bytes
/
jDamnSmallRouter.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
declare namespace jDamnSmallRouter {
type CheckAvailability = (path: string, hashPath: string, params?: {
[key: string]: string;
}) => (boolean | Promise<boolean>);
type RouteFunction = (path: string, hashPath: string, params?: {
[key: string]: string;
}) => (void | Promise<void>);
class Router {
private _regexDuplicatePathId;
private _regexSearchVariables;
private _routes;
private _routeFunction403;
private _routeFunction404;
private _routing;
private _queue;
constructor();
RouteSpecialAdd(code: number, routeFunction: RouteFunction): boolean;
RouteAdd(path: string, routeFunction: RouteFunction, available?: CheckAvailability, routeFunction403?: RouteFunction): boolean;
RouteDel(path: string): boolean;
Trigger(path: string): void;
Route(path: string): Promise<void>;
CheckHash(): Promise<void>;
}
export function Create(): Router;
export {};
}