undici-types 8.0.3 → 8.2.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/client.d.ts CHANGED
@@ -73,6 +73,8 @@ export declare namespace Client {
73
73
  localAddress?: string;
74
74
  /** Max response body size in bytes, -1 is disabled */
75
75
  maxResponseSize?: number;
76
+ /** WebSocket-specific options */
77
+ webSocket?: Client.WebSocketOptions;
76
78
  /** Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. */
77
79
  autoSelectFamily?: boolean;
78
80
  /** The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. */
@@ -113,6 +115,15 @@ export declare namespace Client {
113
115
  bytesWritten?: number
114
116
  bytesRead?: number
115
117
  }
118
+ export interface WebSocketOptions {
119
+ /**
120
+ * Maximum allowed payload size in bytes for WebSocket messages.
121
+ * Applied to uncompressed messages, compressed frame payloads, and decompressed (permessage-deflate) messages.
122
+ * Set to 0 to disable the limit.
123
+ * @default 134217728 (128 MB)
124
+ */
125
+ maxPayloadSize?: number;
126
+ }
116
127
  }
117
128
 
118
129
  export default Client
package/dispatcher.d.ts CHANGED
@@ -2,7 +2,7 @@ import { URL } from 'node:url'
2
2
  import { Duplex, Readable, Writable } from 'node:stream'
3
3
  import { EventEmitter } from 'node:events'
4
4
  import { Blob } from 'node:buffer'
5
- import { IncomingHttpHeaders } from './header'
5
+ import { IncomingHttpHeaders, OutgoingHttpHeaders } from './header'
6
6
  import BodyReadable from './readable'
7
7
  import { FormData } from './formdata'
8
8
  import Errors from './errors'
@@ -10,7 +10,7 @@ import { Autocomplete } from './utility'
10
10
 
11
11
  export default Dispatcher
12
12
 
13
- export type UndiciHeaders = Record<string, string | string[]> | IncomingHttpHeaders | string[] | Iterable<[string, string | string[] | undefined]> | null
13
+ export type UndiciHeaders = OutgoingHttpHeaders | string[] | Iterable<[string, string | string[] | undefined]> | null
14
14
 
15
15
  /** Dispatcher is the core API used to dispatch requests. */
16
16
  declare class Dispatcher extends EventEmitter {
@@ -210,8 +210,8 @@ declare namespace Dispatcher {
210
210
  get aborted(): boolean
211
211
  get paused(): boolean
212
212
  get reason(): Error | null
213
- rawHeaders?: Buffer[] | string[] | null
214
- rawTrailers?: Buffer[] | string[] | null
213
+ rawHeaders?: Buffer[] | string[] | IncomingHttpHeaders | null
214
+ rawTrailers?: Buffer[] | string[] | IncomingHttpHeaders | null
215
215
  abort(reason: Error): void
216
216
  pause(): void
217
217
  resume(): void
package/header.d.ts CHANGED
@@ -5,6 +5,11 @@ import { Autocomplete } from './utility'
5
5
  */
6
6
  export type IncomingHttpHeaders = Record<string, string | string[] | undefined>
7
7
 
8
+ /**
9
+ * The header type declaration of `undici` for outgoing requests.
10
+ */
11
+ export type OutgoingHttpHeaders = Record<string, number | string | string[] | undefined>
12
+
8
13
  type HeaderNames = Autocomplete<
9
14
  | 'Accept'
10
15
  | 'Accept-CH'
package/interceptors.d.ts CHANGED
@@ -8,7 +8,7 @@ export default Interceptors
8
8
  declare namespace Interceptors {
9
9
  export type DumpInterceptorOpts = { maxSize?: number }
10
10
  export type RetryInterceptorOpts = RetryHandler.RetryOptions
11
- export type RedirectInterceptorOpts = { maxRedirections?: number }
11
+ export type RedirectInterceptorOpts = { maxRedirections?: number, throwOnMaxRedirect?: boolean }
12
12
  export type DecompressInterceptorOpts = {
13
13
  skipErrorResponses?: boolean
14
14
  skipStatusCodes?: number[]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici-types",
3
- "version": "8.0.3",
3
+ "version": "8.2.0",
4
4
  "description": "A stand-alone types package for Undici",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
package/proxy-agent.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import Agent from './agent'
2
2
  import buildConnector from './connector'
3
3
  import Dispatcher from './dispatcher'
4
- import { IncomingHttpHeaders } from './header'
4
+ import { OutgoingHttpHeaders } from './header'
5
5
 
6
6
  export default ProxyAgent
7
7
 
@@ -20,7 +20,7 @@ declare namespace ProxyAgent {
20
20
  */
21
21
  auth?: string;
22
22
  token?: string;
23
- headers?: IncomingHttpHeaders;
23
+ headers?: OutgoingHttpHeaders;
24
24
  requestTls?: buildConnector.BuildOptions;
25
25
  proxyTls?: buildConnector.BuildOptions;
26
26
  clientFactory?(origin: URL, opts: object): Dispatcher;
@@ -1,6 +1,6 @@
1
1
  import Dispatcher from './dispatcher'
2
2
  import buildConnector from './connector'
3
- import { IncomingHttpHeaders } from './header'
3
+ import { OutgoingHttpHeaders } from './header'
4
4
  import Pool from './pool'
5
5
 
6
6
  export default Socks5ProxyAgent
@@ -12,7 +12,7 @@ declare class Socks5ProxyAgent extends Dispatcher {
12
12
  declare namespace Socks5ProxyAgent {
13
13
  export interface Options extends Pool.Options {
14
14
  /** Additional headers to send with the proxy connection */
15
- headers?: IncomingHttpHeaders;
15
+ headers?: OutgoingHttpHeaders;
16
16
  /** SOCKS5 proxy username for authentication */
17
17
  username?: string;
18
18
  /** SOCKS5 proxy password for authentication */