undici-types 6.19.8 → 6.21.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/eventsource.d.ts +0 -2
- package/filereader.d.ts +1 -1
- package/interceptors.d.ts +3 -1
- package/package.json +1 -1
- package/patch.d.ts +0 -38
- package/readable.d.ts +5 -0
- package/webidl.d.ts +6 -0
- package/websocket.d.ts +0 -2
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/eventsource.d.ts
CHANGED
package/filereader.d.ts
CHANGED
package/interceptors.d.ts
CHANGED
|
@@ -7,9 +7,11 @@ declare namespace Interceptors {
|
|
|
7
7
|
export type DumpInterceptorOpts = { maxSize?: number }
|
|
8
8
|
export type RetryInterceptorOpts = RetryHandler.RetryOptions
|
|
9
9
|
export type RedirectInterceptorOpts = { maxRedirections?: number }
|
|
10
|
-
|
|
10
|
+
export type ResponseErrorInterceptorOpts = { throwOnError: boolean }
|
|
11
|
+
|
|
11
12
|
export function createRedirectInterceptor(opts: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
12
13
|
export function dump(opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
13
14
|
export function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
14
15
|
export function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
16
|
+
export function responseError(opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
|
|
15
17
|
}
|
package/package.json
CHANGED
package/patch.d.ts
CHANGED
|
@@ -6,44 +6,6 @@ export type DOMException = typeof globalThis extends { DOMException: infer T }
|
|
|
6
6
|
? T
|
|
7
7
|
: any
|
|
8
8
|
|
|
9
|
-
export type EventTarget = typeof globalThis extends { EventTarget: infer T }
|
|
10
|
-
? T
|
|
11
|
-
: {
|
|
12
|
-
addEventListener(
|
|
13
|
-
type: string,
|
|
14
|
-
listener: any,
|
|
15
|
-
options?: any,
|
|
16
|
-
): void
|
|
17
|
-
dispatchEvent(event: Event): boolean
|
|
18
|
-
removeEventListener(
|
|
19
|
-
type: string,
|
|
20
|
-
listener: any,
|
|
21
|
-
options?: any | boolean,
|
|
22
|
-
): void
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export type Event = typeof globalThis extends { Event: infer T }
|
|
26
|
-
? T
|
|
27
|
-
: {
|
|
28
|
-
readonly bubbles: boolean
|
|
29
|
-
cancelBubble: () => void
|
|
30
|
-
readonly cancelable: boolean
|
|
31
|
-
readonly composed: boolean
|
|
32
|
-
composedPath(): [EventTarget?]
|
|
33
|
-
readonly currentTarget: EventTarget | null
|
|
34
|
-
readonly defaultPrevented: boolean
|
|
35
|
-
readonly eventPhase: 0 | 2
|
|
36
|
-
readonly isTrusted: boolean
|
|
37
|
-
preventDefault(): void
|
|
38
|
-
returnValue: boolean
|
|
39
|
-
readonly srcElement: EventTarget | null
|
|
40
|
-
stopImmediatePropagation(): void
|
|
41
|
-
stopPropagation(): void
|
|
42
|
-
readonly target: EventTarget | null
|
|
43
|
-
readonly timeStamp: number
|
|
44
|
-
readonly type: string
|
|
45
|
-
}
|
|
46
|
-
|
|
47
9
|
export interface EventInit {
|
|
48
10
|
bubbles?: boolean
|
|
49
11
|
cancelable?: boolean
|
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/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 {
|