Skip to content

Commit 23de195

Browse files
committed
y
1 parent 53121ce commit 23de195

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

module.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,24 @@ import { Transition } from "./util/transition.js";
1616
// @deno-types="./util/fetch.ts"
1717
import { fetchJson } from "./util/fetch.js";
1818

19-
// @deno-types="./util.ts"
20-
import { proxy } from "./util.js";
19+
// @deno-types="./util/proxy.ts"
20+
import { proxy } from "./util/proxy.js";
2121
// @deno-types="./protocol.ts"
2222
import { ModuleManager } from "./protocol.js";
2323
// @deno-types="./static.ts"
2424
import { SPOTIFY_VERSION } from "./static.js";
2525
// @deno-types="./transform.ts"
26-
import { createTransformer } from "./transform.js";
26+
import { createTransformer, type Transformer } from "./transform.js";
2727

28+
export type IndexMixinFn = (transformer: Transformer) => void;
29+
export type IndexPreloadFn = (module: ModuleInstance) => Promise<() => void>;
30+
export type IndexLoadFn = (module: ModuleInstance) => Promise<() => void>;
2831

32+
export type JSIndex = {
33+
mixin?: IndexMixinFn;
34+
preload?: IndexPreloadFn;
35+
load?: IndexLoadFn;
36+
};
2937

3038
export type ModuleIdentifier = string;
3139
export type Version = string;
@@ -423,7 +431,7 @@ export class ModuleInstance extends ModuleInstanceBase<Module>
423431
_unloadCss: (() => void) | null = null;
424432
private mixinsLoaded = false;
425433
private loaded = false;
426-
private jsIndex: any;
434+
private jsIndex: JSIndex | null = null;
427435

428436
public transition = new Transition();
429437
private dependants = new Set<ModuleInstance>();

0 commit comments

Comments
 (0)