svg-path-d
Version:
SVG path data (path[d] attribute content) manipulation library.
14 lines (13 loc) • 708 B
TypeScript
import { DrawCommand, DrawTo } from './command';
export declare type PathNode = DrawTo & {
prev?: PathNode;
};
export declare function getX(item?: Readonly<PathNode>): number;
export declare function getY(item?: Readonly<PathNode>): number;
export declare function createPathNode(name: DrawCommand, args: ReadonlyArray<string | number>, relative?: boolean, prev?: PathNode): PathNode;
/**
* Connects items and casts the DrawTo array into a PathNode array.
* @param items array to cast
*/
export declare function makePath(items: DrawTo[]): PathNode[];
export declare function clonePath(items: PathNode[], mapper: (value: PathNode, index: number, arr: PathNode[]) => PathNode): PathNode[];