import type { Node } from "@babylonjs/core/node.js"; import type { Scene } from "@babylonjs/core/scene.js"; import type { EntityRecord, SceneDocumentData } from "@skenora/contracts"; import type { ResourceResolver } from "@skenora/resources"; export interface RuntimeEntityProjectionContext { readonly scene: Scene; readonly document: Readonly; readonly resources: ResourceResolver; readonly signal?: AbortSignal; /** Existing RuntimeSession clock; optional for custom/static projection hosts. */ readonly subscribeClock?: (listener: (deltaMs: number) => void) => () => void; } /** * Owns every runtime resource created for one document entity. * * Projectors must release their resources in reverse dependency order from * dispose(). RuntimeSession deliberately treats the projection as opaque. */ export interface RuntimeEntityProjection { readonly node: Node; update(entity: Readonly): void; getCapability?(name: string): unknown; dispose(): void; } export type RuntimeEntityProjectionChange = "update" | "recreate"; export interface RuntimeEntityProjector { readonly id: string; readonly entityType: EntityRecord["type"]; classifyChange?(path: readonly (string | number)[]): RuntimeEntityProjectionChange; create(context: RuntimeEntityProjectionContext, entity: Readonly): RuntimeEntityProjection | Promise; } export interface RuntimeProjectedEntity { readonly entityId: string; readonly entityType: EntityRecord["type"]; readonly node: Node; } /** * Composition boundary between SceneDocument entities and renderer resources. * * The registry owns projected instances; individual projectors own renderer * details. This keeps RuntimeSession responsible for orchestration rather than * knowing how every entity type is built and disposed. */ export declare class EntityProjectionRegistry { #private; constructor(projectors?: readonly RuntimeEntityProjector[]); register(projector: RuntimeEntityProjector): void; supports(entityType: EntityRecord["type"]): boolean; classifyChange(entityType: EntityRecord["type"], path: readonly (string | number)[]): RuntimeEntityProjectionChange; create(context: RuntimeEntityProjectionContext, entity: Readonly): Promise; update(entity: Readonly): boolean; getNode(entityId: string): Node | null; getCapability(entityId: string, name: string): T | null; entries(entityType?: EntityRecord["type"]): readonly RuntimeProjectedEntity[]; dispose(entityId: string): boolean; clear(): void; } //# sourceMappingURL=entity-projection-registry.d.ts.map