feat: add relationship support and observability

Introduces relationship management to the World, including
storage for forward and reverse relationships. Adds new observable
events and a `RelationshipUpdate` stream to track when relationships
are added or removed.
This commit is contained in:
2026-05-31 15:54:21 +08:00
parent ba4a688f57
commit 32f8f29912
4 changed files with 361 additions and 78 deletions
+15 -9
View File
@@ -1,10 +1,16 @@
// ── Public API ─────────────────────────────────────────
export { World } from './world';
export { defineComponent } from './component';
export type { ComponentDef } from './component';
export { query } from './query';
export { Query } from './query';
export type { Entity } from './entity';
export { makeEntity, entityIndex, entityGeneration } from './entity';
export { SparseSet } from './storage/sparse-set';
export type { WorldEvent, QueryUpdate } from './observable/events';
export { World } from "./world";
export { defineComponent } from "./component";
export type { ComponentDef } from "./component";
export { defineRelationship } from "./relationship";
export type { RelationshipDef } from "./relationship";
export { query } from "./query";
export { Query } from "./query";
export type { Entity } from "./entity";
export { makeEntity, entityIndex, entityGeneration } from "./entity";
export { SparseSet } from "./storage/sparse-set";
export type {
WorldEvent,
QueryUpdate,
RelationshipUpdate,
} from "./observable/events";