@cocos/cocos-cli-types 0.0.1-alpha.15.1 → 0.0.1-alpha.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/assets.d.ts CHANGED
@@ -372,7 +372,7 @@ declare interface FileNameCheckConfig {
372
372
 
373
373
  declare type Filter = 'none' | 'nearest' | 'linear';
374
374
 
375
- declare interface FilterPluginOptions {
375
+ export declare interface FilterPluginOptions {
376
376
  loadPluginInEditor?: boolean;
377
377
  loadPluginInWeb?: boolean;
378
378
  loadPluginInNative?: boolean;
@@ -797,7 +797,7 @@ export declare function importAsset(source: string, target: string, options?: As
797
797
 
798
798
  export declare function init(): Promise<void>;
799
799
 
800
- declare interface IPluginScriptInfo extends PluginScriptInfo {
800
+ export declare interface IPluginScriptInfo extends PluginScriptInfo {
801
801
  url: string;
802
802
  }
803
803
 
@@ -965,6 +965,99 @@ declare enum NormalImportSetting {
965
965
  recalculate = 3
966
966
  }
967
967
 
968
+ /**
969
+ * Listen to Asset Added Event // 监听资源添加事件
970
+ * @param listener Callback function that receives asset information
971
+ * @returns Function to remove the listener
972
+ *
973
+ * 推荐用法:
974
+ * ```typescript
975
+ * const removeListener = onAssetAdded((info) => {
976
+ * console.log(`资源已添加: ${info.name}`);
977
+ * console.log(` 逻辑路径: ${info.url}`);
978
+ * console.log(` 物理路径: ${info.file}`);
979
+ * });
980
+ * // 稍后移除监听
981
+ * removeListener();
982
+ * ```
983
+ */
984
+ export declare function onAssetAdded(listener: (info: IAssetInfo) => void): () => void;
985
+
986
+ /**
987
+ * Listen to Asset Changed Event // 监听资源变更事件
988
+ * @param listener Callback function that receives asset information
989
+ * @returns Function to remove the listener
990
+ *
991
+ * 推荐用法:
992
+ * ```typescript
993
+ * const removeListener = onAssetChanged((info) => {
994
+ * console.log(`资源已变更: ${info.name}`);
995
+ * });
996
+ * // 稍后移除监听
997
+ * removeListener();
998
+ * ```
999
+ */
1000
+ export declare function onAssetChanged(listener: (info: IAssetInfo) => void): () => void;
1001
+
1002
+ /**
1003
+ * Listen to Asset Removed Event // 监听资源删除事件
1004
+ * @param listener Callback function that receives asset information
1005
+ * @returns Function to remove the listener
1006
+ *
1007
+ * 推荐用法:
1008
+ * ```typescript
1009
+ * const removeListener = onAssetRemoved((info) => {
1010
+ * console.log(`资源已删除: ${info.name}`);
1011
+ * });
1012
+ * // 稍后移除监听
1013
+ * removeListener();
1014
+ * ```
1015
+ */
1016
+ export declare function onAssetRemoved(listener: (info: IAssetInfo) => void): () => void;
1017
+
1018
+ /**
1019
+ * Register listener for when a specific database finishes starting.
1020
+ *
1021
+ * 注册单个数据库启动完成后的事件监听。
1022
+ *
1023
+ * **注意事项 (Notice)**:
1024
+ * - 这个事件可能会被触发多次(如果项目存在多个子数据库,如 `assets`, `internal`)。
1025
+ * - 主要用于需要做更精细化并行控制的上层逻辑,通常情况下普通的业务逻辑不需要关心此事件,直接监听 `onReady` 即可。
1026
+ *
1027
+ * @param listener 回调函数,接收启动完成的 dbInfo
1028
+ * @returns 移除监听的函数
1029
+ */
1030
+ export declare function onDBReady(listener: (dbInfo: IAssetDBInfo) => void): () => void;
1031
+
1032
+ /**
1033
+ * Register listener for initialization progress.
1034
+ *
1035
+ * 注册初始化过程中的进度监听。
1036
+ *
1037
+ * **注意事项 (Notice)**:
1038
+ * - **仅在启动阶段有效**。一旦触发过一次 `ready` 事件(即启动阶段结束),将不再会有新的进度消息。
1039
+ * - 启动时的资源冷导入会抛出密集的进度信息,建议在 UI 层面进行适当的节流(throttle)渲染。
1040
+ *
1041
+ * @param listener 回调函数,包含当前进度、总数、当前处理的资源 url 和导入状态
1042
+ * @returns 移除监听的函数
1043
+ */
1044
+ export declare function onProgress(listener: (current: number, total: number, url: string, state: 'processing' | 'success' | 'failed') => void): () => void;
1045
+
1046
+ /**
1047
+ * Register listener for when all asset databases are fully initialized.
1048
+ *
1049
+ * 注册数据库初始化完全完成后的事件监听。
1050
+ *
1051
+ * **注意事项 (Notice)**:
1052
+ * - 触发此事件代表**所有**注册的资源数据库都已经完全导入并初始化完成(启动阶段结束)。
1053
+ * - 收到此事件后,表示所有的资源查询、操作 API 都可以安全调用。
1054
+ * - 第一次 ready 后,将不再有 progress 进度消息。
1055
+ *
1056
+ * @param listener 回调函数
1057
+ * @returns 移除监听的函数
1058
+ */
1059
+ export declare function onReady(listener: () => void): () => void;
1060
+
968
1061
  /** 粒子资源的 userData */
969
1062
  declare interface ParticleAssetUserData {
970
1063
  totalParticles: number;
@@ -1246,6 +1339,11 @@ declare interface SpriteFrameVertices {
1246
1339
  maxPos: number[];
1247
1340
  }
1248
1341
 
1342
+ /**
1343
+ * Start Asset DB // 启动资源数据库,开始扫描和导入资源
1344
+ */
1345
+ export declare function start(): Promise<void>;
1346
+
1249
1347
  /** 支持创建的资源类型常量数组(用于 Zod enum 和 TypeScript type) */
1250
1348
  declare const SUPPORT_CREATE_TYPES: readonly ['animation-clip', 'typescript', 'auto-atlas', 'effect', 'scene', 'prefab', 'material', 'terrain', 'physics-material', 'label-atlas', 'render-texture', 'directory', 'effect-header'];
1251
1349
 
package/builder.d.ts CHANGED
@@ -1102,6 +1102,8 @@ declare interface GetManualChunkApi {
1102
1102
 
1103
1103
  declare type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
1104
1104
 
1105
+ export declare function getPreviewSettings<P extends Platform>(options?: IBuildTaskOption<P>): Promise<IPreviewSettingsResult>;
1106
+
1105
1107
  declare type GlobalsOption = { [name: string]: string } | ((name: string) => string);
1106
1108
 
1107
1109
  /** glTF 动画资源的 userData */
@@ -1667,6 +1669,12 @@ export declare interface IBuildOptionBase extends IBuildCommonOptions, Overwrite
1667
1669
  taskName: string;
1668
1670
  }
1669
1671
 
1672
+ export declare interface IBuildPacResult {
1673
+ spriteToImage: Record<string, string>;
1674
+ textureToImage: Record<string, string>;
1675
+ imageToPac: Record<string, string>;
1676
+ }
1677
+
1670
1678
  export declare interface IBuildPanel {
1671
1679
  Vue: any;
1672
1680
  validator: {
@@ -1924,6 +1932,13 @@ export declare interface IBuildUtils {
1924
1932
 
1925
1933
  export declare type IBuildVerificationFunc = (value: any, options: IBuildOptionBase) => boolean | Promise<boolean>;
1926
1934
 
1935
+ export declare interface IBuildWorker {
1936
+ Ipc: {
1937
+ send: (message: string, ...args: any[]) => void;
1938
+ on: (message: string, callbask: (event: any, ...arg: any[]) => Promise<void>) => void;
1939
+ };
1940
+ }
1941
+
1927
1942
  export declare interface IBuildWorkerPluginInfo {
1928
1943
  assetHandlers?: string;
1929
1944
  hooks?: Record<string, string>;
@@ -2059,6 +2074,14 @@ export declare interface IBundleInternalOptions extends IBundleOptions {
2059
2074
  bundleFilterConfig?: BundleFilterConfig[];
2060
2075
  }
2061
2076
 
2077
+ export declare interface IBundleListItem {
2078
+ name: string;
2079
+ root: string;
2080
+ output: boolean;
2081
+ uuid: string;
2082
+ missing?: boolean;
2083
+ }
2084
+
2062
2085
  export declare interface IBundleManager {
2063
2086
  bundleMap: Record<string, IBundle>;
2064
2087
  bundles: IBundle[];
@@ -2453,6 +2476,10 @@ export declare type IEnvLimitModule = Record<string, {
2453
2476
 
2454
2477
  export declare type IETCQuality = 'slow' | 'fast';
2455
2478
 
2479
+ export declare interface IExportBuildOptions extends IBuildTaskOption {
2480
+ __version__: string;
2481
+ }
2482
+
2456
2483
  declare interface IFbxSetting {
2457
2484
  /**
2458
2485
  * https://github.com/cocos-creator/FBX-glTF-conv/pull/26
@@ -2573,6 +2600,11 @@ export declare interface IInternalBuildPluginConfig extends IBuildPluginConfig {
2573
2600
  customBuildStages?: Array<IBuildStageItem>;
2574
2601
  }
2575
2602
 
2603
+ export declare interface IInternalBuildSceneItem extends IBuildSceneItem {
2604
+ bundle: string;
2605
+ missing?: boolean;
2606
+ }
2607
+
2576
2608
  export declare interface IInternalBuildUtils extends IBuildUtils {
2577
2609
  /**
2578
2610
  * 获取构建出的所有模块或者模块包文件。
@@ -3343,6 +3375,15 @@ export declare interface ITaskItemJSON {
3343
3375
  time: string;
3344
3376
  }
3345
3377
 
3378
+ export declare interface ITaskResultMap {
3379
+ 'build-task/script'?: {
3380
+ projectJs: string;
3381
+ systemJs: string;
3382
+ polyfillsJs: string | null;
3383
+ };
3384
+ 'build-task/pac'?: IBuildPacResult;
3385
+ }
3386
+
3346
3387
  export declare type ITaskState = 'waiting' | 'success' | 'failure' | 'cancel' | 'processing' | 'none';
3347
3388
 
3348
3389
  export declare interface ITextureCompressConfig {
@@ -4842,7 +4883,7 @@ declare class StatsQuery {
4842
4883
  */
4843
4884
  declare namespace StatsQuery {
4844
4885
  namespace ConstantManager {
4845
- type PlatformType = 'WEB_EDITOR' | 'WEB_MOBILE' | 'WEB_DESKTOP' | 'WECHAT' | 'WECHAT_MINI_PROGRAM' | 'BYTEDANCE' | 'XIAOMI' | 'ALIPAY' | 'TAOBAO' | 'TAOBAO_MINIGAME' | 'OPPO' | 'VIVO' | 'HUAWEI' | 'MIGU' | 'HONOR' | 'COCOS_RUNTIME' | 'NATIVE_EDITOR' | 'ANDROID' | 'WINDOWS' | 'IOS' | 'MAC' | 'OHOS' | 'OPEN_HARMONY' | 'LINUX' | 'HTML5' | 'NATIVE' | 'NODEJS' | 'INVALID_PLATFORM';
4886
+ type PlatformType = 'WEB_EDITOR' | 'WEB_MOBILE' | 'WEB_DESKTOP' | 'WECHAT' | 'WECHAT_MINI_PROGRAM' | 'BYTEDANCE' | 'XIAOMI' | 'ALIPAY' | 'TAOBAO' | 'TAOBAO_MINIGAME' | 'OPPO' | 'VIVO' | 'HUAWEI' | 'MIGU' | 'HONOR' | 'COCOS_RUNTIME' | 'SUD' | 'SUDV2' | 'NATIVE_EDITOR' | 'ANDROID' | 'WINDOWS' | 'IOS' | 'MAC' | 'OHOS' | 'OPEN_HARMONY' | 'LINUX' | 'HTML5' | 'NATIVE' | 'NODEJS' | 'INVALID_PLATFORM';
4846
4887
  type IPlatformConfig = { [key in PlatformType]: boolean };
4847
4888
  interface IInternalFlagConfig {
4848
4889
  SERVER_MODE: boolean;
@@ -1,3 +1,56 @@
1
+ import { EventEmitter } from 'events';
2
+
3
+ /**
4
+ * 配置范围
5
+ */
6
+ export declare type ConfigurationScope = 'default' | 'project';
7
+
8
+ declare type EventEmitterMethods = Pick<EventEmitter, 'on' | 'off' | 'once' | 'emit'>;
9
+
10
+ export declare function get<T>(key: string, scope?: ConfigurationScope): Promise<T>;
11
+
12
+ /**
13
+ * 配置基类接口
14
+ */
15
+ export declare interface IBaseConfiguration extends EventEmitterMethods {
16
+ /**
17
+ * 模块名
18
+ */
19
+ moduleName: string;
20
+ /**
21
+ * 默认配置数据
22
+ */
23
+ getDefaultConfig(): Record<string, any> | undefined;
24
+ /**
25
+ * 获取配置值
26
+ * @param key 配置键名,支持点号分隔的嵌套路径
27
+ * @param scope 配置作用域,不指定时按优先级查找
28
+ */
29
+ get<T>(key?: string, scope?: ConfigurationScope): Promise<T>;
30
+ /**
31
+ * 获取指定范围的所有配置,默认是 project
32
+ * @param scope
33
+ */
34
+ getAll(scope?: ConfigurationScope): Record<string, any> | undefined;
35
+ /**
36
+ * 设置配置值
37
+ * @param key 配置键名,支持点号分隔的嵌套路径
38
+ * @param value 新的配置值
39
+ * @param scope 配置作用域,默认为 'project'
40
+ */
41
+ set<T>(key: string, value: T, scope?: ConfigurationScope): Promise<boolean>;
42
+ /**
43
+ * 移除配置值
44
+ * @param key 配置键名,支持点号分隔的嵌套路径
45
+ * @param scope 配置作用域,默认为 'project'
46
+ */
47
+ remove(key: string, scope?: ConfigurationScope): Promise<boolean>;
48
+ /**
49
+ * 保存配置
50
+ */
51
+ save(): Promise<boolean>;
52
+ }
53
+
1
54
  /**
2
55
  * 配置的格式
3
56
  */
@@ -10,8 +63,16 @@ export declare interface IConfiguration {
10
63
 
11
64
  export declare function init(projectPath: string): Promise<void>;
12
65
 
66
+ export declare function migrate(): Promise<void>;
67
+
13
68
  export declare function migrateFromProject(): Promise<IConfiguration>;
14
69
 
15
70
  export declare function reload(): Promise<void>;
16
71
 
72
+ export declare function remove(key: string, scope?: ConfigurationScope): Promise<boolean>;
73
+
74
+ export declare function save(force?: boolean): Promise<void>;
75
+
76
+ export declare function set<T>(key: string, value: T, scope?: ConfigurationScope): Promise<boolean>;
77
+
17
78
  export { };
package/engine.d.ts CHANGED
@@ -1,3 +1,355 @@
1
+ export declare interface BaseItem {
2
+ /**
3
+ * @zh 在项目设置上显示的模块名称,支持 i18n 格式
4
+ * @en the module name displayed on the project settings, can be configured in i18n format.
5
+ */
6
+ label?: string;
7
+
8
+ /**
9
+ * @zh 模块详细描述,将会显示在模块鼠标上移后的提示,支持 `i18n` 的格式
10
+ * @en the detailed description of the module, which will be displayed in the tooltip when the mouse is moved over the module, can be configured in i18n format.
11
+ */
12
+ description?: string;
13
+
14
+ /**
15
+ * @zh 是否默认包含该模块
16
+ * @en whether the module is included by default.
17
+ */
18
+ default: boolean;
19
+
20
+ /**
21
+ * @zh 标识是否为只读模块,设为 `true` 后用户无法开启或关闭该模块。
22
+ * @en whether the module is read-only. If set to true, users cannot modify this module.
23
+ */
24
+ readonly?: boolean;
25
+
26
+ /**
27
+ * @zh 是否在项目设置上隐藏该模块,设为 `true` 后将不会显示在项目设置中。
28
+ * @en Whether to hide the module in the project settings. If set to true, it will not be displayed in the project settings.
29
+ */
30
+ hidden?: boolean;
31
+
32
+ /**
33
+ * @zh 默认的模块分组归属,对应 `features` 字段同级的 `categories` 中配置的目录。
34
+ * @en The default module group belongs to, corresponding to the directory configured under the `categories` field at the same level of the `features` field.
35
+ */
36
+ category?: string;
37
+
38
+ /**
39
+ * @zh 是否为必选模块,新增模块为必选模块时,旧版本升级后会强制选择此模块,否则不会选择。
40
+ * @en Whether it is a required module. When adding a new module, the old version will be forced to select this module after the upgrade, otherwise it will not be selected.
41
+ */
42
+ required?: boolean;
43
+
44
+ /**
45
+ * @zh 该模块依赖的其他模块,如果依赖了其他模块,则此模块勾选后,依赖模块也会被自动勾选。反过来,依赖的模块被移除勾选,此模块也会被一并移除。
46
+ * @en The other modules that this module depends on. If the module depends on other modules, the dependent modules will be automatically selected. In addition, if the dependent module is removed, this module will also be removed.
47
+ */
48
+ dependencies?: string[];
49
+ }
50
+
51
+ export declare interface CategoryDetail extends CategoryInfo {
52
+ modules: IModules;
53
+ }
54
+
55
+ export declare interface CategoryInfo {
56
+ label?: string;
57
+ description?: string;
58
+ checkable?: boolean;
59
+ required?: boolean;
60
+ }
61
+
62
+ export declare interface CCEModuleConfig {
63
+ description: string;
64
+ main: string;
65
+ types: string;
66
+ }
67
+
68
+ export declare type CCEModuleMap = {
69
+ [moduleName: string]: CCEModuleConfig;
70
+ } & {
71
+ mapLocation: string;
72
+ };
73
+
74
+ export declare interface EngineInfo {
75
+ typescript: {
76
+ type: 'builtin' | 'custom'; // 当前使用的引擎类型(内置或自定义)
77
+ builtin: string, // 内置引擎地址
78
+ path: string; // 当前使用的 ts 引擎路径
79
+ },
80
+ native: {
81
+ type: 'builtin' | 'custom'; // 当前使用的引擎类型(内置或自定义)
82
+ builtin: string, // 内置引擎地址
83
+ path: string; // 当前使用的原生引擎路径
84
+ },
85
+ tmpDir: string;
86
+ version: string;
87
+ }
88
+
89
+ export declare interface Features {
90
+ [feature: string]: IModuleItem;
91
+ }
92
+
93
+ export declare function getConfig(useDefault?: boolean): Promise<IEngineConfig>;
94
+
95
+ export declare function getInfo(): Promise<EngineInfo>;
96
+
97
+ export declare interface IChunkContent {
98
+ skeleton: null | string;
99
+ clips: string[];
100
+ }
101
+
102
+ export declare interface ICollisionMatrix {
103
+ [x: string]: number;
104
+ }
105
+
106
+ export declare type ICroppingConfig = {
107
+ name: string;
108
+ cache: Record<string, IDisplayModuleCache>,
109
+ flags: IFlags_2,
110
+ includeModules: string[],
111
+ noDeprecatedFeatures: ICroppingConfigDeprecatedFeature;
112
+ moduleToFallBack?: Record<string, string>;
113
+ }
114
+
115
+ export declare type ICroppingConfigDeprecatedFeature = {
116
+ value: boolean,
117
+ version: string
118
+ };
119
+
120
+ export declare interface ICustomJointTextureLayout {
121
+ textureLength: number;
122
+ contents: IChunkContent[];
123
+ }
124
+
125
+ export declare type IDefaultConfig = {
126
+ key: IDefaultConfigKeys;
127
+ name: string;
128
+ diyConfig: (cache: Record<string, IDisplayModuleCache>, flags: IFlags_2, includeModules: string[]) => void;
129
+ }
130
+
131
+ export declare type IDefaultConfigKeys = 'defaultConfig' | 'default2d' | 'default3d' | 'defaultNative' | 'defaultSmallGames'
132
+
133
+ /**
134
+ * 构建使用的设计分辨率数据
135
+ */
136
+ export declare interface IDesignResolution {
137
+ height: number;
138
+ width: number;
139
+ fitWidth?: boolean;
140
+ fitHeight?: boolean;
141
+ policy?: number;
142
+ }
143
+
144
+ export declare interface IDisplayModuleCache {
145
+ _value: boolean;
146
+ _option?: string; // 保存下拉选项的值
147
+ _flags?: IFlags_2; // 保存下拉选项的值的联动开关
148
+ }
149
+
150
+ export declare interface IDisplayModuleItem extends IFeatureItem {
151
+ _value: boolean;
152
+ _option?: string;
153
+ options?: Record<string, IDisplayModuleItem>;
154
+ }
155
+
156
+ export declare interface IEngineConfig extends IEngineModuleConfig {
157
+ physicsConfig: IPhysicsConfig;
158
+ macroConfig?: Record<string, string | number | boolean>;
159
+ sortingLayers: { id: number, name: string, value: number }[];
160
+ customLayers: { name: string, value: number }[];
161
+ renderPipeline?: string;
162
+ // 是否使用自定义管线,如与其他模块配置不匹配将会以当前选项为准
163
+ customPipeline?: boolean;
164
+ highQuality: boolean;
165
+
166
+ macroCustom: MacroItem[];
167
+
168
+ customJointTextureLayouts: ICustomJointTextureLayout[];
169
+ designResolution: IDesignResolution;
170
+ splashScreen: ISplashSetting;
171
+ downloadMaxConcurrency: number;
172
+ }
173
+
174
+ export declare interface IEngineModuleConfig {
175
+ // ---- 模块配置相关 ----
176
+ includeModules: string[];
177
+ flags?: IFlags;
178
+ noDeprecatedFeatures?: { value: boolean, version: string };
179
+ }
180
+
181
+ export declare interface IEngineProjectConfig extends Exclude<IEngineConfig, 'includeModules' | 'flags' | 'noDeprecatedFeatures'> {
182
+ configs?: Record<string, IEngineModuleConfig>;
183
+ globalConfigKey?: string;
184
+ }
185
+
186
+ export declare interface IFeatureGroup extends BaseItem {
187
+ options: { [feature: string]: IFeatureItem };
188
+ }
189
+
190
+ export declare interface IFeatureItem extends BaseItem {
191
+ /**
192
+ * @zh 是否默认以及允许包含在上传的各个小游戏引擎插件内,目前由于部分引擎模块包体较大,默认不会打包在官方的微信引擎分离插件内。(临时方案)
193
+ * @en Whether it is included in the upload of the various engine plugins by default. Currently, because some engine modules are packaged in a large package, the official WeChat engine separation plugin does not package them by default. (Temporary solution)
194
+ */
195
+ enginePlugin?: boolean;
196
+
197
+ /**
198
+ * @zh 限定的使用环境,允许宏的组合条件判断,默认为空支持任意环境,配置后限定为指定环境。如设置为 "$NATIVE || $HTML5" 则仅在 native 和 html5 环境下生效。
199
+ * @en The restricted usage environment allows for conditional judgments using macro combinations. By default, it supports any environment, but once configured, it is limited to the specified environment. For example, if set to "$NATIVE || $HTML5", it will only take effect in native and HTML5 environments.
200
+ */
201
+ envCondition?: string;
202
+
203
+ /**
204
+ * @zh 当环境不符合限定的使用环境时,自动回退的模块名称。仅当 `envCondition` 配置后才有效。
205
+ * @en The name of the engine feature to automatically fall back to when the environment does not meet the restricted usage conditions. This is only effective when `envCondition` is configured.
206
+ */
207
+ fallback?: string;
208
+
209
+ /**
210
+ * @zh 当选择了某个模块时,可以做些附加的配置
211
+ * @en When a module is selected, additional configurations can be made
212
+ */
213
+ flags: { [k: string]: Pick<BaseItem, 'default' | 'label' | 'description'> & { 'ui-type': 'checkbox' | 'select' } }
214
+
215
+ /**
216
+ * @zh 是否为原生模块,这部分模块的编译模式可能是 wasm 也可能是共存或只有 asmjs,为 true 的模块,如果模块勾选构建面板上才会显示原生代码打包模式的配置。
217
+ * @en Whether it is a native module. This part of the module may be compiled as wasm or asmjs, and the module with this attribute will be displayed in the packaging mode configuration in the build panel if it is selected.
218
+ */
219
+ isNativeModule?: boolean;
220
+
221
+ /**
222
+ * @zh 在原生引擎的模块宏配置,如果在原生端有原生实现,在此处补充对应字段,后续根据项目设置的配置情况,会将选择值设置到 `cmake` 配置内。
223
+ * @en The macro configuration of the native module in the native engine. If there is a native implementation in the native engine, please fill in the corresponding fields here. The value will be set to `cmake` configuration according to the project settings.
224
+ */
225
+ cmakeConfig?: string;
226
+ }
227
+
228
+ export declare type IFlags = Record<string, boolean | number>;
229
+
230
+ declare type IFlags_2 = Record<string, boolean | number>;
231
+
232
+ export declare interface IInitEngineInfo {
233
+ importBase: string;
234
+ nativeBase: string;
235
+ writablePath: string;
236
+ serverURL?: string;
237
+ }
238
+
239
+ export declare interface IModuleConfig {
240
+ moduleTreeDump: {
241
+ default: IModules;
242
+ categories: Record<string, CategoryDetail>;
243
+ },
244
+ nativeCodeModules: string[];
245
+ moduleCmakeConfig: Record<string, { native?: string; }>;
246
+ moduleDependMap: Record<string, string[]>;
247
+ moduleDependedMap: Record<string, string[]>;
248
+ features: IModules,
249
+ ignoreModules: string[],
250
+ envLimitModule: Record<string, {
251
+ envList: string[];
252
+ fallback?: string;
253
+ }>;
254
+ }
255
+
256
+ export declare type IModuleItem = IFeatureItem | IFeatureGroup;
257
+
258
+ export declare type IModules = Record<string, IModuleItem>;
259
+
1
260
  export declare function init(projectPath: string): Promise<void>;
2
261
 
262
+ export declare function initEngine(enginePath: string, projectPath: string, serverURL?: string): Promise<void>;
263
+
264
+ export declare interface IPhysicsConfig {
265
+ gravity: IVec3Like; // (0,-10, 0)
266
+ allowSleep: boolean; // true
267
+ sleepThreshold: number; // 0.1,最小 0
268
+ autoSimulation: boolean; // true
269
+ fixedTimeStep: number; // 1 / 60 ,最小 0
270
+ maxSubSteps: number; // 1,最小 0
271
+ defaultMaterial?: string; // 物理材质 uuid
272
+ useNodeChains: boolean; // true
273
+ collisionMatrix: ICollisionMatrix;
274
+ physicsEngine: string;
275
+ physX?: {
276
+ notPackPhysXLibs: boolean;
277
+ multiThread: boolean;
278
+ subThreadCount: number;
279
+ epsilon: number;
280
+ };
281
+ }
282
+
283
+ export declare interface IPhysicsMaterial {
284
+ friction: number; // 0.5
285
+ rollingFriction: number; // 0.1
286
+ spinningFriction: number; // 0.1
287
+ restitution: number; // 0.1
288
+ }
289
+
290
+ export declare interface ISplashBackgroundColor {
291
+ x: number;
292
+ y: number;
293
+ z: number;
294
+ w: number;
295
+ }
296
+
297
+ export declare interface ISplashSetting {
298
+ displayRatio: number;
299
+ totalTime: number;
300
+ watermarkLocation: 'default' | 'topLeft' | 'topRight' | 'topCenter' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
301
+ autoFit: boolean;
302
+
303
+ logo?: {
304
+ type: 'default' | 'none' | 'custom';
305
+ image?: string;
306
+ base64?: string;
307
+ }
308
+ background?: {
309
+ type: 'default' | 'color' | 'custom';
310
+ color?: ISplashBackgroundColor;
311
+ image?: string;
312
+ base64?: string;
313
+ }
314
+ }
315
+
316
+ export declare interface IVec3Like {
317
+ x: number;
318
+ y: number;
319
+ z: number;
320
+ }
321
+
322
+ export declare type MacroItem = {
323
+ key: string;
324
+ value: boolean;
325
+ }
326
+
327
+ export declare type MakeRequired<T, K extends keyof T> = T & Required<Pick<T, K>>;
328
+
329
+ export declare interface Migration {
330
+ version: string;
331
+ migrate(moduleCache: Record<string, boolean>): Record<string, boolean>;
332
+ }
333
+
334
+ export declare interface ModuleRenderConfig {
335
+ $schema?: string;
336
+
337
+ /**
338
+ * The modules info
339
+ */
340
+ features: Features;
341
+
342
+ /**
343
+ * The categories info
344
+ */
345
+ categories: { [category: string]: CategoryInfo };
346
+
347
+ version: string;
348
+
349
+ /**
350
+ * The script to migrate, this script should export a const migrations: Migration[]`.
351
+ */
352
+ migrationScript?: string;
353
+ }
354
+
3
355
  export { };