import type { IDeref, Maybe } from "@thi.ng/api";
import type { ReadonlyVec } from "@thi.ng/vectors";
import type { IDistance, INeighborhood, Neighbor } from "./api.js";
/**
 * A {@link INeighborhood} implementation for nearest neighbor queries around a
 * given target location, initial query radius and {@link IDistance} metric to
 * determine proximity.
 *
 * @typeParam D - spatial position for distance metric
 * @typeParam T - indexed value
 */
export declare class Nearest<D, T> implements INeighborhood<D, T>, IDeref<Maybe<Neighbor<T>>> {
    readonly dist: IDistance<D>;
    readonly target: D;
    readonly radius: number;
    protected _currR: number;
    value?: T;
    constructor(dist: IDistance<D>, target: D, radius?: number);
    reset(): this;
    /**
     * Returns current nearest neighbor result tuple (`[dist, val]`) or
     * undefined, if no such result exists (yet).
     */
    deref(): Neighbor<T> | undefined;
    includesDistance(d: number, eucledian?: boolean): boolean;
    includesPosition(pos: D): boolean;
    consider(pos: D, val: T): number;
}
/**
 * Defines a {@link Nearest} instance for arbitrary length vector positions, by
 * default, using an infinite region radius and {@link DIST_SQ} distance
 * metric.
 *
 * @param p -
 * @param r -
 * @param dist -
 */
export declare const nearest: <T>(p: ReadonlyVec, r?: number, dist?: import("./squared.js").Squared<ReadonlyVec>) => Nearest<ReadonlyVec, T>;
/**
 * Defines a {@link Nearest} instance for 2D vector positions, by default,
 * using an infinite region radius and {@link DIST_SQ2} distance metric.
 *
 * @param p -
 * @param r -
 * @param dist -
 */
export declare const nearest2: <T>(p: ReadonlyVec, r?: number, dist?: import("./squared.js").Squared<ReadonlyVec>) => Nearest<ReadonlyVec, T>;
/**
 * Defines a {@link Nearest} instance for 3D vector positions, by default,
 * using an infinite region radius and {@link DIST_SQ3} distance metric.
 *
 * @param p -
 * @param r -
 * @param dist -
 */
export declare const nearest3: <T>(p: ReadonlyVec, r?: number, dist?: import("./squared.js").Squared<ReadonlyVec>) => Nearest<ReadonlyVec, T>;
/**
 * Defines a {@link Nearest} instance for numeric positions and, by default,
 * using an infinite region radius and {@link DIST_SQ1} distance metric.
 *
 * @param p -
 * @param r -
 * @param dist -
 */
export declare const nearestN: <T>(p: number, r?: number, dist?: import("./squared.js").Squared<number>) => Nearest<number, T>;
//# sourceMappingURL=nearest.d.ts.map