aboutsummaryrefslogtreecommitdiff
path: root/node_modules/got/dist/source/core/utils/timed-out.d.ts
blob: 5b495d464a16a215058c24bdb2729adb2d41af24 (plain)
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
import { ClientRequest } from 'http';
declare const reentry: unique symbol;
interface TimedOutOptions {
    host?: string;
    hostname?: string;
    protocol?: string;
}
export interface Delays {
    lookup?: number;
    connect?: number;
    secureConnect?: number;
    socket?: number;
    response?: number;
    send?: number;
    request?: number;
}
export declare type ErrorCode = 'ETIMEDOUT' | 'ECONNRESET' | 'EADDRINUSE' | 'ECONNREFUSED' | 'EPIPE' | 'ENOTFOUND' | 'ENETUNREACH' | 'EAI_AGAIN';
export declare class TimeoutError extends Error {
    event: string;
    code: ErrorCode;
    constructor(threshold: number, event: string);
}
declare const _default: (request: ClientRequest, delays: Delays, options: TimedOutOptions) => () => void;
export default _default;
declare module 'http' {
    interface ClientRequest {
        [reentry]: boolean;
    }
}