Skip to content

Commit 24d45b4

Browse files
committed
fix: use any for dispatcher when lib: 'dom' is used
1 parent 27fa612 commit 24d45b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/http-proxy/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ export interface ServerOptions {
101101
fetch?: boolean | FetchOptions;
102102
}
103103

104-
export type Dispatcher = RequestInit["dispatcher"];
104+
// use `any` when `lib: "dom"` is included in tsconfig.json,
105+
// as dispatcher property does not exist in RequestInit in that case
106+
export type Dispatcher = (typeof globalThis extends { onmessage: any }
107+
? any
108+
: RequestInit)["dispatcher"];
105109

106110
export interface FetchOptions {
107111
/** Allow custom dispatcher */

0 commit comments

Comments
 (0)