declare function hex_md5(s: string): string; declare class NPMLoader { parentUrl: string; name: string; url: string; module: Module; constructor(module: Module, parentUrl: string, name: string); static ESModuleList: Set; private fetchMain; fetch(): Promise; private fetchCode; private isES6Module; isNpmRoot(url?: string): boolean; fromNpm(): boolean; } declare function getModuleMap(): Record; declare type TModuleType = 'name' | 'code' | 'url'; declare type TModuleErrorType = 'transform' | 'exec'; declare type TModuleLoaded = (module: Module) => void; interface IModuleProgressPart { status: 'start' | 'fail' | 'done'; fromCache?: boolean; } interface IModuleProgressOptions extends IModuleProgressPart { parent: string; current: string; url: string; } declare type TModuleProgress = (options: IModuleProgressOptions) => void; declare type TModuleExecuted = (module: Module) => void; interface IErrorOptions { module: Module; error: any; type: TModuleErrorType; } interface IMoudleOptions extends IMouduleFunc { name: string; parent?: Module | null; type?: TModuleType; app: Application; } interface IMouduleFunc { onLoaded?: TModuleLoaded; onExecuted?: TModuleExecuted; } declare class Module { app: Application; name: string; type: TModuleType; parent: Module | null; func: IMouduleFunc; code: string; imports: string[]; dependencies: Record; exports: any; npmLoader: NPMLoader; private _url; time: number; private startTime; get url(): string; get MainMap(): Record; get IIFENameMap(): Record; get Env(): Record | undefined; constructor({ app, name, parent, onLoaded, onExecuted, type, }: IMoudleOptions); onProgress({ status, fromCache, }: IModuleProgressPart): void; loadCode(): Promise; get fromNpm(): boolean; private emitError; onCode(originCode: string, fromCache?: boolean): void; onModuleLoaded(): void; checkType(name: string): "name" | "url"; run(map: Record): any; buildDependenciesGraph(): Record; } interface IApplicationOptionsBase { env?: Record; iifeNameMap?: Record; mainMap?: Record; onLoaded?: TModuleLoaded; onDependenciesParsed?(graph: Record): void; onProgress?: TModuleProgress; onError?: (options: IErrorOptions) => void; onModuleExecuted?: TModuleExecuted; onExecuted?: () => void; onStart?: (code: string) => void; onEnd?: (code: string) => void; } interface ICodeQueueItem { code: string; resolve: (module: Module) => void; reject: (err: IErrorOptions) => void; } interface IApplicationOptions extends IApplicationOptionsBase { code?: string; } declare class Application { entry: Module; code: string; ModuleExportsMap: Record; onDependenciesParsed?(graph: Record): void; options: IApplicationOptionsBase; reject: ((err: IErrorOptions) => void) | null; private codeQueue; private inExecuting; constructor(options?: IApplicationOptions); private addIntoQueue; exec(code: string): Promise; private execBase; private executeNext; _onError(err: IErrorOptions): void; private _onEnd; } declare type TAnyFunc = (...args: any[]) => any; declare const babel: { availablePlugins: any; availablePresets: any; buildExternalHelpers: TAnyFunc; disableScriptTags: TAnyFunc; registerPlugin: TAnyFunc; registerPlugins: TAnyFunc; registerPreset: TAnyFunc; registerPresets: TAnyFunc; transform: TAnyFunc; transformFromAst: TAnyFunc; transformScriptTags: TAnyFunc; version: string; }; declare function execModule(arg: string | Function, options: IApplicationOptionsBase): Application; declare const md5: typeof hex_md5; export { Application, IApplicationOptions, IApplicationOptionsBase, ICodeQueueItem, babel, execModule, getModuleMap, md5 };