@@ -143,7 +143,6 @@ export type LengthFactory = {
143
143
export type Options = {
144
144
round : "auto" | "off" | number ;
145
145
origin : number [ ] ;
146
- sampleSize : number ;
147
146
} ;
148
147
export type PathTransform = {
149
148
s : PathSegment ;
@@ -361,6 +360,10 @@ export type TransformObjectValues = Partial<TransformObject> & {
361
360
number
362
361
] ;
363
362
} ;
363
+ export type Point = {
364
+ x : number ;
365
+ y : number ;
366
+ } ;
364
367
/**
365
368
* Creates a new SVGPathCommander instance with the following properties:
366
369
* * segments: `pathArray`
@@ -374,20 +377,36 @@ export type TransformObjectValues = Partial<TransformObject> & {
374
377
declare class SVGPathCommander {
375
378
static CSSMatrix : typeof CSSMatrix$1 ;
376
379
static getSVGMatrix : ( transform : TransformObjectValues ) => CSSMatrix$1 ;
377
- static getPathBBox : ( path : PathArray | string , sampleSize ?: number | undefined ) => PathBBox ;
380
+ static getPathBBox : ( path : PathArray | string ) => PathBBox ;
378
381
static getPathArea : ( path : PathArray ) => number ;
379
- static getTotalLength : ( pathInput : string | PathArray , sampleSize ?: number | undefined ) => number ;
382
+ static getTotalLength : ( pathInput : string | PathArray ) => number ;
380
383
static getDrawDirection : ( path : string | PathArray ) => boolean ;
381
- static getPointAtLength : ( pathInput : string | PathArray , distance : number , sampleSize ?: number | undefined ) => {
384
+ static getPointAtLength : ( pathInput : string | PathArray , distance : number ) => {
382
385
x : number ;
383
386
y : number ;
384
387
} ;
385
- static pathLengthFactory : ( pathInput : string | PathArray , distance : number | undefined , sampleSize ?: number | undefined ) => LengthFactory ;
386
- static getPropertiesAtLength : ( pathInput : string | PathArray , distance ?: number , samplesize ?: number ) => SegmentProperties ;
388
+ static pathFactory : ( pathInput : string | PathArray , distance ?: number ) => {
389
+ point : {
390
+ x : number ;
391
+ y : number ;
392
+ } ;
393
+ length : number ;
394
+ readonly bbox : {
395
+ min : {
396
+ x : number ;
397
+ y : number ;
398
+ } ;
399
+ max : {
400
+ x : number ;
401
+ y : number ;
402
+ } ;
403
+ } ;
404
+ } ;
405
+ static getPropertiesAtLength : ( pathInput : string | PathArray , distance ?: number ) => SegmentProperties ;
387
406
static getPropertiesAtPoint : ( pathInput : string | PathArray , point : {
388
407
x : number ;
389
408
y : number ;
390
- } , sampleSize ?: number ) => PointProperties ;
409
+ } ) => PointProperties ;
391
410
static polygonLength : ( polygon : [
392
411
number ,
393
412
number
@@ -399,19 +418,19 @@ declare class SVGPathCommander {
399
418
static getClosestPoint : ( pathInput : string | PathArray , point : {
400
419
x : number ;
401
420
y : number ;
402
- } , sampleSize ?: number | undefined ) => {
421
+ } ) => {
403
422
x : number ;
404
423
y : number ;
405
424
} ;
406
425
static getSegmentOfPoint : ( path : string | PathArray , point : {
407
426
x : number ;
408
427
y : number ;
409
- } , sampleSize ?: number | undefined ) => SegmentProperties | undefined ;
410
- static getSegmentAtLength : ( pathInput : string | PathArray , distance ?: number , sampleSize ?: number ) => PathSegment | undefined ;
428
+ } ) => SegmentProperties | undefined ;
429
+ static getSegmentAtLength : ( pathInput : string | PathArray , distance ?: number ) => PathSegment | undefined ;
411
430
static isPointInStroke : ( pathInput : string | PathArray , point : {
412
431
x : number ;
413
432
y : number ;
414
- } , sampleSize ?: number ) => boolean ;
433
+ } ) => boolean ;
415
434
static isValidPath : ( pathString : string ) => boolean ;
416
435
static isPathArray : ( path : unknown ) => path is PathArray ;
417
436
static isAbsoluteArray : ( path : unknown ) => path is AbsoluteArray ;
@@ -450,32 +469,31 @@ declare class SVGPathCommander {
450
469
* @param config instance options
451
470
*/
452
471
constructor ( pathValue : string , config ?: Partial < Options > ) ;
472
+ get bbox ( ) : PathBBox ;
473
+ get length ( ) : number ;
453
474
/**
454
475
* Returns the path bounding box, equivalent to native `path.getBBox()`.
455
476
*
456
477
* @public
457
- * @param sampleSize the scan resolution
458
478
* @returns the pathBBox
459
479
*/
460
- getBBox ( sampleSize ?: number | undefined ) : PathBBox ;
480
+ getBBox ( ) : PathBBox ;
461
481
/**
462
482
* Returns the total path length, equivalent to native `path.getTotalLength()`.
463
483
*
464
484
* @public
465
- * @param sampleSize the scan resolution
466
485
* @returns the path total length
467
486
*/
468
- getTotalLength ( sampleSize ?: number | undefined ) : number ;
487
+ getTotalLength ( ) : number ;
469
488
/**
470
489
* Returns an `{x,y}` point in the path stroke at a given length,
471
490
* equivalent to the native `path.getPointAtLength()`.
472
491
*
473
492
* @public
474
493
* @param length the length
475
- * @param sampleSize the scan resolution
476
494
* @returns the requested point
477
495
*/
478
- getPointAtLength ( length : number , sampleSize ?: number | undefined ) : {
496
+ getPointAtLength ( length : number ) : {
479
497
x : number ;
480
498
y : number ;
481
499
} ;
0 commit comments