import type { EntityHandle, ComponentDef, Schema } from '@ecsia/schema'; import type { ObserverHandle } from '@ecsia/core'; import type { Object3D, Scene } from 'three'; import type { WorldLike } from './schema.js'; export interface ThreeBindings { /** Associate `object3d` with `handle`. If `scene` was provided, the object is added to it. Re-binding * a handle replaces (and detaches from the scene) the previous object. */ bind(handle: EntityHandle, object3d: Object3D): void; /** Drop the binding for `handle` (and remove its object from the scene if one was provided). No-op if * unbound. Returns the object that was bound, or undefined. */ unbind(handle: EntityHandle): Object3D | undefined; /** The Object3D bound to `handle`, or undefined. */ objectOf(handle: EntityHandle): Object3D | undefined; /** True if `handle` currently has a bound object. */ has(handle: EntityHandle): boolean; /** Number of live bindings. */ readonly size: number; /** Iterate the live (handle, object) pairs. */ entries(): IterableIterator<[EntityHandle, Object3D]>; /** * Auto-unbind when `anchor` is removed from an entity OR the entity despawns (onRemove fires on both, * ). Returns the observer handle so the caller can dispose it; registering twice for * the same anchor is idempotent (the second call returns the existing handle). The handler reads only * `e.handle` — a scalar safe to read under the lenient pooled-ref rules even for a dying entity. */ autoUnbindOn(anchor: ComponentDef): ObserverHandle; /** * Drop every binding whose entity is no longer alive (`world.isAlive(handle) === false`). The * belt-and-suspenders path for entities despawned without an `autoUnbindOn` anchor. O(size). The frame * driver / scheduler can call this once per frame; most apps prefer `autoUnbindOn` (O(despawns)). */ sweep(): number; /** Drop all bindings (detaching every object from the scene). */ clear(): void; } export declare function createThreeBindings(world: WorldLike, scene?: Scene): ThreeBindings; //# sourceMappingURL=bindings.d.ts.map