Skip to content

Commit 37b0c2f

Browse files
committed
named exports
1 parent 4084205 commit 37b0c2f

12 files changed

+214
-368
lines changed

dist/svg-path-commander.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/svg-path-commander.cjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/svg-path-commander.d.cts

Lines changed: 3 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -307,118 +307,6 @@ type LineCoordinates = [number, number, number, number];
307307
type DeriveCallback = (t: number) => Point;
308308
type IteratorCallback = (segment: PathSegment, index: number, lastX: number, lastY: number) => PathSegment | false | void | undefined;
309309

310-
declare const arcTools: {
311-
angleBetween: (v0: Point, v1: Point) => number;
312-
arcLength: (rx: number, ry: number, theta: number) => number;
313-
arcPoint: (cx: number, cy: number, rx: number, ry: number, alpha: number, theta: number) => PointTuple;
314-
getArcBBox: (x1: number, y1: number, RX: number, RY: number, angle: number, LAF: number, SF: number, x: number, y: number) => [number, number, number, number];
315-
getArcLength: (x1: number, y1: number, RX: number, RY: number, angle: number, LAF: number, SF: number, x: number, y: number) => number;
316-
getArcProps: (x1: number, y1: number, RX: number, RY: number, angle: number, LAF: number, SF: number, x: number, y: number) => {
317-
rx: number;
318-
ry: number;
319-
startAngle: number;
320-
endAngle: number;
321-
center: {
322-
x: number;
323-
y: number;
324-
};
325-
};
326-
getPointAtArcLength: (x1: number, y1: number, RX: number, RY: number, angle: number, LAF: number, SF: number, x: number, y: number, distance?: number) => {
327-
x: number;
328-
y: number;
329-
};
330-
};
331-
332-
declare const bezierTools: {
333-
bezierLength: (derivativeFn: DeriveCallback) => number;
334-
calculateBezier: (derivativeFn: DeriveCallback, t: number) => number;
335-
CBEZIER_MINMAX_EPSILON: number;
336-
computeBezier: (points: DerivedQuadPoints | DerivedCubicPoints, t: number) => DerivedPoint;
337-
Cvalues: number[];
338-
deriveBezier: (points: QuadPoints | CubicPoints) => (DerivedQuadPoints | DerivedCubicPoints)[];
339-
getBezierLength: (curve: CubicCoordinates | QuadCoordinates) => number;
340-
minmaxC: ([v1, cp1, cp2, v2]: [number, number, number, number]) => PointTuple;
341-
minmaxQ: ([v1, cp, v2]: [number, number, number]) => PointTuple;
342-
Tvalues: number[];
343-
};
344-
345-
declare const cubicTools: {
346-
getCubicBBox: (x1: number, y1: number, c1x: number, c1y: number, c2x: number, c2y: number, x2: number, y2: number) => [number, number, number, number];
347-
getCubicLength: (x1: number, y1: number, c1x: number, c1y: number, c2x: number, c2y: number, x2: number, y2: number) => number;
348-
getPointAtCubicLength: (x1: number, y1: number, c1x: number, c1y: number, c2x: number, c2y: number, x2: number, y2: number, distance?: number) => {
349-
x: number;
350-
y: number;
351-
};
352-
getPointAtCubicSegmentLength: ([x1, y1, c1x, c1y, c2x, c2y, x2, y2]: CubicCoordinates, t: number) => {
353-
x: number;
354-
y: number;
355-
};
356-
};
357-
358-
declare const lineTools: {
359-
getLineBBox: (x1: number, y1: number, x2: number, y2: number) => [number, number, number, number];
360-
getLineLength: (x1: number, y1: number, x2: number, y2: number) => number;
361-
getPointAtLineLength: (x1: number, y1: number, x2: number, y2: number, distance?: number) => {
362-
x: number;
363-
y: number;
364-
};
365-
};
366-
367-
declare const quadTools: {
368-
getPointAtQuadLength: (x1: number, y1: number, cx: number, cy: number, x2: number, y2: number, distance?: number) => {
369-
x: number;
370-
y: number;
371-
};
372-
getPointAtQuadSegmentLength: ([x1, y1, cx, cy, x2, y2]: QuadCoordinates, t: number) => {
373-
x: number;
374-
y: number;
375-
};
376-
getQuadBBox: (x1: number, y1: number, cx: number, cy: number, x2: number, y2: number) => [number, number, number, number];
377-
getQuadLength: (x1: number, y1: number, cx: number, cy: number, x2: number, y2: number) => number;
378-
};
379-
380-
declare const polygonTools: {
381-
polygonArea: (polygon: PointTuple[]) => number;
382-
polygonLength: (polygon: PointTuple[]) => number;
383-
};
384-
385-
/**
386-
* Returns the square root of the distance
387-
* between two given points.
388-
*
389-
* @param a the first point coordinates
390-
* @param b the second point coordinates
391-
* @returns the distance value
392-
*/
393-
declare const distanceSquareRoot: (a: PointTuple, b: PointTuple) => number;
394-
395-
/**
396-
* Returns the coordinates of a specified distance
397-
* ratio between two points.
398-
*
399-
* @param a the first point coordinates
400-
* @param b the second point coordinates
401-
* @param t the ratio
402-
* @returns the midpoint coordinates
403-
*/
404-
declare const midPoint: (a: PointTuple, b: PointTuple, t: number) => PointTuple;
405-
406-
/**
407-
* Returns an {x,y} vector rotated by a given
408-
* angle in radian.
409-
*
410-
* @param x the initial vector x
411-
* @param y the initial vector y
412-
* @param rad the radian vector angle
413-
* @returns the rotated vector
414-
*/
415-
declare const rotateVector: (x: number, y: number, rad: number) => {
416-
x: number;
417-
y: number;
418-
};
419-
420-
declare const roundTo: (n: number, round: number) => number;
421-
422310
/**
423311
* Parses a path string value or object and returns an array
424312
* of segments, all converted to absolute values.
@@ -459,6 +347,8 @@ declare const pathToCurve: (pathInput: string | PathArray) => CurveArray;
459347
*/
460348
declare const pathToString: (path: PathArray, roundOption?: number | "off") => string;
461349

350+
declare const error = "SVGPathCommander Error";
351+
462352
/**
463353
* Parses a path string value and returns an array
464354
* of segments we like to call `pathArray`.
@@ -1165,4 +1055,4 @@ declare class SVGPathCommander {
11651055
dispose(): void;
11661056
}
11671057

1168-
export { type ACommand, type ASegment, type AbsoluteArray, type AbsoluteCommand, type AbsoluteSegment, type ArcCoordinates, type ArcSegment, type CCommand, type CSegment, type CircleAttr, type CloseSegment, type CubicCoordinates, type CubicPoints, type CubicSegment, type CurveArray, type DeriveCallback, type DerivedCubicPoints, type DerivedPoint, type DerivedQuadPoints, type DigitNumber, type EllipseAttr, type GlyphAttr, type HCommand, type HSegment, type HorLineSegment, type IteratorCallback, type LCommand, type LSegment, type LengthFactory, type LineAttr, type LineCoordinates, type LineSegment, type MCommand, type MSegment, type MoveSegment, type NormalArray, type NormalSegment, type Options, type ParserParams, type PathArray, type PathBBox, type PathCommand, type PathCommandNumber, type PathSegment, type PathTransform, type Point, type PointProperties, type PointTuple, type PolyAttr, type PolygonArray, type PolylineArray, type QCommand, type QSegment, type QuadCoordinates, type QuadPoints, type QuadSegment, type RectAttr, type RelativeArray, type RelativeCommand, type RelativeSegment, type SCommand, type SSegment, type SegmentLimits, type SegmentProperties, type ShapeOps, type ShapeParams, type ShapeTags, type ShapeTypes, type ShortCubicSegment, type ShortQuadSegment, type ShortSegment, type SpaceNumber, type TCommand, type TSegment, type TransformEntries, type TransformObject, type TransformObjectValues, type TransformProps, type VCommand, type VSegment, type VertLineSegment, type ZCommand, type ZSegment, type aCommand, type aSegment, absolutizeSegment, arcToCubic, arcTools, bezierTools, type cCommand, type cSegment, cubicTools, SVGPathCommander as default, DISTANCE_EPSILON as distanceEpsilon, distanceSquareRoot, finalizeSegment, getClosestPoint, getDrawDirection, getPathArea, getPathBBox, getPointAtLength, getPropertiesAtLength, getPropertiesAtPoint, getSVGMatrix, getSegmentAtLength, getSegmentOfPoint, getTotalLength, type hCommand, type hSegment, invalidPathValue, isAbsoluteArray, isArcCommand, isCurveArray, isDigit, isDigitStart, isMoveCommand, isNormalizedArray, isPathArray, isPathCommand, isPointInStroke, isRelativeArray, isSpace, isValidPath, iterate, type lCommand, type lSegment, lineToCubic, lineTools, type mCommand, type mSegment, midPoint, normalizePath, normalizeSegment, optimizePath, paramsCount, paramsParser, parsePathString, PathParser as pathParser, pathToAbsolute, pathToCurve, pathToRelative, pathToString, polygonTools, projection2d, type qCommand, type qSegment, quadToCubic, quadTools, relativizeSegment, reverseCurve, reversePath, rotateVector, roundPath, roundSegment, roundTo, type sCommand, type sSegment, scanFlag, scanParam, scanSegment, segmentToCubic, shapeParams, shapeToPath, shapeToPathArray, shortenSegment, skipSpaces, splitCubic, splitPath, type tCommand, type tSegment, transformPath, type vCommand, type vSegment, type zCommand, type zSegment };
1058+
export { type ACommand, type ASegment, type AbsoluteArray, type AbsoluteCommand, type AbsoluteSegment, type ArcCoordinates, type ArcSegment, type CCommand, type CSegment, type CircleAttr, type CloseSegment, type CubicCoordinates, type CubicPoints, type CubicSegment, type CurveArray, type DeriveCallback, type DerivedCubicPoints, type DerivedPoint, type DerivedQuadPoints, type DigitNumber, type EllipseAttr, type GlyphAttr, type HCommand, type HSegment, type HorLineSegment, type IteratorCallback, type LCommand, type LSegment, type LengthFactory, type LineAttr, type LineCoordinates, type LineSegment, type MCommand, type MSegment, type MoveSegment, type NormalArray, type NormalSegment, type Options, type ParserParams, type PathArray, type PathBBox, type PathCommand, type PathCommandNumber, type PathSegment, type PathTransform, type Point, type PointProperties, type PointTuple, type PolyAttr, type PolygonArray, type PolylineArray, type QCommand, type QSegment, type QuadCoordinates, type QuadPoints, type QuadSegment, type RectAttr, type RelativeArray, type RelativeCommand, type RelativeSegment, type SCommand, type SSegment, type SegmentLimits, type SegmentProperties, type ShapeOps, type ShapeParams, type ShapeTags, type ShapeTypes, type ShortCubicSegment, type ShortQuadSegment, type ShortSegment, type SpaceNumber, type TCommand, type TSegment, type TransformEntries, type TransformObject, type TransformObjectValues, type TransformProps, type VCommand, type VSegment, type VertLineSegment, type ZCommand, type ZSegment, type aCommand, type aSegment, absolutizeSegment, arcToCubic, type cCommand, type cSegment, SVGPathCommander as default, DISTANCE_EPSILON as distanceEpsilon, error, finalizeSegment, getClosestPoint, getDrawDirection, getPathArea, getPathBBox, getPointAtLength, getPropertiesAtLength, getPropertiesAtPoint, getSVGMatrix, getSegmentAtLength, getSegmentOfPoint, getTotalLength, type hCommand, type hSegment, invalidPathValue, isAbsoluteArray, isArcCommand, isCurveArray, isDigit, isDigitStart, isMoveCommand, isNormalizedArray, isPathArray, isPathCommand, isPointInStroke, isRelativeArray, isSpace, isValidPath, iterate, type lCommand, type lSegment, lineToCubic, type mCommand, type mSegment, normalizePath, normalizeSegment, optimizePath, paramsCount, paramsParser, parsePathString, PathParser as pathParser, pathToAbsolute, pathToCurve, pathToRelative, pathToString, projection2d, type qCommand, type qSegment, quadToCubic, relativizeSegment, reverseCurve, reversePath, roundPath, roundSegment, type sCommand, type sSegment, scanFlag, scanParam, scanSegment, segmentToCubic, shapeParams, shapeToPath, shapeToPathArray, shortenSegment, skipSpaces, splitCubic, splitPath, type tCommand, type tSegment, transformPath, type vCommand, type vSegment, type zCommand, type zSegment };

0 commit comments

Comments
 (0)