@shopify/react-native-skia 0.1.224 → 0.1.227

Sign up to get free protection for your applications and to get access to all the features.
Files changed (245) hide show
  1. package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h +3 -3
  2. package/cpp/api/JsiSkMatrix.h +8 -2
  3. package/cpp/api/JsiSkParagraphStyle.h +3 -2
  4. package/cpp/api/JsiSkPictureRecorder.h +10 -3
  5. package/cpp/api/JsiSkStrutStyle.h +10 -3
  6. package/cpp/rnskia/dom/props/MatrixProp.h +8 -0
  7. package/cpp/rnskia/dom/props/TransformProp.h +76 -9
  8. package/lib/commonjs/animation/spring/runSpring.d.ts +3 -0
  9. package/lib/commonjs/animation/spring/runSpring.js +3 -0
  10. package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
  11. package/lib/commonjs/animation/spring/useSpring.d.ts +3 -0
  12. package/lib/commonjs/animation/spring/useSpring.js +3 -0
  13. package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
  14. package/lib/commonjs/animation/timing/runTiming.d.ts +3 -0
  15. package/lib/commonjs/animation/timing/runTiming.js +3 -0
  16. package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
  17. package/lib/commonjs/animation/timing/useLoop.d.ts +3 -0
  18. package/lib/commonjs/animation/timing/useLoop.js +3 -0
  19. package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
  20. package/lib/commonjs/animation/timing/useTiming.d.ts +3 -0
  21. package/lib/commonjs/animation/timing/useTiming.js +3 -0
  22. package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
  23. package/lib/commonjs/dom/nodes/JsiSkDOM.js +2 -0
  24. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  25. package/lib/commonjs/dom/nodes/datatypes/Fitting.d.ts +5 -5
  26. package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
  27. package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +235 -75
  28. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
  29. package/lib/commonjs/dom/types/Common.d.ts +3 -3
  30. package/lib/commonjs/dom/types/Common.js.map +1 -1
  31. package/lib/commonjs/external/reanimated/interpolators.js +10 -4
  32. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
  33. package/lib/commonjs/renderer/Canvas.js +34 -28
  34. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  35. package/lib/commonjs/renderer/components/Drawing.d.ts +5 -0
  36. package/lib/commonjs/renderer/components/Drawing.js +5 -0
  37. package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
  38. package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +5 -5
  39. package/lib/commonjs/skia/core/Matrix.d.ts +2 -2
  40. package/lib/commonjs/skia/core/Matrix.js.map +1 -1
  41. package/lib/commonjs/skia/core/Picture.d.ts +2 -2
  42. package/lib/commonjs/skia/core/Picture.js +12 -2
  43. package/lib/commonjs/skia/core/Picture.js.map +1 -1
  44. package/lib/commonjs/skia/core/Vector.d.ts +3 -3
  45. package/lib/commonjs/skia/core/Vector.js.map +1 -1
  46. package/lib/commonjs/skia/types/Canvas.d.ts +1 -1
  47. package/lib/commonjs/skia/types/Canvas.js.map +1 -1
  48. package/lib/commonjs/skia/types/Matrix.d.ts +4 -9
  49. package/lib/commonjs/skia/types/Matrix.js +5 -56
  50. package/lib/commonjs/skia/types/Matrix.js.map +1 -1
  51. package/lib/commonjs/skia/types/Matrix4.d.ts +39 -0
  52. package/lib/commonjs/skia/types/Matrix4.js +213 -0
  53. package/lib/commonjs/skia/types/Matrix4.js.map +1 -0
  54. package/lib/commonjs/skia/types/Path/Path.d.ts +1 -1
  55. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  56. package/lib/commonjs/skia/types/Picture/PictureRecorder.d.ts +1 -1
  57. package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
  58. package/lib/commonjs/skia/types/Rect.d.ts +1 -0
  59. package/lib/commonjs/skia/types/Rect.js +18 -0
  60. package/lib/commonjs/skia/types/Rect.js.map +1 -1
  61. package/lib/commonjs/skia/types/index.d.ts +1 -0
  62. package/lib/commonjs/skia/types/index.js +13 -0
  63. package/lib/commonjs/skia/types/index.js.map +1 -1
  64. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -1
  65. package/lib/commonjs/skia/web/JsiSkCanvas.js +1 -1
  66. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  67. package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +1 -1
  68. package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
  69. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  70. package/lib/commonjs/skia/web/JsiSkPath.js +1 -1
  71. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  72. package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  73. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +1 -1
  74. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  75. package/lib/commonjs/values/api.d.ts +23 -2
  76. package/lib/commonjs/values/api.js +44 -1
  77. package/lib/commonjs/values/api.js.map +1 -1
  78. package/lib/commonjs/values/hooks/useClockValue.d.ts +3 -0
  79. package/lib/commonjs/values/hooks/useClockValue.js +3 -0
  80. package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
  81. package/lib/commonjs/values/hooks/useComputedValue.d.ts +3 -0
  82. package/lib/commonjs/values/hooks/useComputedValue.js +3 -0
  83. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  84. package/lib/commonjs/values/hooks/useValue.d.ts +3 -0
  85. package/lib/commonjs/values/hooks/useValue.js +3 -0
  86. package/lib/commonjs/values/hooks/useValue.js.map +1 -1
  87. package/lib/commonjs/values/hooks/useValueEffect.d.ts +3 -0
  88. package/lib/commonjs/values/hooks/useValueEffect.js +3 -0
  89. package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
  90. package/lib/commonjs/values/types.d.ts +4 -4
  91. package/lib/commonjs/values/types.js.map +1 -1
  92. package/lib/commonjs/views/SkiaView.d.ts +5 -0
  93. package/lib/commonjs/views/SkiaView.js +9 -0
  94. package/lib/commonjs/views/SkiaView.js.map +1 -1
  95. package/lib/module/animation/spring/runSpring.d.ts +3 -0
  96. package/lib/module/animation/spring/runSpring.js +3 -0
  97. package/lib/module/animation/spring/runSpring.js.map +1 -1
  98. package/lib/module/animation/spring/useSpring.d.ts +3 -0
  99. package/lib/module/animation/spring/useSpring.js +3 -0
  100. package/lib/module/animation/spring/useSpring.js.map +1 -1
  101. package/lib/module/animation/timing/runTiming.d.ts +3 -0
  102. package/lib/module/animation/timing/runTiming.js +3 -0
  103. package/lib/module/animation/timing/runTiming.js.map +1 -1
  104. package/lib/module/animation/timing/useLoop.d.ts +3 -0
  105. package/lib/module/animation/timing/useLoop.js +3 -0
  106. package/lib/module/animation/timing/useLoop.js.map +1 -1
  107. package/lib/module/animation/timing/useTiming.d.ts +3 -0
  108. package/lib/module/animation/timing/useTiming.js +3 -0
  109. package/lib/module/animation/timing/useTiming.js.map +1 -1
  110. package/lib/module/dom/nodes/JsiSkDOM.js +2 -0
  111. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  112. package/lib/module/dom/nodes/datatypes/Fitting.d.ts +5 -5
  113. package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
  114. package/lib/module/dom/nodes/datatypes/Gradient.d.ts +235 -75
  115. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  116. package/lib/module/dom/types/Common.d.ts +3 -3
  117. package/lib/module/dom/types/Common.js.map +1 -1
  118. package/lib/module/external/reanimated/interpolators.js +11 -5
  119. package/lib/module/external/reanimated/interpolators.js.map +1 -1
  120. package/lib/module/renderer/Canvas.js +35 -29
  121. package/lib/module/renderer/Canvas.js.map +1 -1
  122. package/lib/module/renderer/components/Drawing.d.ts +5 -0
  123. package/lib/module/renderer/components/Drawing.js +6 -0
  124. package/lib/module/renderer/components/Drawing.js.map +1 -1
  125. package/lib/module/renderer/components/shapes/FitBox.d.ts +5 -5
  126. package/lib/module/skia/core/Matrix.d.ts +2 -2
  127. package/lib/module/skia/core/Matrix.js.map +1 -1
  128. package/lib/module/skia/core/Picture.d.ts +2 -2
  129. package/lib/module/skia/core/Picture.js +12 -3
  130. package/lib/module/skia/core/Picture.js.map +1 -1
  131. package/lib/module/skia/core/Vector.d.ts +3 -3
  132. package/lib/module/skia/core/Vector.js.map +1 -1
  133. package/lib/module/skia/types/Canvas.d.ts +1 -1
  134. package/lib/module/skia/types/Canvas.js.map +1 -1
  135. package/lib/module/skia/types/Matrix.d.ts +4 -9
  136. package/lib/module/skia/types/Matrix.js +3 -57
  137. package/lib/module/skia/types/Matrix.js.map +1 -1
  138. package/lib/module/skia/types/Matrix4.d.ts +39 -0
  139. package/lib/module/skia/types/Matrix4.js +200 -0
  140. package/lib/module/skia/types/Matrix4.js.map +1 -0
  141. package/lib/module/skia/types/Path/Path.d.ts +1 -1
  142. package/lib/module/skia/types/Path/Path.js.map +1 -1
  143. package/lib/module/skia/types/Picture/PictureRecorder.d.ts +1 -1
  144. package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
  145. package/lib/module/skia/types/Rect.d.ts +1 -0
  146. package/lib/module/skia/types/Rect.js +9 -0
  147. package/lib/module/skia/types/Rect.js.map +1 -1
  148. package/lib/module/skia/types/index.d.ts +1 -0
  149. package/lib/module/skia/types/index.js +1 -0
  150. package/lib/module/skia/types/index.js.map +1 -1
  151. package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -1
  152. package/lib/module/skia/web/JsiSkCanvas.js +1 -1
  153. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  154. package/lib/module/skia/web/JsiSkMatrix.d.ts +1 -1
  155. package/lib/module/skia/web/JsiSkMatrix.js +1 -1
  156. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  157. package/lib/module/skia/web/JsiSkPath.js +1 -1
  158. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  159. package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  160. package/lib/module/skia/web/JsiSkPictureRecorder.js +1 -1
  161. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  162. package/lib/module/values/api.d.ts +23 -2
  163. package/lib/module/values/api.js +44 -1
  164. package/lib/module/values/api.js.map +1 -1
  165. package/lib/module/values/hooks/useClockValue.d.ts +3 -0
  166. package/lib/module/values/hooks/useClockValue.js +3 -0
  167. package/lib/module/values/hooks/useClockValue.js.map +1 -1
  168. package/lib/module/values/hooks/useComputedValue.d.ts +3 -0
  169. package/lib/module/values/hooks/useComputedValue.js +3 -0
  170. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  171. package/lib/module/values/hooks/useValue.d.ts +3 -0
  172. package/lib/module/values/hooks/useValue.js +3 -0
  173. package/lib/module/values/hooks/useValue.js.map +1 -1
  174. package/lib/module/values/hooks/useValueEffect.d.ts +3 -0
  175. package/lib/module/values/hooks/useValueEffect.js +3 -0
  176. package/lib/module/values/hooks/useValueEffect.js.map +1 -1
  177. package/lib/module/values/types.d.ts +4 -4
  178. package/lib/module/values/types.js.map +1 -1
  179. package/lib/module/views/SkiaView.d.ts +5 -0
  180. package/lib/module/views/SkiaView.js +10 -0
  181. package/lib/module/views/SkiaView.js.map +1 -1
  182. package/lib/typescript/src/animation/spring/runSpring.d.ts +3 -0
  183. package/lib/typescript/src/animation/spring/useSpring.d.ts +3 -0
  184. package/lib/typescript/src/animation/timing/runTiming.d.ts +3 -0
  185. package/lib/typescript/src/animation/timing/useLoop.d.ts +3 -0
  186. package/lib/typescript/src/animation/timing/useTiming.d.ts +3 -0
  187. package/lib/typescript/src/dom/nodes/datatypes/Fitting.d.ts +5 -5
  188. package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +235 -75
  189. package/lib/typescript/src/dom/types/Common.d.ts +3 -3
  190. package/lib/typescript/src/renderer/components/Drawing.d.ts +5 -0
  191. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +5 -5
  192. package/lib/typescript/src/skia/core/Matrix.d.ts +2 -2
  193. package/lib/typescript/src/skia/core/Picture.d.ts +2 -2
  194. package/lib/typescript/src/skia/core/Vector.d.ts +3 -3
  195. package/lib/typescript/src/skia/types/Canvas.d.ts +1 -1
  196. package/lib/typescript/src/skia/types/Matrix.d.ts +4 -9
  197. package/lib/typescript/src/skia/types/Matrix4.d.ts +39 -0
  198. package/lib/typescript/src/skia/types/Path/Path.d.ts +1 -1
  199. package/lib/typescript/src/skia/types/Picture/PictureRecorder.d.ts +1 -1
  200. package/lib/typescript/src/skia/types/Rect.d.ts +1 -0
  201. package/lib/typescript/src/skia/types/index.d.ts +1 -0
  202. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -1
  203. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +1 -1
  204. package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  205. package/lib/typescript/src/values/api.d.ts +23 -2
  206. package/lib/typescript/src/values/hooks/useClockValue.d.ts +3 -0
  207. package/lib/typescript/src/values/hooks/useComputedValue.d.ts +3 -0
  208. package/lib/typescript/src/values/hooks/useValue.d.ts +3 -0
  209. package/lib/typescript/src/values/hooks/useValueEffect.d.ts +3 -0
  210. package/lib/typescript/src/values/types.d.ts +4 -4
  211. package/lib/typescript/src/views/SkiaView.d.ts +5 -0
  212. package/package.json +1 -1
  213. package/src/animation/spring/runSpring.ts +3 -0
  214. package/src/animation/spring/useSpring.ts +3 -0
  215. package/src/animation/timing/runTiming.ts +3 -0
  216. package/src/animation/timing/useLoop.ts +3 -0
  217. package/src/animation/timing/useTiming.ts +3 -0
  218. package/src/dom/nodes/JsiSkDOM.ts +4 -0
  219. package/src/dom/nodes/datatypes/Fitting.ts +10 -2
  220. package/src/dom/nodes/datatypes/Gradient.ts +2 -2
  221. package/src/dom/types/Common.ts +3 -3
  222. package/src/external/reanimated/interpolators.ts +14 -6
  223. package/src/renderer/Canvas.tsx +41 -30
  224. package/src/renderer/components/Drawing.tsx +5 -0
  225. package/src/skia/core/Matrix.ts +2 -2
  226. package/src/skia/core/Picture.ts +11 -3
  227. package/src/skia/core/Vector.ts +5 -2
  228. package/src/skia/types/Canvas.ts +1 -1
  229. package/src/skia/types/Matrix.ts +7 -74
  230. package/src/skia/types/Matrix4.ts +266 -0
  231. package/src/skia/types/Path/Path.ts +1 -1
  232. package/src/skia/types/Picture/PictureRecorder.ts +1 -1
  233. package/src/skia/types/Rect.ts +14 -0
  234. package/src/skia/types/index.ts +1 -0
  235. package/src/skia/web/JsiSkCanvas.ts +2 -2
  236. package/src/skia/web/JsiSkMatrix.ts +4 -2
  237. package/src/skia/web/JsiSkPath.ts +1 -1
  238. package/src/skia/web/JsiSkPictureRecorder.ts +6 -2
  239. package/src/values/api.ts +55 -2
  240. package/src/values/hooks/useClockValue.ts +3 -0
  241. package/src/values/hooks/useComputedValue.ts +3 -0
  242. package/src/values/hooks/useValue.ts +3 -0
  243. package/src/values/hooks/useValueEffect.ts +3 -0
  244. package/src/values/types.ts +6 -6
  245. package/src/views/SkiaView.tsx +11 -0
@@ -1 +1 @@
1
- {"version":3,"names":["FillType","PathOp","PathVerb","isPath","obj","__typename__"],"sources":["Path.ts"],"sourcesContent":["import type { SkRect } from \"../Rect\";\nimport type { SkPoint } from \"../Point\";\nimport type { SkRRect } from \"../RRect\";\nimport type { StrokeJoin, StrokeCap } from \"../Paint\";\nimport type { SkMatrix } from \"../Matrix\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\n\n/**\n * Options used for Path.stroke(). If an option is omitted, a sensible default will be used.\n */\nexport interface StrokeOpts {\n /** The width of the stroked lines. */\n width?: number;\n miter_limit?: number;\n /**\n * if > 1, increase precision, else if (0 < resScale < 1) reduce precision to\n * favor speed and size\n */\n precision?: number;\n join?: StrokeJoin;\n cap?: StrokeCap;\n}\n\nexport enum FillType {\n Winding,\n EvenOdd,\n InverseWinding,\n InverseEvenOdd,\n}\n\nexport enum PathOp {\n Difference, //!< subtract the op path from the first path\n Intersect, //!< intersect the two paths\n Union, //!< union (inclusive-or) the two paths\n XOR, //!< exclusive-or the two paths\n ReverseDifference,\n}\n\nexport enum PathVerb {\n Move,\n Line,\n Quad,\n Conic,\n Cubic,\n Close,\n}\n\nexport type PathCommand = number[];\n\nexport const isPath = (obj: SkJSIInstance<string> | null): obj is SkPath =>\n obj !== null && obj.__typename__ === \"Path\";\n\nexport interface SkPath extends SkJSIInstance<\"Path\"> {\n /**\n * Appends arc to Path, as the start of new contour. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngle\n * @param sweepAngle\n */\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ): SkPath;\n\n /**\n * Adds oval to Path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.\n * Oval is upright ellipse bounded by Rect oval with radii equal to half oval width\n * and half oval height. Oval begins at start and continues clockwise by default.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param isCCW - if the path should be drawn counter-clockwise or not\n * @param startIndex - index of initial point of ellipse\n */\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number): SkPath;\n\n /**\n * Returns the number of points in this path. Initially zero.\n */\n countPoints(): number;\n\n /**\n * Adds contour created from array of n points, adding (count - 1) line segments.\n * Contour added starts at pts[0], then adds a line for every additional point\n * in pts array. If close is true, appends kClose_Verb to Path, connecting\n * pts[count - 1] and pts[0].\n * Returns the modified path for easier chaining.\n * @param points\n * @param close - if true, will add a line connecting last point to the first point.\n */\n addPoly(points: SkPoint[], close: boolean): SkPath;\n\n /** Adds beginning of contour at SkPoint (x, y).\n\n @param x x-axis value of contour start\n @param y y-axis value of contour start\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_moveTo\n */\n moveTo(x: number, y: number): SkPath;\n /** Adds line from last point to (x, y). If SkPath is empty, or last SkPath::Verb is\n kClose_Verb, last point is set to (0, 0) before adding line.\n\n lineTo() appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed.\n lineTo() then appends kLine_Verb to verb array and (x, y) to SkPoint array.\n\n @param x end of added line on x-axis\n @param y end of added line on y-axis\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_lineTo\n */\n lineTo(x: number, y: number): SkPath;\n\n /**\n * Returns a new path that covers the same area as the original path, but with the\n * Winding FillType. This may re-draw some contours in the path as counter-clockwise\n * instead of clockwise to achieve that effect. If such a transformation cannot\n * be done, null is returned.\n */\n makeAsWinding(): SkPath | null;\n\n /**\n * Translates all the points in the path by dx, dy.\n * @param dx\n * @param dy\n */\n offset(dx: number, dy: number): SkPath;\n\n /**\n * Relative version of arcToRotated.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param dx\n * @param dy\n */\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ): SkPath;\n\n /**\n * Relative version of conicTo.\n * @param dx1\n * @param dy1\n * @param dx2\n * @param dy2\n * @param w\n */\n rConicTo(\n dx1: number,\n dy1: number,\n dx2: number,\n dy2: number,\n w: number\n ): SkPath;\n\n /**\n * Relative version of cubicTo.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Relative version of moveTo.\n * @param x\n * @param y\n */\n rMoveTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of lineTo.\n * @param x\n * @param y\n */\n rLineTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of quadTo.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\n rQuadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Sets FillType, the rule used to fill Path.\n * @param fill\n */\n setFillType(fill: FillType): SkPath;\n\n /**\n * Specifies whether Path is volatile; whether it will be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false.\n *\n * Mark animating or temporary paths as volatile to improve performance.\n * Mark unchanging Path non-volatile to improve repeated rendering.\n * @param volatile\n */\n setIsVolatile(volatile: boolean): SkPath;\n\n /**\n * Turns this path into the filled equivalent of the stroked path. Returns false if the operation\n * fails (e.g. the path is a hairline).\n * @param opts - describe how stroked path should look.\n * If such a transformation cannot be done, null is returned.\n */\n stroke(opts?: StrokeOpts): null | SkPath;\n\n /**\n * Appends CLOSE_VERB to Path. A closed contour connects the first and last point\n * with a line, forming a continuous loop.\n */\n close(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is released\n */\n reset(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is *not* released.\n * Use rewind() instead of reset() if Path storage will be reused and performance\n * is critical.\n */\n rewind(): SkPath;\n\n /**\n * Returns minimum and maximum axes values of the lines and curves in Path.\n * Returns (0, 0, 0, 0) if Path contains no points.\n * Returned bounds width and height may be larger or smaller than area affected\n * when Path is drawn.\n *\n * Behaves identically to getBounds() when Path contains\n * only lines. If Path contains curves, computed bounds includes\n * the maximum extent of the quad, conic, or cubic; is slower than getBounds();\n * and unlike getBounds(), does not cache the result.\n */\n computeTightBounds(): SkRect;\n\n /**\n * Appends arc to Path. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngleInDegrees\n * @param sweepAngleInDegrees\n * @param forceMoveTo\n */\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ): SkPath;\n\n /**\n * Appends arc to Path. Arc is implemented by one or more conics weighted to\n * describe part of oval with radii (rx, ry) rotated by xAxisRotate degrees. Arc\n * curves from last Path Point to (x, y), choosing one of four possible routes:\n * clockwise or counterclockwise, and smaller or larger. See SkPath.h for more details.\n * Returns the modified path for easier chaining.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param x\n * @param y\n */\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Appends arc to Path, after appending line if needed. Arc is implemented by conic\n * weighted to describe part of circle. Arc is contained by tangent from\n * last Path point to (x1, y1), and tangent from (x1, y1) to (x2, y2). Arc\n * is part of circle sized to radius, positioned so it touches both tangent lines.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param radius\n */\n arcToTangent(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n radius: number\n ): SkPath;\n\n /**\n * Adds conic from last point towards (x1, y1), to (x2, y2), weighted by w.\n * If Path is empty, or path is closed, the last point is set to (0, 0)\n * before adding conic.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param w\n */\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number): SkPath;\n\n /**\n * Returns true if the point (x, y) is contained by Path, taking into\n * account FillType.\n * @param x\n * @param y\n */\n contains(x: number, y: number): boolean;\n\n /**\n * Returns a copy of this Path.\n */\n copy(): SkPath;\n\n /**\n * Adds cubic from last point towards (x1, y1), then towards (x2, y2), ending at\n * (x3, y3). If Path is empty, or path is closed, the last point is set to\n * (0, 0) before adding cubic.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Changes this path to be the dashed version of itself. This is the same effect as creating\n * a DashPathEffect and calling filterPath on this path.\n * @param on\n * @param off\n * @param phase\n */\n dash(on: number, off: number, phase: number): boolean;\n\n /**\n * Returns true if other path is equal to this path.\n * @param other\n */\n equals(other: SkPath): boolean;\n\n /**\n * Returns minimum and maximum axes values of Point array.\n * Returns (0, 0, 0, 0) if Path contains no points. Returned bounds width and height may\n * be larger or smaller than area affected when Path is drawn.\n */\n getBounds(): SkRect;\n\n /**\n * Return the FillType for this path.\n */\n getFillType(): FillType;\n\n /**\n Adds quad from last point towards (x1, y1), to (x2, y2).\n\n If SkPath is empty, or last SkPath::Verb is kClose_Verb, last point is set to (0, 0) before adding quad.\n\n Appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed; then appends kQuad_Verb to verb array;\n and (x1, y1), (x2, y2) to SkPoint array.\n\n Parameters\n x1\tcontrol SkPoint of quad on x-axis\n y1\tcontrol SkPoint of quad on y-axis\n x2\tend SkPoint of quad on x-axis\n y2\tend SkPoint of quad on y-axis\n Returns\n reference to SkPath\n example: https://fiddle.skia.org/c/@Path_quadTo\n */\n quadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Adds Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb,\n * starting with top-left corner of Rect; followed by top-right, bottom-right,\n * and bottom-left if isCCW is false; or followed by bottom-left,\n * bottom-right, and top-right if isCCW is true.\n * Returns the modified path for easier chaining.\n * @param rect\n * @param isCCW\n */\n addRect(rect: SkRect, isCCW?: boolean): SkPath;\n\n /**\n * Adds rrect to Path, creating a new closed contour.\n * Returns the modified path for easier chaining.\n * @param rrect\n * @param isCCW\n */\n addRRect(rrect: SkRRect, isCCW?: boolean): SkPath;\n\n /** Appends src to SkPath, transformed by matrix. Transformed curves may have\n different verbs, SkPoint, and conic weights.\n\n If mode is kAppend_AddPathMode, src verb array, SkPoint array, and conic\n weights are added unaltered. If mode is kExtend_AddPathMode, add line\n before appending verbs, SkPoint, and conic weights.\n\n @param src SkPath verbs, SkPoint, and conic weights to add\n @param matrix transform applied to src\n @param extend extends path with line if true\n @return reference to SkPath\n */\n addPath(src: SkPath, matrix?: SkMatrix, extend?: boolean): SkPath;\n\n /**\n * Returns the Point at index in Point array. Valid range for index is\n * 0 to countPoints() - 1.\n * @param index\n */\n getPoint(index: number): SkPoint;\n\n /**\n * Returns true if there are no verbs in the path.\n */\n isEmpty(): boolean;\n\n /**\n * Returns true if the path is volatile; it will not be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false, allowing\n * Surface to attach a cache of data which speeds repeated drawing. If true, Surface\n * may not speed repeated drawing.\n */\n isVolatile(): boolean;\n\n /** Adds circle centered at (x, y) of size radius to SkPath, appending kMove_Verb,\n four kConic_Verb, and kClose_Verb. Circle begins at: (x + radius, y), continuing\n clockwise if dir is kCW_Direction, and counterclockwise if dir is kCCW_Direction.\n\n Has no effect if radius is zero or negative.\n\n @param x center of circle\n @param y center of circle\n @param radius distance from center to edge \n @return reference to SkPath\n */\n addCircle(x: number, y: number, r: number): SkPath;\n\n getLastPt(): { x: number; y: number };\n\n /** Set this path to the result of applying the Op to this path and the\n specified path: this = (this op operand).\n The resulting path will be constructed from non-overlapping contours.\n The curve order is reduced where possible so that cubics may be turned\n into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param path The second path (for difference, the subtrahend)\n @param op The operator to apply.\n @param result The product of the operands. The result may be one of the\n inputs.\n @return True if the operation succeeded.\n */\n op(path: SkPath, op: PathOp): boolean;\n\n /** Set this path to a set of non-overlapping contours that describe the\n same area as the original path.\n The curve order is reduced where possible so that cubics may\n be turned into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param result The simplified path. The result may be the input.\n @return True if simplification succeeded.\n */\n simplify(): boolean;\n\n /**\n * Returns this path as an SVG string.\n */\n toSVGString(): string;\n\n /**\n * Take start and stop \"t\" values (values between 0...1), and modify this path such that\n * it is a subset of the original path.\n * The trim values apply to the entire path, so if it contains several contours, all of them\n * are including in the calculation.\n * Null is returned if either input value is NaN.\n * @param startT - a value in the range [0.0, 1.0]. 0.0 is the beginning of the path.\n * @param stopT - a value in the range [0.0, 1.0]. 1.0 is the end of the path.\n * @param isComplement\n */\n trim(startT: number, stopT: number, isComplement: boolean): null | SkPath;\n\n /**\n * Transforms the path by the specified matrix.\n */\n transform(m3: SkMatrix): SkPath;\n\n /**\n * Interpolates between Path with point array of equal size.\n * Copy verb array and weights to result, and set result path to a weighted\n * average of this path array and ending path.\n\n * weight is most useful when between zero (ending path) and\n one (this path); will work with values outside of this\n range.\n\n * interpolate() returns undefined if path is not\n * the same size as ending path. Call isInterpolatable() to check Path\n * compatibility prior to calling interpolate().\n\n * @param ending path to interpolate with\n * @param weight contribution of this path, and\n * one minus contribution of ending path\n * @param output path to be replaced with the interpolated averages\n * @return Path replaced by interpolated averages or null if \n * not interpolatable\n * */\n interpolate(end: SkPath, weight: number, output?: SkPath): SkPath | null;\n\n /** Returns true if Path contain equal verbs and equal weights.\n * @param compare path to compare\n * @return true if Path can be interpolated equivalent\n *\n * */\n isInterpolatable(compare: SkPath): boolean;\n\n /**\n * Serializes the contents of this path as a series of commands.\n */\n toCmds(): PathCommand[];\n}\n"],"mappings":"AAOA;AACA;AACA;AAcA,WAAYA,QAAZ;;WAAYA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;GAAAA,Q,KAAAA,Q;;AAOZ,WAAYC,MAAZ;;WAAYA,M;EAAAA,M,CAAAA,M;EAAAA,M,CAAAA,M;EAAAA,M,CAAAA,M;EAAAA,M,CAAAA,M;EAAAA,M,CAAAA,M;GAAAA,M,KAAAA,M;;AAQZ,WAAYC,QAAZ;;WAAYA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;GAAAA,Q,KAAAA,Q;;AAWZ,OAAO,MAAMC,MAAM,GAAIC,GAAD,IACpBA,GAAG,KAAK,IAAR,IAAgBA,GAAG,CAACC,YAAJ,KAAqB,MADhC"}
1
+ {"version":3,"names":["FillType","PathOp","PathVerb","isPath","obj","__typename__"],"sources":["Path.ts"],"sourcesContent":["import type { SkRect } from \"../Rect\";\nimport type { SkPoint } from \"../Point\";\nimport type { SkRRect } from \"../RRect\";\nimport type { StrokeJoin, StrokeCap } from \"../Paint\";\nimport type { SkMatrix } from \"../Matrix\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\n\n/**\n * Options used for Path.stroke(). If an option is omitted, a sensible default will be used.\n */\nexport interface StrokeOpts {\n /** The width of the stroked lines. */\n width?: number;\n miter_limit?: number;\n /**\n * if > 1, increase precision, else if (0 < resScale < 1) reduce precision to\n * favor speed and size\n */\n precision?: number;\n join?: StrokeJoin;\n cap?: StrokeCap;\n}\n\nexport enum FillType {\n Winding,\n EvenOdd,\n InverseWinding,\n InverseEvenOdd,\n}\n\nexport enum PathOp {\n Difference, //!< subtract the op path from the first path\n Intersect, //!< intersect the two paths\n Union, //!< union (inclusive-or) the two paths\n XOR, //!< exclusive-or the two paths\n ReverseDifference,\n}\n\nexport enum PathVerb {\n Move,\n Line,\n Quad,\n Conic,\n Cubic,\n Close,\n}\n\nexport type PathCommand = number[];\n\nexport const isPath = (obj: SkJSIInstance<string> | null): obj is SkPath =>\n obj !== null && obj.__typename__ === \"Path\";\n\nexport interface SkPath extends SkJSIInstance<\"Path\"> {\n /**\n * Appends arc to Path, as the start of new contour. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngle\n * @param sweepAngle\n */\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ): SkPath;\n\n /**\n * Adds oval to Path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.\n * Oval is upright ellipse bounded by Rect oval with radii equal to half oval width\n * and half oval height. Oval begins at start and continues clockwise by default.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param isCCW - if the path should be drawn counter-clockwise or not\n * @param startIndex - index of initial point of ellipse\n */\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number): SkPath;\n\n /**\n * Returns the number of points in this path. Initially zero.\n */\n countPoints(): number;\n\n /**\n * Adds contour created from array of n points, adding (count - 1) line segments.\n * Contour added starts at pts[0], then adds a line for every additional point\n * in pts array. If close is true, appends kClose_Verb to Path, connecting\n * pts[count - 1] and pts[0].\n * Returns the modified path for easier chaining.\n * @param points\n * @param close - if true, will add a line connecting last point to the first point.\n */\n addPoly(points: SkPoint[], close: boolean): SkPath;\n\n /** Adds beginning of contour at SkPoint (x, y).\n\n @param x x-axis value of contour start\n @param y y-axis value of contour start\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_moveTo\n */\n moveTo(x: number, y: number): SkPath;\n /** Adds line from last point to (x, y). If SkPath is empty, or last SkPath::Verb is\n kClose_Verb, last point is set to (0, 0) before adding line.\n\n lineTo() appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed.\n lineTo() then appends kLine_Verb to verb array and (x, y) to SkPoint array.\n\n @param x end of added line on x-axis\n @param y end of added line on y-axis\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_lineTo\n */\n lineTo(x: number, y: number): SkPath;\n\n /**\n * Returns a new path that covers the same area as the original path, but with the\n * Winding FillType. This may re-draw some contours in the path as counter-clockwise\n * instead of clockwise to achieve that effect. If such a transformation cannot\n * be done, null is returned.\n */\n makeAsWinding(): SkPath | null;\n\n /**\n * Translates all the points in the path by dx, dy.\n * @param dx\n * @param dy\n */\n offset(dx: number, dy: number): SkPath;\n\n /**\n * Relative version of arcToRotated.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param dx\n * @param dy\n */\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ): SkPath;\n\n /**\n * Relative version of conicTo.\n * @param dx1\n * @param dy1\n * @param dx2\n * @param dy2\n * @param w\n */\n rConicTo(\n dx1: number,\n dy1: number,\n dx2: number,\n dy2: number,\n w: number\n ): SkPath;\n\n /**\n * Relative version of cubicTo.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Relative version of moveTo.\n * @param x\n * @param y\n */\n rMoveTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of lineTo.\n * @param x\n * @param y\n */\n rLineTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of quadTo.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\n rQuadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Sets FillType, the rule used to fill Path.\n * @param fill\n */\n setFillType(fill: FillType): SkPath;\n\n /**\n * Specifies whether Path is volatile; whether it will be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false.\n *\n * Mark animating or temporary paths as volatile to improve performance.\n * Mark unchanging Path non-volatile to improve repeated rendering.\n * @param volatile\n */\n setIsVolatile(volatile: boolean): SkPath;\n\n /**\n * Turns this path into the filled equivalent of the stroked path. Returns false if the operation\n * fails (e.g. the path is a hairline).\n * @param opts - describe how stroked path should look.\n * If such a transformation cannot be done, null is returned.\n */\n stroke(opts?: StrokeOpts): null | SkPath;\n\n /**\n * Appends CLOSE_VERB to Path. A closed contour connects the first and last point\n * with a line, forming a continuous loop.\n */\n close(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is released\n */\n reset(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is *not* released.\n * Use rewind() instead of reset() if Path storage will be reused and performance\n * is critical.\n */\n rewind(): SkPath;\n\n /**\n * Returns minimum and maximum axes values of the lines and curves in Path.\n * Returns (0, 0, 0, 0) if Path contains no points.\n * Returned bounds width and height may be larger or smaller than area affected\n * when Path is drawn.\n *\n * Behaves identically to getBounds() when Path contains\n * only lines. If Path contains curves, computed bounds includes\n * the maximum extent of the quad, conic, or cubic; is slower than getBounds();\n * and unlike getBounds(), does not cache the result.\n */\n computeTightBounds(): SkRect;\n\n /**\n * Appends arc to Path. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngleInDegrees\n * @param sweepAngleInDegrees\n * @param forceMoveTo\n */\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ): SkPath;\n\n /**\n * Appends arc to Path. Arc is implemented by one or more conics weighted to\n * describe part of oval with radii (rx, ry) rotated by xAxisRotate degrees. Arc\n * curves from last Path Point to (x, y), choosing one of four possible routes:\n * clockwise or counterclockwise, and smaller or larger. See SkPath.h for more details.\n * Returns the modified path for easier chaining.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param x\n * @param y\n */\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Appends arc to Path, after appending line if needed. Arc is implemented by conic\n * weighted to describe part of circle. Arc is contained by tangent from\n * last Path point to (x1, y1), and tangent from (x1, y1) to (x2, y2). Arc\n * is part of circle sized to radius, positioned so it touches both tangent lines.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param radius\n */\n arcToTangent(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n radius: number\n ): SkPath;\n\n /**\n * Adds conic from last point towards (x1, y1), to (x2, y2), weighted by w.\n * If Path is empty, or path is closed, the last point is set to (0, 0)\n * before adding conic.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param w\n */\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number): SkPath;\n\n /**\n * Returns true if the point (x, y) is contained by Path, taking into\n * account FillType.\n * @param x\n * @param y\n */\n contains(x: number, y: number): boolean;\n\n /**\n * Returns a copy of this Path.\n */\n copy(): SkPath;\n\n /**\n * Adds cubic from last point towards (x1, y1), then towards (x2, y2), ending at\n * (x3, y3). If Path is empty, or path is closed, the last point is set to\n * (0, 0) before adding cubic.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Changes this path to be the dashed version of itself. This is the same effect as creating\n * a DashPathEffect and calling filterPath on this path.\n * @param on\n * @param off\n * @param phase\n */\n dash(on: number, off: number, phase: number): boolean;\n\n /**\n * Returns true if other path is equal to this path.\n * @param other\n */\n equals(other: SkPath): boolean;\n\n /**\n * Returns minimum and maximum axes values of Point array.\n * Returns (0, 0, 0, 0) if Path contains no points. Returned bounds width and height may\n * be larger or smaller than area affected when Path is drawn.\n */\n getBounds(): SkRect;\n\n /**\n * Return the FillType for this path.\n */\n getFillType(): FillType;\n\n /**\n Adds quad from last point towards (x1, y1), to (x2, y2).\n\n If SkPath is empty, or last SkPath::Verb is kClose_Verb, last point is set to (0, 0) before adding quad.\n\n Appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed; then appends kQuad_Verb to verb array;\n and (x1, y1), (x2, y2) to SkPoint array.\n\n Parameters\n x1\tcontrol SkPoint of quad on x-axis\n y1\tcontrol SkPoint of quad on y-axis\n x2\tend SkPoint of quad on x-axis\n y2\tend SkPoint of quad on y-axis\n Returns\n reference to SkPath\n example: https://fiddle.skia.org/c/@Path_quadTo\n */\n quadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Adds Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb,\n * starting with top-left corner of Rect; followed by top-right, bottom-right,\n * and bottom-left if isCCW is false; or followed by bottom-left,\n * bottom-right, and top-right if isCCW is true.\n * Returns the modified path for easier chaining.\n * @param rect\n * @param isCCW\n */\n addRect(rect: SkRect, isCCW?: boolean): SkPath;\n\n /**\n * Adds rrect to Path, creating a new closed contour.\n * Returns the modified path for easier chaining.\n * @param rrect\n * @param isCCW\n */\n addRRect(rrect: SkRRect, isCCW?: boolean): SkPath;\n\n /** Appends src to SkPath, transformed by matrix. Transformed curves may have\n different verbs, SkPoint, and conic weights.\n\n If mode is kAppend_AddPathMode, src verb array, SkPoint array, and conic\n weights are added unaltered. If mode is kExtend_AddPathMode, add line\n before appending verbs, SkPoint, and conic weights.\n\n @param src SkPath verbs, SkPoint, and conic weights to add\n @param matrix transform applied to src\n @param extend extends path with line if true\n @return reference to SkPath\n */\n addPath(src: SkPath, matrix?: SkMatrix, extend?: boolean): SkPath;\n\n /**\n * Returns the Point at index in Point array. Valid range for index is\n * 0 to countPoints() - 1.\n * @param index\n */\n getPoint(index: number): SkPoint;\n\n /**\n * Returns true if there are no verbs in the path.\n */\n isEmpty(): boolean;\n\n /**\n * Returns true if the path is volatile; it will not be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false, allowing\n * Surface to attach a cache of data which speeds repeated drawing. If true, Surface\n * may not speed repeated drawing.\n */\n isVolatile(): boolean;\n\n /** Adds circle centered at (x, y) of size radius to SkPath, appending kMove_Verb,\n four kConic_Verb, and kClose_Verb. Circle begins at: (x + radius, y), continuing\n clockwise if dir is kCW_Direction, and counterclockwise if dir is kCCW_Direction.\n\n Has no effect if radius is zero or negative.\n\n @param x center of circle\n @param y center of circle\n @param radius distance from center to edge \n @return reference to SkPath\n */\n addCircle(x: number, y: number, r: number): SkPath;\n\n getLastPt(): { x: number; y: number };\n\n /** Set this path to the result of applying the Op to this path and the\n specified path: this = (this op operand).\n The resulting path will be constructed from non-overlapping contours.\n The curve order is reduced where possible so that cubics may be turned\n into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param path The second path (for difference, the subtrahend)\n @param op The operator to apply.\n @param result The product of the operands. The result may be one of the\n inputs.\n @return True if the operation succeeded.\n */\n op(path: SkPath, op: PathOp): boolean;\n\n /** Set this path to a set of non-overlapping contours that describe the\n same area as the original path.\n The curve order is reduced where possible so that cubics may\n be turned into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param result The simplified path. The result may be the input.\n @return True if simplification succeeded.\n */\n simplify(): boolean;\n\n /**\n * Returns this path as an SVG string.\n */\n toSVGString(): string;\n\n /**\n * Take start and stop \"t\" values (values between 0...1), and modify this path such that\n * it is a subset of the original path.\n * The trim values apply to the entire path, so if it contains several contours, all of them\n * are including in the calculation.\n * Null is returned if either input value is NaN.\n * @param startT - a value in the range [0.0, 1.0]. 0.0 is the beginning of the path.\n * @param stopT - a value in the range [0.0, 1.0]. 1.0 is the end of the path.\n * @param isComplement\n */\n trim(startT: number, stopT: number, isComplement: boolean): null | SkPath;\n\n /**\n * Transforms the path by the specified matrix.\n */\n transform(m3: SkMatrix | number[]): SkPath;\n\n /**\n * Interpolates between Path with point array of equal size.\n * Copy verb array and weights to result, and set result path to a weighted\n * average of this path array and ending path.\n\n * weight is most useful when between zero (ending path) and\n one (this path); will work with values outside of this\n range.\n\n * interpolate() returns undefined if path is not\n * the same size as ending path. Call isInterpolatable() to check Path\n * compatibility prior to calling interpolate().\n\n * @param ending path to interpolate with\n * @param weight contribution of this path, and\n * one minus contribution of ending path\n * @param output path to be replaced with the interpolated averages\n * @return Path replaced by interpolated averages or null if \n * not interpolatable\n * */\n interpolate(end: SkPath, weight: number, output?: SkPath): SkPath | null;\n\n /** Returns true if Path contain equal verbs and equal weights.\n * @param compare path to compare\n * @return true if Path can be interpolated equivalent\n *\n * */\n isInterpolatable(compare: SkPath): boolean;\n\n /**\n * Serializes the contents of this path as a series of commands.\n */\n toCmds(): PathCommand[];\n}\n"],"mappings":"AAOA;AACA;AACA;AAcA,WAAYA,QAAZ;;WAAYA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;GAAAA,Q,KAAAA,Q;;AAOZ,WAAYC,MAAZ;;WAAYA,M;EAAAA,M,CAAAA,M;EAAAA,M,CAAAA,M;EAAAA,M,CAAAA,M;EAAAA,M,CAAAA,M;EAAAA,M,CAAAA,M;GAAAA,M,KAAAA,M;;AAQZ,WAAYC,QAAZ;;WAAYA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;EAAAA,Q,CAAAA,Q;GAAAA,Q,KAAAA,Q;;AAWZ,OAAO,MAAMC,MAAM,GAAIC,GAAD,IACpBA,GAAG,KAAK,IAAR,IAAgBA,GAAG,CAACC,YAAJ,KAAqB,MADhC"}
@@ -7,7 +7,7 @@ export interface SkPictureRecorder {
7
7
  *
8
8
  * @param bounds - a rect to cull the results.
9
9
  */
10
- beginRecording(bounds: SkRect): SkCanvas;
10
+ beginRecording(bounds?: SkRect): SkCanvas;
11
11
  /**
12
12
  * Returns the captured draw commands as a picture and invalidates the canvas returned earlier.
13
13
  */
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["PictureRecorder.ts"],"sourcesContent":["import type { SkCanvas } from \"../Canvas\";\nimport type { SkRect } from \"../Rect\";\n\nimport type { SkPicture } from \"./Picture\";\n\nexport interface SkPictureRecorder {\n /**\n * Returns a canvas on which to draw. When done drawing, call finishRecordingAsPicture()\n *\n * @param bounds - a rect to cull the results.\n */\n beginRecording(bounds: SkRect): SkCanvas;\n\n /**\n * Returns the captured draw commands as a picture and invalidates the canvas returned earlier.\n */\n finishRecordingAsPicture(): SkPicture;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["PictureRecorder.ts"],"sourcesContent":["import type { SkCanvas } from \"../Canvas\";\nimport type { SkRect } from \"../Rect\";\n\nimport type { SkPicture } from \"./Picture\";\n\nexport interface SkPictureRecorder {\n /**\n * Returns a canvas on which to draw. When done drawing, call finishRecordingAsPicture()\n *\n * @param bounds - a rect to cull the results.\n */\n beginRecording(bounds?: SkRect): SkCanvas;\n\n /**\n * Returns the captured draw commands as a picture and invalidates the canvas returned earlier.\n */\n finishRecordingAsPicture(): SkPicture;\n}\n"],"mappings":""}
@@ -4,3 +4,4 @@ export interface SkRect {
4
4
  readonly width: number;
5
5
  readonly height: number;
6
6
  }
7
+ export declare const isRect: (def: unknown) => def is SkRect;
@@ -1,2 +1,11 @@
1
+ export const isRect = def => {
2
+ "worklet";
1
3
 
4
+ if (typeof def === "object" && def !== null) {
5
+ const rect = def;
6
+ return typeof rect.x === "number" && typeof rect.y === "number" && typeof rect.width === "number" && typeof rect.height === "number";
7
+ }
8
+
9
+ return false;
10
+ };
2
11
  //# sourceMappingURL=Rect.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Rect.ts"],"sourcesContent":["export interface SkRect {\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n}\n"],"mappings":""}
1
+ {"version":3,"names":["isRect","def","rect","x","y","width","height"],"sources":["Rect.ts"],"sourcesContent":["export interface SkRect {\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n}\n\nexport const isRect = (def: unknown): def is SkRect => {\n \"worklet\";\n if (typeof def === \"object\" && def !== null) {\n const rect = def as SkRect;\n return (\n typeof rect.x === \"number\" &&\n typeof rect.y === \"number\" &&\n typeof rect.width === \"number\" &&\n typeof rect.height === \"number\"\n );\n }\n return false;\n};\n"],"mappings":"AAOA,OAAO,MAAMA,MAAM,GAAIC,GAAD,IAAiC;EACrD;;EACA,IAAI,OAAOA,GAAP,KAAe,QAAf,IAA2BA,GAAG,KAAK,IAAvC,EAA6C;IAC3C,MAAMC,IAAI,GAAGD,GAAb;IACA,OACE,OAAOC,IAAI,CAACC,CAAZ,KAAkB,QAAlB,IACA,OAAOD,IAAI,CAACE,CAAZ,KAAkB,QADlB,IAEA,OAAOF,IAAI,CAACG,KAAZ,KAAsB,QAFtB,IAGA,OAAOH,IAAI,CAACI,MAAZ,KAAuB,QAJzB;EAMD;;EACD,OAAO,KAAP;AACD,CAZM"}
@@ -28,3 +28,4 @@ export * from "./Skia";
28
28
  export * from "./TextBlob";
29
29
  export * from "./Size";
30
30
  export * from "./Paragraph";
31
+ export * from "./Matrix4";
@@ -28,4 +28,5 @@ export * from "./Skia";
28
28
  export * from "./TextBlob";
29
29
  export * from "./Size";
30
30
  export * from "./Paragraph";
31
+ export * from "./Matrix4";
31
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Picture\";\nexport * from \"./Data\";\nexport * from \"./SVG\";\nexport * from \"./Surface\";\nexport * from \"./Vertices\";\nexport * from \"./RuntimeEffect\";\nexport * from \"./Shader\";\nexport * from \"./Image\";\nexport * from \"./AnimatedImage\";\nexport * from \"./ColorFilter\";\nexport * from \"./ImageFilter\";\nexport * from \"./Font\";\nexport * from \"./Typeface\";\nexport * from \"./Paint\";\nexport * from \"./Path\";\nexport * from \"./Color\";\nexport * from \"./Canvas\";\nexport * from \"./ContourMeasure\";\nexport * from \"./MaskFilter\";\nexport * from \"./Matrix\";\nexport * from \"./PathEffect\";\nexport * from \"./Point\";\nexport * from \"./Rect\";\nexport * from \"./RRect\";\nexport * from \"./RSXform\";\nexport * from \"./JsiInstance\";\nexport * from \"./Skia\";\nexport * from \"./TextBlob\";\nexport * from \"./Size\";\nexport * from \"./Paragraph\";\n"],"mappings":"AAAA,cAAc,WAAd;AACA,cAAc,QAAd;AACA,cAAc,OAAd;AACA,cAAc,WAAd;AACA,cAAc,YAAd;AACA,cAAc,iBAAd;AACA,cAAc,UAAd;AACA,cAAc,SAAd;AACA,cAAc,iBAAd;AACA,cAAc,eAAd;AACA,cAAc,eAAd;AACA,cAAc,QAAd;AACA,cAAc,YAAd;AACA,cAAc,SAAd;AACA,cAAc,QAAd;AACA,cAAc,SAAd;AACA,cAAc,UAAd;AACA,cAAc,kBAAd;AACA,cAAc,cAAd;AACA,cAAc,UAAd;AACA,cAAc,cAAd;AACA,cAAc,SAAd;AACA,cAAc,QAAd;AACA,cAAc,SAAd;AACA,cAAc,WAAd;AACA,cAAc,eAAd;AACA,cAAc,QAAd;AACA,cAAc,YAAd;AACA,cAAc,QAAd;AACA,cAAc,aAAd"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Picture\";\nexport * from \"./Data\";\nexport * from \"./SVG\";\nexport * from \"./Surface\";\nexport * from \"./Vertices\";\nexport * from \"./RuntimeEffect\";\nexport * from \"./Shader\";\nexport * from \"./Image\";\nexport * from \"./AnimatedImage\";\nexport * from \"./ColorFilter\";\nexport * from \"./ImageFilter\";\nexport * from \"./Font\";\nexport * from \"./Typeface\";\nexport * from \"./Paint\";\nexport * from \"./Path\";\nexport * from \"./Color\";\nexport * from \"./Canvas\";\nexport * from \"./ContourMeasure\";\nexport * from \"./MaskFilter\";\nexport * from \"./Matrix\";\nexport * from \"./PathEffect\";\nexport * from \"./Point\";\nexport * from \"./Rect\";\nexport * from \"./RRect\";\nexport * from \"./RSXform\";\nexport * from \"./JsiInstance\";\nexport * from \"./Skia\";\nexport * from \"./TextBlob\";\nexport * from \"./Size\";\nexport * from \"./Paragraph\";\nexport * from \"./Matrix4\";\n"],"mappings":"AAAA,cAAc,WAAd;AACA,cAAc,QAAd;AACA,cAAc,OAAd;AACA,cAAc,WAAd;AACA,cAAc,YAAd;AACA,cAAc,iBAAd;AACA,cAAc,UAAd;AACA,cAAc,SAAd;AACA,cAAc,iBAAd;AACA,cAAc,eAAd;AACA,cAAc,eAAd;AACA,cAAc,QAAd;AACA,cAAc,YAAd;AACA,cAAc,SAAd;AACA,cAAc,QAAd;AACA,cAAc,SAAd;AACA,cAAc,UAAd;AACA,cAAc,kBAAd;AACA,cAAc,cAAd;AACA,cAAc,UAAd;AACA,cAAc,cAAd;AACA,cAAc,SAAd;AACA,cAAc,QAAd;AACA,cAAc,SAAd;AACA,cAAc,WAAd;AACA,cAAc,eAAd;AACA,cAAc,QAAd;AACA,cAAc,YAAd;AACA,cAAc,QAAd;AACA,cAAc,aAAd;AACA,cAAc,WAAd"}
@@ -40,7 +40,7 @@ export declare class JsiSkCanvas extends HostObject<Canvas, "Canvas"> implements
40
40
  clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean): void;
41
41
  clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean): void;
42
42
  clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean): void;
43
- concat(m: SkMatrix): void;
43
+ concat(m: SkMatrix | number[]): void;
44
44
  drawPicture(skp: SkPicture): void;
45
45
  readPixels(srcX: number, srcY: number, imageInfo: ImageInfo): Float32Array | Uint8Array | null;
46
46
  }
@@ -179,7 +179,7 @@ export class JsiSkCanvas extends HostObject {
179
179
  }
180
180
 
181
181
  concat(m) {
182
- this.ref.concat(JsiSkMatrix.fromValue(m));
182
+ this.ref.concat(Array.isArray(m) ? m : JsiSkMatrix.fromValue(m));
183
183
  }
184
184
 
185
185
  drawPicture(skp) {
@@ -1 +1 @@
1
- {"version":3,"names":["ckEnum","getCkEnum","HostObject","JsiSkPaint","JsiSkRect","JsiSkRRect","JsiSkImage","JsiSkVertices","JsiSkPath","JsiSkFont","JsiSkTextBlob","JsiSkPicture","JsiSkMatrix","JsiSkImageFilter","JsiSkPoint","JsiSkCanvas","constructor","CanvasKit","ref","delete","drawRect","rect","paint","fromValue","drawImage","image","x","y","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","drawPatch","cubics","colors","texs","map","flat","flatMap","p","undefined","restoreToCount","saveCount","drawPoints","points","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","drawDRRect","outer","inner","drawOval","drawPath","path","drawText","str","font","drawTextBlob","blob","drawGlyphs","glyphs","positions","drawSvg","_svgDom","_width","_height","Error","save","saveLayer","bounds","backdrop","flags","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","clipRect","clipRRect","concat","m","drawPicture","skp","readPixels","srcX","srcY","imageInfo","pxInfo","width","height","colorSpace","ColorSpace","SRGB","alphaType","AlphaType","colorType","ColorType"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type { Canvas, CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n ClipOp,\n FilterMode,\n MipmapMode,\n PointMode,\n SaveLayerFlag,\n ImageInfo,\n SkCanvas,\n SkColor,\n SkFont,\n SkImage,\n SkImageFilter,\n SkMatrix,\n SkPaint,\n SkPath,\n SkPicture,\n SkPoint,\n SkRect,\n SkRRect,\n SkSVG,\n SkTextBlob,\n SkVertices,\n} from \"../types\";\n\nimport { ckEnum, getCkEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkCanvas\n extends HostObject<Canvas, \"Canvas\">\n implements SkCanvas\n{\n constructor(CanvasKit: CanvasKit, ref: Canvas) {\n super(CanvasKit, ref, \"Canvas\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n drawRect(rect: SkRect, paint: SkPaint) {\n this.ref.drawRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n this.ref.drawImage(\n JsiSkImage.fromValue(image),\n x,\n y,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRect(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n paint: SkPaint,\n fastSample?: boolean\n ) {\n this.ref.drawImageRect(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n JsiSkPaint.fromValue(paint),\n fastSample\n );\n }\n\n drawImageCubic(\n img: SkImage,\n left: number,\n top: number,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageCubic(\n JsiSkImage.fromValue(img),\n left,\n top,\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageOptions(\n img: SkImage,\n left: number,\n top: number,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageOptions(\n JsiSkImage.fromValue(img),\n left,\n top,\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageNine(\n img: SkImage,\n center: SkRect,\n dest: SkRect,\n filter: FilterMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageNine(\n JsiSkImage.fromValue(img),\n Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(filter),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectCubic(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectCubic(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectOptions(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectOptions(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawPaint(paint: SkPaint) {\n this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n }\n\n drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n }\n\n drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n }\n\n drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n this.ref.drawVertices(\n JsiSkVertices.fromValue(verts),\n ckEnum(mode),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPatch(\n cubics: SkPoint[],\n colors?: SkColor[] | null,\n texs?: SkPoint[] | null,\n mode?: BlendMode | null,\n paint?: SkPaint\n ) {\n this.ref.drawPatch(\n cubics.map(({ x, y }) => [x, y]).flat(),\n colors,\n texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n mode ? ckEnum(mode) : null,\n paint ? JsiSkPaint.fromValue(paint) : undefined\n );\n }\n\n restoreToCount(saveCount: number) {\n this.ref.restoreToCount(saveCount);\n }\n\n drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n this.ref.drawPoints(\n ckEnum(mode),\n points.map(({ x, y }) => [x, y]).flat(),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawArc(\n oval: SkRect,\n startAngle: number,\n sweepAngle: number,\n useCenter: boolean,\n paint: SkPaint\n ) {\n this.ref.drawArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngle,\n sweepAngle,\n useCenter,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawRRect(rrect: SkRRect, paint: SkPaint) {\n this.ref.drawRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawDRRect(outer: SkRRect, inner: SkRRect, paint: SkPaint) {\n this.ref.drawDRRect(\n JsiSkRRect.fromValue(this.CanvasKit, outer),\n JsiSkRRect.fromValue(this.CanvasKit, inner),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawOval(oval: SkRect, paint: SkPaint) {\n this.ref.drawOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPath(path: SkPath, paint: SkPaint) {\n this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n }\n\n drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n this.ref.drawText(\n str,\n x,\n y,\n JsiSkPaint.fromValue(paint),\n JsiSkFont.fromValue(font)\n );\n }\n\n drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n this.ref.drawTextBlob(\n JsiSkTextBlob.fromValue(blob),\n x,\n y,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawGlyphs(\n glyphs: number[],\n positions: SkPoint[],\n x: number,\n y: number,\n font: SkFont,\n paint: SkPaint\n ) {\n this.ref.drawGlyphs(\n glyphs,\n positions.map((p) => [p.x, p.y]).flat(),\n x,\n y,\n JsiSkFont.fromValue(font),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawSvg(_svgDom: SkSVG, _width?: number, _height?: number) {\n throw new Error(\"drawSvg is not implemented on React Native Web\");\n }\n\n save() {\n return this.ref.save();\n }\n\n saveLayer(\n paint?: SkPaint,\n bounds?: SkRect | null,\n backdrop?: SkImageFilter | null,\n flags?: SaveLayerFlag\n ) {\n return this.ref.saveLayer(\n paint ? JsiSkPaint.fromValue(paint) : undefined,\n bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n flags\n );\n }\n\n restore() {\n this.ref.restore();\n }\n\n rotate(rotationInDegrees: number, rx: number, ry: number) {\n this.ref.rotate(rotationInDegrees, rx, ry);\n }\n\n scale(sx: number, sy: number) {\n this.ref.scale(sx, sy);\n }\n\n skew(sx: number, sy: number) {\n this.ref.skew(sx, sy);\n }\n\n translate(dx: number, dy: number) {\n this.ref.translate(dx, dy);\n }\n\n drawColor(color: SkColor, blendMode?: BlendMode) {\n this.ref.drawColor(color, blendMode ? ckEnum(blendMode) : undefined);\n }\n\n clear(color: SkColor) {\n this.ref.clear(color);\n }\n\n clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipPath(JsiSkPath.fromValue(path), ckEnum(op), doAntiAlias);\n }\n\n clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n concat(m: SkMatrix) {\n this.ref.concat(JsiSkMatrix.fromValue(m));\n }\n\n drawPicture(skp: SkPicture) {\n this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n }\n\n readPixels(srcX: number, srcY: number, imageInfo: ImageInfo) {\n const pxInfo = {\n width: imageInfo.width,\n height: imageInfo.height,\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n alphaType: getCkEnum(this.CanvasKit.AlphaType, imageInfo.alphaType),\n colorType: getCkEnum(this.CanvasKit.ColorType, imageInfo.colorType),\n };\n return this.ref.readPixels(srcX, srcY, pxInfo);\n }\n}\n"],"mappings":";;AA2BA,SAASA,MAAT,EAAiBC,SAAjB,EAA4BC,UAA5B,QAA8C,QAA9C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA,OAAO,MAAMC,WAAN,SACGb,UADH,CAGP;EACEc,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAoC;IAC7C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IAD6C,iCAIrC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN8C;EAE9C;;EAMDC,QAAQ,CAACC,IAAD,EAAeC,KAAf,EAA+B;IACrC,KAAKJ,GAAL,CAASE,QAAT,CACEhB,SAAS,CAACmB,SAAV,CAAoB,KAAKN,SAAzB,EAAoCI,IAApC,CADF,EAEElB,UAAU,CAACoB,SAAX,CAAqBD,KAArB,CAFF;EAID;;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,EAAD,CAFR,EAGEC,WAHF;EAKD;;EAEDG,MAAM,CAACC,CAAD,EAAc;IAClB,KAAK7G,GAAL,CAAS4G,MAAT,CAAgBlH,WAAW,CAACW,SAAZ,CAAsBwG,CAAtB,CAAhB;EACD;;EAEDC,WAAW,CAACC,GAAD,EAAiB;IAC1B,KAAK/G,GAAL,CAAS8G,WAAT,CAAqBrH,YAAY,CAACY,SAAb,CAAuB0G,GAAvB,CAArB;EACD;;EAEDC,UAAU,CAACC,IAAD,EAAeC,IAAf,EAA6BC,SAA7B,EAAmD;IAC3D,MAAMC,MAAM,GAAG;MACbC,KAAK,EAAEF,SAAS,CAACE,KADJ;MAEbC,MAAM,EAAEH,SAAS,CAACG,MAFL;MAGbC,UAAU,EAAE,KAAKxH,SAAL,CAAeyH,UAAf,CAA0BC,IAHzB;MAIbC,SAAS,EAAE3I,SAAS,CAAC,KAAKgB,SAAL,CAAe4H,SAAhB,EAA2BR,SAAS,CAACO,SAArC,CAJP;MAKbE,SAAS,EAAE7I,SAAS,CAAC,KAAKgB,SAAL,CAAe8H,SAAhB,EAA2BV,SAAS,CAACS,SAArC;IALP,CAAf;IAOA,OAAO,KAAK5H,GAAL,CAASgH,UAAT,CAAoBC,IAApB,EAA0BC,IAA1B,EAAgCE,MAAhC,CAAP;EACD;;AAvVH"}
1
+ {"version":3,"names":["ckEnum","getCkEnum","HostObject","JsiSkPaint","JsiSkRect","JsiSkRRect","JsiSkImage","JsiSkVertices","JsiSkPath","JsiSkFont","JsiSkTextBlob","JsiSkPicture","JsiSkMatrix","JsiSkImageFilter","JsiSkPoint","JsiSkCanvas","constructor","CanvasKit","ref","delete","drawRect","rect","paint","fromValue","drawImage","image","x","y","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","drawPatch","cubics","colors","texs","map","flat","flatMap","p","undefined","restoreToCount","saveCount","drawPoints","points","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","drawDRRect","outer","inner","drawOval","drawPath","path","drawText","str","font","drawTextBlob","blob","drawGlyphs","glyphs","positions","drawSvg","_svgDom","_width","_height","Error","save","saveLayer","bounds","backdrop","flags","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","clipRect","clipRRect","concat","m","isArray","drawPicture","skp","readPixels","srcX","srcY","imageInfo","pxInfo","width","height","colorSpace","ColorSpace","SRGB","alphaType","AlphaType","colorType","ColorType"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type { Canvas, CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n ClipOp,\n FilterMode,\n MipmapMode,\n PointMode,\n SaveLayerFlag,\n ImageInfo,\n SkCanvas,\n SkColor,\n SkFont,\n SkImage,\n SkImageFilter,\n SkMatrix,\n SkPaint,\n SkPath,\n SkPicture,\n SkPoint,\n SkRect,\n SkRRect,\n SkSVG,\n SkTextBlob,\n SkVertices,\n} from \"../types\";\n\nimport { ckEnum, getCkEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkCanvas\n extends HostObject<Canvas, \"Canvas\">\n implements SkCanvas\n{\n constructor(CanvasKit: CanvasKit, ref: Canvas) {\n super(CanvasKit, ref, \"Canvas\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n drawRect(rect: SkRect, paint: SkPaint) {\n this.ref.drawRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n this.ref.drawImage(\n JsiSkImage.fromValue(image),\n x,\n y,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRect(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n paint: SkPaint,\n fastSample?: boolean\n ) {\n this.ref.drawImageRect(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n JsiSkPaint.fromValue(paint),\n fastSample\n );\n }\n\n drawImageCubic(\n img: SkImage,\n left: number,\n top: number,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageCubic(\n JsiSkImage.fromValue(img),\n left,\n top,\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageOptions(\n img: SkImage,\n left: number,\n top: number,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageOptions(\n JsiSkImage.fromValue(img),\n left,\n top,\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageNine(\n img: SkImage,\n center: SkRect,\n dest: SkRect,\n filter: FilterMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageNine(\n JsiSkImage.fromValue(img),\n Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(filter),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectCubic(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectCubic(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectOptions(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectOptions(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawPaint(paint: SkPaint) {\n this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n }\n\n drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n }\n\n drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n }\n\n drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n this.ref.drawVertices(\n JsiSkVertices.fromValue(verts),\n ckEnum(mode),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPatch(\n cubics: SkPoint[],\n colors?: SkColor[] | null,\n texs?: SkPoint[] | null,\n mode?: BlendMode | null,\n paint?: SkPaint\n ) {\n this.ref.drawPatch(\n cubics.map(({ x, y }) => [x, y]).flat(),\n colors,\n texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n mode ? ckEnum(mode) : null,\n paint ? JsiSkPaint.fromValue(paint) : undefined\n );\n }\n\n restoreToCount(saveCount: number) {\n this.ref.restoreToCount(saveCount);\n }\n\n drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n this.ref.drawPoints(\n ckEnum(mode),\n points.map(({ x, y }) => [x, y]).flat(),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawArc(\n oval: SkRect,\n startAngle: number,\n sweepAngle: number,\n useCenter: boolean,\n paint: SkPaint\n ) {\n this.ref.drawArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngle,\n sweepAngle,\n useCenter,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawRRect(rrect: SkRRect, paint: SkPaint) {\n this.ref.drawRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawDRRect(outer: SkRRect, inner: SkRRect, paint: SkPaint) {\n this.ref.drawDRRect(\n JsiSkRRect.fromValue(this.CanvasKit, outer),\n JsiSkRRect.fromValue(this.CanvasKit, inner),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawOval(oval: SkRect, paint: SkPaint) {\n this.ref.drawOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPath(path: SkPath, paint: SkPaint) {\n this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n }\n\n drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n this.ref.drawText(\n str,\n x,\n y,\n JsiSkPaint.fromValue(paint),\n JsiSkFont.fromValue(font)\n );\n }\n\n drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n this.ref.drawTextBlob(\n JsiSkTextBlob.fromValue(blob),\n x,\n y,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawGlyphs(\n glyphs: number[],\n positions: SkPoint[],\n x: number,\n y: number,\n font: SkFont,\n paint: SkPaint\n ) {\n this.ref.drawGlyphs(\n glyphs,\n positions.map((p) => [p.x, p.y]).flat(),\n x,\n y,\n JsiSkFont.fromValue(font),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawSvg(_svgDom: SkSVG, _width?: number, _height?: number) {\n throw new Error(\"drawSvg is not implemented on React Native Web\");\n }\n\n save() {\n return this.ref.save();\n }\n\n saveLayer(\n paint?: SkPaint,\n bounds?: SkRect | null,\n backdrop?: SkImageFilter | null,\n flags?: SaveLayerFlag\n ) {\n return this.ref.saveLayer(\n paint ? JsiSkPaint.fromValue(paint) : undefined,\n bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n flags\n );\n }\n\n restore() {\n this.ref.restore();\n }\n\n rotate(rotationInDegrees: number, rx: number, ry: number) {\n this.ref.rotate(rotationInDegrees, rx, ry);\n }\n\n scale(sx: number, sy: number) {\n this.ref.scale(sx, sy);\n }\n\n skew(sx: number, sy: number) {\n this.ref.skew(sx, sy);\n }\n\n translate(dx: number, dy: number) {\n this.ref.translate(dx, dy);\n }\n\n drawColor(color: SkColor, blendMode?: BlendMode) {\n this.ref.drawColor(color, blendMode ? ckEnum(blendMode) : undefined);\n }\n\n clear(color: SkColor) {\n this.ref.clear(color);\n }\n\n clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipPath(JsiSkPath.fromValue(path), ckEnum(op), doAntiAlias);\n }\n\n clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n concat(m: SkMatrix | number[]) {\n this.ref.concat(Array.isArray(m) ? m : JsiSkMatrix.fromValue(m));\n }\n\n drawPicture(skp: SkPicture) {\n this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n }\n\n readPixels(srcX: number, srcY: number, imageInfo: ImageInfo) {\n const pxInfo = {\n width: imageInfo.width,\n height: imageInfo.height,\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n alphaType: getCkEnum(this.CanvasKit.AlphaType, imageInfo.alphaType),\n colorType: getCkEnum(this.CanvasKit.ColorType, imageInfo.colorType),\n };\n return this.ref.readPixels(srcX, srcY, pxInfo);\n }\n}\n"],"mappings":";;AA2BA,SAASA,MAAT,EAAiBC,SAAjB,EAA4BC,UAA5B,QAA8C,QAA9C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA,OAAO,MAAMC,WAAN,SACGb,UADH,CAGP;EACEc,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAoC;IAC7C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IAD6C,iCAIrC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN8C;EAE9C;;EAMDC,QAAQ,CAACC,IAAD,EAAeC,KAAf,EAA+B;IACrC,KAAKJ,GAAL,CAASE,QAAT,CACEhB,SAAS,CAACmB,SAAV,CAAoB,KAAKN,SAAzB,EAAoCI,IAApC,CADF,EAEElB,UAAU,CAACoB,SAAX,CAAqBD,KAArB,CAFF;EAID;;EAEDE,SAAS,CAACC,KAAD,EAAiBC,CAAjB,EAA4BC,CAA5B,EAAuCL,KAAvC,EAAwD;IAC/D,KAAKJ,GAAL,CAASM,SAAT,CACElB,UAAU,CAACiB,SAAX,CAAqBE,KAArB,CADF,EAEEC,CAFF,EAGEC,CAHF,EAIEL,KAAK,GAAGnB,UAAU,CAACoB,SAAX,CAAqBD,KA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C,GAAD,EAAiB;IAC1B,KAAKhH,GAAL,CAAS+G,WAAT,CAAqBtH,YAAY,CAACY,SAAb,CAAuB2G,GAAvB,CAArB;EACD;;EAEDC,UAAU,CAACC,IAAD,EAAeC,IAAf,EAA6BC,SAA7B,EAAmD;IAC3D,MAAMC,MAAM,GAAG;MACbC,KAAK,EAAEF,SAAS,CAACE,KADJ;MAEbC,MAAM,EAAEH,SAAS,CAACG,MAFL;MAGbC,UAAU,EAAE,KAAKzH,SAAL,CAAe0H,UAAf,CAA0BC,IAHzB;MAIbC,SAAS,EAAE5I,SAAS,CAAC,KAAKgB,SAAL,CAAe6H,SAAhB,EAA2BR,SAAS,CAACO,SAArC,CAJP;MAKbE,SAAS,EAAE9I,SAAS,CAAC,KAAKgB,SAAL,CAAe+H,SAAhB,EAA2BV,SAAS,CAACS,SAArC;IALP,CAAf;IAOA,OAAO,KAAK7H,GAAL,CAASiH,UAAT,CAAoBC,IAApB,EAA0BC,IAA1B,EAAgCE,MAAhC,CAAP;EACD;;AAvVH"}
@@ -6,7 +6,7 @@ export declare class JsiSkMatrix extends HostObject<Matrix3x3, "Matrix"> impleme
6
6
  private preMultiply;
7
7
  private postMultiply;
8
8
  dispose: () => void;
9
- concat(matrix: SkMatrix): this;
9
+ concat(matrix: SkMatrix | number[]): this;
10
10
  translate(x: number, y: number): this;
11
11
  postTranslate(x: number, y: number): this;
12
12
  scale(x: number, y?: number): this;
@@ -18,7 +18,7 @@ export class JsiSkMatrix extends HostObject {
18
18
  }
19
19
 
20
20
  concat(matrix) {
21
- this.preMultiply(JsiSkMatrix.fromValue(matrix));
21
+ this.preMultiply(Array.isArray(matrix) ? matrix : JsiSkMatrix.fromValue(matrix));
22
22
  return this;
23
23
  }
24
24
 
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkMatrix","constructor","CanvasKit","ref","preMultiply","matrix","set","Matrix","multiply","postMultiply","concat","fromValue","translate","x","y","translated","postTranslate","scale","scaled","postScale","skew","skewed","postSkew","rotate","value","rotated","postRotate","identity","get","Array","from"],"sources":["JsiSkMatrix.ts"],"sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport type { SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n private preMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(this.ref, matrix));\n }\n\n private postMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(matrix, this.ref));\n }\n\n dispose = () => {\n // Do nothing - the matrix is represenetd by a Float32Array\n };\n\n concat(matrix: SkMatrix) {\n this.preMultiply(JsiSkMatrix.fromValue(matrix));\n return this;\n }\n\n translate(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n postTranslate(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n scale(x: number, y?: number) {\n this.preMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n postScale(x: number, y?: number) {\n this.postMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n skew(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n postSkew(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n rotate(value: number) {\n this.preMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n postRotate(value: number) {\n this.postMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n return this;\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,M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YC,CAAZ,EAAwB;IAC/B,KAAKL,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBW,MAAtB,CAA6BL,CAA7B,EAAgCC,CAAhC,aAAgCA,CAAhC,cAAgCA,CAAhC,GAAqCD,CAArC,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDO,IAAI,CAACP,CAAD,EAAYC,CAAZ,EAAuB;IACzB,KAAKV,WAAL,CAAiB,KAAKF,SAAL,CAAeK,MAAf,CAAsBc,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDQ,QAAQ,CAACT,CAAD,EAAYC,CAAZ,EAAuB;IAC7B,KAAKL,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBc,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDS,MAAM,CAACC,KAAD,EAAgB;IACpB,KAAKpB,WAAL,CAAiB,KAAKF,SAAL,CAAeK,MAAf,CAAsBkB,OAAtB,CAA8BD,KAA9B,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDE,UAAU,CAACF,KAAD,EAAgB;IACxB,KAAKf,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBkB,OAAtB,CAA8BD,KAA9B,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDG,QAAQ,GAAG;IACT,KAAKxB,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBoB,QAAtB,EAAb;IACA,OAAO,IAAP;EACD;;EAEDC,GAAG,GAAG;IACJ,OAAOC,KAAK,CAACC,IAAN,CAAW,KAAK3B,GAAhB,CAAP;EACD;;AArEH"}
1
+ {"version":3,"names":["HostObject","JsiSkMatrix","constructor","CanvasKit","ref","preMultiply","matrix","set","Matrix","multiply","postMultiply","concat","Array","isArray","fromValue","translate","x","y","translated","postTranslate","scale","scaled","postScale","skew","skewed","postSkew","rotate","value","rotated","postRotate","identity","get","from"],"sources":["JsiSkMatrix.ts"],"sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport type { SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n private preMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(this.ref, matrix));\n }\n\n private postMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(matrix, this.ref));\n }\n\n dispose = () => {\n // Do nothing - the matrix is represenetd by a Float32Array\n };\n\n concat(matrix: SkMatrix | number[]) {\n this.preMultiply(\n Array.isArray(matrix) ? matrix : JsiSkMatrix.fromValue(matrix)\n );\n return this;\n }\n\n translate(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n postTranslate(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n scale(x: number, y?: number) {\n this.preMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n postScale(x: number, y?: number) {\n this.postMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n skew(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n postSkew(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n rotate(value: number) {\n this.preMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n postRotate(value: number) {\n this.postMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n return this;\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA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form(JsiSkMatrix.fromValue(m3));
256
+ this.ref.transform(Array.isArray(m3) ? m3 : JsiSkMatrix.fromValue(m3));
257
257
  return this;
258
258
  }
259
259
 
@@ -1 +1 @@
1
- {"version":3,"names":["PathVerb","ckEnum","HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","pinT","t","Math","min","max","JsiSkPath","constructor","CanvasKit","ref","delete","addPath","src","matrix","extend","args","fromValue","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","cap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","simplify","toSVGString","trim","start","stop","isComplement","startT","stopT","transform","m3","interpolate","end","output","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { ckEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nconst pinT = (t: number) => Math.min(Math.max(t, 0), 1);\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(ckEnum(fill));\n return this;\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n return this;\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(opts.join),\n cap: optEnum(opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n return this;\n }\n\n reset() {\n this.ref.reset();\n return this;\n }\n\n rewind() {\n this.ref.rewind();\n return this;\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n return this;\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n return this;\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(JsiSkPath.fromValue(path), ckEnum(op));\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(start: number, stop: number, isComplement: boolean) {\n const startT = pinT(start);\n const stopT = pinT(stop);\n if (startT === 0 && stopT === 1) {\n return this;\n }\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(JsiSkMatrix.fromValue(m3));\n return this;\n }\n\n interpolate(end: SkPath, t: number, output?: SkPath) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n if (output) {\n (output as JsiSkPath).ref = path;\n return output;\n } else {\n return new JsiSkPath(this.CanvasKit, path);\n }\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":";;AAEA,SAASA,QAAT,QAAyB,UAAzB;AAaA,SAASC,MAAT,EAAiBC,UAAjB,EAA6BC,OAA7B,QAA4C,QAA5C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,MAAMC,YAAY,GAAG;EACnB,CAACR,QA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CAAS,EAAT;QACD;MACF,CAND,MAMO;QACL,MAAME,MAAM,GAAGhJ,YAAY,CAAC+I,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,GAAiBA,MAArB,EAA6B;UAC3BD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACD;;QACD,IAAIG,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF;;MACD,OAAOH,GAAP;IACD,CArBc,EAqBZ,EArBY,CAAf;IAsBA,OAAO/F,MAAP;EACD;;AAxWuE"}
1
+ {"version":3,"names":["PathVerb","ckEnum","HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","pinT","t","Math","min","max","JsiSkPath","constructor","CanvasKit","ref","delete","addPath","src","matrix","extend","args","fromValue","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","cap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","simplify","toSVGString","trim","start","stop","isComplement","startT","stopT","transform","m3","isArray","interpolate","end","output","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { ckEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nconst pinT = (t: number) => Math.min(Math.max(t, 0), 1);\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(ckEnum(fill));\n return this;\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n return this;\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(opts.join),\n cap: optEnum(opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n return this;\n }\n\n reset() {\n this.ref.reset();\n return this;\n }\n\n rewind() {\n this.ref.rewind();\n return this;\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n return this;\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n return this;\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(JsiSkPath.fromValue(path), ckEnum(op));\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(start: number, stop: number, isComplement: boolean) {\n const startT = pinT(start);\n const stopT = pinT(stop);\n if (startT === 0 && stopT === 1) {\n return this;\n }\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(Array.isArray(m3) ? m3 : JsiSkMatrix.fromValue(m3));\n return this;\n }\n\n interpolate(end: SkPath, t: number, output?: SkPath) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n if (output) {\n (output as JsiSkPath).ref = path;\n return output;\n } else {\n return new JsiSkPath(this.CanvasKit, path);\n }\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":";;AAEA,SAASA,QAAT,QAAyB,UAAzB;AAaA,SAASC,MAAT,EAAiBC,UAAjB,EAA6BC,OAA7B,QAA4C,QAA5C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,MAAMC,YAAY,GAAG;EACnB,CAACR,QAAQ,CAACS,IAAV,GAAiB,CADE;EAEnB,CAACT,QAAQ,CAACU,IAAV,GAAiB,CAFE;EAGnB,CAACV,QAAQ,CAACW,IAAV,GAAiB,CAHE;EAInB,CAACX,QAAQ,CAACY,KAAV,GAAkB,CAJC;EAKnB,CAACZ,QAAQ,CAACa,KAAV,GAAkB,CALC;EAMnB,CAACb,QAAQ,CAACc,KAAV,GAAkB;AANC,CAArB;;AASA,MAAMC,IAAI,GAAIC,CAAD,IAAeC,IAAI,CAACC,GAAL,CAASD,IAAI,CAACE,GAAL,CAASH,CAAT,EAAY,CAAZ,CAAT,EAAyB,CAAzB,CAA5B;;AAEA,OAAO,MAAMI,SAAN,SAAwBlB,UAAxB,CAAmE;EACxEmB,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAInC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN4C;EAE5C;;EAMDC,OAAO,CAACC,GAAD,EAAcC,MAAd,EAAiD;IAAA,IAAhBC,MAAgB,uEAAP,KAAO;IACtD,MAAMC,IAAI,GAAG,CACXT,SAAS,CAACU,SAAV,CAAoBJ,GAApB,CADW,EAEX,IAAIC,MAAM,GAAGpB,WAAW,CAACuB,SAAZ,CAAoCH,MAApC,CAAH,GAAiD,EAA3D,CAFW,EAGXC,MAHW,CAAb;IAKA,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G,CAACG,IAAJ,CAAS,EAAT;MACD;;MACD,MAAMC,OAAO,GAAGJ,GAAG,CAACA,GAAG,CAACK,MAAJ,GAAa,CAAd,CAAnB;;MACA,IAAID,OAAO,CAACC,MAAR,KAAmB,CAAvB,EAA0B;QACxBD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACA,MAAMI,MAAM,GAAGjJ,YAAY,CAACgJ,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF,CAND,MAMO;QACL,MAAME,MAAM,GAAGjJ,YAAY,CAACgJ,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,GAAiBA,MAArB,EAA6B;UAC3BD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACD;;QACD,IAAIG,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF;;MACD,OAAOH,GAAP;IACD,CArBc,EAqBZ,EArBY,CAAf;IAsBA,OAAOhG,MAAP;EACD;;AAxWuE"}
@@ -7,6 +7,6 @@ import { JsiSkPicture } from "./JsiSkPicture";
7
7
  export declare class JsiSkPictureRecorder extends HostObject<PictureRecorder, "PictureRecorder"> implements SkPictureRecorder {
8
8
  constructor(CanvasKit: CanvasKit, ref: PictureRecorder);
9
9
  dispose: () => void;
10
- beginRecording(bounds: SkRect): JsiSkCanvas;
10
+ beginRecording(bounds?: SkRect): JsiSkCanvas;
11
11
  finishRecordingAsPicture(): JsiSkPicture;
12
12
  }
@@ -14,7 +14,7 @@ export class JsiSkPictureRecorder extends HostObject {
14
14
  }
15
15
 
16
16
  beginRecording(bounds) {
17
- return new JsiSkCanvas(this.CanvasKit, this.ref.beginRecording(JsiSkRect.fromValue(this.CanvasKit, bounds)));
17
+ return new JsiSkCanvas(this.CanvasKit, this.ref.beginRecording(bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : Float32Array.of(0, 0, 2_000_000, 2_000_000)));
18
18
  }
19
19
 
20
20
  finishRecordingAsPicture() {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkCanvas","JsiSkPicture","JsiSkRect","JsiSkPictureRecorder","constructor","CanvasKit","ref","delete","beginRecording","bounds","fromValue","finishRecordingAsPicture"],"sources":["JsiSkPictureRecorder.ts"],"sourcesContent":["import type { CanvasKit, PictureRecorder } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\nimport type { SkPictureRecorder } from \"../types/Picture/PictureRecorder\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPictureRecorder\n extends HostObject<PictureRecorder, \"PictureRecorder\">\n implements SkPictureRecorder\n{\n constructor(CanvasKit: CanvasKit, ref: PictureRecorder) {\n super(CanvasKit, ref, \"PictureRecorder\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n beginRecording(bounds: SkRect) {\n return new JsiSkCanvas(\n this.CanvasKit,\n this.ref.beginRecording(JsiSkRect.fromValue(this.CanvasKit, bounds))\n );\n }\n\n finishRecordingAsPicture() {\n return new JsiSkPicture(\n this.CanvasKit,\n this.ref.finishRecordingAsPicture()\n );\n }\n}\n"],"mappings":";;AAKA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,oBAAN,SACGJ,UADH,CAGP;EACEK,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA6C;IACtD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,iBAAtB;;IADsD,iCAI9C,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANuD;EAEvD;;EAMDC,cAAc,CAACC,MAAD,EAAiB;IAC7B,OAAO,IAAIT,WAAJ,CACL,KAAKK,SADA,EAEL,KAAKC,GAAL,CAASE,cAAT,CAAwBN,SAAS,CAACQ,SAAV,CAAoB,KAAKL,SAAzB,EAAoCI,MAApC,CAAxB,CAFK,CAAP;EAID;;EAEDE,wBAAwB,GAAG;IACzB,OAAO,IAAIV,YAAJ,CACL,KAAKI,SADA,EAEL,KAAKC,GAAL,CAASK,wBAAT,EAFK,CAAP;EAID;;AArBH"}
1
+ {"version":3,"names":["HostObject","JsiSkCanvas","JsiSkPicture","JsiSkRect","JsiSkPictureRecorder","constructor","CanvasKit","ref","delete","beginRecording","bounds","fromValue","Float32Array","of","finishRecordingAsPicture"],"sources":["JsiSkPictureRecorder.ts"],"sourcesContent":["import type { CanvasKit, PictureRecorder } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\nimport type { SkPictureRecorder } from \"../types/Picture/PictureRecorder\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPictureRecorder\n extends HostObject<PictureRecorder, \"PictureRecorder\">\n implements SkPictureRecorder\n{\n constructor(CanvasKit: CanvasKit, ref: PictureRecorder) {\n super(CanvasKit, ref, \"PictureRecorder\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n beginRecording(bounds?: SkRect) {\n return new JsiSkCanvas(\n this.CanvasKit,\n this.ref.beginRecording(\n bounds\n ? JsiSkRect.fromValue(this.CanvasKit, bounds)\n : Float32Array.of(0, 0, 2_000_000, 2_000_000)\n )\n );\n }\n\n finishRecordingAsPicture() {\n return new JsiSkPicture(\n this.CanvasKit,\n this.ref.finishRecordingAsPicture()\n );\n }\n}\n"],"mappings":";;AAKA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,oBAAN,SACGJ,UADH,CAGP;EACEK,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA6C;IACtD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,iBAAtB;;IADsD,iCAI9C,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANuD;EAEvD;;EAMDC,cAAc,CAACC,MAAD,EAAkB;IAC9B,OAAO,IAAIT,WAAJ,CACL,KAAKK,SADA,EAEL,KAAKC,GAAL,CAASE,cAAT,CACEC,MAAM,GACFP,SAAS,CAACQ,SAAV,CAAoB,KAAKL,SAAzB,EAAoCI,MAApC,CADE,GAEFE,YAAY,CAACC,EAAb,CAAgB,CAAhB,EAAmB,CAAnB,EAAsB,SAAtB,EAAiC,SAAjC,CAHN,CAFK,CAAP;EAQD;;EAEDC,wBAAwB,GAAG;IACzB,OAAO,IAAIZ,YAAJ,CACL,KAAKI,SADA,EAEL,KAAKC,GAAL,CAASO,wBAAT,EAFK,CAAP;EAID;;AAzBH"}
@@ -1,5 +1,26 @@
1
- import type { ISkiaValueApi } from "./types";
1
+ import type { AnimationState, ISkiaValueApi, SkiaAnimation, SkiaClockValue, SkiaMutableValue, SkiaValue } from "./types";
2
2
  declare global {
3
3
  var SkiaValueApi: ISkiaValueApi;
4
4
  }
5
- export declare const ValueApi: ISkiaValueApi;
5
+ export declare const ValueApi: {
6
+ /**
7
+ * @deprecated Use Reanimated 3
8
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
9
+ */
10
+ createValue<T>(initialValue: T): SkiaMutableValue<T>;
11
+ /**
12
+ * @deprecated Use Reanimated 3
13
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
14
+ */
15
+ createComputedValue<R>(cb: () => R, values: SkiaValue<unknown>[]): SkiaValue<R>;
16
+ /**
17
+ * @deprecated Use Reanimated 3
18
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
19
+ */
20
+ createClockValue(): SkiaClockValue;
21
+ /**
22
+ * @deprecated Use Reanimated 3
23
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
24
+ */
25
+ createAnimation<S extends AnimationState = AnimationState>(cb: (t: number, state: S | undefined) => S): SkiaAnimation;
26
+ };
@@ -1,5 +1,48 @@
1
1
  const {
2
2
  SkiaValueApi
3
3
  } = global;
4
- export const ValueApi = SkiaValueApi;
4
+
5
+ const deprecatedWarning = () => {
6
+ console.warn(`Skia values are deprecated and will be removed in the next Skia release.
7
+ Please use Reanimated instead: https://shopify.github.io/react-native-skia/docs/animations/animations`);
8
+ };
9
+
10
+ export const ValueApi = {
11
+ /**
12
+ * @deprecated Use Reanimated 3
13
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
14
+ */
15
+ createValue(initialValue) {
16
+ deprecatedWarning();
17
+ return SkiaValueApi.createValue(initialValue);
18
+ },
19
+
20
+ /**
21
+ * @deprecated Use Reanimated 3
22
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
23
+ */
24
+ createComputedValue(cb, values) {
25
+ deprecatedWarning();
26
+ return SkiaValueApi.createComputedValue(cb, values);
27
+ },
28
+
29
+ /**
30
+ * @deprecated Use Reanimated 3
31
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
32
+ */
33
+ createClockValue() {
34
+ deprecatedWarning();
35
+ return SkiaValueApi.createClockValue();
36
+ },
37
+
38
+ /**
39
+ * @deprecated Use Reanimated 3
40
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
41
+ */
42
+ createAnimation(cb) {
43
+ deprecatedWarning();
44
+ return SkiaValueApi.createAnimation(cb);
45
+ }
46
+
47
+ };
5
48
  //# sourceMappingURL=api.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SkiaValueApi","global","ValueApi"],"sources":["api.ts"],"sourcesContent":["import type { ISkiaValueApi } from \"./types\";\n\ndeclare global {\n var SkiaValueApi: ISkiaValueApi;\n}\n\nconst { SkiaValueApi } = global;\nexport const ValueApi = SkiaValueApi;\n"],"mappings":"AAMA,MAAM;EAAEA;AAAF,IAAmBC,MAAzB;AACA,OAAO,MAAMC,QAAQ,GAAGF,YAAjB"}
1
+ {"version":3,"names":["SkiaValueApi","global","deprecatedWarning","console","warn","ValueApi","createValue","initialValue","createComputedValue","cb","values","createClockValue","createAnimation"],"sources":["api.ts"],"sourcesContent":["import type {\n AnimationState,\n ISkiaValueApi,\n SkiaAnimation,\n SkiaClockValue,\n SkiaMutableValue,\n SkiaValue,\n} from \"./types\";\n\ndeclare global {\n var SkiaValueApi: ISkiaValueApi;\n}\n\nconst { SkiaValueApi } = global;\n\nconst deprecatedWarning = () => {\n console.warn(\n `Skia values are deprecated and will be removed in the next Skia release.\nPlease use Reanimated instead: https://shopify.github.io/react-native-skia/docs/animations/animations`\n );\n};\n\nexport const ValueApi = {\n /**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n */\n createValue<T>(initialValue: T): SkiaMutableValue<T> {\n deprecatedWarning();\n return SkiaValueApi.createValue(initialValue);\n },\n /**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n */\n createComputedValue<R>(\n cb: () => R,\n values: SkiaValue<unknown>[]\n ): SkiaValue<R> {\n deprecatedWarning();\n return SkiaValueApi.createComputedValue(cb, values);\n },\n /**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n */\n createClockValue(): SkiaClockValue {\n deprecatedWarning();\n return SkiaValueApi.createClockValue();\n },\n /**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n */\n createAnimation<S extends AnimationState = AnimationState>(\n cb: (t: number, state: S | undefined) => S\n ): SkiaAnimation {\n deprecatedWarning();\n return SkiaValueApi.createAnimation(cb);\n },\n};\n"],"mappings":"AAaA,MAAM;EAAEA;AAAF,IAAmBC,MAAzB;;AAEA,MAAMC,iBAAiB,GAAG,MAAM;EAC9BC,OAAO,CAACC,IAAR,CACG;AACL,sGAFE;AAID,CALD;;AAOA,OAAO,MAAMC,QAAQ,GAAG;EACtB;AACF;AACA;AACA;EACEC,WAAW,CAAIC,YAAJ,EAA0C;IACnDL,iBAAiB;IACjB,OAAOF,YAAY,CAACM,WAAb,CAAyBC,YAAzB,CAAP;EACD,CARqB;;EAStB;AACF;AACA;AACA;EACEC,mBAAmB,CACjBC,EADiB,EAEjBC,MAFiB,EAGH;IACdR,iBAAiB;IACjB,OAAOF,YAAY,CAACQ,mBAAb,CAAiCC,EAAjC,EAAqCC,MAArC,CAAP;EACD,CAnBqB;;EAoBtB;AACF;AACA;AACA;EACEC,gBAAgB,GAAmB;IACjCT,iBAAiB;IACjB,OAAOF,YAAY,CAACW,gBAAb,EAAP;EACD,CA3BqB;;EA4BtB;AACF;AACA;AACA;EACEC,eAAe,CACbH,EADa,EAEE;IACfP,iBAAiB;IACjB,OAAOF,YAAY,CAACY,eAAb,CAA6BH,EAA7B,CAAP;EACD;;AArCqB,CAAjB"}
@@ -1,4 +1,7 @@
1
1
  /**
2
+ * @deprecated Use Reanimated 3
3
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
4
+ *
2
5
  * @returns A new value that will be updated on every frame redraw with the
3
6
  * number of milliseconds elapsed since the value was started.
4
7
  * The clock is created in the stopped state.
@@ -1,6 +1,9 @@
1
1
  import { useEffect, useMemo } from "react";
2
2
  import { ValueApi } from "../api";
3
3
  /**
4
+ * @deprecated Use Reanimated 3
5
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
6
+ *
4
7
  * @returns A new value that will be updated on every frame redraw with the
5
8
  * number of milliseconds elapsed since the value was started.
6
9
  * The clock is created in the stopped state.
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useMemo","ValueApi","useClockValue","clock","createClockValue","start","stop"],"sources":["useClockValue.ts"],"sourcesContent":["import { useEffect, useMemo } from \"react\";\n\nimport { ValueApi } from \"../api\";\n\n/**\n * @returns A new value that will be updated on every frame redraw with the\n * number of milliseconds elapsed since the value was started.\n * The clock is created in the stopped state.\n */\n\nexport const useClockValue = () => {\n const clock = useMemo(() => ValueApi.createClockValue(), []);\n useEffect(() => {\n clock.start();\n return clock.stop;\n }, [clock]);\n return clock;\n};\n"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,OAApB,QAAmC,OAAnC;AAEA,SAASC,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,aAAa,GAAG,MAAM;EACjC,MAAMC,KAAK,GAAGH,OAAO,CAAC,MAAMC,QAAQ,CAACG,gBAAT,EAAP,EAAoC,EAApC,CAArB;EACAL,SAAS,CAAC,MAAM;IACdI,KAAK,CAACE,KAAN;IACA,OAAOF,KAAK,CAACG,IAAb;EACD,CAHQ,EAGN,CAACH,KAAD,CAHM,CAAT;EAIA,OAAOA,KAAP;AACD,CAPM"}
1
+ {"version":3,"names":["useEffect","useMemo","ValueApi","useClockValue","clock","createClockValue","start","stop"],"sources":["useClockValue.ts"],"sourcesContent":["import { useEffect, useMemo } from \"react\";\n\nimport { ValueApi } from \"../api\";\n\n/**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n *\n * @returns A new value that will be updated on every frame redraw with the\n * number of milliseconds elapsed since the value was started.\n * The clock is created in the stopped state.\n */\n\nexport const useClockValue = () => {\n const clock = useMemo(() => ValueApi.createClockValue(), []);\n useEffect(() => {\n clock.start();\n return clock.stop;\n }, [clock]);\n return clock;\n};\n"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,OAApB,QAAmC,OAAnC;AAEA,SAASC,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,aAAa,GAAG,MAAM;EACjC,MAAMC,KAAK,GAAGH,OAAO,CAAC,MAAMC,QAAQ,CAACG,gBAAT,EAAP,EAAoC,EAApC,CAArB;EACAL,SAAS,CAAC,MAAM;IACdI,KAAK,CAACE,KAAN;IACA,OAAOF,KAAK,CAACG,IAAb;EACD,CAHQ,EAGN,CAACH,KAAD,CAHM,CAAT;EAIA,OAAOA,KAAP;AACD,CAPM"}