1 |
|
2 |
|
3 | import { Url } from "url";
|
4 |
|
5 | import * as core from "express-serve-static-core";
|
6 |
|
7 | export = historyApiFallback;
|
8 |
|
9 | declare function historyApiFallback(options?: historyApiFallback.Options): core.RequestHandler;
|
10 |
|
11 | declare namespace historyApiFallback {
|
12 | interface Options {
|
13 | readonly disableDotRule?: true | undefined;
|
14 | readonly htmlAcceptHeaders?: readonly string[] | undefined;
|
15 | readonly index?: string | undefined;
|
16 | readonly logger?: typeof console.log | undefined;
|
17 | readonly rewrites?: readonly Rewrite[] | undefined;
|
18 | readonly verbose?: boolean | undefined;
|
19 | }
|
20 |
|
21 | interface Context {
|
22 | readonly match: RegExpMatchArray;
|
23 | readonly parsedUrl: Url;
|
24 | readonly request: core.Request;
|
25 | }
|
26 | type RewriteTo = (context: Context) => string;
|
27 |
|
28 | interface Rewrite {
|
29 | readonly from: RegExp;
|
30 | readonly to: string | RegExp | RewriteTo;
|
31 | }
|
32 | }
|