1 | import flatten = require('array-flatten');
|
2 | export declare type Next<T = void> = (err?: Error | null) => T;
|
3 | export declare type RequestHandler<T, U, V = void> = (req: T, res: U, next: Next<V>) => V;
|
4 | export declare type ErrorHandler<T, U, V = void> = (err: Error, req: T, res: U, next: Next<V>) => V;
|
5 | export declare type Middleware<T, U, V = void> = RequestHandler<T, U, V> | ErrorHandler<T, U, V>;
|
6 | export declare type Handler<T, U, V = void> = Middleware<T, U, V> | flatten.NestedArray<Middleware<T, U, V>>;
|
7 |
|
8 |
|
9 |
|
10 | export declare function compose<T, U, V = void>(...handlers: Handler<T, U, V>[]): RequestHandler<T, U, V>;
|
11 |
|
12 |
|
13 |
|
14 | export declare function errors<T, U, V = void>(...handlers: Handler<T, U, V>[]): ErrorHandler<T, U, V>;
|