/** * SceneRunner.ts * * Walks parsed HoloScript+ AST and instantiates the runtime scene: * - Creates ECS entities from HSPlusNode tree * - Attaches components (transform, renderable, etc.) * - Binds traits from @directives via TraitBinder * - Wires event listeners via EventBus * - Applies theme styles * * This is THE bridge between the parser and the engine. */ import type { HSPlusNode } from '@holoscript/core'; import { World, type WorldEntity as Entity } from '../ecs'; import { TraitBinder } from './TraitBinder'; import { EventBus } from '@holoscript/core'; import { AssetPipeline } from './AssetPipeline'; export interface AssetManifestEntry { type: string; path: string; } export interface SceneRunnerConfig { world: World; traitBinder: TraitBinder; eventBus: EventBus; /** Optional asset pipeline for preloading scene assets. */ assetPipeline?: AssetPipeline; } export interface SpawnedEntity { entity: Entity; nodeId: string; nodeType: string; traitNames: string[]; childEntities: Entity[]; } export declare class SceneRunner { private world; private traitBinder; private eventBus; private spawnedEntities; private nodeToEntity; /** Optional asset pipeline — set via config.assetPipeline */ readonly assetPipeline?: AssetPipeline; constructor(config: SceneRunnerConfig); /** * Preload a list of typed assets via the AssetPipeline. * All assets load in parallel; rejects if any single load fails. * No-op if no AssetPipeline was provided in config. */ preloadAssets(manifest: AssetManifestEntry[]): Promise; /** * Convenience: preload assets then run the AST. * Emits 'scene:assets_loaded' on the EventBus after preloading. */ runWithAssets(root: HSPlusNode, manifest: AssetManifestEntry[]): Promise; /** * Run an entire AST — walks the tree and instantiates everything. */ run(root: HSPlusNode): Entity; /** * Instantiate a single AST node as an ECS entity, then recurse into children. */ instantiateNode(node: HSPlusNode, parentEntity?: Entity): Entity; /** * Get entity for a node ID. */ getEntity(nodeId: string): Entity | undefined; /** * Get spawned entity info. */ getSpawned(nodeId: string): SpawnedEntity | undefined; /** * Get all spawned entities. */ getAllSpawned(): SpawnedEntity[]; /** * Despawn all entities from this run. */ despawnAll(): void; /** * Get spawned entity count. */ get spawnedCount(): number; private extractVec3; } //# sourceMappingURL=SceneRunner.d.ts.map