Sha256: 1f0539108fad59d8e9d282900dc9bd4c99cb49eccfbe11df3edb2f53854068a0

Contents?: true

Size: 1.9 KB

Versions: 33

Compression:

Stored size: 1.9 KB

Contents

import * as http from 'http';
import * as https from 'https';
import * as net from 'net';

interface PlainObject {
  [key: string]: any;
}

declare class HttpAgent extends http.Agent {
  constructor(opts?: AgentKeepAlive.HttpOptions);
  readonly statusChanged: boolean;
  createConnection(options: net.NetConnectOpts, cb?: Function): net.Socket;
  createSocket(req: http.IncomingMessage, options: http.RequestOptions, cb: Function): void;
  getCurrentStatus(): AgentKeepAlive.AgentStatus;
}

interface Constants {
  CURRENT_ID: Symbol;
  CREATE_ID: Symbol;
  INIT_SOCKET: Symbol;
  CREATE_HTTPS_CONNECTION: Symbol;
  SOCKET_CREATED_TIME: Symbol;
  SOCKET_NAME: Symbol;
  SOCKET_REQUEST_COUNT: Symbol;
  SOCKET_REQUEST_FINISHED_COUNT: Symbol;
}

declare class AgentKeepAlive extends HttpAgent {}

declare namespace AgentKeepAlive {
  export interface AgentStatus {
    createSocketCount: number;
    createSocketErrorCount: number;
    closeSocketCount: number;
    errorSocketCount: number;
    timeoutSocketCount: number;
    requestCount: number;
    freeSockets: PlainObject;
    sockets: PlainObject;
    requests: PlainObject;
  }

  interface CommonHttpOption {
    keepAlive?: boolean | undefined;
    freeSocketTimeout?: number | undefined;
    freeSocketKeepAliveTimeout?: number | undefined;
    timeout?: number | undefined;
    socketActiveTTL?: number | undefined;
  }

  export interface HttpOptions extends http.AgentOptions, CommonHttpOption { }
  export interface HttpsOptions extends https.AgentOptions, CommonHttpOption { }

  export class HttpsAgent extends https.Agent {
    constructor(opts?: HttpsOptions);
    readonly statusChanged: boolean;
    createConnection(options: net.NetConnectOpts, cb?: Function): net.Socket;
    createSocket(req: http.IncomingMessage, options: http.RequestOptions, cb: Function): void;
    getCurrentStatus(): AgentStatus;
  }

  export const constants: Constants;
}

export = AgentKeepAlive;

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.59 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.58 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.57 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.56 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.55 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.54 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.53 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.52 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.51 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.50 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.49 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.48 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.47 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.46 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.45 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.44 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.43 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.42 node_modules/agentkeepalive/index.d.ts
immosquare-cleaner-0.1.41 node_modules/agentkeepalive/index.d.ts