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[], method?: string | string[] };
|
16 |
|
17 | export interface Options {
|
18 | custom?: (req: express.Request) => boolean;
|
19 | path?: pathFilter | pathFilter[];
|
20 | ext?: string | string[];
|
21 | method?: string | string[];
|
22 | useOriginalUrl?: boolean;
|
23 | }
|
24 | export interface RequestHandler extends express.RequestHandler {
|
25 | unless?: typeof unless;
|
26 | }
|
27 | }
|
28 |
|
29 | export = unless;
|