@codehz/ecs 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/world.d.ts +8 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codehz/ecs",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/world.d.ts CHANGED
@@ -70,11 +70,16 @@ export declare class World<ExtraParams extends any[] = [deltaTime: number]> {
70
70
  */
71
71
  hasComponent<T>(entityId: EntityId, componentType: EntityId<T>): boolean;
72
72
  /**
73
- * Get wildcard relations from an entity
73
+ * Get component data for a specific entity and wildcard relation type
74
+ * Returns an array of all matching relation instances
75
+ * @param entityId The entity
76
+ * @param componentType The wildcard relation type
74
77
  */
75
- getComponent<T>(entityId: EntityId, componentType: WildcardRelationId<T>): [EntityId<unknown>, any][];
78
+ getComponent<T>(entityId: EntityId, componentType: WildcardRelationId<T>): [EntityId<unknown>, T][];
76
79
  /**
77
- * Get a component from an entity
80
+ * Get component data for a specific entity and component type
81
+ * @param entityId The entity
82
+ * @param componentType The component type
78
83
  */
79
84
  getComponent<T>(entityId: EntityId, componentType: EntityId<T>): T;
80
85
  /**