JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8774
  • Score
    100M100P100Q13709F
  • License MIT

TypeScript definitions for agent-base

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/agent-base) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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: Tue, 17 Oct 2023 21:12:30 GMT
    • Dependencies: @types/node

    Credits

    These definitions were written by Christopher Quadflieg.