@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 +2 -2
- package/builder.d.ts +41 -0
- package/engine.d.ts +352 -0
- package/index.d.ts +605 -3
- package/package.json +9 -1
- package/project.d.ts +188 -0
- package/scripting.d.ts +35 -0
package/index.d.ts
CHANGED
|
@@ -247,6 +247,8 @@ export declare namespace Assets {
|
|
|
247
247
|
ICreateMenuInfo,
|
|
248
248
|
IUerDataConfigItem,
|
|
249
249
|
QueryAssetType,
|
|
250
|
+
FilterPluginOptions,
|
|
251
|
+
IPluginScriptInfo,
|
|
250
252
|
IAssetMeta,
|
|
251
253
|
IAssetInfo,
|
|
252
254
|
AssetOperationOption,
|
|
@@ -338,6 +340,56 @@ export declare namespace Base {
|
|
|
338
340
|
};
|
|
339
341
|
}
|
|
340
342
|
|
|
343
|
+
declare interface BaseItem {
|
|
344
|
+
/**
|
|
345
|
+
* @zh 在项目设置上显示的模块名称,支持 i18n 格式
|
|
346
|
+
* @en the module name displayed on the project settings, can be configured in i18n format.
|
|
347
|
+
*/
|
|
348
|
+
label?: string;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* @zh 模块详细描述,将会显示在模块鼠标上移后的提示,支持 `i18n` 的格式
|
|
352
|
+
* @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.
|
|
353
|
+
*/
|
|
354
|
+
description?: string;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* @zh 是否默认包含该模块
|
|
358
|
+
* @en whether the module is included by default.
|
|
359
|
+
*/
|
|
360
|
+
default: boolean;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @zh 标识是否为只读模块,设为 `true` 后用户无法开启或关闭该模块。
|
|
364
|
+
* @en whether the module is read-only. If set to true, users cannot modify this module.
|
|
365
|
+
*/
|
|
366
|
+
readonly?: boolean;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* @zh 是否在项目设置上隐藏该模块,设为 `true` 后将不会显示在项目设置中。
|
|
370
|
+
* @en Whether to hide the module in the project settings. If set to true, it will not be displayed in the project settings.
|
|
371
|
+
*/
|
|
372
|
+
hidden?: boolean;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* @zh 默认的模块分组归属,对应 `features` 字段同级的 `categories` 中配置的目录。
|
|
376
|
+
* @en The default module group belongs to, corresponding to the directory configured under the `categories` field at the same level of the `features` field.
|
|
377
|
+
*/
|
|
378
|
+
category?: string;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* @zh 是否为必选模块,新增模块为必选模块时,旧版本升级后会强制选择此模块,否则不会选择。
|
|
382
|
+
* @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.
|
|
383
|
+
*/
|
|
384
|
+
required?: boolean;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* @zh 该模块依赖的其他模块,如果依赖了其他模块,则此模块勾选后,依赖模块也会被自动勾选。反过来,依赖的模块被移除勾选,此模块也会被一并移除。
|
|
388
|
+
* @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.
|
|
389
|
+
*/
|
|
390
|
+
dependencies?: string[];
|
|
391
|
+
}
|
|
392
|
+
|
|
341
393
|
/** 位图字体资源的 userData */
|
|
342
394
|
declare interface BitmapFontAssetUserData {
|
|
343
395
|
/** 字体配置 */
|
|
@@ -348,6 +400,29 @@ declare interface BitmapFontAssetUserData {
|
|
|
348
400
|
textureUuid: string;
|
|
349
401
|
}
|
|
350
402
|
|
|
403
|
+
declare interface CategoryDetail extends CategoryInfo {
|
|
404
|
+
modules: IModules;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
declare interface CategoryInfo {
|
|
408
|
+
label?: string;
|
|
409
|
+
description?: string;
|
|
410
|
+
checkable?: boolean;
|
|
411
|
+
required?: boolean;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
declare interface CCEModuleConfig {
|
|
415
|
+
description: string;
|
|
416
|
+
main: string;
|
|
417
|
+
types: string;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
declare type CCEModuleMap = {
|
|
421
|
+
[moduleName: string]: CCEModuleConfig;
|
|
422
|
+
} & {
|
|
423
|
+
mapLocation: string;
|
|
424
|
+
};
|
|
425
|
+
|
|
351
426
|
declare function close_2(): Promise<void>;
|
|
352
427
|
|
|
353
428
|
export declare namespace Configuration {
|
|
@@ -445,10 +520,64 @@ declare interface EffectAssetUserData {
|
|
|
445
520
|
|
|
446
521
|
export declare namespace Engine {
|
|
447
522
|
export {
|
|
448
|
-
init_4 as init
|
|
523
|
+
init_4 as init,
|
|
524
|
+
getInfo,
|
|
525
|
+
getConfig,
|
|
526
|
+
initEngine,
|
|
527
|
+
EngineInfo,
|
|
528
|
+
IFlags,
|
|
529
|
+
MakeRequired,
|
|
530
|
+
IPhysicsConfig,
|
|
531
|
+
ICollisionMatrix,
|
|
532
|
+
IVec3Like,
|
|
533
|
+
IPhysicsMaterial,
|
|
534
|
+
ICustomJointTextureLayout,
|
|
535
|
+
IChunkContent,
|
|
536
|
+
MacroItem,
|
|
537
|
+
ISplashBackgroundColor,
|
|
538
|
+
ISplashSetting,
|
|
539
|
+
IDesignResolution,
|
|
540
|
+
IEngineModuleConfig,
|
|
541
|
+
IEngineConfig,
|
|
542
|
+
IEngineProjectConfig,
|
|
543
|
+
IInitEngineInfo,
|
|
544
|
+
CCEModuleConfig,
|
|
545
|
+
CCEModuleMap,
|
|
546
|
+
ModuleRenderConfig,
|
|
547
|
+
Migration,
|
|
548
|
+
IModuleItem,
|
|
549
|
+
Features,
|
|
550
|
+
BaseItem,
|
|
551
|
+
IFeatureItem,
|
|
552
|
+
IFeatureGroup,
|
|
553
|
+
CategoryInfo,
|
|
554
|
+
IModules,
|
|
555
|
+
IDisplayModuleItem,
|
|
556
|
+
IDisplayModuleCache,
|
|
557
|
+
CategoryDetail,
|
|
558
|
+
IModuleConfig,
|
|
559
|
+
IDefaultConfigKeys,
|
|
560
|
+
IDefaultConfig,
|
|
561
|
+
ICroppingConfigDeprecatedFeature,
|
|
562
|
+
ICroppingConfig
|
|
449
563
|
};
|
|
450
564
|
}
|
|
451
565
|
|
|
566
|
+
declare interface EngineInfo {
|
|
567
|
+
typescript: {
|
|
568
|
+
type: 'builtin' | 'custom'; // 当前使用的引擎类型(内置或自定义)
|
|
569
|
+
builtin: string, // 内置引擎地址
|
|
570
|
+
path: string; // 当前使用的 ts 引擎路径
|
|
571
|
+
},
|
|
572
|
+
native: {
|
|
573
|
+
type: 'builtin' | 'custom'; // 当前使用的引擎类型(内置或自定义)
|
|
574
|
+
builtin: string, // 内置引擎地址
|
|
575
|
+
path: string; // 当前使用的原生引擎路径
|
|
576
|
+
},
|
|
577
|
+
tmpDir: string;
|
|
578
|
+
version: string;
|
|
579
|
+
}
|
|
580
|
+
|
|
452
581
|
declare type EventEmitterMethods = Pick<EventEmitter, 'on' | 'off' | 'once' | 'emit'>;
|
|
453
582
|
|
|
454
583
|
declare interface ExecuteAssetDBScriptMethodOptions {
|
|
@@ -457,6 +586,10 @@ declare interface ExecuteAssetDBScriptMethodOptions {
|
|
|
457
586
|
args?: any[];
|
|
458
587
|
}
|
|
459
588
|
|
|
589
|
+
declare interface Features {
|
|
590
|
+
[feature: string]: IModuleItem;
|
|
591
|
+
}
|
|
592
|
+
|
|
460
593
|
declare interface FileNameCheckConfig {
|
|
461
594
|
// 匹配规则
|
|
462
595
|
regStr: string;
|
|
@@ -501,6 +634,14 @@ declare interface FontDefDictionary {
|
|
|
501
634
|
|
|
502
635
|
declare function get<T>(key: string, scope?: ConfigurationScope): Promise<T>;
|
|
503
636
|
|
|
637
|
+
declare function get_2(): Promise<Project_2>;
|
|
638
|
+
|
|
639
|
+
declare function getConfig(useDefault?: boolean): Promise<IEngineConfig>;
|
|
640
|
+
|
|
641
|
+
declare function getInfo(): Promise<EngineInfo>;
|
|
642
|
+
|
|
643
|
+
declare function getInfo_2(): Promise<ProjectInfo>;
|
|
644
|
+
|
|
504
645
|
/** glTF 动画资源的 userData */
|
|
505
646
|
declare interface GltfAnimationAssetUserData {
|
|
506
647
|
gltfIndex: number;
|
|
@@ -819,6 +960,15 @@ declare interface IBaseConfiguration extends EventEmitterMethods {
|
|
|
819
960
|
save(): Promise<boolean>;
|
|
820
961
|
}
|
|
821
962
|
|
|
963
|
+
declare interface IChunkContent {
|
|
964
|
+
skeleton: null | string;
|
|
965
|
+
clips: string[];
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
declare interface ICollisionMatrix {
|
|
969
|
+
[x: string]: number;
|
|
970
|
+
}
|
|
971
|
+
|
|
822
972
|
/**
|
|
823
973
|
* 配置的格式
|
|
824
974
|
*/
|
|
@@ -856,6 +1006,86 @@ declare interface ICreateMenuInfo {
|
|
|
856
1006
|
fileNameCheckConfigs?: FileNameCheckConfig[];
|
|
857
1007
|
}
|
|
858
1008
|
|
|
1009
|
+
declare type ICroppingConfig = {
|
|
1010
|
+
name: string;
|
|
1011
|
+
cache: Record<string, IDisplayModuleCache>,
|
|
1012
|
+
flags: IFlags_2,
|
|
1013
|
+
includeModules: string[],
|
|
1014
|
+
noDeprecatedFeatures: ICroppingConfigDeprecatedFeature;
|
|
1015
|
+
moduleToFallBack?: Record<string, string>;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
declare type ICroppingConfigDeprecatedFeature = {
|
|
1019
|
+
value: boolean,
|
|
1020
|
+
version: string
|
|
1021
|
+
};
|
|
1022
|
+
|
|
1023
|
+
declare interface ICustomJointTextureLayout {
|
|
1024
|
+
textureLength: number;
|
|
1025
|
+
contents: IChunkContent[];
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
declare type IDefaultConfig = {
|
|
1029
|
+
key: IDefaultConfigKeys;
|
|
1030
|
+
name: string;
|
|
1031
|
+
diyConfig: (cache: Record<string, IDisplayModuleCache>, flags: IFlags_2, includeModules: string[]) => void;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
declare type IDefaultConfigKeys = 'defaultConfig' | 'default2d' | 'default3d' | 'defaultNative' | 'defaultSmallGames'
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* 构建使用的设计分辨率数据
|
|
1038
|
+
*/
|
|
1039
|
+
declare interface IDesignResolution {
|
|
1040
|
+
height: number;
|
|
1041
|
+
width: number;
|
|
1042
|
+
fitWidth?: boolean;
|
|
1043
|
+
fitHeight?: boolean;
|
|
1044
|
+
policy?: number;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
declare interface IDisplayModuleCache {
|
|
1048
|
+
_value: boolean;
|
|
1049
|
+
_option?: string; // 保存下拉选项的值
|
|
1050
|
+
_flags?: IFlags_2; // 保存下拉选项的值的联动开关
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
declare interface IDisplayModuleItem extends IFeatureItem {
|
|
1054
|
+
_value: boolean;
|
|
1055
|
+
_option?: string;
|
|
1056
|
+
options?: Record<string, IDisplayModuleItem>;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
declare interface IEngineConfig extends IEngineModuleConfig {
|
|
1060
|
+
physicsConfig: IPhysicsConfig;
|
|
1061
|
+
macroConfig?: Record<string, string | number | boolean>;
|
|
1062
|
+
sortingLayers: { id: number, name: string, value: number }[];
|
|
1063
|
+
customLayers: { name: string, value: number }[];
|
|
1064
|
+
renderPipeline?: string;
|
|
1065
|
+
// 是否使用自定义管线,如与其他模块配置不匹配将会以当前选项为准
|
|
1066
|
+
customPipeline?: boolean;
|
|
1067
|
+
highQuality: boolean;
|
|
1068
|
+
|
|
1069
|
+
macroCustom: MacroItem[];
|
|
1070
|
+
|
|
1071
|
+
customJointTextureLayouts: ICustomJointTextureLayout[];
|
|
1072
|
+
designResolution: IDesignResolution;
|
|
1073
|
+
splashScreen: ISplashSetting;
|
|
1074
|
+
downloadMaxConcurrency: number;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
declare interface IEngineModuleConfig {
|
|
1078
|
+
// ---- 模块配置相关 ----
|
|
1079
|
+
includeModules: string[];
|
|
1080
|
+
flags?: IFlags;
|
|
1081
|
+
noDeprecatedFeatures?: { value: boolean, version: string };
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
declare interface IEngineProjectConfig extends Exclude<IEngineConfig, 'includeModules' | 'flags' | 'noDeprecatedFeatures'> {
|
|
1085
|
+
configs?: Record<string, IEngineModuleConfig>;
|
|
1086
|
+
globalConfigKey?: string;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
859
1089
|
declare interface IFbxSetting {
|
|
860
1090
|
/**
|
|
861
1091
|
* https://github.com/cocos-creator/FBX-glTF-conv/pull/26
|
|
@@ -892,6 +1122,59 @@ declare interface IFbxSetting {
|
|
|
892
1122
|
matchMeshNames?: boolean;
|
|
893
1123
|
}
|
|
894
1124
|
|
|
1125
|
+
declare interface IFeatureGroup extends BaseItem {
|
|
1126
|
+
options: { [feature: string]: IFeatureItem };
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
declare interface IFeatureItem extends BaseItem {
|
|
1130
|
+
/**
|
|
1131
|
+
* @zh 是否默认以及允许包含在上传的各个小游戏引擎插件内,目前由于部分引擎模块包体较大,默认不会打包在官方的微信引擎分离插件内。(临时方案)
|
|
1132
|
+
* @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)
|
|
1133
|
+
*/
|
|
1134
|
+
enginePlugin?: boolean;
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* @zh 限定的使用环境,允许宏的组合条件判断,默认为空支持任意环境,配置后限定为指定环境。如设置为 "$NATIVE || $HTML5" 则仅在 native 和 html5 环境下生效。
|
|
1138
|
+
* @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.
|
|
1139
|
+
*/
|
|
1140
|
+
envCondition?: string;
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* @zh 当环境不符合限定的使用环境时,自动回退的模块名称。仅当 `envCondition` 配置后才有效。
|
|
1144
|
+
* @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.
|
|
1145
|
+
*/
|
|
1146
|
+
fallback?: string;
|
|
1147
|
+
|
|
1148
|
+
/**
|
|
1149
|
+
* @zh 当选择了某个模块时,可以做些附加的配置
|
|
1150
|
+
* @en When a module is selected, additional configurations can be made
|
|
1151
|
+
*/
|
|
1152
|
+
flags: { [k: string]: Pick<BaseItem, 'default' | 'label' | 'description'> & { 'ui-type': 'checkbox' | 'select' } }
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* @zh 是否为原生模块,这部分模块的编译模式可能是 wasm 也可能是共存或只有 asmjs,为 true 的模块,如果模块勾选构建面板上才会显示原生代码打包模式的配置。
|
|
1156
|
+
* @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.
|
|
1157
|
+
*/
|
|
1158
|
+
isNativeModule?: boolean;
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* @zh 在原生引擎的模块宏配置,如果在原生端有原生实现,在此处补充对应字段,后续根据项目设置的配置情况,会将选择值设置到 `cmake` 配置内。
|
|
1162
|
+
* @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.
|
|
1163
|
+
*/
|
|
1164
|
+
cmakeConfig?: string;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
declare type IFlags = Record<string, boolean | number>;
|
|
1168
|
+
|
|
1169
|
+
declare type IFlags_2 = Record<string, boolean | number>;
|
|
1170
|
+
|
|
1171
|
+
declare interface IInitEngineInfo {
|
|
1172
|
+
importBase: string;
|
|
1173
|
+
nativeBase: string;
|
|
1174
|
+
writablePath: string;
|
|
1175
|
+
serverURL?: string;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
895
1178
|
/** 图片资源的 userData */
|
|
896
1179
|
declare interface ImageAssetUserData {
|
|
897
1180
|
/** 图片类型 */
|
|
@@ -940,6 +1223,27 @@ declare interface ImageMeta {
|
|
|
940
1223
|
remap?: string;
|
|
941
1224
|
}
|
|
942
1225
|
|
|
1226
|
+
declare interface IModuleConfig {
|
|
1227
|
+
moduleTreeDump: {
|
|
1228
|
+
default: IModules;
|
|
1229
|
+
categories: Record<string, CategoryDetail>;
|
|
1230
|
+
},
|
|
1231
|
+
nativeCodeModules: string[];
|
|
1232
|
+
moduleCmakeConfig: Record<string, { native?: string; }>;
|
|
1233
|
+
moduleDependMap: Record<string, string[]>;
|
|
1234
|
+
moduleDependedMap: Record<string, string[]>;
|
|
1235
|
+
features: IModules,
|
|
1236
|
+
ignoreModules: string[],
|
|
1237
|
+
envLimitModule: Record<string, {
|
|
1238
|
+
envList: string[];
|
|
1239
|
+
fallback?: string;
|
|
1240
|
+
}>;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
declare type IModuleItem = IFeatureItem | IFeatureGroup;
|
|
1244
|
+
|
|
1245
|
+
declare type IModules = Record<string, IModuleItem>;
|
|
1246
|
+
|
|
943
1247
|
/**
|
|
944
1248
|
* Import Asset // 导入资源
|
|
945
1249
|
*/
|
|
@@ -957,10 +1261,111 @@ declare function init_5(projectPath: string): Promise<void>;
|
|
|
957
1261
|
|
|
958
1262
|
declare function init_6(projectPath: string): Promise<void>;
|
|
959
1263
|
|
|
1264
|
+
declare function initEngine(enginePath: string, projectPath: string, serverURL?: string): Promise<void>;
|
|
1265
|
+
|
|
1266
|
+
declare interface IPhysicsConfig {
|
|
1267
|
+
gravity: IVec3Like; // (0,-10, 0)
|
|
1268
|
+
allowSleep: boolean; // true
|
|
1269
|
+
sleepThreshold: number; // 0.1,最小 0
|
|
1270
|
+
autoSimulation: boolean; // true
|
|
1271
|
+
fixedTimeStep: number; // 1 / 60 ,最小 0
|
|
1272
|
+
maxSubSteps: number; // 1,最小 0
|
|
1273
|
+
defaultMaterial?: string; // 物理材质 uuid
|
|
1274
|
+
useNodeChains: boolean; // true
|
|
1275
|
+
collisionMatrix: ICollisionMatrix;
|
|
1276
|
+
physicsEngine: string;
|
|
1277
|
+
physX?: {
|
|
1278
|
+
notPackPhysXLibs: boolean;
|
|
1279
|
+
multiThread: boolean;
|
|
1280
|
+
subThreadCount: number;
|
|
1281
|
+
epsilon: number;
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
declare interface IPhysicsMaterial {
|
|
1286
|
+
friction: number; // 0.5
|
|
1287
|
+
rollingFriction: number; // 0.1
|
|
1288
|
+
spinningFriction: number; // 0.1
|
|
1289
|
+
restitution: number; // 0.1
|
|
1290
|
+
}
|
|
1291
|
+
|
|
960
1292
|
declare interface IPluginScriptInfo extends PluginScriptInfo {
|
|
961
1293
|
url: string;
|
|
962
1294
|
}
|
|
963
1295
|
|
|
1296
|
+
declare interface IProject {
|
|
1297
|
+
/**
|
|
1298
|
+
* Gets the project directory path
|
|
1299
|
+
*
|
|
1300
|
+
* @returns {string} The project directory path
|
|
1301
|
+
*/
|
|
1302
|
+
get path(): string;
|
|
1303
|
+
/**
|
|
1304
|
+
* Gets the project type (2d or 3d)
|
|
1305
|
+
*
|
|
1306
|
+
* @returns {'2d' | '3d'} The project type
|
|
1307
|
+
*/
|
|
1308
|
+
get type(): '2d' | '3d';
|
|
1309
|
+
/**
|
|
1310
|
+
* Gets the package.json file path
|
|
1311
|
+
*
|
|
1312
|
+
* @returns {string} The path to package.json file
|
|
1313
|
+
*/
|
|
1314
|
+
get pkgPath(): string;
|
|
1315
|
+
/**
|
|
1316
|
+
* Gets the temp directory path
|
|
1317
|
+
*
|
|
1318
|
+
* @returns {string} The path to the temporary directory
|
|
1319
|
+
*/
|
|
1320
|
+
get tmpDir(): string;
|
|
1321
|
+
/**
|
|
1322
|
+
* Gets the library directory path
|
|
1323
|
+
*
|
|
1324
|
+
* @returns {string} The path to the library directory
|
|
1325
|
+
*/
|
|
1326
|
+
get libraryDir(): string;
|
|
1327
|
+
/**
|
|
1328
|
+
* Opens the project and loads project information
|
|
1329
|
+
*
|
|
1330
|
+
* @returns {Promise<boolean>} Returns true if the project was opened successfully, false otherwise
|
|
1331
|
+
*/
|
|
1332
|
+
open(projectPath: string): Promise<boolean>;
|
|
1333
|
+
/**
|
|
1334
|
+
* Closes the project and saves current project information
|
|
1335
|
+
*
|
|
1336
|
+
* @returns {Promise<boolean>} Returns true if the project was closed successfully, false otherwise
|
|
1337
|
+
*/
|
|
1338
|
+
close(): Promise<boolean>;
|
|
1339
|
+
/**
|
|
1340
|
+
* Gets the complete project information
|
|
1341
|
+
*
|
|
1342
|
+
* @returns {ProjectInfo} The complete project information object
|
|
1343
|
+
*/
|
|
1344
|
+
getInfo(): ProjectInfo;
|
|
1345
|
+
/**
|
|
1346
|
+
* Gets specific project information by key path
|
|
1347
|
+
*
|
|
1348
|
+
* @param {string} key - The key path to access nested properties (e.g., 'creator.version')
|
|
1349
|
+
* @returns {any} The value at the specified key path, or null if not found
|
|
1350
|
+
*/
|
|
1351
|
+
getInfo(key: string): any;
|
|
1352
|
+
/**
|
|
1353
|
+
* Gets project information with optional key path
|
|
1354
|
+
*
|
|
1355
|
+
* @param {string} [key] - Optional key path to access nested properties
|
|
1356
|
+
* @returns {ProjectInfo | any} Project information or specific value
|
|
1357
|
+
*/
|
|
1358
|
+
getInfo(key?: string): ProjectInfo | any;
|
|
1359
|
+
/**
|
|
1360
|
+
* Updates specific project information by key path or complete info
|
|
1361
|
+
*
|
|
1362
|
+
* @param {string | ProjectInfo} keyOrValue - Either a key path string or complete ProjectInfo object
|
|
1363
|
+
* @param {ProjectInfo} [value] - The value to set when using key path (required if keyOrValue is string)
|
|
1364
|
+
* @returns {Promise<boolean>} Returns true if update was successful, false otherwise
|
|
1365
|
+
*/
|
|
1366
|
+
updateInfo<T>(keyOrValue: string | ProjectInfo, value?: T): Promise<boolean>;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
964
1369
|
declare interface IRedirectInfo {
|
|
965
1370
|
// 跳转资源的类型
|
|
966
1371
|
type: string;
|
|
@@ -968,6 +1373,32 @@ declare interface IRedirectInfo {
|
|
|
968
1373
|
uuid: string;
|
|
969
1374
|
}
|
|
970
1375
|
|
|
1376
|
+
declare interface ISplashBackgroundColor {
|
|
1377
|
+
x: number;
|
|
1378
|
+
y: number;
|
|
1379
|
+
z: number;
|
|
1380
|
+
w: number;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
declare interface ISplashSetting {
|
|
1384
|
+
displayRatio: number;
|
|
1385
|
+
totalTime: number;
|
|
1386
|
+
watermarkLocation: 'default' | 'topLeft' | 'topRight' | 'topCenter' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
|
|
1387
|
+
autoFit: boolean;
|
|
1388
|
+
|
|
1389
|
+
logo?: {
|
|
1390
|
+
type: 'default' | 'none' | 'custom';
|
|
1391
|
+
image?: string;
|
|
1392
|
+
base64?: string;
|
|
1393
|
+
}
|
|
1394
|
+
background?: {
|
|
1395
|
+
type: 'default' | 'color' | 'custom';
|
|
1396
|
+
color?: ISplashBackgroundColor;
|
|
1397
|
+
image?: string;
|
|
1398
|
+
base64?: string;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
|
|
971
1402
|
declare type ISupportCreateCCType =
|
|
972
1403
|
| 'cc.AnimationClip' // 动画剪辑
|
|
973
1404
|
| 'cc.Script' // 脚本(TypeScript/JavaScript)
|
|
@@ -1010,6 +1441,12 @@ declare interface IUerDataConfigItem {
|
|
|
1010
1441
|
};
|
|
1011
1442
|
}
|
|
1012
1443
|
|
|
1444
|
+
declare interface IVec3Like {
|
|
1445
|
+
x: number;
|
|
1446
|
+
y: number;
|
|
1447
|
+
z: number;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1013
1450
|
/** glTF 虚拟子资源的通用 userData */
|
|
1014
1451
|
declare interface IVirtualAssetUserData {
|
|
1015
1452
|
/** 在 glTF 文件中的索引 */
|
|
@@ -1064,6 +1501,13 @@ declare const enum LogLevel {
|
|
|
1064
1501
|
DEBUG = 4
|
|
1065
1502
|
}
|
|
1066
1503
|
|
|
1504
|
+
declare type MacroItem = {
|
|
1505
|
+
key: string;
|
|
1506
|
+
value: boolean;
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
declare type MakeRequired<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
1510
|
+
|
|
1067
1511
|
declare interface MeshClusterOptions {
|
|
1068
1512
|
enable: boolean;
|
|
1069
1513
|
coneCluster?: boolean;
|
|
@@ -1105,6 +1549,32 @@ declare function migrate(): Promise<void>;
|
|
|
1105
1549
|
|
|
1106
1550
|
declare function migrateFromProject(): Promise<IConfiguration>;
|
|
1107
1551
|
|
|
1552
|
+
declare interface Migration {
|
|
1553
|
+
version: string;
|
|
1554
|
+
migrate(moduleCache: Record<string, boolean>): Record<string, boolean>;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
declare interface ModuleRenderConfig {
|
|
1558
|
+
$schema?: string;
|
|
1559
|
+
|
|
1560
|
+
/**
|
|
1561
|
+
* The modules info
|
|
1562
|
+
*/
|
|
1563
|
+
features: Features;
|
|
1564
|
+
|
|
1565
|
+
/**
|
|
1566
|
+
* The categories info
|
|
1567
|
+
*/
|
|
1568
|
+
categories: { [category: string]: CategoryInfo };
|
|
1569
|
+
|
|
1570
|
+
version: string;
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* The script to migrate, this script should export a const migrations: Migration[]`.
|
|
1574
|
+
*/
|
|
1575
|
+
migrationScript?: string;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1108
1578
|
/**
|
|
1109
1579
|
* Move Asset // 移动资源
|
|
1110
1580
|
*/
|
|
@@ -1306,10 +1776,123 @@ export declare namespace Project {
|
|
|
1306
1776
|
export {
|
|
1307
1777
|
init_5 as init,
|
|
1308
1778
|
open_2 as open,
|
|
1309
|
-
close_2 as close
|
|
1779
|
+
close_2 as close,
|
|
1780
|
+
getInfo_2 as getInfo,
|
|
1781
|
+
get_2 as get
|
|
1310
1782
|
};
|
|
1311
1783
|
}
|
|
1312
1784
|
|
|
1785
|
+
declare class Project_2 implements IProject {
|
|
1786
|
+
/**
|
|
1787
|
+
* The version of the Project
|
|
1788
|
+
*/
|
|
1789
|
+
static readonly version = '4.0.0';
|
|
1790
|
+
private _projectPath;
|
|
1791
|
+
private _type;
|
|
1792
|
+
private _pkgPath;
|
|
1793
|
+
private _tmpDir;
|
|
1794
|
+
private _libraryDir;
|
|
1795
|
+
private _info;
|
|
1796
|
+
get path(): string;
|
|
1797
|
+
get type(): '2d' | '3d';
|
|
1798
|
+
static getPackageJsonPath(projectPath: string): string;
|
|
1799
|
+
get pkgPath(): string;
|
|
1800
|
+
get tmpDir(): string;
|
|
1801
|
+
get libraryDir(): string;
|
|
1802
|
+
static create(projectPath: string, type?: ProjectType): Promise<boolean>;
|
|
1803
|
+
getInfo(): ProjectInfo;
|
|
1804
|
+
getInfo(key: string): any;
|
|
1805
|
+
updateInfo<T>(keyOrValue: string | ProjectInfo, value?: T): Promise<boolean>;
|
|
1806
|
+
open(projectPath: string): Promise<boolean>;
|
|
1807
|
+
close(): Promise<boolean>;
|
|
1808
|
+
/**
|
|
1809
|
+
* Generates project information object
|
|
1810
|
+
*
|
|
1811
|
+
* @param {string} projectPath - The project directory path
|
|
1812
|
+
* @param {ProjectType} type - The project type (2d or 3d)
|
|
1813
|
+
* @returns {ProjectInfo} Generated project information
|
|
1814
|
+
*/
|
|
1815
|
+
private static generateProjectInfo;
|
|
1816
|
+
/**
|
|
1817
|
+
* Validates if the project information is valid
|
|
1818
|
+
*
|
|
1819
|
+
* @param {ProjectInfo} info - The project information to validate
|
|
1820
|
+
* @returns {boolean} Returns true if the project info is valid, false otherwise
|
|
1821
|
+
*/
|
|
1822
|
+
private isValid;
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
/**
|
|
1826
|
+
* Project creator information
|
|
1827
|
+
*/
|
|
1828
|
+
declare interface ProjectCreatorInfo {
|
|
1829
|
+
/**
|
|
1830
|
+
* Version of the tool or engine used to create the project
|
|
1831
|
+
*/
|
|
1832
|
+
version: string;
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* Dependencies of the project
|
|
1836
|
+
* - key: package name
|
|
1837
|
+
* - value: version number
|
|
1838
|
+
*/
|
|
1839
|
+
dependencies?: {
|
|
1840
|
+
[name: string]: string,
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* Registry configuration for package management
|
|
1845
|
+
*/
|
|
1846
|
+
registry?: {
|
|
1847
|
+
/**
|
|
1848
|
+
* Remote repository configuration (e.g., npm, private registry)
|
|
1849
|
+
*/
|
|
1850
|
+
remote?: {};
|
|
1851
|
+
};
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* Project information
|
|
1856
|
+
*/
|
|
1857
|
+
declare interface ProjectInfo {
|
|
1858
|
+
/**
|
|
1859
|
+
* Project name
|
|
1860
|
+
*/
|
|
1861
|
+
name: string;
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* Project type ('2d' or '3d')
|
|
1865
|
+
*/
|
|
1866
|
+
type: ProjectType;
|
|
1867
|
+
|
|
1868
|
+
/**
|
|
1869
|
+
* Project version
|
|
1870
|
+
*/
|
|
1871
|
+
version: string;
|
|
1872
|
+
|
|
1873
|
+
/**
|
|
1874
|
+
* Unique identifier (UUID) of the project
|
|
1875
|
+
*/
|
|
1876
|
+
uuid: string;
|
|
1877
|
+
|
|
1878
|
+
/**
|
|
1879
|
+
* Information about the creator of the project
|
|
1880
|
+
*/
|
|
1881
|
+
creator: ProjectCreatorInfo;
|
|
1882
|
+
|
|
1883
|
+
/**
|
|
1884
|
+
* Other additional properties (flexible extension)
|
|
1885
|
+
*/
|
|
1886
|
+
[key: string]: any;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* Project type
|
|
1891
|
+
* - '2d': 2D Project
|
|
1892
|
+
* - '3d': 3D Project
|
|
1893
|
+
*/
|
|
1894
|
+
declare type ProjectType = '2d' | '3d';
|
|
1895
|
+
|
|
1313
1896
|
/**
|
|
1314
1897
|
* Query Asset Config Map // 查询资源配置映射表
|
|
1315
1898
|
*/
|
|
@@ -1437,7 +2020,10 @@ declare function saveAsset(pathOrUrlOrUUID: string, data: string | Buffer): Prom
|
|
|
1437
2020
|
|
|
1438
2021
|
export declare namespace Scripting {
|
|
1439
2022
|
export {
|
|
1440
|
-
init_6 as init
|
|
2023
|
+
init_6 as init,
|
|
2024
|
+
SharedSettings,
|
|
2025
|
+
IPluginScriptInfo,
|
|
2026
|
+
FilterPluginOptions
|
|
1441
2027
|
};
|
|
1442
2028
|
}
|
|
1443
2029
|
|
|
@@ -1457,6 +2043,22 @@ declare interface SerializedAssetFinder {
|
|
|
1457
2043
|
|
|
1458
2044
|
declare function set<T>(key: string, value: T, scope?: ConfigurationScope): Promise<boolean>;
|
|
1459
2045
|
|
|
2046
|
+
declare interface SharedSettings {
|
|
2047
|
+
useDefineForClassFields: boolean;
|
|
2048
|
+
allowDeclareFields: boolean;
|
|
2049
|
+
loose: boolean;
|
|
2050
|
+
guessCommonJsExports: boolean;
|
|
2051
|
+
exportsConditions: string[];
|
|
2052
|
+
preserveSymlinks: boolean;
|
|
2053
|
+
importMap?: {
|
|
2054
|
+
json: {
|
|
2055
|
+
imports?: Record<string, string>;
|
|
2056
|
+
scopes?: Record<string, Record<string, string>>;
|
|
2057
|
+
};
|
|
2058
|
+
url: string;
|
|
2059
|
+
};
|
|
2060
|
+
}
|
|
2061
|
+
|
|
1460
2062
|
declare interface SimplifyOptions {
|
|
1461
2063
|
// 压缩比例
|
|
1462
2064
|
targetRatio?: number;
|