undici-types 7.24.6 → 7.24.7
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 +0 -6
- package/fetch.d.ts +24 -4
- package/formdata.d.ts +6 -0
- package/handlers.d.ts +1 -2
- package/package.json +1 -1
package/dispatcher.d.ts
CHANGED
|
@@ -137,8 +137,6 @@ declare namespace Dispatcher {
|
|
|
137
137
|
signal?: AbortSignal | EventEmitter | null;
|
|
138
138
|
/** This argument parameter is passed through to `ConnectData` */
|
|
139
139
|
opaque?: TOpaque;
|
|
140
|
-
/** Default: false */
|
|
141
|
-
redirectionLimitReached?: boolean;
|
|
142
140
|
/** Default: `null` */
|
|
143
141
|
responseHeaders?: 'raw' | null;
|
|
144
142
|
}
|
|
@@ -147,8 +145,6 @@ declare namespace Dispatcher {
|
|
|
147
145
|
opaque?: TOpaque;
|
|
148
146
|
/** Default: `null` */
|
|
149
147
|
signal?: AbortSignal | EventEmitter | null;
|
|
150
|
-
/** Default: false */
|
|
151
|
-
redirectionLimitReached?: boolean;
|
|
152
148
|
/** Default: `null` */
|
|
153
149
|
onInfo?: (info: { statusCode: number, headers: Record<string, string | string[]> }) => void;
|
|
154
150
|
/** Default: `null` */
|
|
@@ -170,8 +166,6 @@ declare namespace Dispatcher {
|
|
|
170
166
|
protocol?: string;
|
|
171
167
|
/** Default: `null` */
|
|
172
168
|
signal?: AbortSignal | EventEmitter | null;
|
|
173
|
-
/** Default: false */
|
|
174
|
-
redirectionLimitReached?: boolean;
|
|
175
169
|
/** Default: `null` */
|
|
176
170
|
responseHeaders?: 'raw' | null;
|
|
177
171
|
}
|
package/fetch.d.ts
CHANGED
|
@@ -60,12 +60,32 @@ export interface SpecIterator<T, TReturn = any, TNext = undefined> {
|
|
|
60
60
|
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export interface
|
|
63
|
+
export interface SpecIteratorObject<T, TReturn = undefined, TNext = unknown> extends SpecIterator<T, TReturn, TNext> {
|
|
64
|
+
[Symbol.iterator](): SpecIteratorObject<T, TReturn, TNext>;
|
|
65
|
+
map<U>(callbackfn: (value: T, index: number) => U): SpecIteratorObject<U>;
|
|
66
|
+
filter<S extends T>(predicate: (value: T, index: number) => value is S): SpecIteratorObject<S>;
|
|
67
|
+
filter(predicate: (value: T, index: number) => unknown): SpecIteratorObject<T>;
|
|
68
|
+
take(limit: number): SpecIteratorObject<T>;
|
|
69
|
+
drop(count: number): SpecIteratorObject<T>;
|
|
70
|
+
flatMap<U>(callbackfn: (value: T, index: number) => Iterator<U> | Iterable<U>): SpecIteratorObject<U>;
|
|
71
|
+
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T): T;
|
|
72
|
+
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T, initialValue: T): T;
|
|
73
|
+
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;
|
|
74
|
+
toArray(): T[];
|
|
75
|
+
forEach(callbackfn: (value: T, index: number) => void): void;
|
|
76
|
+
some(predicate: (value: T, index: number) => unknown): boolean;
|
|
77
|
+
every(predicate: (value: T, index: number) => unknown): boolean;
|
|
78
|
+
find<S extends T>(predicate: (value: T, index: number) => value is S): S | undefined;
|
|
79
|
+
find(predicate: (value: T, index: number) => unknown): T | undefined;
|
|
80
|
+
readonly [Symbol.toStringTag]: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface SpecIterableIterator<T> extends SpecIteratorObject<T> {
|
|
64
84
|
[Symbol.iterator](): SpecIterableIterator<T>;
|
|
65
85
|
}
|
|
66
86
|
|
|
67
87
|
export interface SpecIterable<T> {
|
|
68
|
-
[Symbol.iterator]():
|
|
88
|
+
[Symbol.iterator](): SpecIterableIterator<T>;
|
|
69
89
|
}
|
|
70
90
|
|
|
71
91
|
export type HeadersInit = [string, string][] | HeaderRecord | Headers
|
|
@@ -173,7 +193,7 @@ export declare class Request extends BodyMixin {
|
|
|
173
193
|
readonly signal: AbortSignal
|
|
174
194
|
readonly duplex: RequestDuplex
|
|
175
195
|
|
|
176
|
-
|
|
196
|
+
public clone (): Request
|
|
177
197
|
}
|
|
178
198
|
|
|
179
199
|
export interface ResponseInit {
|
|
@@ -203,7 +223,7 @@ export declare class Response extends BodyMixin {
|
|
|
203
223
|
readonly url: string
|
|
204
224
|
readonly redirected: boolean
|
|
205
225
|
|
|
206
|
-
|
|
226
|
+
public clone (): Response
|
|
207
227
|
|
|
208
228
|
static error (): Response
|
|
209
229
|
static json (data: any, init?: ResponseInit): Response
|
package/formdata.d.ts
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
import { File } from 'node:buffer'
|
|
5
5
|
import { SpecIterableIterator } from './fetch'
|
|
6
6
|
|
|
7
|
+
declare module 'node:buffer' {
|
|
8
|
+
interface File {
|
|
9
|
+
readonly [Symbol.toStringTag]: string
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
7
13
|
/**
|
|
8
14
|
* A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
|
|
9
15
|
*/
|
package/handlers.d.ts
CHANGED
|
@@ -5,8 +5,7 @@ export declare class RedirectHandler implements Dispatcher.DispatchHandler {
|
|
|
5
5
|
dispatch: Dispatcher.Dispatch,
|
|
6
6
|
maxRedirections: number,
|
|
7
7
|
opts: Dispatcher.DispatchOptions,
|
|
8
|
-
handler: Dispatcher.DispatchHandler
|
|
9
|
-
redirectionLimitReached: boolean
|
|
8
|
+
handler: Dispatcher.DispatchHandler
|
|
10
9
|
)
|
|
11
10
|
}
|
|
12
11
|
|