UNPKG

1.8 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/connect-history-api-fallback`
3
4# Summary
5This package contains type definitions for connect-history-api-fallback (https://github.com/bripkens/connect-history-api-fallback#readme).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/connect-history-api-fallback.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/connect-history-api-fallback/index.d.ts)
10````ts
11/// <reference types="node" />
12
13import { Url } from "url";
14
15import * as core from "express-serve-static-core";
16
17export = historyApiFallback;
18
19declare function historyApiFallback(options?: historyApiFallback.Options): core.RequestHandler;
20
21declare namespace historyApiFallback {
22 interface Options {
23 readonly disableDotRule?: true | undefined;
24 readonly htmlAcceptHeaders?: readonly string[] | undefined;
25 readonly index?: string | undefined;
26 readonly logger?: typeof console.log | undefined;
27 readonly rewrites?: readonly Rewrite[] | undefined;
28 readonly verbose?: boolean | undefined;
29 }
30
31 interface Context {
32 readonly match: RegExpMatchArray;
33 readonly parsedUrl: Url;
34 readonly request: core.Request;
35 }
36 type RewriteTo = (context: Context) => string;
37
38 interface Rewrite {
39 readonly from: RegExp;
40 readonly to: string | RegExp | RewriteTo;
41 }
42}
43
44````
45
46### Additional Details
47 * Last updated: Mon, 20 Nov 2023 23:36:24 GMT
48 * Dependencies: [@types/express-serve-static-core](https://npmjs.com/package/@types/express-serve-static-core), [@types/node](https://npmjs.com/package/@types/node)
49
50# Credits
51These definitions were written by [Douglas Duteil](https://github.com/douglasduteil).
52
\No newline at end of file