Skip to content

Commit 6d9cd44

Browse files
cliffordfajardoClifford Fajardo
andauthored
fix: add typings for HTTPS agent for fetch and Request (#18)
Co-authored-by: Clifford Fajardo <[email protected]>
1 parent 8a55fc8 commit 6d9cd44

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/polite-poets-enjoy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@remix-run/web-fetch": minor
3+
---
4+
5+
expose RequestExtraOptions to fetch & add HTTPs.agent to types

packages/fetch/src/fetch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const supportedSchemas = new Set(['data:', 'http:', 'https:', 'file:']);
3333
* Fetch function
3434
*
3535
* @param {string | URL | import('./request.js').default} url - Absolute url or Request instance
36-
* @param {RequestInit} [options_] - Fetch options
36+
* @param {RequestInit & import('./request.js').RequestExtraOptions} [options_] - Fetch options
3737
* @return {Promise<import('./response.js').default>}
3838
*/
3939
async function fetch(url, options_ = {}) {

packages/fetch/src/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const isRequest = object => {
4949
* @property {number} [highWaterMark]
5050
* @property {boolean} [insecureHTTPParser]
5151
*
52-
* @typedef {((url:URL) => import('http').Agent) | import('http').Agent} Agent
52+
* @typedef {((url:URL) => import('http').Agent | import('https').Agent) | import('http').Agent | import('https').Agent} Agent
5353
*
5454
* @typedef {Object} RequestOptions
5555
* @property {string} [method]

0 commit comments

Comments
 (0)