"Fossies" - the Fresh Open Source Software Archive

Member "node-v12.18.4-win-x86/node_modules/npm/node_modules/agent-base/index.d.ts" (14 Feb 2020, 1065 Bytes) of package /windows/www/node-v12.18.4-win-x86.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 // Type definitions for agent-base 4.2.1
    2 // Project: https://github.com/TooTallNate/node-agent-base
    3 // Definitions by: Christopher Quadflieg <https://github.com/Shinigami92>
    4 
    5 /// <reference types="node" />
    6 import { EventEmitter } from 'events';
    7 
    8 declare namespace Agent {
    9     export type AgentCallback = (
   10         req?: any,
   11         opts?: {
   12             secureEndpoint: boolean;
   13         }
   14     ) => void;
   15 
   16     export interface AgentOptions {
   17         timeout?: number;
   18         host?: string;
   19         port?: number;
   20         [key: string]: any;
   21     }
   22 
   23     export interface Agent extends EventEmitter {
   24         _promisifiedCallback: boolean;
   25         timeout: number | null;
   26         options?: AgentOptions;
   27         callback: AgentCallback;
   28         addRequest: (req?: any, opts?: any) => void;
   29         freeSocket: (socket: any, opts: any) => void;
   30     }
   31 }
   32 
   33 /**
   34  * Base `http.Agent` implementation.
   35  * No pooling/keep-alive is implemented by default.
   36  */
   37 declare function Agent(opts?: Agent.AgentOptions): Agent.Agent;
   38 declare function Agent(
   39     callback: Agent.AgentCallback,
   40     opts?: Agent.AgentOptions
   41 ): Agent.Agent;
   42 
   43 export = Agent;