UNPKG

1.22 kBTypeScriptView Raw
1/// <reference types="node" />
2import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http";
3import { HttpHandlerOptions, Provider } from "@aws-sdk/types";
4import { Agent as hAgent } from "http";
5import { Agent as hsAgent } from "https";
6/**
7 * Represents the http options that can be passed to a node http client.
8 */
9export interface NodeHttpHandlerOptions {
10 /**
11 * The maximum time in milliseconds that the connection phase of a request
12 * may take before the connection attempt is abandoned.
13 */
14 connectionTimeout?: number;
15 /**
16 * The maximum time in milliseconds that a socket may remain idle before it
17 * is closed.
18 */
19 socketTimeout?: number;
20 httpAgent?: hAgent;
21 httpsAgent?: hsAgent;
22}
23export declare class NodeHttpHandler implements HttpHandler {
24 private config?;
25 private readonly configProvider;
26 readonly metadata: {
27 handlerProtocol: string;
28 };
29 constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>);
30 private resolveDefaultConfig;
31 destroy(): void;
32 handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
33 response: HttpResponse;
34 }>;
35}