|
1 |
| -import { AbsoluteArray as AbsoluteArray_2 } from './types'; |
2 |
| -import { AbsoluteSegment as AbsoluteSegment_2 } from './types'; |
3 | 1 | import * as arcTools from './math/arcTools';
|
4 | 2 | import * as bezierTools from './math/bezier';
|
5 |
| -import { CSegment as CSegment_2 } from './types'; |
6 |
| -import { CubicSegment as CubicSegment_2 } from './types'; |
7 | 3 | import * as cubicTools from './math/cubicTools';
|
8 |
| -import { CurveArray as CurveArray_2 } from './types'; |
| 4 | +import { default as default_10 } from './math/roundTo'; |
| 5 | +import { default as default_11 } from './parser/parsePathString'; |
| 6 | +import { default as default_12 } from './parser/finalizeSegment'; |
| 7 | +import { default as default_13 } from './parser/invalidPathValue'; |
| 8 | +import { default as default_14 } from './parser/isArcCommand'; |
| 9 | +import { default as default_15 } from './parser/isDigit'; |
| 10 | +import { default as default_16 } from './parser/isDigitStart'; |
| 11 | +import { default as default_17 } from './parser/isMoveCommand'; |
| 12 | +import { default as default_18 } from './parser/isPathCommand'; |
| 13 | +import { default as default_19 } from './parser/isSpace'; |
9 | 14 | import { default as default_2 } from '@thednp/dommatrix';
|
10 |
| -import { default as default_3 } from './parser/pathParser'; |
11 |
| -import { DigitNumber as DigitNumber_2 } from './types'; |
12 |
| -import { IteratorCallback as IteratorCallback_2 } from './types'; |
| 15 | +import { default as default_20 } from './parser/paramsCount'; |
| 16 | +import { default as default_21 } from './parser/paramsParser'; |
| 17 | +import { default as default_22 } from './parser/pathParser'; |
| 18 | +import { default as default_23 } from './parser/scanFlag'; |
| 19 | +import { default as default_24 } from './parser/scanParam'; |
| 20 | +import { default as default_25 } from './parser/scanSegment'; |
| 21 | +import { default as default_26 } from './parser/skipSpaces'; |
| 22 | +import { default as default_27 } from './util/distanceEpsilon'; |
| 23 | +import { default as default_28 } from './util/getClosestPoint'; |
| 24 | +import { default as default_29 } from './util/getDrawDirection'; |
| 25 | +import { default as default_3 } from './convert/pathToAbsolute'; |
| 26 | +import { default as default_30 } from './util/getPathArea'; |
| 27 | +import { default as default_31 } from './util/getPathBBox'; |
| 28 | +import { default as default_32 } from './util/getPointAtLength'; |
| 29 | +import { default as default_33 } from './util/getPropertiesAtLength'; |
| 30 | +import { default as default_34 } from './util/getPropertiesAtPoint'; |
| 31 | +import { default as default_35 } from './util/getSegmentAtLength'; |
| 32 | +import { default as default_36 } from './util/getSegmentOfPoint'; |
| 33 | +import { default as default_37 } from './util/getTotalLength'; |
| 34 | +import { default as default_38 } from './util/isAbsoluteArray'; |
| 35 | +import { default as default_39 } from './util/isCurveArray'; |
| 36 | +import { default as default_4 } from './convert/pathToRelative'; |
| 37 | +import { default as default_40 } from './util/isNormalizedArray'; |
| 38 | +import { default as default_41 } from './util/isPathArray'; |
| 39 | +import { default as default_42 } from './util/isPointInStroke'; |
| 40 | +import { default as default_43 } from './util/isRelativeArray'; |
| 41 | +import { default as default_44 } from './util/isValidPath'; |
| 42 | +import { default as default_45 } from './util/shapeParams'; |
| 43 | +import { default as default_46 } from './util/shapeToPath'; |
| 44 | +import { default as default_47 } from './util/shapeToPathArray'; |
| 45 | +import { default as default_48 } from './process/absolutizeSegment'; |
| 46 | +import { default as default_49 } from './process/arcToCubic'; |
| 47 | +import { default as default_5 } from './convert/pathToCurve'; |
| 48 | +import { default as default_50 } from './process/getSVGMatrix'; |
| 49 | +import { default as default_51 } from './process/iterate'; |
| 50 | +import { default as default_52 } from './process/lineToCubic'; |
| 51 | +import { default as default_53 } from './process/normalizePath'; |
| 52 | +import { default as default_54 } from './process/normalizeSegment'; |
| 53 | +import { default as default_55 } from './process/optimizePath'; |
| 54 | +import { default as default_56 } from './process/projection2d'; |
| 55 | +import { default as default_57 } from './process/quadToCubic'; |
| 56 | +import { default as default_58 } from './process/relativizeSegment'; |
| 57 | +import { default as default_59 } from './process/reverseCurve'; |
| 58 | +import { default as default_6 } from './convert/pathToString'; |
| 59 | +import { default as default_60 } from './process/reversePath'; |
| 60 | +import { default as default_61 } from './process/roundPath'; |
| 61 | +import { default as default_62 } from './process/roundSegment'; |
| 62 | +import { default as default_63 } from './process/segmentToCubic'; |
| 63 | +import { default as default_64 } from './process/shortenSegment'; |
| 64 | +import { default as default_65 } from './process/splitCubic'; |
| 65 | +import { default as default_66 } from './process/splitPath'; |
| 66 | +import { default as default_67 } from './process/transformPath'; |
| 67 | +import { default as default_7 } from './math/distanceSquareRoot'; |
| 68 | +import { default as default_8 } from './math/midPoint'; |
| 69 | +import { default as default_9 } from './math/rotateVector'; |
13 | 70 | import * as lineTools from './math/lineTools';
|
14 |
| -import { MSegment as MSegment_2 } from './types'; |
15 |
| -import { NormalArray as NormalArray_2 } from './types'; |
16 |
| -import { NormalSegment as NormalSegment_2 } from './types'; |
17 |
| -import { ParserParams as ParserParams_2 } from './interface'; |
18 |
| -import { PathCommand as PathCommand_2 } from './types'; |
19 |
| -import { PathCommandNumber as PathCommandNumber_2 } from './types'; |
20 |
| -import { PathSegment as PathSegment_2 } from './types'; |
21 |
| -import { Point as Point_2 } from './types'; |
22 |
| -import { PointProperties as PointProperties_2 } from './interface'; |
23 | 71 | import * as polygonTools from './math/polygonTools';
|
24 | 72 | import * as quadTools from './math/quadTools';
|
25 |
| -import { RelativeArray as RelativeArray_2 } from './types'; |
26 |
| -import { RelativeSegment as RelativeSegment_2 } from './types'; |
27 |
| -import { SegmentProperties as SegmentProperties_2 } from './interface'; |
28 |
| -import { ShapeOps as ShapeOps_2 } from './types'; |
29 |
| -import { ShapeParams as ShapeParams_2 } from './interface'; |
30 |
| -import { ShapeTypes as ShapeTypes_2 } from './types'; |
31 |
| -import { ShortSegment as ShortSegment_2 } from './types'; |
32 |
| -import { SpaceNumber as SpaceNumber_2 } from './types'; |
33 | 73 |
|
34 | 74 | export declare type AbsoluteArray = [MSegment, ...AbsoluteSegment[]];
|
35 | 75 |
|
@@ -137,121 +177,8 @@ export declare type CubicSegment = CSegment | cSegment;
|
137 | 177 |
|
138 | 178 | export declare type CurveArray = [MSegment, ...CSegment[]];
|
139 | 179 |
|
140 |
| -declare const _default: typeof SVGPathCommander_2 & { |
141 |
| - absolutizeSegment: (segment: PathSegment_2, index: number, lastX: number, lastY: number) => AbsoluteSegment_2; |
142 |
| - arcToCubic: (X1: number, Y1: number, RX: number, RY: number, angle: number, LAF: number, SF: number, X2: number, Y2: number, recursive?: [number, number, number, number]) => number[]; |
143 |
| - arcTools: typeof arcTools; |
144 |
| - bezierTools: typeof bezierTools; |
145 |
| - CSSMatrix: typeof default_2; |
146 |
| - cubicTools: typeof cubicTools; |
147 |
| - distanceEpsilon: number; |
148 |
| - distanceSquareRoot: (a: PointTuple, b: PointTuple) => number; |
149 |
| - finalizeSegment: (path: default_3) => void; |
150 |
| - getClosestPoint: (pathInput: string | PathArray, point: { |
151 |
| - x: number; |
152 |
| - y: number; |
153 |
| - }) => { |
154 |
| - x: number; |
155 |
| - y: number; |
156 |
| - }; |
157 |
| - getDrawDirection: (path: string | PathArray) => boolean; |
158 |
| - getPathArea: (path: PathArray) => number; |
159 |
| - getPathBBox: (pathInput: PathArray | string) => { |
160 |
| - x: number; |
161 |
| - y: number; |
162 |
| - width: number; |
163 |
| - height: number; |
164 |
| - x2: number; |
165 |
| - y2: number; |
166 |
| - cx: number; |
167 |
| - cy: number; |
168 |
| - cz: number; |
169 |
| - }; |
170 |
| - getPointAtLength: (pathInput: string | PathArray, distance?: number) => { |
171 |
| - x: number; |
172 |
| - y: number; |
173 |
| - }; |
174 |
| - getPropertiesAtLength: (pathInput: string | PathArray, distance?: number) => SegmentProperties_2; |
175 |
| - getPropertiesAtPoint: (pathInput: string | PathArray, point: Point_2) => PointProperties_2; |
176 |
| - getSegmentAtLength: (pathInput: string | PathArray, distance?: number) => PathSegment_2 | undefined; |
177 |
| - getSegmentOfPoint: (path: string | PathArray, point: { |
178 |
| - x: number; |
179 |
| - y: number; |
180 |
| - }) => SegmentProperties_2 | undefined; |
181 |
| - getSVGMatrix: (transform: TransformObjectValues) => default_2; |
182 |
| - getTotalLength: (pathInput: string | PathArray) => number; |
183 |
| - invalidPathValue: string; |
184 |
| - isAbsoluteArray: (path: unknown) => path is AbsoluteArray_2; |
185 |
| - isArcCommand: (code: number) => code is 97; |
186 |
| - isCurveArray: (path: unknown) => path is CurveArray_2; |
187 |
| - isDigit: (code: number) => code is DigitNumber_2; |
188 |
| - isDigitStart: (code: number) => code is DigitNumber_2 | 43 | 45 | 46; |
189 |
| - isMoveCommand: (code: number) => code is 109 | 77; |
190 |
| - isNormalizedArray: (path: unknown) => path is NormalArray_2; |
191 |
| - isPathArray: (path: unknown) => path is PathArray; |
192 |
| - isPathCommand: (code: number) => code is PathCommandNumber_2; |
193 |
| - isPointInStroke: (pathInput: string | PathArray, point: { |
194 |
| - x: number; |
195 |
| - y: number; |
196 |
| - }) => boolean; |
197 |
| - isRelativeArray: (path: unknown) => path is RelativeArray_2; |
198 |
| - isSpace: (ch: number) => ch is SpaceNumber_2; |
199 |
| - isValidPath: (pathString: string) => boolean; |
200 |
| - iterate: <T extends PathArray>(path: PathArray, iterator: IteratorCallback_2) => T; |
201 |
| - lineToCubic: (x1: number, y1: number, x2: number, y2: number) => number[]; |
202 |
| - lineTools: typeof lineTools; |
203 |
| - midPoint: (a: PointTuple, b: PointTuple, t: number) => PointTuple; |
204 |
| - normalizePath: (pathInput: string | PathArray) => NormalArray_2; |
205 |
| - normalizeSegment: (segment: PathSegment_2, params: ParserParams_2) => NormalSegment_2; |
206 |
| - optimizePath: (pathInput: PathArray, roundOption?: number) => PathArray; |
207 |
| - paramsCount: { |
208 |
| - a: number; |
209 |
| - c: number; |
210 |
| - h: number; |
211 |
| - l: number; |
212 |
| - m: number; |
213 |
| - r: number; |
214 |
| - q: number; |
215 |
| - s: number; |
216 |
| - t: number; |
217 |
| - v: number; |
218 |
| - z: number; |
219 |
| - }; |
220 |
| - paramsParser: ParserParams_2; |
221 |
| - parsePathString: <T extends PathArray>(pathInput: string | T) => PathArray; |
222 |
| - pathParser: typeof default_3; |
223 |
| - pathToAbsolute: (pathInput: string | PathArray) => AbsoluteArray_2; |
224 |
| - pathToCurve: (pathInput: string | PathArray) => CurveArray_2; |
225 |
| - pathToRelative: (pathInput: string | PathArray) => RelativeArray_2; |
226 |
| - pathToString: (path: PathArray, roundOption?: number | "off") => string; |
227 |
| - polygonTools: typeof polygonTools; |
228 |
| - projection2d: (m: default_2, point2D: PointTuple, origin: [number, number, number]) => PointTuple; |
229 |
| - quadToCubic: (x1: number, y1: number, qx: number, qy: number, x2: number, y2: number) => [number, number, number, number, number, number]; |
230 |
| - quadTools: typeof quadTools; |
231 |
| - relativizeSegment: (segment: PathSegment_2, index: number, lastX: number, lastY: number) => MSegment_2 | RelativeSegment_2; |
232 |
| - reverseCurve: (path: CurveArray_2) => CurveArray_2; |
233 |
| - reversePath: (pathInput: PathArray) => PathArray; |
234 |
| - rotateVector: (x: number, y: number, rad: number) => { |
235 |
| - x: number; |
236 |
| - y: number; |
237 |
| - }; |
238 |
| - roundPath: (path: PathArray, roundOption?: number | "off") => PathArray; |
239 |
| - roundSegment: <T extends PathSegment_2>(segment: T, roundOption: number) => T; |
240 |
| - roundTo: (n: number, round: number) => number; |
241 |
| - scanFlag: (path: default_3) => void; |
242 |
| - scanParam: (path: default_3) => void; |
243 |
| - scanSegment: (path: default_3) => void; |
244 |
| - segmentToCubic: (segment: PathSegment_2, params: ParserParams_2) => MSegment_2 | CSegment_2; |
245 |
| - shapeParams: ShapeParams_2; |
246 |
| - shapeToPath: (element: ShapeTypes_2 | ShapeOps_2, replace?: boolean, ownerDocument?: Document) => SVGPathElement | false; |
247 |
| - shapeToPathArray: (element: ShapeTypes_2 | ShapeOps_2) => false | PathArray; |
248 |
| - shortenSegment: (segment: AbsoluteSegment_2, normalSegment: NormalSegment_2, params: ParserParams_2, prevCommand: PathCommand_2) => ShortSegment_2; |
249 |
| - skipSpaces: (path: default_3) => void; |
250 |
| - splitCubic: (pts: number[], ratio?: number) => [CubicSegment_2, CubicSegment_2]; |
251 |
| - splitPath: (pathInput: PathArray) => PathArray[]; |
252 |
| - transformPath: (pathInput: PathArray | string, transform?: Partial<TransformObject>) => PathArray; |
253 |
| -}; |
254 |
| -export default _default; |
| 180 | +declare const defaultExport: typeof SVGPathCommander_2 & typeof util; |
| 181 | +export default defaultExport; |
255 | 182 |
|
256 | 183 | export declare type DeriveCallback = (t: number) => Point;
|
257 | 184 |
|
@@ -685,6 +612,83 @@ export declare type TSegment = [TCommand, number, number];
|
685 | 612 |
|
686 | 613 | export declare type tSegment = [tCommand, number, number];
|
687 | 614 |
|
| 615 | +declare namespace util { |
| 616 | + export { |
| 617 | + default_2 as CSSMatrix, |
| 618 | + arcTools, |
| 619 | + bezierTools, |
| 620 | + cubicTools, |
| 621 | + lineTools, |
| 622 | + quadTools, |
| 623 | + polygonTools, |
| 624 | + default_3 as pathToAbsolute, |
| 625 | + default_4 as pathToRelative, |
| 626 | + default_5 as pathToCurve, |
| 627 | + default_6 as pathToString, |
| 628 | + default_7 as distanceSquareRoot, |
| 629 | + default_8 as midPoint, |
| 630 | + default_9 as rotateVector, |
| 631 | + default_10 as roundTo, |
| 632 | + default_11 as parsePathString, |
| 633 | + default_12 as finalizeSegment, |
| 634 | + default_13 as invalidPathValue, |
| 635 | + default_14 as isArcCommand, |
| 636 | + default_15 as isDigit, |
| 637 | + default_16 as isDigitStart, |
| 638 | + default_17 as isMoveCommand, |
| 639 | + default_18 as isPathCommand, |
| 640 | + default_19 as isSpace, |
| 641 | + default_20 as paramsCount, |
| 642 | + default_21 as paramsParser, |
| 643 | + default_22 as pathParser, |
| 644 | + default_23 as scanFlag, |
| 645 | + default_24 as scanParam, |
| 646 | + default_25 as scanSegment, |
| 647 | + default_26 as skipSpaces, |
| 648 | + default_27 as distanceEpsilon, |
| 649 | + default_28 as getClosestPoint, |
| 650 | + default_29 as getDrawDirection, |
| 651 | + default_30 as getPathArea, |
| 652 | + default_31 as getPathBBox, |
| 653 | + default_32 as getPointAtLength, |
| 654 | + default_33 as getPropertiesAtLength, |
| 655 | + default_34 as getPropertiesAtPoint, |
| 656 | + default_35 as getSegmentAtLength, |
| 657 | + default_36 as getSegmentOfPoint, |
| 658 | + default_37 as getTotalLength, |
| 659 | + default_38 as isAbsoluteArray, |
| 660 | + default_39 as isCurveArray, |
| 661 | + default_40 as isNormalizedArray, |
| 662 | + default_41 as isPathArray, |
| 663 | + default_42 as isPointInStroke, |
| 664 | + default_43 as isRelativeArray, |
| 665 | + default_44 as isValidPath, |
| 666 | + default_45 as shapeParams, |
| 667 | + default_46 as shapeToPath, |
| 668 | + default_47 as shapeToPathArray, |
| 669 | + default_48 as absolutizeSegment, |
| 670 | + default_49 as arcToCubic, |
| 671 | + default_50 as getSVGMatrix, |
| 672 | + default_51 as iterate, |
| 673 | + default_52 as lineToCubic, |
| 674 | + default_53 as normalizePath, |
| 675 | + default_54 as normalizeSegment, |
| 676 | + default_55 as optimizePath, |
| 677 | + default_56 as projection2d, |
| 678 | + default_57 as quadToCubic, |
| 679 | + default_58 as relativizeSegment, |
| 680 | + default_59 as reverseCurve, |
| 681 | + default_60 as reversePath, |
| 682 | + default_61 as roundPath, |
| 683 | + default_62 as roundSegment, |
| 684 | + default_63 as segmentToCubic, |
| 685 | + default_64 as shortenSegment, |
| 686 | + default_65 as splitCubic, |
| 687 | + default_66 as splitPath, |
| 688 | + default_67 as transformPath |
| 689 | + } |
| 690 | +} |
| 691 | + |
688 | 692 | export declare type VCommand = "V";
|
689 | 693 |
|
690 | 694 | export declare type vCommand = "v";
|
|
0 commit comments