import type { Always } from "@thi.ng/api"; import type { Vec } from "@thi.ng/vectors"; import type { Attribs, IPath, PCLike, PCLikeConstructor, PathConstructor, PathSegment, PathSegment2, PathSegment3 } from "./api.js"; import { Path } from "./api/path.js"; import { Path3 } from "./api/path3.js"; import { arcFrom2Points } from "./arc.js"; /** @internal */ type PathGeoConstructor = PCLikeConstructor & PCLike>; /** @internal */ type PathBuilderTypes

, S extends P["segments"][0]> = { path: PathConstructor; a?: typeof arcFrom2Points; c: PathGeoConstructor; l: PathGeoConstructor; q: PathGeoConstructor; }; export interface PathBuilderOpts { /** * If true (default), "move" commands will start a new path and * {@link PathBuilder} might produce multiple {@link Path}s. In general, * it's NOT recommended to disable this behavior since various path related * operations will not function properly anymore. However, there're some use * cases where auto-splitting is undesirable and this option primarily * exists for those. */ autoSplit: boolean; } /** * Generic 2D/3D path builder. Use {@link pathBuilder} or {@link pathBuilder3} * to instantiate. */ export declare class PathBuilder

, S extends P["segments"][0]> { protected ctors: PathBuilderTypes; attribs?: Attribs | undefined; opts: Partial; /** * Array of all paths which have been built already (incl. the current) */ paths: P[]; protected curr: P; protected currP: Vec; protected bezierP: Vec; protected startP: Vec; constructor(ctors: PathBuilderTypes, attribs?: Attribs | undefined, opts?: Partial); [Symbol.iterator](): Generator; /** * Returns the current path being constructed. */ current(): P; /** * Starts a new path and makes it the current one. Any future build commands * will only act on this new path. */ newPath(): void; moveTo(p: Vec, relative?: boolean): this; lineTo(p: Vec, relative?: boolean): this; hlineTo(x: number, relative?: boolean): this; vlineTo(y: number, relative?: boolean): this; cubicTo(cp1: Vec, cp2: Vec, p: Vec, relative?: boolean): this; quadraticTo(cp: Vec, p: Vec, relative?: boolean): this; cubicChainTo(cp2: Vec, p: Vec, relative?: boolean): this; quadraticChainTo(p: Vec, relative?: boolean): this; arcTo(p: Vec, r: Vec, xaxis: number, xl: boolean, clockwise: boolean, relative?: boolean): this; close(): this; protected updateCurrent(p: Vec, relative: boolean): Vec; protected absPoint(p: Vec, relative: boolean): Vec; protected addHVLine(p: number, i: number, relative: boolean): void; protected addCubic(cp1: Vec, cp2: Vec, p: Vec, relative: boolean): void; protected addQuadratic(cp: Vec, p: Vec, relative: boolean): void; } /** * Creates a new {@link PathBuilder} instance to construct a path step-by-step * via a fluent builder API to append various segments and/or sub-paths. * * @remarks * Also see {@link pathFromSvg} and {@link roundedRect}. * * @param attribs * @param opts */ export declare const pathBuilder: (attribs?: Attribs, opts?: Partial) => PathBuilder; /** * Like {@link pathBuilder}, but for constructing 3D paths ({@link Path3}). * * @remarks * Does **not** support arc segments, but all other segment types. * * @param attribs * @param opts */ export declare const pathBuilder3: (attribs?: Attribs, opts?: Partial) => PathBuilder; export {}; //# sourceMappingURL=path-builder.d.ts.map