undici-types 6.2.0 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,8 @@ import { URL } from 'url'
4
4
 
5
5
  export default BalancedPool
6
6
 
7
+ type BalancedPoolConnectOptions = Omit<Dispatcher.ConnectOptions, "origin">;
8
+
7
9
  declare class BalancedPool extends Dispatcher {
8
10
  constructor(url: string | string[] | URL | URL[], options?: Pool.Options);
9
11
 
@@ -15,4 +17,13 @@ declare class BalancedPool extends Dispatcher {
15
17
  closed: boolean;
16
18
  /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
17
19
  destroyed: boolean;
20
+
21
+ // Override dispatcher APIs.
22
+ override connect(
23
+ options: BalancedPoolConnectOptions
24
+ ): Promise<Dispatcher.ConnectData>;
25
+ override connect(
26
+ options: BalancedPoolConnectOptions,
27
+ callback: (err: Error | null, data: Dispatcher.ConnectData) => void
28
+ ): void;
18
29
  }
package/client.d.ts CHANGED
@@ -3,6 +3,8 @@ import { TlsOptions } from 'tls'
3
3
  import Dispatcher from './dispatcher'
4
4
  import buildConnector from "./connector";
5
5
 
6
+ type ClientConnectOptions = Omit<Dispatcher.ConnectOptions, "origin">;
7
+
6
8
  /**
7
9
  * A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
8
10
  */
@@ -14,6 +16,15 @@ export class Client extends Dispatcher {
14
16
  closed: boolean;
15
17
  /** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */
16
18
  destroyed: boolean;
19
+
20
+ // Override dispatcher APIs.
21
+ override connect(
22
+ options: ClientConnectOptions
23
+ ): Promise<Dispatcher.ConnectData>;
24
+ override connect(
25
+ options: ClientConnectOptions,
26
+ callback: (err: Error | null, data: Dispatcher.ConnectData) => void
27
+ ): void;
17
28
  }
18
29
 
19
30
  export declare namespace Client {
package/dispatcher.d.ts CHANGED
@@ -121,6 +121,7 @@ declare namespace Dispatcher {
121
121
  expectContinue?: boolean;
122
122
  }
123
123
  export interface ConnectOptions {
124
+ origin: string | URL;
124
125
  path: string;
125
126
  /** Default: `null` */
126
127
  headers?: IncomingHttpHeaders | string[] | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici-types",
3
- "version": "6.2.0",
3
+ "version": "6.3.0",
4
4
  "description": "A stand-alone types package for Undici",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
package/pool.d.ts CHANGED
@@ -5,6 +5,8 @@ import Dispatcher from "./dispatcher";
5
5
 
6
6
  export default Pool
7
7
 
8
+ type PoolConnectOptions = Omit<Dispatcher.ConnectOptions, "origin">;
9
+
8
10
  declare class Pool extends Dispatcher {
9
11
  constructor(url: string | URL, options?: Pool.Options)
10
12
  /** `true` after `pool.close()` has been called. */
@@ -13,6 +15,15 @@ declare class Pool extends Dispatcher {
13
15
  destroyed: boolean;
14
16
  /** Aggregate stats for a Pool. */
15
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;
16
27
  }
17
28
 
18
29
  declare namespace Pool {
package/proxy-agent.d.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  import Agent from './agent'
2
2
  import buildConnector from './connector';
3
- import Client from './client'
4
3
  import Dispatcher from './dispatcher'
5
4
  import { IncomingHttpHeaders } from './header'
6
- import Pool from './pool'
7
5
 
8
6
  export default ProxyAgent
9
7