Skip to content

Commit 06bcefe

Browse files
committed
docs(): jsdoc fixes
1 parent 86917e3 commit 06bcefe

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

intersect.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Find or counts the intersections between two SVG paths.
43
*
@@ -48,7 +47,7 @@ export default findPathIntersections;
4847
* ]
4948
*/
5049
declare type Path = string | PathComponent[];
51-
declare type PathComponent = any[];
50+
declare type PathComponent = [cmd: string, ...number[]];
5251

5352
declare interface Intersection {
5453
/**

intersect.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@ function bezierBBoxIntersects(bez1, bez2) {
287287
return isBBoxIntersect(bbox1, bbox2);
288288
}
289289

290+
/**
291+
*
292+
* @param {import("./intersect").PathComponent} bez1
293+
* @param {import("./intersect").PathComponent} bez2
294+
* @param {boolean} [justCount=false]
295+
* @returns {import("./intersect").Intersection}
296+
*/
290297
function findBezierIntersections(bez1, bez2, justCount) {
291298

292299
// As an optimization, lines will have only 1 segment
@@ -381,11 +388,11 @@ function findBezierIntersections(bez1, bez2, justCount) {
381388
* // { x: 50, y: 50, segment1: 1, segment2: 1, t1: 0.5, t2: 0.5 }
382389
* // ]
383390
*
384-
* @param {String|Array<PathDef>} path1
385-
* @param {String|Array<PathDef>} path2
386-
* @param {Boolean} [justCount=false]
391+
* @param {import("./intersect").Path} path1
392+
* @param {import("./intersect").Path} path2
393+
* @param {boolean} [justCount=false]
387394
*
388-
* @return {Array<Intersection>|Number}
395+
* @return {import("./intersect").Intersection[] | number}
389396
*/
390397
export default function findPathIntersections(path1, path2, justCount) {
391398
path1 = getPathCurve(path1);
@@ -455,7 +462,6 @@ export default function findPathIntersections(path1, path2, justCount) {
455462
return res;
456463
}
457464

458-
459465
function pathToAbsolute(pathArray) {
460466

461467
if (!pathArray || !pathArray.length) {

0 commit comments

Comments
 (0)