import { MaybeRefOrGetter, Ref } from 'vue'; import { BehaviorClass, DeepReadonly, GameEntityType, OpsFor, OpsOf, StateFor, StateSliceOf } from '@skewedaspect/sage'; /** What a UI observes an entity through (design/ui.md#gameentityview). */ export interface GameEntityView { readonly id: string | null; readonly present: boolean; readonly state: DeepReadonly>; readonly ops: OpsFor; hasBehavior(behaviorClass: Class): this is ViewNarrowedTo; } /** A view typed to one behavior's slice of state and operations (design/ui.md#gameentityview). */ export type ViewNarrowedTo = GameEntityView & { readonly state: DeepReadonly>; readonly ops: OpsOf; }; /** * Answers with a `Ref` holding a view of one entity, resolved by class and ID against the simulation the * engine currently holds. The view observes as it is created and refreshes once per rendered frame, pause * included (design/ui.md#when-a-view-observes). The `Ref` never changes what it holds, since the view is one * object for its life; what a refresh changes is inside the view (design/ui.md#gameentityview). * * @param entityClass - Types the view and checks it: another class leaves the view absent. * @param id - The entity ID, read on every refresh, so a `Ref` or a getter follows the entity it names at * that moment and a null ID leaves the view absent (design/ui.md#which-entity-a-view-holds). */ export declare function useSageEntity(entityClass: Type, id: MaybeRefOrGetter): Ref>;