fix: type reconnectTimer as setTimeout return value (#3820)

The dev HMR client declares `reconnectTimer` as `number`, but the
runtime type of `setTimeout`'s return value is a `Timeout` object, so `deno
check` now fails with `TS2322: Type 'Timeout' is not assignable to type
'number'` at `packages/fresh/src/runtime/client/dev_hmr.ts:32`. This is blocking
every PR's type check job. Switching the annotation to
`ReturnType<typeof setTimeout>` keeps the declaration accurate without
committing to a specific runtime's timer type.
This commit is contained in:
Bartek Iwańczuk
2026-05-26 15:13:16 +02:00
committed by GitHub
parent 39b5f06f8a
commit 724879d1aa
+1 -1
View File
@@ -3,7 +3,7 @@ import { IS_BROWSER } from "../shared.ts";
let ws: WebSocket;
let revision = 0;
let reconnectTimer: number;
let reconnectTimer: ReturnType<typeof setTimeout>;
const backoff = [
// Wait 100ms initially, because we could also be
// disconnected because of a form submit.