Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 0e2924d

Browse files
authored
Use export type for exporting Fetch API types (#444)
esbuild requires we enable the TypeScript `isolatedModules` option. This requires us to be explicit when `export`ing types. `export`ing `from "undici"` also means we don't have to duplicate these types in `import`s.
1 parent 6164f66 commit 0e2924d

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

packages/tre/src/index.ts

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,11 @@ import exitHook from "exit-hook";
66
import getPort from "get-port";
77
import stoppable from "stoppable";
88
import {
9-
BodyInit,
10-
File,
11-
FormData,
12-
Headers,
139
HeadersInit,
14-
ReferrerPolicy,
1510
Request,
16-
RequestCache,
17-
RequestCredentials,
18-
RequestDestination,
19-
RequestDuplex,
2011
RequestInfo,
2112
RequestInit,
22-
RequestMode,
23-
RequestRedirect,
2413
Response,
25-
ResponseInit,
26-
ResponseRedirectStatus,
27-
ResponseType,
2814
fetch,
2915
} from "undici";
3016
import { WebSocketServer } from "ws";
@@ -628,14 +614,11 @@ export * from "./plugins";
628614
export * from "./runtime";
629615
export * from "./shared";
630616
export * from "./storage";
631-
export {
617+
export { File, FormData, Headers, Request, Response, fetch } from "undici";
618+
export type {
632619
BodyInit,
633-
File,
634-
FormData,
635-
Headers,
636620
HeadersInit,
637621
ReferrerPolicy,
638-
Request,
639622
RequestCache,
640623
RequestCredentials,
641624
RequestDestination,
@@ -644,9 +627,7 @@ export {
644627
RequestInit,
645628
RequestMode,
646629
RequestRedirect,
647-
Response,
648630
ResponseInit,
649631
ResponseRedirectStatus,
650632
ResponseType,
651-
fetch,
652-
};
633+
} from "undici";

0 commit comments

Comments
 (0)