undici-types 6.15.0 → 6.16.1

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/fetch.d.ts CHANGED
@@ -85,7 +85,7 @@ export declare class Headers implements SpecIterable<[string, string]> {
85
85
  readonly keys: () => SpecIterableIterator<string>
86
86
  readonly values: () => SpecIterableIterator<string>
87
87
  readonly entries: () => SpecIterableIterator<[string, string]>
88
- readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
88
+ readonly [Symbol.iterator]: () => SpecIterableIterator<[string, string]>
89
89
  }
90
90
 
91
91
  export type RequestCache =
@@ -163,6 +163,7 @@ export declare class Request extends BodyMixin {
163
163
  readonly method: string
164
164
  readonly mode: RequestMode
165
165
  readonly redirect: RequestRedirect
166
+ readonly referrer: string
166
167
  readonly referrerPolicy: ReferrerPolicy
167
168
  readonly url: string
168
169
 
@@ -71,11 +71,11 @@ declare namespace MockInterceptor {
71
71
 
72
72
  export interface MockResponseCallbackOptions {
73
73
  path: string;
74
- origin: string;
75
74
  method: string;
76
- body?: BodyInit | Dispatcher.DispatchOptions['body'];
77
- headers: Headers | Record<string, string>;
78
- maxRedirections: number;
75
+ headers?: Headers | Record<string, string>;
76
+ origin?: string;
77
+ body?: BodyInit | Dispatcher.DispatchOptions['body'] | null;
78
+ maxRedirections?: number;
79
79
  }
80
80
 
81
81
  export type MockResponseDataHandler<TData extends object = object> = (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici-types",
3
- "version": "6.15.0",
3
+ "version": "6.16.1",
4
4
  "description": "A stand-alone types package for Undici",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
package/util.d.ts CHANGED
@@ -8,24 +8,11 @@ export namespace util {
8
8
  /**
9
9
  * Receives a header object and returns the parsed value.
10
10
  * @param headers Header object
11
+ * @param obj Object to specify a proxy object. Used to assign parsed values.
12
+ * @returns If `obj` is specified, it is equivalent to `obj`.
11
13
  */
12
14
  export function parseHeaders(
13
- headers:
14
- | Record<string, string | string[]>
15
- | (Buffer | string | (Buffer | string)[])[]
16
- ): Record<string, string | string[]>;
17
- /**
18
- * Receives a header object and returns the parsed value.
19
- * @param headers Header object
20
- * @param obj Object to specify a proxy object. Used to assign parsed values. But, if `headers` is an object, it is not used.
21
- * @returns If `headers` is an object, it is `headers`. Otherwise, if `obj` is specified, it is equivalent to `obj`.
22
- */
23
- export function parseHeaders<
24
- H extends
25
- | Record<string, string | string[]>
26
- | (Buffer | string | (Buffer | string)[])[]
27
- >(
28
- headers: H,
29
- obj?: H extends any[] ? Record<string, string | string[]> : never
15
+ headers: (Buffer | string | (Buffer | string)[])[],
16
+ obj?: Record<string, string | string[]>
30
17
  ): Record<string, string | string[]>;
31
18
  }