@cocos/cocos-cli-types 0.0.1-alpha.22.1 → 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 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>;
@@ -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
  /**
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,16 +1,12 @@
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';
6
7
  import { Request as Request_2 } from 'express';
7
8
  import { Response as Response_2 } from 'express';
8
9
 
9
- /**
10
- * Add component to node // 添加组件到节点
11
- */
12
- declare function addComponent(options: IAddComponentOptions): Promise<IComponent>;
13
-
14
10
  /** 动画剪辑资源的 userData */
15
11
  declare interface AnimationClipAssetUserData {
16
12
  /** 动画名称 */
@@ -264,6 +260,8 @@ export declare namespace Assets {
264
260
  queryAssetUserDataConfig,
265
261
  updateAssetUserData,
266
262
  queryAssetConfigMap,
263
+ queryThumbnailHandlers,
264
+ generateThumbnail,
267
265
  onAssetAdded,
268
266
  onAssetChanged,
269
267
  onAssetRemoved,
@@ -451,19 +449,6 @@ declare type CCEModuleMap = {
451
449
 
452
450
  declare function close_2(): Promise<void>;
453
451
 
454
- export declare namespace Component {
455
- export {
456
- addComponent,
457
- createComponent,
458
- removeComponent,
459
- queryComponent,
460
- resetComponent,
461
- setProperty,
462
- executeComponentMethod,
463
- queryAllComponent
464
- };
465
- }
466
-
467
452
  export declare namespace Configuration {
468
453
  export {
469
454
  init_3 as init,
@@ -474,6 +459,7 @@ export declare namespace Configuration {
474
459
  set,
475
460
  remove,
476
461
  save,
462
+ getConfigPath,
477
463
  onDidSave,
478
464
  getMetadata,
479
465
  IConfiguration,
@@ -536,11 +522,6 @@ declare interface CreateAssetOptions {
536
522
  customOptions?: Record<string, any>;
537
523
  }
538
524
 
539
- /**
540
- * Add component to node // 添加组件到节点
541
- */
542
- declare function createComponent(options: IAddComponentOptions): Promise<boolean>;
543
-
544
525
  /**
545
526
  * Delete Asset // 删除资源
546
527
  */
@@ -573,6 +554,8 @@ export declare namespace Engine {
573
554
  getConfig,
574
555
  initEngine,
575
556
  startEngineCompilation,
557
+ queryLayerBuiltin,
558
+ querySortingLayerBuiltin,
576
559
  EngineInfo,
577
560
  IFlags,
578
561
  MakeRequired,
@@ -635,8 +618,6 @@ declare interface ExecuteAssetDBScriptMethodOptions {
635
618
  args?: any[];
636
619
  }
637
620
 
638
- declare function executeComponentMethod(options: IExecuteComponentMethodOptions): Promise<boolean>;
639
-
640
621
  declare interface Features {
641
622
  [feature: string]: IModuleItem;
642
623
  }
@@ -683,12 +664,19 @@ declare interface FontDefDictionary {
683
664
  [charId: number]: FontDef;
684
665
  }
685
666
 
667
+ /**
668
+ * Generate Thumbnail // 生成资源缩略图
669
+ */
670
+ declare function generateThumbnail(urlOrUUIDOrPath: string, size?: ThumbnailSize): Promise<ThumbnailInfo | null>;
671
+
686
672
  declare function get<T>(key: string, scope?: ConfigurationScope): Promise<T>;
687
673
 
688
674
  declare function get_2(): Promise<Project_2>;
689
675
 
690
676
  declare function getConfig(useDefault?: boolean): Promise<IEngineConfig>;
691
677
 
678
+ declare function getConfigPath(): Promise<string>;
679
+
692
680
  declare function getInfo(): Promise<EngineInfo>;
693
681
 
694
682
  declare function getInfo_2(): Promise<ProjectInfo>;
@@ -900,20 +888,11 @@ declare interface GlTFUserData {
900
888
  };
901
889
  }
902
890
 
903
- /**
904
- * 创建/添加组件
905
- */
906
- declare interface IAddComponentOptions {
907
- nodePathOrUuid: string;
908
- component: string;
909
- }
910
-
911
891
  declare interface IAssetConfig {
912
892
  displayName?: string;
913
893
  description?: string;
914
894
  docURL?: string;
915
895
  userDataConfig?: Record<string, IUerDataConfigItem>;
916
- iconInfo?: ThumbnailInfo;
917
896
  }
918
897
 
919
898
  declare interface IAssetDBInfo extends AssetDBOptions {
@@ -960,6 +939,7 @@ declare interface IAssetInfo {
960
939
  mtime?: number; // 资源文件的 mtime
961
940
  depends?: string[]; // 依赖的资源 uuid 信息
962
941
  dependeds?: string[]; // 被依赖的资源 uuid 信息
942
+ temp?: string; // 资源临时文件目录
963
943
  }
964
944
 
965
945
  declare interface IAssetMeta<T extends ISupportCreateType | 'unknown' = 'unknown'> {
@@ -1080,41 +1060,6 @@ declare interface ICollisionMatrix {
1080
1060
  [x: string]: number;
1081
1061
  }
1082
1062
 
1083
- /**
1084
- * 代表组件属性信息
1085
- */
1086
- declare interface IComponent extends IComponentIdentifier {
1087
- properties: {
1088
- [key: string]: IPropertyValueType;
1089
- };
1090
- prefab: ICompPrefabInfo | null;
1091
- }
1092
-
1093
- declare interface IComponentForPinK extends IProperty {
1094
- value: {
1095
- enabled: IPropertyValueType;
1096
- uuid: IPropertyValueType;
1097
- name: IPropertyValueType;
1098
- } & Record<string, IPropertyValueType>;
1099
- mountedRoot?: string;
1100
- }
1101
-
1102
- /**
1103
- * 代表一个组件
1104
- */
1105
- declare interface IComponentIdentifier {
1106
- cid: string;
1107
- path: string;
1108
- uuid: string;
1109
- name: string;
1110
- type: string;
1111
- enabled: boolean;
1112
- }
1113
-
1114
- declare interface ICompPrefabInfo {
1115
- fileId: string;
1116
- }
1117
-
1118
1063
  /**
1119
1064
  * 配置的格式
1120
1065
  */
@@ -1247,15 +1192,6 @@ declare interface IEngineProjectConfig extends Exclude<IEngineConfig, 'includeMo
1247
1192
  globalConfigKey?: string;
1248
1193
  }
1249
1194
 
1250
- /**
1251
- * 执行组件方法选项
1252
- */
1253
- declare interface IExecuteComponentMethodOptions {
1254
- uuid: string;
1255
- name: string;
1256
- args: any[];
1257
- }
1258
-
1259
1195
  declare interface IFbxSetting {
1260
1196
  /**
1261
1197
  * https://github.com/cocos-creator/FBX-glTF-conv/pull/26
@@ -1561,78 +1497,6 @@ declare interface IProject {
1561
1497
  updateInfo<T>(keyOrValue: string | ProjectInfo, value?: T): Promise<boolean>;
1562
1498
  }
1563
1499
 
1564
- /**
1565
- * 组件的 dump 数据,以 IProperty 格式编码组件信息
1566
- * 与 IComponent 不同,所有属性(包括 uuid, name, enabled)都通过 encodeObject 编码为 IProperty
1567
- */
1568
- declare interface IProperty {
1569
- value: { [key: string]: IPropertyValueType } | IPropertyValueType;
1570
- default?: any; // 默认值
1571
-
1572
- // 多选节点之后,这里存储多个数据,用于自行判断多选后的显示效果,无需更新该数据
1573
- values?: ({ [key: string]: IPropertyValueType } | IPropertyValueType)[];
1574
-
1575
- lock?: { [key in keyof Vec4]?: IPropertyLock };
1576
-
1577
- cid?: string;
1578
- type?: string;
1579
- ui?: { name: string; data?: any }; // 是否用指定的 UI 组件,name 是组件的名称
1580
- readonly?: boolean;
1581
- visible?: boolean;
1582
- name?: string;
1583
-
1584
- elementTypeData?: IProperty; // 数组里的数据的默认值 dump
1585
-
1586
- path?: string; // 数据的搜索路径,这个是由使用方填充的
1587
-
1588
- isArray?: boolean;
1589
- invalid?: boolean;
1590
- extends?: string[]; // 继承链
1591
- displayName?: string; // 显示到界面上的名字
1592
- displayOrder?: number; // 显示排序
1593
- help?: string; // 帮助文档的 url 地址
1594
- group?: IPropertyGroupOptions; // tab
1595
- tooltip?: string; // 提示文本
1596
- editor?: any; // 组件上定义的编辑器数据
1597
- animatable?: boolean; // 是否可以在动画中编辑
1598
- radioGroup?: boolean; // 是否渲染为 RadioGroup
1599
-
1600
- // Enum
1601
- enumList?: any[]; // enum 类型的 list 选项数组
1602
-
1603
- bitmaskList?: any[];
1604
-
1605
- // Number
1606
- min?: number; // 数值类型的最小值
1607
- max?: number; // 数值类型的最大值
1608
- step?: number; // 数值类型的步进值
1609
- slide?: boolean; // 数组是否显示为滑块
1610
- unit?: string; // 显示的单位
1611
- radian?: boolean; // 标识是否为角度
1612
-
1613
- // Label
1614
- multiline?: boolean; // 字符串是否允许换行
1615
- // nullable?: boolean; 属性是否允许为空
1616
-
1617
- optionalTypes?: string[]; // 对属性是 object 且是可变类型的数据的支持,比如 render-pipeline
1618
-
1619
- userData?: { [key: string]: any }; // 用户透传的数据
1620
- }
1621
-
1622
- declare interface IPropertyGroupOptions {
1623
- id: string // 默认 'default'
1624
- name: string,
1625
- displayOrder: number, // 默认 Infinity, 排在最后面
1626
- style: string // 默认为 'tab'
1627
- }
1628
-
1629
- declare type IPropertyLock = {
1630
- default: number;
1631
- message: string
1632
- };
1633
-
1634
- declare type IPropertyValueType = IProperty | IProperty[] | null | undefined | number | boolean | string | Vec4 | Vec3 | Vec2 | Mat4 | any | Array<unknown>
1635
-
1636
1500
  declare interface IRedirectInfo {
1637
1501
  // 跳转资源的类型
1638
1502
  type: string;
@@ -1640,20 +1504,6 @@ declare interface IRedirectInfo {
1640
1504
  uuid: string;
1641
1505
  }
1642
1506
 
1643
- /**
1644
- * 删除组件
1645
- */
1646
- declare interface IRemoveComponentOptions {
1647
- pathOrUuidOrUrl: string;
1648
- }
1649
-
1650
- declare interface ISetPropertyOptionsForPink {
1651
- uuid: string;
1652
- path: string;
1653
- dump: IProperty;
1654
- record?: boolean;
1655
- }
1656
-
1657
1507
  declare interface ISocketConfig {
1658
1508
  connection: (socket: any) => void;
1659
1509
  disconnect: (socket: any) => void;
@@ -1799,28 +1649,6 @@ declare type MacroItem = {
1799
1649
 
1800
1650
  declare type MakeRequired<T, K extends keyof T> = T & Required<Pick<T, K>>;
1801
1651
 
1802
- declare interface Mat4 {
1803
- m00: number;
1804
- m01: number;
1805
- m02: number;
1806
- m03: number;
1807
-
1808
- m04: number;
1809
- m05: number;
1810
- m06: number;
1811
- m07: number;
1812
-
1813
- m08: number;
1814
- m09: number;
1815
- m10: number;
1816
- m11: number;
1817
-
1818
- m12: number;
1819
- m13: number;
1820
- m14: number;
1821
- m15: number;
1822
- }
1823
-
1824
1652
  export declare namespace Mcp {
1825
1653
  export {
1826
1654
  register,
@@ -2258,11 +2086,6 @@ declare interface ProjectInfo {
2258
2086
  */
2259
2087
  declare type ProjectType = '2d' | '3d';
2260
2088
 
2261
- /**
2262
- * Query all component names // 查询所有组件名称
2263
- */
2264
- declare function queryAllComponent(): Promise<string[]>;
2265
-
2266
2089
  /**
2267
2090
  * Query Asset Config Map // 查询资源配置映射表
2268
2091
  */
@@ -2321,16 +2144,16 @@ declare function queryAssetUserDataConfig(urlOrUuidOrPath: string): Promise<fals
2321
2144
  */
2322
2145
  declare function queryAssetUsers(uuidOrUrl: string, type?: QueryAssetType): Promise<string[]>;
2323
2146
 
2324
- /**
2325
- * Query component info // 查询组件信息
2326
- */
2327
- declare function queryComponent(uuid: string): Promise<IComponentForPinK | null>;
2328
-
2329
2147
  /**
2330
2148
  * Query Creatable Asset Map // 查询可创建资源映射表
2331
2149
  */
2332
2150
  declare function queryCreateMap(): Promise<ICreateMenuInfo[]>;
2333
2151
 
2152
+ declare function queryLayerBuiltin(): Promise<{
2153
+ name: string;
2154
+ value: number;
2155
+ }[]>;
2156
+
2334
2157
  /**
2335
2158
  * Query Asset Path // 查询资源路径
2336
2159
  */
@@ -2341,6 +2164,13 @@ declare function queryPath(urlOrUuid: string): Promise<string>;
2341
2164
  */
2342
2165
  declare function querySortedPlugins(filterOptions?: FilterPluginOptions): Promise<IPluginScriptInfo[]>;
2343
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
+
2344
2174
  /**
2345
2175
  * Query Asset URL // 查询资源 URL
2346
2176
  */
@@ -2395,11 +2225,6 @@ declare function reload(): Promise<void>;
2395
2225
 
2396
2226
  declare function remove(key: string, scope?: ConfigurationScope): Promise<boolean>;
2397
2227
 
2398
- /**
2399
- * Remove component from node // 移除节点上的组件
2400
- */
2401
- declare function removeComponent(options: IRemoveComponentOptions): Promise<boolean>;
2402
-
2403
2228
  /**
2404
2229
  * Rename Asset // 重命名资源
2405
2230
  */
@@ -2411,8 +2236,6 @@ declare interface RenderTextureAssetUserData extends TextureBaseAssetUserData {
2411
2236
  height: number;
2412
2237
  }
2413
2238
 
2414
- declare function resetComponent(uuid: string): Promise<void>;
2415
-
2416
2239
  /** 渲染纹理精灵帧的 userData */
2417
2240
  declare interface RtSpriteFrameAssetUserData {
2418
2241
  /** 图片 UUID 或数据库 URI */
@@ -2475,11 +2298,6 @@ export declare namespace Server {
2475
2298
 
2476
2299
  declare function set<T>(key: string, value: T, scope?: ConfigurationScope): Promise<boolean>;
2477
2300
 
2478
- /**
2479
- * Set component property // 设置组件属性
2480
- */
2481
- declare function setProperty(options: ISetPropertyOptionsForPink): Promise<boolean>;
2482
-
2483
2301
  declare interface SharedSettings {
2484
2302
  useDefineForClassFields: boolean;
2485
2303
  allowDeclareFields: boolean;
@@ -2667,6 +2485,8 @@ declare interface ThumbnailInfo {
2667
2485
  value: string; // 具体 icon 名字或者 image 路径,image 路径支持绝对路径、 db:// 、 project:// 、和 packages:// 下的路径
2668
2486
  }
2669
2487
 
2488
+ declare type ThumbnailSize = 'large' | 'small' | 'middle' | 'origin';
2489
+
2670
2490
  /**
2671
2491
  * Clean up MCP state.
2672
2492
  * Note: does NOT stop the Express server — use the Server module for that.
@@ -2683,24 +2503,6 @@ declare function updateAssetUserData(urlOrUuidOrPath: string, path: string, valu
2683
2503
  */
2684
2504
  declare function updateDefaultUserData(handler: string, path: string, value: any): Promise<void>;
2685
2505
 
2686
- declare interface Vec2 {
2687
- x: number;
2688
- y: number;
2689
- }
2690
-
2691
- declare interface Vec3 {
2692
- x: number;
2693
- y: number;
2694
- z: number;
2695
- }
2696
-
2697
- declare interface Vec4 {
2698
- x: number;
2699
- y: number;
2700
- z: number;
2701
- w: number;
2702
- }
2703
-
2704
2506
  declare type WrapMode = 'repeat' | 'clamp-to-edge' | 'mirrored-repeat';
2705
2507
 
2706
2508
  export { };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@cocos/cocos-cli-types",
3
3
  "description": "types for cocos cli",
4
4
  "author": "cocos cli",
5
- "version": "0.0.1-alpha.22.1",
5
+ "version": "0.0.1-alpha.22.2",
6
6
  "main": "index.d.ts",
7
7
  "types": "index.d.ts",
8
8
  "exports": {