UNPKG

2.23 kBTypeScriptView Raw
1export declare const createSVGPathCalculator: any;
2export declare type Direction = [number, number];
3export interface ColinMeinkeSVGPoint {
4 x: number;
5 y: number;
6 curve?: any;
7 moveTo?: any;
8}
9export declare class SVGPointElement implements SVGPoint {
10 x: number;
11 y: number;
12 matrixTransform: any;
13 orientation: any;
14 constructor(x: number, y: number);
15}
16export declare type PathDataCommand = "M" | "m" | "Z" | "z" | "L" | "l" | "H" | "h" | "V" | "v" | "C" | "c" | "S" | "s" | "Q" | "q" | "T" | "t" | "A" | "a" | "B" | "b" | "R" | "r";
17export declare class SVGPathSegment {
18 type: PathDataCommand;
19 values: number[];
20 constructor(type: PathDataCommand, values: number[]);
21}
22export interface SVGPathDataSettings {
23 normalize: boolean;
24}
25export interface SVGPathData {
26 getPathData: (settings?: SVGPathDataSettings) => SVGPathSegment[];
27 setPathData: (pathData: SVGPathSegment[]) => void;
28}
29export declare class SVGPath implements SVGPathData {
30 pathData: SVGPathSegment[];
31 pathCalculator: {
32 at: (length: number) => [number, number];
33 length: () => number;
34 };
35 getPathDataFromPoints: (points: SVGPointElement[], markerStart?: string, markerEnd?: string) => SVGPathSegment[];
36 d: string;
37 points: ColinMeinkeSVGPoint[];
38 constructor(points: SVGPointElement[], getPathDataFromPoints: any);
39 getPathStringFromPathData: (pathData: SVGPathSegment[]) => string;
40 getPointAtLength: (length: number) => SVGPointElement;
41 getTotalLength: () => number;
42 getPathData: (settings?: SVGPathDataSettings) => SVGPathSegment[];
43 setPathData: (pathData: SVGPathSegment[]) => void;
44 getPointAtPosition: (position: number) => SVGPointElement;
45}
46export declare function changeDirection(currentDirection: Direction): Direction;
47export declare class StraightLine extends SVGPath {
48 constructor(points: SVGPointElement[]);
49}
50export declare class ElbowLine extends SVGPath {
51 constructor(points: SVGPointElement[]);
52}
53export declare class SegmentedLine extends SVGPath {
54 constructor(points: SVGPointElement[]);
55}
56export declare class CurvedLine extends SVGPath {
57 constructor(points: SVGPointElement[], markerStart: any, markerEnd: any);
58}