@esengine/ecs-framework 2.2.14 → 2.2.16
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/LICENSE +21 -0
- package/index.cjs +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +762 -19
- package/index.es5.js +2 -2
- package/index.es5.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/index.umd.js +2 -2
- package/index.umd.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @esengine/ecs-framework v2.2.
|
|
2
|
+
* @esengine/ecs-framework v2.2.16
|
|
3
3
|
* TypeScript definitions
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -251,6 +251,8 @@ interface IComponent {
|
|
|
251
251
|
onAddedToEntity(): void;
|
|
252
252
|
/** 组件从实体移除时的回调 */
|
|
253
253
|
onRemovedFromEntity(): void;
|
|
254
|
+
/** 组件反序列化后的回调 */
|
|
255
|
+
onDeserialized(): void | Promise<void>;
|
|
254
256
|
}
|
|
255
257
|
/**
|
|
256
258
|
* 系统基础接口
|
|
@@ -692,8 +694,6 @@ interface ISceneDebugData {
|
|
|
692
694
|
sceneEntityCount: number;
|
|
693
695
|
/** 场景系统数 */
|
|
694
696
|
sceneSystemCount: number;
|
|
695
|
-
/** 场景内存使用量 */
|
|
696
|
-
sceneMemory: number;
|
|
697
697
|
/** 场景启动时间 */
|
|
698
698
|
sceneUptime: number;
|
|
699
699
|
}
|
|
@@ -773,6 +773,32 @@ declare abstract class Component implements IComponent {
|
|
|
773
773
|
* 虽然保留此方法,但建议将复杂的清理逻辑放在 System 中处理。
|
|
774
774
|
*/
|
|
775
775
|
onRemovedFromEntity(): void;
|
|
776
|
+
/**
|
|
777
|
+
* 组件反序列化后的回调
|
|
778
|
+
*
|
|
779
|
+
* 当组件从场景文件加载或快照恢复后调用,可以在此方法中恢复运行时数据。
|
|
780
|
+
*
|
|
781
|
+
* @remarks
|
|
782
|
+
* 这是一个生命周期钩子,用于恢复无法序列化的运行时数据。
|
|
783
|
+
* 例如:从图片路径重新加载图片尺寸信息,重建缓存等。
|
|
784
|
+
*
|
|
785
|
+
* @example
|
|
786
|
+
* ```typescript
|
|
787
|
+
* class TilemapComponent extends Component {
|
|
788
|
+
* public tilesetImage: string = '';
|
|
789
|
+
* private _tilesetData: TilesetData | undefined;
|
|
790
|
+
*
|
|
791
|
+
* public async onDeserialized(): Promise<void> {
|
|
792
|
+
* if (this.tilesetImage) {
|
|
793
|
+
* // 重新加载 tileset 图片并恢复运行时数据
|
|
794
|
+
* const img = await loadImage(this.tilesetImage);
|
|
795
|
+
* this.setTilesetInfo(img.width, img.height, ...);
|
|
796
|
+
* }
|
|
797
|
+
* }
|
|
798
|
+
* }
|
|
799
|
+
* ```
|
|
800
|
+
*/
|
|
801
|
+
onDeserialized(): void | Promise<void>;
|
|
776
802
|
}
|
|
777
803
|
|
|
778
804
|
/**
|
|
@@ -1658,6 +1684,12 @@ declare class EntityList {
|
|
|
1658
1684
|
* @param isAdd 是否为添加操作
|
|
1659
1685
|
*/
|
|
1660
1686
|
private updateNameIndex;
|
|
1687
|
+
/**
|
|
1688
|
+
* 重新排序实体
|
|
1689
|
+
* @param entityId 要移动的实体ID
|
|
1690
|
+
* @param newIndex 新的索引位置
|
|
1691
|
+
*/
|
|
1692
|
+
reorderEntity(entityId: number, newIndex: number): void;
|
|
1661
1693
|
/**
|
|
1662
1694
|
* 获取实体列表的统计信息
|
|
1663
1695
|
* @returns 统计信息
|
|
@@ -1892,6 +1924,12 @@ interface IService {
|
|
|
1892
1924
|
* 使用 any[] 以允许任意参数类型的构造函数
|
|
1893
1925
|
*/
|
|
1894
1926
|
type ServiceType<T extends IService> = new (...args: any[]) => T;
|
|
1927
|
+
/**
|
|
1928
|
+
* 服务标识符
|
|
1929
|
+
*
|
|
1930
|
+
* 支持类构造函数或 Symbol 作为服务标识符
|
|
1931
|
+
*/
|
|
1932
|
+
type ServiceIdentifier<T extends IService = IService> = ServiceType<T> | symbol;
|
|
1895
1933
|
/**
|
|
1896
1934
|
* 服务生命周期
|
|
1897
1935
|
*/
|
|
@@ -1988,35 +2026,42 @@ declare class ServiceContainer {
|
|
|
1988
2026
|
*
|
|
1989
2027
|
* 直接注册已创建的实例,自动视为单例。
|
|
1990
2028
|
*
|
|
1991
|
-
* @param
|
|
2029
|
+
* @param identifier - 服务标识符(构造函数或 Symbol)
|
|
1992
2030
|
* @param instance - 服务实例
|
|
1993
2031
|
*
|
|
1994
2032
|
* @example
|
|
1995
2033
|
* ```typescript
|
|
1996
2034
|
* const config = new Config();
|
|
1997
2035
|
* container.registerInstance(Config, config);
|
|
2036
|
+
*
|
|
2037
|
+
* // 使用 Symbol 作为标识符(适用于接口)
|
|
2038
|
+
* const IFileSystem = Symbol('IFileSystem');
|
|
2039
|
+
* container.registerInstance(IFileSystem, new TauriFileSystem());
|
|
1998
2040
|
* ```
|
|
1999
2041
|
*/
|
|
2000
|
-
registerInstance<T extends IService>(
|
|
2042
|
+
registerInstance<T extends IService>(identifier: ServiceIdentifier<T>, instance: T): void;
|
|
2001
2043
|
/**
|
|
2002
2044
|
* 解析服务
|
|
2003
2045
|
*
|
|
2004
|
-
* @param
|
|
2046
|
+
* @param identifier - 服务标识符(构造函数或 Symbol)
|
|
2005
2047
|
* @returns 服务实例
|
|
2006
2048
|
* @throws 如果服务未注册或存在循环依赖
|
|
2007
2049
|
*
|
|
2008
2050
|
* @example
|
|
2009
2051
|
* ```typescript
|
|
2010
2052
|
* const timer = container.resolve(TimerManager);
|
|
2053
|
+
*
|
|
2054
|
+
* // 使用 Symbol
|
|
2055
|
+
* const fileSystem = container.resolve(IFileSystem);
|
|
2011
2056
|
* ```
|
|
2012
2057
|
*/
|
|
2013
|
-
resolve<T extends IService>(
|
|
2058
|
+
resolve<T extends IService>(identifier: ServiceIdentifier<T>): T;
|
|
2014
2059
|
/**
|
|
2015
2060
|
* 尝试解析服务
|
|
2016
2061
|
*
|
|
2017
2062
|
* 如果服务未注册,返回null而不是抛出异常。
|
|
2018
2063
|
*
|
|
2019
|
-
* @param
|
|
2064
|
+
* @param identifier - 服务标识符(构造函数或 Symbol)
|
|
2020
2065
|
* @returns 服务实例或null
|
|
2021
2066
|
*
|
|
2022
2067
|
* @example
|
|
@@ -2027,31 +2072,31 @@ declare class ServiceContainer {
|
|
|
2027
2072
|
* }
|
|
2028
2073
|
* ```
|
|
2029
2074
|
*/
|
|
2030
|
-
tryResolve<T extends IService>(
|
|
2075
|
+
tryResolve<T extends IService>(identifier: ServiceIdentifier<T>): T | null;
|
|
2031
2076
|
/**
|
|
2032
2077
|
* 检查服务是否已注册
|
|
2033
2078
|
*
|
|
2034
|
-
* @param
|
|
2079
|
+
* @param identifier - 服务标识符(构造函数或 Symbol)
|
|
2035
2080
|
* @returns 是否已注册
|
|
2036
2081
|
*/
|
|
2037
|
-
isRegistered<T extends IService>(
|
|
2082
|
+
isRegistered<T extends IService>(identifier: ServiceIdentifier<T>): boolean;
|
|
2038
2083
|
/**
|
|
2039
2084
|
* 注销服务
|
|
2040
2085
|
*
|
|
2041
|
-
* @param
|
|
2086
|
+
* @param identifier - 服务标识符(构造函数或 Symbol)
|
|
2042
2087
|
* @returns 是否成功注销
|
|
2043
2088
|
*/
|
|
2044
|
-
unregister<T extends IService>(
|
|
2089
|
+
unregister<T extends IService>(identifier: ServiceIdentifier<T>): boolean;
|
|
2045
2090
|
/**
|
|
2046
2091
|
* 清空所有服务
|
|
2047
2092
|
*/
|
|
2048
2093
|
clear(): void;
|
|
2049
2094
|
/**
|
|
2050
|
-
*
|
|
2095
|
+
* 获取所有已注册的服务标识符
|
|
2051
2096
|
*
|
|
2052
|
-
* @returns
|
|
2097
|
+
* @returns 服务标识符数组
|
|
2053
2098
|
*/
|
|
2054
|
-
getRegisteredServices():
|
|
2099
|
+
getRegisteredServices(): ServiceIdentifier[];
|
|
2055
2100
|
/**
|
|
2056
2101
|
* 更新所有使用@Updatable装饰器标记的服务
|
|
2057
2102
|
*
|
|
@@ -2288,6 +2333,7 @@ interface QueryCondition$1 {
|
|
|
2288
2333
|
tag?: number;
|
|
2289
2334
|
name?: string;
|
|
2290
2335
|
component?: ComponentType;
|
|
2336
|
+
matchNothing?: boolean;
|
|
2291
2337
|
}
|
|
2292
2338
|
/**
|
|
2293
2339
|
* 实体匹配条件描述符
|
|
@@ -2345,6 +2391,29 @@ declare class Matcher {
|
|
|
2345
2391
|
* 创建空匙配器
|
|
2346
2392
|
*/
|
|
2347
2393
|
static empty(): Matcher;
|
|
2394
|
+
/**
|
|
2395
|
+
* 创建不匹配任何实体的匹配器
|
|
2396
|
+
* 用于只需要 onBegin/onEnd 生命周期方法但不需要处理实体的系统
|
|
2397
|
+
*
|
|
2398
|
+
* @example
|
|
2399
|
+
* ```typescript
|
|
2400
|
+
* // 创建一个只在帧开始时执行的系统
|
|
2401
|
+
* class FrameBeginSystem extends EntitySystem {
|
|
2402
|
+
* constructor() {
|
|
2403
|
+
* super(Matcher.nothing());
|
|
2404
|
+
* }
|
|
2405
|
+
*
|
|
2406
|
+
* protected onBegin(): void {
|
|
2407
|
+
* // 每帧开始时执行
|
|
2408
|
+
* }
|
|
2409
|
+
*
|
|
2410
|
+
* protected process(entities: readonly Entity[]): void {
|
|
2411
|
+
* // 永远不会被调用,因为没有实体匹配
|
|
2412
|
+
* }
|
|
2413
|
+
* }
|
|
2414
|
+
* ```
|
|
2415
|
+
*/
|
|
2416
|
+
static nothing(): Matcher;
|
|
2348
2417
|
/**
|
|
2349
2418
|
* 必须包含所有指定组件
|
|
2350
2419
|
* @param types 组件类型
|
|
@@ -2403,8 +2472,13 @@ declare class Matcher {
|
|
|
2403
2472
|
getCondition(): Readonly<QueryCondition$1>;
|
|
2404
2473
|
/**
|
|
2405
2474
|
* 检查是否为空条件
|
|
2475
|
+
* 注意:matchNothing 不算空条件,因为它是明确的"不匹配任何实体"语义
|
|
2406
2476
|
*/
|
|
2407
2477
|
isEmpty(): boolean;
|
|
2478
|
+
/**
|
|
2479
|
+
* 检查是否为"不匹配任何实体"的匹配器
|
|
2480
|
+
*/
|
|
2481
|
+
isNothing(): boolean;
|
|
2408
2482
|
/**
|
|
2409
2483
|
* 重置所有条件
|
|
2410
2484
|
*/
|
|
@@ -4509,6 +4583,10 @@ declare class SceneSerializer {
|
|
|
4509
4583
|
* @param options 反序列化选项
|
|
4510
4584
|
*/
|
|
4511
4585
|
static deserialize(scene: IScene, saveData: string | Uint8Array, options?: SceneDeserializationOptions): void;
|
|
4586
|
+
/**
|
|
4587
|
+
* 递归调用实体及其子实体所有组件的 onDeserialized 方法
|
|
4588
|
+
*/
|
|
4589
|
+
private static callOnDeserializedRecursively;
|
|
4512
4590
|
/**
|
|
4513
4591
|
* 递归添加实体的所有子实体到场景
|
|
4514
4592
|
*
|
|
@@ -7197,15 +7275,27 @@ declare abstract class WorkerEntitySystem<TEntityData = any> extends EntitySyste
|
|
|
7197
7275
|
* 存储组件类型名称的Symbol键
|
|
7198
7276
|
*/
|
|
7199
7277
|
declare const COMPONENT_TYPE_NAME: unique symbol;
|
|
7278
|
+
/**
|
|
7279
|
+
* 存储组件依赖的Symbol键
|
|
7280
|
+
*/
|
|
7281
|
+
declare const COMPONENT_DEPENDENCIES: unique symbol;
|
|
7200
7282
|
/**
|
|
7201
7283
|
* 存储系统类型名称的Symbol键
|
|
7202
7284
|
*/
|
|
7203
7285
|
declare const SYSTEM_TYPE_NAME: unique symbol;
|
|
7286
|
+
/**
|
|
7287
|
+
* 组件装饰器配置选项
|
|
7288
|
+
*/
|
|
7289
|
+
interface ComponentOptions {
|
|
7290
|
+
/** 依赖的其他组件名称列表 */
|
|
7291
|
+
requires?: string[];
|
|
7292
|
+
}
|
|
7204
7293
|
/**
|
|
7205
7294
|
* 组件类型装饰器
|
|
7206
7295
|
* 用于为组件类指定固定的类型名称,避免在代码混淆后失效
|
|
7207
7296
|
*
|
|
7208
7297
|
* @param typeName 组件类型名称
|
|
7298
|
+
* @param options 组件配置选项
|
|
7209
7299
|
* @example
|
|
7210
7300
|
* ```typescript
|
|
7211
7301
|
* @ECSComponent('Position')
|
|
@@ -7213,9 +7303,19 @@ declare const SYSTEM_TYPE_NAME: unique symbol;
|
|
|
7213
7303
|
* x: number = 0;
|
|
7214
7304
|
* y: number = 0;
|
|
7215
7305
|
* }
|
|
7306
|
+
*
|
|
7307
|
+
* // 带依赖声明
|
|
7308
|
+
* @ECSComponent('SpriteAnimator', { requires: ['Sprite'] })
|
|
7309
|
+
* class SpriteAnimatorComponent extends Component {
|
|
7310
|
+
* // ...
|
|
7311
|
+
* }
|
|
7216
7312
|
* ```
|
|
7217
7313
|
*/
|
|
7218
|
-
declare function ECSComponent(typeName: string): <T extends new (...args: any[]) => Component>(target: T) => T;
|
|
7314
|
+
declare function ECSComponent(typeName: string, options?: ComponentOptions): <T extends new (...args: any[]) => Component>(target: T) => T;
|
|
7315
|
+
/**
|
|
7316
|
+
* 获取组件的依赖列表
|
|
7317
|
+
*/
|
|
7318
|
+
declare function getComponentDependencies(componentType: ComponentType$1): string[] | undefined;
|
|
7219
7319
|
/**
|
|
7220
7320
|
* System元数据配置
|
|
7221
7321
|
*/
|
|
@@ -7338,6 +7438,649 @@ declare function getEntityRefMetadata(component: any): EntityRefMetadata | null;
|
|
|
7338
7438
|
*/
|
|
7339
7439
|
declare function hasEntityRef(component: any): boolean;
|
|
7340
7440
|
|
|
7441
|
+
/*! *****************************************************************************
|
|
7442
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
7443
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
7444
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
7445
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7446
|
+
|
|
7447
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
7448
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
7449
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
7450
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
7451
|
+
|
|
7452
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
7453
|
+
and limitations under the License.
|
|
7454
|
+
***************************************************************************** */
|
|
7455
|
+
|
|
7456
|
+
|
|
7457
|
+
|
|
7458
|
+
declare global {
|
|
7459
|
+
namespace Reflect {
|
|
7460
|
+
/**
|
|
7461
|
+
* Applies a set of decorators to a target object.
|
|
7462
|
+
* @param decorators An array of decorators.
|
|
7463
|
+
* @param target The target object.
|
|
7464
|
+
* @returns The result of applying the provided decorators.
|
|
7465
|
+
* @remarks Decorators are applied in reverse order of their positions in the array.
|
|
7466
|
+
* @example
|
|
7467
|
+
*
|
|
7468
|
+
* class Example { }
|
|
7469
|
+
*
|
|
7470
|
+
* // constructor
|
|
7471
|
+
* Example = Reflect.decorate(decoratorsArray, Example);
|
|
7472
|
+
*
|
|
7473
|
+
*/
|
|
7474
|
+
function decorate(decorators: ClassDecorator[], target: Function): Function;
|
|
7475
|
+
/**
|
|
7476
|
+
* Applies a set of decorators to a property of a target object.
|
|
7477
|
+
* @param decorators An array of decorators.
|
|
7478
|
+
* @param target The target object.
|
|
7479
|
+
* @param propertyKey The property key to decorate.
|
|
7480
|
+
* @param attributes A property descriptor.
|
|
7481
|
+
* @remarks Decorators are applied in reverse order.
|
|
7482
|
+
* @example
|
|
7483
|
+
*
|
|
7484
|
+
* class Example {
|
|
7485
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7486
|
+
* // static staticProperty;
|
|
7487
|
+
* // property;
|
|
7488
|
+
*
|
|
7489
|
+
* static staticMethod() { }
|
|
7490
|
+
* method() { }
|
|
7491
|
+
* }
|
|
7492
|
+
*
|
|
7493
|
+
* // property (on constructor)
|
|
7494
|
+
* Reflect.decorate(decoratorsArray, Example, "staticProperty");
|
|
7495
|
+
*
|
|
7496
|
+
* // property (on prototype)
|
|
7497
|
+
* Reflect.decorate(decoratorsArray, Example.prototype, "property");
|
|
7498
|
+
*
|
|
7499
|
+
* // method (on constructor)
|
|
7500
|
+
* Object.defineProperty(Example, "staticMethod",
|
|
7501
|
+
* Reflect.decorate(decoratorsArray, Example, "staticMethod",
|
|
7502
|
+
* Object.getOwnPropertyDescriptor(Example, "staticMethod")));
|
|
7503
|
+
*
|
|
7504
|
+
* // method (on prototype)
|
|
7505
|
+
* Object.defineProperty(Example.prototype, "method",
|
|
7506
|
+
* Reflect.decorate(decoratorsArray, Example.prototype, "method",
|
|
7507
|
+
* Object.getOwnPropertyDescriptor(Example.prototype, "method")));
|
|
7508
|
+
*
|
|
7509
|
+
*/
|
|
7510
|
+
function decorate(decorators: (PropertyDecorator | MethodDecorator)[], target: Object, propertyKey: string | symbol, attributes?: PropertyDescriptor): PropertyDescriptor;
|
|
7511
|
+
/**
|
|
7512
|
+
* A default metadata decorator factory that can be used on a class, class member, or parameter.
|
|
7513
|
+
* @param metadataKey The key for the metadata entry.
|
|
7514
|
+
* @param metadataValue The value for the metadata entry.
|
|
7515
|
+
* @returns A decorator function.
|
|
7516
|
+
* @remarks
|
|
7517
|
+
* If `metadataKey` is already defined for the target and target key, the
|
|
7518
|
+
* metadataValue for that key will be overwritten.
|
|
7519
|
+
* @example
|
|
7520
|
+
*
|
|
7521
|
+
* // constructor
|
|
7522
|
+
* @Reflect.metadata(key, value)
|
|
7523
|
+
* class Example {
|
|
7524
|
+
* }
|
|
7525
|
+
*
|
|
7526
|
+
* // property (on constructor, TypeScript only)
|
|
7527
|
+
* class Example {
|
|
7528
|
+
* @Reflect.metadata(key, value)
|
|
7529
|
+
* static staticProperty;
|
|
7530
|
+
* }
|
|
7531
|
+
*
|
|
7532
|
+
* // property (on prototype, TypeScript only)
|
|
7533
|
+
* class Example {
|
|
7534
|
+
* @Reflect.metadata(key, value)
|
|
7535
|
+
* property;
|
|
7536
|
+
* }
|
|
7537
|
+
*
|
|
7538
|
+
* // method (on constructor)
|
|
7539
|
+
* class Example {
|
|
7540
|
+
* @Reflect.metadata(key, value)
|
|
7541
|
+
* static staticMethod() { }
|
|
7542
|
+
* }
|
|
7543
|
+
*
|
|
7544
|
+
* // method (on prototype)
|
|
7545
|
+
* class Example {
|
|
7546
|
+
* @Reflect.metadata(key, value)
|
|
7547
|
+
* method() { }
|
|
7548
|
+
* }
|
|
7549
|
+
*
|
|
7550
|
+
*/
|
|
7551
|
+
function metadata(metadataKey: any, metadataValue: any): {
|
|
7552
|
+
(target: Function): void;
|
|
7553
|
+
(target: Object, propertyKey: string | symbol): void;
|
|
7554
|
+
};
|
|
7555
|
+
/**
|
|
7556
|
+
* Define a unique metadata entry on the target.
|
|
7557
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7558
|
+
* @param metadataValue A value that contains attached metadata.
|
|
7559
|
+
* @param target The target object on which to define metadata.
|
|
7560
|
+
* @example
|
|
7561
|
+
*
|
|
7562
|
+
* class Example {
|
|
7563
|
+
* }
|
|
7564
|
+
*
|
|
7565
|
+
* // constructor
|
|
7566
|
+
* Reflect.defineMetadata("custom:annotation", options, Example);
|
|
7567
|
+
*
|
|
7568
|
+
* // decorator factory as metadata-producing annotation.
|
|
7569
|
+
* function MyAnnotation(options): ClassDecorator {
|
|
7570
|
+
* return target => Reflect.defineMetadata("custom:annotation", options, target);
|
|
7571
|
+
* }
|
|
7572
|
+
*
|
|
7573
|
+
*/
|
|
7574
|
+
function defineMetadata(metadataKey: any, metadataValue: any, target: Object): void;
|
|
7575
|
+
/**
|
|
7576
|
+
* Define a unique metadata entry on the target.
|
|
7577
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7578
|
+
* @param metadataValue A value that contains attached metadata.
|
|
7579
|
+
* @param target The target object on which to define metadata.
|
|
7580
|
+
* @param propertyKey The property key for the target.
|
|
7581
|
+
* @example
|
|
7582
|
+
*
|
|
7583
|
+
* class Example {
|
|
7584
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7585
|
+
* // static staticProperty;
|
|
7586
|
+
* // property;
|
|
7587
|
+
*
|
|
7588
|
+
* static staticMethod(p) { }
|
|
7589
|
+
* method(p) { }
|
|
7590
|
+
* }
|
|
7591
|
+
*
|
|
7592
|
+
* // property (on constructor)
|
|
7593
|
+
* Reflect.defineMetadata("custom:annotation", Number, Example, "staticProperty");
|
|
7594
|
+
*
|
|
7595
|
+
* // property (on prototype)
|
|
7596
|
+
* Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "property");
|
|
7597
|
+
*
|
|
7598
|
+
* // method (on constructor)
|
|
7599
|
+
* Reflect.defineMetadata("custom:annotation", Number, Example, "staticMethod");
|
|
7600
|
+
*
|
|
7601
|
+
* // method (on prototype)
|
|
7602
|
+
* Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "method");
|
|
7603
|
+
*
|
|
7604
|
+
* // decorator factory as metadata-producing annotation.
|
|
7605
|
+
* function MyAnnotation(options): PropertyDecorator {
|
|
7606
|
+
* return (target, key) => Reflect.defineMetadata("custom:annotation", options, target, key);
|
|
7607
|
+
* }
|
|
7608
|
+
*
|
|
7609
|
+
*/
|
|
7610
|
+
function defineMetadata(metadataKey: any, metadataValue: any, target: Object, propertyKey: string | symbol): void;
|
|
7611
|
+
/**
|
|
7612
|
+
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
|
|
7613
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7614
|
+
* @param target The target object on which the metadata is defined.
|
|
7615
|
+
* @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
|
|
7616
|
+
* @example
|
|
7617
|
+
*
|
|
7618
|
+
* class Example {
|
|
7619
|
+
* }
|
|
7620
|
+
*
|
|
7621
|
+
* // constructor
|
|
7622
|
+
* result = Reflect.hasMetadata("custom:annotation", Example);
|
|
7623
|
+
*
|
|
7624
|
+
*/
|
|
7625
|
+
function hasMetadata(metadataKey: any, target: Object): boolean;
|
|
7626
|
+
/**
|
|
7627
|
+
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
|
|
7628
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7629
|
+
* @param target The target object on which the metadata is defined.
|
|
7630
|
+
* @param propertyKey The property key for the target.
|
|
7631
|
+
* @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
|
|
7632
|
+
* @example
|
|
7633
|
+
*
|
|
7634
|
+
* class Example {
|
|
7635
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7636
|
+
* // static staticProperty;
|
|
7637
|
+
* // property;
|
|
7638
|
+
*
|
|
7639
|
+
* static staticMethod(p) { }
|
|
7640
|
+
* method(p) { }
|
|
7641
|
+
* }
|
|
7642
|
+
*
|
|
7643
|
+
* // property (on constructor)
|
|
7644
|
+
* result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty");
|
|
7645
|
+
*
|
|
7646
|
+
* // property (on prototype)
|
|
7647
|
+
* result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property");
|
|
7648
|
+
*
|
|
7649
|
+
* // method (on constructor)
|
|
7650
|
+
* result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod");
|
|
7651
|
+
*
|
|
7652
|
+
* // method (on prototype)
|
|
7653
|
+
* result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method");
|
|
7654
|
+
*
|
|
7655
|
+
*/
|
|
7656
|
+
function hasMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
|
|
7657
|
+
/**
|
|
7658
|
+
* Gets a value indicating whether the target object has the provided metadata key defined.
|
|
7659
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7660
|
+
* @param target The target object on which the metadata is defined.
|
|
7661
|
+
* @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
|
|
7662
|
+
* @example
|
|
7663
|
+
*
|
|
7664
|
+
* class Example {
|
|
7665
|
+
* }
|
|
7666
|
+
*
|
|
7667
|
+
* // constructor
|
|
7668
|
+
* result = Reflect.hasOwnMetadata("custom:annotation", Example);
|
|
7669
|
+
*
|
|
7670
|
+
*/
|
|
7671
|
+
function hasOwnMetadata(metadataKey: any, target: Object): boolean;
|
|
7672
|
+
/**
|
|
7673
|
+
* Gets a value indicating whether the target object has the provided metadata key defined.
|
|
7674
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7675
|
+
* @param target The target object on which the metadata is defined.
|
|
7676
|
+
* @param propertyKey The property key for the target.
|
|
7677
|
+
* @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
|
|
7678
|
+
* @example
|
|
7679
|
+
*
|
|
7680
|
+
* class Example {
|
|
7681
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7682
|
+
* // static staticProperty;
|
|
7683
|
+
* // property;
|
|
7684
|
+
*
|
|
7685
|
+
* static staticMethod(p) { }
|
|
7686
|
+
* method(p) { }
|
|
7687
|
+
* }
|
|
7688
|
+
*
|
|
7689
|
+
* // property (on constructor)
|
|
7690
|
+
* result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty");
|
|
7691
|
+
*
|
|
7692
|
+
* // property (on prototype)
|
|
7693
|
+
* result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property");
|
|
7694
|
+
*
|
|
7695
|
+
* // method (on constructor)
|
|
7696
|
+
* result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod");
|
|
7697
|
+
*
|
|
7698
|
+
* // method (on prototype)
|
|
7699
|
+
* result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method");
|
|
7700
|
+
*
|
|
7701
|
+
*/
|
|
7702
|
+
function hasOwnMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
|
|
7703
|
+
/**
|
|
7704
|
+
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
|
|
7705
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7706
|
+
* @param target The target object on which the metadata is defined.
|
|
7707
|
+
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
7708
|
+
* @example
|
|
7709
|
+
*
|
|
7710
|
+
* class Example {
|
|
7711
|
+
* }
|
|
7712
|
+
*
|
|
7713
|
+
* // constructor
|
|
7714
|
+
* result = Reflect.getMetadata("custom:annotation", Example);
|
|
7715
|
+
*
|
|
7716
|
+
*/
|
|
7717
|
+
function getMetadata(metadataKey: any, target: Object): any;
|
|
7718
|
+
/**
|
|
7719
|
+
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
|
|
7720
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7721
|
+
* @param target The target object on which the metadata is defined.
|
|
7722
|
+
* @param propertyKey The property key for the target.
|
|
7723
|
+
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
7724
|
+
* @example
|
|
7725
|
+
*
|
|
7726
|
+
* class Example {
|
|
7727
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7728
|
+
* // static staticProperty;
|
|
7729
|
+
* // property;
|
|
7730
|
+
*
|
|
7731
|
+
* static staticMethod(p) { }
|
|
7732
|
+
* method(p) { }
|
|
7733
|
+
* }
|
|
7734
|
+
*
|
|
7735
|
+
* // property (on constructor)
|
|
7736
|
+
* result = Reflect.getMetadata("custom:annotation", Example, "staticProperty");
|
|
7737
|
+
*
|
|
7738
|
+
* // property (on prototype)
|
|
7739
|
+
* result = Reflect.getMetadata("custom:annotation", Example.prototype, "property");
|
|
7740
|
+
*
|
|
7741
|
+
* // method (on constructor)
|
|
7742
|
+
* result = Reflect.getMetadata("custom:annotation", Example, "staticMethod");
|
|
7743
|
+
*
|
|
7744
|
+
* // method (on prototype)
|
|
7745
|
+
* result = Reflect.getMetadata("custom:annotation", Example.prototype, "method");
|
|
7746
|
+
*
|
|
7747
|
+
*/
|
|
7748
|
+
function getMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): any;
|
|
7749
|
+
/**
|
|
7750
|
+
* Gets the metadata value for the provided metadata key on the target object.
|
|
7751
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7752
|
+
* @param target The target object on which the metadata is defined.
|
|
7753
|
+
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
7754
|
+
* @example
|
|
7755
|
+
*
|
|
7756
|
+
* class Example {
|
|
7757
|
+
* }
|
|
7758
|
+
*
|
|
7759
|
+
* // constructor
|
|
7760
|
+
* result = Reflect.getOwnMetadata("custom:annotation", Example);
|
|
7761
|
+
*
|
|
7762
|
+
*/
|
|
7763
|
+
function getOwnMetadata(metadataKey: any, target: Object): any;
|
|
7764
|
+
/**
|
|
7765
|
+
* Gets the metadata value for the provided metadata key on the target object.
|
|
7766
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7767
|
+
* @param target The target object on which the metadata is defined.
|
|
7768
|
+
* @param propertyKey The property key for the target.
|
|
7769
|
+
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
7770
|
+
* @example
|
|
7771
|
+
*
|
|
7772
|
+
* class Example {
|
|
7773
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7774
|
+
* // static staticProperty;
|
|
7775
|
+
* // property;
|
|
7776
|
+
*
|
|
7777
|
+
* static staticMethod(p) { }
|
|
7778
|
+
* method(p) { }
|
|
7779
|
+
* }
|
|
7780
|
+
*
|
|
7781
|
+
* // property (on constructor)
|
|
7782
|
+
* result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty");
|
|
7783
|
+
*
|
|
7784
|
+
* // property (on prototype)
|
|
7785
|
+
* result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property");
|
|
7786
|
+
*
|
|
7787
|
+
* // method (on constructor)
|
|
7788
|
+
* result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod");
|
|
7789
|
+
*
|
|
7790
|
+
* // method (on prototype)
|
|
7791
|
+
* result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method");
|
|
7792
|
+
*
|
|
7793
|
+
*/
|
|
7794
|
+
function getOwnMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): any;
|
|
7795
|
+
/**
|
|
7796
|
+
* Gets the metadata keys defined on the target object or its prototype chain.
|
|
7797
|
+
* @param target The target object on which the metadata is defined.
|
|
7798
|
+
* @returns An array of unique metadata keys.
|
|
7799
|
+
* @example
|
|
7800
|
+
*
|
|
7801
|
+
* class Example {
|
|
7802
|
+
* }
|
|
7803
|
+
*
|
|
7804
|
+
* // constructor
|
|
7805
|
+
* result = Reflect.getMetadataKeys(Example);
|
|
7806
|
+
*
|
|
7807
|
+
*/
|
|
7808
|
+
function getMetadataKeys(target: Object): any[];
|
|
7809
|
+
/**
|
|
7810
|
+
* Gets the metadata keys defined on the target object or its prototype chain.
|
|
7811
|
+
* @param target The target object on which the metadata is defined.
|
|
7812
|
+
* @param propertyKey The property key for the target.
|
|
7813
|
+
* @returns An array of unique metadata keys.
|
|
7814
|
+
* @example
|
|
7815
|
+
*
|
|
7816
|
+
* class Example {
|
|
7817
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7818
|
+
* // static staticProperty;
|
|
7819
|
+
* // property;
|
|
7820
|
+
*
|
|
7821
|
+
* static staticMethod(p) { }
|
|
7822
|
+
* method(p) { }
|
|
7823
|
+
* }
|
|
7824
|
+
*
|
|
7825
|
+
* // property (on constructor)
|
|
7826
|
+
* result = Reflect.getMetadataKeys(Example, "staticProperty");
|
|
7827
|
+
*
|
|
7828
|
+
* // property (on prototype)
|
|
7829
|
+
* result = Reflect.getMetadataKeys(Example.prototype, "property");
|
|
7830
|
+
*
|
|
7831
|
+
* // method (on constructor)
|
|
7832
|
+
* result = Reflect.getMetadataKeys(Example, "staticMethod");
|
|
7833
|
+
*
|
|
7834
|
+
* // method (on prototype)
|
|
7835
|
+
* result = Reflect.getMetadataKeys(Example.prototype, "method");
|
|
7836
|
+
*
|
|
7837
|
+
*/
|
|
7838
|
+
function getMetadataKeys(target: Object, propertyKey: string | symbol): any[];
|
|
7839
|
+
/**
|
|
7840
|
+
* Gets the unique metadata keys defined on the target object.
|
|
7841
|
+
* @param target The target object on which the metadata is defined.
|
|
7842
|
+
* @returns An array of unique metadata keys.
|
|
7843
|
+
* @example
|
|
7844
|
+
*
|
|
7845
|
+
* class Example {
|
|
7846
|
+
* }
|
|
7847
|
+
*
|
|
7848
|
+
* // constructor
|
|
7849
|
+
* result = Reflect.getOwnMetadataKeys(Example);
|
|
7850
|
+
*
|
|
7851
|
+
*/
|
|
7852
|
+
function getOwnMetadataKeys(target: Object): any[];
|
|
7853
|
+
/**
|
|
7854
|
+
* Gets the unique metadata keys defined on the target object.
|
|
7855
|
+
* @param target The target object on which the metadata is defined.
|
|
7856
|
+
* @param propertyKey The property key for the target.
|
|
7857
|
+
* @returns An array of unique metadata keys.
|
|
7858
|
+
* @example
|
|
7859
|
+
*
|
|
7860
|
+
* class Example {
|
|
7861
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7862
|
+
* // static staticProperty;
|
|
7863
|
+
* // property;
|
|
7864
|
+
*
|
|
7865
|
+
* static staticMethod(p) { }
|
|
7866
|
+
* method(p) { }
|
|
7867
|
+
* }
|
|
7868
|
+
*
|
|
7869
|
+
* // property (on constructor)
|
|
7870
|
+
* result = Reflect.getOwnMetadataKeys(Example, "staticProperty");
|
|
7871
|
+
*
|
|
7872
|
+
* // property (on prototype)
|
|
7873
|
+
* result = Reflect.getOwnMetadataKeys(Example.prototype, "property");
|
|
7874
|
+
*
|
|
7875
|
+
* // method (on constructor)
|
|
7876
|
+
* result = Reflect.getOwnMetadataKeys(Example, "staticMethod");
|
|
7877
|
+
*
|
|
7878
|
+
* // method (on prototype)
|
|
7879
|
+
* result = Reflect.getOwnMetadataKeys(Example.prototype, "method");
|
|
7880
|
+
*
|
|
7881
|
+
*/
|
|
7882
|
+
function getOwnMetadataKeys(target: Object, propertyKey: string | symbol): any[];
|
|
7883
|
+
/**
|
|
7884
|
+
* Deletes the metadata entry from the target object with the provided key.
|
|
7885
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7886
|
+
* @param target The target object on which the metadata is defined.
|
|
7887
|
+
* @returns `true` if the metadata entry was found and deleted; otherwise, false.
|
|
7888
|
+
* @example
|
|
7889
|
+
*
|
|
7890
|
+
* class Example {
|
|
7891
|
+
* }
|
|
7892
|
+
*
|
|
7893
|
+
* // constructor
|
|
7894
|
+
* result = Reflect.deleteMetadata("custom:annotation", Example);
|
|
7895
|
+
*
|
|
7896
|
+
*/
|
|
7897
|
+
function deleteMetadata(metadataKey: any, target: Object): boolean;
|
|
7898
|
+
/**
|
|
7899
|
+
* Deletes the metadata entry from the target object with the provided key.
|
|
7900
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7901
|
+
* @param target The target object on which the metadata is defined.
|
|
7902
|
+
* @param propertyKey The property key for the target.
|
|
7903
|
+
* @returns `true` if the metadata entry was found and deleted; otherwise, false.
|
|
7904
|
+
* @example
|
|
7905
|
+
*
|
|
7906
|
+
* class Example {
|
|
7907
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7908
|
+
* // static staticProperty;
|
|
7909
|
+
* // property;
|
|
7910
|
+
*
|
|
7911
|
+
* static staticMethod(p) { }
|
|
7912
|
+
* method(p) { }
|
|
7913
|
+
* }
|
|
7914
|
+
*
|
|
7915
|
+
* // property (on constructor)
|
|
7916
|
+
* result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty");
|
|
7917
|
+
*
|
|
7918
|
+
* // property (on prototype)
|
|
7919
|
+
* result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property");
|
|
7920
|
+
*
|
|
7921
|
+
* // method (on constructor)
|
|
7922
|
+
* result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod");
|
|
7923
|
+
*
|
|
7924
|
+
* // method (on prototype)
|
|
7925
|
+
* result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method");
|
|
7926
|
+
*
|
|
7927
|
+
*/
|
|
7928
|
+
function deleteMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
|
|
7929
|
+
}
|
|
7930
|
+
}
|
|
7931
|
+
|
|
7932
|
+
type PropertyType = 'number' | 'integer' | 'string' | 'boolean' | 'color' | 'vector2' | 'vector3' | 'enum' | 'asset' | 'animationClips';
|
|
7933
|
+
/**
|
|
7934
|
+
* 资源类型
|
|
7935
|
+
* Asset type for asset properties
|
|
7936
|
+
*/
|
|
7937
|
+
type AssetType = 'texture' | 'audio' | 'scene' | 'prefab' | 'animation' | 'any';
|
|
7938
|
+
/**
|
|
7939
|
+
* 枚举选项 - 支持简单字符串或带标签的对象
|
|
7940
|
+
* Enum option - supports simple string or labeled object
|
|
7941
|
+
*/
|
|
7942
|
+
type EnumOption = string | {
|
|
7943
|
+
label: string;
|
|
7944
|
+
value: any;
|
|
7945
|
+
};
|
|
7946
|
+
/**
|
|
7947
|
+
* Action button configuration for property fields
|
|
7948
|
+
* 属性字段的操作按钮配置
|
|
7949
|
+
*/
|
|
7950
|
+
interface PropertyAction {
|
|
7951
|
+
/** Action identifier | 操作标识符 */
|
|
7952
|
+
id: string;
|
|
7953
|
+
/** Button label | 按钮标签 */
|
|
7954
|
+
label: string;
|
|
7955
|
+
/** Button tooltip | 按钮提示 */
|
|
7956
|
+
tooltip?: string;
|
|
7957
|
+
/** Icon name from Lucide | Lucide图标名称 */
|
|
7958
|
+
icon?: string;
|
|
7959
|
+
}
|
|
7960
|
+
/**
|
|
7961
|
+
* 控制关系声明
|
|
7962
|
+
* Control relationship declaration
|
|
7963
|
+
*/
|
|
7964
|
+
interface PropertyControl {
|
|
7965
|
+
/** 被控制的组件名称 | Target component name */
|
|
7966
|
+
component: string;
|
|
7967
|
+
/** 被控制的属性名称 | Target property name */
|
|
7968
|
+
property: string;
|
|
7969
|
+
}
|
|
7970
|
+
/**
|
|
7971
|
+
* 属性基础选项
|
|
7972
|
+
* Base property options shared by all types
|
|
7973
|
+
*/
|
|
7974
|
+
interface PropertyOptionsBase {
|
|
7975
|
+
/** 显示标签 | Display label */
|
|
7976
|
+
label?: string;
|
|
7977
|
+
/** 是否只读 | Read-only flag */
|
|
7978
|
+
readOnly?: boolean;
|
|
7979
|
+
/** Action buttons | 操作按钮 */
|
|
7980
|
+
actions?: PropertyAction[];
|
|
7981
|
+
/** 此属性控制的其他组件属性 | Properties this field controls */
|
|
7982
|
+
controls?: PropertyControl[];
|
|
7983
|
+
}
|
|
7984
|
+
/**
|
|
7985
|
+
* 数值类型属性选项
|
|
7986
|
+
* Number property options
|
|
7987
|
+
*/
|
|
7988
|
+
interface NumberPropertyOptions extends PropertyOptionsBase {
|
|
7989
|
+
type: 'number' | 'integer';
|
|
7990
|
+
min?: number;
|
|
7991
|
+
max?: number;
|
|
7992
|
+
step?: number;
|
|
7993
|
+
}
|
|
7994
|
+
/**
|
|
7995
|
+
* 字符串类型属性选项
|
|
7996
|
+
* String property options
|
|
7997
|
+
*/
|
|
7998
|
+
interface StringPropertyOptions extends PropertyOptionsBase {
|
|
7999
|
+
type: 'string';
|
|
8000
|
+
/** 多行文本 | Multiline text */
|
|
8001
|
+
multiline?: boolean;
|
|
8002
|
+
}
|
|
8003
|
+
/**
|
|
8004
|
+
* 布尔类型属性选项
|
|
8005
|
+
* Boolean property options
|
|
8006
|
+
*/
|
|
8007
|
+
interface BooleanPropertyOptions extends PropertyOptionsBase {
|
|
8008
|
+
type: 'boolean';
|
|
8009
|
+
}
|
|
8010
|
+
/**
|
|
8011
|
+
* 颜色类型属性选项
|
|
8012
|
+
* Color property options
|
|
8013
|
+
*/
|
|
8014
|
+
interface ColorPropertyOptions extends PropertyOptionsBase {
|
|
8015
|
+
type: 'color';
|
|
8016
|
+
/** 是否包含透明度 | Include alpha channel */
|
|
8017
|
+
alpha?: boolean;
|
|
8018
|
+
}
|
|
8019
|
+
/**
|
|
8020
|
+
* 向量类型属性选项
|
|
8021
|
+
* Vector property options
|
|
8022
|
+
*/
|
|
8023
|
+
interface VectorPropertyOptions extends PropertyOptionsBase {
|
|
8024
|
+
type: 'vector2' | 'vector3';
|
|
8025
|
+
}
|
|
8026
|
+
/**
|
|
8027
|
+
* 枚举类型属性选项
|
|
8028
|
+
* Enum property options
|
|
8029
|
+
*/
|
|
8030
|
+
interface EnumPropertyOptions extends PropertyOptionsBase {
|
|
8031
|
+
type: 'enum';
|
|
8032
|
+
/** 枚举选项列表 | Enum options list */
|
|
8033
|
+
options: EnumOption[];
|
|
8034
|
+
}
|
|
8035
|
+
/**
|
|
8036
|
+
* 资源类型属性选项
|
|
8037
|
+
* Asset property options
|
|
8038
|
+
*/
|
|
8039
|
+
interface AssetPropertyOptions extends PropertyOptionsBase {
|
|
8040
|
+
type: 'asset';
|
|
8041
|
+
/** 资源类型 | Asset type */
|
|
8042
|
+
assetType?: AssetType;
|
|
8043
|
+
/** 文件扩展名过滤 | File extension filter */
|
|
8044
|
+
extensions?: string[];
|
|
8045
|
+
}
|
|
8046
|
+
/**
|
|
8047
|
+
* 动画剪辑类型属性选项
|
|
8048
|
+
* Animation clips property options
|
|
8049
|
+
*/
|
|
8050
|
+
interface AnimationClipsPropertyOptions extends PropertyOptionsBase {
|
|
8051
|
+
type: 'animationClips';
|
|
8052
|
+
}
|
|
8053
|
+
/**
|
|
8054
|
+
* 属性选项联合类型
|
|
8055
|
+
* Property options union type
|
|
8056
|
+
*/
|
|
8057
|
+
type PropertyOptions = NumberPropertyOptions | StringPropertyOptions | BooleanPropertyOptions | ColorPropertyOptions | VectorPropertyOptions | EnumPropertyOptions | AssetPropertyOptions | AnimationClipsPropertyOptions;
|
|
8058
|
+
declare const PROPERTY_METADATA: unique symbol;
|
|
8059
|
+
/**
|
|
8060
|
+
* 属性装饰器 - 声明组件属性的编辑器元数据
|
|
8061
|
+
*
|
|
8062
|
+
* @example
|
|
8063
|
+
* ```typescript
|
|
8064
|
+
* @ECSComponent('Transform')
|
|
8065
|
+
* export class TransformComponent extends Component {
|
|
8066
|
+
* @Property({ type: 'vector3', label: 'Position' })
|
|
8067
|
+
* public position: Vector3 = { x: 0, y: 0, z: 0 };
|
|
8068
|
+
*
|
|
8069
|
+
* @Property({ type: 'number', label: 'Speed', min: 0, max: 100 })
|
|
8070
|
+
* public speed: number = 10;
|
|
8071
|
+
* }
|
|
8072
|
+
* ```
|
|
8073
|
+
*/
|
|
8074
|
+
declare function Property(options: PropertyOptions): PropertyDecorator;
|
|
8075
|
+
/**
|
|
8076
|
+
* 获取组件类的所有属性元数据
|
|
8077
|
+
*/
|
|
8078
|
+
declare function getPropertyMetadata(target: Function): Record<string, PropertyOptions> | undefined;
|
|
8079
|
+
/**
|
|
8080
|
+
* 检查组件类是否有属性元数据
|
|
8081
|
+
*/
|
|
8082
|
+
declare function hasPropertyMetadata(target: Function): boolean;
|
|
8083
|
+
|
|
7341
8084
|
/**
|
|
7342
8085
|
* 实体构建器 - 提供流式API创建和配置实体
|
|
7343
8086
|
*/
|
|
@@ -11265,5 +12008,5 @@ declare function getFullPlatformConfig(): Promise<any>;
|
|
|
11265
12008
|
declare function supportsFeature(feature: 'worker' | 'shared-array-buffer' | 'transferable-objects' | 'module-worker'): boolean;
|
|
11266
12009
|
declare function hasAdapter(): boolean;
|
|
11267
12010
|
|
|
11268
|
-
export { BinarySerializer, BitMask64Utils, Bits, COMPONENT_TYPE_NAME, ChangeOperation, Colors, Component, ComponentDataCollector, ComponentPool, ComponentPoolManager, ComponentRegistry, ComponentSerializer, ComponentSparseSet, ComponentStorage, ConsoleLogger, Core, DebugConfigService, DebugManager, DebugPlugin, DeepCopy, ECSComponent, ECSEventType, ECSFluentAPI, ECSSystem, ENTITY_REF_METADATA, EVENT_TYPES, Emitter, EnableSoA, Entity, EntityDataCollector, EntityList, EntityProcessorList, EntityRef, EntitySerializer, EntitySystem, EventBus, EventPriority, EventTypeValidator, Float32, Float64, FuncPack, GlobalEventBus, GlobalManager, IdentifierPool, IgnoreSerialization, IncrementalSerializer, InjectProperty, Injectable, Int16, Int32, Int8, IntervalSystem, LogLevel, Logger, LoggerManager, Matcher, MigrationBuilder, NumberExtension, PassiveSystem, PerformanceDataCollector, PerformanceMonitor, PerformanceWarningType, PlatformDetector, PlatformManager, PluginManager, PluginState, Pool, PoolManager, ProcessingSystem, QuerySystem, ReactiveQuery, ReactiveQueryChangeType, ReferenceTracker, SERIALIZABLE_METADATA, SERIALIZE_FIELD, SERIALIZE_OPTIONS, SYSTEM_TYPE_NAME, Scene, SceneDataCollector, SceneManager, SceneSerializer, Serializable, Serialize, SerializeArray, SerializeAsMap, SerializeAsSet, SerializeMap, SerializeSet, ServiceContainer, ServiceLifetime, SoAStorage, SparseSet, SystemDataCollector, Time, Timer, TimerManager, TypeSafeEventSystem, TypeUtils, TypedEntityBuilder, TypedQueryBuilder, TypedQueryResult, Uint16, Uint32, Uint8, Uint8Clamped, Updatable, VersionMigrationManager, WebSocketManager, WorkerEntitySystem, World, WorldManager, addAndConfigure, buildEntity, createECSAPI, createInstance, createLogger, createQuery, getBasicWorkerConfig, getComponentInstanceTypeName, getComponentTypeName, getComponents, getCurrentAdapter, getEntityRefMetadata, getFullPlatformConfig, getOrAddComponent, getPropertyInjectMetadata, getSceneByEntityId, getSerializationMetadata, getSystemInstanceTypeName, getSystemMetadata, getSystemTypeName, getUpdatableMetadata, hasAdapter, hasAnyComponent, hasComponents, hasEntityRef, injectProperties, isComponentArray, isComponentType, isSerializable, isUpdatable, queryFor, queryForAll, registerInjectable, registerPlatformAdapter, requireComponent, resetLoggerColors, setGlobalLogLevel, setLoggerColors, setLoggerFactory, supportsFeature, tryGetComponent, updateComponent };
|
|
11269
|
-
export type { AnyComponentConstructor, BitMask64Data, ComponentChange, ComponentConstructor, ComponentDebugInfo, ComponentInstance, ComponentMigrationFunction, ComponentType$1 as ComponentType, ComponentTypeMap, ComponentTypeName, ComponentTypeNames, DataOnly, DeepPartial, DeepReadonly, DeserializationStrategy, ECSDebugStats, EntityChange, EntityDebugInfo, EntityRefMetadata, EntityRefRecord, EntityWithComponents, EventListenerConfig, EventStats, ExtractComponents, FieldSerializeOptions, IComponent, IComponentDebugData, IComponentEventData, ICoreConfig, IECSDebugConfig, IECSDebugData, IEntityDebugData, IEntityEventData, IEntityHierarchyNode, IEventBus, IEventData, IEventListenerConfig, IEventStats, ILogger, IPerformanceDebugData, IPerformanceEventData, IPlatformAdapter, IPlugin, IPluginMetadata, IPoolable, IScene, ISceneConfig, ISceneDebugData, ISceneEventData, ISceneFactory, IService, ISystemBase, ISystemDebugData, ISystemEventData, ITimer, IUpdatable, IWorldConfig, IWorldManagerConfig, IncrementalSerializationFormat, IncrementalSerializationOptions, IncrementalSnapshot, InjectableMetadata, LoggerColorConfig, LoggerConfig, MigrationFunction, PartialComponent, PerformanceData, PerformanceStats, PerformanceThresholds, PerformanceWarning, PlatformConfig, PlatformDetectionResult, PlatformWorker, PoolStats, QueryResult$1 as QueryResult, ReactiveQueryChange, ReactiveQueryConfig, ReactiveQueryListener, ReadonlyComponent, SceneDataChange, SceneDebugInfo, SceneDeserializationOptions, SceneMigrationFunction, SceneSerializationOptions, SerializableComponent, SerializableFields, SerializableOptions, SerializationFormat, SerializationMetadata, SerializedComponent, SerializedEntity, SerializedScene, ServiceType, SharedArrayBufferProcessFunction, SupportedTypedArray, SystemDebugInfo, SystemEntityType, SystemLifecycleHooks, SystemMetadata, TypeSafeBuilder, TypedEventHandler, TypedQueryCondition, UpdatableMetadata, ValidComponent, ValidComponentArray, WorkerCreationOptions, WorkerProcessFunction, WorkerSystemConfig };
|
|
12011
|
+
export { BinarySerializer, BitMask64Utils, Bits, COMPONENT_DEPENDENCIES, COMPONENT_TYPE_NAME, ChangeOperation, Colors, Component, ComponentDataCollector, ComponentPool, ComponentPoolManager, ComponentRegistry, ComponentSerializer, ComponentSparseSet, ComponentStorage, ConsoleLogger, Core, DebugConfigService, DebugManager, DebugPlugin, DeepCopy, ECSComponent, ECSEventType, ECSFluentAPI, ECSSystem, ENTITY_REF_METADATA, EVENT_TYPES, Emitter, EnableSoA, Entity, EntityDataCollector, EntityList, EntityProcessorList, EntityRef, EntitySerializer, EntitySystem, EventBus, EventPriority, EventTypeValidator, Float32, Float64, FuncPack, GlobalEventBus, GlobalManager, IdentifierPool, IgnoreSerialization, IncrementalSerializer, InjectProperty, Injectable, Int16, Int32, Int8, IntervalSystem, LogLevel, Logger, LoggerManager, Matcher, MigrationBuilder, NumberExtension, PROPERTY_METADATA, PassiveSystem, PerformanceDataCollector, PerformanceMonitor, PerformanceWarningType, PlatformDetector, PlatformManager, PluginManager, PluginState, Pool, PoolManager, ProcessingSystem, Property, QuerySystem, ReactiveQuery, ReactiveQueryChangeType, ReferenceTracker, SERIALIZABLE_METADATA, SERIALIZE_FIELD, SERIALIZE_OPTIONS, SYSTEM_TYPE_NAME, Scene, SceneDataCollector, SceneManager, SceneSerializer, Serializable, Serialize, SerializeArray, SerializeAsMap, SerializeAsSet, SerializeMap, SerializeSet, ServiceContainer, ServiceLifetime, SoAStorage, SparseSet, SystemDataCollector, Time, Timer, TimerManager, TypeSafeEventSystem, TypeUtils, TypedEntityBuilder, TypedQueryBuilder, TypedQueryResult, Uint16, Uint32, Uint8, Uint8Clamped, Updatable, VersionMigrationManager, WebSocketManager, WorkerEntitySystem, World, WorldManager, addAndConfigure, buildEntity, createECSAPI, createInstance, createLogger, createQuery, getBasicWorkerConfig, getComponentDependencies, getComponentInstanceTypeName, getComponentTypeName, getComponents, getCurrentAdapter, getEntityRefMetadata, getFullPlatformConfig, getOrAddComponent, getPropertyInjectMetadata, getPropertyMetadata, getSceneByEntityId, getSerializationMetadata, getSystemInstanceTypeName, getSystemMetadata, getSystemTypeName, getUpdatableMetadata, hasAdapter, hasAnyComponent, hasComponents, hasEntityRef, hasPropertyMetadata, injectProperties, isComponentArray, isComponentType, isSerializable, isUpdatable, queryFor, queryForAll, registerInjectable, registerPlatformAdapter, requireComponent, resetLoggerColors, setGlobalLogLevel, setLoggerColors, setLoggerFactory, supportsFeature, tryGetComponent, updateComponent };
|
|
12012
|
+
export type { AnyComponentConstructor, AssetType, BitMask64Data, ComponentChange, ComponentConstructor, ComponentDebugInfo, ComponentInstance, ComponentMigrationFunction, ComponentOptions, ComponentType$1 as ComponentType, ComponentTypeMap, ComponentTypeName, ComponentTypeNames, DataOnly, DeepPartial, DeepReadonly, DeserializationStrategy, ECSDebugStats, EntityChange, EntityDebugInfo, EntityRefMetadata, EntityRefRecord, EntityWithComponents, EnumOption, EventListenerConfig, EventStats, ExtractComponents, FieldSerializeOptions, IComponent, IComponentDebugData, IComponentEventData, ICoreConfig, IECSDebugConfig, IECSDebugData, IEntityDebugData, IEntityEventData, IEntityHierarchyNode, IEventBus, IEventData, IEventListenerConfig, IEventStats, ILogger, IPerformanceDebugData, IPerformanceEventData, IPlatformAdapter, IPlugin, IPluginMetadata, IPoolable, IScene, ISceneConfig, ISceneDebugData, ISceneEventData, ISceneFactory, IService, ISystemBase, ISystemDebugData, ISystemEventData, ITimer, IUpdatable, IWorldConfig, IWorldManagerConfig, IncrementalSerializationFormat, IncrementalSerializationOptions, IncrementalSnapshot, InjectableMetadata, LoggerColorConfig, LoggerConfig, MigrationFunction, PartialComponent, PerformanceData, PerformanceStats, PerformanceThresholds, PerformanceWarning, PlatformConfig, PlatformDetectionResult, PlatformWorker, PoolStats, PropertyAction, PropertyControl, PropertyOptions, PropertyType, QueryResult$1 as QueryResult, ReactiveQueryChange, ReactiveQueryConfig, ReactiveQueryListener, ReadonlyComponent, SceneDataChange, SceneDebugInfo, SceneDeserializationOptions, SceneMigrationFunction, SceneSerializationOptions, SerializableComponent, SerializableFields, SerializableOptions, SerializationFormat, SerializationMetadata, SerializedComponent, SerializedEntity, SerializedScene, ServiceIdentifier, ServiceType, SharedArrayBufferProcessFunction, SupportedTypedArray, SystemDebugInfo, SystemEntityType, SystemLifecycleHooks, SystemMetadata, TypeSafeBuilder, TypedEventHandler, TypedQueryCondition, UpdatableMetadata, ValidComponent, ValidComponentArray, WorkerCreationOptions, WorkerProcessFunction, WorkerSystemConfig };
|