Skip to content

Commit 724879d

Browse files
authored
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.
1 parent 39b5f06 commit 724879d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/fresh/src/runtime/client/dev_hmr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { IS_BROWSER } from "../shared.ts";
33
let ws: WebSocket;
44
let revision = 0;
55

6-
let reconnectTimer: number;
6+
let reconnectTimer: ReturnType<typeof setTimeout>;
77
const backoff = [
88
// Wait 100ms initially, because we could also be
99
// disconnected because of a form submit.

0 commit comments

Comments
 (0)