UNPKG

@thi.ng/geom

Version:

Functional, polymorphic API for 2D geometry types & SVG generation

28 lines 1.15 kB
import type { Fn, IClear, IEmpty } from "@thi.ng/api"; import type { Attribs, IHiccupShape2, IPath, PathSegment2 } from "../api.js"; export declare class Path implements IClear, IEmpty<Path>, IHiccupShape2<Path>, IPath<PathSegment2> { attribs?: Attribs | undefined; readonly type = "path"; readonly dim = 2; segments: PathSegment2[]; subPaths: PathSegment2[][]; constructor(segments?: Iterable<PathSegment2>, subPaths?: Iterable<PathSegment2[]>, attribs?: Attribs | undefined); /** * Returns true, if the last main segment is a closing segment, e.g. if the * path represents a closed shape. */ get closed(): boolean; [Symbol.iterator](): Generator<PathSegment2, void, any>; clear(): void; empty(): Path; close(): this; copy(): Path; copyTransformed(fn: Fn<PathSegment2[], PathSegment2[]>): Path; withAttribs(attribs: Attribs): Path; equiv(o: any): boolean; isComplex(): boolean; addSegments(...segments: PathSegment2[]): this; addSubPaths(...paths: PathSegment2[][]): this; toHiccup(): (string | any[] | Attribs)[]; } //# sourceMappingURL=path.d.ts.map