import type { ComponentDef, EntityHandle, RelationDef, RelationId, Schema } from '@ecsia/schema'; /** The world verbs the deferred buffer replays at flush time (all serial / main-thread). */ export interface ObserverCommandApply { /** Place an already-minted (alive) handle into its target signature. The handle was reserved when * the observer called spawn (so the observer could configure it); placement is deferred to flush. */ placeReserved(handle: EntityHandle, defs: readonly ComponentDef[]): void; add(handle: EntityHandle, def: ComponentDef): void; remove(handle: EntityHandle, def: ComponentDef): void; despawn(handle: EntityHandle): void; isAlive(handle: EntityHandle): boolean; /** Write initializer values through the tracked accessor path (value-carrying spawnWith, Item 8). */ writePayload(handle: EntityHandle, def: ComponentDef, values: Record): void; /** Relation apply seams (undefined in a relation-free world). */ addPair?(subject: EntityHandle, relationId: RelationId, target: EntityHandle, payload: Record | undefined): void; removePair?(subject: EntityHandle, relationId: RelationId, target: EntityHandle): void; } export declare class ObserverCommandBuffer { #private; get deferring(): boolean; get isDraining(): boolean; get pendingCount(): number; beginDeferring(): void; endDeferring(): void; enterDrain(): boolean; exitDrain(): void; stageSpawnWith(handle: EntityHandle, defs: readonly ComponentDef[], values?: readonly (readonly [ComponentDef, Record])[]): void; stageBuildReserved(handle: EntityHandle, build: (handle: EntityHandle) => void): void; stageAdd(handle: EntityHandle, def: ComponentDef): void; stageRemove(handle: EntityHandle, def: ComponentDef): void; stageDespawn(handle: EntityHandle): void; stageAddPair(subject: EntityHandle, relation: RelationDef, relationId: RelationId, target: EntityHandle, payload: Record | undefined): void; stageRemovePair(subject: EntityHandle, relation: RelationDef, relationId: RelationId, target: EntityHandle): void; /** * Apply every staged op in FIFO order (deterministic — staging order is the observers' fire order, * which is itself deterministic merge order). Drop-if-dead is honored: a staged op whose subject is * no longer alive at flush time is skipped (the entity was despawned by an earlier staged op or the * intervening frame). Called at the start of the next drain — i.e. the next serial flush. */ flush(apply: ObserverCommandApply): void; } //# sourceMappingURL=observer-commands.d.ts.map