1 |
|
2 | import type { ClientRequest } from 'node:http';
|
3 | declare const reentry: unique symbol;
|
4 | type TimedOutOptions = {
|
5 | host?: string;
|
6 | hostname?: string;
|
7 | protocol?: string;
|
8 | };
|
9 | export type Delays = {
|
10 | lookup?: number;
|
11 | socket?: number;
|
12 | connect?: number;
|
13 | secureConnect?: number;
|
14 | send?: number;
|
15 | response?: number;
|
16 | read?: number;
|
17 | request?: number;
|
18 | };
|
19 | export type ErrorCode = 'ETIMEDOUT' | 'ECONNRESET' | 'EADDRINUSE' | 'ECONNREFUSED' | 'EPIPE' | 'ENOTFOUND' | 'ENETUNREACH' | 'EAI_AGAIN';
|
20 | export declare class TimeoutError extends Error {
|
21 | event: string;
|
22 | code: ErrorCode;
|
23 | constructor(threshold: number, event: string);
|
24 | }
|
25 | export default function timedOut(request: ClientRequest, delays: Delays, options: TimedOutOptions): () => void;
|
26 | declare module 'http' {
|
27 | interface ClientRequest {
|
28 | [reentry]?: boolean;
|
29 | }
|
30 | }
|
31 | export {};
|