@cocos/cocos-cli-types 0.0.1-alpha.22.1 → 0.0.1-alpha.23.1
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/{service.d.ts → cli.d.ts} +337 -624
- package/configuration.d.ts +2 -0
- package/engine.d.ts +9 -0
- package/index.d.ts +994 -55
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
+
import { __private } from 'cc';
|
|
3
4
|
import { ChunkInfo } from '@cocos/creator-programming-quick-pack/lib/loader';
|
|
5
|
+
import type { Component } from 'cc';
|
|
4
6
|
import { EventEmitter } from 'events';
|
|
7
|
+
import { default as i18n_2 } from 'i18next';
|
|
5
8
|
import { NextFunction } from 'express';
|
|
9
|
+
import type { Node as Node_2 } from 'cc';
|
|
6
10
|
import { Request as Request_2 } from 'express';
|
|
7
11
|
import { Response as Response_2 } from 'express';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* Add component to node // 添加组件到节点
|
|
11
|
-
*/
|
|
12
|
-
declare function addComponent(options: IAddComponentOptions): Promise<IComponent>;
|
|
12
|
+
import type { Scene as Scene_2 } from 'cc';
|
|
13
|
+
import type { Vec3 as Vec3_2 } from 'cc';
|
|
13
14
|
|
|
14
15
|
/** 动画剪辑资源的 userData */
|
|
15
16
|
declare interface AnimationClipAssetUserData {
|
|
@@ -264,6 +265,8 @@ export declare namespace Assets {
|
|
|
264
265
|
queryAssetUserDataConfig,
|
|
265
266
|
updateAssetUserData,
|
|
266
267
|
queryAssetConfigMap,
|
|
268
|
+
queryThumbnailHandlers,
|
|
269
|
+
generateThumbnail,
|
|
267
270
|
onAssetAdded,
|
|
268
271
|
onAssetChanged,
|
|
269
272
|
onAssetRemoved,
|
|
@@ -451,19 +454,6 @@ declare type CCEModuleMap = {
|
|
|
451
454
|
|
|
452
455
|
declare function close_2(): Promise<void>;
|
|
453
456
|
|
|
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
457
|
export declare namespace Configuration {
|
|
468
458
|
export {
|
|
469
459
|
init_3 as init,
|
|
@@ -474,6 +464,7 @@ export declare namespace Configuration {
|
|
|
474
464
|
set,
|
|
475
465
|
remove,
|
|
476
466
|
save,
|
|
467
|
+
getConfigPath,
|
|
477
468
|
onDidSave,
|
|
478
469
|
getMetadata,
|
|
479
470
|
IConfiguration,
|
|
@@ -489,6 +480,11 @@ export declare namespace Configuration {
|
|
|
489
480
|
*/
|
|
490
481
|
declare type ConfigurationScope = 'default' | 'project';
|
|
491
482
|
|
|
483
|
+
/**
|
|
484
|
+
* 创建类型
|
|
485
|
+
*/
|
|
486
|
+
declare const CREATE_TYPES: readonly ['scene', 'prefab'];
|
|
487
|
+
|
|
492
488
|
/**
|
|
493
489
|
* Create Asset // 创建资源
|
|
494
490
|
*/
|
|
@@ -536,11 +532,6 @@ declare interface CreateAssetOptions {
|
|
|
536
532
|
customOptions?: Record<string, any>;
|
|
537
533
|
}
|
|
538
534
|
|
|
539
|
-
/**
|
|
540
|
-
* Add component to node // 添加组件到节点
|
|
541
|
-
*/
|
|
542
|
-
declare function createComponent(options: IAddComponentOptions): Promise<boolean>;
|
|
543
|
-
|
|
544
535
|
/**
|
|
545
536
|
* Delete Asset // 删除资源
|
|
546
537
|
*/
|
|
@@ -573,6 +564,8 @@ export declare namespace Engine {
|
|
|
573
564
|
getConfig,
|
|
574
565
|
initEngine,
|
|
575
566
|
startEngineCompilation,
|
|
567
|
+
queryLayerBuiltin,
|
|
568
|
+
querySortingLayerBuiltin,
|
|
576
569
|
EngineInfo,
|
|
577
570
|
IFlags,
|
|
578
571
|
MakeRequired,
|
|
@@ -635,8 +628,6 @@ declare interface ExecuteAssetDBScriptMethodOptions {
|
|
|
635
628
|
args?: any[];
|
|
636
629
|
}
|
|
637
630
|
|
|
638
|
-
declare function executeComponentMethod(options: IExecuteComponentMethodOptions): Promise<boolean>;
|
|
639
|
-
|
|
640
631
|
declare interface Features {
|
|
641
632
|
[feature: string]: IModuleItem;
|
|
642
633
|
}
|
|
@@ -683,12 +674,19 @@ declare interface FontDefDictionary {
|
|
|
683
674
|
[charId: number]: FontDef;
|
|
684
675
|
}
|
|
685
676
|
|
|
677
|
+
/**
|
|
678
|
+
* Generate Thumbnail // 生成资源缩略图
|
|
679
|
+
*/
|
|
680
|
+
declare function generateThumbnail(urlOrUUIDOrPath: string, size?: ThumbnailSize): Promise<ThumbnailInfo | null>;
|
|
681
|
+
|
|
686
682
|
declare function get<T>(key: string, scope?: ConfigurationScope): Promise<T>;
|
|
687
683
|
|
|
688
684
|
declare function get_2(): Promise<Project_2>;
|
|
689
685
|
|
|
690
686
|
declare function getConfig(useDefault?: boolean): Promise<IEngineConfig>;
|
|
691
687
|
|
|
688
|
+
declare function getConfigPath(): Promise<string>;
|
|
689
|
+
|
|
692
690
|
declare function getInfo(): Promise<EngineInfo>;
|
|
693
691
|
|
|
694
692
|
declare function getInfo_2(): Promise<ProjectInfo>;
|
|
@@ -719,6 +717,73 @@ declare function getStatus_2(): {
|
|
|
719
717
|
*/
|
|
720
718
|
declare function getUrl(): string | undefined;
|
|
721
719
|
|
|
720
|
+
/**
|
|
721
|
+
* 全局事件管理器
|
|
722
|
+
* 统一管理所有服务的事件监听,支持类型安全的事件订阅
|
|
723
|
+
*/
|
|
724
|
+
export declare class GlobalEventManager {
|
|
725
|
+
/**
|
|
726
|
+
* 监听指定类型的事件(类型安全版本)
|
|
727
|
+
* @param event 事件名称
|
|
728
|
+
* @param listener 事件监听器
|
|
729
|
+
*/
|
|
730
|
+
on<TEvents extends Record<string, any>>(event: keyof TEvents, listener: TEvents[keyof TEvents] extends void ? () => void : (payload: TEvents[keyof TEvents]) => void): void;
|
|
731
|
+
/**
|
|
732
|
+
* 监听指定类型的事件(通用版本)
|
|
733
|
+
* @param event 事件名称
|
|
734
|
+
* @param listener 事件监听器
|
|
735
|
+
*/
|
|
736
|
+
on(event: string, listener: (...args: any[]) => void): void;
|
|
737
|
+
/**
|
|
738
|
+
* 监听指定类型的事件(一次性,类型安全版本)
|
|
739
|
+
* @param event 事件名称
|
|
740
|
+
* @param listener 事件监听器
|
|
741
|
+
*/
|
|
742
|
+
once<TEvents extends Record<string, any>>(event: keyof TEvents, listener: TEvents[keyof TEvents] extends void ? () => void : (payload: TEvents[keyof TEvents]) => void): void;
|
|
743
|
+
/**
|
|
744
|
+
* 监听指定类型的事件(一次性,通用版本)
|
|
745
|
+
* @param event 事件名称
|
|
746
|
+
* @param listener 事件监听器
|
|
747
|
+
*/
|
|
748
|
+
once(event: string, listener: (...args: any[]) => void): void;
|
|
749
|
+
/**
|
|
750
|
+
* 移除指定类型的事件监听器(类型安全版本)
|
|
751
|
+
* @param event 事件名称
|
|
752
|
+
* @param listener 事件监听器
|
|
753
|
+
*/
|
|
754
|
+
off<TEvents extends Record<string, any>>(event: keyof TEvents, listener: TEvents[keyof TEvents] extends void ? () => void : (payload: TEvents[keyof TEvents]) => void): void;
|
|
755
|
+
/**
|
|
756
|
+
* 移除事件监听器(通用版本)
|
|
757
|
+
* @param event 事件名称
|
|
758
|
+
* @param listener 事件监听器
|
|
759
|
+
*/
|
|
760
|
+
off(event: string, listener: (...args: any[]) => void): void;
|
|
761
|
+
/**
|
|
762
|
+
* 发射指定类型的事件(类型安全版本)
|
|
763
|
+
* @param event 事件名称
|
|
764
|
+
* @param args 事件参数
|
|
765
|
+
*/
|
|
766
|
+
emit<TEvents extends Record<string, any>>(event: keyof TEvents, ...args: TEvents[keyof TEvents]): void;
|
|
767
|
+
/**
|
|
768
|
+
* 触发事件(通用版本)
|
|
769
|
+
* @param event 事件名称
|
|
770
|
+
* @param args 事件参数
|
|
771
|
+
*/
|
|
772
|
+
emit(event: string, ...args: any[]): void;
|
|
773
|
+
/**
|
|
774
|
+
* 跨进程广播,传的参数需要能被序列化
|
|
775
|
+
* @param event 事件名称
|
|
776
|
+
* @param args 事件参数
|
|
777
|
+
*/
|
|
778
|
+
broadcast<TEvents extends Record<string, any>>(event: keyof TEvents, ...args: TEvents[keyof TEvents]): void;
|
|
779
|
+
broadcast(event: string, ...args: any[]): void;
|
|
780
|
+
/**
|
|
781
|
+
* 清除事件监听器
|
|
782
|
+
* @param event 事件名称,如果不提供则清除所有
|
|
783
|
+
*/
|
|
784
|
+
clear(event?: string): void;
|
|
785
|
+
}
|
|
786
|
+
|
|
722
787
|
/** glTF 动画资源的 userData */
|
|
723
788
|
declare interface GltfAnimationAssetUserData {
|
|
724
789
|
gltfIndex: number;
|
|
@@ -900,20 +965,29 @@ declare interface GlTFUserData {
|
|
|
900
965
|
};
|
|
901
966
|
}
|
|
902
967
|
|
|
968
|
+
export declare namespace i18n {
|
|
969
|
+
export {
|
|
970
|
+
i18n_2 as default
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
|
|
903
974
|
/**
|
|
904
|
-
*
|
|
975
|
+
* 添加/创建组件的选项
|
|
905
976
|
*/
|
|
906
977
|
declare interface IAddComponentOptions {
|
|
907
978
|
nodePathOrUuid: string;
|
|
908
979
|
component: string;
|
|
909
980
|
}
|
|
910
981
|
|
|
982
|
+
declare interface IApplyPrefabChangesParams {
|
|
983
|
+
nodePath: string;
|
|
984
|
+
}
|
|
985
|
+
|
|
911
986
|
declare interface IAssetConfig {
|
|
912
987
|
displayName?: string;
|
|
913
988
|
description?: string;
|
|
914
989
|
docURL?: string;
|
|
915
990
|
userDataConfig?: Record<string, IUerDataConfigItem>;
|
|
916
|
-
iconInfo?: ThumbnailInfo;
|
|
917
991
|
}
|
|
918
992
|
|
|
919
993
|
declare interface IAssetDBInfo extends AssetDBOptions {
|
|
@@ -960,6 +1034,7 @@ declare interface IAssetInfo {
|
|
|
960
1034
|
mtime?: number; // 资源文件的 mtime
|
|
961
1035
|
depends?: string[]; // 依赖的资源 uuid 信息
|
|
962
1036
|
dependeds?: string[]; // 被依赖的资源 uuid 信息
|
|
1037
|
+
temp?: string; // 资源临时文件目录
|
|
963
1038
|
}
|
|
964
1039
|
|
|
965
1040
|
declare interface IAssetMeta<T extends ISupportCreateType | 'unknown' = 'unknown'> {
|
|
@@ -977,6 +1052,22 @@ declare interface IAssetMeta<T extends ISupportCreateType | 'unknown' = 'unknown
|
|
|
977
1052
|
name?: string;
|
|
978
1053
|
}
|
|
979
1054
|
|
|
1055
|
+
/**
|
|
1056
|
+
* 场景相关处理接口
|
|
1057
|
+
*/
|
|
1058
|
+
declare interface IAssetService extends IServiceEvents {
|
|
1059
|
+
/**
|
|
1060
|
+
* 资源发生变化时,进行处理
|
|
1061
|
+
* @param uuid
|
|
1062
|
+
*/
|
|
1063
|
+
assetChanged(uuid: string): Promise<void>;
|
|
1064
|
+
/**
|
|
1065
|
+
* 资源删除时,进行处理
|
|
1066
|
+
* @param uuid
|
|
1067
|
+
*/
|
|
1068
|
+
assetDeleted(uuid: string): Promise<void>;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
980
1071
|
declare type IAssetType =
|
|
981
1072
|
| ISupportCreateCCType
|
|
982
1073
|
| 'cc.Asset' // 基础资源类型(instantiation-asset)
|
|
@@ -1046,11 +1137,72 @@ declare interface IBaseConfiguration extends EventEmitterMethods {
|
|
|
1046
1137
|
save(): Promise<boolean>;
|
|
1047
1138
|
}
|
|
1048
1139
|
|
|
1140
|
+
declare interface IBaseCreateNodeParams {
|
|
1141
|
+
path: string;
|
|
1142
|
+
name?: string;
|
|
1143
|
+
workMode?: '2d' | '3d';
|
|
1144
|
+
position?: IVec3;
|
|
1145
|
+
keepWorldTransform?: boolean;
|
|
1146
|
+
canvasRequired?: boolean;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* 基础标识
|
|
1151
|
+
*/
|
|
1152
|
+
declare interface IBaseIdentifier {
|
|
1153
|
+
assetName: string;
|
|
1154
|
+
assetUuid: string;
|
|
1155
|
+
assetUrl: string;
|
|
1156
|
+
assetType: string;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
declare interface ICameraService {
|
|
1160
|
+
init(): void;
|
|
1161
|
+
initFromConfig(): Promise<void>;
|
|
1162
|
+
is2D: boolean;
|
|
1163
|
+
focus(nodes?: string[] | null, editorCameraInfo?: any, immediate?: boolean): void;
|
|
1164
|
+
defaultFocus(uuid: string): void;
|
|
1165
|
+
rotateCameraToDir(dir: Vec3_2, rotateByViewDist: boolean): void;
|
|
1166
|
+
changeProjection(): void;
|
|
1167
|
+
setGridVisible(value: boolean): void;
|
|
1168
|
+
isGridVisible(): boolean;
|
|
1169
|
+
setCameraProperty(options: any): void;
|
|
1170
|
+
resetCameraProperty(): void;
|
|
1171
|
+
getCameraFov(): number;
|
|
1172
|
+
zoomUp(): void;
|
|
1173
|
+
zoomDown(): void;
|
|
1174
|
+
zoomReset(): void;
|
|
1175
|
+
alignNodeToSceneView(nodes: string[]): void;
|
|
1176
|
+
alignSceneViewToNode(nodes: string[]): void;
|
|
1177
|
+
onUpdate(deltaTime: number): void;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
declare interface IChangeNodeOptions {
|
|
1181
|
+
source?: 'editor' | 'undo' | 'engine';
|
|
1182
|
+
type?: NodeEventType;
|
|
1183
|
+
propPath?: string;
|
|
1184
|
+
index?: number;
|
|
1185
|
+
record?: boolean;
|
|
1186
|
+
dumpImmediately?: boolean;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1049
1189
|
declare interface IChunkContent {
|
|
1050
1190
|
skeleton: null | string;
|
|
1051
1191
|
clips: string[];
|
|
1052
1192
|
}
|
|
1053
1193
|
|
|
1194
|
+
export declare interface ICLI {
|
|
1195
|
+
Scene: IServiceManager;
|
|
1196
|
+
SceneEvents: GlobalEventManager;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* 关闭场景/预制体选项
|
|
1201
|
+
*/
|
|
1202
|
+
declare interface ICloseOptions {
|
|
1203
|
+
urlOrUUID?: string;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1054
1206
|
declare interface ICocosConfigurationNode {
|
|
1055
1207
|
id: string;
|
|
1056
1208
|
title: string;
|
|
@@ -1081,7 +1233,7 @@ declare interface ICollisionMatrix {
|
|
|
1081
1233
|
}
|
|
1082
1234
|
|
|
1083
1235
|
/**
|
|
1084
|
-
*
|
|
1236
|
+
* CLI 使用的组件信息,属性值以扁平的 key-value 形式呈现
|
|
1085
1237
|
*/
|
|
1086
1238
|
declare interface IComponent extends IComponentIdentifier {
|
|
1087
1239
|
properties: {
|
|
@@ -1090,7 +1242,11 @@ declare interface IComponent extends IComponentIdentifier {
|
|
|
1090
1242
|
prefab: ICompPrefabInfo | null;
|
|
1091
1243
|
}
|
|
1092
1244
|
|
|
1093
|
-
|
|
1245
|
+
/**
|
|
1246
|
+
* 编辑器使用的组件详细信息,属性值以 IProperty 编码形式呈现,
|
|
1247
|
+
* 包含 type、readonly、default 等元信息,用于编辑器 Inspector 面板渲染
|
|
1248
|
+
*/
|
|
1249
|
+
declare interface IComponentForEditor extends IProperty {
|
|
1094
1250
|
value: {
|
|
1095
1251
|
enabled: IPropertyValueType;
|
|
1096
1252
|
uuid: IPropertyValueType;
|
|
@@ -1100,7 +1256,7 @@ declare interface IComponentForPinK extends IProperty {
|
|
|
1100
1256
|
}
|
|
1101
1257
|
|
|
1102
1258
|
/**
|
|
1103
|
-
*
|
|
1259
|
+
* 组件标识信息,包含组件的基本标识字段
|
|
1104
1260
|
*/
|
|
1105
1261
|
declare interface IComponentIdentifier {
|
|
1106
1262
|
cid: string;
|
|
@@ -1111,6 +1267,144 @@ declare interface IComponentIdentifier {
|
|
|
1111
1267
|
enabled: boolean;
|
|
1112
1268
|
}
|
|
1113
1269
|
|
|
1270
|
+
/**
|
|
1271
|
+
* 组件服务接口,定义了所有组件相关的操作方法
|
|
1272
|
+
*/
|
|
1273
|
+
declare interface IComponentService extends IServiceEvents {
|
|
1274
|
+
/**
|
|
1275
|
+
* 添加组件到指定节点,返回添加后的组件信息
|
|
1276
|
+
* @param params - 添加组件选项
|
|
1277
|
+
* @param params.nodePathOrUuid - 目标节点路径或 UUID
|
|
1278
|
+
* @param params.component - 组件类名,支持精确匹配('cc.Label')和模糊匹配('label')
|
|
1279
|
+
* @returns 添加成功后的组件信息
|
|
1280
|
+
*
|
|
1281
|
+
* @example
|
|
1282
|
+
* ```ts
|
|
1283
|
+
* // 通过节点路径 + 精确组件名
|
|
1284
|
+
* const comp = await addComponent({ nodePathOrUuid: 'Canvas/MyNode', component: 'cc.Label' });
|
|
1285
|
+
*
|
|
1286
|
+
* // 通过节点 UUID + 模糊组件名
|
|
1287
|
+
* const comp = await addComponent({ nodePathOrUuid: 'abc-123-uuid', component: 'label' });
|
|
1288
|
+
* ```
|
|
1289
|
+
*/
|
|
1290
|
+
addComponent(params: IAddComponentOptions): Promise<IComponent>;
|
|
1291
|
+
/**
|
|
1292
|
+
* 删除指定组件
|
|
1293
|
+
* @param params - 删除组件选项
|
|
1294
|
+
* @param params.path - 组件路径,支持路径、UUID 或资源 URL
|
|
1295
|
+
* @returns 删除成功返回 true,失败返回 false
|
|
1296
|
+
*/
|
|
1297
|
+
removeComponent(params: IRemoveComponentOptions): Promise<boolean>;
|
|
1298
|
+
/**
|
|
1299
|
+
* 设置组件属性
|
|
1300
|
+
* - CLI 调用时传入 ISetPropertyOptions,通过 componentPath 定位,属性为扁平键值对
|
|
1301
|
+
* - 编辑器调用时传入 ISetPropertyOptionsForEditor,通过节点 UUID + dump 路径定位,属性为 IProperty 格式
|
|
1302
|
+
*
|
|
1303
|
+
* @param params - 设置属性选项,根据调用方不同传入不同类型
|
|
1304
|
+
* @returns 设置成功返回 true,失败返回 false
|
|
1305
|
+
*
|
|
1306
|
+
* @example
|
|
1307
|
+
* ```ts
|
|
1308
|
+
* // CLI 方式:通过 componentPath 定位,直接传属性键值对
|
|
1309
|
+
* await setProperty({
|
|
1310
|
+
* componentPath: 'Canvas/cc.Label_1',
|
|
1311
|
+
* properties: { string: 'Hello', fontSize: 32 },
|
|
1312
|
+
* });
|
|
1313
|
+
*
|
|
1314
|
+
* // 编辑器方式:通过节点 UUID + dump 路径定位,传 IProperty 格式
|
|
1315
|
+
* await setProperty({
|
|
1316
|
+
* uuid: 'node-uuid',
|
|
1317
|
+
* path: '__comps__.0.string',
|
|
1318
|
+
* dump: { value: 'Hello', type: 'String' },
|
|
1319
|
+
* });
|
|
1320
|
+
* ```
|
|
1321
|
+
*/
|
|
1322
|
+
setProperty(params: ISetPropertyOptions | ISetPropertyOptionsForEditor): Promise<boolean>;
|
|
1323
|
+
/**
|
|
1324
|
+
* 查询组件信息
|
|
1325
|
+
* - 传入 IQueryComponentOptions 时,返回 IComponent 或 IComponent
|
|
1326
|
+
* - 传入 string 时,返回 IComponentForEditor
|
|
1327
|
+
*
|
|
1328
|
+
* @param params - 查询选项或组件路径字符串
|
|
1329
|
+
* @returns 如果传入的是 IQueryComponentOptions 时返回 IComponent,如果传入是string时返回 IComponentForEditor,未找到返回 null
|
|
1330
|
+
*
|
|
1331
|
+
* @example
|
|
1332
|
+
* ```ts
|
|
1333
|
+
* CLI 模式:返回 IComponent(扁平属性)
|
|
1334
|
+
* const comp = await queryComponent({ path: 'Canvas/cc.Label_1' }) as IComponent;
|
|
1335
|
+
*
|
|
1336
|
+
* 编辑器模式:直接传 string,这里是uuid,因为与cli重复了,也支持 path 和 url
|
|
1337
|
+
* const comp = await queryComponent('uuid') as IComponentForEditor;
|
|
1338
|
+
* ```
|
|
1339
|
+
*/
|
|
1340
|
+
queryComponent(params: IQueryComponentOptions | string): Promise<IComponent | IComponentForEditor | null>;
|
|
1341
|
+
/**
|
|
1342
|
+
* 获取所有已注册的组件类名,包含内置与自定义组件
|
|
1343
|
+
* @returns 组件类名数组,如 ['cc.Label', 'cc.Sprite', 'MyCustomComponent']
|
|
1344
|
+
*/
|
|
1345
|
+
queryAllComponent(): Promise<string[]>;
|
|
1346
|
+
/**
|
|
1347
|
+
* 创建组件(编辑器使用),与 addComponent 不同的是仅返回是否成功
|
|
1348
|
+
* @param params - 添加组件选项
|
|
1349
|
+
* @param params.nodePathOrUuid - 目标节点路径或 UUID
|
|
1350
|
+
* @param params.component - 组件类名
|
|
1351
|
+
* @returns 创建成功返回 true,失败返回 false
|
|
1352
|
+
*/
|
|
1353
|
+
createComponent(params: IAddComponentOptions): Promise<boolean>;
|
|
1354
|
+
/**
|
|
1355
|
+
* 复位组件,将组件所有属性恢复为默认值
|
|
1356
|
+
* @param params - 查询组件选项,用于定位要复位的组件
|
|
1357
|
+
* @param params.path - 组件路径,支持路径、UUID 或资源 URL
|
|
1358
|
+
* @returns 复位成功返回 true,失败返回 false
|
|
1359
|
+
*/
|
|
1360
|
+
resetComponent(params: IQueryComponentOptions): Promise<boolean>;
|
|
1361
|
+
/**
|
|
1362
|
+
* 获取所有注册类名,支持按继承关系过滤
|
|
1363
|
+
* @param options - 过滤选项,不传则返回所有注册类
|
|
1364
|
+
* @param options.extends - 父类名称,只返回继承自该类的子类,支持字符串或字符串数组
|
|
1365
|
+
* @param options.excludeSelf - 是否排除父类自身,默认 false
|
|
1366
|
+
* @returns 类名对象数组,如 [{ name: 'cc.Label' }, { name: 'cc.Sprite' }]
|
|
1367
|
+
*
|
|
1368
|
+
* @example
|
|
1369
|
+
* ```ts
|
|
1370
|
+
* // 查询所有注册类
|
|
1371
|
+
* const all = await queryClasses();
|
|
1372
|
+
*
|
|
1373
|
+
* // 查询 cc.Component 的所有子类(含自身)
|
|
1374
|
+
* const comps = await queryClasses({ extends: 'cc.Component' });
|
|
1375
|
+
*
|
|
1376
|
+
* // 查询 cc.Component 的所有子类(排除自身)
|
|
1377
|
+
* const subComps = await queryClasses({ extends: 'cc.Component', excludeSelf: true });
|
|
1378
|
+
* ```
|
|
1379
|
+
*/
|
|
1380
|
+
queryClasses(options?: IQueryClassesOptions): Promise<{
|
|
1381
|
+
name: string;
|
|
1382
|
+
}[]>;
|
|
1383
|
+
/**
|
|
1384
|
+
* 查询指定节点上所有组件暴露的可调用函数
|
|
1385
|
+
* @param uuid - 节点 UUID
|
|
1386
|
+
* @returns 节点上组件的函数信息,节点不存在时返回空对象
|
|
1387
|
+
*/
|
|
1388
|
+
queryComponentFunctionOfNode(uuid: string): Promise<any>;
|
|
1389
|
+
/**
|
|
1390
|
+
* 执行组件上的指定方法
|
|
1391
|
+
* @param options - 执行选项
|
|
1392
|
+
* @param options.uuid - 组件实例的 UUID
|
|
1393
|
+
* @param options.name - 要执行的方法名,如 'onLoad'、'start'
|
|
1394
|
+
* @param options.args - 方法参数列表
|
|
1395
|
+
* @returns 执行成功返回 true,失败返回 false
|
|
1396
|
+
*/
|
|
1397
|
+
executeComponentMethod(options: IExecuteComponentMethodOptions): Promise<boolean>;
|
|
1398
|
+
/**
|
|
1399
|
+
* 查询指定名称的组件是否已注册(是否存在对应脚本)
|
|
1400
|
+
* @param name - 组件类名,如 'cc.Label'
|
|
1401
|
+
* @returns 存在返回 true,不存在返回 false
|
|
1402
|
+
*/
|
|
1403
|
+
queryComponentHasScript(name: string): Promise<boolean>;
|
|
1404
|
+
init(): void;
|
|
1405
|
+
unregisterCompMgrEvents(): void;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1114
1408
|
declare interface ICompPrefabInfo {
|
|
1115
1409
|
fileId: string;
|
|
1116
1410
|
}
|
|
@@ -1125,6 +1419,14 @@ declare interface IConfiguration {
|
|
|
1125
1419
|
[key: string]: any;
|
|
1126
1420
|
}
|
|
1127
1421
|
|
|
1422
|
+
declare interface ICreateByAssetParams extends IBaseCreateNodeParams {
|
|
1423
|
+
dbURL: string;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
declare interface ICreateByNodeTypeParams extends IBaseCreateNodeParams {
|
|
1427
|
+
nodeType: NodeType;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1128
1430
|
declare interface ICreateMenuInfo {
|
|
1129
1431
|
// 新建菜单名称,支持 i18n:xxx
|
|
1130
1432
|
label: string;
|
|
@@ -1148,6 +1450,27 @@ declare interface ICreateMenuInfo {
|
|
|
1148
1450
|
fileNameCheckConfigs?: FileNameCheckConfig[];
|
|
1149
1451
|
}
|
|
1150
1452
|
|
|
1453
|
+
/**
|
|
1454
|
+
* 创建场景/预制体选项
|
|
1455
|
+
*/
|
|
1456
|
+
declare interface ICreateOptions {
|
|
1457
|
+
type: ICreateType;
|
|
1458
|
+
baseName: string;
|
|
1459
|
+
targetDirectory: string;
|
|
1460
|
+
templateType?: TSceneTemplateType;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
declare interface ICreatePrefabFromNodeParams {
|
|
1464
|
+
/** 要转换为预制体的源节点路径 */
|
|
1465
|
+
nodePath: string;
|
|
1466
|
+
/** 预制体资源保存 URL */
|
|
1467
|
+
dbURL: string;
|
|
1468
|
+
/** 是否强制覆盖现有资源 */
|
|
1469
|
+
overwrite?: boolean;
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
declare type ICreateType = typeof CREATE_TYPES[number];
|
|
1473
|
+
|
|
1151
1474
|
declare type ICroppingConfig = {
|
|
1152
1475
|
name: string;
|
|
1153
1476
|
cache: Record<string, IDisplayModuleCache>,
|
|
@@ -1175,6 +1498,15 @@ declare type IDefaultConfig = {
|
|
|
1175
1498
|
|
|
1176
1499
|
declare type IDefaultConfigKeys = 'defaultConfig' | 'default2d' | 'default3d' | 'defaultNative' | 'defaultSmallGames'
|
|
1177
1500
|
|
|
1501
|
+
declare interface IDeleteNodeParams {
|
|
1502
|
+
path: string;
|
|
1503
|
+
keepWorldTransform?: boolean;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
declare interface IDeleteNodeResult {
|
|
1507
|
+
path: string;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1178
1510
|
/**
|
|
1179
1511
|
* 构建使用的设计分辨率数据
|
|
1180
1512
|
*/
|
|
@@ -1198,6 +1530,50 @@ declare interface IDisplayModuleItem extends IFeatureItem {
|
|
|
1198
1530
|
options?: Record<string, IDisplayModuleItem>;
|
|
1199
1531
|
}
|
|
1200
1532
|
|
|
1533
|
+
declare interface IEditorService extends IServiceEvents {
|
|
1534
|
+
/**
|
|
1535
|
+
* 当前编辑器类型
|
|
1536
|
+
*/
|
|
1537
|
+
getCurrentEditorType(): 'scene' | 'prefab' | 'unknown';
|
|
1538
|
+
/**
|
|
1539
|
+
* 打开资产
|
|
1540
|
+
* @param params
|
|
1541
|
+
*/
|
|
1542
|
+
open(params: IOpenOptions): Promise<TEditorEntity>;
|
|
1543
|
+
/**
|
|
1544
|
+
* 关闭当前资产
|
|
1545
|
+
*/
|
|
1546
|
+
close(params: ICloseOptions): Promise<boolean>;
|
|
1547
|
+
/**
|
|
1548
|
+
* 保存资产
|
|
1549
|
+
*/
|
|
1550
|
+
save(params: ISaveOptions): Promise<IAssetInfo>;
|
|
1551
|
+
/**
|
|
1552
|
+
* 重载资产
|
|
1553
|
+
* @param params
|
|
1554
|
+
*/
|
|
1555
|
+
reload(params: IReloadOptions): Promise<ReloadResult>;
|
|
1556
|
+
/**
|
|
1557
|
+
* 创建新资产
|
|
1558
|
+
* @param params
|
|
1559
|
+
*/
|
|
1560
|
+
create(params: ICreateOptions): Promise<IBaseIdentifier>;
|
|
1561
|
+
/**
|
|
1562
|
+
* 是否有打开编辑器
|
|
1563
|
+
*/
|
|
1564
|
+
hasOpen(): Promise<boolean>;
|
|
1565
|
+
/**
|
|
1566
|
+
* 获取当前打开的资产
|
|
1567
|
+
*/
|
|
1568
|
+
queryCurrent(): Promise<TEditorEntity | null>;
|
|
1569
|
+
/**
|
|
1570
|
+
*
|
|
1571
|
+
*/
|
|
1572
|
+
getRootNode(): TEditorInstance | null;
|
|
1573
|
+
lock(): Promise<void>;
|
|
1574
|
+
unlock(): void;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1201
1577
|
declare interface IEngineConfig extends IEngineModuleConfig {
|
|
1202
1578
|
physicsConfig: IPhysicsConfig;
|
|
1203
1579
|
macroConfig?: Record<string, string | number | boolean>;
|
|
@@ -1247,8 +1623,19 @@ declare interface IEngineProjectConfig extends Exclude<IEngineConfig, 'includeMo
|
|
|
1247
1623
|
globalConfigKey?: string;
|
|
1248
1624
|
}
|
|
1249
1625
|
|
|
1626
|
+
declare interface IEngineService extends IServiceEvents {
|
|
1627
|
+
/**
|
|
1628
|
+
* 初始化引擎服务,目前是暂时引擎 mainLoop
|
|
1629
|
+
*/
|
|
1630
|
+
init(): Promise<void>;
|
|
1631
|
+
/**
|
|
1632
|
+
* 让引擎执行一帧
|
|
1633
|
+
*/
|
|
1634
|
+
repaintInEditMode(): Promise<void>;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1250
1637
|
/**
|
|
1251
|
-
*
|
|
1638
|
+
* 执行组件方法的选项
|
|
1252
1639
|
*/
|
|
1253
1640
|
declare interface IExecuteComponentMethodOptions {
|
|
1254
1641
|
uuid: string;
|
|
@@ -1343,6 +1730,32 @@ declare interface IGetPostConfig {
|
|
|
1343
1730
|
handler: (req: Request_2, res: Response_2, next?: NextFunction) => Promise<void>;
|
|
1344
1731
|
}
|
|
1345
1732
|
|
|
1733
|
+
declare interface IGetPrefabInfoParams {
|
|
1734
|
+
nodePath: string;
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
declare interface IGizmoService {
|
|
1738
|
+
gizmoRootNode: any;
|
|
1739
|
+
foregroundNode: any;
|
|
1740
|
+
backgroundNode: any;
|
|
1741
|
+
transformToolData: any;
|
|
1742
|
+
transformToolName: string;
|
|
1743
|
+
isViewMode: boolean;
|
|
1744
|
+
init(): void;
|
|
1745
|
+
initFromConfig(): Promise<void>;
|
|
1746
|
+
saveConfig(): Promise<void>;
|
|
1747
|
+
changeTool(name: string): void;
|
|
1748
|
+
setCoordinate(coord: 'local' | 'global'): void;
|
|
1749
|
+
setPivot(pivot: 'pivot' | 'center'): void;
|
|
1750
|
+
lockGizmoTool(locked: boolean): void;
|
|
1751
|
+
setIconVisible(visible: boolean): void;
|
|
1752
|
+
showAllGizmoOfNode(node: any, recursive?: boolean): void;
|
|
1753
|
+
removeAllGizmoOfNode(node: any, recursive?: boolean): void;
|
|
1754
|
+
clearAllGizmos(): void;
|
|
1755
|
+
callAllGizmoFuncOfNode(node: any, funcName: string, ...params: any[]): boolean;
|
|
1756
|
+
onUpdate(deltaTime: number): void;
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1346
1759
|
declare interface IInitEngineInfo {
|
|
1347
1760
|
importBase: string;
|
|
1348
1761
|
nativeBase: string;
|
|
@@ -1350,6 +1763,10 @@ declare interface IInitEngineInfo {
|
|
|
1350
1763
|
serverURL?: string;
|
|
1351
1764
|
}
|
|
1352
1765
|
|
|
1766
|
+
declare interface IIsPrefabInstanceParams {
|
|
1767
|
+
nodePath: string;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1353
1770
|
/** 图片资源的 userData */
|
|
1354
1771
|
declare interface ImageAssetUserData {
|
|
1355
1772
|
/** 图片类型 */
|
|
@@ -1426,6 +1843,16 @@ declare type IModuleItem = IFeatureItem | IFeatureGroup;
|
|
|
1426
1843
|
|
|
1427
1844
|
declare type IModules = Record<string, IModuleItem>;
|
|
1428
1845
|
|
|
1846
|
+
declare interface IMountedChildrenInfo {
|
|
1847
|
+
targetInfo: ITargetInfo | null;
|
|
1848
|
+
nodes: INodeIdentifier[];
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
declare interface IMountedComponentsInfo {
|
|
1852
|
+
targetInfo: ITargetInfo | null;
|
|
1853
|
+
components: IComponentIdentifier[];
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1429
1856
|
/**
|
|
1430
1857
|
* Import Asset // 导入资源
|
|
1431
1858
|
*/
|
|
@@ -1458,6 +1885,103 @@ declare function initEngine(enginePath: string, projectPath: string, serverURL?:
|
|
|
1458
1885
|
|
|
1459
1886
|
declare function initProgrammingFacet(): Promise<ProgrammingFacet>;
|
|
1460
1887
|
|
|
1888
|
+
declare interface INode extends INodeIdentifier {
|
|
1889
|
+
properties: INodeProperties;
|
|
1890
|
+
components?: IComponent[] | IComponentIdentifier[];
|
|
1891
|
+
children?: INode[];
|
|
1892
|
+
prefab: IPrefabInfo | null;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
declare interface INodeIdentifier {
|
|
1896
|
+
nodeId: string;
|
|
1897
|
+
path: string;
|
|
1898
|
+
name: string;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
declare interface INodeProperties {
|
|
1902
|
+
position: IVec3;
|
|
1903
|
+
rotation: IQuat;
|
|
1904
|
+
eulerAngles: IVec3;
|
|
1905
|
+
scale: IVec3;
|
|
1906
|
+
mobility: MobilityMode;
|
|
1907
|
+
layer: number;
|
|
1908
|
+
active: boolean;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
/**
|
|
1912
|
+
* 节点的相关处理接口
|
|
1913
|
+
*/
|
|
1914
|
+
declare interface INodeService extends IServiceEvents {
|
|
1915
|
+
/**
|
|
1916
|
+
* 创建节点
|
|
1917
|
+
* @param params
|
|
1918
|
+
*/
|
|
1919
|
+
createNodeByType(params: ICreateByNodeTypeParams): Promise<INode | null>;
|
|
1920
|
+
/**
|
|
1921
|
+
* 创建节点
|
|
1922
|
+
* @param params
|
|
1923
|
+
*/
|
|
1924
|
+
createNodeByAsset(params: ICreateByAssetParams): Promise<INode | null>;
|
|
1925
|
+
/**
|
|
1926
|
+
* 删除节点
|
|
1927
|
+
* @param params
|
|
1928
|
+
*/
|
|
1929
|
+
deleteNode(params: IDeleteNodeParams): Promise<IDeleteNodeResult | null>;
|
|
1930
|
+
/**
|
|
1931
|
+
* 更新节点
|
|
1932
|
+
* @param params
|
|
1933
|
+
*/
|
|
1934
|
+
updateNode(params: IUpdateNodeParams): Promise<IUpdateNodeResult>;
|
|
1935
|
+
/**
|
|
1936
|
+
* 查询节点
|
|
1937
|
+
*/
|
|
1938
|
+
queryNode(params: IQueryNodeParams): Promise<INode | null>;
|
|
1939
|
+
/**
|
|
1940
|
+
* 查询节点树(层级管理器格式)
|
|
1941
|
+
*/
|
|
1942
|
+
queryNodeTree(params: IQueryNodeTreeParams): Promise<INodeTreeItem | null>;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
declare interface INodeTreeComponent {
|
|
1946
|
+
isCustom: boolean;
|
|
1947
|
+
type: string;
|
|
1948
|
+
value: string;
|
|
1949
|
+
extends: string[];
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
declare interface INodeTreeItem {
|
|
1953
|
+
name: string;
|
|
1954
|
+
active: boolean;
|
|
1955
|
+
locked: boolean;
|
|
1956
|
+
type: string;
|
|
1957
|
+
uuid: string;
|
|
1958
|
+
children: INodeTreeItem[];
|
|
1959
|
+
prefab: IPrefabStateInfo;
|
|
1960
|
+
parent: string;
|
|
1961
|
+
path: string;
|
|
1962
|
+
isScene: boolean;
|
|
1963
|
+
readonly: boolean;
|
|
1964
|
+
components: INodeTreeComponent[];
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
/**
|
|
1968
|
+
* 打开场景/预制体选项
|
|
1969
|
+
*/
|
|
1970
|
+
declare interface IOpenOptions {
|
|
1971
|
+
urlOrUUID: string;
|
|
1972
|
+
simpleNode?: boolean;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
declare interface IOperationService {
|
|
1976
|
+
addListener(type: OperationEvent, listener: Function, priority?: number): void;
|
|
1977
|
+
removeListener(type: OperationEvent, listener: Function): void;
|
|
1978
|
+
dispatch(type: OperationEvent, ...args: any[]): void;
|
|
1979
|
+
emitMouseEvent(type: string, event: ISceneMouseEvent, dpr?: number): void;
|
|
1980
|
+
requestPointerLock(): void;
|
|
1981
|
+
exitPointerLock(): void;
|
|
1982
|
+
changePointer(type: string): void;
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1461
1985
|
declare interface IPhysicsConfig {
|
|
1462
1986
|
gravity: IVec3Like; // (0,-10, 0)
|
|
1463
1987
|
allowSleep: boolean; // true
|
|
@@ -1488,6 +2012,76 @@ declare interface IPluginScriptInfo extends PluginScriptInfo {
|
|
|
1488
2012
|
url: string;
|
|
1489
2013
|
}
|
|
1490
2014
|
|
|
2015
|
+
declare interface IPrefab {
|
|
2016
|
+
name: string;
|
|
2017
|
+
uuid: string;
|
|
2018
|
+
data: INodeIdentifier;
|
|
2019
|
+
optimizationPolicy: OptimizationPolicy;
|
|
2020
|
+
persistent: boolean;
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
declare interface IPrefabInfo {
|
|
2024
|
+
/** 关联的预制体资源信息 */
|
|
2025
|
+
asset?: IPrefab;
|
|
2026
|
+
root?: INodeIdentifier;
|
|
2027
|
+
instance?: IPrefabInstance;
|
|
2028
|
+
fileId: string;
|
|
2029
|
+
targetOverrides: ITargetOverrideInfo[];
|
|
2030
|
+
nestedPrefabInstanceRoots: INodeIdentifier[];
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
declare interface IPrefabInstance {
|
|
2034
|
+
fileId: string;
|
|
2035
|
+
prefabRootNode?: INodeIdentifier;
|
|
2036
|
+
mountedChildren: IMountedChildrenInfo[];
|
|
2037
|
+
mountedComponents: IMountedComponentsInfo[];
|
|
2038
|
+
propertyOverrides: IPropertyOverrideInfo[];
|
|
2039
|
+
removedComponents: ITargetInfo[];
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
declare interface IPrefabService extends IServiceEvents {
|
|
2043
|
+
/**
|
|
2044
|
+
* 将节点转换为预制体资源
|
|
2045
|
+
*/
|
|
2046
|
+
createPrefabFromNode(params: ICreatePrefabFromNodeParams): Promise<INode>;
|
|
2047
|
+
/**
|
|
2048
|
+
* 将节点的修改应用回预制体资源
|
|
2049
|
+
*/
|
|
2050
|
+
applyPrefabChanges(params: IApplyPrefabChangesParams): Promise<boolean>;
|
|
2051
|
+
/**
|
|
2052
|
+
* 重置节点到预制体原始状态
|
|
2053
|
+
*/
|
|
2054
|
+
revertToPrefab(params: IRevertToPrefabParams): Promise<boolean>;
|
|
2055
|
+
/**
|
|
2056
|
+
* 解耦预制体实例,使其成为普通节点
|
|
2057
|
+
*/
|
|
2058
|
+
unpackPrefabInstance(params: IUnpackPrefabInstanceParams): Promise<INode>;
|
|
2059
|
+
/**
|
|
2060
|
+
* 检查节点是否为预制体实例
|
|
2061
|
+
*/
|
|
2062
|
+
isPrefabInstance(params: IIsPrefabInstanceParams): Promise<boolean>;
|
|
2063
|
+
/**
|
|
2064
|
+
* 获取节点的预制体信息
|
|
2065
|
+
*/
|
|
2066
|
+
getPrefabInfo(params: IGetPrefabInfoParams): Promise<IPrefabInfo | null>;
|
|
2067
|
+
/**
|
|
2068
|
+
* 移除 prefab info
|
|
2069
|
+
* @param node
|
|
2070
|
+
* @param removeNested
|
|
2071
|
+
*/
|
|
2072
|
+
removePrefabInfoFromNode(node: Node_2, removeNested?: boolean): void;
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
declare interface IPrefabStateInfo {
|
|
2076
|
+
state: PrefabState;
|
|
2077
|
+
isUnwrappable: boolean;
|
|
2078
|
+
isRevertable: boolean;
|
|
2079
|
+
isApplicable: boolean;
|
|
2080
|
+
isAddedChild: boolean;
|
|
2081
|
+
isNested: boolean;
|
|
2082
|
+
assetUuid: string;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
1491
2085
|
declare interface IProject {
|
|
1492
2086
|
/**
|
|
1493
2087
|
* Gets the project directory path
|
|
@@ -1631,8 +2225,46 @@ declare type IPropertyLock = {
|
|
|
1631
2225
|
message: string
|
|
1632
2226
|
};
|
|
1633
2227
|
|
|
2228
|
+
declare interface IPropertyOverrideInfo {
|
|
2229
|
+
targetInfo: ITargetInfo | null;
|
|
2230
|
+
propertyPath: string[];
|
|
2231
|
+
value?: any;
|
|
2232
|
+
}
|
|
2233
|
+
|
|
1634
2234
|
declare type IPropertyValueType = IProperty | IProperty[] | null | undefined | number | boolean | string | Vec4 | Vec3 | Vec2 | Mat4 | any | Array<unknown>
|
|
1635
2235
|
|
|
2236
|
+
declare interface IQuat {
|
|
2237
|
+
x: number;
|
|
2238
|
+
y: number;
|
|
2239
|
+
z: number;
|
|
2240
|
+
w: number;
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
/**
|
|
2244
|
+
* 查询注册类的过滤选项
|
|
2245
|
+
*/
|
|
2246
|
+
declare interface IQueryClassesOptions {
|
|
2247
|
+
extends?: string | string[];
|
|
2248
|
+
excludeSelf?: boolean;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
/**
|
|
2252
|
+
* 查询组件的选项
|
|
2253
|
+
*/
|
|
2254
|
+
declare interface IQueryComponentOptions {
|
|
2255
|
+
path: string;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
declare interface IQueryNodeParams {
|
|
2259
|
+
path: string;
|
|
2260
|
+
queryChildren: boolean;
|
|
2261
|
+
queryComponent: boolean;
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
declare interface IQueryNodeTreeParams {
|
|
2265
|
+
path?: string;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
1636
2268
|
declare interface IRedirectInfo {
|
|
1637
2269
|
// 跳转资源的类型
|
|
1638
2270
|
type: string;
|
|
@@ -1641,13 +2273,160 @@ declare interface IRedirectInfo {
|
|
|
1641
2273
|
}
|
|
1642
2274
|
|
|
1643
2275
|
/**
|
|
1644
|
-
*
|
|
2276
|
+
* 软刷新场景/预制体选项
|
|
2277
|
+
*/
|
|
2278
|
+
declare interface IReloadOptions {
|
|
2279
|
+
urlOrUUID?: string;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
/**
|
|
2283
|
+
* 删除组件的选项
|
|
1645
2284
|
*/
|
|
1646
2285
|
declare interface IRemoveComponentOptions {
|
|
1647
|
-
|
|
2286
|
+
path: string;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
declare interface IRevertToPrefabParams {
|
|
2290
|
+
nodePath: string;
|
|
1648
2291
|
}
|
|
1649
2292
|
|
|
1650
|
-
|
|
2293
|
+
/**
|
|
2294
|
+
* 保持场景/预制体选项
|
|
2295
|
+
*/
|
|
2296
|
+
declare interface ISaveOptions {
|
|
2297
|
+
urlOrUUID?: string;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
/**
|
|
2301
|
+
* 场景信息
|
|
2302
|
+
*/
|
|
2303
|
+
declare interface IScene extends IBaseIdentifier {
|
|
2304
|
+
name: string;
|
|
2305
|
+
prefab: IPrefabInfo | null;
|
|
2306
|
+
children: INode[];
|
|
2307
|
+
components: IComponentIdentifier[];
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
declare interface ISceneMouseEvent {
|
|
2311
|
+
x: number;
|
|
2312
|
+
y: number;
|
|
2313
|
+
clientX: number;
|
|
2314
|
+
clientY: number;
|
|
2315
|
+
deltaX: number;
|
|
2316
|
+
deltaY: number;
|
|
2317
|
+
wheelDeltaX: number;
|
|
2318
|
+
wheelDeltaY: number;
|
|
2319
|
+
moveDeltaX: number;
|
|
2320
|
+
moveDeltaY: number;
|
|
2321
|
+
leftButton: boolean;
|
|
2322
|
+
middleButton: boolean;
|
|
2323
|
+
rightButton: boolean;
|
|
2324
|
+
button: number;
|
|
2325
|
+
buttons: number;
|
|
2326
|
+
ctrlKey: boolean;
|
|
2327
|
+
shiftKey: boolean;
|
|
2328
|
+
altKey: boolean;
|
|
2329
|
+
metaKey: boolean;
|
|
2330
|
+
hitPoint?: any;
|
|
2331
|
+
type?: string;
|
|
2332
|
+
handleName?: string;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
declare interface ISceneViewService {
|
|
2336
|
+
init(): void;
|
|
2337
|
+
initFromConfig(): Promise<void>;
|
|
2338
|
+
saveConfig(): Promise<void>;
|
|
2339
|
+
setSceneLightOn(enable: boolean): void;
|
|
2340
|
+
querySceneLightOn(): boolean;
|
|
2341
|
+
onSceneOpened(scene: any): void;
|
|
2342
|
+
onSceneClosed(): void;
|
|
2343
|
+
onComponentAdded(comp: Component): void;
|
|
2344
|
+
onComponentRemoved(comp: Component): void;
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
declare interface IScriptService extends IServiceEvents {
|
|
2348
|
+
investigatePackerDriver(): Promise<void>;
|
|
2349
|
+
loadScript(): Promise<void>;
|
|
2350
|
+
removeScript(): Promise<void>;
|
|
2351
|
+
scriptChange(): Promise<void>;
|
|
2352
|
+
queryScriptCid(uuid: string): Promise<string | null>;
|
|
2353
|
+
queryScriptName(uuid: string): Promise<string | null>;
|
|
2354
|
+
isCustomComponent(classConstructor: Function): boolean;
|
|
2355
|
+
suspend(condition: Promise<any>): void;
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
declare interface ISelectionService {
|
|
2359
|
+
select(uuid: string): void;
|
|
2360
|
+
unselect(uuid: string): void;
|
|
2361
|
+
clear(): void;
|
|
2362
|
+
query(): string[];
|
|
2363
|
+
isSelect(uuid: string): boolean;
|
|
2364
|
+
reset(): void;
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
declare interface IServiceEvents {
|
|
2368
|
+
onEditorOpened?(): void;
|
|
2369
|
+
onEditorReload?(): void;
|
|
2370
|
+
onEditorClosed?(): void;
|
|
2371
|
+
onEditorSaved?(): void;
|
|
2372
|
+
onNodeBeforeChanged?(node: Node_2): void;
|
|
2373
|
+
onBeforeRemoveNode?(node: Node_2): void;
|
|
2374
|
+
onBeforeAddNode?(node: Node_2): void;
|
|
2375
|
+
onNodeChanged?(node: Node_2, opts: IChangeNodeOptions): void;
|
|
2376
|
+
onBeforeNodeAdded?(node: Node_2): void;
|
|
2377
|
+
onAddNode?(node: Node_2): void;
|
|
2378
|
+
onRemoveNode?(node: Node_2): void;
|
|
2379
|
+
onNodeAdded?(node: Node_2): void;
|
|
2380
|
+
onNodeRemoved?(node: Node_2): void;
|
|
2381
|
+
onAddComponent?(comp: Component): void;
|
|
2382
|
+
onRemoveComponent?(comp: Component): void;
|
|
2383
|
+
onSetPropertyComponent?(comp: Component): void;
|
|
2384
|
+
onComponentAdded?(comp: Component): void;
|
|
2385
|
+
onComponentRemoved?(comp: Component): void;
|
|
2386
|
+
onBeforeRemoveComponent?(comp: Component): void;
|
|
2387
|
+
onComponentBeforeChanged?(node: Node_2): void;
|
|
2388
|
+
onBeforeComponentAdded?(name: string, node: Node_2): void;
|
|
2389
|
+
onComponentChanged?(name: string, opts: IChangeNodeOptions): void;
|
|
2390
|
+
onAssetDeleted?(uuid: string): void;
|
|
2391
|
+
onAssetChanged?(uuid: string): void;
|
|
2392
|
+
onAssetRefreshed?(uuid: string): void;
|
|
2393
|
+
onScriptExecutionFinished?(): void;
|
|
2394
|
+
onSelectionSelect?(uuid: string, uuids: string[]): void;
|
|
2395
|
+
onSelectionUnselect?(uuid: string, uuids: string[]): void;
|
|
2396
|
+
onSelectionClear?(): void;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
export declare interface IServiceManager {
|
|
2400
|
+
Editor: IEditorService;
|
|
2401
|
+
Node: INodeService;
|
|
2402
|
+
Component: IComponentService;
|
|
2403
|
+
Script: IScriptService;
|
|
2404
|
+
Asset: IAssetService;
|
|
2405
|
+
Engine: IEngineService;
|
|
2406
|
+
Prefab: IPrefabService;
|
|
2407
|
+
Selection: ISelectionService;
|
|
2408
|
+
Operation: IOperationService;
|
|
2409
|
+
Undo: IUndoService;
|
|
2410
|
+
Camera: ICameraService;
|
|
2411
|
+
Gizmo: IGizmoService;
|
|
2412
|
+
SceneView: ISceneViewService;
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
/**
|
|
2416
|
+
* CLI 设置组件属性的选项
|
|
2417
|
+
*/
|
|
2418
|
+
declare interface ISetPropertyOptions {
|
|
2419
|
+
componentPath: string;
|
|
2420
|
+
properties: {
|
|
2421
|
+
[key: string]: null | undefined | number | boolean | string | object | Array<unknown>;
|
|
2422
|
+
};
|
|
2423
|
+
record?: boolean;
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
/**
|
|
2427
|
+
* 编辑器设置组件属性的选项
|
|
2428
|
+
*/
|
|
2429
|
+
declare interface ISetPropertyOptionsForEditor {
|
|
1651
2430
|
uuid: string;
|
|
1652
2431
|
path: string;
|
|
1653
2432
|
dump: IProperty;
|
|
@@ -1710,6 +2489,18 @@ declare type ISupportCreateCCType =
|
|
|
1710
2489
|
/** 支持创建的资源类型(从常量数组派生) */
|
|
1711
2490
|
declare type ISupportCreateType = typeof SUPPORT_CREATE_TYPES[number];
|
|
1712
2491
|
|
|
2492
|
+
declare interface ITargetInfo {
|
|
2493
|
+
localID: string[];
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
declare interface ITargetOverrideInfo {
|
|
2497
|
+
source: IComponentIdentifier | INodeIdentifier | null;
|
|
2498
|
+
sourceInfo: ITargetInfo | null;
|
|
2499
|
+
propertyPath: string[];
|
|
2500
|
+
target: INodeIdentifier | null;
|
|
2501
|
+
targetInfo: ITargetInfo | null;
|
|
2502
|
+
}
|
|
2503
|
+
|
|
1713
2504
|
declare interface IUerDataConfigItem {
|
|
1714
2505
|
key?: string; // 唯一标识符
|
|
1715
2506
|
// 配置显示的名字,如果需要翻译,则传入 i18n:${key}
|
|
@@ -1732,6 +2523,40 @@ declare interface IUerDataConfigItem {
|
|
|
1732
2523
|
};
|
|
1733
2524
|
}
|
|
1734
2525
|
|
|
2526
|
+
declare interface IUndoService {
|
|
2527
|
+
beginRecording(uuids: string[], options?: any): string;
|
|
2528
|
+
endRecording(commandId: string): void;
|
|
2529
|
+
cancelRecording(commandId: string): void;
|
|
2530
|
+
undo(): Promise<void>;
|
|
2531
|
+
redo(): Promise<void>;
|
|
2532
|
+
snapshot(): void;
|
|
2533
|
+
reset(): void;
|
|
2534
|
+
isDirty(): boolean;
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
declare interface IUnpackPrefabInstanceParams {
|
|
2538
|
+
/** 要解耦的预制体实例节点 */
|
|
2539
|
+
nodePath: string;
|
|
2540
|
+
/** 递归解耦所有子预制体 */
|
|
2541
|
+
recursive?: boolean;
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
declare interface IUpdateNodeParams {
|
|
2545
|
+
path: string;
|
|
2546
|
+
name?: string;
|
|
2547
|
+
properties?: Partial<INodeProperties>;
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
declare interface IUpdateNodeResult {
|
|
2551
|
+
path: string;
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
declare interface IVec3 {
|
|
2555
|
+
x: number;
|
|
2556
|
+
y: number;
|
|
2557
|
+
z: number;
|
|
2558
|
+
}
|
|
2559
|
+
|
|
1735
2560
|
declare interface IVec3Like {
|
|
1736
2561
|
x: number;
|
|
1737
2562
|
y: number;
|
|
@@ -1875,6 +2700,24 @@ declare interface Migration {
|
|
|
1875
2700
|
migrate(moduleCache: Record<string, boolean>): Record<string, boolean>;
|
|
1876
2701
|
}
|
|
1877
2702
|
|
|
2703
|
+
declare enum MobilityMode {
|
|
2704
|
+
/**
|
|
2705
|
+
* @en Static node
|
|
2706
|
+
* @zh 静态节点
|
|
2707
|
+
*/
|
|
2708
|
+
Static = 0,
|
|
2709
|
+
/**
|
|
2710
|
+
* @en Stationary node
|
|
2711
|
+
* @zh 固定节点
|
|
2712
|
+
*/
|
|
2713
|
+
Stationary = 1,
|
|
2714
|
+
/**
|
|
2715
|
+
* @en Movable node
|
|
2716
|
+
* @zh 可移动节点
|
|
2717
|
+
*/
|
|
2718
|
+
Movable = 2
|
|
2719
|
+
}
|
|
2720
|
+
|
|
1878
2721
|
declare interface ModuleRenderConfig {
|
|
1879
2722
|
$schema?: string;
|
|
1880
2723
|
|
|
@@ -1901,6 +2744,66 @@ declare interface ModuleRenderConfig {
|
|
|
1901
2744
|
*/
|
|
1902
2745
|
declare function moveAsset(source: string, target: string, options?: AssetOperationOption): Promise<any>;
|
|
1903
2746
|
|
|
2747
|
+
declare enum NodeEventType {
|
|
2748
|
+
TRANSFORM_CHANGED = 'transform-changed',// 节点改变位置、旋转或缩放事件
|
|
2749
|
+
SIZE_CHANGED = 'size-changed',// 当节点尺寸改变时触发的事件
|
|
2750
|
+
ANCHOR_CHANGED = 'anchor-changed',// 当节点锚点改变时触发的事件
|
|
2751
|
+
CHILD_ADDED = 'child-added',// 节点子类添加
|
|
2752
|
+
CHILD_REMOVED = 'child-removed',// 节点子类移除
|
|
2753
|
+
PARENT_CHANGED = 'parent-changed',// 父节点改变时触发的事件
|
|
2754
|
+
CHILD_CHANGED = 'child-changed',// 子节点改变时触发的事件
|
|
2755
|
+
COMPONENT_CHANGED = 'component-changed',// 组件数据发生改变时
|
|
2756
|
+
ACTIVE_IN_HIERARCHY_CHANGE = 'active-in-hierarchy-changed',// 节点在hierarchy是否激活
|
|
2757
|
+
NOTIFY_NODE_CHANGED = 'notify-node-changed',
|
|
2758
|
+
PREFAB_INFO_CHANGED = 'prefab-info-changed',// prefab数据改变
|
|
2759
|
+
LIGHT_PROBE_CHANGED = 'light-probe-changed',// 光照探针数据改变
|
|
2760
|
+
SET_PROPERTY = 'set-property',// 设置节点上的属性
|
|
2761
|
+
MOVE_ARRAY_ELEMENT = 'move-array-element',// 调整一个数组类型的数据内某个 item 的位置
|
|
2762
|
+
REMOVE_ARRAY_ELEMENT = 'remove-array-element',// 删除一个数组元素
|
|
2763
|
+
CREATE_COMPONENT = 'create-component',// 创建一个组件
|
|
2764
|
+
RESET_COMPONENT = 'reset-component'
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
declare enum NodeType {
|
|
2768
|
+
EMPTY = 'Empty',// 空节点
|
|
2769
|
+
TERRAIN = 'Terrain',// 地形节点
|
|
2770
|
+
CAMERA = 'Camera',// 摄像机节点(需要用过 TWorkMode 来区分 2D 和 3D)
|
|
2771
|
+
SPRITE = 'Sprite',// 精灵节点(需要用过 TWorkMode 来区分 2D 和 3D)
|
|
2772
|
+
SPRITE_SPLASH = 'SpriteSplash',// 单色
|
|
2773
|
+
GRAPHICS = 'Graphics',// 图形节点
|
|
2774
|
+
LABEL = 'Label',// 文本节点
|
|
2775
|
+
MASK = 'Mask',// 遮罩节点
|
|
2776
|
+
PARTICLE = 'Particle',// 粒子节点(需要用过 TWorkMode 来区分 2D 和 3D)
|
|
2777
|
+
TILED_MAP = 'TiledMap',// 瓦片地图节点
|
|
2778
|
+
CAPSULE = 'Capsule',// 胶囊体节点
|
|
2779
|
+
CONE = 'Cone',// 圆锥体节点
|
|
2780
|
+
CUBE = 'Cube',// 立方体节点
|
|
2781
|
+
CYLINDER = 'Cylinder',// 圆柱体节点
|
|
2782
|
+
PLANE = 'Plane',// 平面节点
|
|
2783
|
+
QUAD = 'Quad',// 四边形节点
|
|
2784
|
+
SPHERE = 'Sphere',// 球体节点
|
|
2785
|
+
TORUS = 'Torus',// 圆环体节点
|
|
2786
|
+
BUTTON = 'Button',// 按钮节点
|
|
2787
|
+
CANVAS = 'Canvas',// 画布节点(需要用过 TWorkMode 来区分 2D 和 3D)
|
|
2788
|
+
EDIT_BOX = 'EditBox',// 输入框节点
|
|
2789
|
+
LAYOUT = 'Layout',// 布局节点
|
|
2790
|
+
PAGE_VIEW = 'PageView',// 页面视图节点
|
|
2791
|
+
PROGRESS_BAR = 'ProgressBar',// 进度条节点
|
|
2792
|
+
RICH_TEXT = 'RichText',// 富文本节点
|
|
2793
|
+
SCROLL_VIEW = 'ScrollView',// 滚动视图节点
|
|
2794
|
+
SLIDER = 'Slider',// 滑动条节点
|
|
2795
|
+
TOGGLE = 'Toggle',// 切换节点
|
|
2796
|
+
TOGGLE_GROUP = 'ToggleGroup',// 切换组节点
|
|
2797
|
+
VIDEO_PLAYER = 'VideoPlayer',// 视频播放器节点
|
|
2798
|
+
WEB_VIEW = 'WebView',// 网页视图节点
|
|
2799
|
+
WIDGET = 'Widget',// 小部件节点
|
|
2800
|
+
DIRECTIONAL_LIGHT = 'Light-Directional',// 平行光
|
|
2801
|
+
SPHERE_LIGHT = 'Light-Sphere',// 球面光
|
|
2802
|
+
SPOT_LIGHT = 'Light-Spot',// 聚光灯
|
|
2803
|
+
PROBE_LIGHT = 'Light-Probe-Group',// 光照探针
|
|
2804
|
+
REFLECTION_LIGHT = 'Light-Reflection-Probe'
|
|
2805
|
+
}
|
|
2806
|
+
|
|
1904
2807
|
declare enum NormalImportSetting {
|
|
1905
2808
|
/**
|
|
1906
2809
|
* 如果模型文件中包含法线信息则导出法线,否则不导出法线。
|
|
@@ -2022,6 +2925,14 @@ declare function onReady(listener: () => void): () => void;
|
|
|
2022
2925
|
|
|
2023
2926
|
declare function open_2(projectPath: string): Promise<void>;
|
|
2024
2927
|
|
|
2928
|
+
declare type OperationEvent = SceneDragEvent | SceneKeyboardEvent | SceneMouseEvent | 'resize';
|
|
2929
|
+
|
|
2930
|
+
declare enum OptimizationPolicy {
|
|
2931
|
+
AUTO = 0,
|
|
2932
|
+
SINGLE_INSTANCE = 1,
|
|
2933
|
+
MULTI_INSTANCE = 2
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2025
2936
|
/** 粒子资源的 userData */
|
|
2026
2937
|
declare interface ParticleAssetUserData {
|
|
2027
2938
|
totalParticles: number;
|
|
@@ -2100,6 +3011,13 @@ declare interface PrefabAssetUserData {
|
|
|
2100
3011
|
syncNodeName?: string;
|
|
2101
3012
|
}
|
|
2102
3013
|
|
|
3014
|
+
declare enum PrefabState {
|
|
3015
|
+
NotAPrefab = 0,// Normal node, not a Prefab
|
|
3016
|
+
PrefabChild = 1,// Child node of a Prefab, without PrefabInstance
|
|
3017
|
+
PrefabInstance = 2,// Root node of a Prefab that contains a PrefabInstance
|
|
3018
|
+
PrefabLostAsset = 3
|
|
3019
|
+
}
|
|
3020
|
+
|
|
2103
3021
|
declare class ProgrammingFacet {
|
|
2104
3022
|
private _packerDriverUpdateCount;
|
|
2105
3023
|
private _asyncIteration;
|
|
@@ -2258,11 +3176,6 @@ declare interface ProjectInfo {
|
|
|
2258
3176
|
*/
|
|
2259
3177
|
declare type ProjectType = '2d' | '3d';
|
|
2260
3178
|
|
|
2261
|
-
/**
|
|
2262
|
-
* Query all component names // 查询所有组件名称
|
|
2263
|
-
*/
|
|
2264
|
-
declare function queryAllComponent(): Promise<string[]>;
|
|
2265
|
-
|
|
2266
3179
|
/**
|
|
2267
3180
|
* Query Asset Config Map // 查询资源配置映射表
|
|
2268
3181
|
*/
|
|
@@ -2321,16 +3234,16 @@ declare function queryAssetUserDataConfig(urlOrUuidOrPath: string): Promise<fals
|
|
|
2321
3234
|
*/
|
|
2322
3235
|
declare function queryAssetUsers(uuidOrUrl: string, type?: QueryAssetType): Promise<string[]>;
|
|
2323
3236
|
|
|
2324
|
-
/**
|
|
2325
|
-
* Query component info // 查询组件信息
|
|
2326
|
-
*/
|
|
2327
|
-
declare function queryComponent(uuid: string): Promise<IComponentForPinK | null>;
|
|
2328
|
-
|
|
2329
3237
|
/**
|
|
2330
3238
|
* Query Creatable Asset Map // 查询可创建资源映射表
|
|
2331
3239
|
*/
|
|
2332
3240
|
declare function queryCreateMap(): Promise<ICreateMenuInfo[]>;
|
|
2333
3241
|
|
|
3242
|
+
declare function queryLayerBuiltin(): Promise<{
|
|
3243
|
+
name: string;
|
|
3244
|
+
value: number;
|
|
3245
|
+
}[]>;
|
|
3246
|
+
|
|
2334
3247
|
/**
|
|
2335
3248
|
* Query Asset Path // 查询资源路径
|
|
2336
3249
|
*/
|
|
@@ -2341,6 +3254,13 @@ declare function queryPath(urlOrUuid: string): Promise<string>;
|
|
|
2341
3254
|
*/
|
|
2342
3255
|
declare function querySortedPlugins(filterOptions?: FilterPluginOptions): Promise<IPluginScriptInfo[]>;
|
|
2343
3256
|
|
|
3257
|
+
declare function querySortingLayerBuiltin(): Promise<readonly __private._cocos_sorting_sorting_layers__SortingItem[]>;
|
|
3258
|
+
|
|
3259
|
+
/**
|
|
3260
|
+
* Query Thumbnail Handlers // 查询支持缩略图生成的资源处理器列表
|
|
3261
|
+
*/
|
|
3262
|
+
declare function queryThumbnailHandlers(): string[];
|
|
3263
|
+
|
|
2344
3264
|
/**
|
|
2345
3265
|
* Query Asset URL // 查询资源 URL
|
|
2346
3266
|
*/
|
|
@@ -2393,12 +3313,19 @@ declare function reimportAsset(pathOrUrlOrUUID: string): Promise<IAssetInfo>;
|
|
|
2393
3313
|
|
|
2394
3314
|
declare function reload(): Promise<void>;
|
|
2395
3315
|
|
|
2396
|
-
declare function remove(key: string, scope?: ConfigurationScope): Promise<boolean>;
|
|
2397
|
-
|
|
2398
3316
|
/**
|
|
2399
|
-
*
|
|
3317
|
+
* 重载结果
|
|
2400
3318
|
*/
|
|
2401
|
-
declare
|
|
3319
|
+
declare enum ReloadResult {
|
|
3320
|
+
SUCCESS = 0,
|
|
3321
|
+
FAILED = 1,
|
|
3322
|
+
QUEUED = 2,
|
|
3323
|
+
NO_EDITOR = 3,
|
|
3324
|
+
ASSET_NOT_FOUND = 4,
|
|
3325
|
+
EDITOR_NOT_FOUND = 5
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
declare function remove(key: string, scope?: ConfigurationScope): Promise<boolean>;
|
|
2402
3329
|
|
|
2403
3330
|
/**
|
|
2404
3331
|
* Rename Asset // 重命名资源
|
|
@@ -2411,8 +3338,6 @@ declare interface RenderTextureAssetUserData extends TextureBaseAssetUserData {
|
|
|
2411
3338
|
height: number;
|
|
2412
3339
|
}
|
|
2413
3340
|
|
|
2414
|
-
declare function resetComponent(uuid: string): Promise<void>;
|
|
2415
|
-
|
|
2416
3341
|
/** 渲染纹理精灵帧的 userData */
|
|
2417
3342
|
declare interface RtSpriteFrameAssetUserData {
|
|
2418
3343
|
/** 图片 UUID 或数据库 URI */
|
|
@@ -2437,6 +3362,17 @@ export declare namespace Scene {
|
|
|
2437
3362
|
};
|
|
2438
3363
|
}
|
|
2439
3364
|
|
|
3365
|
+
/**
|
|
3366
|
+
* 场景模板类型
|
|
3367
|
+
*/
|
|
3368
|
+
declare const SCENE_TEMPLATE_TYPE: readonly ['2d', '3d', 'quality'];
|
|
3369
|
+
|
|
3370
|
+
declare type SceneDragEvent = 'onDragLeave' | 'onDragOver' | 'onDrop';
|
|
3371
|
+
|
|
3372
|
+
declare type SceneKeyboardEvent = 'keydown' | 'keyup';
|
|
3373
|
+
|
|
3374
|
+
declare type SceneMouseEvent = 'dblclick' | 'mousedown' | 'mousemove' | 'mouseup' | 'mousewheel';
|
|
3375
|
+
|
|
2440
3376
|
export declare namespace Scripting {
|
|
2441
3377
|
export {
|
|
2442
3378
|
init_7 as init,
|
|
@@ -2475,11 +3411,6 @@ export declare namespace Server {
|
|
|
2475
3411
|
|
|
2476
3412
|
declare function set<T>(key: string, value: T, scope?: ConfigurationScope): Promise<boolean>;
|
|
2477
3413
|
|
|
2478
|
-
/**
|
|
2479
|
-
* Set component property // 设置组件属性
|
|
2480
|
-
*/
|
|
2481
|
-
declare function setProperty(options: ISetPropertyOptionsForPink): Promise<boolean>;
|
|
2482
|
-
|
|
2483
3414
|
declare interface SharedSettings {
|
|
2484
3415
|
useDefineForClassFields: boolean;
|
|
2485
3416
|
allowDeclareFields: boolean;
|
|
@@ -2627,6 +3558,10 @@ declare enum TangentImportSetting {
|
|
|
2627
3558
|
recalculate = 3
|
|
2628
3559
|
}
|
|
2629
3560
|
|
|
3561
|
+
declare type TEditorEntity = IScene | INode;
|
|
3562
|
+
|
|
3563
|
+
declare type TEditorInstance = Scene_2 | Node_2;
|
|
3564
|
+
|
|
2630
3565
|
declare interface Texture2DAssetUserData extends TextureBaseAssetUserData {
|
|
2631
3566
|
isUuid?: boolean;
|
|
2632
3567
|
imageUuidOrDatabaseUri?: string;
|
|
@@ -2667,6 +3602,10 @@ declare interface ThumbnailInfo {
|
|
|
2667
3602
|
value: string; // 具体 icon 名字或者 image 路径,image 路径支持绝对路径、 db:// 、 project:// 、和 packages:// 下的路径
|
|
2668
3603
|
}
|
|
2669
3604
|
|
|
3605
|
+
declare type ThumbnailSize = 'large' | 'small' | 'middle' | 'origin';
|
|
3606
|
+
|
|
3607
|
+
declare type TSceneTemplateType = typeof SCENE_TEMPLATE_TYPE[number];
|
|
3608
|
+
|
|
2670
3609
|
/**
|
|
2671
3610
|
* Clean up MCP state.
|
|
2672
3611
|
* Note: does NOT stop the Express server — use the Server module for that.
|