import { MaybeRefOrGetter } from 'vue'; import { BehaviorClass, GameEntity, GameEntityType } from '@skewedaspect/sage'; import { ObservedSimulation } from "../symbols.js"; type Bag = Record; /** The bag a view holds its state in: reactive for a template, and with no prototype the way its records are. */ export declare function createStateBag(): Bag; /** Assigns what differs, adds what appeared, removes what vanished, and leaves everything else alone. */ export declare function syncBag(target: Bag, source: Readonly): void; /** * Answers with the entity that ID names in the simulation the engine currently holds, when it is of the class * asked for. A subclass is of that class, and a null ID names no entity * (design/ui.md#which-entity-a-view-holds). */ export declare function resolveEntity(simulation: ObservedSimulation | null | undefined, entityClass: GameEntityType, id: string | null): GameEntity | undefined; /** * Answers with the entities carrying the tag, whatever their class, in the order the simulation holds them. * A behavior narrows that to the ones holding it (design/ui.md#gameentityview), and a null tag gathers * nothing (design/ui.md#which-entity-a-view-holds). */ export declare function resolveTagged(simulation: ObservedSimulation | null | undefined, tag: string | null, behaviorClass?: BehaviorClass): readonly GameEntity[]; /** * Builds the narrowing guard a view exposes. It resolves the entity on every call, so it answers from the * entity rather than from the view's copy of state, and a view whose entity has gone holds no behavior * (design/ui.md#gameentityview). */ export declare function buildHasBehavior(find: () => GameEntity | undefined): (behaviorClass: BehaviorClass) => boolean; /** * Builds the operations a view exposes. Every call resolves the entity again, so a view whose entity has gone * throws rather than reaching the one it used to hold (design/ui.md#absence). One name answers with one * function for the view's life, so a template handing an operation to a child hands it the same function on * every render (design/ui.md#gameentityview). */ export declare function buildOps(id: MaybeRefOrGetter, find: () => GameEntity | undefined): Record; export {};