UNPKG

1.45 kBTypeScriptView Raw
1import { SVGCommand, CommandM, CommandL, CommandH, CommandV, CommandZ, CommandQ, CommandT, CommandC, CommandS, CommandA } from 'svg-pathdata/lib/types';
2import { SVGPathData } from 'svg-pathdata';
3import Point from './Point';
4export declare type CommandType = SVGCommand['type'];
5export declare type Command = {
6 type: CommandType;
7} & Omit<CommandM, 'type'> & Omit<CommandL, 'type'> & Omit<CommandH, 'type'> & Omit<CommandV, 'type'> & Omit<CommandZ, 'type'> & Omit<CommandQ, 'type'> & Omit<CommandT, 'type'> & Omit<CommandC, 'type'> & Omit<CommandS, 'type'> & Omit<CommandA, 'type'>;
8export default class PathParser extends SVGPathData {
9 control: Point;
10 start: Point;
11 current: Point;
12 command: Command;
13 readonly commands: Command[];
14 private i;
15 private previousCommand;
16 private points;
17 private angles;
18 constructor(path: string);
19 reset(): void;
20 isEnd(): boolean;
21 next(): Command;
22 getPoint(xProp?: string, yProp?: string): Point;
23 getAsControlPoint(xProp?: string, yProp?: string): Point;
24 getAsCurrentPoint(xProp?: string, yProp?: string): Point;
25 getReflectedControlPoint(): Point;
26 makeAbsolute(point: Point): Point;
27 addMarker(point: Point, from?: Point, priorTo?: Point): void;
28 addMarkerAngle(point: Point, angle: number): void;
29 getMarkerPoints(): Point[];
30 getMarkerAngles(): number[];
31}
32//# sourceMappingURL=PathParser.d.ts.map
\No newline at end of file