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