import type { CubicPath2d } from '../path/cubic2d.ts'; import type { Pipeable } from '../utils.ts'; import type { Vector2 } from '../vector/vector2.ts'; import type { Basis2dTypeId } from './basis2d.internal.ts'; import type { Bezier2d } from './bezier2d.ts'; /** * A Basis Spline (uniform cubic B-spline) in 2D space. * * All fields are readonly and immutable, and all operations create new instances. * * The characteristic matrix that identifies this spline family lives in the * `characteristic` module as `Characteristic.cubicBasisSpline`. * * @since 1.0.0 */ export interface Basis2d extends Pipeable { readonly [Basis2dTypeId]: Basis2dTypeId; [Symbol.iterator](): Iterator; } /** * Checks if a value is a `Basis2d`. * * @param p - The value to check. * @returns `true` if the value is a `Basis2d`, `false` otherwise. * @since 1.0.0 */ export declare const isBasis2d: (p: unknown) => p is Basis2d; /** * Creates a new `Basis2d` instance. * * @param p0 - The first control point. * @param p1 - The second control point. * @param p2 - The third control point. * @param p3 - The fourth control point. * @returns A new `Basis2d` instance. * @since 1.0.0 */ export declare const make: (p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2) => Basis2d; /** * Creates a new `Basis2d` instance from an array of control points. * * @param points - The control points. * @returns A new `Basis2d` instance. * @since 1.0.0 */ export declare const fromArray: (points: ReadonlyArray) => Basis2d; /** * Creates a new `Basis2d` from an array of `[x, y]` tuples. * * @param tuples - The control points as `[x, y]` tuples. * @returns A new `Basis2d` instance. * @since 2.0.0 */ export declare const fromTuples: (tuples: ReadonlyArray) => Basis2d; export declare const append: { /** * Appends control points to a `Basis2d`. * * @param points - The control points to append. * @returns A function that takes a `Basis2d` and returns a new `Basis2d` instance with the appended control points. * @since 1.0.0 */ (...points: ReadonlyArray): (p: Basis2d) => Basis2d; /** * Appends control points to a `Basis2d`. * * @param p - The `Basis2d` to append the control points to. * @param points - The control points to append. * @returns A new `Basis2d` instance with the appended control points. * @since 1.0.0 */ (p: Basis2d, ...points: ReadonlyArray): Basis2d; }; export declare const prepend: { /** * Prepends control points to a `Basis2d`. * * @param points - The control points to prepend. * @returns A function that takes a `Basis2d` and returns a new `Basis2d` instance with the prepended control points. * @since 1.0.0 */ (...points: ReadonlyArray): (p: Basis2d) => Basis2d; /** * Prepends control points to a `Basis2d`. * * @param p - The `Basis2d` to prepend the control points to. * @param points - The control points to prepend. * @returns A new `Basis2d` instance with the prepended control points. * @since 1.0.0 */ (p: Basis2d, ...points: ReadonlyArray): Basis2d; }; /** * Triplicates the endpoints of a `Basis2d`. * * This is useful for creating a closed loop spline. * * @param p - The `Basis2d` to triplicate the endpoints of. * @returns A new `Basis2d` instance with the triplicated endpoints. * @since 1.0.0 */ export declare const withTriplicatedEndpoints: (p: Basis2d) => Basis2d; /** * Creates a new `Path2d` from a `Basis2d`. * * @param p - The `Basis2d` to convert to a `Path2d`. * @returns A new `Path2d` instance. * @since 1.0.0 */ export declare const toPath: (p: Basis2d) => CubicPath2d; /** * Converts a `Basis2d` to a `Bezier2d`. * * @param p - The `Basis2d` to convert. * @returns A new `Bezier2d` instance. * @since 1.0.0 */ export declare const toBezier: (p: Basis2d) => Bezier2d;