Installation
npm install --save @types/agent-base
Summary
This package contains type definitions for agent-base (https://github.com/TooTallNate/node-agent-base#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/agent-base.
import { EventEmitter } from "events";
declare namespace Agent {
type AgentCallback = (
req?: any,
opts?: {
secureEndpoint: boolean;
},
) => void;
interface AgentOptions {
timeout?: number | undefined;
host?: string | undefined;
port?: number | undefined;
[key: string]: any;
}
interface Agent extends EventEmitter {
_promisifiedCallback: boolean;
timeout: number | null;
options?: AgentOptions | undefined;
callback: AgentCallback;
addRequest: (req?: any, opts?: any) => void;
freeSocket: (socket: any, opts: any) => void;
}
}
declare function Agent(opts?: Agent.AgentOptions): Agent.Agent;
declare function Agent(
callback: Agent.AgentCallback,
opts?: Agent.AgentOptions,
): Agent.Agent;
export = Agent;
Additional Details
- Last updated: Mon, 06 Nov 2023 22:41:04 GMT
- Dependencies: @types/node
Credits
These definitions were written by Christopher Quadflieg.