export interface Pt { readonly x: number; readonly y: number; } /** One cubic bezier from the previous anchor: two controls and the end anchor. */ export interface Cubic { readonly c1: Pt; readonly c2: Pt; readonly end: Pt; } /** A subpath: a start anchor, a chain of cubics, and whether it closes. */ export interface Subpath { readonly start: Pt; readonly segments: Cubic[]; readonly closed: boolean; } /** * Parse a `d` string into subpaths of absolute cubic segments. Handles M, L, H, * V, C, S, Q, T, A, Z (and their relative forms). Elliptical arcs (A/a) are * converted to cubic beziers (<=90 degrees per segment). */ export declare function parsePath(d: string): Subpath[]; /** Reconcile two subpaths to the same segment count (subdivide the smaller). */ export declare function reconcile(a: Subpath, b: Subpath): [Subpath, Subpath]; /** * Pick the rotation and winding of `to` (a closed ring) that puts its anchors * closest to `from`'s - so the shape settles into place instead of spinning or * turning inside out. Both must already be reconciled to the same count. Open * subpaths have a fixed start/end, so they pass through unchanged. */ export declare function align(from: Subpath, to: Subpath): Subpath; /** Interpolate two reconciled subpaths (same segment count) at fraction f. */ export declare function lerpSubpath(a: Subpath, b: Subpath, f: number): Subpath; /** The centroid of a subpath's ring anchors - its rough position, for matching. */ export declare function subpathCentroid(sp: Subpath): Pt; /** The (unsigned) enclosed area of a subpath's ring anchors - its rough size, for matching. */ export declare function subpathArea(sp: Subpath): number; /** * A degenerate copy of `sp` with every anchor and control collapsed onto `pt` - * so a surplus subpath can shrink to a point (or grow from one) rather than * being padded with an unrelated shape. Keeps the segment count for reconciliation. */ export declare function collapseToPoint(sp: Subpath, pt: Pt): Subpath; /** * True if a subpath has collapsed to a single point (every anchor and control * within `eps` of the start) - a not-yet-grown or fully-shrunk piece, which * should emit nothing so it never paints a dot on a stroked path. */ export declare function isPointSubpath(sp: Subpath, eps?: number): boolean; /** Emit a subpath as a cubic `d` string. */ export declare function subpathToD(subpath: Subpath): string; //# sourceMappingURL=path-commands.d.ts.map