@shopify/react-native-skia 0.1.225 → 0.1.228

Sign up to get free protection for your applications and to get access to all the features.
Files changed (326) hide show
  1. package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h +3 -3
  2. package/cpp/api/JsiSkCanvas.h +2 -1
  3. package/cpp/api/JsiSkMatrix.h +35 -13
  4. package/cpp/api/JsiSkPictureRecorder.h +10 -3
  5. package/cpp/api/JsiSkTypeface.h +1 -0
  6. package/cpp/rnskia/dom/props/MatrixProp.h +19 -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.d.ts +1 -0
  32. package/lib/commonjs/external/reanimated/interpolators.js +24 -5
  33. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
  34. package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +2 -1
  35. package/lib/commonjs/external/reanimated/moduleWrapper.js +9 -7
  36. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
  37. package/lib/commonjs/renderer/Canvas.js +34 -28
  38. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  39. package/lib/commonjs/renderer/components/Drawing.d.ts +5 -0
  40. package/lib/commonjs/renderer/components/Drawing.js +5 -0
  41. package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
  42. package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +5 -5
  43. package/lib/commonjs/skia/core/Matrix.d.ts +2 -2
  44. package/lib/commonjs/skia/core/Matrix.js.map +1 -1
  45. package/lib/commonjs/skia/core/Picture.d.ts +2 -2
  46. package/lib/commonjs/skia/core/Picture.js +12 -2
  47. package/lib/commonjs/skia/core/Picture.js.map +1 -1
  48. package/lib/commonjs/skia/core/Vector.d.ts +0 -5
  49. package/lib/commonjs/skia/core/Vector.js +1 -17
  50. package/lib/commonjs/skia/core/Vector.js.map +1 -1
  51. package/lib/commonjs/skia/types/Canvas.d.ts +1 -1
  52. package/lib/commonjs/skia/types/Canvas.js.map +1 -1
  53. package/lib/commonjs/skia/types/Matrix.d.ts +4 -20
  54. package/lib/commonjs/skia/types/Matrix.js +4 -70
  55. package/lib/commonjs/skia/types/Matrix.js.map +1 -1
  56. package/lib/commonjs/skia/types/Matrix4.d.ts +90 -0
  57. package/lib/commonjs/skia/types/Matrix4.js +312 -0
  58. package/lib/commonjs/skia/types/Matrix4.js.map +1 -0
  59. package/lib/commonjs/skia/types/Path/Path.d.ts +1 -1
  60. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  61. package/lib/commonjs/skia/types/Picture/PictureRecorder.d.ts +1 -1
  62. package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
  63. package/lib/commonjs/skia/types/Rect.d.ts +1 -0
  64. package/lib/commonjs/skia/types/Rect.js +18 -0
  65. package/lib/commonjs/skia/types/Rect.js.map +1 -1
  66. package/lib/commonjs/skia/types/index.d.ts +1 -0
  67. package/lib/commonjs/skia/types/index.js +13 -0
  68. package/lib/commonjs/skia/types/index.js.map +1 -1
  69. package/lib/commonjs/skia/web/Host.d.ts +2 -3
  70. package/lib/commonjs/skia/web/Host.js +4 -12
  71. package/lib/commonjs/skia/web/Host.js.map +1 -1
  72. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -1
  73. package/lib/commonjs/skia/web/JsiSkCanvas.js +13 -13
  74. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  75. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +1 -1
  76. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  77. package/lib/commonjs/skia/web/JsiSkFont.js +2 -2
  78. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  79. package/lib/commonjs/skia/web/JsiSkImage.js +6 -6
  80. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  81. package/lib/commonjs/skia/web/JsiSkImageFactory.js +2 -2
  82. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  83. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +3 -3
  84. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  85. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +1 -1
  86. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  87. package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +2 -2
  88. package/lib/commonjs/skia/web/JsiSkMatrix.js +6 -1
  89. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  90. package/lib/commonjs/skia/web/JsiSkPaint.js +3 -3
  91. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  92. package/lib/commonjs/skia/web/JsiSkPath.js +5 -5
  93. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  94. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +1 -1
  95. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  96. package/lib/commonjs/skia/web/JsiSkPathFactory.js +1 -1
  97. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
  98. package/lib/commonjs/skia/web/JsiSkPicture.js +1 -1
  99. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  100. package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  101. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +1 -1
  102. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  103. package/lib/commonjs/skia/web/JsiSkShaderFactory.js +5 -5
  104. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
  105. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +3 -3
  106. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
  107. package/lib/commonjs/values/api.d.ts +23 -2
  108. package/lib/commonjs/values/api.js +44 -1
  109. package/lib/commonjs/values/api.js.map +1 -1
  110. package/lib/commonjs/values/hooks/useClockValue.d.ts +3 -0
  111. package/lib/commonjs/values/hooks/useClockValue.js +3 -0
  112. package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
  113. package/lib/commonjs/values/hooks/useComputedValue.d.ts +3 -0
  114. package/lib/commonjs/values/hooks/useComputedValue.js +3 -0
  115. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  116. package/lib/commonjs/values/hooks/useValue.d.ts +3 -0
  117. package/lib/commonjs/values/hooks/useValue.js +3 -0
  118. package/lib/commonjs/values/hooks/useValue.js.map +1 -1
  119. package/lib/commonjs/values/hooks/useValueEffect.d.ts +3 -0
  120. package/lib/commonjs/values/hooks/useValueEffect.js +3 -0
  121. package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
  122. package/lib/commonjs/values/types.d.ts +4 -4
  123. package/lib/commonjs/values/types.js.map +1 -1
  124. package/lib/commonjs/views/SkiaView.d.ts +5 -0
  125. package/lib/commonjs/views/SkiaView.js +9 -0
  126. package/lib/commonjs/views/SkiaView.js.map +1 -1
  127. package/lib/module/animation/spring/runSpring.d.ts +3 -0
  128. package/lib/module/animation/spring/runSpring.js +3 -0
  129. package/lib/module/animation/spring/runSpring.js.map +1 -1
  130. package/lib/module/animation/spring/useSpring.d.ts +3 -0
  131. package/lib/module/animation/spring/useSpring.js +3 -0
  132. package/lib/module/animation/spring/useSpring.js.map +1 -1
  133. package/lib/module/animation/timing/runTiming.d.ts +3 -0
  134. package/lib/module/animation/timing/runTiming.js +3 -0
  135. package/lib/module/animation/timing/runTiming.js.map +1 -1
  136. package/lib/module/animation/timing/useLoop.d.ts +3 -0
  137. package/lib/module/animation/timing/useLoop.js +3 -0
  138. package/lib/module/animation/timing/useLoop.js.map +1 -1
  139. package/lib/module/animation/timing/useTiming.d.ts +3 -0
  140. package/lib/module/animation/timing/useTiming.js +3 -0
  141. package/lib/module/animation/timing/useTiming.js.map +1 -1
  142. package/lib/module/dom/nodes/JsiSkDOM.js +2 -0
  143. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  144. package/lib/module/dom/nodes/datatypes/Fitting.d.ts +5 -5
  145. package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
  146. package/lib/module/dom/nodes/datatypes/Gradient.d.ts +235 -75
  147. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  148. package/lib/module/dom/types/Common.d.ts +3 -3
  149. package/lib/module/dom/types/Common.js.map +1 -1
  150. package/lib/module/external/reanimated/interpolators.d.ts +1 -0
  151. package/lib/module/external/reanimated/interpolators.js +22 -6
  152. package/lib/module/external/reanimated/interpolators.js.map +1 -1
  153. package/lib/module/external/reanimated/moduleWrapper.d.ts +2 -1
  154. package/lib/module/external/reanimated/moduleWrapper.js +7 -6
  155. package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
  156. package/lib/module/renderer/Canvas.js +35 -29
  157. package/lib/module/renderer/Canvas.js.map +1 -1
  158. package/lib/module/renderer/components/Drawing.d.ts +5 -0
  159. package/lib/module/renderer/components/Drawing.js +6 -0
  160. package/lib/module/renderer/components/Drawing.js.map +1 -1
  161. package/lib/module/renderer/components/shapes/FitBox.d.ts +5 -5
  162. package/lib/module/skia/core/Matrix.d.ts +2 -2
  163. package/lib/module/skia/core/Matrix.js.map +1 -1
  164. package/lib/module/skia/core/Picture.d.ts +2 -2
  165. package/lib/module/skia/core/Picture.js +12 -3
  166. package/lib/module/skia/core/Picture.js.map +1 -1
  167. package/lib/module/skia/core/Vector.d.ts +0 -5
  168. package/lib/module/skia/core/Vector.js +0 -13
  169. package/lib/module/skia/core/Vector.js.map +1 -1
  170. package/lib/module/skia/types/Canvas.d.ts +1 -1
  171. package/lib/module/skia/types/Canvas.js.map +1 -1
  172. package/lib/module/skia/types/Matrix.d.ts +4 -20
  173. package/lib/module/skia/types/Matrix.js +3 -71
  174. package/lib/module/skia/types/Matrix.js.map +1 -1
  175. package/lib/module/skia/types/Matrix4.d.ts +90 -0
  176. package/lib/module/skia/types/Matrix4.js +274 -0
  177. package/lib/module/skia/types/Matrix4.js.map +1 -0
  178. package/lib/module/skia/types/Path/Path.d.ts +1 -1
  179. package/lib/module/skia/types/Path/Path.js.map +1 -1
  180. package/lib/module/skia/types/Picture/PictureRecorder.d.ts +1 -1
  181. package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
  182. package/lib/module/skia/types/Rect.d.ts +1 -0
  183. package/lib/module/skia/types/Rect.js +9 -0
  184. package/lib/module/skia/types/Rect.js.map +1 -1
  185. package/lib/module/skia/types/index.d.ts +1 -0
  186. package/lib/module/skia/types/index.js +1 -0
  187. package/lib/module/skia/types/index.js.map +1 -1
  188. package/lib/module/skia/web/Host.d.ts +2 -3
  189. package/lib/module/skia/web/Host.js +2 -7
  190. package/lib/module/skia/web/Host.js.map +1 -1
  191. package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -1
  192. package/lib/module/skia/web/JsiSkCanvas.js +14 -14
  193. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  194. package/lib/module/skia/web/JsiSkColorFilterFactory.js +2 -2
  195. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  196. package/lib/module/skia/web/JsiSkFont.js +3 -3
  197. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  198. package/lib/module/skia/web/JsiSkImage.js +7 -7
  199. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  200. package/lib/module/skia/web/JsiSkImageFactory.js +3 -3
  201. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  202. package/lib/module/skia/web/JsiSkImageFilterFactory.js +4 -4
  203. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  204. package/lib/module/skia/web/JsiSkMaskFilterFactory.js +2 -2
  205. package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  206. package/lib/module/skia/web/JsiSkMatrix.d.ts +2 -2
  207. package/lib/module/skia/web/JsiSkMatrix.js +6 -1
  208. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  209. package/lib/module/skia/web/JsiSkPaint.js +4 -4
  210. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  211. package/lib/module/skia/web/JsiSkPath.js +6 -6
  212. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  213. package/lib/module/skia/web/JsiSkPathEffectFactory.js +2 -2
  214. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  215. package/lib/module/skia/web/JsiSkPathFactory.js +2 -2
  216. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
  217. package/lib/module/skia/web/JsiSkPicture.js +2 -2
  218. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  219. package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  220. package/lib/module/skia/web/JsiSkPictureRecorder.js +1 -1
  221. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  222. package/lib/module/skia/web/JsiSkShaderFactory.js +6 -6
  223. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
  224. package/lib/module/skia/web/JsiSkVerticesFactory.js +2 -2
  225. package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
  226. package/lib/module/values/api.d.ts +23 -2
  227. package/lib/module/values/api.js +44 -1
  228. package/lib/module/values/api.js.map +1 -1
  229. package/lib/module/values/hooks/useClockValue.d.ts +3 -0
  230. package/lib/module/values/hooks/useClockValue.js +3 -0
  231. package/lib/module/values/hooks/useClockValue.js.map +1 -1
  232. package/lib/module/values/hooks/useComputedValue.d.ts +3 -0
  233. package/lib/module/values/hooks/useComputedValue.js +3 -0
  234. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  235. package/lib/module/values/hooks/useValue.d.ts +3 -0
  236. package/lib/module/values/hooks/useValue.js +3 -0
  237. package/lib/module/values/hooks/useValue.js.map +1 -1
  238. package/lib/module/values/hooks/useValueEffect.d.ts +3 -0
  239. package/lib/module/values/hooks/useValueEffect.js +3 -0
  240. package/lib/module/values/hooks/useValueEffect.js.map +1 -1
  241. package/lib/module/values/types.d.ts +4 -4
  242. package/lib/module/values/types.js.map +1 -1
  243. package/lib/module/views/SkiaView.d.ts +5 -0
  244. package/lib/module/views/SkiaView.js +10 -0
  245. package/lib/module/views/SkiaView.js.map +1 -1
  246. package/lib/typescript/src/animation/spring/runSpring.d.ts +3 -0
  247. package/lib/typescript/src/animation/spring/useSpring.d.ts +3 -0
  248. package/lib/typescript/src/animation/timing/runTiming.d.ts +3 -0
  249. package/lib/typescript/src/animation/timing/useLoop.d.ts +3 -0
  250. package/lib/typescript/src/animation/timing/useTiming.d.ts +3 -0
  251. package/lib/typescript/src/dom/nodes/datatypes/Fitting.d.ts +5 -5
  252. package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +235 -75
  253. package/lib/typescript/src/dom/types/Common.d.ts +3 -3
  254. package/lib/typescript/src/external/reanimated/interpolators.d.ts +1 -0
  255. package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +2 -1
  256. package/lib/typescript/src/renderer/components/Drawing.d.ts +5 -0
  257. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +5 -5
  258. package/lib/typescript/src/skia/core/Matrix.d.ts +2 -2
  259. package/lib/typescript/src/skia/core/Picture.d.ts +2 -2
  260. package/lib/typescript/src/skia/core/Vector.d.ts +0 -5
  261. package/lib/typescript/src/skia/types/Canvas.d.ts +1 -1
  262. package/lib/typescript/src/skia/types/Matrix.d.ts +4 -20
  263. package/lib/typescript/src/skia/types/Matrix4.d.ts +90 -0
  264. package/lib/typescript/src/skia/types/Path/Path.d.ts +1 -1
  265. package/lib/typescript/src/skia/types/Picture/PictureRecorder.d.ts +1 -1
  266. package/lib/typescript/src/skia/types/Rect.d.ts +1 -0
  267. package/lib/typescript/src/skia/types/index.d.ts +1 -0
  268. package/lib/typescript/src/skia/web/Host.d.ts +2 -3
  269. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -1
  270. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +2 -2
  271. package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  272. package/lib/typescript/src/values/api.d.ts +23 -2
  273. package/lib/typescript/src/values/hooks/useClockValue.d.ts +3 -0
  274. package/lib/typescript/src/values/hooks/useComputedValue.d.ts +3 -0
  275. package/lib/typescript/src/values/hooks/useValue.d.ts +3 -0
  276. package/lib/typescript/src/values/hooks/useValueEffect.d.ts +3 -0
  277. package/lib/typescript/src/values/types.d.ts +4 -4
  278. package/lib/typescript/src/views/SkiaView.d.ts +5 -0
  279. package/package.json +2 -1
  280. package/src/animation/spring/runSpring.ts +3 -0
  281. package/src/animation/spring/useSpring.ts +3 -0
  282. package/src/animation/timing/runTiming.ts +3 -0
  283. package/src/animation/timing/useLoop.ts +3 -0
  284. package/src/animation/timing/useTiming.ts +3 -0
  285. package/src/dom/nodes/JsiSkDOM.ts +4 -0
  286. package/src/dom/nodes/datatypes/Fitting.ts +10 -2
  287. package/src/dom/nodes/datatypes/Gradient.ts +2 -2
  288. package/src/dom/types/Common.ts +5 -3
  289. package/src/external/reanimated/interpolators.ts +30 -7
  290. package/src/external/reanimated/moduleWrapper.ts +6 -0
  291. package/src/renderer/Canvas.tsx +41 -30
  292. package/src/renderer/components/Drawing.tsx +5 -0
  293. package/src/skia/core/Matrix.ts +2 -2
  294. package/src/skia/core/Picture.ts +11 -3
  295. package/src/skia/core/Vector.ts +0 -4
  296. package/src/skia/types/Canvas.ts +1 -1
  297. package/src/skia/types/Matrix.ts +7 -85
  298. package/src/skia/types/Matrix4.ts +344 -0
  299. package/src/skia/types/Path/Path.ts +1 -1
  300. package/src/skia/types/Picture/PictureRecorder.ts +1 -1
  301. package/src/skia/types/Rect.ts +14 -0
  302. package/src/skia/types/index.ts +1 -0
  303. package/src/skia/web/Host.ts +4 -3
  304. package/src/skia/web/JsiSkCanvas.ts +24 -17
  305. package/src/skia/web/JsiSkColorFilterFactory.ts +5 -2
  306. package/src/skia/web/JsiSkFont.ts +3 -3
  307. package/src/skia/web/JsiSkImage.ts +14 -11
  308. package/src/skia/web/JsiSkImageFactory.ts +3 -3
  309. package/src/skia/web/JsiSkImageFilterFactory.ts +5 -5
  310. package/src/skia/web/JsiSkMaskFilterFactory.ts +6 -2
  311. package/src/skia/web/JsiSkMatrix.ts +14 -3
  312. package/src/skia/web/JsiSkPaint.ts +4 -4
  313. package/src/skia/web/JsiSkPath.ts +9 -6
  314. package/src/skia/web/JsiSkPathEffectFactory.ts +2 -2
  315. package/src/skia/web/JsiSkPathFactory.ts +2 -2
  316. package/src/skia/web/JsiSkPicture.ts +4 -4
  317. package/src/skia/web/JsiSkPictureRecorder.ts +6 -2
  318. package/src/skia/web/JsiSkShaderFactory.ts +6 -6
  319. package/src/skia/web/JsiSkVerticesFactory.ts +2 -2
  320. package/src/values/api.ts +55 -2
  321. package/src/values/hooks/useClockValue.ts +3 -0
  322. package/src/values/hooks/useComputedValue.ts +3 -0
  323. package/src/values/hooks/useValue.ts +3 -0
  324. package/src/values/hooks/useValueEffect.ts +3 -0
  325. package/src/values/types.ts +6 -6
  326. package/src/views/SkiaView.tsx +11 -0
@@ -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,MAAMC,WAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;IAChD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IADgD,iCAYxC,MAAM,CACd;IACD,CAdiD;EAEjD;;EAEOC,WAAW,CAACC,MAAD,EAAmB;IACpC,KAAKF,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+B,KAAKL,GAApC,EAAyCE,MAAzC,CAAb;EACD;;EAEOI,YAAY,CAACJ,MAAD,EAAmB;IACrC,KAAKF,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+BH,MAA/B,EAAuC,KAAKF,GAA5C,CAAb;EACD;;EAMDO,MAAM,CAACL,MAAD,EAAmB;IACvB,KAAKD,WAAL,CAAiBJ,WAAW,CAACW,SAAZ,CAAsBN,MAAtB,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDO,SAAS,CAACC,CAAD,EAAYC,CAAZ,EAAuB;IAC9B,KAAKV,WAAL,CAAiB,KAAKF,SAAL,CAAeK,MAAf,CAAsBQ,UAAtB,CAAiCF,CAAjC,EAAoCC,CAApC,CAAjB;IACA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AAf,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":["toMatrix3","HostObject","isMatrixHostObject","obj","Array","isArray","JsiSkMatrix","constructor","CanvasKit","ref","preMultiply","matrix","set","Matrix","multiply","postMultiply","concat","fromValue","length","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 { toMatrix3, type Matrix3, type Matrix4, type SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nconst isMatrixHostObject = (\n obj: SkMatrix | number[] | Matrix4 | Matrix3\n): obj is SkMatrix => !Array.isArray(obj);\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[] | Matrix4 | Matrix3) {\n this.preMultiply(\n // eslint-disable-next-line no-nested-ternary\n isMatrixHostObject(matrix)\n ? JsiSkMatrix.fromValue(matrix)\n : matrix.length === 16\n ? toMatrix3(matrix as Matrix4)\n : [...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":";;AAEA,SAASA,SAAT,QAAqE,UAArE;AAEA,SAASC,UAAT,QAA2B,QAA3B;;AAEA,MAAMC,kBAAkB,GACtBC,GADyB,IAEL,CAACC,KAAK,CAACC,OAAN,CAAcF,GAAd,CAFvB;;AAIA,OAAO,MAAMG,WAAN,SACGL,UADH,CAGP;EACEM,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;IAChD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IADgD,iCAYxC,MAAM,CACd;IACD,CAdiD;EAEjD;;EAEOC,WAAW,CAACC,MAAD,EAAmB;IACpC,KAAKF,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+B,KAAKL,GAApC,EAAyCE,MAAzC,CAAb;EACD;;EAEOI,YAAY,CAACJ,MAAD,EAAmB;IACrC,KAAKF,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,C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eK,MAAf,CAAsBe,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDQ,QAAQ,CAACT,CAAD,EAAYC,CAAZ,EAAuB;IAC7B,KAAKN,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBe,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDS,MAAM,CAACC,KAAD,EAAgB;IACpB,KAAKrB,WAAL,CAAiB,KAAKF,SAAL,CAAeK,MAAf,CAAsBmB,OAAtB,CAA8BD,KAA9B,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDE,UAAU,CAACF,KAAD,EAAgB;IACxB,KAAKhB,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBmB,OAAtB,CAA8BD,KAA9B,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDG,QAAQ,GAAG;IACT,KAAKzB,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBqB,QAAtB,EAAb;IACA,OAAO,IAAP;EACD;;EAEDC,GAAG,GAAG;IACJ,OAAO/B,KAAK,CAACgC,IAAN,CAAW,KAAK3B,GAAhB,CAAP;EACD;;AA5EH"}
@@ -1,6 +1,6 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
 
3
- import { HostObject, ckEnum } from "./Host";
3
+ import { HostObject, getEnum } from "./Host";
4
4
  import { JsiSkColorFilter } from "./JsiSkColorFilter";
5
5
  import { JsiSkImageFilter } from "./JsiSkImageFilter";
6
6
  import { JsiSkMaskFilter } from "./JsiSkMaskFilter";
@@ -60,7 +60,7 @@ export class JsiSkPaint extends HostObject {
60
60
  }
61
61
 
62
62
  setBlendMode(blendMode) {
63
- this.ref.setBlendMode(ckEnum(blendMode));
63
+ this.ref.setBlendMode(getEnum(this.CanvasKit.BlendMode, blendMode));
64
64
  }
65
65
 
66
66
  setColor(color) {
@@ -88,11 +88,11 @@ export class JsiSkPaint extends HostObject {
88
88
  }
89
89
 
90
90
  setStrokeCap(cap) {
91
- this.ref.setStrokeCap(ckEnum(cap));
91
+ this.ref.setStrokeCap(getEnum(this.CanvasKit.StrokeCap, cap));
92
92
  }
93
93
 
94
94
  setStrokeJoin(join) {
95
- this.ref.setStrokeJoin(ckEnum(join));
95
+ this.ref.setStrokeJoin(getEnum(this.CanvasKit.StrokeJoin, join));
96
96
  }
97
97
 
98
98
  setStrokeMiter(limit) {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","ckEnum","JsiSkColorFilter","JsiSkImageFilter","JsiSkMaskFilter","JsiSkPathEffect","JsiSkShader","JsiSkPaint","constructor","CanvasKit","ref","delete","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setDither","dither","setBlendMode","blendMode","setColor","color","setColorFilter","filter","fromValue","setImageFilter","setMaskFilter","setPathEffect","effect","setShader","shader","setStrokeCap","cap","setStrokeJoin","join","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n super(CanvasKit, ref, \"Paint\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setDither(dither: boolean) {\n this.ref.setDither(dither);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(ckEnum(blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(ckEnum(cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(ckEnum(join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style: PaintStyle) {\n this.ref.setStyle({ value: style });\n }\n}\n"],"mappings":";;AAgBA,SAASA,UAAT,EAAqBC,MAArB,QAAmC,QAAnC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,UAAN,SAAyBP,UAAzB,CAAuE;EAC5EQ,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;;IAD4C,iCAIpC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN6C;EAE7C;;EAMDC,IAAI,GAAG;IACL,OAAO,IAAIL,UAAJ,CAAe,KAAKE,SAApB,EAA+B,KAAKC,GAAL,CAASE,IAAT,EAA/B,CAAP;EACD;;EAEDC,KAAK,GAAG;IACN,KAAKH,GAAL,GAAW,IAAI,KAAKD,SAAL,CAAeK,KAAnB,EAAX;EACD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKC,QAAL,GAAgB,CAAhB,CAAP;EACD;;EAEDA,QAAQ,GAAG;IACT,OAAO,KAAKN,GAAL,CAASM,QAAT,EAAP;EACD;;EAEDC,YAAY,GAAG;IACb,OAAO,KAAKP,GAAL,CAASO,YAAT,GAAwBC,KAA/B;EACD;;EAEDC,aAAa,GAAG;IACd,OAAO,KAAKT,GAAL,CAASS,aAAT,GAAyBD,KAAhC;EACD;;EAEDE,cAAc,GAAG;IACf,OAAO,KAAKV,GAAL,CAASU,cAAT,EAAP;EACD;;EAEDC,cAAc,GAAG;IACf,OAAO,KAAKX,GAAL,CAASW,cAAT,EAAP;EACD;;EAEDC,SAAS,CAACC,KAAD,EAAgB;IACvB,KAAKb,GAAL,CAASY,SAAT,CA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AsBxC,MAAM,CAACyC,GAAD,CAA5B;EACD;;EAEDC,aAAa,CAACC,IAAD,EAAmB;IAC9B,KAAKlC,GAAL,CAASiC,aAAT,CAAuB1C,MAAM,CAAC2C,IAAD,CAA7B;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKpC,GAAL,CAASmC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKtC,GAAL,CAASqC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAoB;IAC1B,KAAKxC,GAAL,CAASuC,QAAT,CAAkB;MAAE/B,KAAK,EAAEgC;IAAT,CAAlB;EACD;;AAnG2E"}
1
+ {"version":3,"names":["HostObject","getEnum","JsiSkColorFilter","JsiSkImageFilter","JsiSkMaskFilter","JsiSkPathEffect","JsiSkShader","JsiSkPaint","constructor","CanvasKit","ref","delete","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setDither","dither","setBlendMode","blendMode","BlendMode","setColor","color","setColorFilter","filter","fromValue","setImageFilter","setMaskFilter","setPathEffect","effect","setShader","shader","setStrokeCap","cap","StrokeCap","setStrokeJoin","join","StrokeJoin","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, getEnum } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n super(CanvasKit, ref, \"Paint\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setDither(dither: boolean) {\n this.ref.setDither(dither);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(getEnum(this.CanvasKit.BlendMode, blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(getEnum(this.CanvasKit.StrokeCap, cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(getEnum(this.CanvasKit.StrokeJoin, join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style: PaintStyle) {\n this.ref.setStyle({ value: style });\n }\n}\n"],"mappings":";;AAgBA,SAASA,UAAT,EAAqBC,OAArB,QAAoC,QAApC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,UAAN,SAAyBP,UAAzB,CAAuE;EAC5EQ,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;;IAD4C,iCAIpC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN6C;EAE7C;;EAMDC,IAAI,GAAG;IACL,OAAO,IAAIL,UAAJ,CAAe,KAAKE,SAApB,EAA+B,KAAKC,GAAL,CAASE,IAAT,EAA/B,CAAP;EACD;;EAEDC,KAAK,GAAG;IACN,KAAKH,GAAL,GAAW,IAAI,KAAKD,SAAL,CAAeK,KAAnB,EAAX;EACD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKC,QAAL,GAAgB,CAAhB,CAAP;EACD;;EAEDA,QAAQ,GAAG;IACT,OAAO,KAAKN,GAAL,CAASM,QAAT,EAAP;EACD;;EAEDC,YAAY,GAAG;IACb,OAAO,KAAKP,GAAL,CAASO,YAAT,GAAwBC,KAA/B;EACD;;EAEDC,aAAa,GAAG;IACd,OAAO,KAAKT,GAAL,CAASS,aAAT,GAAyBD,KAAhC;EACD;;EAEDE,cAAc,GAAG;IACf,OAAO,KAAKV,GAAL,CAASU,cAAT,EAAP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GAAL,CAAS8B,SAAT,CAAmBC,MAAM,GAAGnC,WAAW,CAAC6B,SAAZ,CAAsBM,MAAtB,CAAH,GAAmC,IAA5D;EACD;;EAEDC,YAAY,CAACC,GAAD,EAAiB;IAC3B,KAAKjC,GAAL,CAASgC,YAAT,CAAsBzC,OAAO,CAAC,KAAKQ,SAAL,CAAemC,SAAhB,EAA2BD,GAA3B,CAA7B;EACD;;EAEDE,aAAa,CAACC,IAAD,EAAmB;IAC9B,KAAKpC,GAAL,CAASmC,aAAT,CAAuB5C,OAAO,CAAC,KAAKQ,SAAL,CAAesC,UAAhB,EAA4BD,IAA5B,CAA9B;EACD;;EAEDE,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKvC,GAAL,CAASsC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKzC,GAAL,CAASwC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAoB;IAC1B,KAAK3C,GAAL,CAAS0C,QAAT,CAAkB;MAAElC,KAAK,EAAEmC;IAAT,CAAlB;EACD;;AAnG2E"}
@@ -1,7 +1,7 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
 
3
3
  import { PathVerb } from "../types";
4
- import { ckEnum, HostObject, optEnum } from "./Host";
4
+ import { getEnum, HostObject, optEnum } from "./Host";
5
5
  import { JsiSkPoint } from "./JsiSkPoint";
6
6
  import { JsiSkRect } from "./JsiSkRect";
7
7
  import { JsiSkRRect } from "./JsiSkRRect";
@@ -103,7 +103,7 @@ export class JsiSkPath extends HostObject {
103
103
  }
104
104
 
105
105
  setFillType(fill) {
106
- this.ref.setFillType(ckEnum(fill));
106
+ this.ref.setFillType(getEnum(this.CanvasKit.FillType, fill));
107
107
  return this;
108
108
  }
109
109
 
@@ -118,8 +118,8 @@ export class JsiSkPath extends HostObject {
118
118
  // eslint-disable-next-line camelcase
119
119
  miter_limit: opts.width,
120
120
  precision: opts.width,
121
- join: optEnum(opts.join),
122
- cap: optEnum(opts.cap)
121
+ join: optEnum(this.CanvasKit.StrokeJoin, opts.join),
122
+ cap: optEnum(this.CanvasKit.StrokeCap, opts.cap)
123
123
  });
124
124
  return result === null ? result : this;
125
125
  }
@@ -229,7 +229,7 @@ export class JsiSkPath extends HostObject {
229
229
  }
230
230
 
231
231
  op(path, op) {
232
- return this.ref.op(JsiSkPath.fromValue(path), ckEnum(op));
232
+ return this.ref.op(JsiSkPath.fromValue(path), getEnum(this.CanvasKit.PathOp, op));
233
233
  }
234
234
 
235
235
  simplify() {
@@ -253,7 +253,7 @@ export class JsiSkPath extends HostObject {
253
253
  }
254
254
 
255
255
  transform(m3) {
256
- this.ref.transform(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,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,G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AAL,CAA2B,CAACC,GAAD,EAAMC,GAAN,EAAWC,CAAX,KAAiB;MACzD,IAAIA,CAAC,KAAK,CAAV,EAAa;QACXF,GAAG,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,GAAGhJ,YAAY,CAAC+I,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,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","getEnum","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","FillType","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","StrokeJoin","cap","StrokeCap","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","PathOp","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 { getEnum, 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(getEnum(this.CanvasKit.FillType, 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(this.CanvasKit.StrokeJoin, opts.join),\n cap: optEnum(this.CanvasKit.StrokeCap, 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(\n JsiSkPath.fromValue(path),\n getEnum(this.CanvasKit.PathOp, op)\n );\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,OAAT,EAAkBC,UAAlB,EAA8BC,OAA9B,QAA6C,QAA7C;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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GrJ,YAAY,CAACoJ,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,OAAOpG,MAAP;EACD;;AA3WuE"}
@@ -1,4 +1,4 @@
1
- import { ckEnum, Host, NotImplementedOnRNWeb } from "./Host";
1
+ import { getEnum, Host, NotImplementedOnRNWeb } from "./Host";
2
2
  import { JsiSkMatrix } from "./JsiSkMatrix";
3
3
  import { JsiSkPath } from "./JsiSkPath";
4
4
  import { JsiSkPathEffect } from "./JsiSkPathEffect";
@@ -46,7 +46,7 @@ export class JsiSkPathEffectFactory extends Host {
46
46
  }
47
47
 
48
48
  MakePath1D(path, advance, phase, style) {
49
- const pe = this.CanvasKit.PathEffect.MakePath1D(JsiSkPath.fromValue(path), advance, phase, ckEnum(style));
49
+ const pe = this.CanvasKit.PathEffect.MakePath1D(JsiSkPath.fromValue(path), advance, phase, getEnum(this.CanvasKit.Path1DEffect, style));
50
50
 
51
51
  if (pe === null) {
52
52
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["ckEnum","Host","NotImplementedOnRNWeb","JsiSkMatrix","JsiSkPath","JsiSkPathEffect","JsiSkPathEffectFactory","constructor","CanvasKit","MakeCorner","radius","pe","PathEffect","MakeDash","intervals","phase","MakeDiscrete","segLength","dev","seedAssist","MakeCompose","_outer","_inner","MakeSum","MakeLine2D","width","matrix","fromValue","MakePath1D","path","advance","style","MakePath2D"],"sources":["JsiSkPathEffectFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n Path1DEffectStyle,\n PathEffectFactory,\n SkMatrix,\n SkPath,\n SkPathEffect,\n} from \"../types\";\n\nimport { ckEnum, Host, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\n\nexport class JsiSkPathEffectFactory extends Host implements PathEffectFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeCorner(radius: number) {\n const pe = this.CanvasKit.PathEffect.MakeCorner(radius);\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDash(intervals: number[], phase?: number) {\n const pe = this.CanvasKit.PathEffect.MakeDash(intervals, phase);\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDiscrete(segLength: number, dev: number, seedAssist: number) {\n const pe = this.CanvasKit.PathEffect.MakeDiscrete(\n segLength,\n dev,\n seedAssist\n );\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeCompose(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeSum(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeLine2D(width: number, matrix: SkMatrix) {\n const pe = this.CanvasKit.PathEffect.MakeLine2D(\n width,\n JsiSkMatrix.fromValue(matrix)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath1D(\n path: SkPath,\n advance: number,\n phase: number,\n style: Path1DEffectStyle\n ) {\n const pe = this.CanvasKit.PathEffect.MakePath1D(\n JsiSkPath.fromValue(path),\n advance,\n phase,\n ckEnum(style)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath2D(matrix: SkMatrix, path: SkPath) {\n const pe = this.CanvasKit.PathEffect.MakePath2D(\n JsiSkMatrix.fromValue(matrix),\n JsiSkPath.fromValue(path)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n}\n"],"mappings":"AAUA,SAASA,MAAT,EAAiBC,IAAjB,EAAuBC,qBAAvB,QAAoD,QAApD;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA,OAAO,MAAMC,sBAAN,SAAqCL,IAArC,CAAuE;EAC5EM,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,MAAD,EAAiB;IACzB,MAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BH,UAA1B,CAAqCC,MAArC,CAAX;;IACA,IAAIC,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAEDE,QAAQ,CAACC,SAAD,EAAsBC,KAAtB,EAAsC;IAC5C,MAAMJ,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BC,QAA1B,CAAmCC,SAAnC,EAA8CC,KAA9C,CAAX;IACA,OAAO,IAAIV,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAEDK,YAAY,CAACC,SAAD,EAAoBC,GAApB,EAAiCC,UAAjC,EAAqD;IAC/D,MAAMR,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BI,YAA1B,CACTC,SADS,EAETC,GAFS,EAGTC,UAHS,CAAX;IAKA,OAAO,IAAId,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAEDS,WAAW,CAACC,MAAD,EAAuBC,MAAvB,EAA2D;IACpE,MAAM,IAAIpB,qBAAJ,EAAN;EACD;;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ath","JsiSkPathEffect","JsiSkPathEffectFactory","constructor","CanvasKit","MakeCorner","radius","pe","PathEffect","MakeDash","intervals","phase","MakeDiscrete","segLength","dev","seedAssist","MakeCompose","_outer","_inner","MakeSum","MakeLine2D","width","matrix","fromValue","MakePath1D","path","advance","style","Path1DEffect","MakePath2D"],"sources":["JsiSkPathEffectFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n Path1DEffectStyle,\n PathEffectFactory,\n SkMatrix,\n SkPath,\n SkPathEffect,\n} from \"../types\";\n\nimport { getEnum, Host, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\n\nexport class JsiSkPathEffectFactory extends Host implements PathEffectFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeCorner(radius: number) {\n const pe = this.CanvasKit.PathEffect.MakeCorner(radius);\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDash(intervals: number[], phase?: number) {\n const pe = this.CanvasKit.PathEffect.MakeDash(intervals, phase);\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDiscrete(segLength: number, dev: number, seedAssist: number) {\n const pe = this.CanvasKit.PathEffect.MakeDiscrete(\n segLength,\n dev,\n seedAssist\n );\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeCompose(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeSum(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeLine2D(width: number, matrix: SkMatrix) {\n const pe = this.CanvasKit.PathEffect.MakeLine2D(\n width,\n JsiSkMatrix.fromValue(matrix)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath1D(\n path: SkPath,\n advance: number,\n phase: number,\n style: Path1DEffectStyle\n ) {\n const pe = this.CanvasKit.PathEffect.MakePath1D(\n JsiSkPath.fromValue(path),\n advance,\n phase,\n getEnum(this.CanvasKit.Path1DEffect, style)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath2D(matrix: SkMatrix, path: SkPath) {\n const pe = this.CanvasKit.PathEffect.MakePath2D(\n JsiSkMatrix.fromValue(matrix),\n JsiSkPath.fromValue(path)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n}\n"],"mappings":"AAUA,SAASA,OAAT,EAAkBC,IAAlB,EAAwBC,qBAAxB,QAAqD,QAArD;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA,OAAO,MAAMC,sBAAN,SAAqCL,IAArC,CAAuE;EAC5EM,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,MAAD,EAAiB;IACzB,MAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BH,UAA1B,CAAqCC,MAArC,CAAX;;IACA,IAAIC,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAEDE,QAAQ,CAACC,SAAD,EAAsBC,KAAtB,EAAsC;IAC5C,MAAMJ,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BC,QAA1B,CAAmCC,SAAnC,EAA8CC,KAA9C,CAAX;IACA,OAAO,IAAIV,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAEDK,YAAY,CAACC,SAAD,EAAoBC,GAApB,EAAiC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A0BqB,UAA1B,CACT9B,WAAW,CAACwB,SAAZ,CAAsBD,MAAtB,CADS,EAETtB,SAAS,CAACuB,SAAV,CAAoBE,IAApB,CAFS,CAAX;;IAIA,IAAIlB,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;AAzE2E"}
@@ -1,4 +1,4 @@
1
- import { Host, ckEnum, NotImplementedOnRNWeb } from "./Host";
1
+ import { Host, getEnum, NotImplementedOnRNWeb } from "./Host";
2
2
  import { JsiSkPath } from "./JsiSkPath";
3
3
  export class JsiSkPathFactory extends Host {
4
4
  constructor(CanvasKit) {
@@ -20,7 +20,7 @@ export class JsiSkPathFactory extends Host {
20
20
  }
21
21
 
22
22
  MakeFromOp(one, two, op) {
23
- const path = this.CanvasKit.Path.MakeFromOp(JsiSkPath.fromValue(one), JsiSkPath.fromValue(two), ckEnum(op));
23
+ const path = this.CanvasKit.Path.MakeFromOp(JsiSkPath.fromValue(one), JsiSkPath.fromValue(two), getEnum(this.CanvasKit.PathOp, op));
24
24
 
25
25
  if (path === null) {
26
26
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["Host","ckEnum","NotImplementedOnRNWeb","JsiSkPath","JsiSkPathFactory","constructor","CanvasKit","Make","Path","MakeFromSVGString","str","path","MakeFromOp","one","two","op","fromValue","MakeFromCmds","cmds","flat","MakeFromText","_text","_x","_y","_font"],"sources":["JsiSkPathFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { PathCommand, PathOp, SkFont, SkPath } from \"../types\";\nimport type { PathFactory } from \"../types/Path/PathFactory\";\n\nimport { Host, ckEnum, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\n\nexport class JsiSkPathFactory extends Host implements PathFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make() {\n return new JsiSkPath(this.CanvasKit, new this.CanvasKit.Path());\n }\n\n MakeFromSVGString(str: string) {\n const path = this.CanvasKit.Path.MakeFromSVGString(str);\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromOp(one: SkPath, two: SkPath, op: PathOp) {\n const path = this.CanvasKit.Path.MakeFromOp(\n JsiSkPath.fromValue(one),\n JsiSkPath.fromValue(two),\n ckEnum(op)\n );\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromCmds(cmds: PathCommand[]) {\n const path = this.CanvasKit.Path.MakeFromCmds(cmds.flat());\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromText(\n _text: string,\n _x: number,\n _y: number,\n _font: SkFont\n ): SkPath | null {\n throw new NotImplementedOnRNWeb();\n }\n}\n"],"mappings":"AAKA,SAASA,IAAT,EAAeC,MAAf,EAAuBC,qBAAvB,QAAoD,QAApD;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,gBAAN,SAA+BJ,IAA/B,CAA2D;EAChEK,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,GAAG;IACL,OAAO,IAAIJ,SAAJ,CAAc,KAAKG,SAAnB,EAA8B,IAAI,KAAKA,SAAL,CAAeE,IAAnB,EAA9B,CAAP;EACD;;EAEDC,iBAAiB,CAACC,GAAD,EAAc;IAC7B,MAAMC,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBC,iBAApB,CAAsCC,GAAtC,CAAb;;IACA,IAAIC,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDC,UAAU,CAACC,GAAD,EAAcC,GAAd,EAA2BC,EAA3B,EAAuC;IAC/C,MAAMJ,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBI,UAApB,CACXT,SAAS,CAACa,SAAV,CAAoBH,GAApB,CADW,EAEXV,SAAS,CAACa,SAAV,CAAoBF,GAApB,CAFW,EAGXb,MAAM,CAACc,EAAD,CAHK,CAAb;;IAKA,IAAIJ,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDM,YAAY,CAACC,IAAD,EAAsB;IAChC,MAAMP,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBS,YAApB,CAAiCC,IAAI,CAACC,IAAL,EAAjC,CAAb;;IACA,IAAIR,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDS,YAAY,CACVC,KADU,EAEVC,EAFU,EAGVC,EAHU,EAIVC,KAJU,EAKK;IACf,MAAM,IAAItB,qBAAJ,EAAN;EACD;;AA5C+D"}
1
+ {"version":3,"names":["Host","getEnum","NotImplementedOnRNWeb","JsiSkPath","JsiSkPathFactory","constructor","CanvasKit","Make","Path","MakeFromSVGString","str","path","MakeFromOp","one","two","op","fromValue","PathOp","MakeFromCmds","cmds","flat","MakeFromText","_text","_x","_y","_font"],"sources":["JsiSkPathFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { PathCommand, PathOp, SkFont, SkPath } from \"../types\";\nimport type { PathFactory } from \"../types/Path/PathFactory\";\n\nimport { Host, getEnum, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\n\nexport class JsiSkPathFactory extends Host implements PathFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make() {\n return new JsiSkPath(this.CanvasKit, new this.CanvasKit.Path());\n }\n\n MakeFromSVGString(str: string) {\n const path = this.CanvasKit.Path.MakeFromSVGString(str);\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromOp(one: SkPath, two: SkPath, op: PathOp) {\n const path = this.CanvasKit.Path.MakeFromOp(\n JsiSkPath.fromValue(one),\n JsiSkPath.fromValue(two),\n getEnum(this.CanvasKit.PathOp, op)\n );\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromCmds(cmds: PathCommand[]) {\n const path = this.CanvasKit.Path.MakeFromCmds(cmds.flat());\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromText(\n _text: string,\n _x: number,\n _y: number,\n _font: SkFont\n ): SkPath | null {\n throw new NotImplementedOnRNWeb();\n }\n}\n"],"mappings":"AAKA,SAASA,IAAT,EAAeC,OAAf,EAAwBC,qBAAxB,QAAqD,QAArD;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,gBAAN,SAA+BJ,IAA/B,CAA2D;EAChEK,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,GAAG;IACL,OAAO,IAAIJ,SAAJ,CAAc,KAAKG,SAAnB,EAA8B,IAAI,KAAKA,SAAL,CAAeE,IAAnB,EAA9B,CAAP;EACD;;EAEDC,iBAAiB,CAACC,GAAD,EAAc;IAC7B,MAAMC,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBC,iBAApB,CAAsCC,GAAtC,CAAb;;IACA,IAAIC,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDC,UAAU,CAACC,GAAD,EAAcC,GAAd,EAA2BC,EAA3B,EAAuC;IAC/C,MAAMJ,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBI,UAApB,CACXT,SAAS,CAACa,SAAV,CAAoBH,GAApB,CADW,EAEXV,SAAS,CAACa,SAAV,CAAoBF,GAApB,CAFW,EAGXb,OAAO,CAAC,KAAKK,SAAL,CAAeW,MAAhB,EAAwBF,EAAxB,CAHI,CAAb;;IAKA,IAAIJ,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDO,YAAY,CAACC,IAAD,EAAsB;IAChC,MAAMR,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBU,YAApB,CAAiCC,IAAI,CAACC,IAAL,EAAjC,CAAb;;IACA,IAAIT,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDU,YAAY,CACVC,KADU,EAEVC,EAFU,EAGVC,EAHU,EAIVC,KAJU,EAKK;IACf,MAAM,IAAIvB,qBAAJ,EAAN;EACD;;AA5C+D"}
@@ -1,7 +1,7 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
 
3
3
  // TODO: suggest to rename SkPicture to Picture for consistency
4
- import { HostObject, ckEnum } from "./Host";
4
+ import { HostObject, getEnum } from "./Host";
5
5
  import { JsiSkShader } from "./JsiSkShader";
6
6
  import { JsiSkMatrix } from "./JsiSkMatrix";
7
7
  import { JsiSkRect } from "./JsiSkRect";
@@ -15,7 +15,7 @@ export class JsiSkPicture extends HostObject {
15
15
  }
16
16
 
17
17
  makeShader(tmx, tmy, mode, localMatrix, tileRect) {
18
- return new JsiSkShader(this.CanvasKit, this.ref.makeShader(ckEnum(tmx), ckEnum(tmy), ckEnum(mode), localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined, tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined));
18
+ return new JsiSkShader(this.CanvasKit, this.ref.makeShader(getEnum(this.CanvasKit.TileMode, tmx), getEnum(this.CanvasKit.TileMode, tmy), getEnum(this.CanvasKit.FilterMode, mode), localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined, tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined));
19
19
  }
20
20
 
21
21
  serialize() {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","ckEnum","JsiSkShader","JsiSkMatrix","JsiSkRect","JsiSkPicture","constructor","CanvasKit","ref","delete","makeShader","tmx","tmy","mode","localMatrix","tileRect","fromValue","undefined","serialize"],"sources":["JsiSkPicture.ts"],"sourcesContent":["// TODO: suggest to rename SkPicture to Picture for consistency\nimport type { CanvasKit, SkPicture as Picture } from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n SkRect,\n TileMode,\n SkPicture,\n SkMatrix,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPicture\n extends HostObject<Picture, \"Picture\">\n implements SkPicture\n{\n constructor(CanvasKit: CanvasKit, ref: Picture) {\n super(CanvasKit, ref, \"Picture\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n makeShader(\n tmx: TileMode,\n tmy: TileMode,\n mode: FilterMode,\n localMatrix?: SkMatrix,\n tileRect?: SkRect\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n ckEnum(tmx),\n ckEnum(tmy),\n ckEnum(mode),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined,\n tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined\n )\n );\n }\n\n serialize() {\n return this.ref.serialize();\n }\n}\n"],"mappings":";;AAAA;AAWA,SAASA,UAAT,EAAqBC,MAArB,QAAmC,QAAnC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,YAAN,SACGL,UADH,CAGP;EACEM,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;IAC9C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;;IAD8C,iCAItC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN+C;EAE/C;;EAMDC,UAAU,CACRC,GADQ,EAERC,GAFQ,EAGRC,IAHQ,EAIRC,WAJQ,EAKRC,QALQ,EAMR;IACA,OAAO,IAAIb,WAAJ,CACL,KAAKK,SADA,EAEL,KAAKC,GAAL,CAASE,UAAT,CACET,MAAM,CAACU,GAAD,CADR,EAEEV,MAAM,CAACW,GAAD,CAFR,EAGEX,MAAM,CAACY,IAAD,CAHR,EAIEC,WAAW,GAAGX,WAAW,CAACa,SAAZ,CAAsBF,WAAtB,CAAH,GAAwCG,SAJrD,EAKEF,QAAQ,GAAGX,SAAS,CAACY,SAAV,CAAoB,KAAKT,SAAzB,EAAoCQ,QAApC,CAAH,GAAmDE,SAL7D,CAFK,CAAP;EAUD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKV,GAAL,CAASU,SAAT,EAAP;EACD;;AA9BH"}
1
+ {"version":3,"names":["HostObject","getEnum","JsiSkShader","JsiSkMatrix","JsiSkRect","JsiSkPicture","constructor","CanvasKit","ref","delete","makeShader","tmx","tmy","mode","localMatrix","tileRect","TileMode","FilterMode","fromValue","undefined","serialize"],"sources":["JsiSkPicture.ts"],"sourcesContent":["// TODO: suggest to rename SkPicture to Picture for consistency\nimport type { CanvasKit, SkPicture as Picture } from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n SkRect,\n TileMode,\n SkPicture,\n SkMatrix,\n} from \"../types\";\n\nimport { HostObject, getEnum } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPicture\n extends HostObject<Picture, \"Picture\">\n implements SkPicture\n{\n constructor(CanvasKit: CanvasKit, ref: Picture) {\n super(CanvasKit, ref, \"Picture\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n makeShader(\n tmx: TileMode,\n tmy: TileMode,\n mode: FilterMode,\n localMatrix?: SkMatrix,\n tileRect?: SkRect\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n getEnum(this.CanvasKit.TileMode, tmx),\n getEnum(this.CanvasKit.TileMode, tmy),\n getEnum(this.CanvasKit.FilterMode, mode),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined,\n tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined\n )\n );\n }\n\n serialize() {\n return this.ref.serialize();\n }\n}\n"],"mappings":";;AAAA;AAWA,SAASA,UAAT,EAAqBC,OAArB,QAAoC,QAApC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,YAAN,SACGL,UADH,CAGP;EACEM,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;IAC9C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;;IAD8C,iCAItC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN+C;EAE/C;;EAMDC,UAAU,CACRC,GADQ,EAERC,GAFQ,EAGRC,IAHQ,EAIRC,WAJQ,EAKRC,QALQ,EAMR;IACA,OAAO,IAAIb,WAAJ,CACL,KAAKK,SADA,EAEL,KAAKC,GAAL,CAASE,UAAT,CACET,OAAO,CAAC,KAAKM,SAAL,CAAeS,QAAhB,EAA0BL,GAA1B,CADT,EAEEV,OAAO,CAAC,KAAKM,SAAL,CAAeS,QAAhB,EAA0BJ,GAA1B,CAFT,EAGEX,OAAO,CAAC,KAAKM,SAAL,CAAeU,UAAhB,EAA4BJ,IAA5B,CAHT,EAIEC,WAAW,GAAGX,WAAW,CAACe,SAAZ,CAAsBJ,WAAtB,CAAH,GAAwCK,SAJrD,EAKEJ,QAAQ,GAAGX,SAAS,CAACc,SAAV,CAAoB,KAAKX,SAAzB,EAAoCQ,QAApC,CAAH,GAAmDI,SAL7D,CAFK,CAAP;EAUD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKZ,GAAL,CAASY,SAAT,EAAP;EACD;;AA9BH"}
@@ -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,4 +1,4 @@
1
- import { Host, ckEnum } from "./Host";
1
+ import { Host, getEnum } from "./Host";
2
2
  import { JsiSkMatrix } from "./JsiSkMatrix";
3
3
  import { JsiSkPoint } from "./JsiSkPoint";
4
4
  import { JsiSkShader } from "./JsiSkShader";
@@ -8,19 +8,19 @@ export class JsiSkShaderFactory extends Host {
8
8
  }
9
9
 
10
10
  MakeLinearGradient(start, end, colors, pos, mode, localMatrix, flags) {
11
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(JsiSkPoint.fromValue(start), JsiSkPoint.fromValue(end), colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
11
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(JsiSkPoint.fromValue(start), JsiSkPoint.fromValue(end), colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
12
12
  }
13
13
 
14
14
  MakeRadialGradient(center, radius, colors, pos, mode, localMatrix, flags) {
15
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(JsiSkPoint.fromValue(center), radius, colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
15
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(JsiSkPoint.fromValue(center), radius, colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
16
16
  }
17
17
 
18
18
  MakeTwoPointConicalGradient(start, startRadius, end, endRadius, colors, pos, mode, localMatrix, flags) {
19
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(JsiSkPoint.fromValue(start), startRadius, JsiSkPoint.fromValue(end), endRadius, colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
19
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(JsiSkPoint.fromValue(start), startRadius, JsiSkPoint.fromValue(end), endRadius, colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
20
20
  }
21
21
 
22
22
  MakeSweepGradient(cx, cy, colors, pos, mode, localMatrix, flags, startAngleInDegrees, endAngleInDegrees) {
23
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, ckEnum(mode), localMatrix === undefined || localMatrix === null ? undefined : JsiSkMatrix.fromValue(localMatrix), flags, startAngleInDegrees, endAngleInDegrees));
23
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined || localMatrix === null ? undefined : JsiSkMatrix.fromValue(localMatrix), flags, startAngleInDegrees, endAngleInDegrees));
24
24
  }
25
25
 
26
26
  MakeTurbulence(baseFreqX, baseFreqY, octaves, seed, tileW, tileH) {
@@ -32,7 +32,7 @@ export class JsiSkShaderFactory extends Host {
32
32
  }
33
33
 
34
34
  MakeBlend(mode, one, two) {
35
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend(ckEnum(mode), JsiSkShader.fromValue(one), JsiSkShader.fromValue(two)));
35
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend(getEnum(this.CanvasKit.BlendMode, mode), JsiSkShader.fromValue(one), JsiSkShader.fromValue(two)));
36
36
  }
37
37
 
38
38
  MakeColor(color) {
@@ -1 +1 @@
1
- {"version":3,"names":["Host","ckEnum","JsiSkMatrix","JsiSkPoint","JsiSkShader","JsiSkShaderFactory","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","Shader","fromValue","undefined","MakeRadialGradient","center","radius","MakeTwoPointConicalGradient","startRadius","endRadius","MakeSweepGradient","cx","cy","startAngleInDegrees","endAngleInDegrees","MakeTurbulence","baseFreqX","baseFreqY","octaves","seed","tileW","tileH","MakeFractalNoise","MakeBlend","one","two","MakeColor","color","ColorSpace","SRGB"],"sources":["JsiSkShaderFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n SkColor,\n SkMatrix,\n SkPoint,\n SkShader,\n TileMode,\n} from \"../types\";\nimport type { ShaderFactory } from \"../types/Shader/ShaderFactory\";\n\nimport { Host, ckEnum } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkShaderFactory extends Host implements ShaderFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeLinearGradient(\n start: SkPoint,\n end: SkPoint,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeLinearGradient(\n JsiSkPoint.fromValue(start),\n JsiSkPoint.fromValue(end),\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeRadialGradient(\n center: SkPoint,\n radius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeRadialGradient(\n JsiSkPoint.fromValue(center),\n radius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeTwoPointConicalGradient(\n start: SkPoint,\n startRadius: number,\n end: SkPoint,\n endRadius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTwoPointConicalGradient(\n JsiSkPoint.fromValue(start),\n startRadius,\n JsiSkPoint.fromValue(end),\n endRadius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeSweepGradient(\n cx: number,\n cy: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix | null,\n flags?: number,\n startAngleInDegrees?: number,\n endAngleInDegrees?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeSweepGradient(\n cx,\n cy,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined || localMatrix === null\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags,\n startAngleInDegrees,\n endAngleInDegrees\n )\n );\n }\n\n MakeTurbulence(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTurbulence(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeFractalNoise(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeFractalNoise(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeBlend(mode: BlendMode, one: SkShader, two: SkShader) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeBlend(\n ckEnum(mode),\n JsiSkShader.fromValue(one),\n JsiSkShader.fromValue(two)\n )\n );\n }\n\n MakeColor(color: SkColor) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeColor(color, this.CanvasKit.ColorSpace.SRGB)\n );\n }\n}\n"],"mappings":"AAYA,SAASA,IAAT,EAAeC,MAAf,QAA6B,QAA7B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,kBAAN,SAAiCL,IAAjC,CAA+D;EACpEM,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,kBAAkB,CAChBC,KADgB,EAEhBC,GAFgB,EAGhBC,MAHgB,EAIhBC,GAJgB,EAKhBC,IALgB,EAMhBC,WANgB,EAOhBC,KAPgB,EAQhB;IACA,OAAO,IAAIX,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeS,MAAf,CAAsBR,kBAAtB,CACEL,UAAU,CAACc,SAAX,CAAqBR,KAArB,CADF,EAEEN,UAAU,CAACc,SAAX,CAAqBP,GAArB,CAFF,EAGEC,MAHF,EAIEC,GAJF,EAKEX,MAAM,CAACY,IAAD,CALR,EAMEC,WAAW,KAAKI,SAAhB,GACIA,SADJ,GAEIhB,WAAW,CAACe,SAAZ,CAAsBH,WAAtB,CARN,EASEC,KATF,CAFK,CAAP;EAcD;;EAEDI,kBAAkB,CAChBC,MADgB,EAEhBC,MAFgB,EAGhBV,MAHgB,EAIhBC,GAJgB,EAKhBC,IALgB,EAMhBC,WANgB,EAOhBC,KAPgB,EAQh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host","getEnum","JsiSkMatrix","JsiSkPoint","JsiSkShader","JsiSkShaderFactory","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","Shader","fromValue","TileMode","undefined","MakeRadialGradient","center","radius","MakeTwoPointConicalGradient","startRadius","endRadius","MakeSweepGradient","cx","cy","startAngleInDegrees","endAngleInDegrees","MakeTurbulence","baseFreqX","baseFreqY","octaves","seed","tileW","tileH","MakeFractalNoise","MakeBlend","one","two","BlendMode","MakeColor","color","ColorSpace","SRGB"],"sources":["JsiSkShaderFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n SkColor,\n SkMatrix,\n SkPoint,\n SkShader,\n TileMode,\n} from \"../types\";\nimport type { ShaderFactory } from \"../types/Shader/ShaderFactory\";\n\nimport { Host, getEnum } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkShaderFactory extends Host implements ShaderFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeLinearGradient(\n start: SkPoint,\n end: SkPoint,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeLinearGradient(\n JsiSkPoint.fromValue(start),\n JsiSkPoint.fromValue(end),\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeRadialGradient(\n center: SkPoint,\n radius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeRadialGradient(\n JsiSkPoint.fromValue(center),\n radius,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeTwoPointConicalGradient(\n start: SkPoint,\n startRadius: number,\n end: SkPoint,\n endRadius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTwoPointConicalGradient(\n JsiSkPoint.fromValue(start),\n startRadius,\n JsiSkPoint.fromValue(end),\n endRadius,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeSweepGradient(\n cx: number,\n cy: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix | null,\n flags?: number,\n startAngleInDegrees?: number,\n endAngleInDegrees?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeSweepGradient(\n cx,\n cy,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined || localMatrix === null\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags,\n startAngleInDegrees,\n endAngleInDegrees\n )\n );\n }\n\n MakeTurbulence(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTurbulence(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeFractalNoise(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeFractalNoise(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeBlend(mode: BlendMode, one: SkShader, two: SkShader) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeBlend(\n getEnum(this.CanvasKit.BlendMode, mode),\n JsiSkShader.fromValue(one),\n JsiSkShader.fromValue(two)\n )\n );\n }\n\n MakeColor(color: SkColor) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeColor(color, this.CanvasKit.ColorSpace.SRGB)\n );\n }\n}\n"],"mappings":"AAYA,SAASA,IAAT,EAAeC,OAAf,QAA8B,QAA9B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,kBAAN,SAAiCL,IAAjC,CAA+D;EACpEM,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,kBAAkB,CAChBC,KADgB,EAEhBC,GAFgB,EAGhBC,MAHgB,EAIhBC,GAJgB,EAKhBC,IALgB,EAMhBC,WANgB,EAOhBC,KAPgB,EAQhB;IACA,OAAO,IAAIX,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeS,MAAf,CAAsBR,kBAAtB,CACEL,UAAU,CAACc,SAAX,CAAqBR,KAArB,CADF,EAEEN,UAAU,CAACc,SAAX,CAAqBP,GAArB,CAFF,EAGEC,MAHF,EAIEC,GAJF,EAKEX,OAAO,CAAC,KAAKM,SAAL,CAAeW,QAAhB,EAA0BL,IAA1B,CALT,EAMEC,WAAW,KAAKK,SAAhB,GACIA,SADJ,GAEIjB,WAAW,CAACe,SAAZ,CAAsBH,WAAtB,CARN,EASEC,KATF,CAFK,CAAP;EAcD;;EAEDK,kBAAkB,CAChBC,MADgB,EAEhBC,MAFgB,EAGhBX,MAHgB,EAIhBC,GAJgB,EAKhBC,IALgB,EAMhBC,WANgB,EAOhBC,KAPgB,EAQhB;IACA,OAAO,IAAIX,WAAJ,CAC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2B,SAAtB,CAAgCC,KAAhC,EAAuC,KAAKrC,SAAL,CAAesC,UAAf,CAA0BC,IAAjE,CAFK,CAAP;EAID;;AA3KmE"}
@@ -1,5 +1,5 @@
1
- import { ckEnum } from "./Host";
2
1
  import { JsiSkVertices } from "./JsiSkVertices";
2
+ import { getEnum } from "./Host";
3
3
 
4
4
  const concat = function () {
5
5
  let totalLength = 0;
@@ -23,7 +23,7 @@ const concat = function () {
23
23
  return result;
24
24
  };
25
25
 
26
- export const MakeVertices = (CanvasKit, mode, positions, textureCoordinates, colors, indices, isVolatile) => new JsiSkVertices(CanvasKit, CanvasKit.MakeVertices(ckEnum(mode), positions.map(_ref => {
26
+ export const MakeVertices = (CanvasKit, mode, positions, textureCoordinates, colors, indices, isVolatile) => new JsiSkVertices(CanvasKit, CanvasKit.MakeVertices(getEnum(CanvasKit.VertexMode, mode), positions.map(_ref => {
27
27
  let {
28
28
  x,
29
29
  y
@@ -1 +1 @@
1
- {"version":3,"names":["ckEnum","JsiSkVertices","concat","totalLength","arrays","arr","length","result","Float32Array","offset","set","MakeVertices","CanvasKit","mode","positions","textureCoordinates","colors","indices","isVolatile","map","x","y","flat","reduce","a","c"],"sources":["JsiSkVerticesFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkColor, SkPoint, VertexMode } from \"../types\";\n\nimport { ckEnum } from \"./Host\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\n\nconst concat = (...arrays: Float32Array[]) => {\n let totalLength = 0;\n for (const arr of arrays) {\n totalLength += arr.length;\n }\n const result = new Float32Array(totalLength);\n let offset = 0;\n for (const arr of arrays) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n};\n\nexport const MakeVertices = (\n CanvasKit: CanvasKit,\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n) =>\n new JsiSkVertices(\n CanvasKit,\n CanvasKit.MakeVertices(\n ckEnum(mode),\n positions.map(({ x, y }) => [x, y]).flat(),\n (textureCoordinates || []).map(({ x, y }) => [x, y]).flat(),\n !colors ? null : colors.reduce((a, c) => concat(a, c)),\n indices,\n isVolatile\n )\n );\n"],"mappings":"AAIA,SAASA,MAAT,QAAuB,QAAvB;AACA,SAASC,aAAT,QAA8B,iBAA9B;;AAEA,MAAMC,MAAM,GAAG,YAA+B;EAC5C,IAAIC,WAAW,GAAG,CAAlB;;EAD4C,kCAA3BC,MAA2B;IAA3BA,MAA2B;EAAA;;EAE5C,KAAK,MAAMC,GAAX,IAAkBD,MAAlB,EAA0B;IACxBD,WAAW,IAAIE,GAAG,CAACC,MAAnB;EACD;;EACD,MAAMC,MAAM,GAAG,IAAIC,YAAJ,CAAiBL,WAAjB,CAAf;EACA,IAAIM,MAAM,GAAG,CAAb;;EACA,KAAK,MAAMJ,GAAX,IAAkBD,MAAlB,EAA0B;IACxBG,MAAM,CAACG,GAAP,CAAWL,GAAX,EAAgBI,MAAhB;IACAA,MAAM,IAAIJ,GAAG,CAACC,MAAd;EACD;;EACD,OAAOC,MAAP;AACD,CAZD;;AAcA,OAAO,MAAMI,YAAY,GAAG,CAC1BC,SAD0B,EAE1BC,IAF0B,EAG1BC,SAH0B,EAI1BC,kBAJ0B,EAK1BC,MAL0B,EAM1BC,OAN0B,EAO1BC,UAP0B,KAS1B,IAAIjB,aAAJ,CACEW,SADF,EAEEA,SAAS,CAACD,YAAV,CACEX,MAAM,CAACa,IAAD,CADR,EAEEC,SAAS,CAACK,GAAV,CAAc;EAAA,IAAC;IAAEC,CAAF;IAAKC;EAAL,CAAD;EAAA,OAAc,CAACD,CAAD,EAAIC,CAAJ,CAAd;AAAA,CAAd,EAAoCC,IAApC,EAFF,EAGE,CAACP,kBAAkB,IAAI,EAAvB,EAA2BI,GAA3B,CAA+B;EAAA,IAAC;IAAEC,CAAF;IAAKC;EAAL,CAAD;EAAA,OAAc,CAACD,CAAD,EAAIC,CAAJ,CAAd;AAAA,CAA/B,EAAqDC,IAArD,EAHF,EAIE,CAACN,MAAD,GAAU,IAAV,GAAiBA,MAAM,CAACO,MAAP,CAAc,CAACC,CAAD,EAAIC,CAAJ,KAAUvB,MAAM,CAACsB,CAAD,EAAIC,CAAJ,CAA9B,CAJnB,EAKER,OALF,EAMEC,UANF,CAFF,CATK"}
1
+ {"version":3,"names":["JsiSkVertices","getEnum","concat","totalLength","arrays","arr","length","result","Float32Array","offset","set","MakeVertices","CanvasKit","mode","positions","textureCoordinates","colors","indices","isVolatile","VertexMode","map","x","y","flat","reduce","a","c"],"sources":["JsiSkVerticesFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkColor, SkPoint, VertexMode } from \"../types\";\n\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { getEnum } from \"./Host\";\n\nconst concat = (...arrays: Float32Array[]) => {\n let totalLength = 0;\n for (const arr of arrays) {\n totalLength += arr.length;\n }\n const result = new Float32Array(totalLength);\n let offset = 0;\n for (const arr of arrays) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n};\n\nexport const MakeVertices = (\n CanvasKit: CanvasKit,\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n) =>\n new JsiSkVertices(\n CanvasKit,\n CanvasKit.MakeVertices(\n getEnum(CanvasKit.VertexMode, mode),\n positions.map(({ x, y }) => [x, y]).flat(),\n (textureCoordinates || []).map(({ x, y }) => [x, y]).flat(),\n !colors ? null : colors.reduce((a, c) => concat(a, c)),\n indices,\n isVolatile\n )\n );\n"],"mappings":"AAIA,SAASA,aAAT,QAA8B,iBAA9B;AACA,SAASC,OAAT,QAAwB,QAAxB;;AAEA,MAAMC,MAAM,GAAG,YAA+B;EAC5C,IAAIC,WAAW,GAAG,CAAlB;;EAD4C,kCAA3BC,MAA2B;IAA3BA,MAA2B;EAAA;;EAE5C,K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Value, 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"}