forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boom.d.ts
32 lines (26 loc) · 854 Bytes
/
boom.d.ts
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
31
32
// Type definitions for boom
// Project: http://github.com/hapijs/boom
// Definitions by: Igor Rogatty <http://github.com/rogatty>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module Boom {
interface BoomError {
data: any;
reformat: () => void;
isBoom: boolean;
isServer: boolean;
message: string;
output: Output;
}
export interface Output {
statusCode: number;
headers: any;
payload: any;
}
export function wrap(error: Error, statusCode?: number, message?: string): BoomError;
export function create(statusCode: number, message?: string, data?: any): BoomError;
export function badRequest(message?: string, data?: any): BoomError;
}
declare module "boom" {
export = Boom;
}