@types/agent-base
TypeScript icon, indicating that this package has built-in type declarations

4.2.5 • Public • Published

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.

index.d.ts

/// <reference types="node" />
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;
    }
}

/**
 * Base `http.Agent` implementation.
 * No pooling/keep-alive is implemented by default.
 */
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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/agent-base

Weekly Downloads

7,195

Version

4.2.5

License

MIT

Unpacked Size

4.64 kB

Total Files

5

Last publish

Collaborators

  • types