@cocos/cocos-cli-types 0.0.1-alpha.17.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
 
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 {
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 { };