import { Color, Euler, Vector2, Vector3 } from "three"; //#region src/observable/index.d.ts /** Flat record returned by `snapshot()` for shallow-equal memoization. */ type Snapshot = Record; /** * Strategy that wires an observable value's mutation surface and * captures field snapshots for memoization. The public contract for * teaching the observable system about a custom value type — call * `attach` to make a value reactive, `snapshot` to memoize it. */ type ObservableStrategy = { readonly attach: (value: T, notify: () => void) => void; readonly snapshot: (value: T) => Snapshot; }; /** * Shallow-compare two snapshots. Used by the registry to bail out * of redundant action fires when an observed value's fields didn't * actually change. */ declare function shallowEqual(a: Snapshot, b: Snapshot): boolean; declare function attachColor(c: Color, notify: () => void): void; declare function snapshotColor(c: Color): Snapshot; declare function attachVector2(v: Vector2, notify: () => void): void; declare function snapshotVector2(v: Vector2): Snapshot; declare function attachVector3(v: Vector3, notify: () => void): void; declare function snapshotVector3(v: Vector3): Snapshot; declare function attachEuler(e: Euler, notify: () => void): void; declare function snapshotEuler(e: Euler): Snapshot; /** * Observable strategies for three.js value types. Call a strategy's * `attach(value, notify)` directly to make a value fire `notify` on * in-place mutation (R3F compat). * * - `observable.color` — Color (r, g, b) * - `observable.vector2` — Vector2 (x, y) * - `observable.vector3` — Vector3 (x, y, z) * - `observable.euler` — Euler (x, y, z, order) — hooks into three's * existing `_onChangeCallback` rather than installing accessors */ declare const observable: { readonly color: { attach: typeof attachColor; snapshot: typeof snapshotColor; }; readonly vector2: { attach: typeof attachVector2; snapshot: typeof snapshotVector2; }; readonly vector3: { attach: typeof attachVector3; snapshot: typeof snapshotVector3; }; readonly euler: { attach: typeof attachEuler; snapshot: typeof snapshotEuler; }; }; //#endregion export { ObservableStrategy, Snapshot, observable, shallowEqual }; //# sourceMappingURL=index.d.ts.map