import { Rect } from 'geome'; import { CurveLocation, TimeCurveLocation } from './Location.js'; import { Vertex, VertexA, VertexC, VertexL } from './Path.js'; import { Segment } from './Segment.js'; /** * A single open or closed stroke represented as an array of vertices. All of the points are represented as tuple `[x: number, y: number]` and the commands are represented in absolute form. * @category Types */ export type Curve = { readonly vertices: V[]; readonly closed: boolean; }; /** @category Types */ export type CurveL = Curve; /** @category Types */ export type CurveC = Curve; /** @category Types */ export type CurveA = Curve; /** * A collection of functions to handle {@link Curve}. * @category Modules */ export declare namespace Curve { const length: (arg: Curve) => number; const bounds: (arg: Curve) => Rect; function segmentCount(curve: Curve): number; function segment(curve: Curve, index: number): Segment; const segments: (arg: Curve) => Segment[]; function neighborSegment(curve: Curve, segmentIndex: number, offset: number): Segment | null; function nextSegment(curve: Curve, segmentIndex: number): Segment | null; function prevSegment(curve: Curve, segmentIndex: number): Segment | null; function reverse(curve: Curve): Curve; function trim(curve: Curve, from: CurveLocation, to: CurveLocation): Curve; function close(curve: Curve, fuse?: boolean): Curve; interface ReduceOptions { /** * If true, the function will convert straight lines to `L` commands * @default true */ convertStraightLines?: boolean; } /** * Cleans up the curve by removing redundant vertices and segments */ function reduce(curve: Curve, { convertStraightLines }?: ReduceOptions): Curve; function isZero(curve: Curve): boolean; /** * Retrieves the segment location information from a signed curve loocation * @param curve The cuve to retrieve the segment location from * @param location The location on the curve * @returns The information of the segment location */ function toTime(curve: Curve, location: CurveLocation): Required & { segment: Segment; }; } //# sourceMappingURL=Curve.d.ts.map