import { RoomcraftEventMap, RoomcraftOptions, RoomcraftStatus, SceneAssetDescription, SceneLayout } from "./SceneTypes.js"; import * as THREE from "three"; import { AI, ManipulationEvent, Script, SelectEvent, World } from "xrblocks"; //#region src/addons/roomcraft/Roomcraft.d.ts /** * Composes trusted assets, procedural designs, and environments using AI edits. * Add it to XR Blocks before initialization, then call `request` or load a * hand-authored layout with `applyLayout`. No AI call is made on initialization. */ export declare class Roomcraft extends Script { static dependencies: { ai: typeof AI; world: typeof World; camera: typeof THREE.Camera; timer: typeof THREE.Timer; }; private readonly assets; private readonly entities; private readonly ownerIds; private readonly planner?; private readonly repairInvalidPlans; private readonly history; private readonly future; private redoBase?; private ai?; private world?; private camera?; private timer?; private motionIsPaused; private motionSource?; private motionTime?; private environment?; private environmentContent?; private title; private currentStatus; private selection; private disposed; constructor(options?: RoomcraftOptions); init({ ai, world, camera, timer }: { ai: AI; world: World; camera: THREE.Camera; timer?: THREE.Timer; }): void; /** Detached metadata only; factories and model URLs never reach the planner. */ get catalog(): SceneAssetDescription[]; /** Whether any authored part has a motion definition, including when paused. */ get hasMotion(): boolean; /** Playback inspection state; not part of the saved layout or undo history. */ get motionPaused(): boolean; /** The installed absolute clock, exposed so a bridge can detach only its own. */ get motionTimeSource(): (() => number) | undefined; /** * Use absolute playback seconds instead of the SDK frame delta. The source * must return finite, non-negative seconds and is sampled once per frame or * content commit. Retuned speeds and periods use the whole absolute time, * rather than carrying the previous definition's cycle. * * Installing a clock aligns playback immediately unless locally paused. * Removing it retains the sampled cycles for subsequent delta playback. * * @param source - The shared playback clock, or undefined to use frame deltas. */ setMotionTimeSource(source: (() => number) | undefined): void; /** * Freeze the current local sample without changing authored motion. * Resuming an absolute clock immediately realigns to its current time. */ setMotionPaused(paused: boolean): void; update(): void; private readMotionTime; private seekMotions; /** A detached snapshot of the setting, live transforms, and authored recipes. */ get layout(): SceneLayout; get status(): RoomcraftStatus; get busy(): boolean; get canUndo(): boolean; /** Redo never overwrites changes made since the last history operation. */ get canRedo(): boolean; get selectedId(): string | null; /** The stable manipulation owner. Change its transform, not its hierarchy. */ getObject(id: string): THREE.Object3D | undefined; /** * Bounds of the authored objects in world space, including full motion envelopes. * Includes virtual ground, but not sky. An empty scene has an empty box. * * @param id - One object ID, or omit it to include the whole composition. */ getWorldBounds(id?: string): THREE.Box3; select(id: string | null): void; /** * Replace the scene explicitly, for curated examples or saved layouts. * Aborting rejects the import without changing the current scene. A factory * already loading may finish later; its unused content is then disposed. */ applyLayout(value: unknown, { signal }?: { signal?: AbortSignal; }): Promise; /** Apply explicit add/update/remove operations without invoking AI. */ applyPlan(value: unknown): Promise; /** Refine the current scene; selection and actual transforms are sent as context. */ request(prompt: string): Promise; private requestPlan; /** Undo the last successful scene edit, including explicit scene replacements. */ undo(): Promise; /** Reapply an undone scene edit without asking the planner again. */ redo(): Promise; /** * Place the whole composition on a detected horizontal surface that fits it. * Returns false without moving the scene if no suitable surface is available. * Virtual environments already own a ground plane and cannot use this placement. * This is session-local placement, not a persistent spatial anchor. */ placeOnSurface(): Promise; onObjectSelectStart(event: SelectEvent): void; onObjectManipulate(event: ManipulationEvent): void; dispose(): void; private commitLayout; private run; private setStatus; private assertAlive; private findOwner; } //#endregion