svgo-fix-path
Version:
Fix SVG path direction using SVGO
27 lines (23 loc) • 861 B
TypeScript
import { PathArray, Point, PathBBox } from 'svg-path-commander';
import { CustomPlugin } from 'svgo';
declare class PathTree {
protected path?: PathArray;
protected area?: number;
protected polygon?: Point[];
protected bbox?: PathBBox;
parent?: PathTree;
children: Set<PathTree>;
constructor(path?: PathArray);
set value(path: PathArray | undefined);
get value(): PathArray | undefined;
get dir(): "cw" | "ccw" | undefined;
addChild(target: PathTree): this;
setParent(parent: PathTree): this;
compare(other: PathTree): 0 | 1 | -1;
reverse(): this;
static from(paths: PathArray[]): PathTree;
}
declare function fixPath(d: string): string;
declare const FixPathPlugin: CustomPlugin;
declare const RemoveClipPathPlugin: CustomPlugin;
export { FixPathPlugin, PathTree, RemoveClipPathPlugin, fixPath };