Skip to content

Commit d4cf6f7

Browse files
authored
fix: proper exports to allow TS to recognize class types and proper casting (#2)
1 parent 6cc580c commit d4cf6f7

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

packages/fetch/src/lib.node.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
import * as WebFetch from "./fetch.js"
1+
export { default, Headers, Request, Response } from "./fetch.js"
22

3-
export { ReadableStream, Blob, FormData } from './package.js';
43
// Node 18+ introduces fetch API globally and it doesn't support our use-cases yet.
54
// For now we always use the polyfill.
5+
export { ReadableStream, Blob, FormData } from './package.js'
66

7-
// Marking export as a DOM File object instead of custom class.
8-
export const fetch = /** @type {typeof globalThis.fetch} */
9-
WebFetch.fetch
10-
11-
export const Headers = WebFetch.Headers
12-
export const Request = WebFetch.Request
13-
export const Response = WebFetch.Response
14-
15-
export default fetch

0 commit comments

Comments
 (0)