import { DIVESceneObject } from '../../../../../index.ts'; import { ActionDependencies, EntitySchema } from '../../../types/index.ts'; /** * Listens to what a scene object reports about itself and records it. * * ### Why this reports instead of commanding * * An object's own report travels engine -> state. The state is the destination, * not the source, so the report writes the schema and announces the change — * it does not run an action. Running `UPDATE_OBJECT` here, as this code used to, * meant sending a command back to the very object that had just moved: the * position went out through `updateEntity` -> `setPosition` -> `worldToLocal` * onto the node it came from, once per frame of a gizmo drag. * * Subscribers see no difference. `dispatch` is the same call `performAction` * makes at the end, with the same payload under the same name, so * `state.subscribe('UPDATE_OBJECT', …)` keeps receiving gizmo positions. * * The closure is the routing: the id comes from the entity that was just * created, so nothing has to search for it later, and the engine never learns * that any of this happens. * * @param node - The scene object to listen to. * @param entity - The entity it stands for. * @param deps - EntityRegistry to write, dispatch to announce. * @returns Drops every listener again. Belongs in the registry entry. * * @module */ export declare const watchEntity: (node: DIVESceneObject, entity: EntitySchema, { registry, dispatch }: Pick) => (() => void);