@esengine/ecs-framework 2.2.14 → 2.2.15
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 +599 -6
- 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.15
|
|
3
3
|
* TypeScript definitions
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -692,8 +692,6 @@ interface ISceneDebugData {
|
|
|
692
692
|
sceneEntityCount: number;
|
|
693
693
|
/** 场景系统数 */
|
|
694
694
|
sceneSystemCount: number;
|
|
695
|
-
/** 场景内存使用量 */
|
|
696
|
-
sceneMemory: number;
|
|
697
695
|
/** 场景启动时间 */
|
|
698
696
|
sceneUptime: number;
|
|
699
697
|
}
|
|
@@ -1658,6 +1656,12 @@ declare class EntityList {
|
|
|
1658
1656
|
* @param isAdd 是否为添加操作
|
|
1659
1657
|
*/
|
|
1660
1658
|
private updateNameIndex;
|
|
1659
|
+
/**
|
|
1660
|
+
* 重新排序实体
|
|
1661
|
+
* @param entityId 要移动的实体ID
|
|
1662
|
+
* @param newIndex 新的索引位置
|
|
1663
|
+
*/
|
|
1664
|
+
reorderEntity(entityId: number, newIndex: number): void;
|
|
1661
1665
|
/**
|
|
1662
1666
|
* 获取实体列表的统计信息
|
|
1663
1667
|
* @returns 统计信息
|
|
@@ -7197,15 +7201,27 @@ declare abstract class WorkerEntitySystem<TEntityData = any> extends EntitySyste
|
|
|
7197
7201
|
* 存储组件类型名称的Symbol键
|
|
7198
7202
|
*/
|
|
7199
7203
|
declare const COMPONENT_TYPE_NAME: unique symbol;
|
|
7204
|
+
/**
|
|
7205
|
+
* 存储组件依赖的Symbol键
|
|
7206
|
+
*/
|
|
7207
|
+
declare const COMPONENT_DEPENDENCIES: unique symbol;
|
|
7200
7208
|
/**
|
|
7201
7209
|
* 存储系统类型名称的Symbol键
|
|
7202
7210
|
*/
|
|
7203
7211
|
declare const SYSTEM_TYPE_NAME: unique symbol;
|
|
7212
|
+
/**
|
|
7213
|
+
* 组件装饰器配置选项
|
|
7214
|
+
*/
|
|
7215
|
+
interface ComponentOptions {
|
|
7216
|
+
/** 依赖的其他组件名称列表 */
|
|
7217
|
+
requires?: string[];
|
|
7218
|
+
}
|
|
7204
7219
|
/**
|
|
7205
7220
|
* 组件类型装饰器
|
|
7206
7221
|
* 用于为组件类指定固定的类型名称,避免在代码混淆后失效
|
|
7207
7222
|
*
|
|
7208
7223
|
* @param typeName 组件类型名称
|
|
7224
|
+
* @param options 组件配置选项
|
|
7209
7225
|
* @example
|
|
7210
7226
|
* ```typescript
|
|
7211
7227
|
* @ECSComponent('Position')
|
|
@@ -7213,9 +7229,19 @@ declare const SYSTEM_TYPE_NAME: unique symbol;
|
|
|
7213
7229
|
* x: number = 0;
|
|
7214
7230
|
* y: number = 0;
|
|
7215
7231
|
* }
|
|
7232
|
+
*
|
|
7233
|
+
* // 带依赖声明
|
|
7234
|
+
* @ECSComponent('SpriteAnimator', { requires: ['Sprite'] })
|
|
7235
|
+
* class SpriteAnimatorComponent extends Component {
|
|
7236
|
+
* // ...
|
|
7237
|
+
* }
|
|
7216
7238
|
* ```
|
|
7217
7239
|
*/
|
|
7218
|
-
declare function ECSComponent(typeName: string): <T extends new (...args: any[]) => Component>(target: T) => T;
|
|
7240
|
+
declare function ECSComponent(typeName: string, options?: ComponentOptions): <T extends new (...args: any[]) => Component>(target: T) => T;
|
|
7241
|
+
/**
|
|
7242
|
+
* 获取组件的依赖列表
|
|
7243
|
+
*/
|
|
7244
|
+
declare function getComponentDependencies(componentType: ComponentType$1): string[] | undefined;
|
|
7219
7245
|
/**
|
|
7220
7246
|
* System元数据配置
|
|
7221
7247
|
*/
|
|
@@ -7338,6 +7364,573 @@ declare function getEntityRefMetadata(component: any): EntityRefMetadata | null;
|
|
|
7338
7364
|
*/
|
|
7339
7365
|
declare function hasEntityRef(component: any): boolean;
|
|
7340
7366
|
|
|
7367
|
+
/*! *****************************************************************************
|
|
7368
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
7369
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
7370
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
7371
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7372
|
+
|
|
7373
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
7374
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
7375
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
7376
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
7377
|
+
|
|
7378
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
7379
|
+
and limitations under the License.
|
|
7380
|
+
***************************************************************************** */
|
|
7381
|
+
|
|
7382
|
+
|
|
7383
|
+
|
|
7384
|
+
declare global {
|
|
7385
|
+
namespace Reflect {
|
|
7386
|
+
/**
|
|
7387
|
+
* Applies a set of decorators to a target object.
|
|
7388
|
+
* @param decorators An array of decorators.
|
|
7389
|
+
* @param target The target object.
|
|
7390
|
+
* @returns The result of applying the provided decorators.
|
|
7391
|
+
* @remarks Decorators are applied in reverse order of their positions in the array.
|
|
7392
|
+
* @example
|
|
7393
|
+
*
|
|
7394
|
+
* class Example { }
|
|
7395
|
+
*
|
|
7396
|
+
* // constructor
|
|
7397
|
+
* Example = Reflect.decorate(decoratorsArray, Example);
|
|
7398
|
+
*
|
|
7399
|
+
*/
|
|
7400
|
+
function decorate(decorators: ClassDecorator[], target: Function): Function;
|
|
7401
|
+
/**
|
|
7402
|
+
* Applies a set of decorators to a property of a target object.
|
|
7403
|
+
* @param decorators An array of decorators.
|
|
7404
|
+
* @param target The target object.
|
|
7405
|
+
* @param propertyKey The property key to decorate.
|
|
7406
|
+
* @param attributes A property descriptor.
|
|
7407
|
+
* @remarks Decorators are applied in reverse order.
|
|
7408
|
+
* @example
|
|
7409
|
+
*
|
|
7410
|
+
* class Example {
|
|
7411
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7412
|
+
* // static staticProperty;
|
|
7413
|
+
* // property;
|
|
7414
|
+
*
|
|
7415
|
+
* static staticMethod() { }
|
|
7416
|
+
* method() { }
|
|
7417
|
+
* }
|
|
7418
|
+
*
|
|
7419
|
+
* // property (on constructor)
|
|
7420
|
+
* Reflect.decorate(decoratorsArray, Example, "staticProperty");
|
|
7421
|
+
*
|
|
7422
|
+
* // property (on prototype)
|
|
7423
|
+
* Reflect.decorate(decoratorsArray, Example.prototype, "property");
|
|
7424
|
+
*
|
|
7425
|
+
* // method (on constructor)
|
|
7426
|
+
* Object.defineProperty(Example, "staticMethod",
|
|
7427
|
+
* Reflect.decorate(decoratorsArray, Example, "staticMethod",
|
|
7428
|
+
* Object.getOwnPropertyDescriptor(Example, "staticMethod")));
|
|
7429
|
+
*
|
|
7430
|
+
* // method (on prototype)
|
|
7431
|
+
* Object.defineProperty(Example.prototype, "method",
|
|
7432
|
+
* Reflect.decorate(decoratorsArray, Example.prototype, "method",
|
|
7433
|
+
* Object.getOwnPropertyDescriptor(Example.prototype, "method")));
|
|
7434
|
+
*
|
|
7435
|
+
*/
|
|
7436
|
+
function decorate(decorators: (PropertyDecorator | MethodDecorator)[], target: Object, propertyKey: string | symbol, attributes?: PropertyDescriptor): PropertyDescriptor;
|
|
7437
|
+
/**
|
|
7438
|
+
* A default metadata decorator factory that can be used on a class, class member, or parameter.
|
|
7439
|
+
* @param metadataKey The key for the metadata entry.
|
|
7440
|
+
* @param metadataValue The value for the metadata entry.
|
|
7441
|
+
* @returns A decorator function.
|
|
7442
|
+
* @remarks
|
|
7443
|
+
* If `metadataKey` is already defined for the target and target key, the
|
|
7444
|
+
* metadataValue for that key will be overwritten.
|
|
7445
|
+
* @example
|
|
7446
|
+
*
|
|
7447
|
+
* // constructor
|
|
7448
|
+
* @Reflect.metadata(key, value)
|
|
7449
|
+
* class Example {
|
|
7450
|
+
* }
|
|
7451
|
+
*
|
|
7452
|
+
* // property (on constructor, TypeScript only)
|
|
7453
|
+
* class Example {
|
|
7454
|
+
* @Reflect.metadata(key, value)
|
|
7455
|
+
* static staticProperty;
|
|
7456
|
+
* }
|
|
7457
|
+
*
|
|
7458
|
+
* // property (on prototype, TypeScript only)
|
|
7459
|
+
* class Example {
|
|
7460
|
+
* @Reflect.metadata(key, value)
|
|
7461
|
+
* property;
|
|
7462
|
+
* }
|
|
7463
|
+
*
|
|
7464
|
+
* // method (on constructor)
|
|
7465
|
+
* class Example {
|
|
7466
|
+
* @Reflect.metadata(key, value)
|
|
7467
|
+
* static staticMethod() { }
|
|
7468
|
+
* }
|
|
7469
|
+
*
|
|
7470
|
+
* // method (on prototype)
|
|
7471
|
+
* class Example {
|
|
7472
|
+
* @Reflect.metadata(key, value)
|
|
7473
|
+
* method() { }
|
|
7474
|
+
* }
|
|
7475
|
+
*
|
|
7476
|
+
*/
|
|
7477
|
+
function metadata(metadataKey: any, metadataValue: any): {
|
|
7478
|
+
(target: Function): void;
|
|
7479
|
+
(target: Object, propertyKey: string | symbol): void;
|
|
7480
|
+
};
|
|
7481
|
+
/**
|
|
7482
|
+
* Define a unique metadata entry on the target.
|
|
7483
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7484
|
+
* @param metadataValue A value that contains attached metadata.
|
|
7485
|
+
* @param target The target object on which to define metadata.
|
|
7486
|
+
* @example
|
|
7487
|
+
*
|
|
7488
|
+
* class Example {
|
|
7489
|
+
* }
|
|
7490
|
+
*
|
|
7491
|
+
* // constructor
|
|
7492
|
+
* Reflect.defineMetadata("custom:annotation", options, Example);
|
|
7493
|
+
*
|
|
7494
|
+
* // decorator factory as metadata-producing annotation.
|
|
7495
|
+
* function MyAnnotation(options): ClassDecorator {
|
|
7496
|
+
* return target => Reflect.defineMetadata("custom:annotation", options, target);
|
|
7497
|
+
* }
|
|
7498
|
+
*
|
|
7499
|
+
*/
|
|
7500
|
+
function defineMetadata(metadataKey: any, metadataValue: any, target: Object): void;
|
|
7501
|
+
/**
|
|
7502
|
+
* Define a unique metadata entry on the target.
|
|
7503
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7504
|
+
* @param metadataValue A value that contains attached metadata.
|
|
7505
|
+
* @param target The target object on which to define metadata.
|
|
7506
|
+
* @param propertyKey The property key for the target.
|
|
7507
|
+
* @example
|
|
7508
|
+
*
|
|
7509
|
+
* class Example {
|
|
7510
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7511
|
+
* // static staticProperty;
|
|
7512
|
+
* // property;
|
|
7513
|
+
*
|
|
7514
|
+
* static staticMethod(p) { }
|
|
7515
|
+
* method(p) { }
|
|
7516
|
+
* }
|
|
7517
|
+
*
|
|
7518
|
+
* // property (on constructor)
|
|
7519
|
+
* Reflect.defineMetadata("custom:annotation", Number, Example, "staticProperty");
|
|
7520
|
+
*
|
|
7521
|
+
* // property (on prototype)
|
|
7522
|
+
* Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "property");
|
|
7523
|
+
*
|
|
7524
|
+
* // method (on constructor)
|
|
7525
|
+
* Reflect.defineMetadata("custom:annotation", Number, Example, "staticMethod");
|
|
7526
|
+
*
|
|
7527
|
+
* // method (on prototype)
|
|
7528
|
+
* Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "method");
|
|
7529
|
+
*
|
|
7530
|
+
* // decorator factory as metadata-producing annotation.
|
|
7531
|
+
* function MyAnnotation(options): PropertyDecorator {
|
|
7532
|
+
* return (target, key) => Reflect.defineMetadata("custom:annotation", options, target, key);
|
|
7533
|
+
* }
|
|
7534
|
+
*
|
|
7535
|
+
*/
|
|
7536
|
+
function defineMetadata(metadataKey: any, metadataValue: any, target: Object, propertyKey: string | symbol): void;
|
|
7537
|
+
/**
|
|
7538
|
+
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
|
|
7539
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7540
|
+
* @param target The target object on which the metadata is defined.
|
|
7541
|
+
* @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
|
|
7542
|
+
* @example
|
|
7543
|
+
*
|
|
7544
|
+
* class Example {
|
|
7545
|
+
* }
|
|
7546
|
+
*
|
|
7547
|
+
* // constructor
|
|
7548
|
+
* result = Reflect.hasMetadata("custom:annotation", Example);
|
|
7549
|
+
*
|
|
7550
|
+
*/
|
|
7551
|
+
function hasMetadata(metadataKey: any, target: Object): boolean;
|
|
7552
|
+
/**
|
|
7553
|
+
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
|
|
7554
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7555
|
+
* @param target The target object on which the metadata is defined.
|
|
7556
|
+
* @param propertyKey The property key for the target.
|
|
7557
|
+
* @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
|
|
7558
|
+
* @example
|
|
7559
|
+
*
|
|
7560
|
+
* class Example {
|
|
7561
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7562
|
+
* // static staticProperty;
|
|
7563
|
+
* // property;
|
|
7564
|
+
*
|
|
7565
|
+
* static staticMethod(p) { }
|
|
7566
|
+
* method(p) { }
|
|
7567
|
+
* }
|
|
7568
|
+
*
|
|
7569
|
+
* // property (on constructor)
|
|
7570
|
+
* result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty");
|
|
7571
|
+
*
|
|
7572
|
+
* // property (on prototype)
|
|
7573
|
+
* result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property");
|
|
7574
|
+
*
|
|
7575
|
+
* // method (on constructor)
|
|
7576
|
+
* result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod");
|
|
7577
|
+
*
|
|
7578
|
+
* // method (on prototype)
|
|
7579
|
+
* result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method");
|
|
7580
|
+
*
|
|
7581
|
+
*/
|
|
7582
|
+
function hasMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
|
|
7583
|
+
/**
|
|
7584
|
+
* Gets a value indicating whether the target object has the provided metadata key defined.
|
|
7585
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7586
|
+
* @param target The target object on which the metadata is defined.
|
|
7587
|
+
* @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
|
|
7588
|
+
* @example
|
|
7589
|
+
*
|
|
7590
|
+
* class Example {
|
|
7591
|
+
* }
|
|
7592
|
+
*
|
|
7593
|
+
* // constructor
|
|
7594
|
+
* result = Reflect.hasOwnMetadata("custom:annotation", Example);
|
|
7595
|
+
*
|
|
7596
|
+
*/
|
|
7597
|
+
function hasOwnMetadata(metadataKey: any, target: Object): boolean;
|
|
7598
|
+
/**
|
|
7599
|
+
* Gets a value indicating whether the target object has the provided metadata key defined.
|
|
7600
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7601
|
+
* @param target The target object on which the metadata is defined.
|
|
7602
|
+
* @param propertyKey The property key for the target.
|
|
7603
|
+
* @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
|
|
7604
|
+
* @example
|
|
7605
|
+
*
|
|
7606
|
+
* class Example {
|
|
7607
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7608
|
+
* // static staticProperty;
|
|
7609
|
+
* // property;
|
|
7610
|
+
*
|
|
7611
|
+
* static staticMethod(p) { }
|
|
7612
|
+
* method(p) { }
|
|
7613
|
+
* }
|
|
7614
|
+
*
|
|
7615
|
+
* // property (on constructor)
|
|
7616
|
+
* result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty");
|
|
7617
|
+
*
|
|
7618
|
+
* // property (on prototype)
|
|
7619
|
+
* result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property");
|
|
7620
|
+
*
|
|
7621
|
+
* // method (on constructor)
|
|
7622
|
+
* result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod");
|
|
7623
|
+
*
|
|
7624
|
+
* // method (on prototype)
|
|
7625
|
+
* result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method");
|
|
7626
|
+
*
|
|
7627
|
+
*/
|
|
7628
|
+
function hasOwnMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
|
|
7629
|
+
/**
|
|
7630
|
+
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
|
|
7631
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7632
|
+
* @param target The target object on which the metadata is defined.
|
|
7633
|
+
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
7634
|
+
* @example
|
|
7635
|
+
*
|
|
7636
|
+
* class Example {
|
|
7637
|
+
* }
|
|
7638
|
+
*
|
|
7639
|
+
* // constructor
|
|
7640
|
+
* result = Reflect.getMetadata("custom:annotation", Example);
|
|
7641
|
+
*
|
|
7642
|
+
*/
|
|
7643
|
+
function getMetadata(metadataKey: any, target: Object): any;
|
|
7644
|
+
/**
|
|
7645
|
+
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
|
|
7646
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7647
|
+
* @param target The target object on which the metadata is defined.
|
|
7648
|
+
* @param propertyKey The property key for the target.
|
|
7649
|
+
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
7650
|
+
* @example
|
|
7651
|
+
*
|
|
7652
|
+
* class Example {
|
|
7653
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7654
|
+
* // static staticProperty;
|
|
7655
|
+
* // property;
|
|
7656
|
+
*
|
|
7657
|
+
* static staticMethod(p) { }
|
|
7658
|
+
* method(p) { }
|
|
7659
|
+
* }
|
|
7660
|
+
*
|
|
7661
|
+
* // property (on constructor)
|
|
7662
|
+
* result = Reflect.getMetadata("custom:annotation", Example, "staticProperty");
|
|
7663
|
+
*
|
|
7664
|
+
* // property (on prototype)
|
|
7665
|
+
* result = Reflect.getMetadata("custom:annotation", Example.prototype, "property");
|
|
7666
|
+
*
|
|
7667
|
+
* // method (on constructor)
|
|
7668
|
+
* result = Reflect.getMetadata("custom:annotation", Example, "staticMethod");
|
|
7669
|
+
*
|
|
7670
|
+
* // method (on prototype)
|
|
7671
|
+
* result = Reflect.getMetadata("custom:annotation", Example.prototype, "method");
|
|
7672
|
+
*
|
|
7673
|
+
*/
|
|
7674
|
+
function getMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): any;
|
|
7675
|
+
/**
|
|
7676
|
+
* Gets the metadata value for the provided metadata key on the target object.
|
|
7677
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7678
|
+
* @param target The target object on which the metadata is defined.
|
|
7679
|
+
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
7680
|
+
* @example
|
|
7681
|
+
*
|
|
7682
|
+
* class Example {
|
|
7683
|
+
* }
|
|
7684
|
+
*
|
|
7685
|
+
* // constructor
|
|
7686
|
+
* result = Reflect.getOwnMetadata("custom:annotation", Example);
|
|
7687
|
+
*
|
|
7688
|
+
*/
|
|
7689
|
+
function getOwnMetadata(metadataKey: any, target: Object): any;
|
|
7690
|
+
/**
|
|
7691
|
+
* Gets the metadata value for the provided metadata key on the target object.
|
|
7692
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7693
|
+
* @param target The target object on which the metadata is defined.
|
|
7694
|
+
* @param propertyKey The property key for the target.
|
|
7695
|
+
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
|
7696
|
+
* @example
|
|
7697
|
+
*
|
|
7698
|
+
* class Example {
|
|
7699
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7700
|
+
* // static staticProperty;
|
|
7701
|
+
* // property;
|
|
7702
|
+
*
|
|
7703
|
+
* static staticMethod(p) { }
|
|
7704
|
+
* method(p) { }
|
|
7705
|
+
* }
|
|
7706
|
+
*
|
|
7707
|
+
* // property (on constructor)
|
|
7708
|
+
* result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty");
|
|
7709
|
+
*
|
|
7710
|
+
* // property (on prototype)
|
|
7711
|
+
* result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property");
|
|
7712
|
+
*
|
|
7713
|
+
* // method (on constructor)
|
|
7714
|
+
* result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod");
|
|
7715
|
+
*
|
|
7716
|
+
* // method (on prototype)
|
|
7717
|
+
* result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method");
|
|
7718
|
+
*
|
|
7719
|
+
*/
|
|
7720
|
+
function getOwnMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): any;
|
|
7721
|
+
/**
|
|
7722
|
+
* Gets the metadata keys defined on the target object or its prototype chain.
|
|
7723
|
+
* @param target The target object on which the metadata is defined.
|
|
7724
|
+
* @returns An array of unique metadata keys.
|
|
7725
|
+
* @example
|
|
7726
|
+
*
|
|
7727
|
+
* class Example {
|
|
7728
|
+
* }
|
|
7729
|
+
*
|
|
7730
|
+
* // constructor
|
|
7731
|
+
* result = Reflect.getMetadataKeys(Example);
|
|
7732
|
+
*
|
|
7733
|
+
*/
|
|
7734
|
+
function getMetadataKeys(target: Object): any[];
|
|
7735
|
+
/**
|
|
7736
|
+
* Gets the metadata keys defined on the target object or its prototype chain.
|
|
7737
|
+
* @param target The target object on which the metadata is defined.
|
|
7738
|
+
* @param propertyKey The property key for the target.
|
|
7739
|
+
* @returns An array of unique metadata keys.
|
|
7740
|
+
* @example
|
|
7741
|
+
*
|
|
7742
|
+
* class Example {
|
|
7743
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7744
|
+
* // static staticProperty;
|
|
7745
|
+
* // property;
|
|
7746
|
+
*
|
|
7747
|
+
* static staticMethod(p) { }
|
|
7748
|
+
* method(p) { }
|
|
7749
|
+
* }
|
|
7750
|
+
*
|
|
7751
|
+
* // property (on constructor)
|
|
7752
|
+
* result = Reflect.getMetadataKeys(Example, "staticProperty");
|
|
7753
|
+
*
|
|
7754
|
+
* // property (on prototype)
|
|
7755
|
+
* result = Reflect.getMetadataKeys(Example.prototype, "property");
|
|
7756
|
+
*
|
|
7757
|
+
* // method (on constructor)
|
|
7758
|
+
* result = Reflect.getMetadataKeys(Example, "staticMethod");
|
|
7759
|
+
*
|
|
7760
|
+
* // method (on prototype)
|
|
7761
|
+
* result = Reflect.getMetadataKeys(Example.prototype, "method");
|
|
7762
|
+
*
|
|
7763
|
+
*/
|
|
7764
|
+
function getMetadataKeys(target: Object, propertyKey: string | symbol): any[];
|
|
7765
|
+
/**
|
|
7766
|
+
* Gets the unique metadata keys defined on the target object.
|
|
7767
|
+
* @param target The target object on which the metadata is defined.
|
|
7768
|
+
* @returns An array of unique metadata keys.
|
|
7769
|
+
* @example
|
|
7770
|
+
*
|
|
7771
|
+
* class Example {
|
|
7772
|
+
* }
|
|
7773
|
+
*
|
|
7774
|
+
* // constructor
|
|
7775
|
+
* result = Reflect.getOwnMetadataKeys(Example);
|
|
7776
|
+
*
|
|
7777
|
+
*/
|
|
7778
|
+
function getOwnMetadataKeys(target: Object): any[];
|
|
7779
|
+
/**
|
|
7780
|
+
* Gets the unique metadata keys defined on the target object.
|
|
7781
|
+
* @param target The target object on which the metadata is defined.
|
|
7782
|
+
* @param propertyKey The property key for the target.
|
|
7783
|
+
* @returns An array of unique metadata keys.
|
|
7784
|
+
* @example
|
|
7785
|
+
*
|
|
7786
|
+
* class Example {
|
|
7787
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7788
|
+
* // static staticProperty;
|
|
7789
|
+
* // property;
|
|
7790
|
+
*
|
|
7791
|
+
* static staticMethod(p) { }
|
|
7792
|
+
* method(p) { }
|
|
7793
|
+
* }
|
|
7794
|
+
*
|
|
7795
|
+
* // property (on constructor)
|
|
7796
|
+
* result = Reflect.getOwnMetadataKeys(Example, "staticProperty");
|
|
7797
|
+
*
|
|
7798
|
+
* // property (on prototype)
|
|
7799
|
+
* result = Reflect.getOwnMetadataKeys(Example.prototype, "property");
|
|
7800
|
+
*
|
|
7801
|
+
* // method (on constructor)
|
|
7802
|
+
* result = Reflect.getOwnMetadataKeys(Example, "staticMethod");
|
|
7803
|
+
*
|
|
7804
|
+
* // method (on prototype)
|
|
7805
|
+
* result = Reflect.getOwnMetadataKeys(Example.prototype, "method");
|
|
7806
|
+
*
|
|
7807
|
+
*/
|
|
7808
|
+
function getOwnMetadataKeys(target: Object, propertyKey: string | symbol): any[];
|
|
7809
|
+
/**
|
|
7810
|
+
* Deletes the metadata entry from the target object with the provided key.
|
|
7811
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7812
|
+
* @param target The target object on which the metadata is defined.
|
|
7813
|
+
* @returns `true` if the metadata entry was found and deleted; otherwise, false.
|
|
7814
|
+
* @example
|
|
7815
|
+
*
|
|
7816
|
+
* class Example {
|
|
7817
|
+
* }
|
|
7818
|
+
*
|
|
7819
|
+
* // constructor
|
|
7820
|
+
* result = Reflect.deleteMetadata("custom:annotation", Example);
|
|
7821
|
+
*
|
|
7822
|
+
*/
|
|
7823
|
+
function deleteMetadata(metadataKey: any, target: Object): boolean;
|
|
7824
|
+
/**
|
|
7825
|
+
* Deletes the metadata entry from the target object with the provided key.
|
|
7826
|
+
* @param metadataKey A key used to store and retrieve metadata.
|
|
7827
|
+
* @param target The target object on which the metadata is defined.
|
|
7828
|
+
* @param propertyKey The property key for the target.
|
|
7829
|
+
* @returns `true` if the metadata entry was found and deleted; otherwise, false.
|
|
7830
|
+
* @example
|
|
7831
|
+
*
|
|
7832
|
+
* class Example {
|
|
7833
|
+
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
|
7834
|
+
* // static staticProperty;
|
|
7835
|
+
* // property;
|
|
7836
|
+
*
|
|
7837
|
+
* static staticMethod(p) { }
|
|
7838
|
+
* method(p) { }
|
|
7839
|
+
* }
|
|
7840
|
+
*
|
|
7841
|
+
* // property (on constructor)
|
|
7842
|
+
* result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty");
|
|
7843
|
+
*
|
|
7844
|
+
* // property (on prototype)
|
|
7845
|
+
* result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property");
|
|
7846
|
+
*
|
|
7847
|
+
* // method (on constructor)
|
|
7848
|
+
* result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod");
|
|
7849
|
+
*
|
|
7850
|
+
* // method (on prototype)
|
|
7851
|
+
* result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method");
|
|
7852
|
+
*
|
|
7853
|
+
*/
|
|
7854
|
+
function deleteMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean;
|
|
7855
|
+
}
|
|
7856
|
+
}
|
|
7857
|
+
|
|
7858
|
+
type PropertyType = 'number' | 'integer' | 'string' | 'boolean' | 'color' | 'vector2' | 'vector3' | 'enum' | 'asset' | 'animationClips';
|
|
7859
|
+
/**
|
|
7860
|
+
* Action button configuration for property fields
|
|
7861
|
+
* 属性字段的操作按钮配置
|
|
7862
|
+
*/
|
|
7863
|
+
interface PropertyAction {
|
|
7864
|
+
/** Action identifier | 操作标识符 */
|
|
7865
|
+
id: string;
|
|
7866
|
+
/** Button label | 按钮标签 */
|
|
7867
|
+
label: string;
|
|
7868
|
+
/** Button tooltip | 按钮提示 */
|
|
7869
|
+
tooltip?: string;
|
|
7870
|
+
/** Icon name from Lucide | Lucide图标名称 */
|
|
7871
|
+
icon?: string;
|
|
7872
|
+
}
|
|
7873
|
+
/**
|
|
7874
|
+
* 控制关系声明
|
|
7875
|
+
* Control relationship declaration
|
|
7876
|
+
*/
|
|
7877
|
+
interface PropertyControl {
|
|
7878
|
+
/** 被控制的组件名称 | Target component name */
|
|
7879
|
+
component: string;
|
|
7880
|
+
/** 被控制的属性名称 | Target property name */
|
|
7881
|
+
property: string;
|
|
7882
|
+
}
|
|
7883
|
+
interface PropertyOptions {
|
|
7884
|
+
/** 属性类型 */
|
|
7885
|
+
type: PropertyType;
|
|
7886
|
+
/** 显示标签 */
|
|
7887
|
+
label?: string;
|
|
7888
|
+
/** 最小值 (number/integer) */
|
|
7889
|
+
min?: number;
|
|
7890
|
+
/** 最大值 (number/integer) */
|
|
7891
|
+
max?: number;
|
|
7892
|
+
/** 步进值 (number/integer) */
|
|
7893
|
+
step?: number;
|
|
7894
|
+
/** 枚举选项 (enum) */
|
|
7895
|
+
options?: Array<{
|
|
7896
|
+
label: string;
|
|
7897
|
+
value: any;
|
|
7898
|
+
}>;
|
|
7899
|
+
/** 是否只读 */
|
|
7900
|
+
readOnly?: boolean;
|
|
7901
|
+
/** 资源文件扩展名 (asset) */
|
|
7902
|
+
fileExtension?: string;
|
|
7903
|
+
/** Action buttons for this property | 属性的操作按钮 */
|
|
7904
|
+
actions?: PropertyAction[];
|
|
7905
|
+
/** 此属性控制的其他组件属性 | Properties this field controls */
|
|
7906
|
+
controls?: PropertyControl[];
|
|
7907
|
+
}
|
|
7908
|
+
declare const PROPERTY_METADATA: unique symbol;
|
|
7909
|
+
/**
|
|
7910
|
+
* 属性装饰器 - 声明组件属性的编辑器元数据
|
|
7911
|
+
*
|
|
7912
|
+
* @example
|
|
7913
|
+
* ```typescript
|
|
7914
|
+
* @ECSComponent('Transform')
|
|
7915
|
+
* export class TransformComponent extends Component {
|
|
7916
|
+
* @Property({ type: 'vector3', label: 'Position' })
|
|
7917
|
+
* public position: Vector3 = { x: 0, y: 0, z: 0 };
|
|
7918
|
+
*
|
|
7919
|
+
* @Property({ type: 'number', label: 'Speed', min: 0, max: 100 })
|
|
7920
|
+
* public speed: number = 10;
|
|
7921
|
+
* }
|
|
7922
|
+
* ```
|
|
7923
|
+
*/
|
|
7924
|
+
declare function Property(options: PropertyOptions): PropertyDecorator;
|
|
7925
|
+
/**
|
|
7926
|
+
* 获取组件类的所有属性元数据
|
|
7927
|
+
*/
|
|
7928
|
+
declare function getPropertyMetadata(target: Function): Record<string, PropertyOptions> | undefined;
|
|
7929
|
+
/**
|
|
7930
|
+
* 检查组件类是否有属性元数据
|
|
7931
|
+
*/
|
|
7932
|
+
declare function hasPropertyMetadata(target: Function): boolean;
|
|
7933
|
+
|
|
7341
7934
|
/**
|
|
7342
7935
|
* 实体构建器 - 提供流式API创建和配置实体
|
|
7343
7936
|
*/
|
|
@@ -11265,5 +11858,5 @@ declare function getFullPlatformConfig(): Promise<any>;
|
|
|
11265
11858
|
declare function supportsFeature(feature: 'worker' | 'shared-array-buffer' | 'transferable-objects' | 'module-worker'): boolean;
|
|
11266
11859
|
declare function hasAdapter(): boolean;
|
|
11267
11860
|
|
|
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 };
|
|
11861
|
+
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 };
|
|
11862
|
+
export type { AnyComponentConstructor, BitMask64Data, ComponentChange, ComponentConstructor, ComponentDebugInfo, ComponentInstance, ComponentMigrationFunction, ComponentOptions, 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, PropertyControl, PropertyOptions, PropertyType, 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 };
|