import { Vector2d } from "./vector2d"; /** * Function type for the observable vector update callback. * @param options - The update options. * @param options.newX - The new x value. * @param options.newY - The new y value. * @param options.currentX - The current x value. * @param options.currentY - The current y value. * @returns - The updated values or undefined. If the values are returned, they will become the new x and y values. */ export type ObservableVector2dUpdateFn = (options: { newX: number; newY: number; currentX: number; currentY: number; }) => { x?: number | undefined; y?: number | undefined; } | void; export interface ObservableVector2d extends Vector2d { /** * Returns a `Vector2d` copy of this `ObservableVector2d` object. * @returns - The new Vector2d. */ toVector2d(): Vector2d; /** * Sets the vector value without triggering the callback. * @param x - The x value of the vector. * @param y - The y value of the vector. * @returns - Reference to this object for method chaining. */ setMuted(x: number, y: number): ObservableVector2d; /** * Returns a clone copy of this vector. * @returns - The cloned vector. */ clone(): ObservableVector2d; /** * Negates the vector values. * @returns - The negated vector. */ negate(): ObservableVector2d; /** * Ceils the vector values. * @returns - The ceiled vector. */ ceil(): ObservableVector2d; /** * Floors the vector values. * @returns - The floored vector. */ floor(): ObservableVector2d; /** * Clamps the vector values within the specified value range. * @param low - The lower bound. * @param high - The upper bound. * @returns - The clamped vector. */ clamp(low: number, high: number): ObservableVector2d; } interface CreateObservableVector2dOptions { target: Vector2d; updateFn: ObservableVector2dUpdateFn; } /** * Creates an observable vector. * This function wraps a given `Vector2d` object with a proxy that intercepts changes to the `x` and `y` properties, * allowing for custom update logic via the provided `updateFn` callback. * @param options - The options for creating the observable vector. * @param options.target - The target vector to be made observable. * @param options.updateFn - The update function to be called whenever the vector's properties change. * @returns - The observable vector with additional methods for vector manipulation. */ export declare const createObservableVector2d: (options: CreateObservableVector2dOptions) => ObservableVector2d; export {}; //# sourceMappingURL=observableVector2d_old.d.ts.map