1 | export declare type Point = {
|
2 | x: number;
|
3 | y: number;
|
4 | };
|
5 | export declare type MCommand = 'M';
|
6 | export declare type mCommand = 'm';
|
7 | export declare type LCommand = 'L';
|
8 | export declare type lCommand = 'l';
|
9 | export declare type VCommand = 'V';
|
10 | export declare type vCommand = 'v';
|
11 | export declare type HCommand = 'H';
|
12 | export declare type hCommand = 'h';
|
13 | export declare type ZCommand = 'Z';
|
14 | export declare type zCommand = 'z';
|
15 | export declare type CCommand = 'C';
|
16 | export declare type cCommand = 'c';
|
17 | export declare type SCommand = 'S';
|
18 | export declare type sCommand = 's';
|
19 | export declare type QCommand = 'Q';
|
20 | export declare type qCommand = 'q';
|
21 | export declare type TCommand = 'T';
|
22 | export declare type tCommand = 't';
|
23 | export declare type ACommand = 'A';
|
24 | export declare type aCommand = 'a';
|
25 | export declare type AbsoluteCommand = MCommand | LCommand | VCommand | HCommand | ZCommand | CCommand | SCommand | QCommand | TCommand | ACommand;
|
26 | export declare type RelativeCommand = mCommand | lCommand | vCommand | hCommand | zCommand | cCommand | sCommand | qCommand | tCommand | aCommand;
|
27 | export declare type PathCommand = AbsoluteCommand | RelativeCommand;
|
28 | export declare type MSegment = [MCommand, number, number];
|
29 | export declare type mSegment = [mCommand, number, number];
|
30 | export declare type MoveSegment = MSegment | mSegment;
|
31 | export declare type LSegment = [LCommand, number, number];
|
32 | export declare type lSegment = [lCommand, number, number];
|
33 | export declare type LineSegment = LSegment | lSegment;
|
34 | export declare type VSegment = [VCommand, number];
|
35 | export declare type vSegment = [vCommand, number];
|
36 | export declare type VertLineSegment = vSegment | VSegment;
|
37 | export declare type HSegment = [HCommand, number];
|
38 | export declare type hSegment = [hCommand, number];
|
39 | export declare type HorLineSegment = HSegment | hSegment;
|
40 | export declare type ZSegment = [ZCommand];
|
41 | export declare type zSegment = [zCommand];
|
42 | export declare type CloseSegment = ZSegment | zSegment;
|
43 | export declare type CSegment = [CCommand, number, number, number, number, number, number];
|
44 | export declare type cSegment = [cCommand, number, number, number, number, number, number];
|
45 | export declare type CubicSegment = CSegment | cSegment;
|
46 | export declare type SSegment = [SCommand, number, number, number, number];
|
47 | export declare type sSegment = [sCommand, number, number, number, number];
|
48 | export declare type ShortCubicSegment = SSegment | sSegment;
|
49 | export declare type QSegment = [QCommand, number, number, number, number];
|
50 | export declare type qSegment = [qCommand, number, number, number, number];
|
51 | export declare type QuadSegment = QSegment | qSegment;
|
52 | export declare type TSegment = [TCommand, number, number];
|
53 | export declare type tSegment = [tCommand, number, number];
|
54 | export declare type ShortQuadSegment = TSegment | tSegment;
|
55 | export declare type ASegment = [ACommand, number, number, number, number, number, number, number];
|
56 | export declare type aSegment = [aCommand, number, number, number, number, number, number, number];
|
57 | export declare type ArcSegment = ASegment | aSegment;
|
58 | export declare type PathSegment = MoveSegment | LineSegment | VertLineSegment | HorLineSegment | CloseSegment | CubicSegment | ShortCubicSegment | QuadSegment | ShortQuadSegment | ArcSegment;
|
59 | export interface SegmentProperties {
|
60 |
|
61 | segment: PathSegment;
|
62 |
|
63 | index: number;
|
64 |
|
65 | length: number;
|
66 |
|
67 | lengthAtSegment: number;
|
68 | [key: string]: any;
|
69 | }
|
70 | export declare type ShortSegment = VertLineSegment | HorLineSegment | ShortCubicSegment | ShortQuadSegment | CloseSegment;
|
71 | export declare type AbsoluteSegment = MSegment | LSegment | VSegment | HSegment | CSegment | SSegment | QSegment | TSegment | ASegment | ZSegment;
|
72 | export declare type RelativeSegment = mSegment | lSegment | vSegment | hSegment | cSegment | sSegment | qSegment | tSegment | aSegment | zSegment;
|
73 | export declare type NormalSegment = MSegment | LSegment | CSegment | QSegment | ASegment | ZSegment;
|
74 | export declare type PathArray = [MSegment | mSegment, ...PathSegment[]];
|
75 | export declare type AbsoluteArray = [MSegment, ...AbsoluteSegment[]];
|
76 | export declare type RelativeArray = [MSegment, ...RelativeSegment[]];
|
77 | export declare type NormalArray = [MSegment, ...NormalSegment[]];
|
78 | export declare type CurveArray = [MSegment, ...CSegment[]];
|
79 | export declare type PolygonArray = [MSegment, ...LSegment[], ZSegment];
|
80 | export declare type PolylineArray = [MSegment, ...LSegment[]];
|
81 | export interface ParserParams {
|
82 | x1: number;
|
83 | y1: number;
|
84 | x2: number;
|
85 | y2: number;
|
86 | x: number;
|
87 | y: number;
|
88 | qx: number | null;
|
89 | qy: number | null;
|
90 | }
|
91 | export interface PathBBox {
|
92 | width: number;
|
93 | height: number;
|
94 | x: number;
|
95 | y: number;
|
96 | x2: number;
|
97 | y2: number;
|
98 | cx: number;
|
99 | cy: number;
|
100 | cz: number;
|
101 | }
|
102 | export interface PathBBoxTotalLength extends PathBBox {
|
103 | length: number;
|
104 | }
|
105 | export interface PathLengthFactoryOptions {
|
106 | bbox: boolean;
|
107 | length: boolean;
|
108 | sampleSize: number;
|
109 | }
|
110 | export interface SegmentLimits {
|
111 | min: Point;
|
112 | max: Point;
|
113 | }
|
114 | export interface PointProperties {
|
115 | closest: {
|
116 | x: number;
|
117 | y: number;
|
118 | };
|
119 | distance: number;
|
120 | segment?: SegmentProperties;
|
121 | }
|
122 | export interface LengthFactory {
|
123 | length: number;
|
124 | point: Point;
|
125 | min: Point;
|
126 | max: Point;
|
127 | }
|