/** * World.ts * * The central ECS World — the container for all entities, components, and systems. * Provides entity creation, component attachment, and query APIs. */ export type Entity = number; export type ComponentType = string; import { UndoManager } from '../state/UndoManager'; export type WorldOp = { type: 'create'; entity: Entity; } | { type: 'destroy'; entity: Entity; components: Map; tags: Set; } | { type: 'addComponent'; entity: Entity; componentType: ComponentType; data: any; } | { type: 'removeComponent'; entity: Entity; componentType: ComponentType; data: any; } | { type: 'updateComponent'; entity: Entity; componentType: ComponentType; key: string | symbol; value: any; oldValue: any; } | { type: 'addTag'; entity: Entity; tag: string; } | { type: 'removeTag'; entity: Entity; tag: string; } | { type: 'restore'; entity: Entity; components: Map; tags: Set; }; export declare class World { private nextEntity; private entities; private components; private tags; undoManager: UndoManager; private isUndoing; /** * Create a new entity. */ createEntity(): Entity; /** * Destroy an entity and all its components. */ destroyEntity(entity: Entity): void; /** * Check if an entity exists. */ hasEntity(entity: Entity): boolean; /** * Get entity count. */ get entityCount(): number; /** * Add a component to an entity. * The component data will be wrapped in a reactive proxy. */ addComponent(entity: Entity, type: ComponentType, data: T): void; private attachLegacyVectorAliases; /** * Remove a component from an entity. */ removeComponent(entity: Entity, type: ComponentType): void; /** * Get a component from an entity. */ getComponent(entity: Entity, type: ComponentType): T | undefined; /** * Check if an entity has a component. */ hasComponent(entity: Entity, type: ComponentType): boolean; /** * Get all component types for an entity. */ getComponentTypes(entity: Entity): ComponentType[]; /** * Add a tag to an entity. */ addTag(entity: Entity, tag: string): void; /** * Check if an entity has a tag. */ hasTag(entity: Entity, tag: string): boolean; /** * Query all entities that have ALL of the specified component types. */ query(...componentTypes: ComponentType[]): Entity[]; /** * Query entities by tag. */ queryByTag(tag: string): Entity[]; /** * Get all entities. */ getAllEntities(): Entity[]; /** * Undo the last operation. */ undo(): void; /** * Redo the last undone operation. */ redo(): void; private applyOp; } //# sourceMappingURL=World.d.ts.map