paper 0.12.15 → 0.12.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +2 -2
  3. package/dist/docs/assets/js/paper.js +35 -22
  4. package/dist/docs/classes/Color.html +2 -2
  5. package/dist/docs/classes/CompoundPath.html +2 -2
  6. package/dist/docs/classes/Curve.html +2 -2
  7. package/dist/docs/classes/CurveLocation.html +2 -2
  8. package/dist/docs/classes/Event.html +2 -2
  9. package/dist/docs/classes/Gradient.html +2 -2
  10. package/dist/docs/classes/GradientStop.html +2 -2
  11. package/dist/docs/classes/Group.html +2 -2
  12. package/dist/docs/classes/HitResult.html +2 -2
  13. package/dist/docs/classes/Item.html +2 -2
  14. package/dist/docs/classes/Key.html +2 -2
  15. package/dist/docs/classes/KeyEvent.html +2 -2
  16. package/dist/docs/classes/Layer.html +2 -2
  17. package/dist/docs/classes/Matrix.html +2 -2
  18. package/dist/docs/classes/MouseEvent.html +2 -2
  19. package/dist/docs/classes/PaperScope.html +2 -2
  20. package/dist/docs/classes/PaperScript.html +2 -2
  21. package/dist/docs/classes/Path.html +2 -2
  22. package/dist/docs/classes/PathItem.html +2 -2
  23. package/dist/docs/classes/Point.html +2 -2
  24. package/dist/docs/classes/PointText.html +2 -2
  25. package/dist/docs/classes/Project.html +2 -2
  26. package/dist/docs/classes/Raster.html +35 -4
  27. package/dist/docs/classes/Rectangle.html +2 -2
  28. package/dist/docs/classes/Segment.html +3 -3
  29. package/dist/docs/classes/Shape.html +3 -3
  30. package/dist/docs/classes/Size.html +2 -2
  31. package/dist/docs/classes/Style.html +2 -2
  32. package/dist/docs/classes/SymbolDefinition.html +2 -2
  33. package/dist/docs/classes/SymbolItem.html +2 -2
  34. package/dist/docs/classes/TextItem.html +2 -2
  35. package/dist/docs/classes/Tool.html +2 -2
  36. package/dist/docs/classes/ToolEvent.html +2 -2
  37. package/dist/docs/classes/Tween.html +2 -2
  38. package/dist/docs/classes/View.html +2 -2
  39. package/dist/docs/classes/global.html +2 -2
  40. package/dist/docs/classes/index.html +2 -2
  41. package/dist/docs/index.html +1 -1
  42. package/dist/paper-core.js +35 -22
  43. package/dist/paper-core.min.js +3 -3
  44. package/dist/paper-full.js +35 -22
  45. package/dist/paper-full.min.js +3 -3
  46. package/dist/paper.d.ts +171 -146
  47. package/package.json +9 -9
package/dist/paper.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Paper.js v0.12.15 - The Swiss Army Knife of Vector Graphics Scripting.
2
+ * Paper.js v0.12.17 - The Swiss Army Knife of Vector Graphics Scripting.
3
3
  * http://paperjs.org/
4
4
  *
5
5
  * Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
@@ -9,13 +9,35 @@
9
9
  *
10
10
  * All rights reserved.
11
11
  *
12
- * Date: Wed Mar 17 10:49:48 2021 +0100
12
+ * Date: Thu Nov 3 21:15:36 2022 +0100
13
13
  *
14
14
  * This is an auto-generated type definition.
15
15
  */
16
16
 
17
17
  declare namespace paper {
18
18
 
19
+ type PointLike = (
20
+ Point
21
+ | [ number, number ]
22
+ | { x: number, y: number }
23
+ | { width: number, height: number }
24
+ | { angle: number, length: number }
25
+ )
26
+
27
+ type SizeLike = (
28
+ Size
29
+ | [ number, number ]
30
+ | { x: number, y: number }
31
+ | { width: number, height: number }
32
+ )
33
+
34
+ type RectangleLike = (
35
+ Rectangle
36
+ | [ number, number, number, number ]
37
+ | { x: number, y: number, width: number, height: number }
38
+ | { from: PointLike, to: PointLike }
39
+ )
40
+
19
41
  /**
20
42
  * All properties and functions that expect color values in the form
21
43
  * of instances of Color objects, also accept named colors and hex values as
@@ -133,7 +155,7 @@ declare namespace paper {
133
155
  /**
134
156
  * Creates a gradient Color object.
135
157
  */
136
- constructor(gradient: Gradient, origin: Point, destination: Point, highlight?: Point)
158
+ constructor(gradient: Gradient, origin: PointLike, destination: PointLike, highlight?: PointLike)
137
159
 
138
160
  /**
139
161
  * Creates a HSB, HSL or gradient Color object from the properties of
@@ -540,7 +562,7 @@ declare namespace paper {
540
562
  /**
541
563
  * Creates a new curve object.
542
564
  */
543
- constructor(point1: Point, handle1: Point, handle2: Point, point2: Point)
565
+ constructor(point1: PointLike, handle1: PointLike, handle2: PointLike, point2: PointLike)
544
566
 
545
567
  /**
546
568
  * Returns a copy of the curve.
@@ -782,7 +804,7 @@ declare namespace paper {
782
804
  * @return at most two curve-time parameters, where the curve is
783
805
  * tangential to the given tangent
784
806
  */
785
- getTimesWithTangent(tangent: Point): number[]
807
+ getTimesWithTangent(tangent: PointLike): number[]
786
808
 
787
809
  /**
788
810
  * Calculates the curve offset at the specified curve-time parameter on
@@ -802,7 +824,7 @@ declare namespace paper {
802
824
  *
803
825
  * @return the curve location of the specified point
804
826
  */
805
- getLocationOf(point: Point): CurveLocation
827
+ getLocationOf(point: PointLike): CurveLocation
806
828
 
807
829
  /**
808
830
  * Returns the length of the path from its beginning up to up to the
@@ -812,7 +834,7 @@ declare namespace paper {
812
834
  *
813
835
  * @return the length of the path up to the specified point
814
836
  */
815
- getOffsetOf(point: Point): number
837
+ getOffsetOf(point: PointLike): number
816
838
 
817
839
  /**
818
840
  * Returns the curve-time parameter of the specified point if it lies on the
@@ -824,7 +846,7 @@ declare namespace paper {
824
846
  *
825
847
  * @return the curve-time parameter of the specified point
826
848
  */
827
- getTimeOf(point: Point): number
849
+ getTimeOf(point: PointLike): number
828
850
 
829
851
  /**
830
852
  * Returns the nearest location on the curve to the specified point.
@@ -834,7 +856,7 @@ declare namespace paper {
834
856
  * @return the location on the curve that's the closest to
835
857
  * the specified point
836
858
  */
837
- getNearestLocation(point: Point): CurveLocation
859
+ getNearestLocation(point: PointLike): CurveLocation
838
860
 
839
861
  /**
840
862
  * Returns the nearest point on the curve to the specified point.
@@ -844,7 +866,7 @@ declare namespace paper {
844
866
  * @return the point on the curve that's the closest to the
845
867
  * specified point
846
868
  */
847
- getNearestPoint(point: Point): Point
869
+ getNearestPoint(point: PointLike): Point
848
870
 
849
871
  /**
850
872
  * Calculates the point on the curve at the given location.
@@ -1083,7 +1105,7 @@ declare namespace paper {
1083
1105
  /**
1084
1106
  * Creates a new CurveLocation object.
1085
1107
  */
1086
- constructor(curve: Curve, time: number, point?: Point)
1108
+ constructor(curve: Curve, time: number, point?: PointLike)
1087
1109
 
1088
1110
  /**
1089
1111
  * Checks whether tow CurveLocation objects are describing the same location
@@ -1815,12 +1837,12 @@ declare namespace paper {
1815
1837
  *
1816
1838
  * @param point - the point to check for
1817
1839
  */
1818
- contains(point: Point): boolean
1840
+ contains(point: PointLike): boolean
1819
1841
 
1820
1842
  /**
1821
1843
  * @param rect - the rectangle to check against
1822
1844
  */
1823
- isInside(rect: Rectangle): boolean
1845
+ isInside(rect: RectangleLike): boolean
1824
1846
 
1825
1847
  /**
1826
1848
  * @param item - the item to check against
@@ -1872,7 +1894,7 @@ declare namespace paper {
1872
1894
  * @return a hit result object describing what exactly was hit
1873
1895
  * or `null` if nothing was hit
1874
1896
  */
1875
- hitTest(point: Point, options?: object): HitResult
1897
+ hitTest(point: PointLike, options?: object): HitResult
1876
1898
 
1877
1899
  /**
1878
1900
  * Performs a hit-test on the item and its children (if it is a {@link
@@ -1890,7 +1912,7 @@ declare namespace paper {
1890
1912
  * @return hit result objects for all hits, describing what
1891
1913
  * exactly was hit or `null` if nothing was hit
1892
1914
  */
1893
- hitTestAll(point: Point, options?: object): HitResult[]
1915
+ hitTestAll(point: PointLike, options?: object): HitResult[]
1894
1916
 
1895
1917
  /**
1896
1918
  * Checks whether the item matches the criteria described by the given
@@ -2357,7 +2379,7 @@ declare namespace paper {
2357
2379
  *
2358
2380
  * @param delta - the offset to translate the item by
2359
2381
  */
2360
- translate(delta: Point): void
2382
+ translate(delta: PointLike): void
2361
2383
 
2362
2384
  /**
2363
2385
  * Rotates the item by a given angle around the given center point.
@@ -2368,7 +2390,7 @@ declare namespace paper {
2368
2390
  *
2369
2391
  * @param angle - the rotation angle
2370
2392
  */
2371
- rotate(angle: number, center?: Point): void
2393
+ rotate(angle: number, center?: PointLike): void
2372
2394
 
2373
2395
  /**
2374
2396
  * Scales the item by the given value from its center point, or optionally
@@ -2376,7 +2398,7 @@ declare namespace paper {
2376
2398
  *
2377
2399
  * @param scale - the scale factor
2378
2400
  */
2379
- scale(scale: number, center?: Point): void
2401
+ scale(scale: number, center?: PointLike): void
2380
2402
 
2381
2403
  /**
2382
2404
  * Scales the item by the given values from its center point, or optionally
@@ -2385,7 +2407,7 @@ declare namespace paper {
2385
2407
  * @param hor - the horizontal scale factor
2386
2408
  * @param ver - the vertical scale factor
2387
2409
  */
2388
- scale(hor: number, ver: number, center?: Point): void
2410
+ scale(hor: number, ver: number, center?: PointLike): void
2389
2411
 
2390
2412
  /**
2391
2413
  * Shears the item by the given value from its center point, or optionally
@@ -2395,7 +2417,7 @@ declare namespace paper {
2395
2417
  *
2396
2418
  * @param shear - the horizontal and vertical shear factors as a point
2397
2419
  */
2398
- shear(shear: Point, center?: Point): void
2420
+ shear(shear: PointLike, center?: PointLike): void
2399
2421
 
2400
2422
  /**
2401
2423
  * Shears the item by the given values from its center point, or optionally
@@ -2406,7 +2428,7 @@ declare namespace paper {
2406
2428
  * @param hor - the horizontal shear factor
2407
2429
  * @param ver - the vertical shear factor
2408
2430
  */
2409
- shear(hor: number, ver: number, center?: Point): void
2431
+ shear(hor: number, ver: number, center?: PointLike): void
2410
2432
 
2411
2433
  /**
2412
2434
  * Skews the item by the given angles from its center point, or optionally
@@ -2416,7 +2438,7 @@ declare namespace paper {
2416
2438
  *
2417
2439
  * @param skew - the horizontal and vertical skew angles in degrees
2418
2440
  */
2419
- skew(skew: Point, center?: Point): void
2441
+ skew(skew: PointLike, center?: PointLike): void
2420
2442
 
2421
2443
  /**
2422
2444
  * Skews the item by the given angles from its center point, or optionally
@@ -2427,7 +2449,7 @@ declare namespace paper {
2427
2449
  * @param hor - the horizontal skew angle in degrees
2428
2450
  * @param ver - the vertical sskew angle in degrees
2429
2451
  */
2430
- skew(hor: number, ver: number, center?: Point): void
2452
+ skew(hor: number, ver: number, center?: PointLike): void
2431
2453
 
2432
2454
  /**
2433
2455
  * Transform the item.
@@ -2444,7 +2466,7 @@ declare namespace paper {
2444
2466
  *
2445
2467
  * @return the transformed point as a new instance
2446
2468
  */
2447
- globalToLocal(point: Point): Point
2469
+ globalToLocal(point: PointLike): Point
2448
2470
 
2449
2471
  /**
2450
2472
  * Converts the specified point from the item's own local coordinate space
@@ -2454,7 +2476,7 @@ declare namespace paper {
2454
2476
  *
2455
2477
  * @return the transformed point as a new instance
2456
2478
  */
2457
- localToGlobal(point: Point): Point
2479
+ localToGlobal(point: PointLike): Point
2458
2480
 
2459
2481
  /**
2460
2482
  * Converts the specified point from the parent's coordinate space to
@@ -2464,7 +2486,7 @@ declare namespace paper {
2464
2486
  *
2465
2487
  * @return the transformed point as a new instance
2466
2488
  */
2467
- parentToLocal(point: Point): Point
2489
+ parentToLocal(point: PointLike): Point
2468
2490
 
2469
2491
  /**
2470
2492
  * Converts the specified point from the item's own local coordinate space
@@ -2474,13 +2496,13 @@ declare namespace paper {
2474
2496
  *
2475
2497
  * @return the transformed point as a new instance
2476
2498
  */
2477
- localToParent(point: Point): Point
2499
+ localToParent(point: PointLike): Point
2478
2500
 
2479
2501
  /**
2480
2502
  * Transform the item so that its {@link #bounds} fit within the specified
2481
2503
  * rectangle, without changing its aspect ratio.
2482
2504
  */
2483
- fitBounds(rectangle: Rectangle, fill?: boolean): void
2505
+ fitBounds(rectangle: RectangleLike, fill?: boolean): void
2484
2506
 
2485
2507
  /**
2486
2508
  * Attaches an event handler to the item.
@@ -2923,7 +2945,7 @@ declare namespace paper {
2923
2945
  *
2924
2946
  * @return this affine transform
2925
2947
  */
2926
- translate(point: Point): Matrix
2948
+ translate(point: PointLike): Matrix
2927
2949
 
2928
2950
  /**
2929
2951
  * Concatenates this matrix with a translate transformation.
@@ -2943,7 +2965,7 @@ declare namespace paper {
2943
2965
  *
2944
2966
  * @return this affine transform
2945
2967
  */
2946
- scale(scale: number, center?: Point): Matrix
2968
+ scale(scale: number, center?: PointLike): Matrix
2947
2969
 
2948
2970
  /**
2949
2971
  * Concatenates this matrix with a scaling transformation.
@@ -2954,7 +2976,7 @@ declare namespace paper {
2954
2976
  *
2955
2977
  * @return this affine transform
2956
2978
  */
2957
- scale(hor: number, ver: number, center?: Point): Matrix
2979
+ scale(hor: number, ver: number, center?: PointLike): Matrix
2958
2980
 
2959
2981
  /**
2960
2982
  * Concatenates this matrix with a rotation transformation around an
@@ -2965,7 +2987,7 @@ declare namespace paper {
2965
2987
  *
2966
2988
  * @return this affine transform
2967
2989
  */
2968
- rotate(angle: number, center: Point): Matrix
2990
+ rotate(angle: number, center: PointLike): Matrix
2969
2991
 
2970
2992
  /**
2971
2993
  * Concatenates this matrix with a rotation transformation around an
@@ -2987,7 +3009,7 @@ declare namespace paper {
2987
3009
  *
2988
3010
  * @return this affine transform
2989
3011
  */
2990
- shear(shear: Point, center?: Point): Matrix
3012
+ shear(shear: PointLike, center?: PointLike): Matrix
2991
3013
 
2992
3014
  /**
2993
3015
  * Concatenates this matrix with a shear transformation.
@@ -2998,7 +3020,7 @@ declare namespace paper {
2998
3020
  *
2999
3021
  * @return this affine transform
3000
3022
  */
3001
- shear(hor: number, ver: number, center?: Point): Matrix
3023
+ shear(hor: number, ver: number, center?: PointLike): Matrix
3002
3024
 
3003
3025
  /**
3004
3026
  * Concatenates this matrix with a skew transformation.
@@ -3008,7 +3030,7 @@ declare namespace paper {
3008
3030
  *
3009
3031
  * @return this affine transform
3010
3032
  */
3011
- skew(skew: Point, center?: Point): Matrix
3033
+ skew(skew: PointLike, center?: PointLike): Matrix
3012
3034
 
3013
3035
  /**
3014
3036
  * Concatenates this matrix with a skew transformation.
@@ -3019,7 +3041,7 @@ declare namespace paper {
3019
3041
  *
3020
3042
  * @return this affine transform
3021
3043
  */
3022
- skew(hor: number, ver: number, center?: Point): Matrix
3044
+ skew(hor: number, ver: number, center?: PointLike): Matrix
3023
3045
 
3024
3046
  /**
3025
3047
  * Appends the specified matrix to this matrix. This is the equivalent of
@@ -3109,7 +3131,7 @@ declare namespace paper {
3109
3131
  *
3110
3132
  * @return the transformed point
3111
3133
  */
3112
- transform(point: Point): Point
3134
+ transform(point: PointLike): Point
3113
3135
 
3114
3136
  /**
3115
3137
  * Transforms an array of coordinates by this matrix and stores the results
@@ -3130,7 +3152,7 @@ declare namespace paper {
3130
3152
  *
3131
3153
  * @param point - the point to be transformed
3132
3154
  */
3133
- inverseTransform(point: Point): Point
3155
+ inverseTransform(point: PointLike): Point
3134
3156
 
3135
3157
  /**
3136
3158
  * Decomposes the affine transformation described by this matrix into
@@ -3341,7 +3363,7 @@ declare namespace paper {
3341
3363
  * the element, or the size of the canvas to be created for usage in a web
3342
3364
  * worker.
3343
3365
  */
3344
- setup(element: HTMLCanvasElement | string | Size): void
3366
+ setup(element: HTMLCanvasElement | string | SizeLike): void
3345
3367
 
3346
3368
  /**
3347
3369
  * Activates this PaperScope, so all newly created items will be placed
@@ -3510,7 +3532,7 @@ declare namespace paper {
3510
3532
  * the same object, e.g. if the segment to be added already belongs to
3511
3533
  * another path.
3512
3534
  */
3513
- add(...segment: (Segment | Point | number[])[]): Segment | Segment[]
3535
+ add(...segment: (Segment | PointLike | number[])[]): Segment | Segment[]
3514
3536
 
3515
3537
  /**
3516
3538
  * Inserts one or more segments at a given index in the list of this path's
@@ -3522,7 +3544,7 @@ declare namespace paper {
3522
3544
  * @return the added segment. This is not necessarily the same
3523
3545
  * object, e.g. if the segment to be added already belongs to another path
3524
3546
  */
3525
- insert(index: number, segment: Segment | Point): Segment
3547
+ insert(index: number, segment: Segment | PointLike): Segment
3526
3548
 
3527
3549
  /**
3528
3550
  * Adds an array of segments (or types that can be converted to segments)
@@ -3664,7 +3686,7 @@ declare namespace paper {
3664
3686
  *
3665
3687
  * @return the curve location of the specified point
3666
3688
  */
3667
- getLocationOf(point: Point): CurveLocation
3689
+ getLocationOf(point: PointLike): CurveLocation
3668
3690
 
3669
3691
  /**
3670
3692
  * Returns the length of the path from its beginning up to up to the
@@ -3674,7 +3696,7 @@ declare namespace paper {
3674
3696
  *
3675
3697
  * @return the length of the path up to the specified point
3676
3698
  */
3677
- getOffsetOf(point: Point): number
3699
+ getOffsetOf(point: PointLike): number
3678
3700
 
3679
3701
  /**
3680
3702
  * Returns the curve location of the specified offset on the path.
@@ -3760,7 +3782,7 @@ declare namespace paper {
3760
3782
  * @return path offsets where the path is tangential to the
3761
3783
  * provided tangent
3762
3784
  */
3763
- getOffsetsWithTangent(tangent: Point): number[]
3785
+ getOffsetsWithTangent(tangent: PointLike): number[]
3764
3786
 
3765
3787
  }
3766
3788
  namespace Path {
@@ -3772,7 +3794,7 @@ declare namespace paper {
3772
3794
  * @param from - the line's starting point
3773
3795
  * @param to - the line's ending point
3774
3796
  */
3775
- constructor(from: Point, to: Point)
3797
+ constructor(from: PointLike, to: PointLike)
3776
3798
 
3777
3799
  /**
3778
3800
  * Creates a linear path item from the properties described by an object
@@ -3792,7 +3814,7 @@ declare namespace paper {
3792
3814
  * @param center - the center point of the circle
3793
3815
  * @param radius - the radius of the circle
3794
3816
  */
3795
- constructor(center: Point, radius: number)
3817
+ constructor(center: PointLike, radius: number)
3796
3818
 
3797
3819
  /**
3798
3820
  * Creates a circular path item from the properties described by an
@@ -3813,7 +3835,7 @@ declare namespace paper {
3813
3835
  * geometry of the rectangular path to be created
3814
3836
  * @param radius - the size of the rounded corners
3815
3837
  */
3816
- constructor(rectangle: paper.Rectangle, radius?: Size)
3838
+ constructor(rectangle: RectangleLike, radius?: SizeLike)
3817
3839
 
3818
3840
  /**
3819
3841
  * Creates a rectangular path item from a point and a size object.
@@ -3821,7 +3843,7 @@ declare namespace paper {
3821
3843
  * @param point - the rectangle's top-left corner.
3822
3844
  * @param size - the rectangle's size.
3823
3845
  */
3824
- constructor(point: Point, size: Size)
3846
+ constructor(point: PointLike, size: SizeLike)
3825
3847
 
3826
3848
  /**
3827
3849
  * Creates a rectangular path item from the passed points. These do not
@@ -3831,7 +3853,7 @@ declare namespace paper {
3831
3853
  * @param from - the first point defining the rectangle
3832
3854
  * @param to - the second point defining the rectangle
3833
3855
  */
3834
- constructor(from: Point, to: Point)
3856
+ constructor(from: PointLike, to: PointLike)
3835
3857
 
3836
3858
  /**
3837
3859
  * Creates a rectangular path item from the properties described by an
@@ -3850,7 +3872,7 @@ declare namespace paper {
3850
3872
  *
3851
3873
  * @param rectangle - the rectangle circumscribing the ellipse
3852
3874
  */
3853
- constructor(rectangle: paper.Rectangle)
3875
+ constructor(rectangle: RectangleLike)
3854
3876
 
3855
3877
  /**
3856
3878
  * Creates an elliptical path item from the properties described by an
@@ -3871,7 +3893,7 @@ declare namespace paper {
3871
3893
  * @param through - the point the arc passes through
3872
3894
  * @param to - the end point of the arc
3873
3895
  */
3874
- constructor(from: Point, through: Point, to: Point)
3896
+ constructor(from: PointLike, through: PointLike, to: PointLike)
3875
3897
 
3876
3898
  /**
3877
3899
  * Creates an circular arc path item from the properties described by an
@@ -3892,7 +3914,7 @@ declare namespace paper {
3892
3914
  * @param sides - the number of sides of the polygon
3893
3915
  * @param radius - the radius of the polygon
3894
3916
  */
3895
- constructor(center: Point, sides: number, radius: number)
3917
+ constructor(center: PointLike, sides: number, radius: number)
3896
3918
 
3897
3919
  /**
3898
3920
  * Creates a regular polygon shaped path item from the properties
@@ -3916,7 +3938,7 @@ declare namespace paper {
3916
3938
  * @param center - the center point of the star
3917
3939
  * @param points - the number of points of the star
3918
3940
  */
3919
- constructor(center: Point, points: number, radius1: number, radius2: number)
3941
+ constructor(center: PointLike, points: number, radius1: number, radius2: number)
3920
3942
 
3921
3943
  /**
3922
3944
  * Creates a star shaped path item from the properties described by an
@@ -4141,7 +4163,7 @@ declare namespace paper {
4141
4163
  * @return the location on the path that's the closest to
4142
4164
  * the specified point
4143
4165
  */
4144
- getNearestLocation(point: Point): CurveLocation
4166
+ getNearestLocation(point: PointLike): CurveLocation
4145
4167
 
4146
4168
  /**
4147
4169
  * Returns the nearest point on the path item to the specified point.
@@ -4151,7 +4173,7 @@ declare namespace paper {
4151
4173
  * @return the point on the path that's the closest to the specified
4152
4174
  * point
4153
4175
  */
4154
- getNearestPoint(point: Point): Point
4176
+ getNearestPoint(point: PointLike): Point
4155
4177
 
4156
4178
  /**
4157
4179
  * Reverses the orientation of the path item. When called on
@@ -4292,7 +4314,7 @@ declare namespace paper {
4292
4314
  *
4293
4315
  * @param point - the point in which to start the path
4294
4316
  */
4295
- moveTo(point: Point): void
4317
+ moveTo(point: PointLike): void
4296
4318
 
4297
4319
  /**
4298
4320
  * Adds a straight curve to the path, from the the last segment in the path
@@ -4301,7 +4323,7 @@ declare namespace paper {
4301
4323
  * @param point - the destination point of the newly added straight
4302
4324
  * curve
4303
4325
  */
4304
- lineTo(point: Point): void
4326
+ lineTo(point: PointLike): void
4305
4327
 
4306
4328
  /**
4307
4329
  * Adds an arc from the position of the last segment in the path, passing
@@ -4311,7 +4333,7 @@ declare namespace paper {
4311
4333
  * @param through - the point where the arc should pass through
4312
4334
  * @param to - the point where the arc should end
4313
4335
  */
4314
- arcTo(through: Point, to: Point): void
4336
+ arcTo(through: PointLike, to: PointLike): void
4315
4337
 
4316
4338
  /**
4317
4339
  * Adds an arc from the position of the last segment in the path to
@@ -4321,7 +4343,7 @@ declare namespace paper {
4321
4343
  * @param clockwise - specifies whether the arc should be
4322
4344
  * drawn in clockwise direction
4323
4345
  */
4324
- arcTo(to: Point, clockwise?: boolean): void
4346
+ arcTo(to: PointLike, clockwise?: boolean): void
4325
4347
 
4326
4348
  /**
4327
4349
  * Adds a curve from the last segment in the path through the specified
@@ -4333,7 +4355,7 @@ declare namespace paper {
4333
4355
  * @param time - the curve-time parameter at which the
4334
4356
  * `through` point is to be located
4335
4357
  */
4336
- curveTo(through: Point, to: Point, time?: number): void
4358
+ curveTo(through: PointLike, to: PointLike, time?: number): void
4337
4359
 
4338
4360
  /**
4339
4361
  * Adds a cubic bezier curve to the path, from the last segment to the
@@ -4348,7 +4370,7 @@ declare namespace paper {
4348
4370
  * for {@link Segment#handleIn} of its second segment are calculated
4349
4371
  * @param to - the destination point of the newly added curve
4350
4372
  */
4351
- cubicCurveTo(handle1: Point, handle2: Point, to: Point): void
4373
+ cubicCurveTo(handle1: PointLike, handle2: PointLike, to: PointLike): void
4352
4374
 
4353
4375
  /**
4354
4376
  * Adds a quadratic bezier curve to the path, from the last segment to the
@@ -4365,7 +4387,7 @@ declare namespace paper {
4365
4387
  * calculated
4366
4388
  * @param to - the destination point of the newly added curve
4367
4389
  */
4368
- quadraticCurveTo(handle: Point, to: Point): void
4390
+ quadraticCurveTo(handle: PointLike, to: PointLike): void
4369
4391
 
4370
4392
  /**
4371
4393
  * Closes the path. When closed, Paper.js connects the first and last
@@ -4382,7 +4404,7 @@ declare namespace paper {
4382
4404
  * child and a point is added as its first segment relative to the position
4383
4405
  * of the last segment of the current path.
4384
4406
  */
4385
- moveBy(to: Point): void
4407
+ moveBy(to: PointLike): void
4386
4408
 
4387
4409
  /**
4388
4410
  * Adds a straight curve to the path, from the the last segment in the path
@@ -4391,7 +4413,7 @@ declare namespace paper {
4391
4413
  * @param point - the vector describing the destination of the newly
4392
4414
  * added straight curve
4393
4415
  */
4394
- lineBy(point: Point): void
4416
+ lineBy(point: PointLike): void
4395
4417
 
4396
4418
  /**
4397
4419
  * Adds an arc from the position of the last segment in the path, passing
@@ -4402,7 +4424,7 @@ declare namespace paper {
4402
4424
  * @param through - the vector where the arc should pass through
4403
4425
  * @param to - the vector where the arc should end
4404
4426
  */
4405
- arcBy(through: Point, to: Point): void
4427
+ arcBy(through: PointLike, to: PointLike): void
4406
4428
 
4407
4429
  /**
4408
4430
  * Adds an arc from the position of the last segment in the path to the `to`
@@ -4413,7 +4435,7 @@ declare namespace paper {
4413
4435
  * @param clockwise - specifies whether the arc should be
4414
4436
  * drawn in clockwise direction
4415
4437
  */
4416
- arcBy(to: Point, clockwise?: boolean): void
4438
+ arcBy(to: PointLike, clockwise?: boolean): void
4417
4439
 
4418
4440
  /**
4419
4441
  * Adds a curve from the last segment in the path through the specified
@@ -4425,7 +4447,7 @@ declare namespace paper {
4425
4447
  * @param time - the curve-time parameter at which the
4426
4448
  * `through` point is to be located
4427
4449
  */
4428
- curveBy(through: Point, to: Point, time?: number): void
4450
+ curveBy(through: PointLike, to: PointLike, time?: number): void
4429
4451
 
4430
4452
  /**
4431
4453
  * Adds a cubic bezier curve to the path, from the last segment to the
@@ -4438,7 +4460,7 @@ declare namespace paper {
4438
4460
  * added curve
4439
4461
  * @param to - the destination point of the newly added curve
4440
4462
  */
4441
- cubicCurveBy(handle1: Point, handle2: Point, to: Point): void
4463
+ cubicCurveBy(handle1: PointLike, handle2: PointLike, to: PointLike): void
4442
4464
 
4443
4465
  /**
4444
4466
  * Adds a quadratic bezier curve to the path, from the last segment to the
@@ -4454,7 +4476,7 @@ declare namespace paper {
4454
4476
  * second segment are calculated
4455
4477
  * @param to - the destination point of the newly added curve
4456
4478
  */
4457
- quadraticCurveBy(handle: Point, to: Point): void
4479
+ quadraticCurveBy(handle: PointLike, to: PointLike): void
4458
4480
 
4459
4481
  }
4460
4482
 
@@ -4536,12 +4558,12 @@ declare namespace paper {
4536
4558
  * Creates a Point object using the width and height values of the given
4537
4559
  * Size object.
4538
4560
  */
4539
- constructor(size: Size)
4561
+ constructor(size: SizeLike)
4540
4562
 
4541
4563
  /**
4542
4564
  * Creates a Point object using the coordinates of the given Point object.
4543
4565
  */
4544
- constructor(point: Point)
4566
+ constructor(point: PointLike)
4545
4567
 
4546
4568
  /**
4547
4569
  * Creates a Point object using the properties in the given object.
@@ -4563,7 +4585,7 @@ declare namespace paper {
4563
4585
  *
4564
4586
  * @return true if the points are equal
4565
4587
  */
4566
- equals(point: Point): boolean
4588
+ equals(point: PointLike): boolean
4567
4589
 
4568
4590
  /**
4569
4591
  * Returns a copy of the point.
@@ -4583,7 +4605,7 @@ declare namespace paper {
4583
4605
  *
4584
4606
  * @return the angle in degrees
4585
4607
  */
4586
- getAngle(point: Point): number
4608
+ getAngle(point: PointLike): number
4587
4609
 
4588
4610
  /**
4589
4611
  * Returns the smaller angle between two vectors in radians. The angle is
@@ -4591,7 +4613,7 @@ declare namespace paper {
4591
4613
  *
4592
4614
  * @return the angle in radians
4593
4615
  */
4594
- getAngleInRadians(point: Point): number
4616
+ getAngleInRadians(point: PointLike): number
4595
4617
 
4596
4618
  /**
4597
4619
  * Returns the angle between two vectors. The angle is directional and
@@ -4602,7 +4624,7 @@ declare namespace paper {
4602
4624
  *
4603
4625
  * @return the angle between the two vectors
4604
4626
  */
4605
- getDirectedAngle(point: Point): number
4627
+ getDirectedAngle(point: PointLike): number
4606
4628
 
4607
4629
  /**
4608
4630
  * Returns the distance between the point and another point.
@@ -4610,7 +4632,7 @@ declare namespace paper {
4610
4632
  * @param squared - Controls whether the distance should
4611
4633
  * remain squared, or its square root should be calculated
4612
4634
  */
4613
- getDistance(point: Point, squared?: boolean): number
4635
+ getDistance(point: PointLike, squared?: boolean): number
4614
4636
 
4615
4637
  /**
4616
4638
  * Normalize modifies the {@link #length} of the vector to `1` without
@@ -4637,7 +4659,7 @@ declare namespace paper {
4637
4659
  *
4638
4660
  * @return the rotated point
4639
4661
  */
4640
- rotate(angle: number, center: Point): Point
4662
+ rotate(angle: number, center: PointLike): Point
4641
4663
 
4642
4664
  /**
4643
4665
  * Transforms the point by the matrix as a new point. The object itself is
@@ -4667,7 +4689,7 @@ declare namespace paper {
4667
4689
  *
4668
4690
  * @return the addition of the two points as a new point
4669
4691
  */
4670
- add(point: Point): Point
4692
+ add(point: PointLike): Point
4671
4693
 
4672
4694
  /**
4673
4695
  * Returns the subtraction of the supplied value to both coordinates of
@@ -4689,7 +4711,7 @@ declare namespace paper {
4689
4711
  *
4690
4712
  * @return the subtraction of the two points as a new point
4691
4713
  */
4692
- subtract(point: Point): Point
4714
+ subtract(point: PointLike): Point
4693
4715
 
4694
4716
  /**
4695
4717
  * Returns the multiplication of the supplied value to both coordinates of
@@ -4712,7 +4734,7 @@ declare namespace paper {
4712
4734
  *
4713
4735
  * @return the multiplication of the two points as a new point
4714
4736
  */
4715
- multiply(point: Point): Point
4737
+ multiply(point: PointLike): Point
4716
4738
 
4717
4739
  /**
4718
4740
  * Returns the division of the supplied value to both coordinates of
@@ -4734,7 +4756,7 @@ declare namespace paper {
4734
4756
  *
4735
4757
  * @return the division of the two points as a new point
4736
4758
  */
4737
- divide(point: Point): Point
4759
+ divide(point: PointLike): Point
4738
4760
 
4739
4761
  /**
4740
4762
  * The modulo operator returns the integer remainders of dividing the point
@@ -4752,7 +4774,7 @@ declare namespace paper {
4752
4774
  * @return the integer remainders of dividing the points by each
4753
4775
  * other as a new point
4754
4776
  */
4755
- modulo(point: Point): Point
4777
+ modulo(point: PointLike): Point
4756
4778
 
4757
4779
  /**
4758
4780
  * Checks whether the point is inside the boundaries of the rectangle.
@@ -4761,7 +4783,7 @@ declare namespace paper {
4761
4783
  *
4762
4784
  * @return true if the point is inside the rectangle
4763
4785
  */
4764
- isInside(rect: Rectangle): boolean
4786
+ isInside(rect: RectangleLike): boolean
4765
4787
 
4766
4788
  /**
4767
4789
  * Checks if the point is within a given distance of another point.
@@ -4771,7 +4793,7 @@ declare namespace paper {
4771
4793
  *
4772
4794
  * @return true if it is within the given distance
4773
4795
  */
4774
- isClose(point: Point, tolerance: number): boolean
4796
+ isClose(point: PointLike, tolerance: number): boolean
4775
4797
 
4776
4798
  /**
4777
4799
  * Checks if the vector represented by this point is collinear (parallel) to
@@ -4781,7 +4803,7 @@ declare namespace paper {
4781
4803
  *
4782
4804
  * @return true it is collinear
4783
4805
  */
4784
- isCollinear(point: Point): boolean
4806
+ isCollinear(point: PointLike): boolean
4785
4807
 
4786
4808
  /**
4787
4809
  * Checks if the vector represented by this point is orthogonal
@@ -4791,7 +4813,7 @@ declare namespace paper {
4791
4813
  *
4792
4814
  * @return true it is orthogonal
4793
4815
  */
4794
- isOrthogonal(point: Point): boolean
4816
+ isOrthogonal(point: PointLike): boolean
4795
4817
 
4796
4818
  /**
4797
4819
  * Checks if this point has both the x and y coordinate set to 0.
@@ -4826,14 +4848,14 @@ declare namespace paper {
4826
4848
  *
4827
4849
  * @return the dot product of the two points
4828
4850
  */
4829
- dot(point: Point): number
4851
+ dot(point: PointLike): number
4830
4852
 
4831
4853
  /**
4832
4854
  * Returns the cross product of the point and another point.
4833
4855
  *
4834
4856
  * @return the cross product of the two points
4835
4857
  */
4836
- cross(point: Point): number
4858
+ cross(point: PointLike): number
4837
4859
 
4838
4860
  /**
4839
4861
  * Returns the projection of the point onto another point.
@@ -4841,7 +4863,7 @@ declare namespace paper {
4841
4863
  *
4842
4864
  * @return the projection of the point onto another point
4843
4865
  */
4844
- project(point: Point): Point
4866
+ project(point: PointLike): Point
4845
4867
 
4846
4868
  /**
4847
4869
  * Returns a new point with rounded {@link #x} and {@link #y} values. The
@@ -4875,7 +4897,7 @@ declare namespace paper {
4875
4897
  *
4876
4898
  * @return the newly created point object
4877
4899
  */
4878
- static min(point1: Point, point2: Point): Point
4900
+ static min(point1: PointLike, point2: PointLike): Point
4879
4901
 
4880
4902
  /**
4881
4903
  * Returns a new point object with the largest {@link #x} and
@@ -4883,7 +4905,7 @@ declare namespace paper {
4883
4905
  *
4884
4906
  * @return the newly created point object
4885
4907
  */
4886
- static max(point1: Point, point2: Point): Point
4908
+ static max(point1: PointLike, point2: PointLike): Point
4887
4909
 
4888
4910
  /**
4889
4911
  * Returns a point object with random {@link #x} and {@link #y} values
@@ -4912,7 +4934,7 @@ declare namespace paper {
4912
4934
  *
4913
4935
  * @param point - the position where the text will start
4914
4936
  */
4915
- constructor(point: Point)
4937
+ constructor(point: PointLike)
4916
4938
 
4917
4939
  /**
4918
4940
  * Creates a point text item from the properties described by an object
@@ -4995,7 +5017,7 @@ declare namespace paper {
4995
5017
  * to find the element, or the size of the canvas to be created for usage in
4996
5018
  * a web worker.
4997
5019
  */
4998
- constructor(element: HTMLCanvasElement | string | Size)
5020
+ constructor(element: HTMLCanvasElement | string | SizeLike)
4999
5021
 
5000
5022
  /**
5001
5023
  * Activates this project, so all newly created items will be placed
@@ -5093,7 +5115,7 @@ declare namespace paper {
5093
5115
  * @return a hit result object that contains more information
5094
5116
  * about what exactly was hit or `null` if nothing was hit
5095
5117
  */
5096
- hitTest(point: Point, options?: object): HitResult
5118
+ hitTest(point: PointLike, options?: object): HitResult
5097
5119
 
5098
5120
  /**
5099
5121
  * Performs a hit-test on the item and its children (if it is a {@link
@@ -5110,7 +5132,7 @@ declare namespace paper {
5110
5132
  * @return hit result objects for all hits, describing what
5111
5133
  * exactly was hit or `null` if nothing was hit
5112
5134
  */
5113
- hitTestAll(point: Point, options?: object): HitResult[]
5135
+ hitTestAll(point: PointLike, options?: object): HitResult[]
5114
5136
 
5115
5137
  /**
5116
5138
  * Fetch items contained within the project whose properties match the
@@ -5386,7 +5408,7 @@ declare namespace paper {
5386
5408
  * @param position - the center position at which the raster item is
5387
5409
  * placed
5388
5410
  */
5389
- constructor(source?: HTMLImageElement | HTMLCanvasElement | string, position?: Point)
5411
+ constructor(source?: HTMLImageElement | HTMLCanvasElement | string, position?: PointLike)
5390
5412
 
5391
5413
  /**
5392
5414
  * Creates a new empty raster of the given size, and places it in the
@@ -5396,7 +5418,7 @@ declare namespace paper {
5396
5418
  * @param position - the center position at which the raster item is
5397
5419
  * placed
5398
5420
  */
5399
- constructor(size: Size, position?: Point)
5421
+ constructor(size: SizeLike, position?: PointLike)
5400
5422
 
5401
5423
  /**
5402
5424
  * Creates a new raster from an object description, and places it in the
@@ -5416,7 +5438,7 @@ declare namespace paper {
5416
5438
  *
5417
5439
  * @return the sub image as a Canvas object
5418
5440
  */
5419
- getSubCanvas(rect: Rectangle): HTMLCanvasElement
5441
+ getSubCanvas(rect: RectangleLike): HTMLCanvasElement
5420
5442
 
5421
5443
  /**
5422
5444
  * Extracts a part of the raster item's content as a new raster item, placed
@@ -5427,7 +5449,7 @@ declare namespace paper {
5427
5449
  *
5428
5450
  * @return the sub raster as a newly created raster item
5429
5451
  */
5430
- getSubRaster(rect: Rectangle): Raster
5452
+ getSubRaster(rect: RectangleLike): Raster
5431
5453
 
5432
5454
  /**
5433
5455
  * Returns a Base 64 encoded `data:` URL representation of the raster.
@@ -5440,7 +5462,7 @@ declare namespace paper {
5440
5462
  * @param point - the offset of the image as a point in pixel
5441
5463
  * coordinates
5442
5464
  */
5443
- drawImage(image: CanvasImageSource, point: Point): void
5465
+ drawImage(image: CanvasImageSource, point: PointLike): void
5444
5466
 
5445
5467
  /**
5446
5468
  * Calculates the average color of the image within the given path,
@@ -5450,7 +5472,7 @@ declare namespace paper {
5450
5472
  * @return the average color contained in the area covered by the
5451
5473
  * specified path, rectangle or point
5452
5474
  */
5453
- getAverageColor(object: Path | Rectangle | Point): Color
5475
+ getAverageColor(object: Path | RectangleLike | PointLike): Color
5454
5476
 
5455
5477
  /**
5456
5478
  * Gets the color of a pixel in the raster.
@@ -5470,7 +5492,7 @@ declare namespace paper {
5470
5492
  *
5471
5493
  * @return the color of the pixel
5472
5494
  */
5473
- getPixel(point: Point): Color
5495
+ getPixel(point: PointLike): Color
5474
5496
 
5475
5497
  /**
5476
5498
  * Sets the color of the specified pixel to the specified color.
@@ -5488,7 +5510,7 @@ declare namespace paper {
5488
5510
  * coordinates
5489
5511
  * @param color - the color that the pixel will be set to
5490
5512
  */
5491
- setPixel(point: Point, color: Color): void
5513
+ setPixel(point: PointLike, color: Color): void
5492
5514
 
5493
5515
  /**
5494
5516
  * Clears the image, if it is backed by a canvas.
@@ -5496,13 +5518,16 @@ declare namespace paper {
5496
5518
  clear(): void
5497
5519
 
5498
5520
 
5499
- createImageData(size: Size): ImageData
5521
+ createImageData(size: SizeLike): ImageData
5522
+
5523
+
5524
+ getImageData(rect: RectangleLike): ImageData
5500
5525
 
5501
5526
 
5502
- getImageData(rect: Rectangle): ImageData
5527
+ putImageData(data: ImageData, point: PointLike): void
5503
5528
 
5504
5529
 
5505
- setImageData(data: ImageData, point: Point): void
5530
+ setImageData(data: ImageData): void
5506
5531
 
5507
5532
  }
5508
5533
 
@@ -5631,7 +5656,7 @@ declare namespace paper {
5631
5656
  * @param point - the top-left point of the rectangle
5632
5657
  * @param size - the size of the rectangle
5633
5658
  */
5634
- constructor(point: Point, size: Size)
5659
+ constructor(point: PointLike, size: SizeLike)
5635
5660
 
5636
5661
  /**
5637
5662
  * Creates a rectangle object.
@@ -5649,12 +5674,12 @@ declare namespace paper {
5649
5674
  * @param from - the first point defining the rectangle
5650
5675
  * @param to - the second point defining the rectangle
5651
5676
  */
5652
- constructor(from: Point, to: Point)
5677
+ constructor(from: PointLike, to: PointLike)
5653
5678
 
5654
5679
  /**
5655
5680
  * Creates a new rectangle object from the passed rectangle object.
5656
5681
  */
5657
- constructor(rectangle: Rectangle)
5682
+ constructor(rectangle: RectangleLike)
5658
5683
 
5659
5684
  /**
5660
5685
  * Creates a Rectangle object.
@@ -5682,7 +5707,7 @@ declare namespace paper {
5682
5707
  *
5683
5708
  * @return true if the rectangles are equal
5684
5709
  */
5685
- equals(rect: Rectangle): boolean
5710
+ equals(rect: RectangleLike): boolean
5686
5711
 
5687
5712
  /**
5688
5713
  * @return a string representation of this rectangle
@@ -5701,7 +5726,7 @@ declare namespace paper {
5701
5726
  *
5702
5727
  * @return true if the point is inside the rectangle's boundary
5703
5728
  */
5704
- contains(point: Point): boolean
5729
+ contains(point: PointLike): boolean
5705
5730
 
5706
5731
  /**
5707
5732
  * Tests if the interior of the rectangle entirely contains the specified
@@ -5712,7 +5737,7 @@ declare namespace paper {
5712
5737
  * @return true if the rectangle entirely contains the specified
5713
5738
  * rectangle
5714
5739
  */
5715
- contains(rect: Rectangle): boolean
5740
+ contains(rect: RectangleLike): boolean
5716
5741
 
5717
5742
  /**
5718
5743
  * Tests if the interior of this rectangle intersects the interior of
@@ -5727,7 +5752,7 @@ declare namespace paper {
5727
5752
  * @return true if the rectangle and the specified rectangle
5728
5753
  * intersect each other
5729
5754
  */
5730
- intersects(rect: Rectangle, epsilon?: number): boolean
5755
+ intersects(rect: RectangleLike, epsilon?: number): boolean
5731
5756
 
5732
5757
  /**
5733
5758
  * Returns a new rectangle representing the intersection of this rectangle
@@ -5739,7 +5764,7 @@ declare namespace paper {
5739
5764
  * @return the largest rectangle contained in both the specified
5740
5765
  * rectangle and in this rectangle
5741
5766
  */
5742
- intersect(rect: Rectangle): Rectangle
5767
+ intersect(rect: RectangleLike): Rectangle
5743
5768
 
5744
5769
  /**
5745
5770
  * Returns a new rectangle representing the union of this rectangle with the
@@ -5750,7 +5775,7 @@ declare namespace paper {
5750
5775
  * @return the smallest rectangle containing both the specified
5751
5776
  * rectangle and this rectangle
5752
5777
  */
5753
- unite(rect: Rectangle): Rectangle
5778
+ unite(rect: RectangleLike): Rectangle
5754
5779
 
5755
5780
  /**
5756
5781
  * Adds a point to this rectangle. The resulting rectangle is the smallest
@@ -5767,7 +5792,7 @@ declare namespace paper {
5767
5792
  * @return the smallest rectangle that contains both the
5768
5793
  * original rectangle and the specified point
5769
5794
  */
5770
- include(point: Point): Rectangle
5795
+ include(point: PointLike): Rectangle
5771
5796
 
5772
5797
  /**
5773
5798
  * Returns a new rectangle expanded by the specified amount in horizontal
@@ -5778,7 +5803,7 @@ declare namespace paper {
5778
5803
  *
5779
5804
  * @return the expanded rectangle
5780
5805
  */
5781
- expand(amount: number | Size | Point): Rectangle
5806
+ expand(amount: number | SizeLike | PointLike): Rectangle
5782
5807
 
5783
5808
  /**
5784
5809
  * Returns a new rectangle expanded by the specified amounts in horizontal
@@ -5817,7 +5842,7 @@ declare namespace paper {
5817
5842
  * its {@link Path#segments} array.
5818
5843
  *
5819
5844
  * Each segment consists of an anchor point ({@link Segment#point}) and
5820
- * optionaly an incoming and an outgoing handle ({@link Segment#handleIn} and
5845
+ * optionally an incoming and an outgoing handle ({@link Segment#handleIn} and
5821
5846
  * {@link Segment#handleOut}), describing the tangents of the two {@link Curve}
5822
5847
  * objects that are connected by this segment.
5823
5848
  */
@@ -5892,7 +5917,7 @@ declare namespace paper {
5892
5917
  * anchor point of the segment that describes the out tangent of the
5893
5918
  * segment
5894
5919
  */
5895
- constructor(point?: Point, handleIn?: Point, handleOut?: Point)
5920
+ constructor(point?: PointLike, handleIn?: PointLike, handleOut?: PointLike)
5896
5921
 
5897
5922
  /**
5898
5923
  * Creates a new Segment object.
@@ -6080,7 +6105,7 @@ declare namespace paper {
6080
6105
  * @param center - the center point of the circle
6081
6106
  * @param radius - the radius of the circle
6082
6107
  */
6083
- constructor(center: Point, radius: number)
6108
+ constructor(center: PointLike, radius: number)
6084
6109
 
6085
6110
  /**
6086
6111
  * Creates a circular shape item from the properties described by an
@@ -6101,7 +6126,7 @@ declare namespace paper {
6101
6126
  * geometry of the rectangular shape to be created
6102
6127
  * @param radius - the size of the rounded corners
6103
6128
  */
6104
- constructor(rectangle: paper.Rectangle, radius?: Size)
6129
+ constructor(rectangle: RectangleLike, radius?: SizeLike)
6105
6130
 
6106
6131
  /**
6107
6132
  * Creates a rectangular shape item from a point and a size object.
@@ -6109,7 +6134,7 @@ declare namespace paper {
6109
6134
  * @param point - the rectangle's top-left corner.
6110
6135
  * @param size - the rectangle's size.
6111
6136
  */
6112
- constructor(point: Point, size: Size)
6137
+ constructor(point: PointLike, size: SizeLike)
6113
6138
 
6114
6139
  /**
6115
6140
  * Creates a rectangular shape item from the passed points. These do not
@@ -6119,7 +6144,7 @@ declare namespace paper {
6119
6144
  * @param from - the first point defining the rectangle
6120
6145
  * @param to - the second point defining the rectangle
6121
6146
  */
6122
- constructor(from: Point, to: Point)
6147
+ constructor(from: PointLike, to: PointLike)
6123
6148
 
6124
6149
  /**
6125
6150
  * Creates a rectangular shape item from the properties described by an
@@ -6138,7 +6163,7 @@ declare namespace paper {
6138
6163
  *
6139
6164
  * @param rectangle - the rectangle circumscribing the ellipse
6140
6165
  */
6141
- constructor(rectangle: paper.Rectangle)
6166
+ constructor(rectangle: RectangleLike)
6142
6167
 
6143
6168
  /**
6144
6169
  * Creates an elliptical shape item from the properties described by an
@@ -6185,13 +6210,13 @@ declare namespace paper {
6185
6210
  /**
6186
6211
  * Creates a Size object using the coordinates of the given Size object.
6187
6212
  */
6188
- constructor(size: Size)
6213
+ constructor(size: SizeLike)
6189
6214
 
6190
6215
  /**
6191
6216
  * Creates a Size object using the {@link Point#x} and {@link Point#y}
6192
6217
  * values of the given Point object.
6193
6218
  */
6194
- constructor(point: Point)
6219
+ constructor(point: PointLike)
6195
6220
 
6196
6221
  /**
6197
6222
  * Creates a Size object using the properties in the given object.
@@ -6211,7 +6236,7 @@ declare namespace paper {
6211
6236
  *
6212
6237
  * @param size - the size to compare to
6213
6238
  */
6214
- equals(size: Size): boolean
6239
+ equals(size: SizeLike): boolean
6215
6240
 
6216
6241
  /**
6217
6242
  * Returns a copy of the size.
@@ -6241,7 +6266,7 @@ declare namespace paper {
6241
6266
  *
6242
6267
  * @return the addition of the two sizes as a new size
6243
6268
  */
6244
- add(size: Size): Size
6269
+ add(size: SizeLike): Size
6245
6270
 
6246
6271
  /**
6247
6272
  * Returns the subtraction of the supplied value from the width and height
@@ -6262,7 +6287,7 @@ declare namespace paper {
6262
6287
  *
6263
6288
  * @return the subtraction of the two sizes as a new size
6264
6289
  */
6265
- subtract(size: Size): Size
6290
+ subtract(size: SizeLike): Size
6266
6291
 
6267
6292
  /**
6268
6293
  * Returns the multiplication of the supplied value with the width and
@@ -6282,7 +6307,7 @@ declare namespace paper {
6282
6307
  *
6283
6308
  * @return the multiplication of the two sizes as a new size
6284
6309
  */
6285
- multiply(size: Size): Size
6310
+ multiply(size: SizeLike): Size
6286
6311
 
6287
6312
  /**
6288
6313
  * Returns the division of the supplied value by the width and height of the
@@ -6302,7 +6327,7 @@ declare namespace paper {
6302
6327
  *
6303
6328
  * @return the division of the two sizes as a new size
6304
6329
  */
6305
- divide(size: Size): Size
6330
+ divide(size: SizeLike): Size
6306
6331
 
6307
6332
  /**
6308
6333
  * The modulo operator returns the integer remainders of dividing the size
@@ -6320,7 +6345,7 @@ declare namespace paper {
6320
6345
  * @return the integer remainders of dividing the sizes by each
6321
6346
  * other as a new size
6322
6347
  */
6323
- modulo(size: Size): Size
6348
+ modulo(size: SizeLike): Size
6324
6349
 
6325
6350
  /**
6326
6351
  * Checks if this size has both the width and height set to 0.
@@ -6369,7 +6394,7 @@ declare namespace paper {
6369
6394
  *
6370
6395
  * @return the newly created size object
6371
6396
  */
6372
- static min(size1: Size, size2: Size): Size
6397
+ static min(size1: SizeLike, size2: SizeLike): Size
6373
6398
 
6374
6399
  /**
6375
6400
  * Returns a new size object with the largest {@link #width} and
@@ -6377,7 +6402,7 @@ declare namespace paper {
6377
6402
  *
6378
6403
  * @return the newly created size object
6379
6404
  */
6380
- static max(size1: Size, size2: Size): Size
6405
+ static max(size1: SizeLike, size2: SizeLike): Size
6381
6406
 
6382
6407
  /**
6383
6408
  * Returns a size object with random {@link #width} and {@link #height}
@@ -6555,7 +6580,7 @@ declare namespace paper {
6555
6580
  *
6556
6581
  * @param position - the position of the placed symbol
6557
6582
  */
6558
- place(position?: Point): SymbolItem
6583
+ place(position?: PointLike): SymbolItem
6559
6584
 
6560
6585
  /**
6561
6586
  * Returns a copy of the symbol.
@@ -6589,7 +6614,7 @@ declare namespace paper {
6589
6614
  * item to place as a symbol
6590
6615
  * @param point - the center point of the placed symbol
6591
6616
  */
6592
- constructor(definition: SymbolDefinition | Item, point?: Point)
6617
+ constructor(definition: SymbolDefinition | Item, point?: PointLike)
6593
6618
 
6594
6619
  }
6595
6620
 
@@ -7171,7 +7196,7 @@ declare namespace paper {
7171
7196
  *
7172
7197
  * @param delta - the offset to translate the view by
7173
7198
  */
7174
- translate(delta: Point): void
7199
+ translate(delta: PointLike): void
7175
7200
 
7176
7201
  /**
7177
7202
  * Rotates the view by a given angle around the given center point.
@@ -7182,7 +7207,7 @@ declare namespace paper {
7182
7207
  *
7183
7208
  * @param angle - the rotation angle
7184
7209
  */
7185
- rotate(angle: number, center?: Point): void
7210
+ rotate(angle: number, center?: PointLike): void
7186
7211
 
7187
7212
  /**
7188
7213
  * Scales the view by the given value from its center point, or optionally
@@ -7190,7 +7215,7 @@ declare namespace paper {
7190
7215
  *
7191
7216
  * @param scale - the scale factor
7192
7217
  */
7193
- scale(scale: number, center?: Point): void
7218
+ scale(scale: number, center?: PointLike): void
7194
7219
 
7195
7220
  /**
7196
7221
  * Scales the view by the given values from its center point, or optionally
@@ -7199,7 +7224,7 @@ declare namespace paper {
7199
7224
  * @param hor - the horizontal scale factor
7200
7225
  * @param ver - the vertical scale factor
7201
7226
  */
7202
- scale(hor: number, ver: number, center?: Point): void
7227
+ scale(hor: number, ver: number, center?: PointLike): void
7203
7228
 
7204
7229
  /**
7205
7230
  * Shears the view by the given value from its center point, or optionally
@@ -7209,7 +7234,7 @@ declare namespace paper {
7209
7234
  *
7210
7235
  * @param shear - the horizontal and vertical shear factors as a point
7211
7236
  */
7212
- shear(shear: Point, center?: Point): void
7237
+ shear(shear: PointLike, center?: PointLike): void
7213
7238
 
7214
7239
  /**
7215
7240
  * Shears the view by the given values from its center point, or optionally
@@ -7220,7 +7245,7 @@ declare namespace paper {
7220
7245
  * @param hor - the horizontal shear factor
7221
7246
  * @param ver - the vertical shear factor
7222
7247
  */
7223
- shear(hor: number, ver: number, center?: Point): void
7248
+ shear(hor: number, ver: number, center?: PointLike): void
7224
7249
 
7225
7250
  /**
7226
7251
  * Skews the view by the given angles from its center point, or optionally
@@ -7230,7 +7255,7 @@ declare namespace paper {
7230
7255
  *
7231
7256
  * @param skew - the horizontal and vertical skew angles in degrees
7232
7257
  */
7233
- skew(skew: Point, center?: Point): void
7258
+ skew(skew: PointLike, center?: PointLike): void
7234
7259
 
7235
7260
  /**
7236
7261
  * Skews the view by the given angles from its center point, or optionally
@@ -7241,7 +7266,7 @@ declare namespace paper {
7241
7266
  * @param hor - the horizontal skew angle in degrees
7242
7267
  * @param ver - the vertical sskew angle in degrees
7243
7268
  */
7244
- skew(hor: number, ver: number, center?: Point): void
7269
+ skew(hor: number, ver: number, center?: PointLike): void
7245
7270
 
7246
7271
  /**
7247
7272
  * Transform the view.
@@ -7259,7 +7284,7 @@ declare namespace paper {
7259
7284
  *
7260
7285
  * @return the point converted into view coordinates
7261
7286
  */
7262
- projectToView(point: Point): Point
7287
+ projectToView(point: PointLike): Point
7263
7288
 
7264
7289
  /**
7265
7290
  * Converts the passed point from view coordinate space to project
@@ -7269,7 +7294,7 @@ declare namespace paper {
7269
7294
  *
7270
7295
  * @return the point converted into project coordinates
7271
7296
  */
7272
- viewToProject(point: Point): Point
7297
+ viewToProject(point: PointLike): Point
7273
7298
 
7274
7299
  /**
7275
7300
  * Determines and returns the event location in project coordinate space.