UNPKG

1.57 kBTypeScriptView Raw
1import rp = require('.');
2import http = require('http');
3
4export interface RequestError extends Error {
5 name: 'RequestError';
6 cause: any;
7 error: any;
8 options: rp.Options;
9 response: http.IncomingMessage;
10}
11export interface RequestErrorConstructor {
12 new (cause: any, options: rp.Options, response: http.IncomingMessage): RequestError;
13 (cause: any, options: rp.Options, response: http.IncomingMessage): RequestError;
14 prototype: RequestError;
15}
16export const RequestError: RequestErrorConstructor;
17
18export interface StatusCodeError extends Error {
19 name: 'StatusCodeError';
20 statusCode: number;
21 error: any;
22 options: rp.Options;
23 response: http.IncomingMessage;
24}
25export interface StatusCodeErrorConstructor extends Error {
26 new (statusCode: number, body: any, options: rp.Options, response: http.IncomingMessage): StatusCodeError;
27 (statusCode: number, body: any, options: rp.Options, response: http.IncomingMessage): StatusCodeError;
28 prototype: StatusCodeError;
29}
30export const StatusCodeError: StatusCodeErrorConstructor;
31
32export interface TransformError extends Error {
33 name: 'TransformError';
34 cause: any;
35 error: any;
36 options: rp.Options;
37 response: http.IncomingMessage;
38}
39export interface TransformErrorConstructor extends Error {
40 new (cause: any, options: rp.Options, response: http.IncomingMessage): TransformError;
41 (cause: any, options: rp.Options, response: http.IncomingMessage): TransformError;
42 prototype: TransformError;
43}
44export const TransformError: TransformErrorConstructor;