import { XY } from "./interfaces"; export declare let snapToGrid: (nr: number) => number; export declare let toSVGCoordinates: (svgElement: SVGSVGElement, x: number, y: number, transformX: number, transformY: number, scale: number) => XY; export interface Memoization { /** * Manually invalidates the cached outcome. */ invalidate(): void; /** * If the inputs array matches the inputs array from the previous invocation, this method returns the result of the previous invocation. * Otherwise, the calculation function is invoked and its result is cached and returned. * Objects in the inputs array are compared using ===. * @param inputs - Array of objects that are to be compared using === with the inputs from the previous invocation. * These objects are assumed to be immutable values. * @param calculation - Function that takes zero arguments and returns an object that can be cached. */ result(inputs: unknown[], calculation: () => Result): Result; previousResult(): Result | undefined; } export declare function createMemoization(): Memoization;