forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-error-handler.d.ts
More file actions
30 lines (23 loc) · 869 Bytes
/
api-error-handler.d.ts
File metadata and controls
30 lines (23 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Type definitions for api-error-handler v1.0.0
// Project: https://github.com/expressjs/api-error-handler
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
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;
}