declare module "fit-curve" { /** A point in space represented as an array of numbers, 2D by default, but can be any dimension. */ type Point = Arr; /** A vector represented as an array of numbers, 2D by default, but can be any dimension. */ type Vector = Arr; /** A Bezier curve represented by an array of points with elements [first-point, control-point-1, control-point-2, second-point] */ type Curve = [ Point, Point, Point, Point ]; /** * Fit one or more Bezier curves to a set of points. * * @param points - Array of digitized points, e.g. [[5,5],[5,50],[110,140],[210,160],[320,110]] * @param maxError - Tolerance, squared error between points and fitted curve * @returns Array of Bezier curves, where each element is [first-point, control-point-1, control-point-2, second-point] and points are [x, y] */ function fitCurve( points: Point[], maxError: number ): Curve[]; export default fitCurve; /** * Fit a Bezier curve to a (sub)set of digitized points. * Typically, your code should not call this function directly. Use {@link fitCurve} instead. * * @param points - Array of digitized points, e.g. [[5,5],[5,50],[110,140],[210,160],[320,110]] * @param leftTangent - Unit tangent vector at start point * @param rightTangent - Unit tangent vector at end point * @param maxError - Tolerance, squared error between points and fitted curve * @returns Array of Bezier curves, where each element is [first-point, control-point-1, control-point-2, second-point] and points are [x, y] */ export function fitCubic( points: Point[], leftTangent: Vector, rightTangent: Vector, maxError: number ): Curve[]; /** * Creates a vector of length 1 which shows the direction from B to A */ export function createTangent( pointA: Point, pointB: Point ): Vector; }