Skip to content

Commit 7916f8d

Browse files
authored
fix: Improve DOM-less type exports (#352)
Usage of HeadersInit requires either a node-fetch dependency or to include DOM in tsconfig libs for consumer projects. It is not exported as a global type in @types/node v18 or v20. RequestInit is: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/aaf94a0a6431f52c46dab26182f1156d79720d29/types/node/v18/globals.d.ts#L341 Define headers in interface HTTPResolverOptions<> via RequestInit['headers'] which will make it possible to depend on this project without node-fetch.
1 parent 4993889 commit 7916f8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/types/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface HTTPResolverOptions<S extends object = JSONSchema> extends Part
2525
/**
2626
* You can specify any HTTP headers that should be sent when downloading files. For example, some servers may require you to set the `Accept` or `Referrer` header.
2727
*/
28-
headers?: HeadersInit | null;
28+
headers?: RequestInit['headers'] | null;
2929

3030
/**
3131
* The amount of time (in milliseconds) to wait for a response from the server when downloading files. The default is 5 seconds.

0 commit comments

Comments
 (0)