paper 0.12.16 → 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.
- package/CHANGELOG.md +7 -3
- package/dist/docs/assets/js/paper.js +6 -6
- package/dist/docs/classes/Color.html +1 -1
- package/dist/docs/classes/CompoundPath.html +1 -1
- package/dist/docs/classes/Curve.html +1 -1
- package/dist/docs/classes/CurveLocation.html +1 -1
- package/dist/docs/classes/Event.html +1 -1
- package/dist/docs/classes/Gradient.html +1 -1
- package/dist/docs/classes/GradientStop.html +1 -1
- package/dist/docs/classes/Group.html +1 -1
- package/dist/docs/classes/HitResult.html +1 -1
- package/dist/docs/classes/Item.html +1 -1
- package/dist/docs/classes/Key.html +1 -1
- package/dist/docs/classes/KeyEvent.html +1 -1
- package/dist/docs/classes/Layer.html +1 -1
- package/dist/docs/classes/Matrix.html +1 -1
- package/dist/docs/classes/MouseEvent.html +1 -1
- package/dist/docs/classes/PaperScope.html +1 -1
- package/dist/docs/classes/PaperScript.html +1 -1
- package/dist/docs/classes/Path.html +1 -1
- package/dist/docs/classes/PathItem.html +1 -1
- package/dist/docs/classes/Point.html +1 -1
- package/dist/docs/classes/PointText.html +1 -1
- package/dist/docs/classes/Project.html +1 -1
- package/dist/docs/classes/Raster.html +1 -1
- package/dist/docs/classes/Rectangle.html +1 -1
- package/dist/docs/classes/Segment.html +1 -1
- package/dist/docs/classes/Shape.html +1 -1
- package/dist/docs/classes/Size.html +1 -1
- package/dist/docs/classes/Style.html +1 -1
- package/dist/docs/classes/SymbolDefinition.html +1 -1
- package/dist/docs/classes/SymbolItem.html +1 -1
- package/dist/docs/classes/TextItem.html +1 -1
- package/dist/docs/classes/Tool.html +1 -1
- package/dist/docs/classes/ToolEvent.html +1 -1
- package/dist/docs/classes/Tween.html +1 -1
- package/dist/docs/classes/View.html +1 -1
- package/dist/docs/classes/global.html +1 -1
- package/dist/docs/classes/index.html +2 -2
- package/dist/docs/index.html +1 -1
- package/dist/paper-core.js +6 -6
- package/dist/paper-core.min.js +3 -3
- package/dist/paper-full.js +6 -6
- package/dist/paper-full.min.js +3 -3
- package/dist/paper.d.ts +167 -145
- package/package.json +1 -1
package/dist/paper.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Paper.js v0.12.
|
|
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: Thu
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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?:
|
|
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:
|
|
1840
|
+
contains(point: PointLike): boolean
|
|
1819
1841
|
|
|
1820
1842
|
/**
|
|
1821
1843
|
* @param rect - the rectangle to check against
|
|
1822
1844
|
*/
|
|
1823
|
-
isInside(rect:
|
|
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:
|
|
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:
|
|
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:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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:
|
|
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?:
|
|
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:
|
|
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?:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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?:
|
|
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?:
|
|
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:
|
|
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:
|
|
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?:
|
|
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:
|
|
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?:
|
|
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:
|
|
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:
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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 |
|
|
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:
|
|
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:
|
|
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?:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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 |
|
|
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:
|
|
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:
|
|
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,13 @@ declare namespace paper {
|
|
|
5496
5518
|
clear(): void
|
|
5497
5519
|
|
|
5498
5520
|
|
|
5499
|
-
createImageData(size:
|
|
5521
|
+
createImageData(size: SizeLike): ImageData
|
|
5500
5522
|
|
|
5501
5523
|
|
|
5502
|
-
getImageData(rect:
|
|
5524
|
+
getImageData(rect: RectangleLike): ImageData
|
|
5503
5525
|
|
|
5504
5526
|
|
|
5505
|
-
putImageData(data: ImageData, point:
|
|
5527
|
+
putImageData(data: ImageData, point: PointLike): void
|
|
5506
5528
|
|
|
5507
5529
|
|
|
5508
5530
|
setImageData(data: ImageData): void
|
|
@@ -5634,7 +5656,7 @@ declare namespace paper {
|
|
|
5634
5656
|
* @param point - the top-left point of the rectangle
|
|
5635
5657
|
* @param size - the size of the rectangle
|
|
5636
5658
|
*/
|
|
5637
|
-
constructor(point:
|
|
5659
|
+
constructor(point: PointLike, size: SizeLike)
|
|
5638
5660
|
|
|
5639
5661
|
/**
|
|
5640
5662
|
* Creates a rectangle object.
|
|
@@ -5652,12 +5674,12 @@ declare namespace paper {
|
|
|
5652
5674
|
* @param from - the first point defining the rectangle
|
|
5653
5675
|
* @param to - the second point defining the rectangle
|
|
5654
5676
|
*/
|
|
5655
|
-
constructor(from:
|
|
5677
|
+
constructor(from: PointLike, to: PointLike)
|
|
5656
5678
|
|
|
5657
5679
|
/**
|
|
5658
5680
|
* Creates a new rectangle object from the passed rectangle object.
|
|
5659
5681
|
*/
|
|
5660
|
-
constructor(rectangle:
|
|
5682
|
+
constructor(rectangle: RectangleLike)
|
|
5661
5683
|
|
|
5662
5684
|
/**
|
|
5663
5685
|
* Creates a Rectangle object.
|
|
@@ -5685,7 +5707,7 @@ declare namespace paper {
|
|
|
5685
5707
|
*
|
|
5686
5708
|
* @return true if the rectangles are equal
|
|
5687
5709
|
*/
|
|
5688
|
-
equals(rect:
|
|
5710
|
+
equals(rect: RectangleLike): boolean
|
|
5689
5711
|
|
|
5690
5712
|
/**
|
|
5691
5713
|
* @return a string representation of this rectangle
|
|
@@ -5704,7 +5726,7 @@ declare namespace paper {
|
|
|
5704
5726
|
*
|
|
5705
5727
|
* @return true if the point is inside the rectangle's boundary
|
|
5706
5728
|
*/
|
|
5707
|
-
contains(point:
|
|
5729
|
+
contains(point: PointLike): boolean
|
|
5708
5730
|
|
|
5709
5731
|
/**
|
|
5710
5732
|
* Tests if the interior of the rectangle entirely contains the specified
|
|
@@ -5715,7 +5737,7 @@ declare namespace paper {
|
|
|
5715
5737
|
* @return true if the rectangle entirely contains the specified
|
|
5716
5738
|
* rectangle
|
|
5717
5739
|
*/
|
|
5718
|
-
contains(rect:
|
|
5740
|
+
contains(rect: RectangleLike): boolean
|
|
5719
5741
|
|
|
5720
5742
|
/**
|
|
5721
5743
|
* Tests if the interior of this rectangle intersects the interior of
|
|
@@ -5730,7 +5752,7 @@ declare namespace paper {
|
|
|
5730
5752
|
* @return true if the rectangle and the specified rectangle
|
|
5731
5753
|
* intersect each other
|
|
5732
5754
|
*/
|
|
5733
|
-
intersects(rect:
|
|
5755
|
+
intersects(rect: RectangleLike, epsilon?: number): boolean
|
|
5734
5756
|
|
|
5735
5757
|
/**
|
|
5736
5758
|
* Returns a new rectangle representing the intersection of this rectangle
|
|
@@ -5742,7 +5764,7 @@ declare namespace paper {
|
|
|
5742
5764
|
* @return the largest rectangle contained in both the specified
|
|
5743
5765
|
* rectangle and in this rectangle
|
|
5744
5766
|
*/
|
|
5745
|
-
intersect(rect:
|
|
5767
|
+
intersect(rect: RectangleLike): Rectangle
|
|
5746
5768
|
|
|
5747
5769
|
/**
|
|
5748
5770
|
* Returns a new rectangle representing the union of this rectangle with the
|
|
@@ -5753,7 +5775,7 @@ declare namespace paper {
|
|
|
5753
5775
|
* @return the smallest rectangle containing both the specified
|
|
5754
5776
|
* rectangle and this rectangle
|
|
5755
5777
|
*/
|
|
5756
|
-
unite(rect:
|
|
5778
|
+
unite(rect: RectangleLike): Rectangle
|
|
5757
5779
|
|
|
5758
5780
|
/**
|
|
5759
5781
|
* Adds a point to this rectangle. The resulting rectangle is the smallest
|
|
@@ -5770,7 +5792,7 @@ declare namespace paper {
|
|
|
5770
5792
|
* @return the smallest rectangle that contains both the
|
|
5771
5793
|
* original rectangle and the specified point
|
|
5772
5794
|
*/
|
|
5773
|
-
include(point:
|
|
5795
|
+
include(point: PointLike): Rectangle
|
|
5774
5796
|
|
|
5775
5797
|
/**
|
|
5776
5798
|
* Returns a new rectangle expanded by the specified amount in horizontal
|
|
@@ -5781,7 +5803,7 @@ declare namespace paper {
|
|
|
5781
5803
|
*
|
|
5782
5804
|
* @return the expanded rectangle
|
|
5783
5805
|
*/
|
|
5784
|
-
expand(amount: number |
|
|
5806
|
+
expand(amount: number | SizeLike | PointLike): Rectangle
|
|
5785
5807
|
|
|
5786
5808
|
/**
|
|
5787
5809
|
* Returns a new rectangle expanded by the specified amounts in horizontal
|
|
@@ -5895,7 +5917,7 @@ declare namespace paper {
|
|
|
5895
5917
|
* anchor point of the segment that describes the out tangent of the
|
|
5896
5918
|
* segment
|
|
5897
5919
|
*/
|
|
5898
|
-
constructor(point?:
|
|
5920
|
+
constructor(point?: PointLike, handleIn?: PointLike, handleOut?: PointLike)
|
|
5899
5921
|
|
|
5900
5922
|
/**
|
|
5901
5923
|
* Creates a new Segment object.
|
|
@@ -6083,7 +6105,7 @@ declare namespace paper {
|
|
|
6083
6105
|
* @param center - the center point of the circle
|
|
6084
6106
|
* @param radius - the radius of the circle
|
|
6085
6107
|
*/
|
|
6086
|
-
constructor(center:
|
|
6108
|
+
constructor(center: PointLike, radius: number)
|
|
6087
6109
|
|
|
6088
6110
|
/**
|
|
6089
6111
|
* Creates a circular shape item from the properties described by an
|
|
@@ -6104,7 +6126,7 @@ declare namespace paper {
|
|
|
6104
6126
|
* geometry of the rectangular shape to be created
|
|
6105
6127
|
* @param radius - the size of the rounded corners
|
|
6106
6128
|
*/
|
|
6107
|
-
constructor(rectangle:
|
|
6129
|
+
constructor(rectangle: RectangleLike, radius?: SizeLike)
|
|
6108
6130
|
|
|
6109
6131
|
/**
|
|
6110
6132
|
* Creates a rectangular shape item from a point and a size object.
|
|
@@ -6112,7 +6134,7 @@ declare namespace paper {
|
|
|
6112
6134
|
* @param point - the rectangle's top-left corner.
|
|
6113
6135
|
* @param size - the rectangle's size.
|
|
6114
6136
|
*/
|
|
6115
|
-
constructor(point:
|
|
6137
|
+
constructor(point: PointLike, size: SizeLike)
|
|
6116
6138
|
|
|
6117
6139
|
/**
|
|
6118
6140
|
* Creates a rectangular shape item from the passed points. These do not
|
|
@@ -6122,7 +6144,7 @@ declare namespace paper {
|
|
|
6122
6144
|
* @param from - the first point defining the rectangle
|
|
6123
6145
|
* @param to - the second point defining the rectangle
|
|
6124
6146
|
*/
|
|
6125
|
-
constructor(from:
|
|
6147
|
+
constructor(from: PointLike, to: PointLike)
|
|
6126
6148
|
|
|
6127
6149
|
/**
|
|
6128
6150
|
* Creates a rectangular shape item from the properties described by an
|
|
@@ -6141,7 +6163,7 @@ declare namespace paper {
|
|
|
6141
6163
|
*
|
|
6142
6164
|
* @param rectangle - the rectangle circumscribing the ellipse
|
|
6143
6165
|
*/
|
|
6144
|
-
constructor(rectangle:
|
|
6166
|
+
constructor(rectangle: RectangleLike)
|
|
6145
6167
|
|
|
6146
6168
|
/**
|
|
6147
6169
|
* Creates an elliptical shape item from the properties described by an
|
|
@@ -6188,13 +6210,13 @@ declare namespace paper {
|
|
|
6188
6210
|
/**
|
|
6189
6211
|
* Creates a Size object using the coordinates of the given Size object.
|
|
6190
6212
|
*/
|
|
6191
|
-
constructor(size:
|
|
6213
|
+
constructor(size: SizeLike)
|
|
6192
6214
|
|
|
6193
6215
|
/**
|
|
6194
6216
|
* Creates a Size object using the {@link Point#x} and {@link Point#y}
|
|
6195
6217
|
* values of the given Point object.
|
|
6196
6218
|
*/
|
|
6197
|
-
constructor(point:
|
|
6219
|
+
constructor(point: PointLike)
|
|
6198
6220
|
|
|
6199
6221
|
/**
|
|
6200
6222
|
* Creates a Size object using the properties in the given object.
|
|
@@ -6214,7 +6236,7 @@ declare namespace paper {
|
|
|
6214
6236
|
*
|
|
6215
6237
|
* @param size - the size to compare to
|
|
6216
6238
|
*/
|
|
6217
|
-
equals(size:
|
|
6239
|
+
equals(size: SizeLike): boolean
|
|
6218
6240
|
|
|
6219
6241
|
/**
|
|
6220
6242
|
* Returns a copy of the size.
|
|
@@ -6244,7 +6266,7 @@ declare namespace paper {
|
|
|
6244
6266
|
*
|
|
6245
6267
|
* @return the addition of the two sizes as a new size
|
|
6246
6268
|
*/
|
|
6247
|
-
add(size:
|
|
6269
|
+
add(size: SizeLike): Size
|
|
6248
6270
|
|
|
6249
6271
|
/**
|
|
6250
6272
|
* Returns the subtraction of the supplied value from the width and height
|
|
@@ -6265,7 +6287,7 @@ declare namespace paper {
|
|
|
6265
6287
|
*
|
|
6266
6288
|
* @return the subtraction of the two sizes as a new size
|
|
6267
6289
|
*/
|
|
6268
|
-
subtract(size:
|
|
6290
|
+
subtract(size: SizeLike): Size
|
|
6269
6291
|
|
|
6270
6292
|
/**
|
|
6271
6293
|
* Returns the multiplication of the supplied value with the width and
|
|
@@ -6285,7 +6307,7 @@ declare namespace paper {
|
|
|
6285
6307
|
*
|
|
6286
6308
|
* @return the multiplication of the two sizes as a new size
|
|
6287
6309
|
*/
|
|
6288
|
-
multiply(size:
|
|
6310
|
+
multiply(size: SizeLike): Size
|
|
6289
6311
|
|
|
6290
6312
|
/**
|
|
6291
6313
|
* Returns the division of the supplied value by the width and height of the
|
|
@@ -6305,7 +6327,7 @@ declare namespace paper {
|
|
|
6305
6327
|
*
|
|
6306
6328
|
* @return the division of the two sizes as a new size
|
|
6307
6329
|
*/
|
|
6308
|
-
divide(size:
|
|
6330
|
+
divide(size: SizeLike): Size
|
|
6309
6331
|
|
|
6310
6332
|
/**
|
|
6311
6333
|
* The modulo operator returns the integer remainders of dividing the size
|
|
@@ -6323,7 +6345,7 @@ declare namespace paper {
|
|
|
6323
6345
|
* @return the integer remainders of dividing the sizes by each
|
|
6324
6346
|
* other as a new size
|
|
6325
6347
|
*/
|
|
6326
|
-
modulo(size:
|
|
6348
|
+
modulo(size: SizeLike): Size
|
|
6327
6349
|
|
|
6328
6350
|
/**
|
|
6329
6351
|
* Checks if this size has both the width and height set to 0.
|
|
@@ -6372,7 +6394,7 @@ declare namespace paper {
|
|
|
6372
6394
|
*
|
|
6373
6395
|
* @return the newly created size object
|
|
6374
6396
|
*/
|
|
6375
|
-
static min(size1:
|
|
6397
|
+
static min(size1: SizeLike, size2: SizeLike): Size
|
|
6376
6398
|
|
|
6377
6399
|
/**
|
|
6378
6400
|
* Returns a new size object with the largest {@link #width} and
|
|
@@ -6380,7 +6402,7 @@ declare namespace paper {
|
|
|
6380
6402
|
*
|
|
6381
6403
|
* @return the newly created size object
|
|
6382
6404
|
*/
|
|
6383
|
-
static max(size1:
|
|
6405
|
+
static max(size1: SizeLike, size2: SizeLike): Size
|
|
6384
6406
|
|
|
6385
6407
|
/**
|
|
6386
6408
|
* Returns a size object with random {@link #width} and {@link #height}
|
|
@@ -6558,7 +6580,7 @@ declare namespace paper {
|
|
|
6558
6580
|
*
|
|
6559
6581
|
* @param position - the position of the placed symbol
|
|
6560
6582
|
*/
|
|
6561
|
-
place(position?:
|
|
6583
|
+
place(position?: PointLike): SymbolItem
|
|
6562
6584
|
|
|
6563
6585
|
/**
|
|
6564
6586
|
* Returns a copy of the symbol.
|
|
@@ -6592,7 +6614,7 @@ declare namespace paper {
|
|
|
6592
6614
|
* item to place as a symbol
|
|
6593
6615
|
* @param point - the center point of the placed symbol
|
|
6594
6616
|
*/
|
|
6595
|
-
constructor(definition: SymbolDefinition | Item, point?:
|
|
6617
|
+
constructor(definition: SymbolDefinition | Item, point?: PointLike)
|
|
6596
6618
|
|
|
6597
6619
|
}
|
|
6598
6620
|
|
|
@@ -7174,7 +7196,7 @@ declare namespace paper {
|
|
|
7174
7196
|
*
|
|
7175
7197
|
* @param delta - the offset to translate the view by
|
|
7176
7198
|
*/
|
|
7177
|
-
translate(delta:
|
|
7199
|
+
translate(delta: PointLike): void
|
|
7178
7200
|
|
|
7179
7201
|
/**
|
|
7180
7202
|
* Rotates the view by a given angle around the given center point.
|
|
@@ -7185,7 +7207,7 @@ declare namespace paper {
|
|
|
7185
7207
|
*
|
|
7186
7208
|
* @param angle - the rotation angle
|
|
7187
7209
|
*/
|
|
7188
|
-
rotate(angle: number, center?:
|
|
7210
|
+
rotate(angle: number, center?: PointLike): void
|
|
7189
7211
|
|
|
7190
7212
|
/**
|
|
7191
7213
|
* Scales the view by the given value from its center point, or optionally
|
|
@@ -7193,7 +7215,7 @@ declare namespace paper {
|
|
|
7193
7215
|
*
|
|
7194
7216
|
* @param scale - the scale factor
|
|
7195
7217
|
*/
|
|
7196
|
-
scale(scale: number, center?:
|
|
7218
|
+
scale(scale: number, center?: PointLike): void
|
|
7197
7219
|
|
|
7198
7220
|
/**
|
|
7199
7221
|
* Scales the view by the given values from its center point, or optionally
|
|
@@ -7202,7 +7224,7 @@ declare namespace paper {
|
|
|
7202
7224
|
* @param hor - the horizontal scale factor
|
|
7203
7225
|
* @param ver - the vertical scale factor
|
|
7204
7226
|
*/
|
|
7205
|
-
scale(hor: number, ver: number, center?:
|
|
7227
|
+
scale(hor: number, ver: number, center?: PointLike): void
|
|
7206
7228
|
|
|
7207
7229
|
/**
|
|
7208
7230
|
* Shears the view by the given value from its center point, or optionally
|
|
@@ -7212,7 +7234,7 @@ declare namespace paper {
|
|
|
7212
7234
|
*
|
|
7213
7235
|
* @param shear - the horizontal and vertical shear factors as a point
|
|
7214
7236
|
*/
|
|
7215
|
-
shear(shear:
|
|
7237
|
+
shear(shear: PointLike, center?: PointLike): void
|
|
7216
7238
|
|
|
7217
7239
|
/**
|
|
7218
7240
|
* Shears the view by the given values from its center point, or optionally
|
|
@@ -7223,7 +7245,7 @@ declare namespace paper {
|
|
|
7223
7245
|
* @param hor - the horizontal shear factor
|
|
7224
7246
|
* @param ver - the vertical shear factor
|
|
7225
7247
|
*/
|
|
7226
|
-
shear(hor: number, ver: number, center?:
|
|
7248
|
+
shear(hor: number, ver: number, center?: PointLike): void
|
|
7227
7249
|
|
|
7228
7250
|
/**
|
|
7229
7251
|
* Skews the view by the given angles from its center point, or optionally
|
|
@@ -7233,7 +7255,7 @@ declare namespace paper {
|
|
|
7233
7255
|
*
|
|
7234
7256
|
* @param skew - the horizontal and vertical skew angles in degrees
|
|
7235
7257
|
*/
|
|
7236
|
-
skew(skew:
|
|
7258
|
+
skew(skew: PointLike, center?: PointLike): void
|
|
7237
7259
|
|
|
7238
7260
|
/**
|
|
7239
7261
|
* Skews the view by the given angles from its center point, or optionally
|
|
@@ -7244,7 +7266,7 @@ declare namespace paper {
|
|
|
7244
7266
|
* @param hor - the horizontal skew angle in degrees
|
|
7245
7267
|
* @param ver - the vertical sskew angle in degrees
|
|
7246
7268
|
*/
|
|
7247
|
-
skew(hor: number, ver: number, center?:
|
|
7269
|
+
skew(hor: number, ver: number, center?: PointLike): void
|
|
7248
7270
|
|
|
7249
7271
|
/**
|
|
7250
7272
|
* Transform the view.
|
|
@@ -7262,7 +7284,7 @@ declare namespace paper {
|
|
|
7262
7284
|
*
|
|
7263
7285
|
* @return the point converted into view coordinates
|
|
7264
7286
|
*/
|
|
7265
|
-
projectToView(point:
|
|
7287
|
+
projectToView(point: PointLike): Point
|
|
7266
7288
|
|
|
7267
7289
|
/**
|
|
7268
7290
|
* Converts the passed point from view coordinate space to project
|
|
@@ -7272,7 +7294,7 @@ declare namespace paper {
|
|
|
7272
7294
|
*
|
|
7273
7295
|
* @return the point converted into project coordinates
|
|
7274
7296
|
*/
|
|
7275
|
-
viewToProject(point:
|
|
7297
|
+
viewToProject(point: PointLike): Point
|
|
7276
7298
|
|
|
7277
7299
|
/**
|
|
7278
7300
|
* Determines and returns the event location in project coordinate space.
|