import { COMPILE_ENTRY } from './config/constant.config'; import { Project } from 'xhs-mp-project'; import EventEmitter from 'events'; import { Logger } from 'xhs-mp-shared'; import { prepareDevPool } from './compiler'; export { COMPILE_ENTRY, prepareDevPool }; interface ILibFeatures { supportV2?: boolean; supportVDom?: boolean; } export type IArchType = 'v1' | 'v2'; export type IZipResult = { type: IArchType; zipPath: string; zipSize: number; root: string; originSize: number; }; export type ICompileOpts = { logger?: any; report?: (key: string, data?: any) => void; compileDistDir?: string; compileCacheDir?: string; nodeJsPath?: string; getLibFeatures?: () => Promise; }; export type ICompilerProps = { projectPath?: string; project?: Project; } & ICompileOpts; interface ICompileBaseConfig { compressCss?: boolean; compressJs?: boolean; enableSourcemap?: boolean; appendSourcemapComment?: boolean; enableV2?: boolean; enableV1?: boolean; enableVDom?: boolean; } type IMakePkgsReadyConfig = ICompileBaseConfig & { compilePkgs?: string[]; }; type ICompilePkgsConfig = ICompileBaseConfig & { compilePkgs?: string[]; }; type ICompileProjectConfig = ICompileBaseConfig & { entryType?: string; mpUploadOptions?: ICompileAndZipOptions | false; }; export interface ICompileAndZipOptions { entryType?: string; can_upload_ext_json?: boolean; upload_app_id?: string; pkgInfo?: { version: string; }; } export interface ISubPackages { root: string; pages: string; } export declare class ProjectCompilerManager extends EventEmitter { compilerProps: ICompilerProps; project: Project; compilerImplMap: {}; logger: Logger; report?: (key: string, data?: any) => void; constructor(props: ICompilerProps); bindProject(props: any): void; private getCompilerType; getDistDir(entryType?: string): string; removeDistDir(entryType?: string): void; getCacheDir(entryType?: string): string; removeCacheDir(entryType?: string): void; removeAllCacheDir(): void; private createCompiler; private getCompiler; getUsingPackageType(entryType?: string): Promise<{ enableV1: boolean; enableV2: boolean; enableVDom: boolean; }>; private initSimulatorCompiler; private initBuildCompiler; makePkgsReady(opts: IMakePkgsReadyConfig): Promise; reCompilePkgs(opts: ICompilePkgsConfig): Promise; compileProject(config: ICompileProjectConfig): Promise; compileAndZip(opts: ICompileAndZipOptions): Promise; checkMiniWidgetSize(zipResult: IZipResult[], resolve: any, reject: any): any; closeCompiler(entryType?: string): void; killCompiler(entryType?: string): void; killAll(): void; private zipWithSubPackage; }