undici-types 7.7.0 → 7.9.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.
package/agent.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { URL } from 'url'
2
2
  import Pool from './pool'
3
3
  import Dispatcher from './dispatcher'
4
+ import TClientStats from './client-stats'
5
+ import TPoolStats from './pool-stats'
4
6
 
5
7
  export default Agent
6
8
 
@@ -12,6 +14,8 @@ declare class Agent extends Dispatcher {
12
14
  destroyed: boolean
13
15
  /** Dispatches a request. */
14
16
  dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
17
+ /** Aggregate stats for a Agent by origin. */
18
+ readonly stats: Record<string, TClientStats | TPoolStats>
15
19
  }
16
20
 
17
21
  declare namespace Agent {
@@ -0,0 +1,15 @@
1
+ import Client from './client'
2
+
3
+ export default ClientStats
4
+
5
+ declare class ClientStats {
6
+ constructor (pool: Client)
7
+ /** If socket has open connection. */
8
+ connected: boolean
9
+ /** Number of open socket connections in this client that do not have an active request. */
10
+ pending: number
11
+ /** Number of currently active requests of this client. */
12
+ running: number
13
+ /** Number of active, pending, or queued requests of this client. */
14
+ size: number
15
+ }
package/client.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { URL } from 'url'
2
2
  import Dispatcher from './dispatcher'
3
3
  import buildConnector from './connector'
4
+ import TClientStats from './client-stats'
4
5
 
5
6
  type ClientConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
6
7
 
@@ -15,6 +16,8 @@ export class Client extends Dispatcher {
15
16
  closed: boolean
16
17
  /** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */
17
18
  destroyed: boolean
19
+ /** Aggregate stats for a Client. */
20
+ readonly stats: TClientStats
18
21
 
19
22
  // Override dispatcher APIs.
20
23
  override connect (
@@ -84,13 +87,13 @@ export declare namespace Client {
84
87
  /**
85
88
  * @description Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation.
86
89
  * @default false
87
- */
90
+ */
88
91
  allowH2?: boolean;
89
92
  /**
90
93
  * @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
91
94
  * @default 100
92
- */
93
- maxConcurrentStreams?: number
95
+ */
96
+ maxConcurrentStreams?: number;
94
97
  }
95
98
  export interface SocketInfo {
96
99
  localAddress?: string
package/mock-agent.d.ts CHANGED
@@ -59,6 +59,9 @@ declare namespace MockAgent {
59
59
  /** Ignore trailing slashes in the path */
60
60
  ignoreTrailingSlash?: boolean;
61
61
 
62
+ /** Accept URLs with search parameters using non standard syntaxes. default false */
63
+ acceptNonStandardSearchParameters?: boolean;
64
+
62
65
  /** Enable call history. you can either call MockAgent.enableCallHistory(). default false */
63
66
  enableCallHistory?: boolean
64
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici-types",
3
- "version": "7.7.0",
3
+ "version": "7.9.0",
4
4
  "description": "A stand-alone types package for Undici",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
package/websocket.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
 
3
3
  import type { Blob } from 'buffer'
4
+ import type { ReadableStream, WritableStream } from 'stream/web'
4
5
  import type { MessagePort } from 'worker_threads'
5
6
  import {
6
7
  EventInit,