undici-types 6.20.0 → 6.23.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/dispatcher.d.ts +1 -0
- package/interceptors.d.ts +15 -0
- package/package.json +1 -1
- package/proxy-agent.d.ts +1 -0
- package/readable.d.ts +5 -0
- package/retry-handler.d.ts +1 -1
- package/webidl.d.ts +6 -0
package/dispatcher.d.ts
CHANGED
|
@@ -244,6 +244,7 @@ declare namespace Dispatcher {
|
|
|
244
244
|
readonly bodyUsed: boolean;
|
|
245
245
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
246
246
|
blob(): Promise<Blob>;
|
|
247
|
+
bytes(): Promise<Uint8Array>;
|
|
247
248
|
formData(): Promise<never>;
|
|
248
249
|
json(): Promise<unknown>;
|
|
249
250
|
text(): Promise<string>;
|
package/interceptors.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LookupOptions } from 'node:dns'
|
|
2
|
+
|
|
1
3
|
import Dispatcher from "./dispatcher";
|
|
2
4
|
import RetryHandler from "./retry-handler";
|
|
3
5
|
|
|
@@ -9,9 +11,22 @@ declare namespace Interceptors {
|
|
|
9
11
|
export type RedirectInterceptorOpts = { maxRedirections?: number }
|
|
10
12
|
export type ResponseErrorInterceptorOpts = { throwOnError: boolean }
|
|
11
13
|
|
|
14
|
+
// DNS interceptor
|
|
15
|
+
export type DNSInterceptorRecord = { address: string, ttl: number, family: 4 | 6 }
|
|
16
|
+
export type DNSInterceptorOriginRecords = { 4: { ips: DNSInterceptorRecord[] } | null, 6: { ips: DNSInterceptorRecord[] } | null }
|
|
17
|
+
export type DNSInterceptorOpts = {
|
|
18
|
+
maxTTL?: number
|
|
19
|
+
maxItems?: number
|
|
20
|
+
lookup?: (hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, addresses: DNSInterceptorRecord[]) => void) => void
|
|
21
|
+
pick?: (origin: URL, records: DNSInterceptorOriginRecords, affinity: 4 | 6) => DNSInterceptorRecord
|
|
22
|
+
dualStack?: boolean
|
|
23
|
+
affinity?: 4 | 6
|
|
24
|
+
}
|
|
25
|
+
|
|
12
26
|
export function createRedirectInterceptor(opts: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
13
27
|
export function dump(opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
14
28
|
export function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
15
29
|
export function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
16
30
|
export function responseError(opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
31
|
+
export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
17
32
|
}
|
package/package.json
CHANGED
package/proxy-agent.d.ts
CHANGED
package/readable.d.ts
CHANGED
|
@@ -25,6 +25,11 @@ declare class BodyReadable extends Readable {
|
|
|
25
25
|
*/
|
|
26
26
|
blob(): Promise<Blob>
|
|
27
27
|
|
|
28
|
+
/** Consumes and returns the body as an Uint8Array
|
|
29
|
+
* https://fetch.spec.whatwg.org/#dom-body-bytes
|
|
30
|
+
*/
|
|
31
|
+
bytes(): Promise<Uint8Array>
|
|
32
|
+
|
|
28
33
|
/** Consumes and returns the body as an ArrayBuffer
|
|
29
34
|
* https://fetch.spec.whatwg.org/#dom-body-arraybuffer
|
|
30
35
|
*/
|
package/retry-handler.d.ts
CHANGED
package/webidl.d.ts
CHANGED
|
@@ -67,6 +67,12 @@ interface WebidlUtil {
|
|
|
67
67
|
* Stringifies {@param V}
|
|
68
68
|
*/
|
|
69
69
|
Stringify (V: any): string
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Mark a value as uncloneable for Node.js.
|
|
73
|
+
* This is only effective in some newer Node.js versions.
|
|
74
|
+
*/
|
|
75
|
+
markAsUncloneable (V: any): void
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
interface WebidlConverters {
|