From 24d45b4e2274e3f9434662a50f528d00318f722e Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Mon, 17 Nov 2025 15:13:20 +0900 Subject: [PATCH] fix: use `any` for `dispatcher` when `lib: 'dom'` is used --- lib/http-proxy/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/http-proxy/index.ts b/lib/http-proxy/index.ts index 18e7d32..7a6d08c 100644 --- a/lib/http-proxy/index.ts +++ b/lib/http-proxy/index.ts @@ -101,7 +101,11 @@ export interface ServerOptions { fetch?: boolean | FetchOptions; } -export type Dispatcher = RequestInit["dispatcher"]; +// use `any` when `lib: "dom"` is included in tsconfig.json, +// as dispatcher property does not exist in RequestInit in that case +export type Dispatcher = (typeof globalThis extends { onmessage: any } + ? any + : RequestInit)["dispatcher"]; export interface FetchOptions { /** Allow custom dispatcher */