;
+
+/** 音频资源的 userData */
+export declare interface AudioClipAssetUserData {
+ /** 下载模式:0-Web Audio, 1-DOM Audio */
+ downloadMode: number;
+}
+
+/** 自动图集资源的 userData */
+export declare interface AutoAtlasAssetUserData {
+ compressed: boolean;
+ dest: any;
+ /** 打包图像的尺寸 */
+ maxWidth: number;
+ maxHeight: number;
+ /** 图像的边距 */
+ padding: number;
+ allowRotation: boolean;
+ forceSquared: boolean;
+ powerOfTwo: boolean;
+ algorithm: string;
+ format: string;
+ quality: number;
+ contourBleed: boolean;
+ paddingBleed: boolean;
+ filterUnused: boolean;
+ removeTextureInBundle: boolean;
+ removeImageInBundle: boolean;
+ removeSpriteAtlasInBundle: boolean;
+ platformSettings: any;
+ textureSetting: any;
+}
+
+export declare type BabelPluginItem = PluginItem;
+
+/** 位图字体资源的 userData */
+export declare interface BitmapFontAssetUserData {
+ /** 字体配置 */
+ _fntConfig: any;
+ /** 字体大小 */
+ fontSize: number;
+ /** 纹理 UUID */
+ textureUuid: string;
+}
+
+export declare type BreakType = 'cancel' | 'crashed' | 'refreshed' | 'interrupted' | '';
+
+export declare function build(platform: P, options?: IBuildCommandOption): Promise;
+
+export declare function buildBundleOnly(bundleOptions: IBundleBuildOptions): Promise;
+
+export declare interface BuildCheckResult {
+ error: string;
+ newValue: any;
+ level: IConsoleType;
+}
+
+export declare interface BuildConfiguration {
+ common: IBuildCommonOptions;
+ platforms: {
+ 'web-desktop'?: WebDesktopBuildOptions & OverwriteProjectSettings;
+ 'web-mobile'?: WebMobileBuildOptions & OverwriteProjectSettings;
+ };
+ useCacheConfig?: IBuildCacheUseConfig;
+ bundleConfig: {
+ custom: Record;
+ };
+ textureCompressConfig: UserCompressConfig;
+}
+
+/**
+ * 资源管理器,主要负责资源的缓存查询缓存等
+ * 所有 __ 开头的属性方法都不对外公开
+ */
+export declare class BuilderAssetCache implements BuilderCache {
+ readonly scenes: Array;
+ readonly scriptUuids: Array;
+ assetUuids: Array;
+ private readonly instanceMap;
+ private readonly _task?;
+ constructor(task?: IBuilder);
+ /**
+ * 初始化
+ */
+ init(): Promise;
+ /**
+ * 查询某个 uuid 是否存在
+ * @param uuid
+ * @returns
+ */
+ hasAsset(uuid: string): Promise;
+ /**
+ * 添加一个资源到缓存
+ * @param asset
+ */
+ addAsset(asset: IAsset, type?: string): void;
+ /**
+ * 删除一个资源的缓存
+ */
+ removeAsset(uuid: string, type?: string): void;
+ /**
+ * 查询指定 uuid 的资源信息
+ * @param uuid
+ */
+ getAssetInfo(uuid: string): IAssetInfo;
+ /**
+ * 添加或修改一个实例化对象到缓存
+ * @param instance
+ */
+ addInstance(instance: any): void;
+ /**
+ * 删除一个资源的缓存
+ * @param uuid
+ */
+ clearAsset(uuid: string): void;
+ /**
+ * 查询一个资源的 meta 数据
+ * @param uuid
+ */
+ getMeta(uuid: string): Promise;
+ addMeta(uuid: string, meta: any): Promise;
+ /**
+ * 获取指定 uuid 资源的依赖资源 uuid 列表
+ * @param uuid
+ */
+ getDependUuids(uuid: string): Promise;
+ /**
+ * 深度获取指定 uuid 资源的依赖资源 uuid 列表
+ * @param uuid
+ */
+ getDependUuidsDeep(uuid: string): Promise;
+ /**
+ *
+ * 获取指定 uuid 资源在 library 内的序列化 JSON 内容
+ * @param uuid
+ */
+ getLibraryJSON(uuid: string): Promise;
+ /**
+ * 获取指定 uuid 资源的重新序列化后的 JSON 内容(最终输出)
+ * @param uuid
+ * @param options
+ */
+ getSerializedJSON(uuid: string, options: ISerializedOptions): Promise;
+ /**
+ * 直接输出某个资源序列化 JSON 到指定包内
+ * @param uuid
+ * @param destDir
+ * @param options
+ */
+ outputAssetJson(uuid: string, destDir: string, options: IInternalBuildOptions): Promise;
+ /**
+ * 循环一种数据
+ * @param type
+ * @param handle
+ */
+ forEach(type: string, handle: Function): Promise;
+ /**
+ * 查询一个资源反序列化后的实例
+ * @param uuid
+ */
+ getInstance(uuid: string): Promise;
+}
+
+export declare interface BuilderCache {
+ readonly scenes: Array;
+ readonly scriptUuids: Array;
+ readonly assetUuids: Array;
+ init: () => Promise;
+ hasAsset: (uuid: string) => Promise;
+ addAsset: (asset: IAsset) => void;
+ addInstance: (instance: any) => void;
+ clearAsset: (uuid: string) => void;
+ removeAsset: (uuid: string) => void;
+ getMeta: (uuid: string) => Promise;
+ getAssetInfo: (uuid: string) => IAssetInfo;
+ addMeta: (uuid: string, meta: any) => void;
+ getDependUuids: (uuid: string) => Promise;
+ getDependUuidsDeep: (uuid: string) => Promise;
+ /**
+ * 获取序列化文件
+ */
+ getLibraryJSON: (uuid: string) => Promise;
+ getSerializedJSON: (uuid: string, options: IInternalBuildOptions) => Promise;
+ forEach: (type: string, handle: Function) => Promise;
+ getInstance: (uuid: string) => Promise;
+ outputAssetJson: (uuid: string, destDir: string, options: IInternalBuildOptions) => Promise;
+}
+
+export declare const enum BuildExitCode {
+ PARAM_ERROR = 32,
+ BUILD_FAILED = 34,
+ BUILD_SUCCESS = 0,
+ BUILD_BUSY = 37,
+ STATIC_COMPILE_ERROR = 38,
+ UNKNOWN_ERROR = 50
+}
+
+export declare namespace BuildHook {
+ export type throwError = boolean;
+ export type title = string;
+ export type onError = IBaseHooks;
+ export type onBeforeBuild = IBaseHooks;
+ export type onBeforeCompressSettings = IBaseHooks;
+ export type onAfterCompressSettings = IBaseHooks;
+ export type onAfterBuild = IBaseHooks;
+ export type onAfterMake = IBuildStageHooks;
+ export type onBeforeMake = IBuildStageHooks;
+ export type load = () => Promise | void;
+ export type unload = () => Promise | void;
+}
+
+export declare namespace BuildPlugin {
+ export type Configs = Record;
+ export type AssetHandlers = string;
+ export type load = () => Promise | void;
+ export type Unload = () => Promise | void;
+}
+
+export declare class BuildResult implements IBuildResult {
+ private readonly __task;
+ settings?: ISettings;
+ dest: string;
+ get paths(): IBuildPaths;
+ constructor(task: IBuilder);
+ /**
+ * 指定的 uuid 资源是否包含在构建资源中
+ */
+ containsAsset(uuid: string): boolean;
+ /**
+ * 获取指定 uuid 原始资源的存放路径(不包括序列化 json)
+ * 自动图集的小图 uuid 和自动图集的 uuid 都将会查询到合图大图的生成路径
+ * 实际返回多个路径的情况:查询 uuid 为自动图集资源,且对应图集生成多张大图,纹理压缩会有多个图片格式路径
+ */
+ getRawAssetPaths(uuid: string): IRawAssetPathInfo[];
+ /**
+ * 获取指定 uuid 资源的路径相关信息
+ * @return Array<{raw?: string | string[]; import?: string; groupIndex?: number;}>
+ * @return.raw: 该资源源文件的实际存储位置,存在多个为数组,不存在则为空
+ * @return.import: 该资源序列化数据的实际存储位置,不存在为空,可能是 .bin 或者 .json 格式
+ * @return.groupIndex: 若该资源的序列化数据在某个分组内,这里标识在分组内的 index,不存在为空
+ */
+ getAssetPathInfo(uuid: string): IAssetPathInfo[];
+ /**
+ * @deprecated please use getImportAssetPaths instead
+ * @param uuid
+ */
+ getJsonPathInfo(uuid: string): IImportAssetPathInfo[];
+ /**
+ * 指定 uuid 资源的序列化信息在构建后的信息
+ * @param uuid
+ */
+ getImportAssetPaths(uuid: string): IImportAssetPathInfo[];
+}
+
+export declare class BuildStageTask extends BuildTaskBase implements IBuildStageTask {
+ options: IBuildOptionBase;
+ hooksInfo: IBuildHooksInfo;
+ private root;
+ hookMap: Record;
+ constructor(id: string, config: IBuildStageConfig);
+ run(): Promise;
+ break(reason: string): void;
+ handleHook(func: Function, internal: boolean): Promise;
+ saveOptions(): Promise;
+}
+
+export declare class BuildTask extends BuildTaskBase implements IBuilder {
+ cache: BuilderAssetCache;
+ result: InternalBuildResult_2;
+ buildTemplate: BuildTemplate;
+ buildResult?: BuildResult;
+ options: IInternalBuildOptions;
+ hooksInfo: IBuildHooksInfo;
+ taskManager: TaskManager;
+ private mainTaskWeight;
+ static isCommandBuild: boolean;
+ private currentStageTask?;
+ bundleManager: BundleManager;
+ hookMap: Record;
+ pipeline: (string | Function | IBuildTask[])[];
+ /**
+ * 构建任务的结果缓存,只允许接口访问
+ */
+ private taskResMap;
+ static utils: IBuildUtils;
+ get utils(): IBuildUtils;
+ constructor(id: string, options: IBuildOptionBase);
+ get stage(): string;
+ /**
+ * 获取某个任务结果
+ * @param name
+ */
+ getTaskResult(name: keyof ITaskResultMap_2): {
+ projectJs: string;
+ systemJs: string;
+ polyfillsJs: string | null;
+ } | IBuildPacResult_2 | undefined;
+ /**
+ * 开始整理构建需要的参数
+ */
+ init(): Promise;
+ /**
+ * 执行具体的构建任务
+ */
+ run(): Promise;
+ /**
+ * 仅构建 Bundle 流程
+ */
+ buildBundleOnly(): Promise;
+ private postBuild;
+ private handleBuildStageTask;
+ private initBundleManager;
+ break(reason: string): void;
+ lockAssetDB(): Promise;
+ unLockAssetDB(): void;
+ /**
+ * 获取预览 settings 信息
+ */
+ getPreviewSettings(): Promise;
+ private initOptions;
+ /**
+ * 执行某个任务列表
+ * @param buildTasks 任务列表数组
+ * @param weight 全部任务列表所占权重
+ * @param args 需要传递给任务的其他参数
+ */
+ private runBuildTask;
+ handleHook(func: Function, internal: boolean, ...args: any[]): Promise;
+ onError(error: Error, throwError?: boolean): void;
+ runErrorHook(): Promise;
+}
+
+export declare abstract class BuildTaskBase extends EventEmitter {
+ breakReason?: string;
+ name: string;
+ progress: number;
+ error?: Error;
+ abstract hooksInfo: IBuildHooksInfo;
+ abstract options: IBuildOptionBase;
+ abstract hookMap: Record;
+ hookWeight: number;
+ id: string;
+ buildExitRes: IBuildResultSuccess;
+ constructor(id: string, name: string);
+ break(reason: string): void;
+ onError(error: Error, throwError?: boolean): void;
+ /**
+ * 更新进度消息 log
+ * @param message
+ * @param increment
+ * @param outputType
+ */
+ updateProcess(message: string, increment?: number, outputType?: IConsoleType): void;
+ abstract handleHook(func: Function, internal: boolean, ...args: any[]): Promise;
+ abstract run(): Promise;
+ runPluginTask(funcName: string, weight?: number): Promise;
+}
+
+export declare class BuildTemplate implements IBuildTemplate {
+ _buildTemplateDirs: string[];
+ map: Record;
+ _versionUser: string;
+ config?: BuildTemplateConfig;
+ get isEnable(): boolean;
+ constructor(platform: Platform | string, taskName: string, config?: BuildTemplateConfig);
+ query(name: string): string;
+ private _initVersion;
+ findFile(relativeUrl: string): string;
+ initUrl(relativeUrl: string, name?: string): string | undefined;
+ copyTo(dest: string): Promise;
+}
+
+export declare interface BuildTemplateConfig {
+ templates: {
+ path: string;
+ destUrl: string;
+ }[];
+ displayName?: string;
+ version: string;
+ dirname?: string;
+}
+
+export declare const enum BuiltinBundleName {
+ RESOURCES = "resources",
+ MAIN = "main",
+ START_SCENE = "start-scene",
+ INTERNAL = "internal"
+}
+
+export declare enum BuiltinBundleName_2 {
+ RESOURCES = "resources",
+ MAIN = "main",
+ START_SCENE = "start-scene",
+ INTERNAL = "internal"
+}
+
+export declare type BundleCompressionType = 'none' | 'merge_dep' | 'merge_all_json' | 'subpackage' | 'zip';
+
+export declare const enum BundleCompressionTypes {
+ NONE = "none",
+ MERGE_DEP = "merge_dep",
+ MERGE_ALL_JSON = "merge_all_json",
+ SUBPACKAGE = "subpackage",
+ ZIP = "zip"
+}
+
+export declare enum BundleCompressionTypes_2 {
+ NONE = "none",
+ MERGE_DEP = "merge_dep",
+ MERGE_ALL_JSON = "merge_all_json",
+ SUBPACKAGE = "subpackage",
+ ZIP = "zip"
+}
+
+export declare interface BundleConfigItem {
+ isRemote?: boolean;
+ compressionType: BundleCompressionType;
+}
+
+export declare type BundleConfigProperty = 'compressionType' | 'isRemote';
+
+export declare interface BundleFilterConfig {
+ range: 'include' | 'exclude';
+ type: 'asset' | 'url';
+ patchOption?: {
+ patchType: 'glob' | 'beginWith' | 'endWith' | 'contain';
+ value: string;
+ };
+ assets?: string[];
+}
+
+export declare class BundleManager extends BuildTaskBase implements IBundleManager {
+ static BuiltinBundleName: typeof BuiltinBundleName_2;
+ static BundleConfigs: Record>;
+ private _task?;
+ options: IInternalBundleBuildOptions;
+ destDir: string;
+ hooksInfo: IBuildHooksInfo;
+ bundleMap: Record;
+ bundles: IBundle[];
+ _pacAssets: string[];
+ _bundleGroupInPriority?: Array;
+ imageCompressManager?: TextureCompress_2;
+ scriptBuilder: ScriptBuilder_2;
+ packResults: PacInfo[];
+ cache: BuilderAssetCache;
+ hookMap: {
+ onBeforeBundleInit: string;
+ onAfterBundleInit: string;
+ onBeforeBundleDataTask: string;
+ onAfterBundleDataTask: string;
+ onBeforeBundleBuildTask: string;
+ onAfterBundleBuildTask: string;
+ };
+ pipeline: (string | Function)[];
+ get bundleGroupInPriority(): IBundle[][];
+ static internalBundlePriority: Record;
+ private constructor();
+ static create(options: IBuildOptionBase, task?: IBuilder): Promise;
+ loadScript(scriptUuids: string[], pluginScripts: IPluginScriptInfo[]): Promise;
+ /**
+ * 初始化项目设置的一些 bundle 配置信息
+ */
+ static initStaticBundleConfig(): Promise;
+ getUserConfig(ID?: string): {
+ isRemote: boolean;
+ compressionType: BundleCompressionTypes_2;
+ } | null;
+ /**
+ * 对 options 上的数据做补全处理
+ */
+ initOptions(): Promise;
+ clearBundleDest(): void;
+ /**
+ * 初始化整理资源列表
+ */
+ initAsset(): Promise;
+ initBundleConfig(): Promise;
+ buildAsset(): Promise;
+ /**
+ * 独立构建 Bundle 时调用
+ * @returns
+ */
+ run(): Promise;
+ outputBundle(): Promise;
+ private addBundle;
+ private getDefaultBundleConfig;
+ /**
+ * 根据参数初始化一些信息配置,整理所有的 bundle 分组信息
+ */
+ initBundle(): Promise;
+ /**
+ * 初始化内置 Bundle(由于一些历史的 bundle 行为配置,内置 Bundle 的配置需要单独处理)
+ */
+ private initInternalBundleConfigs;
+ /**
+ * 填充成完整可用的项目 Bundle 配置(传入自定义配置 > Bundle 文件夹配置 > 默认配置)
+ * @param customConfig
+ * @returns IBundleInitOptions | null
+ */
+ private patchProjectBundleConfig;
+ /**
+ * 初始化 bundle 分组内的根资源信息
+ * 初始化 bundle 内的各项不同的处理任务
+ */
+ private initBundleRootAssets;
+ /**
+ * 按照 Bundle 优先级整理 Bundle 的资源列表
+ */
+ private initBundleShareAssets;
+ /**
+ * 根据不同的选项做不同的 bundle 任务注册
+ */
+ bundleDataTask(): Promise;
+ /**
+ * 纹理压缩处理
+ * @returns
+ */
+ private compressImage;
+ /**
+ * 执行自动图集任务
+ */
+ private packImage;
+ /**
+ * 编译项目脚本
+ */
+ buildScript(): Promise;
+ /**
+ * 输出所有的 bundle 资源,包含脚本、json、普通资源、纹理压缩、图集等
+ */
+ private outputAssets;
+ handleHook(func: Function, internal: boolean, ...args: any[]): Promise;
+ runAllTask(): Promise;
+ runBuildTask(handle: Function, increment: number): Promise;
+}
+
+export declare type BundlePlatformType = 'native' | 'miniGame' | 'web';
+
+export declare interface BundleRenderConfig {
+ platformTypeInfo: PlatformTypeInfo;
+ platformConfigs: Record;
+ maxOptionList: Record;
+ minOptionList?: Record;
+}
+
+export declare type CCEnvConstants = ConstantManager.CCEnvConstants;
+
+export declare type ChangeEvent = 'create' | 'update' | 'delete';
+
+export declare interface ChokidarOptions {
+ alwaysStat?: boolean;
+ atomic?: boolean | number;
+ awaitWriteFinish?:
+ | {
+ pollInterval?: number;
+ stabilityThreshold?: number;
+ }
+ | boolean;
+ binaryInterval?: number;
+ cwd?: string;
+ depth?: number;
+ disableGlobbing?: boolean;
+ followSymlinks?: boolean;
+ ignoreInitial?: boolean;
+ ignorePermissionErrors?: boolean;
+ ignored?: any;
+ interval?: number;
+ persistent?: boolean;
+ useFsEvents?: boolean;
+ usePolling?: boolean;
+}
+
+export declare class CocosParams {
+ platformParams: T;
+ debug: boolean;
+ projectName: string;
+ cmakePath: string;
+ platform: InternalNativePlatform;
+ platformName: string;
+ executableName: string;
+ /**
+ * engine root
+ */
+ enginePath: string;
+ /**
+ * native engine root
+ */
+ nativeEnginePath: string;
+ /**
+ * project path
+ */
+ projDir: string;
+ /**
+ * build/[platform]
+ */
+ buildDir: string;
+ /**
+ * @zh 构建资源路径
+ * @en /build/[platform]/data
+ */
+ buildAssetsDir: string;
+ /**
+ * @zh 是否加密脚本
+ * @en is encrypted
+ */
+ encrypted?: boolean;
+ /**
+ * @zh 是否压缩脚本
+ * @en is compress script
+ */
+ compressZip?: boolean;
+ /**
+ * @zh 加密密钥
+ * @en encrypt Key
+ */
+ xxteaKey?: string;
+ /**
+ * @zh 是否为模拟器
+ * @en is simulator
+ */
+ simulator?: boolean;
+ cMakeConfig: ICMakeConfig;
+ constructor(params: CocosParams);
+}
+
+export declare interface CompressCacheInfo {
+ option: {
+ mtime: number | string;
+ src: string;
+ compressOptions: Record>;
+ };
+ mipmapFiles: string[] | undefined;
+ customConfigs: Record;
+ dest?: string[];
+}
+
+export declare interface CompressedInfo {
+ suffixs: string[];
+ imagePathNoExt: string;
+}
+
+export declare interface CompressExecuteInfo {
+ busyFormatType: Partial>;
+ busyAsset: Set;
+ resolve: Function;
+ reject: Function;
+ state: 'progress' | 'success' | 'failed';
+ complete: number;
+ total: number;
+ childProcess: number;
+}
+
+export declare interface Config {
+ /**
+ * Engine features. Keys are feature IDs.
+ */
+ features: Record;
+ /**
+ * Describe how to generate the index module `'cc'`.
+ * Currently not used.
+ */
+ index?: IndexConfig;
+ moduleOverrides?: Array<{
+ test: Test;
+ overrides: Record;
+ isVirtualModule: boolean;
+ }>;
+ /**
+ * Included files for quick-compiler.
+ */
+ includes: Array;
+ /**
+ * The constants config for engine and user.
+ */
+ constants: IConstantConfig;
+ /**
+ * The decorators to be optimize when build engine.
+ */
+ optimizeDecorators: IOptimizeDecorators;
+ /**
+ * The TreeShake config
+ */
+ treeShake?: ITreeShakeConfig;
+}
+
+declare namespace ConfigInterface {
+ export {
+ Config,
+ IndexConfig,
+ Test,
+ Feature,
+ Context,
+ ConstantTypeName,
+ IConstantInfo,
+ IConstantConfig,
+ IOptimizeDecorators,
+ ITreeShakeConfig
+ }
+}
+
+export declare type ConfigType = 'options' | 'overwrite';
+
+export declare type ConstantTypeName = 'boolean' | 'number';
+
+export declare interface Context {
+ mode?: string;
+ platform?: string;
+ buildTimeConstants?: object;
+}
+
+export declare function createBuildStageTask(taskId: string, stageName: string, options: IBuildStageOptions): Promise;
+
+export declare function createBuildTask(platform: P, options?: IBuildCommandOption): Promise;
+
+export declare function createBundleBuildTask(bundleOptions: IBundleBuildOptions): Promise;
+
+export declare interface CustomBundleConfig {
+ displayName: string;
+ configs: Record;
+}
+
+export declare interface CustomBundleConfigItem {
+ preferredOptions?: {
+ isRemote: boolean;
+ compressionType: BundleCompressionType;
+ };
+ fallbackOptions?: {
+ compressionType: BundleCompressionType;
+ isRemote?: boolean;
+ };
+ overwriteSettings?: Record;
+ configMode?: 'auto' | 'fallback' | 'overwrite';
+}
+
+export declare class CustomConsole {
+ constructor(level?: LogLevel);
+ debug: (...args: any[]) => void;
+ log: (...args: any[]) => void;
+ warn: (...args: any[]) => void;
+ error: (...args: any[]) => void;
+}
+
+export declare interface CustomPluginOptions {
+ [plugin: string]: any;
+}
+
+/**
+ * 资源关联以及依赖关系列表
+ * 部分数据需要固化到硬盘上
+ */
+export declare class DataManager {
+ file: string | undefined;
+ dataMap: {
+ [uuid: string]: IData;
+ };
+ _saveTimer: any;
+ private console;
+ constructor(customConsole: CustomConsole);
+ /**
+ * 设置用于记录的 json 文件
+ * @param json
+ */
+ setRecordJSON(json: string): Promise;
+ save(): void;
+ saveImmediate(): void;
+ /**
+ * 检查资源是否有初始化过 data 数据
+ * @param asset
+ * @returns
+ */
+ has(asset: VirtualAsset): boolean;
+ /**
+ *
+ * @param asset
+ */
+ empty(asset: VirtualAsset): void;
+ /**
+ * 根据 asset 信息更新数据
+ * @param asset
+ */
+ update(asset: VirtualAsset): void;
+ /**
+ * 设置 value 内存储数据
+ * @param asset
+ */
+ setValue(asset: VirtualAsset, key: string, value: any): void;
+ /**
+ * 获取 value 内存储的某个数据
+ * @param asset
+ */
+ getValue(asset: VirtualAsset, key: string): any;
+ /**
+ * 获取一个 data 信息
+ * @param uuid
+ * @param source
+ * @returns
+ */
+ get(asset: VirtualAsset, key?: keyof IData): null | any;
+}
+
+export declare type DecodedSourceMapOrMissing =
+ | {
+ mappings?: never;
+ missing: true;
+ plugin: string;
+ }
+ | ExistingDecodedSourceMap;
+
+export declare function defineConfig(options: RollupOptions): RollupOptions;
+
+export declare function defineConfig(options: RollupOptions[]): RollupOptions[];
+
+/**
+ * 资源关联以及依赖关系列表,主要影响导入队列以及是否需要重新导入
+ * 部分数据需要固化到硬盘上
+ */
+export declare class DependencyManager {
+ static version: string;
+ file?: string;
+ pathRoot: string;
+ dependMap: DependMap;
+ _saveTimer: any;
+ private console;
+ constructor(customConsole: CustomConsole, pathRoot: string);
+ /**
+ * 设置用于记录的 json 文件
+ * @param json
+ */
+ setRecordJSON(path: string): Promise;
+ private _restoreCache;
+ private readRecordJSON;
+ save(): void;
+ saveImmediate(): void;
+ /**
+ * 记录一个资源依赖的所有资源列表
+ * 允许传入 url、uuid、path 三种依赖的格式
+ * @param path
+ * @param dependNames
+ */
+ add(type: string, key: string, depends: string | string[]): void;
+ /**
+ * 清空一个资源的依赖记录
+ * @param name
+ */
+ remove(type: string, key: string): void;
+ /**
+ * 销毁一个依赖管理器实例
+ * @param manager
+ */
+ destroy(): void;
+}
+
+export declare interface DependMap {
+ path: {
+ [path: string]: string[];
+ };
+ uuid: {
+ [uuid: string]: string[];
+ };
+}
+
+/** 文件夹资源的 userData */
+export declare interface DirectoryAssetUserData {
+ /** 是否是资源包 */
+ isBundle?: boolean;
+ /** 资源包配置 ID */
+ bundleConfigID?: string;
+ /** 资源包名称 */
+ bundleName?: string;
+ /** 优先级 */
+ priority?: number;
+}
+
+/** Effect 着色器资源的 userData */
+export declare interface EffectAssetUserData {
+ /** 预编译组合 */
+ combinations?: any;
+ /** 编辑器相关数据 */
+ editor?: any;
+}
+
+export declare type EmitAsset = (name: string, source?: string | Uint8Array) => string;
+
+export declare type EmitChunk = (id: string, options?: { name?: string }) => string;
+
+export declare type EmitFile = (emittedFile: EmittedFile) => string;
+
+export declare interface EmittedAsset {
+ fileName?: string;
+ name?: string;
+ source?: string | Uint8Array;
+ type: 'asset';
+}
+
+export declare interface EmittedChunk {
+ fileName?: string;
+ id: string;
+ implicitlyLoadedAfterOneOf?: string[];
+ importer?: string;
+ name?: string;
+ preserveSignature?: PreserveEntrySignaturesOption;
+ type: 'chunk';
+}
+
+export declare type EmittedFile = EmittedAsset | EmittedChunk;
+
+export declare interface EngineInfo {
+ typescript: {
+ type: 'builtin' | 'custom'; // 当前使用的引擎类型(内置或自定义)
+ builtin: string, // 内置引擎地址
+ path: string; // 当前使用的 ts 引擎路径
+ },
+ native: {
+ type: 'builtin' | 'custom'; // 当前使用的引擎类型(内置或自定义)
+ builtin: string, // 内置引擎地址
+ path: string; // 当前使用的原生引擎路径
+ },
+ tmpDir: string;
+ version: string;
+}
+
+/**
+ * 枚举选项,可以是字符串值或带标签的值
+ */
+export declare type EnumItem = string | {
+ /** 选项显示的标签,支持 i18n:xxx */
+ label: string;
+ /** 选项的值 */
+ value: string | number;
+};
+
+export declare function executeBuildStageTask(taskId: string, stageName: string, options: IBuildStageOptions): Promise;
+
+export declare interface ExecuteHookTaskOption {
+ pkgName: string;
+ hook: string;
+ options: IBuildOptionBase;
+ [x: string]: any;
+}
+
+export declare interface ExistingDecodedSourceMap {
+ file?: string;
+ mappings: SourceMapSegment[][];
+ names: string[];
+ sourceRoot?: string;
+ sources: string[];
+ sourcesContent?: string[];
+ version: number;
+}
+
+export declare interface ExistingRawSourceMap {
+ file?: string;
+ mappings: string;
+ names: string[];
+ sourceRoot?: string;
+ sources: string[];
+ sourcesContent?: string[];
+ version: number;
+}
+
+export declare type ExternalOption =
+ | (string | RegExp)[]
+ | string
+ | RegExp
+ | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | void);
+
+/**
+ * An engine feature.
+ */
+export declare interface Feature {
+ /**
+ * Modules to be included in this feature in their IDs.
+ * The ID of a module is its relative path(no extension) under /exports/.
+ */
+ modules: string[];
+ /**
+ * Flags to set when this feature is enabled.
+ */
+ intrinsicFlags?: Record;
+ /**
+ * Constants to override when this feature is enabled.
+ * The overridden constants should be defined in cc.config.json.
+ */
+ overrideConstants?: Record;
+ /**
+ * List of uuid that the feature depends on.
+ */
+ dependentAssets?: string[];
+ /**
+ * List of script uuid that the feature depends on.
+ */
+ dependentScripts?: string[];
+ /**
+ * List of module that the feature depends on.
+ */
+ dependentModules?: string[];
+ /**
+ * Whether it is a native only feature, default is false.
+ * @default false
+ */
+ isNativeOnly?: boolean;
+}
+
+export declare interface fileMap {
+ src: string;
+ dest: string;
+}
+
+export declare type Filter = 'none' | 'nearest' | 'linear';
+
+export declare type FirstPluginHooks =
+ | 'load'
+ | 'renderDynamicImport'
+ | 'resolveAssetUrl'
+ | 'resolveDynamicImport'
+ | 'resolveFileUrl'
+ | 'resolveId'
+ | 'resolveImportMeta'
+ | 'shouldTransformCachedModule';
+
+export declare interface FntData {
+ commonHeight?: number;
+ fontSize?: number;
+ atlasName?: string;
+ fontDefDictionary?: FontDefDictionary;
+ kerningDict?: KerningDict;
+}
+
+export declare interface FontDef {
+ rect: {
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+ };
+ xOffset: number;
+ yOffset: number;
+ xAdvance: number;
+}
+
+export declare interface FontDefDictionary {
+ [charId: number]: FontDef;
+}
+
+export declare interface FunctionPluginHooks {
+ augmentChunkHash: (this: PluginContext, chunk: PreRenderedChunk) => string | void;
+ buildEnd: (this: PluginContext, err?: Error) => void;
+ buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
+ closeBundle: (this: PluginContext) => void;
+ closeWatcher: (this: PluginContext) => void;
+ generateBundle: (
+ this: PluginContext,
+ options: NormalizedOutputOptions,
+ bundle: OutputBundle,
+ isWrite: boolean
+ ) => void;
+ load: LoadHook;
+ moduleParsed: ModuleParsedHook;
+ options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | null | void;
+ outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | null | void;
+ renderChunk: RenderChunkHook;
+ renderDynamicImport: (
+ this: PluginContext,
+ options: {
+ customResolution: string | null;
+ format: InternalModuleFormat;
+ moduleId: string;
+ targetModuleId: string | null;
+ }
+ ) => { left: string; right: string } | null | void;
+ renderError: (this: PluginContext, err?: Error) => void;
+ renderStart: (
+ this: PluginContext,
+ outputOptions: NormalizedOutputOptions,
+ inputOptions: NormalizedInputOptions
+ ) => void;
+ /** @deprecated Use `resolveFileUrl` instead */
+ resolveAssetUrl: ResolveAssetUrlHook;
+ resolveDynamicImport: ResolveDynamicImportHook;
+ resolveFileUrl: ResolveFileUrlHook;
+ resolveId: ResolveIdHook;
+ resolveImportMeta: ResolveImportMetaHook;
+ shouldTransformCachedModule: ShouldTransformCachedModuleHook;
+ transform: TransformHook;
+ watchChange: WatchChangeHook;
+ writeBundle: (
+ this: PluginContext,
+ options: NormalizedOutputOptions,
+ bundle: OutputBundle
+ ) => void;
+}
+
+export declare interface GeneratedCodeOptions extends Partial {
+ preset?: GeneratedCodePreset;
+}
+
+export declare type GeneratedCodePreset = 'es5' | 'es2015';
+
+export declare type GetInterop = (id: string | null) => InteropType;
+
+export declare type GetManualChunk = (id: string, api: GetManualChunkApi) => string | null | void;
+
+export declare interface GetManualChunkApi {
+ getModuleIds: () => IterableIterator;
+ getModuleInfo: GetModuleInfo;
+}
+
+export declare type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
+
+export declare function getPreviewSettings(options?: IBuildTaskOption
): Promise;
+
+export declare type GlobalsOption = { [name: string]: string } | ((name: string) => string);
+
+/** glTF 动画资源的 userData */
+export declare interface GltfAnimationAssetUserData {
+ gltfIndex: number;
+ events: Array<{
+ frame: number;
+ func: string;
+ params: string[];
+ }>;
+ editorExtras?: unknown;
+ embeddedPlayers?: Array<{
+ editorExtras?: unknown;
+ begin: number;
+ end: number;
+ reconciledSpeed: boolean;
+ playable:
+ | {
+ type: 'animation-clip';
+ path: string;
+ clip: string;
+ }
+ | {
+ type: 'particle-system';
+ path: string;
+ };
+ }>;
+ auxiliaryCurves?: Record;
+ wrapMode: number;
+ speed?: number;
+ sample?: number;
+ span?: {
+ from: number;
+ to: number;
+ };
+ additive?: any;
+}
+
+/** glTF 嵌入图片子资源的 userData */
+export declare interface GltfEmbededImageAssetUserData extends IVirtualAssetUserData {
+ /** 是否修复 Alpha 透明度瑕疵 */
+ fixAlphaTransparencyArtifacts?: boolean;
+}
+
+export declare type GltfpackOptions = Record;
+
+/** glTF Skeleton 子资源的 userData */
+export declare interface GltfSkeletonAssetUserData extends IVirtualAssetUserData {
+ /** 骨骼数量 */
+ jointsLength?: number;
+}
+
+export declare interface GlTFUserData {
+ assetFinder?: SerializedAssetFinder;
+
+ imageMetas: ImageMeta[];
+
+ // Normal import settings
+ // @default required
+ normals?: NormalImportSetting;
+
+ // Tangent import settings;
+ // @default required
+ tangents?: TangentImportSetting;
+
+ /**
+ * Controls how to import morph normals.
+ * @default Exclude.
+ */
+ morphNormals?: NormalImportSetting.exclude | NormalImportSetting.optional;
+
+ // Whether to extract material assets out of embedded (sub)assets,
+ // so that the assets become editable.
+ // @default false
+ dumpMaterials?: boolean;
+
+ // only for chat avatar
+ redirectMaterialMap?: Record;
+
+ // The directory to dump the materials.
+ // Default to a direct sub-folder prefixed with 'Materials_' under current path.
+ materialDumpDir?: string;
+
+ /**
+ * Whether to use vertex colors(if valid) in material.
+ * @default false
+ */
+ useVertexColors?: boolean;
+
+ /**
+ * Whether to enable depth-write if the material specify the `BLEND` mode.
+ * See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#alpha-coverage
+ * @default false
+ */
+ depthWriteInAlphaModeBlend?: boolean;
+
+ // @default true
+ skipValidation?: boolean;
+
+ /**
+ * 整个数组由导入器创建。`name` 和 `duration` 也都由导入器写入修改,外部不允许修改。
+ * `splits` 是允许用户配置的。
+ */
+ animationImportSettings?: AnimationImportSetting[];
+
+ /**
+ * 是否将所有动画挂载到生成的预制体上。
+ * @default false
+ */
+ mountAllAnimationsOnPrefab?: boolean;
+
+ /**
+ * 使用旧的 FBX 导入器。(在非 FBX 导入器上是 `undefined`)
+ */
+ legacyFbxImporter?: boolean;
+
+ /**
+ * 禁用 Mesh 分割,默认勾选
+ */
+ disableMeshSplit?: boolean;
+
+ /**
+ * 允许数据访问。
+ */
+ allowMeshDataAccess?: boolean;
+
+ /**
+ * 是否添加填充顶点色
+ * @default false
+ */
+ addVertexColor?: boolean;
+
+ /**
+ * 若开启并且模型场景顶部仅有一个节点,那么以该节点作为根节点转换为 Prefab。
+ * 否则,以场景为根节点转换为 Prefab。见 cocos/cocos-engine#11858 。
+ */
+ promoteSingleRootNode?: boolean;
+ /*
+ * 若开启则自动生成 Lightmap UV,并将 UV 写入第二个通道(若第二个通道有 UV , 则该 UV 会被覆盖)
+ * 否则,使用默认 UV 。
+ */
+ generateLightmapUVNode?: boolean;
+
+ /**
+ * 关于 FBX 的配置。仅当 `legacyFbxImporter === false` 时有效。
+ */
+ fbx?: IFbxSetting;
+
+ /**
+ * 减面配置
+ */
+ meshOptimizer?: MeshOptimizerOption;
+
+ /**
+ * mesh 优化配置
+ */
+ meshOptimize?: MeshOptimizeOptions;
+
+ /**
+ * 是否开启 mesh 减面
+ */
+ meshSimplify?: MeshSimplifyOptions;
+
+ /**
+ * MeshCluster Options
+ */
+ meshCluster?: MeshClusterOptions;
+
+ /**
+ * Mesh compression options
+ */
+ meshCompress?: MeshCompressOptions;
+
+ lods?: {
+ // 是否开启 LODS
+ enable: boolean;
+ // fbx 是否自带 LOD
+ hasBuiltinLOD: boolean;
+ // fbx 各层级 lod 的配置
+ options: LODsOption[];
+ };
+}
+
+export declare type HasModuleSideEffects = (id: string, external: boolean) => boolean;
+
+export declare type IAsset = VirtualAsset | Asset;
+
+export declare interface IAssetGroupItem {
+ baseUrls: string[];
+ scriptDest: string;
+ scriptUuids: UUID[];
+ assetUuids: UUID[];
+}
+
+export declare type IAssetGroupMap = Record;
+
+export declare interface IAssetGroupOptions {
+ scriptUrl: string;
+ baseUrl: string;
+}
+
+export declare interface IAssetInfo extends IAssetInfo_2 {
+ temp?: string;
+ dirty?: boolean;
+ meta: IAssetMeta;
+ subAssets: Record;
+ mtime: number;
+}
+
+export declare interface IAssetInfo_2 {
+ name: string; // 资源名字
+ source: string; // url 地址
+ loadUrl: string; // loader 加载的层级地址
+ url: string; // loader 加载地址会去掉扩展名,这个参数不去掉
+ file: string; // 绝对路径
+ uuid: string; // 资源的唯一 ID
+ importer: AssetHandlerType; // 使用的导入器名字
+ imported: boolean; // 是否结束导入过程
+ invalid: boolean; // 是否导入成功
+ type: IAssetType; // 类型
+ isDirectory: boolean; // 是否是文件夹
+ library: { [key: string]: string }; // 导入资源的 map
+
+ // dataKeys 作用范围
+ isBundle?: boolean; // 是否是文件夹
+ displayName?: string; // 资源用于显示的名字
+ readonly?: boolean; // 是否只读
+ visible?: boolean; // 是否显示
+ subAssets?: { [key: string]: IAssetInfo_2 }; // 子资源 map
+ // 虚拟资源可以实例化成实体的话,会带上这个扩展名
+ instantiation?: string;
+ redirect?: IRedirectInfo; // 跳转指向资源
+ meta?: IAssetMeta,
+ parent?: {
+ source: string;
+ library: { [key: string]: string };
+ uuid: string;
+ };
+ extends?: string[]; // 资源的继承链信息
+ mtime?: number; // 资源文件的 mtime
+ depends?: string[]; // 依赖的资源 uuid 信息
+ dependeds?: string[]; // 被依赖的资源 uuid 信息
+ temp?: string; // 资源临时文件目录
+}
+
+export declare type IAssetInfoMap = Record;
+
+export declare interface IAssetMeta {
+ ver: string;
+ importer: AssetHandlerType;
+ imported: boolean;
+ uuid: string;
+ files: string[];
+ subMetas: {
+ [index: string]: IAssetMeta<'unknown'>;
+ };
+ userData: AssetUserDataMap[T extends keyof AssetUserDataMap ? T : 'unknown'];
+ displayName?: string;
+ id?: string;
+ name?: string;
+}
+
+export declare interface IAssetPathBase {
+ bundleName?: string;
+ redirect?: string;
+}
+
+export declare interface IAssetPathInfo extends IAssetPathBase {
+ raw?: string[];
+ import?: string;
+ /**
+ * @deprecated please use `import` instead
+ */
+ json?: string;
+ /**
+ * @deprecated please use `import` instead
+ */
+ bin?: string;
+ groupIndex?: number;
+}
+
+export declare type IAssetType =
+| ISupportCreateCCType
+| 'cc.Asset' // 基础资源类型(instantiation-asset)
+| 'cce.Database' // 数据库资源
+| 'cce.EffectHeader' // 着色器头文件
+| 'cc.VideoClip' // 视频剪辑
+| 'cc.TiledMapAsset' // 瓦片地图
+| 'cc.TTFFont' // TTF 字体
+| 'cc.Texture2D' // 2D 纹理
+| 'cc.SpriteFrame' // 精灵帧(sprite-frame、rt-sprite-frame)
+| 'cc.ImageAsset' // 图片资源(image、gltf/image、image/alpha、image/sign、texture-cube-face)
+| 'cc.TextAsset' // 文本资源
+| 'cc.JsonAsset' // JSON 资源
+| 'cc.AudioClip' // 音频剪辑
+| 'cc.BitmapFont' // 位图字体
+| 'cc.BufferAsset' // 缓冲区资源
+| 'cc.ParticleAsset' // 粒子资源
+| 'cc.RenderPipeline' // 渲染管线
+| 'cc.Skeleton' // 骨骼(gltf/skeleton、instantiation-asset/skeleton)
+| 'cc.Mesh' // 网格(gltf/mesh、instantiation-asset/mesh)
+| 'sp.SkeletonData' // Spine 骨骼数据
+| 'dragonBones.DragonBonesAsset' // DragonBones 资源
+| 'dragonBones.DragonBonesAtlasAsset' // DragonBones 图集资源
+| 'RenderStage' // 渲染阶段
+| 'RenderFlow';
+
+export declare type IASTCQuality = 'veryfast' | 'fast' | 'medium' | 'thorough' | 'exhaustive';
+
+export declare interface IAtlasInfo {
+ spriteFrameInfos: ISpriteFrameInfo[];
+ width: number;
+ height: number;
+ name: string;
+ imagePath: string;
+ imageUuid: string;
+ textureUuid: string;
+ compressed: CompressedInfo;
+}
+
+export declare interface IAtlasResult {
+ assetsToImage: Record;
+ imageToAtlas: Record;
+ atlasToImages: Record;
+}
+
+export declare interface IAutoAtlasUserData {
+ name: string;
+ bleed: number | boolean;
+ width: number;
+ height: number;
+ removeTextureInBundle: boolean;
+ removeImageInBundle: boolean;
+ removeSpriteAtlasInBundle: boolean;
+ filterUnused: boolean;
+}
+
+export declare type IBaseHooks = (options: IBuildOptionBase, result: IBuildResult) => Promise | void;
+
+export declare interface IBinGroupConfig {
+ enable: boolean;
+ threshold: number;
+}
+
+export declare interface IBuildAssetHandlerInfo {
+ pkgNameOrder: string[];
+ handles: {
+ [pkgName: string]: Function;
+ };
+}
+
+export declare interface IBuildCacheUseConfig {
+ serializeData?: boolean;
+ engine?: boolean;
+ textureCompress?: boolean;
+ autoAtlas?: boolean;
+}
+
+export declare interface IBuildCommandOption extends Partial {
+ configPath?: string;
+ migrate?: boolean;
+ skipCheck?: boolean;
+}
+
+export declare interface IBuildCommonOptions {
+ /**
+ * 构建任务 id
+ */
+ taskId?: string;
+ /**
+ * 构建任务名称,用于日志表示提示,默认为 outputName 字段值
+ */
+ taskName?: string;
+ /**
+ * 指定的构建日志输出地址
+ */
+ logDest?: string;
+ /**
+ * 游戏名称, 默认为项目名称
+ */
+ name: string;
+ /**
+ * 构建输出名称,默认为平台名称
+ */
+ outputName: string;
+ /**
+ * 构建后的游戏生成文件夹
+ */
+ buildPath: string;
+ /**
+ * 构建平台
+ * @default 'web-mobile'
+ */
+ platform: Platform | string;
+ /**
+ * 构建场景列表,默认为全部场景
+ */
+ scenes?: IBuildSceneItem[];
+ /**
+ * 是否跳过纹理压缩
+ * @default false
+ */
+ skipCompressTexture: boolean;
+ /**
+ * 是否自动合图
+ * @default true
+ */
+ packAutoAtlas: boolean;
+ /**
+ * 是否生成 sourceMap
+ * @default false
+ * @description 将已转换的代码映射到源码,以便可以直接查看和调试源码,定位问题。
【关闭】: 关闭 source map 的生成。这在生产环境中用于减少开发时的资源消耗和提高性能,但会牺牲代码可维护性和调试能力。
【启用(内联)】: 选择此选项时,source map 信息将作为数据 URI 内联在生成的代码中,通常作为注释。这可以减少 HTTP 请求,但可能会增加生成文件的大小。
【启用 (独立文件)】: 当用户选择此选项时,将会为转换后的代码生成一个源代码与转换代码之间的映射文件,该文件是独立的,并与主文件分开存储。这有助于在开发工具中跟踪源代码。
+ */
+ sourceMaps: boolean | 'inline';
+ /**
+ * 是否使用实验性 eraseModules
+ * @default false
+ */
+ experimentalEraseModules: boolean;
+ /**
+ * 在 Bundle 中嵌入公共脚本
+ * @description 在 Bundle 中包含所有依赖的公共脚本,确保 Bundle 可以被跨项目单独加载。此选项仅在只构建 Bundle 时生效,正常构建时将默认禁用。
+ * 【未勾选时】在构建 Bundle 时,会将不同 Bundle 之间公用的一些 helper 之类的内容生成在 src/chunk 内的 bundle.js 内,减少整体脚本的体积。但这样构建出来的 Bundle 是和项目相耦合的,无法跨项目复用。
+ * 【勾选时】不再提取 Bundle 依赖的公共 JS 库内而是直接构建在 Bundle 的内部。这样的 Bundle 可以跨项目使用(因为所需的脚本都在 Bundle 的内部,而引用相同代码的 Bundle 可能会有重复的部分),缺陷是由于脚本资源都在 Bundle 内部,因此最终的 Bundle 体积会增大。
+ */
+ bundleCommonChunk: boolean;
+ /**
+ * 设置打开游戏后进入的第一个场景,db url 格式
+ * @default 默认为场景列表的第一个场景
+ */
+ startScene: string;
+ /**
+ * 是否是调试模式
+ * @default false
+ */
+ debug: boolean;
+ mangleProperties: boolean;
+ inlineEnum: boolean;
+ /**
+ * MD5 缓存
+ * @default false
+ * @description 给构建后的所有资源文件名将加上 MD5 信息,解决 CDN 资源缓存问题
+ */
+ md5Cache: boolean;
+ /**
+ * JavaScript Polyfills
+ * @description 实现运行环境并不支持的 JavaScript 标准库
+ */
+ polyfills?: IPolyFills;
+ buildScriptTargets?: string;
+ mainBundleCompressionType: BundleCompressionType;
+ mainBundleIsRemote: boolean;
+ server?: string;
+ startSceneAssetBundle: boolean;
+ bundleCommonJs?: string;
+ binGroupConfig?: IBinGroupConfig;
+ moveRemoteBundleScript: boolean;
+ useSplashScreen?: boolean;
+ /**
+ * 是否是预览进程发送的构建请求。
+ * @default false
+ */
+ preview?: boolean;
+ stage?: string;
+ buildMode?: 'normal' | 'bundle' | 'script';
+ nextStages?: string[];
+ packages: Record;
+ nativeCodeBundleMode: 'wasm' | 'asmjs' | 'both';
+ wasmCompressionMode?: 'brotli';
+ buildBundleOnly?: boolean;
+ bundleConfigs?: IBundleOptions[];
+ /**
+ * @deprecated please use engineModulesConfigKey
+ */
+ overwriteProjectSettings?: {
+ macroConfig?: {
+ cleanupImageCache: string;
+ };
+ includeModules?: {
+ physics?: 'inherit-project-setting' | string;
+ 'physics-2d'?: 'inherit-project-setting' | string;
+ 'gfx-webgl2'?: 'inherit-project-setting' | 'on' | 'off';
+ [key: string]: string | undefined;
+ };
+ };
+}
+
+export declare interface IBuildEngineParam {
+ entry: string;
+ debug: boolean;
+ mangleProperties: boolean;
+ sourceMaps: boolean | 'inline';
+ /**
+ * @deprecated please use `platformType` instead
+ */
+ platform?: PlatformType_2;
+ platformType: PlatformType_2;
+ includeModules: string[];
+ engineVersion: string;
+ md5Map: string[];
+ engineName: string;
+ useCache: boolean;
+ split?: boolean;
+ separateEngineOptions?: Pick & {
+ checkVersionValid?: boolean;
+ };
+ targets?: ITransformTarget;
+ skip?: boolean;
+ nativeCodeBundleMode: 'wasm' | 'asmjs' | 'both';
+ assetURLFormat?: 'relative-from-out' | 'relative-from-chunk' | 'runtime-resolved';
+ baseUrl?: string;
+ flags?: Record;
+ output: string;
+ preserveType?: boolean;
+ wasmCompressionMode?: 'brotli';
+ enableNamedRegisterForSystemJSModuleFormat?: boolean;
+ inlineEnum?: boolean;
+ loose?: boolean;
+}
+
+export declare interface IBuilder {
+ cache: BuilderCache;
+ result: InternalBuildResult;
+ options: IInternalBuildOptions;
+ bundleManager: IBundleManager;
+ hooksInfo: IBuildHooksInfo;
+ buildTemplate: IBuildTemplate;
+ buildExitRes: IBuildResultSuccess;
+ id: string;
+ utils: IBuildUtils;
+ updateProcess(message: string, increment?: number): void;
+ break(reason: string): void;
+}
+
+export declare type IBuilderConfigItem = IConfigItem & {
+ experiment?: boolean;
+ hidden?: boolean;
+ verifyRules?: string[];
+ verifyLevel?: IConsoleType;
+};
+
+export declare type IBuilderRegisterInfo = IPlatformRegisterInfo | IPluginRegisterInfo;
+
+export declare interface IBuildHooksInfo {
+ pkgNameOrder: string[];
+ infos: Record;
+}
+
+export declare type IBuildIconItem = IconConfigWithHook;
+
+export declare interface IBuildManager {
+ taskManager: any;
+ currentCompileTask: any;
+ currentBuildTask: any;
+ __taskId: string;
+}
+
+export declare interface IBuildOptionBase extends IBuildCommonOptions, OverwriteProjectSettings {
+ engineModulesConfigKey?: string;
+ useCacheConfig?: IBuildCacheUseConfig;
+ taskName: string;
+}
+
+export declare interface IBuildPacResult {
+ spriteToImage: Record;
+ textureToImage: Record;
+ imageToPac: Record;
+}
+
+export declare interface IBuildPacResult_2 {
+ spriteToImage: Record;
+ textureToImage: Record;
+ imageToPac: Record;
+}
+
+export declare interface IBuildPanel {
+ Vue: any;
+ validator: {
+ has: (ruleName: string) => boolean;
+ checkRuleWithMessage: (ruleName: ICheckRule, val: any, ...arg: any[]) => Promise;
+ check: (ruleName: ICheckRule, val: any, ...arg: any[]) => Promise;
+ checkWithInternalRule: (ruleName: ICheckRule, val: any, ...arg: any[]) => boolean;
+ queryRuleMessage: (ruleName: ICheckRule) => string;
+ };
+}
+
+export declare interface IBuildPaths {
+ dir: string;
+ readonly output: string;
+ effectBin?: string;
+ settings: string;
+ systemJs?: string;
+ engineDir?: string;
+ polyfillsJs?: string;
+ assets: string;
+ subpackages: string;
+ remote: string;
+ bundleScripts: string;
+ applicationJS: string;
+ compileConfig: string;
+ importMap: string;
+ engineMeta: string;
+ tempDir: string;
+ plugins: Record;
+ hashedMap: Record;
+ projectRoot: string;
+}
+
+export declare interface IBuildPlugin {
+ configs?: BuildPlugin.Configs;
+ assetHandlers?: BuildPlugin.AssetHandlers;
+ load?: BuildPlugin.load;
+ unload?: BuildPlugin.Unload;
+}
+
+export declare interface IBuildPluginConfig {
+ doc?: string;
+ hooks?: string;
+ panel?: string;
+ options?: IDisplayOptions;
+ verifyRuleMap?: IVerificationRuleMap;
+}
+
+export declare interface IBuildPluginProfile {
+ builder?: {
+ common?: Record;
+ options?: Record>;
+ taskOptionsMap?: Record;
+ };
+ __version__: string;
+ common?: Record;
+ options?: Record>;
+}
+
+export declare interface IBuildProcessInfo {
+ state: ITaskState;
+ progress: number;
+ message: string;
+ id: string;
+ options: any;
+}
+
+export declare class IBuildResult {
+ dest: string;
+ paths: IBuildPaths;
+ settings?: ISettings;
+ /**
+ * 指定的 uuid 资源是否包含在构建资源中
+ */
+ containsAsset: (uuid: string) => boolean;
+ /**
+ * 获取指定 uuid 原始资源的存放路径(不包括序列化 json)
+ * 自动图集的小图 uuid 和自动图集的 uuid 都将会查询到合图大图的生成路径
+ * 实际返回多个路径的情况:查询 uuid 为自动图集资源,且对应图集生成多张大图,纹理压缩会有多个图片格式路径
+ */
+ getRawAssetPaths: (uuid: string) => IRawAssetPathInfo[];
+ /**
+ * @deprecated please use getImportAssetPaths instead
+ * 获取指定 uuid 资源的序列化 json 路径信息
+ */
+ getJsonPathInfo: (uuid: string) => IImportAssetPathInfo[];
+ getImportAssetPaths: (uuid: string) => IImportAssetPathInfo[];
+ /**
+ * 获取指定 uuid 资源的路径相关信息
+ * @return Array<{raw?: string | string[]; import?: string; groupIndex?: number;}>
+ * @return.raw: 该资源源文件的实际存储位置,存在多个为数组,不存在则为空
+ * @return.import: 该资源序列化数据的实际存储位置,不存在为空,可能是 .bin 或者 .json 格式
+ * @return.groupIndex: 若该资源的序列化数据在某个分组内,这里标识在分组内的 index,不存在为空
+ */
+ getAssetPathInfo: (uuid: string) => IAssetPathInfo[];
+}
+
+export declare type IBuildResultData = IBuildResultSuccess | IBuildResultFailed;
+
+export declare interface IBuildResultFailed {
+ code: Exclude;
+ reason?: string;
+}
+
+export declare interface IBuildResultSuccess {
+ code: BuildExitCode.BUILD_SUCCESS;
+ dest: string;
+ custom: Record;
+}
+
+/**
+ * 构建使用的场景的数据
+ */
+export declare interface IBuildSceneItem {
+ url: string;
+ uuid: string;
+}
+
+export declare interface IBuildScriptParam {
+ /**
+ * 若存在,表示将 import map 转换为指定的模块格式。
+ */
+ importMapFormat?: 'commonjs' | 'esm';
+ polyfills?: IPolyFills;
+ /**
+ * 擦除模块结构。当选择后会获得更快的脚本导入速度,但无法再使用模块特性,如 `import.meta`、`import()` 等。
+ * @experimental
+ */
+ experimentalEraseModules?: boolean;
+ outputName: string;
+ targets?: ITransformTarget;
+ system?: {
+ preset?: 'web' | 'commonjs-like';
+ };
+ flags: Record;
+ platform: PlatformType_2;
+ /**
+ * 是否开启模块热重载
+ * @default false
+ */
+ hotModuleReload?: boolean;
+ commonDir: string;
+ bundleCommonChunk: boolean;
+}
+
+export declare type IBuildSeparateEngineCacheOptions = Pick & {
+ engineFeatureQuery?: IEngineFeatureQuery;
+};
+
+/**
+ * 引擎分离编译后,默认会生成一份包含全部引擎散文件的目录结构,默认名称为 cocos-js-all
+ */
+export declare type IBuildSeparateEngineOptions = Pick & {
+ pluginFeatures?: string[] | 'default' | 'all';
+ engine: string;
+ platform: string;
+ importMapOutFile: string;
+ outputLocalPlugin?: boolean;
+ pluginName: string;
+ useCacheForce?: boolean;
+ signatureProvider?: string;
+};
+
+export declare interface IBuildSeparateEngineResult {
+ paths: IEngineCachePaths;
+ importMap: Record;
+}
+
+export declare type IBuildStage = 'build' | 'bundle' | 'make' | 'run' | string;
+
+export declare interface IBuildStageConfig extends IBuildStageItem {
+ root: string;
+ hooksInfo: IBuildHooksInfo;
+ buildTaskOptions: IBuildOptionBase;
+}
+
+export declare type IBuildStageHooks = (root: string, options: IBuildOptionBase) => Promise | void;
+
+export declare interface IBuildStageItem {
+ name: string;
+ displayName?: string;
+ description?: string;
+ hidden?: boolean;
+ parallelism?: 'none' | 'all' | 'other';
+ hook: string;
+ requiredBuildOptions?: boolean;
+}
+
+export declare interface IBuildStageOptions {
+ dest: string;
+ platform: Platform | string;
+ taskName?: string;
+}
+
+export declare interface IBuildStagesInfo {
+ pkgNameOrder: string[];
+ infos: Record;
+}
+
+export declare interface IBuildStageTask {
+ buildExitRes: IBuildResultSuccess;
+ options: IBuildOptionBase;
+ buildTaskOptions?: IBuildOptionBase;
+ run(): Promise;
+ saveOptions(): Promise;
+}
+
+export declare interface IBuildSystemJsOption {
+ dest: string;
+ platform: string;
+ debug: boolean;
+ sourceMaps: boolean | 'inline';
+ hotModuleReload?: boolean;
+}
+
+export declare interface IBuildTask {
+ handle: (options: IInternalBuildOptions, result: InternalBuildResult, cache: BuilderCache, settings?: ISettings) => {};
+ title: string;
+ name: string;
+}
+
+export declare interface IBuildTaskItemJSON extends ITaskItemJSON {
+ stage: 'build' | string;
+ options: IBuildOptionBase;
+ dirty: boolean;
+ rawOptions?: IBuildOptionBase;
+ type: 'build';
+}
+
+/**
+ * 构建所需的完整参数
+ */
+export declare interface IBuildTaskOption extends IBuildOptionBase {
+ platform: P;
+ packages: Record
;
+}
+
+export declare interface IBuildTemplate {
+ query(name: string): string | null;
+ initUrl(relativeUrl: string, name?: string): string | undefined;
+ copyTo(dest: string): Promise;
+ findFile(dest: string): string | undefined;
+ isEnable: boolean;
+}
+
+export declare type IBuildTimeConstantValue = StatsQuery.ConstantManager.ValueType;
+
+export declare interface IBuildUtils {
+ /**
+ * 检查是否全局安装了 nodejs
+ */
+ isInstallNodeJs: () => Promise;
+ /**
+ * 获取相对路径接口
+ * 返回 / 拼接的相对路径
+ */
+ relativeUrl: (from: string, to: string) => string;
+ transformCode: (code: string, options: ITransformOptions) => Promise;
+ resolveToRaw: (path: string) => string;
+}
+
+export declare type IBuildVerificationFunc = (value: any, options: IBuildOptionBase) => boolean | Promise;
+
+export declare interface IBuildWorker {
+ Ipc: {
+ send: (message: string, ...args: any[]) => void;
+ on: (message: string, callbask: (event: any, ...arg: any[]) => Promise) => void;
+ };
+}
+
+export declare interface IBuildWorkerPluginInfo {
+ assetHandlers?: string;
+ hooks?: Record;
+ pkgName: string;
+ internal: boolean;
+ priority: number;
+ customBuildStages?: {
+ [platform: string]: IBuildStageItem[];
+ };
+ buildTemplate?: BuildTemplateConfig;
+ customIconConfigs?: {
+ [platform: string]: IBuildIconItem[];
+ };
+}
+
+export declare interface IBundle {
+ readonly scenes: IBuildSceneItem[];
+ readonly assets: UUID[];
+ readonly assetsWithoutRedirect: UUID[];
+ readonly scripts: UUID[];
+ readonly rootAssets: UUID[];
+ readonly isSubpackage: boolean;
+ root: string;
+ dest: string;
+ importBase: string;
+ nativeBase: string;
+ scriptDest: string;
+ name: string;
+ priority: number;
+ compressionType: BundleCompressionType;
+ assetVer: IVersionMap;
+ version: string;
+ readonly isRemote: boolean;
+ redirect: Record;
+ deps: Set;
+ groups: IGroup[];
+ configOutPutName: string;
+ config: IBundleConfig;
+ readonly isZip: boolean;
+ zipVer: string;
+ compressRes: Record;
+ atlasRes: IAtlasResult;
+ compressTask: Record;
+ _rootAssets: Set;
+ _scenes: Record;
+ _scripts: Set;
+ _assets: Set;
+ output: boolean;
+ md5Cache: boolean;
+ debug: boolean;
+ paths: Record;
+ build(): void;
+ initConfig(): void;
+ initAssetPaths(): Promise;
+ /**
+ * 添加根资源,此方法会递归添加子资源的数据支持普通资源与脚本资源
+ * @param asset
+ * @returns
+ */
+ addRootAsset(asset: IAsset): void;
+ addAsset(asset: IAsset): void;
+ /**
+ * 添加参与 Bundle 打包的脚本资源,最终输出到 index.js 内
+ * 需要提前判断脚本资源类型
+ * @param asset
+ * @returns
+ */
+ addScript(asset: IAsset): void;
+ removeAsset(asset: UUID): void;
+ addRedirect(asset: UUID, redirect: string): void;
+ addAssetWithUuid(asset: UUID): void;
+ getRedirect(uuid: UUID): string | undefined;
+ addGroup(type: IJSONGroupType, uuids: UUID[], name?: string): void;
+ addToGroup(type: IJSONGroupType, uuid: UUID): void;
+ removeFromGroups(uuid: UUID): void;
+ containsAsset(uuid: string, deep?: boolean): boolean;
+}
+
+export declare interface IBundleBuildOptions {
+ buildTaskIds?: string[];
+ taskName: string;
+ dest: string;
+ buildTaskOptions: IBuildOptionBase;
+ logDest?: string;
+}
+
+export declare interface IBundleConfig {
+ importBase: string;
+ nativeBase: string;
+ name: string;
+ deps: string[];
+ uuids: UUID[];
+ paths: Record;
+ scenes: Record;
+ packs: Record>;
+ versions: {
+ import: Array;
+ native: Array;
+ };
+ redirect: Array;
+ debug: boolean;
+ types?: string[];
+ encrypted?: boolean;
+ isZip?: boolean;
+ zipVersion?: string;
+ extensionMap: Record>;
+ /**
+ * 是否有需要预加载的脚本,默认为 `true`。
+ */
+ hasPreloadScript: boolean;
+ dependencyRelationships: Record>;
+}
+
+export declare interface IBundleInitOptions extends IBundleOptions {
+ root: string;
+ name: BuiltinBundleName | string;
+ priority: number;
+ compressionType: BundleCompressionType;
+ isRemote: boolean;
+ md5Cache: boolean;
+ debug: boolean;
+ output?: boolean;
+ dest: string;
+ scriptDest: string;
+}
+
+export declare interface IBundleInternalOptions extends IBundleOptions {
+ dest: string;
+ scriptDest: string;
+ priority: number;
+ compressionType: BundleCompressionType;
+ isRemote: boolean;
+ bundleFilterConfig?: BundleFilterConfig[];
+}
+
+export declare interface IBundleListItem {
+ name: string;
+ root: string;
+ output: boolean;
+ uuid: string;
+ missing?: boolean;
+}
+
+export declare interface IBundleManager {
+ bundleMap: Record;
+ bundles: IBundle[];
+ destDir: string;
+ scriptBuilder: ScriptBuilder;
+ packResults: IPacInfo[];
+ cache: BuilderCache;
+ hookMap: Record;
+ buildAsset(): Promise;
+ initBundle(): Promise;
+ initAsset(): Promise;
+ buildScript(): Promise;
+ outputBundle(): Promise;
+ bundleDataTask(): Promise;
+ runPluginTask(hookName: string): Promise;
+ break(reason: string): void;
+}
+
+export declare interface IBundleOptions {
+ root: string;
+ priority?: number;
+ compressionType?: BundleCompressionType;
+ isRemote?: boolean;
+ output?: boolean;
+ name: string;
+ dest?: string;
+ scriptDest?: string;
+ bundleFilterConfig?: BundleFilterConfig[];
+}
+
+export declare interface IBundleTaskItemJSON extends ITaskItemJSON {
+ options: IBundleBuildOptions;
+ type: 'bundle';
+}
+
+export declare interface IBundleTaskOption extends IBuildOptionBase {
+ dest: string;
+}
+
+export declare type ICheckRule = 'pathExist' | 'valid' | 'required' | 'normalName' | 'noChinese' | 'array' | 'string' | 'number' | 'http';
+
+export declare interface IChunkContent {
+ skeleton: null | string;
+ clips: string[];
+}
+
+export declare interface ICMakeConfig {
+ USE_AUDIO?: boolean;
+ USE_VIDEO?: boolean;
+ USE_WEBVIEW?: boolean;
+ USE_JOB_SYSTEM_TBB?: boolean;
+ USE_JOB_SYSTEM_TASKFLOW?: boolean;
+ USE_PORTRAIT?: boolean;
+ CC_USE_METAL?: boolean;
+ CC_USE_VUKAN?: boolean;
+ CC_USE_GLES3: boolean;
+ CC_USE_GLES2: boolean;
+ COCOS_X_PATH?: string;
+ APP_NAME?: string;
+ XXTEAKEY: string;
+ [propName: string]: any;
+ USE_SERVER_MODE: string;
+}
+
+export declare interface ICollisionMatrix {
+ [x: string]: number;
+}
+
+export declare interface ICollisionMatrix_2 {
+ [x: string]: number;
+}
+
+export declare interface ICommandInfo {
+ command: string;
+ params?: string[];
+ path: string;
+}
+
+export declare interface ICompressConfig {
+ src: string;
+ mipmapFiles?: string[];
+ dest: string;
+ compressOptions: Record;
+ format: ITextureCompressType;
+ customConfig?: ICustomConfig;
+ uuid: string;
+ suffix: string;
+ formatType: ITextureCompressFormatType;
+}
+
+export declare type ICompressImageResult = Record;
+
+export declare type ICompressOptions = Record;
+
+export declare interface ICompressPresetConfig {
+ name: string;
+ options: Record>;
+}
+
+export declare interface IconConfig {
+ type: 'icon' | 'image';
+ value: string;
+}
+
+export declare interface IconConfigWithHook extends ICustomBuildIconItem {
+ executeType: 'hook';
+ hook: string;
+}
+
+export declare type IConfigGroups = Record;
+
+export declare interface IConfigGroupsInfo {
+ defaultSupport?: ISupportFormat;
+ support: ISupportFormat;
+ displayName: string;
+ icon: string;
+ supportOverwrite?: boolean;
+}
+
+/**
+ * 用户数据配置项
+ * 根据 type 字段的不同,需要提供相应的必需字段:
+ * - enum: 必须提供 items
+ * - array: 必须提供 items
+ * - object: 必须提供 properties
+ * - boolean/string/number: 只需基本字段
+ */
+export declare type IConfigItem = IConfigItemString | IConfigItemNumber | IConfigItemBoolean | IConfigItemEnum | IConfigItemArray | IConfigItemObject;
+
+/**
+ * 数组类型配置项
+ */
+export declare interface IConfigItemArray extends IConfigItemBase {
+ type: 'array';
+ /** 数组项配置,定义数组中每个元素的类型和结构 */
+ items: IConfigItem | IConfigItem[];
+ /** 最小数组长度 */
+ minItems?: number;
+ /** 最大数组长度 */
+ maxItems?: number;
+ /** 默认值必须是数组 */
+ default?: any[];
+}
+
+/**
+ * 用户数据配置项的基础接口
+ */
+export declare interface IConfigItemBase {
+ /** 唯一标识符 */
+ key?: string;
+ /** 配置显示的名字,如果需要翻译,则传入 i18n:${key} */
+ label?: string;
+ /** 设置的简单说明,支持 i18n:xxx */
+ description?: string;
+ /** 默认值 */
+ default?: any;
+}
+
+/**
+ * 布尔类型配置项
+ */
+export declare interface IConfigItemBoolean extends IConfigItemBase {
+ type: 'boolean';
+ default?: boolean;
+}
+
+/**
+ * 枚举类型配置项
+ */
+export declare interface IConfigItemEnum extends IConfigItemBase {
+ type: 'enum';
+ /** 枚举选项列表,可以是字符串数组或对象数组 */
+ items: EnumItem[];
+ /** 默认值必须是 items 中的值 */
+ default?: string | number;
+}
+
+/**
+ * 数字类型配置项
+ */
+export declare interface IConfigItemNumber extends IConfigItemBase {
+ type: 'number';
+ /** 最小值 */
+ minimum?: number;
+ /** 最大值 */
+ maximum?: number;
+ /** 步长 */
+ step?: number;
+ default?: number;
+}
+
+/**
+ * 对象类型配置项
+ */
+export declare interface IConfigItemObject extends IConfigItemBase {
+ type: 'object';
+ /** 对象属性配置,定义对象中每个属性的类型和结构 */
+ properties: Record;
+ /** 必需属性列表 */
+ required?: string[];
+ /** 默认值必须是对象 */
+ default?: Record;
+}
+
+/**
+ * 字符串类型配置项
+ */
+export declare interface IConfigItemString extends IConfigItemBase {
+ type: 'string';
+ /** 最小长度 */
+ minLength?: number;
+ /** 最大长度 */
+ maxLength?: number;
+ /** 正则表达式验证 */
+ pattern?: string;
+ default?: string;
+}
+
+export declare interface IConsoleMessage {
+ type: ICustomConsoleType;
+ value: string;
+ num: number;
+ time: string;
+}
+
+export declare type IConsoleType = 'log' | 'warn' | 'error' | 'debug' | 'info' | 'success' | 'ready' | 'start';
+
+export declare interface IConstantConfig {
+ [ConstantName: string]: IConstantInfo;
+}
+
+export declare interface IConstantInfo {
+ /**
+ * The comment of the constant.
+ * Which is used to generate the consts.d.ts file.
+ */
+ readonly comment: string;
+ /**
+ * The type of the constant for generating consts.d.ts file.
+ */
+ readonly type: ConstantTypeName;
+ /**
+ * The default value of the constant.
+ * It can be a boolean, number or string.
+ * When it's a string type, the value is the result of eval().
+ */
+ value: boolean | string | number;
+ /**
+ * Whether exported to global as a `CC_XXXX` constant.
+ * eg. WECHAT is exported to global.CC_WECHAT
+ * NOTE: this is a feature of compatibility with Cocos 2.x engine.
+ * Default is false.
+ *
+ * @default false
+ */
+ ccGlobal?: boolean;
+ /**
+ * Whether exported to developer.
+ * If true, it's only exported to engine.
+ */
+ readonly internal: boolean;
+ /**
+ * Some constant can't specify the value in the Editor, Preview or Test environment,
+ * so we need to dynamically judge them in runtime.
+ * These values are specified in a helper called `helper-dynamic-constants.ts`.
+ * Default is false.
+ *
+ * @default false
+ */
+ dynamic?: boolean;
+}
+
+export declare type ICustomAssetHandlerType = 'compressTextures';
+
+export declare type ICustomBuildIconInfo = IBuildIconItem & {
+ pkgName: string;
+};
+
+export declare interface ICustomBuildIconItem extends IconConfig {
+ description?: string;
+ disabled?: (taskInfo: IBuildTaskItemJSON) => boolean | Promise;
+}
+
+export declare interface ICustomBuildScriptParam extends IBuildScriptParam {
+ experimentalHotReload: boolean;
+}
+
+export declare type ICustomBuildStageDisplayItem = IBuildStageItem & {
+ groupItems: IBuildStageItem[];
+ inGroup: boolean;
+ lock?: boolean;
+};
+
+export declare interface ICustomConfig {
+ id: string;
+ name: string;
+ path: string;
+ command: string;
+ format: string;
+ overwrite?: boolean;
+ num?: number;
+}
+
+export declare type ICustomConsoleType = IConsoleType | 'group' | 'groupEnd' | 'groupCollapsed';
+
+export declare interface ICustomJointTextureLayout {
+ textureLength: number;
+ contents: IChunkContent[];
+}
+
+export declare interface IData {
+ url: string;
+ value: {
+ [key: string]: any;
+ };
+ versionCode: number;
+}
+
+export declare interface IDefaultGroup {
+ assetUuids: UUID[];
+ scriptUuids: UUID[];
+ jsonUuids: UUID[];
+}
+
+/**
+ * 构建使用的设计分辨率数据
+ */
+export declare interface IDesignResolution {
+ height: number;
+ width: number;
+ fitWidth?: boolean;
+ fitHeight?: boolean;
+ policy?: number;
+}
+
+export declare type IDisplayOptions = Record;
+
+export declare interface IEngineCachePaths {
+ dir: string;
+ all: string;
+ plugin: string;
+ meta: string;
+ signatureJSON: string;
+ pluginJSON: string;
+}
+
+export declare interface IEngineConfig extends IEngineModuleConfig {
+ physicsConfig: IPhysicsConfig_2;
+ macroConfig?: Record;
+ sortingLayers: { id: number, name: string, value: number }[];
+ customLayers: { name: string, value: number }[];
+ renderPipeline?: string;
+ // 是否使用自定义管线,如与其他模块配置不匹配将会以当前选项为准
+ customPipeline?: boolean;
+ highQuality: boolean;
+
+ macroCustom: MacroItem[];
+
+ customJointTextureLayouts: ICustomJointTextureLayout[];
+ designResolution: IDesignResolution;
+ splashScreen: ISplashSetting;
+ downloadMaxConcurrency: number;
+}
+
+export declare interface IEngineFeatureQuery {
+ all: string[];
+ allUnit: string[];
+ plugin: string[];
+ pluginUnit: string[];
+ engineStatsQuery: StatsQuery;
+ envLimitModule: IEnvLimitModule;
+ _defaultPlugins: string[];
+ env: StatsQuery.ConstantManager.ConstantOptions;
+ getUnitsOfFeatures(features: string[]): string[];
+ filterEngineModules(features: string[]): string[];
+}
+
+export declare interface IEngineModuleConfig {
+ // ---- 模块配置相关 ----
+ includeModules: string[];
+ flags?: IFlags;
+ noDeprecatedFeatures?: { value: boolean, version: string };
+}
+
+export declare type IEnvLimitModule = Record;
+
+export declare type IETCQuality = 'slow' | 'fast';
+
+export declare interface IExportBuildOptions extends IBuildTaskOption {
+ __version__: string;
+}
+
+export declare interface IFbxSetting {
+ /**
+ * https://github.com/cocos-creator/FBX-glTF-conv/pull/26
+ */
+ unitConversion?: 'geometry-level' | 'hierarchy-level' | 'disabled';
+
+ /**
+ * 动画烘焙速率。单位为 FPS。
+ * 一般来说有以下几种 FPS 选项。
+ * - NTSC video 30/60
+ * - PAL video 25
+ * - Film 24
+ * 见 https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2020/ENU/3DSMax-Reference/files/GUID-92B75FD6-C112-44D6-AB89-DB50D11AE0DE-htm.html 。
+ * 为了以后的拓展性,我们目前仅支持用户从这几种选项中选择。
+ * @default 24
+ */
+ animationBakeRate?: 0 | 24 | 25 | 30 | 60;
+
+ /**
+ * 在导出动画时,是否优先使用 FBX 内记录的时间范围。
+ * @default true
+ */
+ preferLocalTimeSpan?: boolean;
+
+ /**
+ * 是否为导入的材质匹配DCC的光照模型.
+ * 在导入时,若此字段为 `undefined` 时,该字段将被初始化为当前配置的"是否开启智能材质转换".
+ */
+ smartMaterialEnabled?: boolean;
+
+ /**
+ * 匹配 DCC 原始模型名称。
+ */
+ matchMeshNames?: boolean;
+}
+
+export declare type IFlags = Record;
+
+export declare interface IGroup {
+ name: string;
+ type: IJSONGroupType;
+ uuids: UUID[];
+}
+
+export declare type IGroupType = 'json' | 'script' | 'asset';
+
+export declare interface IHandlerInfo {
+ type: 'program' | 'npm' | 'function';
+ info: ICommandInfo | Function;
+ func?: Function;
+}
+
+export declare interface IImageTaskInfo {
+ src: string;
+ presetId: string;
+ hasAlpha: boolean;
+ mtime: string | number;
+ hasMipmaps: boolean;
+ compressOptions: Record;
+ dest: string[];
+ suffix: string[];
+ dirty?: boolean;
+}
+
+export declare interface IImportAssetPathInfo extends IAssetPathBase {
+ import?: string;
+ /**
+ * @deprecated please use `import` instead
+ */
+ json?: string;
+ /**
+ * @deprecated please use `import` instead
+ */
+ bin?: string;
+ groupIndex?: number;
+}
+
+export declare interface IImportMapOptions {
+ debug: boolean;
+ dest: string;
+ importMapFormat?: 'commonjs' | 'esm';
+}
+
+export declare type IInstanceMap = Record;
+
+export declare type IInterBuildTaskOption = IInternalBuildOptions & {
+ platform: P;
+ packages: Record
;
+};
+
+export declare type IInternalBaseHooks = (options: IInternalBuildOptions, result: InternalBuildResult, cache: BuilderCache, ...args: any[]) => void;
+
+export declare interface IInternalBuildOptions extends IInternalBundleBuildOptions {
+ dest: string;
+ appTemplateData: appTemplateData;
+ buildEngineParam: IBuildEngineParam;
+ updateOnly: boolean;
+ generateCompileConfig?: boolean;
+ recompileConfig?: IRecompileConfig;
+ resolution: {
+ width: number;
+ height: number;
+ policy: number;
+ };
+ useCache?: boolean;
+ bundleConfigs?: IBundleInternalOptions[];
+}
+
+export declare interface IInternalBuildPluginConfig extends IBuildPluginConfig {
+ doc?: string;
+ displayName?: string;
+ hooks?: string;
+ priority?: number;
+ options?: IDisplayOptions;
+ verifyRuleMap?: IVerificationRuleMap;
+ commonOptions?: Record>;
+ internal?: boolean;
+ customBuildStages?: Array;
+}
+
+export declare interface IInternalBuildSceneItem extends IBuildSceneItem {
+ bundle: string;
+ missing?: boolean;
+}
+
+export declare interface IInternalBuildUtils extends IBuildUtils {
+ /**
+ * 获取构建出的所有模块或者模块包文件。
+ */
+ getModuleFiles(result: InternalBuildResult): Promise