@shopify/react-native-skia 2.5.4 → 2.6.0
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/android/src/main/java/com/shopify/reactnative/skia/WebGPUViewManager.java +7 -7
- package/apple/{WebGPUView.h → SkiaWebGPUView.h} +1 -1
- package/apple/{WebGPUView.mm → SkiaWebGPUView.mm} +7 -7
- package/cpp/api/CustomBlendModes.h +1 -0
- package/cpp/api/JsiSkApi.h +4 -0
- package/cpp/api/JsiSkCanvas.h +2 -2
- package/cpp/api/JsiSkContourMeasureIter.h +1 -1
- package/cpp/api/JsiSkPath.h +483 -355
- package/cpp/api/JsiSkPathBuilder.h +415 -0
- package/cpp/api/JsiSkPathBuilderFactory.h +53 -0
- package/cpp/api/JsiSkPathEffectFactory.h +2 -2
- package/cpp/api/JsiSkPathFactory.h +274 -3
- package/cpp/api/recorder/DataTypes.h +1 -1
- package/cpp/api/recorder/Drawings.h +6 -2
- package/cpp/rnskia/RNDawnContext.h +21 -0
- package/cpp/rnskia/RNDawnUtils.h +115 -113
- package/lib/commonjs/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/commonjs/animation/functions/interpolatePaths.js +5 -4
- package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/commonjs/external/reanimated/interpolators.d.ts +11 -2
- package/lib/commonjs/external/reanimated/interpolators.js +21 -4
- package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
- package/lib/commonjs/skia/types/Path/PathBuilder.d.ts +201 -0
- package/lib/commonjs/skia/types/Path/PathBuilder.js +6 -0
- package/lib/commonjs/skia/types/Path/PathBuilder.js.map +1 -0
- package/lib/commonjs/skia/types/Path/PathBuilderFactory.d.ts +13 -0
- package/lib/commonjs/skia/types/Path/PathBuilderFactory.js +6 -0
- package/lib/commonjs/skia/types/Path/PathBuilderFactory.js.map +1 -0
- package/lib/commonjs/skia/types/Path/PathFactory.d.ts +87 -1
- package/lib/commonjs/skia/types/Path/PathFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Path/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Path/index.js +22 -0
- package/lib/commonjs/skia/types/Path/index.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.d.ts +2 -1
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/web/Host.js +1 -3
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +6 -2
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js +4 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.d.ts +42 -30
- package/lib/commonjs/skia/web/JsiSkPath.js +302 -111
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathBuilder.d.ts +45 -0
- package/lib/commonjs/skia/web/JsiSkPathBuilder.js +192 -0
- package/lib/commonjs/skia/web/JsiSkPathBuilder.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathBuilderFactory.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkPathBuilderFactory.js +26 -0
- package/lib/commonjs/skia/web/JsiSkPathBuilderFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +6 -2
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.d.ts +13 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js +140 -5
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +8 -1
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js +18 -6
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.d.ts +2 -2
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js +2 -3
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/WebGPUViewNativeComponent.d.ts +2 -2
- package/lib/commonjs/specs/WebGPUViewNativeComponent.js +2 -3
- package/lib/commonjs/specs/WebGPUViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/WebGPUViewNativeComponent.web.js +2 -0
- package/lib/commonjs/specs/WebGPUViewNativeComponent.web.js.map +1 -1
- package/lib/module/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/module/animation/functions/interpolatePaths.js +5 -4
- package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/module/external/reanimated/interpolators.d.ts +11 -2
- package/lib/module/external/reanimated/interpolators.js +21 -4
- package/lib/module/external/reanimated/interpolators.js.map +1 -1
- package/lib/module/skia/types/Path/PathBuilder.d.ts +201 -0
- package/lib/module/skia/types/Path/PathBuilder.js +2 -0
- package/lib/module/skia/types/Path/PathBuilder.js.map +1 -0
- package/lib/module/skia/types/Path/PathBuilderFactory.d.ts +13 -0
- package/lib/module/skia/types/Path/PathBuilderFactory.js +2 -0
- package/lib/module/skia/types/Path/PathBuilderFactory.js.map +1 -0
- package/lib/module/skia/types/Path/PathFactory.d.ts +87 -1
- package/lib/module/skia/types/Path/PathFactory.js.map +1 -1
- package/lib/module/skia/types/Path/index.d.ts +2 -0
- package/lib/module/skia/types/Path/index.js +2 -0
- package/lib/module/skia/types/Path/index.js.map +1 -1
- package/lib/module/skia/types/Skia.d.ts +2 -1
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/web/Host.js +1 -3
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +6 -2
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasure.js +4 -1
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.d.ts +42 -30
- package/lib/module/skia/web/JsiSkPath.js +300 -110
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathBuilder.d.ts +45 -0
- package/lib/module/skia/web/JsiSkPathBuilder.js +186 -0
- package/lib/module/skia/web/JsiSkPathBuilder.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathBuilderFactory.d.ts +9 -0
- package/lib/module/skia/web/JsiSkPathBuilderFactory.js +19 -0
- package/lib/module/skia/web/JsiSkPathBuilderFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +6 -2
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.d.ts +13 -1
- package/lib/module/skia/web/JsiSkPathFactory.js +141 -6
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +8 -1
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Drawing.js +18 -6
- package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/module/specs/SkiaPictureViewNativeComponent.d.ts +2 -2
- package/lib/module/specs/SkiaPictureViewNativeComponent.js +1 -1
- package/lib/module/specs/SkiaPictureViewNativeComponent.js.map +1 -1
- package/lib/module/specs/WebGPUViewNativeComponent.d.ts +2 -2
- package/lib/module/specs/WebGPUViewNativeComponent.js +2 -2
- package/lib/module/specs/WebGPUViewNativeComponent.js.map +1 -1
- package/lib/module/specs/WebGPUViewNativeComponent.web.js +2 -0
- package/lib/module/specs/WebGPUViewNativeComponent.web.js.map +1 -1
- package/lib/typescript/lib/commonjs/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/typescript/lib/commonjs/external/reanimated/interpolators.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/types/Path/PathBuilder.d.ts +1 -0
- package/lib/typescript/lib/commonjs/skia/types/Path/PathBuilderFactory.d.ts +1 -0
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPath.d.ts +33 -25
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPathBuilder.d.ts +46 -0
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPathBuilderFactory.d.ts +7 -0
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPathFactory.d.ts +12 -0
- package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +2 -0
- package/lib/typescript/lib/commonjs/specs/SkiaPictureViewNativeComponent.d.ts +2 -1
- package/lib/typescript/lib/commonjs/specs/WebGPUViewNativeComponent.d.ts +2 -1
- package/lib/typescript/lib/module/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/typescript/lib/module/external/reanimated/interpolators.d.ts +1 -1
- package/lib/typescript/lib/module/mock/index.d.ts +1 -1
- package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -0
- package/lib/typescript/lib/module/skia/types/Path/PathBuilder.d.ts +1 -0
- package/lib/typescript/lib/module/skia/types/Path/PathBuilderFactory.d.ts +1 -0
- package/lib/typescript/lib/module/skia/types/Path/index.d.ts +2 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPath.d.ts +38 -25
- package/lib/typescript/lib/module/skia/web/JsiSkPathBuilder.d.ts +45 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPathBuilderFactory.d.ts +6 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPathFactory.d.ts +12 -0
- package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +2 -0
- package/lib/typescript/lib/module/specs/SkiaPictureViewNativeComponent.d.ts +1 -1
- package/lib/typescript/lib/module/specs/WebGPUViewNativeComponent.d.ts +1 -1
- package/lib/typescript/src/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/typescript/src/external/reanimated/interpolators.d.ts +11 -2
- package/lib/typescript/src/skia/types/Path/PathBuilder.d.ts +201 -0
- package/lib/typescript/src/skia/types/Path/PathBuilderFactory.d.ts +13 -0
- package/lib/typescript/src/skia/types/Path/PathFactory.d.ts +87 -1
- package/lib/typescript/src/skia/types/Path/index.d.ts +2 -0
- package/lib/typescript/src/skia/types/Skia.d.ts +2 -1
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +42 -30
- package/lib/typescript/src/skia/web/JsiSkPathBuilder.d.ts +45 -0
- package/lib/typescript/src/skia/web/JsiSkPathBuilderFactory.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkPathFactory.d.ts +13 -1
- package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.d.ts +2 -2
- package/lib/typescript/src/specs/WebGPUViewNativeComponent.d.ts +2 -2
- package/package.json +4 -3
- package/scripts/install-libs.js +16 -6
- package/src/animation/functions/interpolatePaths.ts +5 -6
- package/src/external/reanimated/interpolators.ts +25 -5
- package/src/skia/types/Path/PathBuilder.ts +303 -0
- package/src/skia/types/Path/PathBuilderFactory.ts +15 -0
- package/src/skia/types/Path/PathFactory.ts +108 -1
- package/src/skia/types/Path/index.ts +2 -0
- package/src/skia/types/Skia.ts +2 -1
- package/src/skia/web/Host.ts +7 -1
- package/src/skia/web/JsiSkCanvas.ts +6 -6
- package/src/skia/web/JsiSkContourMeasure.ts +4 -4
- package/src/skia/web/JsiSkPath.ts +451 -168
- package/src/skia/web/JsiSkPathBuilder.ts +293 -0
- package/src/skia/web/JsiSkPathBuilderFactory.ts +32 -0
- package/src/skia/web/JsiSkPathEffectFactory.ts +6 -2
- package/src/skia/web/JsiSkPathFactory.ts +231 -8
- package/src/skia/web/JsiSkia.ts +11 -8
- package/src/sksg/Recorder/commands/Drawing.ts +20 -7
- package/src/specs/SkiaPictureViewNativeComponent.ts +1 -2
- package/src/specs/WebGPUViewNativeComponent.ts +3 -3
- package/src/specs/WebGPUViewNativeComponent.web.ts +2 -0
|
@@ -1,53 +1,66 @@
|
|
|
1
|
+
export function toMatrix3x3(m: any): any;
|
|
2
|
+
/**
|
|
3
|
+
* SkPath wraps a CK PathBuilder internally, providing both mutable building
|
|
4
|
+
* methods and immutable query methods. Use snapshot() internally to get
|
|
5
|
+
* an immutable CK Path for read-only operations.
|
|
6
|
+
*/
|
|
1
7
|
export class JsiSkPath extends HostObject {
|
|
8
|
+
/** Extract an immutable CK Path from a JsiSkPath value (for CK interop). */
|
|
9
|
+
static pathFromValue(value: any): any;
|
|
2
10
|
constructor(CanvasKit: any, ref: any);
|
|
11
|
+
/** Returns an immutable CK Path snapshot for read-only operations. */
|
|
12
|
+
asPath(): any;
|
|
3
13
|
addPath(src: any, matrix: any, extend?: boolean): this;
|
|
4
14
|
addArc(oval: any, startAngleInDegrees: any, sweepAngleInDegrees: any): this;
|
|
5
15
|
addOval(oval: any, isCCW: any, startIndex: any): this;
|
|
6
|
-
countPoints(): any;
|
|
7
16
|
addPoly(points: any, close: any): this;
|
|
17
|
+
addRect(rect: any, isCCW: any): this;
|
|
18
|
+
addRRect(rrect: any, isCCW: any): this;
|
|
19
|
+
addCircle(x: any, y: any, r: any): this;
|
|
8
20
|
moveTo(x: any, y: any): this;
|
|
9
|
-
lineTo(x: any, y: any): this;
|
|
10
|
-
makeAsWinding(): any;
|
|
11
|
-
offset(dx: any, dy: any): this;
|
|
12
|
-
rArcTo(rx: any, ry: any, xAxisRotateInDegrees: any, useSmallArc: any, isCCW: any, dx: any, dy: any): this;
|
|
13
|
-
rConicTo(dx1: any, dy1: any, dx2: any, dy2: any, w: any): this;
|
|
14
|
-
rCubicTo(cpx1: any, cpy1: any, cpx2: any, cpy2: any, x: any, y: any): this;
|
|
15
21
|
rMoveTo(x: any, y: any): this;
|
|
22
|
+
lineTo(x: any, y: any): this;
|
|
16
23
|
rLineTo(x: any, y: any): this;
|
|
24
|
+
quadTo(x1: any, y1: any, x2: any, y2: any): this;
|
|
17
25
|
rQuadTo(x1: any, y1: any, x2: any, y2: any): this;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
conicTo(x1: any, y1: any, x2: any, y2: any, w: any): this;
|
|
27
|
+
rConicTo(x1: any, y1: any, x2: any, y2: any, w: any): this;
|
|
28
|
+
cubicTo(cpx1: any, cpy1: any, cpx2: any, cpy2: any, x: any, y: any): this;
|
|
29
|
+
rCubicTo(cpx1: any, cpy1: any, cpx2: any, cpy2: any, x: any, y: any): this;
|
|
21
30
|
close(): this;
|
|
22
31
|
reset(): this;
|
|
23
32
|
rewind(): this;
|
|
24
|
-
computeTightBounds(): JsiSkRect;
|
|
25
33
|
arcToOval(oval: any, startAngleInDegrees: any, sweepAngleInDegrees: any, forceMoveTo: any): this;
|
|
26
34
|
arcToRotated(rx: any, ry: any, xAxisRotateInDegrees: any, useSmallArc: any, isCCW: any, x: any, y: any): this;
|
|
35
|
+
rArcTo(rx: any, ry: any, xAxisRotateInDegrees: any, useSmallArc: any, isCCW: any, dx: any, dy: any): this;
|
|
27
36
|
arcToTangent(x1: any, y1: any, x2: any, y2: any, radius: any): this;
|
|
28
|
-
|
|
37
|
+
setFillType(fill: any): this;
|
|
38
|
+
setIsVolatile(_volatile: any): this;
|
|
39
|
+
offset(dx: any, dy: any): this;
|
|
40
|
+
transform(m: any): this;
|
|
41
|
+
makeAsWinding(): this | null;
|
|
42
|
+
simplify(): boolean;
|
|
43
|
+
op(path: any, op: any): boolean;
|
|
44
|
+
dash(on: any, off: any, phase: any): boolean;
|
|
45
|
+
stroke(opts: any): this | null;
|
|
46
|
+
trim(start: any, stop: any, isComplement: any): this | null;
|
|
47
|
+
countPoints(): any;
|
|
48
|
+
computeTightBounds(): JsiSkRect;
|
|
29
49
|
contains(x: any, y: any): any;
|
|
30
50
|
copy(): JsiSkPath;
|
|
31
|
-
cubicTo(cpx1: any, cpy1: any, cpx2: any, cpy2: any, x: any, y: any): this;
|
|
32
|
-
dash(on: any, off: any, phase: any): any;
|
|
33
51
|
equals(other: any): any;
|
|
34
52
|
getBounds(): JsiSkRect;
|
|
35
53
|
getFillType(): any;
|
|
36
|
-
quadTo(x1: any, y1: any, x2: any, y2: any): this;
|
|
37
|
-
addRect(rect: any, isCCW: any): this;
|
|
38
|
-
addRRect(rrect: any, isCCW: any): this;
|
|
39
54
|
getPoint(index: any): JsiSkPoint;
|
|
40
55
|
isEmpty(): any;
|
|
41
|
-
isVolatile():
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
56
|
+
isVolatile(): boolean;
|
|
57
|
+
getLastPt(): {
|
|
58
|
+
x: any;
|
|
59
|
+
y: any;
|
|
60
|
+
};
|
|
46
61
|
toSVGString(): any;
|
|
47
|
-
trim(start: any, stop: any, isComplement: any): any;
|
|
48
|
-
transform(m: any): this;
|
|
49
|
-
interpolate(end: any, t: any, output: any): any;
|
|
50
62
|
isInterpolatable(path2: any): any;
|
|
63
|
+
interpolate(end: any, weight: any, output: any): any;
|
|
51
64
|
toCmds(): any;
|
|
52
65
|
}
|
|
53
66
|
import { HostObject } from "./Host";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web implementation of SkPathBuilder using CanvasKit's native PathBuilder.
|
|
3
|
+
*/
|
|
4
|
+
export class JsiSkPathBuilder extends HostObject {
|
|
5
|
+
constructor(CanvasKit: any, ref: any);
|
|
6
|
+
moveTo(x: any, y: any): this;
|
|
7
|
+
rMoveTo(x: any, y: any): this;
|
|
8
|
+
lineTo(x: any, y: any): this;
|
|
9
|
+
rLineTo(x: any, y: any): this;
|
|
10
|
+
quadTo(x1: any, y1: any, x2: any, y2: any): this;
|
|
11
|
+
rQuadTo(x1: any, y1: any, x2: any, y2: any): this;
|
|
12
|
+
conicTo(x1: any, y1: any, x2: any, y2: any, w: any): this;
|
|
13
|
+
rConicTo(x1: any, y1: any, x2: any, y2: any, w: any): this;
|
|
14
|
+
cubicTo(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): this;
|
|
15
|
+
rCubicTo(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): this;
|
|
16
|
+
close(): this;
|
|
17
|
+
arcToOval(oval: any, startAngleInDegrees: any, sweepAngleInDegrees: any, forceMoveTo: any): this;
|
|
18
|
+
arcToRotated(rx: any, ry: any, xAxisRotateInDegrees: any, useSmallArc: any, isCCW: any, x: any, y: any): this;
|
|
19
|
+
rArcTo(rx: any, ry: any, xAxisRotateInDegrees: any, useSmallArc: any, isCCW: any, dx: any, dy: any): this;
|
|
20
|
+
arcToTangent(x1: any, y1: any, x2: any, y2: any, radius: any): this;
|
|
21
|
+
addRect(rect: any, isCCW: any): this;
|
|
22
|
+
addOval(oval: any, isCCW: any, startIndex: any): this;
|
|
23
|
+
addArc(oval: any, startAngleInDegrees: any, sweepAngleInDegrees: any): this;
|
|
24
|
+
addRRect(rrect: any, isCCW: any): this;
|
|
25
|
+
addCircle(x: any, y: any, r: any, _isCCW: any): this;
|
|
26
|
+
addPoly(points: any, close: any): this;
|
|
27
|
+
addPath(src: any, matrix: any, extend?: boolean): this;
|
|
28
|
+
setFillType(fill: any): this;
|
|
29
|
+
setIsVolatile(_isVolatile: any): this;
|
|
30
|
+
reset(): this;
|
|
31
|
+
offset(dx: any, dy: any): this;
|
|
32
|
+
transform(m: any): this;
|
|
33
|
+
computeBounds(): JsiSkRect;
|
|
34
|
+
isEmpty(): any;
|
|
35
|
+
getLastPt(): {
|
|
36
|
+
x: any;
|
|
37
|
+
y: any;
|
|
38
|
+
};
|
|
39
|
+
countPoints(): any;
|
|
40
|
+
build(): JsiSkPath;
|
|
41
|
+
detach(): JsiSkPath;
|
|
42
|
+
}
|
|
43
|
+
import { HostObject } from "./Host";
|
|
44
|
+
import { JsiSkRect } from "./JsiSkRect";
|
|
45
|
+
import { JsiSkPath } from "./JsiSkPath";
|
|
@@ -4,6 +4,18 @@ export class JsiSkPathFactory extends Host {
|
|
|
4
4
|
MakeFromOp(one: any, two: any, op: any): JsiSkPath | null;
|
|
5
5
|
MakeFromCmds(cmds: any): JsiSkPath | null;
|
|
6
6
|
MakeFromText(_text: any, _x: any, _y: any, _font: any): jest.Mock<any, any, any>;
|
|
7
|
+
Rect(rect: any, isCCW: any): JsiSkPath;
|
|
8
|
+
Oval(rect: any, isCCW: any, startIndex: any): JsiSkPath;
|
|
9
|
+
Circle(x: any, y: any, r: any): JsiSkPath;
|
|
10
|
+
RRect(rrect: any, isCCW: any): JsiSkPath;
|
|
11
|
+
Line(p1: any, p2: any): JsiSkPath;
|
|
12
|
+
Polygon(points: any, close: any): JsiSkPath;
|
|
13
|
+
Stroke(srcPath: any, opts: any): JsiSkPath | null;
|
|
14
|
+
Trim(srcPath: any, start: any, end: any, isComplement: any): JsiSkPath | null;
|
|
15
|
+
Simplify(srcPath: any): JsiSkPath | null;
|
|
16
|
+
Dash(srcPath: any, on: any, off: any, phase: any): JsiSkPath | null;
|
|
17
|
+
AsWinding(srcPath: any): JsiSkPath | null;
|
|
18
|
+
Interpolate(start: any, end: any, weight: any): JsiSkPath | null;
|
|
7
19
|
}
|
|
8
20
|
import { Host } from "./Host";
|
|
9
21
|
import { JsiSkPath } from "./JsiSkPath";
|
|
@@ -10,6 +10,7 @@ export function JsiSkApi(CanvasKit: any): {
|
|
|
10
10
|
PictureRecorder: () => JsiSkPictureRecorder;
|
|
11
11
|
Picture: JsiSkPictureFactory;
|
|
12
12
|
Path: JsiSkPathFactory;
|
|
13
|
+
PathBuilder: JsiSkPathBuilderFactory;
|
|
13
14
|
Matrix: (matrix: any) => JsiSkMatrix;
|
|
14
15
|
ColorFilter: JsiSkColorFilterFactory;
|
|
15
16
|
Font: (typeface: any, size: any) => JsiSkFont;
|
|
@@ -46,6 +47,7 @@ import { JsiSkPaint } from "./JsiSkPaint";
|
|
|
46
47
|
import { JsiSkPictureRecorder } from "./JsiSkPictureRecorder";
|
|
47
48
|
import { JsiSkPictureFactory } from "./JsiSkPictureFactory";
|
|
48
49
|
import { JsiSkPathFactory } from "./JsiSkPathFactory";
|
|
50
|
+
import { JsiSkPathBuilderFactory } from "./JsiSkPathBuilderFactory";
|
|
49
51
|
import { JsiSkMatrix } from "./JsiSkMatrix";
|
|
50
52
|
import { JsiSkColorFilterFactory } from "./JsiSkColorFilterFactory";
|
|
51
53
|
import { JsiSkFont } from "./JsiSkFont";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("react-native
|
|
1
|
+
declare const _default: import("react-native").HostComponent<object>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("react-native
|
|
1
|
+
declare const _default: import("react-native").HostComponent<object>;
|
|
2
2
|
export default _default;
|
|
@@ -16,4 +16,4 @@ import type { ExtrapolationType } from "./interpolate";
|
|
|
16
16
|
* path2.lineTo(0, 100);
|
|
17
17
|
* const path = interpolatePath(0.5, [0, 1], [path1, path2]);
|
|
18
18
|
*/
|
|
19
|
-
export declare const interpolatePaths: (value: number, input: number[], outputRange: SkPath[], options?: ExtrapolationType,
|
|
19
|
+
export declare const interpolatePaths: (value: number, input: number[], outputRange: SkPath[], options?: ExtrapolationType, _output?: SkPath) => SkPath;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import type { ExtrapolationType, SharedValue } from "react-native-reanimated";
|
|
2
|
-
import type { SkPath, SkPoint } from "../../skia/types";
|
|
2
|
+
import type { SkPath, SkPathBuilder, SkPoint } from "../../skia/types";
|
|
3
3
|
export declare const notifyChange: <T>(value: SharedValue<T>) => void;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Hook for creating animated paths using PathBuilder.
|
|
6
|
+
* The callback receives a mutable PathBuilder that can be used to construct the path.
|
|
7
|
+
* The resulting immutable SkPath is stored in a shared value.
|
|
8
|
+
*
|
|
9
|
+
* @param cb - Callback that receives the PathBuilder to construct the path
|
|
10
|
+
* @param init - Optional initial path to add to the builder
|
|
11
|
+
* @param transform - Optional transform function applied to the built path
|
|
12
|
+
*/
|
|
13
|
+
export declare const usePathValue: (cb: (builder: SkPathBuilder) => void, init?: SkPath, transform?: (path: SkPath) => SkPath) => SharedValue<SkPath>;
|
|
5
14
|
export declare const useClock: () => SharedValue<number>;
|
|
6
15
|
export declare const usePathInterpolation: (value: SharedValue<number>, input: number[], outputRange: SkPath[], options?: ExtrapolationType) => SharedValue<SkPath>;
|
|
7
16
|
export declare const useVectorInterpolation: (value: SharedValue<number>, input: number[], outputRange: SkPoint[], options?: ExtrapolationType) => SharedValue<SkPoint>;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import type { SkRect } from "../Rect";
|
|
2
|
+
import type { SkPoint } from "../Point";
|
|
3
|
+
import type { InputRRect } from "../RRect";
|
|
4
|
+
import type { InputMatrix, SkMatrix } from "../Matrix";
|
|
5
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
|
6
|
+
import type { FillType, SkPath } from "./Path";
|
|
7
|
+
/**
|
|
8
|
+
* SkPathBuilder is a mutable builder for constructing SkPath objects.
|
|
9
|
+
* Once construction is complete, call build() or detach() to get the immutable SkPath.
|
|
10
|
+
*/
|
|
11
|
+
export interface SkPathBuilder extends SkJSIInstance<"PathBuilder"> {
|
|
12
|
+
/**
|
|
13
|
+
* Adds beginning of contour at point (x, y).
|
|
14
|
+
* @param x - x-axis value of contour start
|
|
15
|
+
* @param y - y-axis value of contour start
|
|
16
|
+
* @returns reference to this PathBuilder for chaining
|
|
17
|
+
*/
|
|
18
|
+
moveTo(x: number, y: number): SkPathBuilder;
|
|
19
|
+
/**
|
|
20
|
+
* Adds beginning of contour relative to the last point.
|
|
21
|
+
* @param x - offset from last point on x-axis
|
|
22
|
+
* @param y - offset from last point on y-axis
|
|
23
|
+
* @returns reference to this PathBuilder for chaining
|
|
24
|
+
*/
|
|
25
|
+
rMoveTo(x: number, y: number): SkPathBuilder;
|
|
26
|
+
/**
|
|
27
|
+
* Adds line from last point to (x, y).
|
|
28
|
+
* @param x - end of line on x-axis
|
|
29
|
+
* @param y - end of line on y-axis
|
|
30
|
+
* @returns reference to this PathBuilder for chaining
|
|
31
|
+
*/
|
|
32
|
+
lineTo(x: number, y: number): SkPathBuilder;
|
|
33
|
+
/**
|
|
34
|
+
* Adds line from last point, relative to last point.
|
|
35
|
+
* @param x - offset from last point on x-axis
|
|
36
|
+
* @param y - offset from last point on y-axis
|
|
37
|
+
* @returns reference to this PathBuilder for chaining
|
|
38
|
+
*/
|
|
39
|
+
rLineTo(x: number, y: number): SkPathBuilder;
|
|
40
|
+
/**
|
|
41
|
+
* Adds quad from last point towards (x1, y1), to (x2, y2).
|
|
42
|
+
*/
|
|
43
|
+
quadTo(x1: number, y1: number, x2: number, y2: number): SkPathBuilder;
|
|
44
|
+
/**
|
|
45
|
+
* Relative version of quadTo.
|
|
46
|
+
*/
|
|
47
|
+
rQuadTo(x1: number, y1: number, x2: number, y2: number): SkPathBuilder;
|
|
48
|
+
/**
|
|
49
|
+
* Adds conic from last point towards (x1, y1), to (x2, y2), weighted by w.
|
|
50
|
+
*/
|
|
51
|
+
conicTo(x1: number, y1: number, x2: number, y2: number, w: number): SkPathBuilder;
|
|
52
|
+
/**
|
|
53
|
+
* Relative version of conicTo.
|
|
54
|
+
*/
|
|
55
|
+
rConicTo(x1: number, y1: number, x2: number, y2: number, w: number): SkPathBuilder;
|
|
56
|
+
/**
|
|
57
|
+
* Adds cubic from last point towards (x1, y1), then towards (x2, y2), ending at (x3, y3).
|
|
58
|
+
*/
|
|
59
|
+
cubicTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): SkPathBuilder;
|
|
60
|
+
/**
|
|
61
|
+
* Relative version of cubicTo.
|
|
62
|
+
*/
|
|
63
|
+
rCubicTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): SkPathBuilder;
|
|
64
|
+
/**
|
|
65
|
+
* Appends CLOSE_VERB to the builder, connecting first and last points.
|
|
66
|
+
*/
|
|
67
|
+
close(): SkPathBuilder;
|
|
68
|
+
/**
|
|
69
|
+
* Appends arc to the builder. Arc is part of ellipse bounded by oval.
|
|
70
|
+
* @param oval - bounds of ellipse containing arc
|
|
71
|
+
* @param startAngleInDegrees - starting angle of arc in degrees
|
|
72
|
+
* @param sweepAngleInDegrees - sweep, in degrees. Positive is clockwise
|
|
73
|
+
* @param forceMoveTo - true to start a new contour with arc
|
|
74
|
+
*/
|
|
75
|
+
arcToOval(oval: SkRect, startAngleInDegrees: number, sweepAngleInDegrees: number, forceMoveTo: boolean): SkPathBuilder;
|
|
76
|
+
/**
|
|
77
|
+
* Appends arc to the builder with SVG-style parameters.
|
|
78
|
+
* @param rx - x-radius of ellipse
|
|
79
|
+
* @param ry - y-radius of ellipse
|
|
80
|
+
* @param xAxisRotateInDegrees - rotation of ellipse
|
|
81
|
+
* @param useSmallArc - if true, use smaller of two arcs
|
|
82
|
+
* @param isCCW - if true, arc sweeps counter-clockwise
|
|
83
|
+
* @param x - end point x
|
|
84
|
+
* @param y - end point y
|
|
85
|
+
*/
|
|
86
|
+
arcToRotated(rx: number, ry: number, xAxisRotateInDegrees: number, useSmallArc: boolean, isCCW: boolean, x: number, y: number): SkPathBuilder;
|
|
87
|
+
/**
|
|
88
|
+
* Relative version of arcToRotated.
|
|
89
|
+
*/
|
|
90
|
+
rArcTo(rx: number, ry: number, xAxisRotateInDegrees: number, useSmallArc: boolean, isCCW: boolean, dx: number, dy: number): SkPathBuilder;
|
|
91
|
+
/**
|
|
92
|
+
* Appends arc to the builder, tangent to two lines.
|
|
93
|
+
* @param x1 - x of first tangent point
|
|
94
|
+
* @param y1 - y of first tangent point
|
|
95
|
+
* @param x2 - x of second tangent point
|
|
96
|
+
* @param y2 - y of second tangent point
|
|
97
|
+
* @param radius - arc radius
|
|
98
|
+
*/
|
|
99
|
+
arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number): SkPathBuilder;
|
|
100
|
+
/**
|
|
101
|
+
* Adds Rect to the builder.
|
|
102
|
+
* @param rect - rectangle to add
|
|
103
|
+
* @param isCCW - if true, draws counter-clockwise
|
|
104
|
+
*/
|
|
105
|
+
addRect(rect: SkRect, isCCW?: boolean): SkPathBuilder;
|
|
106
|
+
/**
|
|
107
|
+
* Adds oval to the builder.
|
|
108
|
+
* @param oval - bounds of ellipse
|
|
109
|
+
* @param isCCW - if true, draws counter-clockwise
|
|
110
|
+
* @param startIndex - index of initial point
|
|
111
|
+
*/
|
|
112
|
+
addOval(oval: SkRect, isCCW?: boolean, startIndex?: number): SkPathBuilder;
|
|
113
|
+
/**
|
|
114
|
+
* Appends arc to the builder as a new contour.
|
|
115
|
+
* @param oval - bounds of ellipse
|
|
116
|
+
* @param startAngleInDegrees - starting angle
|
|
117
|
+
* @param sweepAngleInDegrees - sweep angle
|
|
118
|
+
*/
|
|
119
|
+
addArc(oval: SkRect, startAngleInDegrees: number, sweepAngleInDegrees: number): SkPathBuilder;
|
|
120
|
+
/**
|
|
121
|
+
* Adds rounded rectangle to the builder.
|
|
122
|
+
* @param rrect - rounded rectangle to add
|
|
123
|
+
* @param isCCW - if true, draws counter-clockwise
|
|
124
|
+
*/
|
|
125
|
+
addRRect(rrect: InputRRect, isCCW?: boolean): SkPathBuilder;
|
|
126
|
+
/**
|
|
127
|
+
* Adds circle to the builder.
|
|
128
|
+
* @param x - center x
|
|
129
|
+
* @param y - center y
|
|
130
|
+
* @param r - radius
|
|
131
|
+
* @param isCCW - if true, draws counter-clockwise
|
|
132
|
+
*/
|
|
133
|
+
addCircle(x: number, y: number, r: number, isCCW?: boolean): SkPathBuilder;
|
|
134
|
+
/**
|
|
135
|
+
* Adds polygon to the builder from array of points.
|
|
136
|
+
* @param points - array of points
|
|
137
|
+
* @param close - if true, close the polygon
|
|
138
|
+
*/
|
|
139
|
+
addPoly(points: SkPoint[], close: boolean): SkPathBuilder;
|
|
140
|
+
/**
|
|
141
|
+
* Adds the path to the builder.
|
|
142
|
+
* @param src - path to add
|
|
143
|
+
* @param matrix - optional transform matrix
|
|
144
|
+
* @param extend - if true, extend rather than append
|
|
145
|
+
*/
|
|
146
|
+
addPath(src: SkPath, matrix?: SkMatrix, extend?: boolean): SkPathBuilder;
|
|
147
|
+
/**
|
|
148
|
+
* Sets the fill type for the path.
|
|
149
|
+
* @param fill - fill type to set
|
|
150
|
+
*/
|
|
151
|
+
setFillType(fill: FillType): SkPathBuilder;
|
|
152
|
+
/**
|
|
153
|
+
* Sets whether the path is volatile (temporary/animating).
|
|
154
|
+
* @param isVolatile - true if path will be altered frequently
|
|
155
|
+
*/
|
|
156
|
+
setIsVolatile(isVolatile: boolean): SkPathBuilder;
|
|
157
|
+
/**
|
|
158
|
+
* Resets the builder to empty state.
|
|
159
|
+
*/
|
|
160
|
+
reset(): SkPathBuilder;
|
|
161
|
+
/**
|
|
162
|
+
* Translates all points in the builder.
|
|
163
|
+
* @param dx - translation in x
|
|
164
|
+
* @param dy - translation in y
|
|
165
|
+
*/
|
|
166
|
+
offset(dx: number, dy: number): SkPathBuilder;
|
|
167
|
+
/**
|
|
168
|
+
* Transforms all points in the builder by the matrix.
|
|
169
|
+
* @param m - transformation matrix
|
|
170
|
+
*/
|
|
171
|
+
transform(m: InputMatrix): SkPathBuilder;
|
|
172
|
+
/**
|
|
173
|
+
* Returns the bounds of the path being built.
|
|
174
|
+
*/
|
|
175
|
+
computeBounds(): SkRect;
|
|
176
|
+
/**
|
|
177
|
+
* Returns true if the builder has no verbs.
|
|
178
|
+
*/
|
|
179
|
+
isEmpty(): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Returns the last point added to the builder.
|
|
182
|
+
*/
|
|
183
|
+
getLastPt(): {
|
|
184
|
+
x: number;
|
|
185
|
+
y: number;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Returns the number of points in the builder.
|
|
189
|
+
*/
|
|
190
|
+
countPoints(): number;
|
|
191
|
+
/**
|
|
192
|
+
* Returns a new SkPath with the current builder state.
|
|
193
|
+
* The builder is NOT reset and can continue to be used.
|
|
194
|
+
*/
|
|
195
|
+
build(): SkPath;
|
|
196
|
+
/**
|
|
197
|
+
* Returns a new SkPath with the current builder state and resets the builder.
|
|
198
|
+
* More efficient than build() when you're done with this builder.
|
|
199
|
+
*/
|
|
200
|
+
detach(): SkPath;
|
|
201
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SkPath } from "./Path";
|
|
2
|
+
import type { SkPathBuilder } from "./PathBuilder";
|
|
3
|
+
export interface PathBuilderFactory {
|
|
4
|
+
/**
|
|
5
|
+
* Creates a new empty PathBuilder.
|
|
6
|
+
*/
|
|
7
|
+
Make(): SkPathBuilder;
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new PathBuilder initialized with the given path's contents.
|
|
10
|
+
* @param path - path to copy into the builder
|
|
11
|
+
*/
|
|
12
|
+
MakeFromPath(path: SkPath): SkPathBuilder;
|
|
13
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { SkFont } from "../Font";
|
|
2
|
-
import type {
|
|
2
|
+
import type { SkRect } from "../Rect";
|
|
3
|
+
import type { SkPoint } from "../Point";
|
|
4
|
+
import type { InputRRect } from "../RRect";
|
|
5
|
+
import type { SkPath, PathOp, PathCommand, StrokeOpts } from "./Path";
|
|
3
6
|
export interface PathFactory {
|
|
4
7
|
Make(): SkPath;
|
|
5
8
|
/**
|
|
@@ -26,4 +29,87 @@ export interface PathFactory {
|
|
|
26
29
|
* Converts the text to a path with the given font at location x / y.
|
|
27
30
|
*/
|
|
28
31
|
MakeFromText(text: string, x: number, y: number, font: SkFont): SkPath | null;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a path containing a rectangle.
|
|
34
|
+
* @param rect - the rectangle
|
|
35
|
+
* @param isCCW - if true, draws counter-clockwise
|
|
36
|
+
*/
|
|
37
|
+
Rect(rect: SkRect, isCCW?: boolean): SkPath;
|
|
38
|
+
/**
|
|
39
|
+
* Creates a path containing an oval (ellipse).
|
|
40
|
+
* @param rect - bounds of the oval
|
|
41
|
+
* @param isCCW - if true, draws counter-clockwise
|
|
42
|
+
* @param startIndex - index of initial point
|
|
43
|
+
*/
|
|
44
|
+
Oval(rect: SkRect, isCCW?: boolean, startIndex?: number): SkPath;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a path containing a circle.
|
|
47
|
+
* @param x - center x
|
|
48
|
+
* @param y - center y
|
|
49
|
+
* @param r - radius
|
|
50
|
+
*/
|
|
51
|
+
Circle(x: number, y: number, r: number): SkPath;
|
|
52
|
+
/**
|
|
53
|
+
* Creates a path containing a rounded rectangle.
|
|
54
|
+
* @param rrect - the rounded rectangle
|
|
55
|
+
* @param isCCW - if true, draws counter-clockwise
|
|
56
|
+
*/
|
|
57
|
+
RRect(rrect: InputRRect, isCCW?: boolean): SkPath;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a path containing a line segment.
|
|
60
|
+
* @param p1 - start point
|
|
61
|
+
* @param p2 - end point
|
|
62
|
+
*/
|
|
63
|
+
Line(p1: SkPoint, p2: SkPoint): SkPath;
|
|
64
|
+
/**
|
|
65
|
+
* Creates a path containing a polygon from the given points.
|
|
66
|
+
* @param points - array of points
|
|
67
|
+
* @param close - if true, close the polygon
|
|
68
|
+
*/
|
|
69
|
+
Polygon(points: SkPoint[], close: boolean): SkPath;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a new stroked path from the input path.
|
|
72
|
+
* @param path - source path to stroke
|
|
73
|
+
* @param opts - stroke options (width, cap, join, miter_limit, precision)
|
|
74
|
+
* @returns stroked path or null if operation fails
|
|
75
|
+
*/
|
|
76
|
+
Stroke(path: SkPath, opts?: StrokeOpts): SkPath | null;
|
|
77
|
+
/**
|
|
78
|
+
* Creates a trimmed path from the input path.
|
|
79
|
+
* @param path - source path
|
|
80
|
+
* @param start - start of trim (0-1)
|
|
81
|
+
* @param end - end of trim (0-1)
|
|
82
|
+
* @param isComplement - if true, returns the complement
|
|
83
|
+
* @returns trimmed path or null if operation fails
|
|
84
|
+
*/
|
|
85
|
+
Trim(path: SkPath, start: number, end: number, isComplement: boolean): SkPath | null;
|
|
86
|
+
/**
|
|
87
|
+
* Simplifies the path to non-overlapping contours.
|
|
88
|
+
* @param path - source path
|
|
89
|
+
* @returns simplified path or null if operation fails
|
|
90
|
+
*/
|
|
91
|
+
Simplify(path: SkPath): SkPath | null;
|
|
92
|
+
/**
|
|
93
|
+
* Creates a dashed version of the path.
|
|
94
|
+
* @param path - source path
|
|
95
|
+
* @param on - length of dash
|
|
96
|
+
* @param off - length of gap
|
|
97
|
+
* @param phase - offset into dash pattern
|
|
98
|
+
* @returns dashed path or null if operation fails
|
|
99
|
+
*/
|
|
100
|
+
Dash(path: SkPath, on: number, off: number, phase: number): SkPath | null;
|
|
101
|
+
/**
|
|
102
|
+
* Creates a path with Winding fill type.
|
|
103
|
+
* @param path - source path
|
|
104
|
+
* @returns path with winding fill or null if operation fails
|
|
105
|
+
*/
|
|
106
|
+
AsWinding(path: SkPath): SkPath | null;
|
|
107
|
+
/**
|
|
108
|
+
* Interpolates between two paths.
|
|
109
|
+
* @param start - starting path
|
|
110
|
+
* @param end - ending path
|
|
111
|
+
* @param weight - interpolation weight (0 = start, 1 = end)
|
|
112
|
+
* @returns interpolated path or null if paths are not interpolatable
|
|
113
|
+
*/
|
|
114
|
+
Interpolate(start: SkPath, end: SkPath, weight: number): SkPath | null;
|
|
29
115
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ImageFilterFactory } from "./ImageFilter";
|
|
2
|
-
import type { PathFactory } from "./Path";
|
|
2
|
+
import type { PathFactory, PathBuilderFactory } from "./Path";
|
|
3
3
|
import type { ColorFilterFactory } from "./ColorFilter";
|
|
4
4
|
import type { SkFont, FontMgrFactory } from "./Font";
|
|
5
5
|
import type { SkTypeface, TypefaceFactory } from "./Typeface";
|
|
@@ -50,6 +50,7 @@ export interface Skia {
|
|
|
50
50
|
PictureRecorder: () => SkPictureRecorder;
|
|
51
51
|
Picture: PictureFactory;
|
|
52
52
|
Path: PathFactory;
|
|
53
|
+
PathBuilder: PathBuilderFactory;
|
|
53
54
|
Matrix: (matrix?: readonly number[]) => SkMatrix;
|
|
54
55
|
ColorFilter: ColorFilterFactory;
|
|
55
56
|
Font: (typeface?: SkTypeface, size?: number) => SkFont;
|
|
@@ -1,57 +1,69 @@
|
|
|
1
|
-
import type { CanvasKit,
|
|
1
|
+
import type { CanvasKit, PathBuilder as CKPathBuilder } from "canvaskit-wasm";
|
|
2
2
|
import type { FillType, PathCommand, PathOp, SkMatrix, SkPath, SkPoint, SkRect, InputRRect, StrokeOpts, InputMatrix } from "../types";
|
|
3
3
|
import { HostObject } from "./Host";
|
|
4
|
-
import { JsiSkPoint } from "./JsiSkPoint";
|
|
5
4
|
import { JsiSkRect } from "./JsiSkRect";
|
|
6
|
-
export declare
|
|
7
|
-
|
|
5
|
+
export declare const toMatrix3x3: (m: InputMatrix) => number[];
|
|
6
|
+
/**
|
|
7
|
+
* SkPath wraps a CK PathBuilder internally, providing both mutable building
|
|
8
|
+
* methods and immutable query methods. Use snapshot() internally to get
|
|
9
|
+
* an immutable CK Path for read-only operations.
|
|
10
|
+
*/
|
|
11
|
+
export declare class JsiSkPath extends HostObject<CKPathBuilder, "Path"> implements SkPath {
|
|
12
|
+
constructor(CanvasKit: CanvasKit, ref: CKPathBuilder);
|
|
13
|
+
/** Returns an immutable CK Path snapshot for read-only operations. */
|
|
14
|
+
private asPath;
|
|
15
|
+
/** Extract an immutable CK Path from a JsiSkPath value (for CK interop). */
|
|
16
|
+
static pathFromValue(value: SkPath): import("canvaskit-wasm").Path;
|
|
8
17
|
addPath(src: SkPath, matrix?: SkMatrix, extend?: boolean): this;
|
|
9
18
|
addArc(oval: SkRect, startAngleInDegrees: number, sweepAngleInDegrees: number): this;
|
|
10
19
|
addOval(oval: SkRect, isCCW?: boolean, startIndex?: number): this;
|
|
11
|
-
countPoints(): number;
|
|
12
20
|
addPoly(points: SkPoint[], close: boolean): this;
|
|
21
|
+
addRect(rect: SkRect, isCCW?: boolean): this;
|
|
22
|
+
addRRect(rrect: InputRRect, isCCW?: boolean): this;
|
|
23
|
+
addCircle(x: number, y: number, r: number): this;
|
|
13
24
|
moveTo(x: number, y: number): this;
|
|
14
|
-
lineTo(x: number, y: number): this;
|
|
15
|
-
makeAsWinding(): this | null;
|
|
16
|
-
offset(dx: number, dy: number): this;
|
|
17
|
-
rArcTo(rx: number, ry: number, xAxisRotateInDegrees: number, useSmallArc: boolean, isCCW: boolean, dx: number, dy: number): this;
|
|
18
|
-
rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number): this;
|
|
19
|
-
rCubicTo(cpx1: number, cpy1: number, cpx2: number, cpy2: number, x: number, y: number): this;
|
|
20
25
|
rMoveTo(x: number, y: number): this;
|
|
26
|
+
lineTo(x: number, y: number): this;
|
|
21
27
|
rLineTo(x: number, y: number): this;
|
|
28
|
+
quadTo(x1: number, y1: number, x2: number, y2: number): this;
|
|
22
29
|
rQuadTo(x1: number, y1: number, x2: number, y2: number): this;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
conicTo(x1: number, y1: number, x2: number, y2: number, w: number): this;
|
|
31
|
+
rConicTo(x1: number, y1: number, x2: number, y2: number, w: number): this;
|
|
32
|
+
cubicTo(cpx1: number, cpy1: number, cpx2: number, cpy2: number, x: number, y: number): this;
|
|
33
|
+
rCubicTo(cpx1: number, cpy1: number, cpx2: number, cpy2: number, x: number, y: number): this;
|
|
26
34
|
close(): this;
|
|
27
35
|
reset(): this;
|
|
28
36
|
rewind(): this;
|
|
29
|
-
computeTightBounds(): SkRect;
|
|
30
37
|
arcToOval(oval: SkRect, startAngleInDegrees: number, sweepAngleInDegrees: number, forceMoveTo: boolean): this;
|
|
31
38
|
arcToRotated(rx: number, ry: number, xAxisRotateInDegrees: number, useSmallArc: boolean, isCCW: boolean, x: number, y: number): this;
|
|
39
|
+
rArcTo(rx: number, ry: number, xAxisRotateInDegrees: number, useSmallArc: boolean, isCCW: boolean, dx: number, dy: number): this;
|
|
32
40
|
arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number): this;
|
|
33
|
-
|
|
41
|
+
setFillType(fill: FillType): this;
|
|
42
|
+
setIsVolatile(_volatile: boolean): this;
|
|
43
|
+
offset(dx: number, dy: number): this;
|
|
44
|
+
transform(m: InputMatrix): this;
|
|
45
|
+
makeAsWinding(): this | null;
|
|
46
|
+
simplify(): boolean;
|
|
47
|
+
op(path: SkPath, op: PathOp): boolean;
|
|
48
|
+
dash(on: number, off: number, phase: number): boolean;
|
|
49
|
+
stroke(opts?: StrokeOpts): this | null;
|
|
50
|
+
trim(start: number, stop: number, isComplement: boolean): this | null;
|
|
51
|
+
countPoints(): number;
|
|
52
|
+
computeTightBounds(): SkRect;
|
|
34
53
|
contains(x: number, y: number): boolean;
|
|
35
54
|
copy(): JsiSkPath;
|
|
36
|
-
cubicTo(cpx1: number, cpy1: number, cpx2: number, cpy2: number, x: number, y: number): this;
|
|
37
|
-
dash(on: number, off: number, phase: number): boolean;
|
|
38
55
|
equals(other: SkPath): boolean;
|
|
39
56
|
getBounds(): JsiSkRect;
|
|
40
|
-
getFillType():
|
|
41
|
-
|
|
42
|
-
addRect(rect: SkRect, isCCW?: boolean): this;
|
|
43
|
-
addRRect(rrect: InputRRect, isCCW?: boolean): this;
|
|
44
|
-
getPoint(index: number): JsiSkPoint;
|
|
57
|
+
getFillType(): FillType;
|
|
58
|
+
getPoint(index: number): SkPoint;
|
|
45
59
|
isEmpty(): boolean;
|
|
46
60
|
isVolatile(): boolean;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
getLastPt(): {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
};
|
|
51
65
|
toSVGString(): string;
|
|
52
|
-
trim(start: number, stop: number, isComplement: boolean): this | null;
|
|
53
|
-
transform(m: InputMatrix): this;
|
|
54
|
-
interpolate(end: SkPath, t: number, output?: SkPath): SkPath | JsiSkPath | null;
|
|
55
66
|
isInterpolatable(path2: SkPath): boolean;
|
|
67
|
+
interpolate(end: SkPath, weight: number, output?: SkPath): SkPath | null;
|
|
56
68
|
toCmds(): PathCommand[];
|
|
57
69
|
}
|