Last active
August 29, 2015 14:01
-
-
Save juandopazo/dfc6c067f1442fa8fa23 to your computer and use it in GitHub Desktop.
Loader hooks API surface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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