UNPKG

2.1 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/express-unless`
3
4# Summary
5This package contains type definitions for express-unless (https://www.npmjs.org/package/express-unless).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-unless.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-unless/index.d.ts)
10````ts
11// Type definitions for express-unless 0.5
12// Project: https://www.npmjs.org/package/express-unless
13// Definitions by: Wonshik Kim <https://github.com/wokim>
14// Joao Vieira <https://github.com/joaovieira>
15// Michal Kaminski <https://github.com/michal-b-kaminski>
16// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
17// TypeScript Version: 2.3
18
19import express = require("express");
20
21declare function unless(options: unless.Options): express.RequestHandler;
22declare function unless(options: unless.Options["custom"]): express.RequestHandler;
23declare function unless(middleware: express.RequestHandler, options: unless.Options): express.RequestHandler;
24
25declare namespace unless {
26 type pathFilter = string | RegExp | { url: string | RegExp, methods?: string[] | undefined, method?: string | string[] | undefined };
27
28 export interface Options {
29 custom?: ((req: express.Request) => boolean) | undefined;
30 path?: pathFilter | pathFilter[] | undefined;
31 ext?: string | string[] | undefined;
32 method?: string | string[] | undefined;
33 useOriginalUrl?: boolean | undefined;
34 }
35 export interface RequestHandler extends express.RequestHandler {
36 unless?: typeof unless | undefined;
37 }
38}
39
40export = unless;
41
42````
43
44### Additional Details
45 * Last updated: Thu, 10 Feb 2022 07:31:36 GMT
46 * Dependencies: [@types/express](https://npmjs.com/package/@types/express)
47 * Global values: none
48
49# Credits
50These definitions were written by [Wonshik Kim](https://github.com/wokim), [Joao Vieira](https://github.com/joaovieira), and [Michal Kaminski](https://github.com/michal-b-kaminski).
51
\No newline at end of file