import { Mesh } from "../form/Mesh";
import { PointCloud } from "../form/PointCloud";
import { Primitive, Ray } from "../primitive/Primitive";
import { NDArrayFloat32, NDArrayBool, NDArrayInt32 } from "../ndarray/NDArray";
/** A spatial form: either a Mesh or a PointCloud. */
export type Form = Mesh | PointCloud;
/** Result of closest-point query (single). */
export interface ClosestPointResult {
    /** Closest point on B to A. */
    point: NDArrayFloat32;
    /** Squared distance. */
    distance2: number;
}
/** Result of closest-point query (batch). */
export interface ClosestPointBatchResult {
    /** Closest points [N, 3]. */
    points: NDArrayFloat32;
    /** Squared distances [N]. */
    distances: NDArrayFloat32;
}
/** Result of closest-point-pair query (single). */
export interface ClosestPointPairResult {
    /** Closest point on A. */
    point0: NDArrayFloat32;
    /** Closest point on B. */
    point1: NDArrayFloat32;
    /** Squared distance. */
    distance2: number;
}
/** Result of closest-point-pair query (batch). */
export interface ClosestPointPairBatchResult {
    /** Closest points on A [N, 3]. */
    points0: NDArrayFloat32;
    /** Closest points on B [N, 3]. */
    points1: NDArrayFloat32;
    /** Squared distances [N]. */
    distances: NDArrayFloat32;
}
/** Result of neighbor search (form × prim). */
export interface NeighborResult {
    /** Index of the closest element in the form. */
    elementId: number;
    /** Closest point on the form. */
    point: NDArrayFloat32;
    /** Squared distance. */
    distance2: number;
}
/** Result of neighbor search (form × batch prim). */
export interface NeighborBatchResult {
    /** Element indices [N]. */
    elementIds: NDArrayInt32;
    /** Closest points on the form [N, 3]. */
    points: NDArrayFloat32;
    /** Squared distances [N]. */
    distances: NDArrayFloat32;
}
/** Result of neighbor search (form × form). */
export interface NeighborPairResult {
    /** Index of the closest element on form 0. */
    elementId0: number;
    /** Index of the closest element on form 1. */
    elementId1: number;
    /** Closest point on form 0. */
    point0: NDArrayFloat32;
    /** Closest point on form 1. */
    point1: NDArrayFloat32;
    /** Squared distance. */
    distance2: number;
}
/** Result of k-NN neighbor search (single query). */
export interface NeighborKnnResult {
    /** Element indices [count]. */
    elementIds: NDArrayInt32;
    /** Closest points on the form [count, 3]. */
    points: NDArrayFloat32;
    /** Squared distances [count]. */
    distances: NDArrayFloat32;
}
/** Result of k-NN neighbor search (batch query). */
export interface NeighborKnnBatchResult {
    /** Element indices [N, k] padded with -1. */
    elementIds: NDArrayInt32;
    /** Closest points on the form [N, k, 3]. */
    points: NDArrayFloat32;
    /** Squared distances [N, k]. */
    distances: NDArrayFloat32;
    /** Actual count per query [N]. */
    counts: NDArrayInt32;
}
/** Options for k-NN neighbor search. */
export interface KnnOptions {
    /** Number of nearest neighbors to find. */
    k: number;
    /** Maximum search radius (default: Infinity). */
    radius?: number;
}
/** Options for neighbor search. */
export interface NeighborSearchOptions {
    /** Maximum search radius (default: Infinity). */
    radius?: number;
}
/** Result of ray cast (single). */
export interface RayCastResult {
    /** Whether the ray hit the target. */
    hit: boolean;
    /** Parameter t along the ray at the hit point. */
    t: number;
    /** Element index (-1 for primitive targets). */
    elementId: number;
}
/** Result of ray cast against primitives (batch). */
export interface RayCastPrimBatchResult {
    /** Hit flags [N]. */
    hits: NDArrayBool;
    /** Ray parameters [N]. */
    ts: NDArrayFloat32;
}
/** Result of ray cast against a form (batch). */
export interface RayCastFormBatchResult {
    /** Hit flags [N]. */
    hits: NDArrayBool;
    /** Ray parameters [N]. */
    ts: NDArrayFloat32;
    /** Element indices [N]. */
    elementIds: NDArrayInt32;
}
/** Options for ray cast queries. */
export interface RayCastOptions {
    /** Minimum ray parameter. Scalar applies to all rays; NDArrayFloat32 [N] for per-ray bounds. Default: 0. */
    minT?: number | NDArrayFloat32;
    /** Maximum ray parameter. Scalar applies to all rays; NDArrayFloat32 [N] for per-ray bounds. Default: Infinity. */
    maxT?: number | NDArrayFloat32;
}
/** Squared distance between two primitives. */
export declare function distance2(a: Primitive, b: Primitive): number | NDArrayFloat32;
/** Squared distance from a form to a primitive. */
export declare function distance2(form: Form, prim: Primitive): number | NDArrayFloat32;
/** Squared distance between two forms. */
export declare function distance2(a: Form, b: Form): number;
/** Distance between two primitives (signed for plane-point). */
export declare function distance(a: Primitive, b: Primitive): number | NDArrayFloat32;
/** Distance from a form to a primitive. */
export declare function distance(form: Form, prim: Primitive): number | NDArrayFloat32;
/** Distance between two forms. */
export declare function distance(a: Form, b: Form): number;
/** Closest point on B to A (prim × prim). */
export declare function closestPoint(a: Primitive, b: Primitive): ClosestPointResult | ClosestPointBatchResult;
/** Closest pair of points between A and B (prim × prim). */
export declare function closestPointPair(a: Primitive, b: Primitive): ClosestPointPairResult | ClosestPointPairBatchResult;
/** Find the nearest element in a form to a primitive. */
export declare function neighborSearch(form: Form, query: Primitive, opts?: NeighborSearchOptions): NeighborResult | NeighborBatchResult;
/** Find the nearest pair of elements between two forms. */
export declare function neighborSearch(a: Form, b: Form, opts?: NeighborSearchOptions): NeighborPairResult;
/** Find the k nearest elements in a form to a primitive. */
export declare function neighborSearch(form: Form, query: Primitive, opts: KnnOptions): NeighborKnnResult | NeighborKnnBatchResult;
/** Test intersection between two primitives. */
export declare function intersects(a: Primitive, b: Primitive): boolean | NDArrayBool;
/** Test intersection between a form and a primitive. */
export declare function intersects(form: Form, prim: Primitive): boolean | NDArrayBool;
/** Test intersection between two forms. */
export declare function intersects(a: Form, b: Form): boolean;
/** Cast a ray against a primitive target. */
export declare function rayCast(ray: Ray, target: Primitive, opts?: RayCastOptions): RayCastResult | RayCastPrimBatchResult;
/** Cast a ray against a form. */
export declare function rayCast(ray: Ray, form: Form, opts?: RayCastOptions): RayCastResult | RayCastFormBatchResult;
//# sourceMappingURL=sync.d.ts.map