source: node_modules/undici/types/pool.d.ts

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1008 bytes
Line 
1import Client from './client'
2import TPoolStats from './pool-stats'
3import { URL } from 'url'
4import Dispatcher from "./dispatcher";
5
6export default Pool
7
8declare class Pool extends Dispatcher {
9 constructor(url: string | URL, options?: Pool.Options)
10 /** `true` after `pool.close()` has been called. */
11 closed: boolean;
12 /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
13 destroyed: boolean;
14 /** Aggregate stats for a Pool. */
15 readonly stats: TPoolStats;
16}
17
18declare namespace Pool {
19 export type PoolStats = TPoolStats;
20 export interface Options extends Client.Options {
21 /** Default: `(origin, opts) => new Client(origin, opts)`. */
22 factory?(origin: URL, opts: object): Dispatcher;
23 /** The max number of clients to create. `null` if no limit. Default `null`. */
24 connections?: number | null;
25
26 interceptors?: { Pool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options["interceptors"]
27 }
28}
Note: See TracBrowser for help on using the repository browser.