@whatwg-node/fetch 0.8.5 → 0.8.6-rc-20230419123748-0bceaec

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @whatwg-node/fetch
2
2
 
3
+ ## 0.8.6-rc-20230419123748-0bceaec
4
+
5
+ ### Patch Changes
6
+
7
+ - [#427](https://github.com/ardatan/whatwg-node/pull/427)
8
+ [`e8bda7c`](https://github.com/ardatan/whatwg-node/commit/e8bda7cdf440a7f4bb617ee1b5df8ee1becb4ad6)
9
+ Thanks [@Rugvip](https://github.com/Rugvip)! - Restructure type declarations to avoid polluting
10
+ global namespace.
11
+
12
+ - Updated dependencies []:
13
+ - @whatwg-node/node-fetch@0.3.6-rc-20230419123748-0bceaec
14
+
3
15
  ## 0.8.5
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -2,50 +2,28 @@
2
2
  /// <reference lib="dom.iterable" />
3
3
  /// <reference types="urlpattern-polyfill" />
4
4
 
5
- type ResponseCtorWithJson = typeof Response & {
6
- json(data: any, init?: ResponseInit): Response;
7
- }
8
-
9
- declare const _fetch: typeof fetch;
10
- declare const _Request: typeof Request;
11
- declare const _Response: ResponseCtorWithJson;
12
- declare const _Headers: typeof Headers;
13
- declare const _FormData: typeof FormData;
14
- declare const _AbortSignal: typeof AbortSignal;
15
- declare const _AbortController: typeof AbortController;
16
- declare const _ReadableStream: typeof ReadableStream;
17
- declare const _WritableStream: typeof WritableStream;
18
- declare const _TransformStream: typeof TransformStream;
19
- declare const _Blob: typeof Blob;
20
- declare const _File: typeof File;
21
- declare const _crypto: typeof crypto;
22
- declare const _btoa: typeof btoa;
23
- declare const _TextEncoder: typeof TextEncoder;
24
- declare const _TextDecoder: typeof TextDecoder;
25
- declare const _URLPattern: typeof URLPattern;
26
- declare const _URL: typeof URL;
27
- declare const _URLSearchParams: typeof URLSearchParams;
28
-
29
- declare module "@whatwg-node/fetch" {
30
- export const fetch: typeof _fetch;
31
- export const Request: typeof _Request;
32
- export const Response: typeof _Response;
33
- export const Headers: typeof _Headers;
34
- export const FormData: typeof _FormData;
35
- export const AbortSignal: typeof _AbortSignal;
36
- export const AbortController: typeof _AbortController;
37
- export const ReadableStream: typeof _ReadableStream;
38
- export const WritableStream: typeof _WritableStream;
39
- export const TransformStream: typeof _TransformStream;
40
- export const Blob: typeof _Blob;
41
- export const File: typeof _File;
42
- export const crypto: typeof _crypto;
43
- export const btoa: typeof _btoa;
44
- export const TextDecoder: typeof _TextDecoder;
45
- export const TextEncoder: typeof _TextEncoder;
46
- export const URL: typeof _URL;
47
- export const URLSearchParams: typeof _URLSearchParams;
48
- export const URLPattern: typeof _URLPattern;
5
+ declare module '@whatwg-node/fetch' {
6
+ export const fetch: typeof globalThis.fetch;
7
+ export const Request: typeof globalThis.Request;
8
+ export const Response: typeof globalThis.Response & {
9
+ json(data: any, init?: ResponseInit): globalThis.Response;
10
+ };
11
+ export const Headers: typeof globalThis.Headers;
12
+ export const FormData: typeof globalThis.FormData;
13
+ export const AbortSignal: typeof globalThis.AbortSignal;
14
+ export const AbortController: typeof globalThis.AbortController;
15
+ export const ReadableStream: typeof globalThis.ReadableStream;
16
+ export const WritableStream: typeof globalThis.WritableStream;
17
+ export const TransformStream: typeof globalThis.TransformStream;
18
+ export const Blob: typeof globalThis.Blob;
19
+ export const File: typeof globalThis.File;
20
+ export const crypto: typeof globalThis.crypto;
21
+ export const btoa: typeof globalThis.btoa;
22
+ export const TextDecoder: typeof globalThis.TextDecoder;
23
+ export const TextEncoder: typeof globalThis.TextEncoder;
24
+ export const URL: typeof globalThis.URL;
25
+ export const URLSearchParams: typeof globalThis.URLSearchParams;
26
+ export const URLPattern: globalThis.URLPattern;
49
27
  export interface FormDataLimits {
50
28
  /* Max field name size (in bytes). Default: 100. */
51
29
  fieldNameSize?: number;
@@ -62,26 +40,28 @@ declare module "@whatwg-node/fetch" {
62
40
  /* For multipart forms, the max number of header key-value pairs to parse. Default: 2000. */
63
41
  headerSize?: number;
64
42
  }
65
- export const createFetch: (opts?: { useNodeFetch?: boolean; formDataLimits?: FormDataLimits }) => ({
66
- fetch: typeof _fetch,
67
- Request: typeof _Request,
68
- Response: typeof _Response,
69
- Headers: typeof _Headers,
70
- FormData: typeof _FormData,
71
- AbortSignal: typeof _AbortSignal,
72
- AbortController: typeof _AbortController,
73
- ReadableStream: typeof _ReadableStream,
74
- WritableStream: typeof _WritableStream,
75
- TransformStream: typeof _TransformStream,
76
- Blob: typeof _Blob,
77
- File: typeof _File,
78
- crypto: typeof _crypto,
79
- btoa: typeof _btoa,
80
- TextEncoder: typeof _TextEncoder,
81
- TextDecoder: typeof _TextDecoder,
82
- URLPattern: typeof _URLPattern,
83
- URL: typeof _URL,
84
- URLSearchParams: typeof _URLSearchParams,
85
- });
43
+ export const createFetch: (opts?: {
44
+ useNodeFetch?: boolean;
45
+ formDataLimits?: FormDataLimits;
46
+ }) => {
47
+ fetch: typeof globalThis.fetch;
48
+ Request: typeof globalThis.Request;
49
+ Response: typeof globalThis.Response;
50
+ Headers: typeof globalThis.Headers;
51
+ FormData: typeof globalThis.FormData;
52
+ AbortSignal: typeof globalThis.AbortSignal;
53
+ AbortController: typeof globalThis.AbortController;
54
+ ReadableStream: typeof globalThis.ReadableStream;
55
+ WritableStream: typeof globalThis.WritableStream;
56
+ TransformStream: typeof globalThis.TransformStream;
57
+ Blob: typeof globalThis.Blob;
58
+ File: typeof globalThis.File;
59
+ crypto: typeof globalThis.crypto;
60
+ btoa: typeof globalThis.btoa;
61
+ TextEncoder: typeof globalThis.TextEncoder;
62
+ TextDecoder: typeof globalThis.TextDecoder;
63
+ URLPattern: globalThis.URLPattern;
64
+ URL: typeof globalThis.URL;
65
+ URLSearchParams: typeof globalThis.URLSearchParams;
66
+ };
86
67
  }
87
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/fetch",
3
- "version": "0.8.5",
3
+ "version": "0.8.6-rc-20230419123748-0bceaec",
4
4
  "description": "Cross Platform Smart Fetch Ponyfill",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  "types": "dist/index.d.ts",
15
15
  "dependencies": {
16
16
  "@peculiar/webcrypto": "^1.4.0",
17
- "@whatwg-node/node-fetch": "^0.3.3",
17
+ "@whatwg-node/node-fetch": "0.3.6-rc-20230419123748-0bceaec",
18
18
  "busboy": "^1.6.0",
19
19
  "urlpattern-polyfill": "^7.0.0",
20
20
  "web-streams-polyfill": "^3.2.1"