@@ -7,7 +7,7 @@ export type KeysEnum<T> = { [P in keyof Required<T>]: true };
7
7
8
8
export type FinalizedRequestInit = RequestInit & { headers : Headers } ;
9
9
10
- type NotAny < T > = [ unknown ] extends [ T ] ? never : T ;
10
+ type NotAny < T > = [ 0 ] extends [ 1 & T ] ? never : T ;
11
11
12
12
/**
13
13
* Some environments overload the global fetch function, and Parameters<T> only gets the last signature.
@@ -64,13 +64,15 @@ type OverloadedParameters<T> =
64
64
* [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
65
65
*/
66
66
/** @ts -ignore For users with \@types/node */
67
- type UndiciTypesRequestInit = NotAny < import ( '../node_modules/undici-types' ) . RequestInit > | NotAny < import ( '../../node_modules/undici-types' ) . RequestInit > | NotAny < import ( '../../../node_modules/undici-types' ) . RequestInit > | NotAny < import ( '../../../../node_modules/undici-types' ) . RequestInit > | NotAny < import ( '../../../../../node_modules/undici-types' ) . RequestInit > | NotAny < import ( '../../../../../../node_modules/undici-types' ) . RequestInit > | NotAny < import ( '../../../../../../../node_modules/undici-types' ) . RequestInit > | NotAny < import ( '../../../../../../../../node_modules/undici-types' ) . RequestInit > | NotAny < import ( '../../../../../../../../../node_modules/undici-types' ) . RequestInit > | NotAny < import ( '../../../../../../../../../../node_modules/undici-types' ) . RequestInit > ;
67
+ type UndiciTypesRequestInit = NotAny < import ( '../node_modules/undici-types/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../node_modules/undici-types/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../node_modules/undici-types/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../node_modules/undici-types/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../node_modules/undici-types/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../../node_modules/undici-types/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../../../node_modules/undici-types/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../../../../node_modules/undici-types/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../../../../../node_modules/undici-types/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../../../../../../node_modules/undici-types/index.d.ts ' ) . RequestInit > ;
68
68
/** @ts -ignore For users with undici */
69
- type UndiciRequestInit = NotAny < import ( '../node_modules/undici' ) . RequestInit > | NotAny < import ( '../../node_modules/undici' ) . RequestInit > | NotAny < import ( '../../../node_modules/undici' ) . RequestInit > | NotAny < import ( '../../../../node_modules/undici' ) . RequestInit > | NotAny < import ( '../../../../../node_modules/undici' ) . RequestInit > | NotAny < import ( '../../../../../../node_modules/undici' ) . RequestInit > | NotAny < import ( '../../../../../../../node_modules/undici' ) . RequestInit > | NotAny < import ( '../../../../../../../../node_modules/undici' ) . RequestInit > | NotAny < import ( '../../../../../../../../../node_modules/undici' ) . RequestInit > | NotAny < import ( '../../../../../../../../../../node_modules/undici' ) . RequestInit > ;
69
+ type UndiciRequestInit = NotAny < import ( '../node_modules/undici/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../node_modules/undici/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../node_modules/undici/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../node_modules/undici/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../node_modules/undici/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../../node_modules/undici/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../../../node_modules/undici/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../../../../node_modules/undici/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../../../../../node_modules/undici/index.d.ts ' ) . RequestInit > | NotAny < import ( '../../../../../../../../../../node_modules/undici/index.d.ts ' ) . RequestInit > ;
70
70
/** @ts -ignore For users with \@types/bun */
71
71
type BunRequestInit = globalThis . FetchRequestInit ;
72
- /** @ts -ignore For users with node-fetch */
73
- type NodeFetchRequestInit = NotAny < import ( '../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../../../../../../node_modules/node-fetch' ) . RequestInit > ;
72
+ /** @ts -ignore For users with node-fetch@2 */
73
+ type NodeFetch2RequestInit = NotAny < import ( '../node_modules/@types/node-fetch/index.d.ts' ) . RequestInit > | NotAny < import ( '../../node_modules/@types/node-fetch/index.d.ts' ) . RequestInit > | NotAny < import ( '../../../node_modules/@types/node-fetch/index.d.ts' ) . RequestInit > | NotAny < import ( '../../../../node_modules/@types/node-fetch/index.d.ts' ) . RequestInit > | NotAny < import ( '../../../../../node_modules/@types/node-fetch/index.d.ts' ) . RequestInit > | NotAny < import ( '../../../../../../node_modules/@types/node-fetch/index.d.ts' ) . RequestInit > | NotAny < import ( '../../../../../../../node_modules/@types/node-fetch/index.d.ts' ) . RequestInit > | NotAny < import ( '../../../../../../../../node_modules/@types/node-fetch/index.d.ts' ) . RequestInit > | NotAny < import ( '../../../../../../../../../node_modules/@types/node-fetch/index.d.ts' ) . RequestInit > | NotAny < import ( '../../../../../../../../../../node_modules/@types/node-fetch/index.d.ts' ) . RequestInit > ;
74
+ /** @ts -ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */
75
+ type NodeFetch3RequestInit = NotAny < import ( '../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../../../../../node_modules/node-fetch' ) . RequestInit > | NotAny < import ( '../../../../../../../../../../node_modules/node-fetch' ) . RequestInit > ;
74
76
/** @ts -ignore For users who use Deno */
75
77
type FetchRequestInit = NonNullable < OverloadedParameters < typeof fetch > [ 1 ] > ;
76
78
/* eslint-enable */
@@ -79,7 +81,8 @@ type RequestInits =
79
81
| NotAny < UndiciTypesRequestInit >
80
82
| NotAny < UndiciRequestInit >
81
83
| NotAny < BunRequestInit >
82
- | NotAny < NodeFetchRequestInit >
84
+ | NotAny < NodeFetch2RequestInit >
85
+ | NotAny < NodeFetch3RequestInit >
83
86
| NotAny < RequestInit >
84
87
| NotAny < FetchRequestInit > ;
85
88
0 commit comments