import { Alias } from '@xzzs/resolve-alias'; import * as swc from '@swc/core'; declare type AssetsMap = Map; interface BaseAssetsMap { uri: string; output: string; } declare type Asset = BaseAssetsMap & PackSingleJSOutput; declare type ScopeUtils = { registerGlobalPack: (key: string, value: any) => void; takeGlobalPack: (key: string) => any; }; declare type PackConfig = { root: string; entry: string | string[]; output: string; verbose?: boolean; watch?: boolean; clean?: boolean; alias?: Alias; compileExtensions?: string[]; swcConfig?: swc.Options; inject?: { [name: string]: { packages: string; exclude: string[]; }; }; copy?: { [from: string]: string; }; compileExcludes?: RegExp[]; plugins?: Plugin[]; formatPlugins?: PluginBody[]; }; declare type TransportCondition = (entry: string, config: PackConfig) => [boolean, string]; interface PackItem { entry: string; code: string; finalCode: string; transformed: boolean; transformedCode: string; requireMap: { [dep: string]: { deps: string[]; }; }; } declare type PluginConfig = Omit; declare type PluginBody = ReturnType; declare type Plugin = (config: PackConfig) => { beforeBuild?: (scopeUtils: ScopeUtils) => void | Promise; afterBuild?: (scopeUtils: ScopeUtils) => void | Promise; beforeReadCode?: (scopeUtils: ScopeUtils) => void | Promise; afterReadCode?: (scopeUtils: ScopeUtils) => void | Promise; beforeCollectDependencies?: (scopeUtils: ScopeUtils) => void; afterCollectDependencies?: (scopeUtils: ScopeUtils) => void; beforeParseDependency?: (scopeUtils: ScopeUtils) => void | Promise; afterParseDependency?: (scopeUtils: ScopeUtils) => void | Promise; beforeResolveRequirePath?: (scopeUtils: ScopeUtils) => void; afterResolveRequirePath?: (scopeUtils: ScopeUtils) => void; beforeAddStaticAssets?: (scopeUtils: ScopeUtils) => void | Promise; afterAddStaticAssets?: (scopeUtils: ScopeUtils) => void | Promise; beforeEmit?: (scopeUtils: ScopeUtils) => void | Promise; afterEmit?: (scopeUtils: ScopeUtils) => void | Promise; beforeWatch?: (scopeUtils: ScopeUtils) => void | Promise; afterWatch?: (scopeUtils: ScopeUtils) => void | Promise; }; interface PackSingleJSOutput { flatDependencies: Set; dependenciesMap: Map; outputCode: string; } declare function pack({ rc }: { rc: string; }): Promise; declare function main({ rc }: { rc: string; }): Promise; export { Asset, AssetsMap, PackConfig, PackItem, PackSingleJSOutput, Plugin, PluginBody, PluginConfig, TransportCondition, main, pack };