import * as _garfish_loader from '@garfish/loader'; import { ModuleManager, Loader } from '@garfish/loader'; import * as _garfish_hooks from '@garfish/hooks'; import { PluginSystem, SyncHook, SyncWaterfallHook, AsyncWaterfallHook } from '@garfish/hooks'; declare class Actuator { private manager; env: Record; constructor(manager: ModuleManager, externals?: Record); execScript(): Record; } declare type PartialPart = { [P in Exclude]-?: T[P]; } & { [P in K]?: T[P]; }; declare type ModuleConfig = PartialPart & { alias: Record; }>, 'externals'>; interface ModuleInfo { cache: boolean; version: string; externals: Record; error: null | ((err: Error, info: ModuleInfo, alias: string) => any); adapter: null | ((cjsModule: Record) => Record); } declare const cacheModules: any; declare const loader: Loader; interface BeforeLoadArgs { url: string; options?: ModuleConfig; } interface afterLoadArgs { url: string; code: string; exports: Record; } declare const hooks: PluginSystem<{ preloaded: SyncHook<[ModuleManager], any>; initModule: SyncHook<[Actuator], any>; beforeLoadModule: SyncWaterfallHook; asyncBeforeLoadModule: AsyncWaterfallHook; afterLoadModule: SyncWaterfallHook; asyncAfterLoadModule: AsyncWaterfallHook; }>; declare function preload(urls: string | Array): Promise<_garfish_loader.CacheValue<_garfish_loader.ModuleManager>[]>; declare type ESModuleResult = { default: T; __esModule: true; }; declare function esModule>(obj: T): Promise ? P : T>>; declare function esModule>(obj: T): T; declare function esModule(obj: T): ESModuleResult; declare function loadModule(urlOrAlias: string, options?: ModuleConfig): Promise | null>; declare function loadModuleSync(urlOrAlias: string, options?: ModuleConfig): Record | null; declare function setModuleConfig(obj: Partial): void; declare const Apis: { preload: typeof preload; esModule: typeof esModule; loadModule: typeof loadModule; loadModuleSync: typeof loadModuleSync; setModuleConfig: typeof setModuleConfig; hooks: _garfish_hooks.PluginSystem<{ preloaded: _garfish_hooks.SyncHook<[_garfish_loader.ModuleManager], any>; initModule: _garfish_hooks.SyncHook<[Actuator], any>; beforeLoadModule: _garfish_hooks.SyncWaterfallHook; asyncBeforeLoadModule: _garfish_hooks.AsyncWaterfallHook; afterLoadModule: _garfish_hooks.SyncWaterfallHook; asyncAfterLoadModule: _garfish_hooks.AsyncWaterfallHook; }>; loader: _garfish_loader.Loader; cacheModules: any; }; export { cacheModules, Apis as default, esModule, hooks, loadModule, loadModuleSync, loader, preload, setModuleConfig };