import type { Vec2 } from "./geometry.js"; /** A polyline prepared for repeated distance/fraction sampling, with cumulative arc-length precomputed. */ export interface Polyline { readonly points: readonly Vec2[]; readonly cumulative: readonly number[]; readonly length: number; } /** The closest point on a polyline to a query point, with where it lands along the line. */ export interface PolylineHit { readonly point: Vec2; readonly distanceAlong: number; readonly segment: number; readonly lateral: number; } /** Prepare a polyline from ordered points, computing cumulative arc-length once for O(log n) sampling. * @internal */ export declare function polyline(points: readonly Vec2[]): Polyline; /** Point at an absolute arc-length distance along the line, clamped to the endpoints. * @internal */ export declare function pointAtDistance(line: Polyline, dist: number): Vec2; /** Point at a `[0, 1]` fraction of the line's total length. * @internal */ export declare function pointAtFraction(line: Polyline, fraction: number): Vec2; /** Unit tangent (direction of travel) at an absolute distance along the line. * @internal */ export declare function tangentAtDistance(line: Polyline, dist: number): Vec2; /** Closest point on the line to `query`, reporting arc-length position, segment index, and signed lateral offset. * @internal */ export declare function closestPoint(line: Polyline, query: Vec2): PolylineHit;