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 | declare function unless(middleware: express.RequestHandler, options: unless.Options): express.RequestHandler;
|
14 |
|
15 | declare namespace unless {
|
16 | type pathFilter = string | RegExp | { url: string | RegExp, methods?: string[] | undefined, method?: string | string[] | undefined };
|
17 |
|
18 | export interface Options {
|
19 | custom?: ((req: express.Request) => boolean) | undefined;
|
20 | path?: pathFilter | pathFilter[] | undefined;
|
21 | ext?: string | string[] | undefined;
|
22 | method?: string | string[] | undefined;
|
23 | useOriginalUrl?: boolean | undefined;
|
24 | }
|
25 | export interface RequestHandler extends express.RequestHandler {
|
26 | unless?: typeof unless | undefined;
|
27 | }
|
28 | }
|
29 |
|
30 | export = unless;
|
31 |
|
\ | No newline at end of file |