source: imaps-frontend/node_modules/undici-types/pool.d.ts

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

F4 Finalna Verzija

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