Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Loader hooks API surface
interface LoadRequest {
name: string;
address?: string;
source?: string;
metadata: Object;
}
interface Eventual<T> = T | Promise<T>;
interface ModuleInstantiator {
deps: string[];
execute(): Reflect.Module;
}
interface LoaderHooks {
normalize(string): Eventual<string>;
locate(LoadRequest): Eventual<string>;
fetch(LoadRequest): Eventual<string>;
translate(LoadRequest): Eventual<string>;
instantiate(LoadRequest): ModuleInstantiator;
}
interface SystemClass extends Loader, LoaderHooks {
}
interface GlobalSystem {
System: SystemClass;
}
Window implements GlobalSystem;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment