mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
export Response thanks to a namespace
This commit is contained in:
@@ -9,3 +9,5 @@ api.get('/users/:userid', function (req, res, next) {
|
||||
});
|
||||
|
||||
api.use(errorHandler());
|
||||
|
||||
let res: errorHandler.Response;
|
||||
|
||||
16
api-error-handler/api-error-handler.d.ts
vendored
16
api-error-handler/api-error-handler.d.ts
vendored
@@ -8,6 +8,22 @@
|
||||
declare module 'api-error-handler' {
|
||||
import * as express from 'express';
|
||||
|
||||
namespace apiErrorHandler {
|
||||
|
||||
// Body response: the JSON returned by api-error-handler
|
||||
// See https://github.com/expressjs/api-error-handler/blob/1.0.0/index.js
|
||||
interface Response {
|
||||
status: number;
|
||||
stack?: string;
|
||||
message: string;
|
||||
|
||||
// Client errors
|
||||
code?: any;
|
||||
name?: string;
|
||||
type?: any;
|
||||
}
|
||||
}
|
||||
|
||||
function apiErrorHandler(options?: any): express.ErrorRequestHandler;
|
||||
|
||||
export = apiErrorHandler;
|
||||
|
||||
Reference in New Issue
Block a user