Skip to content

Commit 8d886c5

Browse files
committed
fix: type for global variable CHUNKS
1 parent 4da8f84 commit 8d886c5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mixins.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import type { Transformer } from "./transform.ts";
99
import { matchLast } from "./util.js";
1010
import { RootModule } from "/hooks/module.js";
1111

12+
type CHUNKS = Record<string, PromiseWithResolvers<void>>;
13+
1214
declare global {
1315
var __applyTransforms: typeof applyTransforms;
1416
var __interceptNavigationControlMessage: typeof interceptNavigationControlMessage;
1517
var __onScriptLoaded: (path: string) => void;
16-
var CHUNKS: Record<string, PromiseWithResolvers<void>>;
18+
var CHUNKS: CHUNKS;
1719
}
1820

1921
export const applyTransforms = (path: string) => {
@@ -63,8 +65,7 @@ function interceptNavigationControlMessage(e: Event): boolean {
6365
return true;
6466
}
6567
globalThis.__interceptNavigationControlMessage = interceptNavigationControlMessage;
66-
67-
globalThis.CHUNKS = {};
68+
export const CHUNKS: CHUNKS = globalThis.CHUNKS = {};
6869
globalThis.__onScriptLoaded = (path: string) => {
6970
CHUNKS[path] ??= Promise.withResolvers();
7071
setTimeout(CHUNKS[path].resolve);

0 commit comments

Comments
 (0)