refactor(core): remove redundant as casts using window.d.ts declarations

window.d.ts already declares __timelines, __player, __playerReady,
and __renderReady on the global Window interface. The casts in
init.ts and init.test.ts were re-asserting the same types.

- Add __hfRuntimeTeardown to window.d.ts (used 6x in init.ts)
- Remove runtimeWindow cast variable from init.ts — use window directly
- Remove all (window as Window & { __player?: ... }).__player casts
  from init.test.ts — window.__player is already typed as PlayerAPI
- Remove all (window as Window & { __timelines?: ... }).__timelines
  casts from init.test.ts — window.__timelines is already typed
- Remove (window as Window & { __playerReady/renderReady }}) casts
  from init.ts — already declared globally
This commit is contained in:
Miguel Ángel
2026-05-24 13:36:57 -04:00
parent e7d0b392c7
commit 3347486ae9
3 changed files with 42 additions and 95 deletions
+1
View File
@@ -31,6 +31,7 @@ declare global {
__clipManifest?: RuntimeTimelineMessage;
__playerReady?: boolean;
__renderReady?: boolean;
__hfRuntimeTeardown?: (() => void) | null;
__HF_PARITY_MODE?: boolean;
__HF_FPS?: number;
__HF_MAX_DURATION_SEC?: number;