1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | import express = require("express");
|
10 |
|
11 | declare function unless(options: unless.Options): express.RequestHandler;
|
12 | declare function unless(options: unless.Options["custom"]): express.RequestHandler;
|
13 |
|
14 | declare namespace unless {
|
15 | type pathFilter = string | RegExp | { url: string | RegExp, methods?: string[] | undefined, method?: string | string[] | undefined };
|
16 |
|
17 | export interface Options {
|
18 | custom?: ((req: express.Request) => boolean) | undefined;
|
19 | path?: pathFilter | pathFilter[] | undefined;
|
20 | ext?: string | string[] | undefined;
|
21 | method?: string | string[] | undefined;
|
22 | useOriginalUrl?: boolean | undefined;
|
23 | }
|
24 | export interface RequestHandler extends express.RequestHandler {
|
25 | unless?: typeof unless | undefined;
|
26 | }
|
27 | }
|
28 |
|
29 | export = unless;
|
30 |
|
\ | No newline at end of file |