@cocos/cocos-cli-types 0.0.1-alpha.21.2 → 0.0.1-alpha.22.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 +13 -1
- package/builder.d.ts +1 -0
- package/configuration.d.ts +15 -10
- package/engine.d.ts +9 -0
- package/index.d.ts +42 -11
- package/package.json +1 -1
- package/service.d.ts +1158 -26
package/assets.d.ts
CHANGED
|
@@ -403,6 +403,11 @@ declare interface FontDefDictionary {
|
|
|
403
403
|
[charId: number]: FontDef;
|
|
404
404
|
}
|
|
405
405
|
|
|
406
|
+
/**
|
|
407
|
+
* Generate Thumbnail // 生成资源缩略图
|
|
408
|
+
*/
|
|
409
|
+
export declare function generateThumbnail(urlOrUUIDOrPath: string, size?: ThumbnailSize): Promise<ThumbnailInfo | null>;
|
|
410
|
+
|
|
406
411
|
/** glTF 动画资源的 userData */
|
|
407
412
|
declare interface GltfAnimationAssetUserData {
|
|
408
413
|
gltfIndex: number;
|
|
@@ -589,7 +594,6 @@ export declare interface IAssetConfig {
|
|
|
589
594
|
description?: string;
|
|
590
595
|
docURL?: string;
|
|
591
596
|
userDataConfig?: Record<string, IUerDataConfigItem>;
|
|
592
|
-
iconInfo?: ThumbnailInfo;
|
|
593
597
|
}
|
|
594
598
|
|
|
595
599
|
export declare interface IAssetDBInfo extends AssetDBOptions_2 {
|
|
@@ -636,6 +640,7 @@ export declare interface IAssetInfo {
|
|
|
636
640
|
mtime?: number; // 资源文件的 mtime
|
|
637
641
|
depends?: string[]; // 依赖的资源 uuid 信息
|
|
638
642
|
dependeds?: string[]; // 被依赖的资源 uuid 信息
|
|
643
|
+
temp?: string; // 资源临时文件目录
|
|
639
644
|
}
|
|
640
645
|
|
|
641
646
|
export declare interface IAssetMeta<T extends ISupportCreateType | 'unknown' = 'unknown'> {
|
|
@@ -1205,6 +1210,11 @@ export declare function queryPath(urlOrUuid: string): Promise<string>;
|
|
|
1205
1210
|
*/
|
|
1206
1211
|
export declare function querySortedPlugins(filterOptions?: FilterPluginOptions): Promise<IPluginScriptInfo[]>;
|
|
1207
1212
|
|
|
1213
|
+
/**
|
|
1214
|
+
* Query Thumbnail Handlers // 查询支持缩略图生成的资源处理器列表
|
|
1215
|
+
*/
|
|
1216
|
+
export declare function queryThumbnailHandlers(): string[];
|
|
1217
|
+
|
|
1208
1218
|
/**
|
|
1209
1219
|
* Query Asset URL // 查询资源 URL
|
|
1210
1220
|
*/
|
|
@@ -1402,6 +1412,8 @@ declare interface ThumbnailInfo {
|
|
|
1402
1412
|
value: string; // 具体 icon 名字或者 image 路径,image 路径支持绝对路径、 db:// 、 project:// 、和 packages:// 下的路径
|
|
1403
1413
|
}
|
|
1404
1414
|
|
|
1415
|
+
declare type ThumbnailSize = 'large' | 'small' | 'middle' | 'origin';
|
|
1416
|
+
|
|
1405
1417
|
/**
|
|
1406
1418
|
* Update Asset User Data // 更新资源用户数据
|
|
1407
1419
|
*/
|
package/builder.d.ts
CHANGED
|
@@ -1751,6 +1751,7 @@ declare interface IAssetInfo_2 {
|
|
|
1751
1751
|
mtime?: number; // 资源文件的 mtime
|
|
1752
1752
|
depends?: string[]; // 依赖的资源 uuid 信息
|
|
1753
1753
|
dependeds?: string[]; // 被依赖的资源 uuid 信息
|
|
1754
|
+
temp?: string; // 资源临时文件目录
|
|
1754
1755
|
}
|
|
1755
1756
|
|
|
1756
1757
|
export declare type IAssetInfoMap = Record<UUID, IAssetInfo>;
|
package/configuration.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ declare type EventEmitterMethods = Pick<EventEmitter, 'on' | 'off' | 'once' | 'e
|
|
|
9
9
|
|
|
10
10
|
export declare function get<T>(key: string, scope?: ConfigurationScope): Promise<T>;
|
|
11
11
|
|
|
12
|
+
export declare function getConfigPath(): Promise<string>;
|
|
13
|
+
|
|
12
14
|
export declare function getMetadata(): Promise<ICocosConfigurationNode[]>;
|
|
13
15
|
|
|
14
16
|
/**
|
|
@@ -23,6 +25,7 @@ export declare interface IBaseConfiguration extends EventEmitterMethods {
|
|
|
23
25
|
* 默认配置数据
|
|
24
26
|
*/
|
|
25
27
|
getDefaultConfig(): Record<string, any> | undefined;
|
|
28
|
+
mergeDefaultConfig(defaultConfig?: Record<string, any>): void;
|
|
26
29
|
/**
|
|
27
30
|
* 获取配置值
|
|
28
31
|
* @param key 配置键名,支持点号分隔的嵌套路径
|
|
@@ -61,26 +64,21 @@ export declare interface ICocosConfigurationNode {
|
|
|
61
64
|
properties: Record<string, ICocosConfigurationPropertySchema>;
|
|
62
65
|
}
|
|
63
66
|
|
|
64
|
-
/**
|
|
65
|
-
* Cocos 配置元数据定义。
|
|
66
|
-
*
|
|
67
|
-
* 基于 COCOS_CONFIG 类型(@types/cocos.config.d.ts)展开,
|
|
68
|
-
* 按 group(顶级模块) → node(二级字段) 组织。
|
|
69
|
-
*
|
|
70
|
-
* 供 Pink 配置面板渲染使用,通过 CocosHostConfiguration.getMetadata() 返回。
|
|
71
|
-
*/
|
|
72
67
|
export declare interface ICocosConfigurationPropertySchema {
|
|
73
68
|
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
74
69
|
default?: unknown;
|
|
75
70
|
title?: string;
|
|
76
71
|
description?: string;
|
|
77
|
-
|
|
78
|
-
enum?: any[];
|
|
72
|
+
enum?: Array<string | number | boolean>;
|
|
79
73
|
enumDescriptions?: string[];
|
|
80
74
|
minimum?: number;
|
|
81
75
|
maximum?: number;
|
|
82
76
|
step?: number;
|
|
83
77
|
order?: number;
|
|
78
|
+
properties?: Record<string, ICocosConfigurationPropertySchema>;
|
|
79
|
+
items?: ICocosConfigurationPropertySchema | ICocosConfigurationPropertySchema[];
|
|
80
|
+
additionalProperties?: boolean | ICocosConfigurationPropertySchema;
|
|
81
|
+
required?: string[];
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
/**
|
|
@@ -99,6 +97,13 @@ export declare function migrate(): Promise<void>;
|
|
|
99
97
|
|
|
100
98
|
export declare function migrateFromProject(): Promise<IConfiguration>;
|
|
101
99
|
|
|
100
|
+
/**
|
|
101
|
+
* 注册 configurationManager 保存事件的监听器
|
|
102
|
+
* 每次 cocos.config.json 被写入磁盘时触发
|
|
103
|
+
* @returns 取消监听的函数
|
|
104
|
+
*/
|
|
105
|
+
export declare function onDidSave(callback: () => void): () => void;
|
|
106
|
+
|
|
102
107
|
export declare function reload(): Promise<void>;
|
|
103
108
|
|
|
104
109
|
export declare function remove(key: string, scope?: ConfigurationScope): Promise<boolean>;
|
package/engine.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { __private } from 'cc';
|
|
2
|
+
|
|
1
3
|
export declare interface BaseItem {
|
|
2
4
|
/**
|
|
3
5
|
* @zh 在项目设置上显示的模块名称,支持 i18n 格式
|
|
@@ -352,6 +354,13 @@ export declare interface ModuleRenderConfig {
|
|
|
352
354
|
migrationScript?: string;
|
|
353
355
|
}
|
|
354
356
|
|
|
357
|
+
export declare function queryLayerBuiltin(): Promise<{
|
|
358
|
+
name: string;
|
|
359
|
+
value: number;
|
|
360
|
+
}[]>;
|
|
361
|
+
|
|
362
|
+
export declare function querySortingLayerBuiltin(): Promise<readonly __private._cocos_sorting_sorting_layers__SortingItem[]>;
|
|
363
|
+
|
|
355
364
|
export declare function startEngineCompilation(force?: boolean): Promise<void>;
|
|
356
365
|
|
|
357
366
|
export { };
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
+
import { __private } from 'cc';
|
|
3
4
|
import { ChunkInfo } from '@cocos/creator-programming-quick-pack/lib/loader';
|
|
4
5
|
import { EventEmitter } from 'events';
|
|
5
6
|
import { NextFunction } from 'express';
|
|
@@ -259,6 +260,8 @@ export declare namespace Assets {
|
|
|
259
260
|
queryAssetUserDataConfig,
|
|
260
261
|
updateAssetUserData,
|
|
261
262
|
queryAssetConfigMap,
|
|
263
|
+
queryThumbnailHandlers,
|
|
264
|
+
generateThumbnail,
|
|
262
265
|
onAssetAdded,
|
|
263
266
|
onAssetChanged,
|
|
264
267
|
onAssetRemoved,
|
|
@@ -456,6 +459,8 @@ export declare namespace Configuration {
|
|
|
456
459
|
set,
|
|
457
460
|
remove,
|
|
458
461
|
save,
|
|
462
|
+
getConfigPath,
|
|
463
|
+
onDidSave,
|
|
459
464
|
getMetadata,
|
|
460
465
|
IConfiguration,
|
|
461
466
|
ConfigurationScope,
|
|
@@ -549,6 +554,8 @@ export declare namespace Engine {
|
|
|
549
554
|
getConfig,
|
|
550
555
|
initEngine,
|
|
551
556
|
startEngineCompilation,
|
|
557
|
+
queryLayerBuiltin,
|
|
558
|
+
querySortingLayerBuiltin,
|
|
552
559
|
EngineInfo,
|
|
553
560
|
IFlags,
|
|
554
561
|
MakeRequired,
|
|
@@ -657,12 +664,19 @@ declare interface FontDefDictionary {
|
|
|
657
664
|
[charId: number]: FontDef;
|
|
658
665
|
}
|
|
659
666
|
|
|
667
|
+
/**
|
|
668
|
+
* Generate Thumbnail // 生成资源缩略图
|
|
669
|
+
*/
|
|
670
|
+
declare function generateThumbnail(urlOrUUIDOrPath: string, size?: ThumbnailSize): Promise<ThumbnailInfo | null>;
|
|
671
|
+
|
|
660
672
|
declare function get<T>(key: string, scope?: ConfigurationScope): Promise<T>;
|
|
661
673
|
|
|
662
674
|
declare function get_2(): Promise<Project_2>;
|
|
663
675
|
|
|
664
676
|
declare function getConfig(useDefault?: boolean): Promise<IEngineConfig>;
|
|
665
677
|
|
|
678
|
+
declare function getConfigPath(): Promise<string>;
|
|
679
|
+
|
|
666
680
|
declare function getInfo(): Promise<EngineInfo>;
|
|
667
681
|
|
|
668
682
|
declare function getInfo_2(): Promise<ProjectInfo>;
|
|
@@ -879,7 +893,6 @@ declare interface IAssetConfig {
|
|
|
879
893
|
description?: string;
|
|
880
894
|
docURL?: string;
|
|
881
895
|
userDataConfig?: Record<string, IUerDataConfigItem>;
|
|
882
|
-
iconInfo?: ThumbnailInfo;
|
|
883
896
|
}
|
|
884
897
|
|
|
885
898
|
declare interface IAssetDBInfo extends AssetDBOptions {
|
|
@@ -926,6 +939,7 @@ declare interface IAssetInfo {
|
|
|
926
939
|
mtime?: number; // 资源文件的 mtime
|
|
927
940
|
depends?: string[]; // 依赖的资源 uuid 信息
|
|
928
941
|
dependeds?: string[]; // 被依赖的资源 uuid 信息
|
|
942
|
+
temp?: string; // 资源临时文件目录
|
|
929
943
|
}
|
|
930
944
|
|
|
931
945
|
declare interface IAssetMeta<T extends ISupportCreateType | 'unknown' = 'unknown'> {
|
|
@@ -981,6 +995,7 @@ declare interface IBaseConfiguration extends EventEmitterMethods {
|
|
|
981
995
|
* 默认配置数据
|
|
982
996
|
*/
|
|
983
997
|
getDefaultConfig(): Record<string, any> | undefined;
|
|
998
|
+
mergeDefaultConfig(defaultConfig?: Record<string, any>): void;
|
|
984
999
|
/**
|
|
985
1000
|
* 获取配置值
|
|
986
1001
|
* @param key 配置键名,支持点号分隔的嵌套路径
|
|
@@ -1024,26 +1039,21 @@ declare interface ICocosConfigurationNode {
|
|
|
1024
1039
|
properties: Record<string, ICocosConfigurationPropertySchema>;
|
|
1025
1040
|
}
|
|
1026
1041
|
|
|
1027
|
-
/**
|
|
1028
|
-
* Cocos 配置元数据定义。
|
|
1029
|
-
*
|
|
1030
|
-
* 基于 COCOS_CONFIG 类型(@types/cocos.config.d.ts)展开,
|
|
1031
|
-
* 按 group(顶级模块) → node(二级字段) 组织。
|
|
1032
|
-
*
|
|
1033
|
-
* 供 Pink 配置面板渲染使用,通过 CocosHostConfiguration.getMetadata() 返回。
|
|
1034
|
-
*/
|
|
1035
1042
|
declare interface ICocosConfigurationPropertySchema {
|
|
1036
1043
|
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
1037
1044
|
default?: unknown;
|
|
1038
1045
|
title?: string;
|
|
1039
1046
|
description?: string;
|
|
1040
|
-
|
|
1041
|
-
enum?: any[];
|
|
1047
|
+
enum?: Array<string | number | boolean>;
|
|
1042
1048
|
enumDescriptions?: string[];
|
|
1043
1049
|
minimum?: number;
|
|
1044
1050
|
maximum?: number;
|
|
1045
1051
|
step?: number;
|
|
1046
1052
|
order?: number;
|
|
1053
|
+
properties?: Record<string, ICocosConfigurationPropertySchema>;
|
|
1054
|
+
items?: ICocosConfigurationPropertySchema | ICocosConfigurationPropertySchema[];
|
|
1055
|
+
additionalProperties?: boolean | ICocosConfigurationPropertySchema;
|
|
1056
|
+
required?: string[];
|
|
1047
1057
|
}
|
|
1048
1058
|
|
|
1049
1059
|
declare interface ICollisionMatrix {
|
|
@@ -1802,6 +1812,13 @@ declare function onAssetRemoved(listener: (info: IAssetInfo) => void): () => voi
|
|
|
1802
1812
|
*/
|
|
1803
1813
|
declare function onDBReady(listener: (dbInfo: IAssetDBInfo) => void): () => void;
|
|
1804
1814
|
|
|
1815
|
+
/**
|
|
1816
|
+
* 注册 configurationManager 保存事件的监听器
|
|
1817
|
+
* 每次 cocos.config.json 被写入磁盘时触发
|
|
1818
|
+
* @returns 取消监听的函数
|
|
1819
|
+
*/
|
|
1820
|
+
declare function onDidSave(callback: () => void): () => void;
|
|
1821
|
+
|
|
1805
1822
|
/**
|
|
1806
1823
|
* Register listener for initialization progress.
|
|
1807
1824
|
*
|
|
@@ -2132,6 +2149,11 @@ declare function queryAssetUsers(uuidOrUrl: string, type?: QueryAssetType): Prom
|
|
|
2132
2149
|
*/
|
|
2133
2150
|
declare function queryCreateMap(): Promise<ICreateMenuInfo[]>;
|
|
2134
2151
|
|
|
2152
|
+
declare function queryLayerBuiltin(): Promise<{
|
|
2153
|
+
name: string;
|
|
2154
|
+
value: number;
|
|
2155
|
+
}[]>;
|
|
2156
|
+
|
|
2135
2157
|
/**
|
|
2136
2158
|
* Query Asset Path // 查询资源路径
|
|
2137
2159
|
*/
|
|
@@ -2142,6 +2164,13 @@ declare function queryPath(urlOrUuid: string): Promise<string>;
|
|
|
2142
2164
|
*/
|
|
2143
2165
|
declare function querySortedPlugins(filterOptions?: FilterPluginOptions): Promise<IPluginScriptInfo[]>;
|
|
2144
2166
|
|
|
2167
|
+
declare function querySortingLayerBuiltin(): Promise<readonly __private._cocos_sorting_sorting_layers__SortingItem[]>;
|
|
2168
|
+
|
|
2169
|
+
/**
|
|
2170
|
+
* Query Thumbnail Handlers // 查询支持缩略图生成的资源处理器列表
|
|
2171
|
+
*/
|
|
2172
|
+
declare function queryThumbnailHandlers(): string[];
|
|
2173
|
+
|
|
2145
2174
|
/**
|
|
2146
2175
|
* Query Asset URL // 查询资源 URL
|
|
2147
2176
|
*/
|
|
@@ -2456,6 +2485,8 @@ declare interface ThumbnailInfo {
|
|
|
2456
2485
|
value: string; // 具体 icon 名字或者 image 路径,image 路径支持绝对路径、 db:// 、 project:// 、和 packages:// 下的路径
|
|
2457
2486
|
}
|
|
2458
2487
|
|
|
2488
|
+
declare type ThumbnailSize = 'large' | 'small' | 'middle' | 'origin';
|
|
2489
|
+
|
|
2459
2490
|
/**
|
|
2460
2491
|
* Clean up MCP state.
|
|
2461
2492
|
* Note: does NOT stop the Express server — use the Server module for that.
|