@shopify/react-native-skia 0.1.191 → 0.1.192

Sign up to get free protection for your applications and to get access to all the features.
Files changed (317) hide show
  1. package/cpp/api/JsiSkColorFilter.h +2 -17
  2. package/cpp/api/JsiSkContourMeasure.h +3 -17
  3. package/cpp/api/JsiSkContourMeasureIter.h +3 -18
  4. package/cpp/api/JsiSkData.h +1 -18
  5. package/cpp/api/JsiSkFont.h +4 -14
  6. package/cpp/api/JsiSkHostObjects.h +85 -10
  7. package/cpp/api/JsiSkImage.h +1 -12
  8. package/cpp/api/JsiSkImageFilter.h +1 -17
  9. package/cpp/api/JsiSkMaskFilter.h +1 -17
  10. package/cpp/api/JsiSkMatrix.h +3 -6
  11. package/cpp/api/JsiSkPaint.h +3 -15
  12. package/cpp/api/JsiSkPath.h +2 -15
  13. package/cpp/api/JsiSkPathEffect.h +2 -17
  14. package/cpp/api/JsiSkPicture.h +4 -18
  15. package/cpp/api/JsiSkPictureRecorder.h +4 -1
  16. package/cpp/api/JsiSkPoint.h +6 -1
  17. package/cpp/api/JsiSkRRect.h +6 -1
  18. package/cpp/api/JsiSkRSXform.h +4 -6
  19. package/cpp/api/JsiSkRect.h +6 -2
  20. package/cpp/api/JsiSkRuntimeEffect.h +4 -7
  21. package/cpp/api/JsiSkRuntimeShaderBuilder.h +2 -10
  22. package/cpp/api/JsiSkSVG.h +1 -10
  23. package/cpp/api/JsiSkShader.h +2 -16
  24. package/cpp/api/JsiSkSurface.h +3 -16
  25. package/cpp/api/JsiSkTextBlob.h +2 -18
  26. package/cpp/api/JsiSkTypeface.h +1 -22
  27. package/cpp/api/JsiSkVertices.h +3 -17
  28. package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -2
  29. package/cpp/rnskia/values/RNSkValue.h +1 -1
  30. package/lib/commonjs/renderer/Canvas.js +17 -1
  31. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  32. package/lib/commonjs/skia/core/Data.d.ts +2 -2
  33. package/lib/commonjs/skia/core/Data.js.map +1 -1
  34. package/lib/commonjs/skia/types/Data/Data.d.ts +2 -2
  35. package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
  36. package/lib/commonjs/skia/types/Image/Image.d.ts +2 -2
  37. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  38. package/lib/commonjs/skia/types/JsiInstance.d.ts +4 -4
  39. package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
  40. package/lib/commonjs/skia/types/SVG/SVG.d.ts +2 -2
  41. package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
  42. package/lib/commonjs/skia/types/Typeface/Typeface.d.ts +2 -2
  43. package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
  44. package/lib/commonjs/skia/web/Host.d.ts +1 -0
  45. package/lib/commonjs/skia/web/Host.js +2 -0
  46. package/lib/commonjs/skia/web/Host.js.map +1 -1
  47. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -0
  48. package/lib/commonjs/skia/web/JsiSkCanvas.js +6 -0
  49. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  50. package/lib/commonjs/skia/web/JsiSkColorFilter.d.ts +1 -0
  51. package/lib/commonjs/skia/web/JsiSkColorFilter.js +6 -0
  52. package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
  53. package/lib/commonjs/skia/web/JsiSkContourMeasure.d.ts +1 -0
  54. package/lib/commonjs/skia/web/JsiSkContourMeasure.js +6 -0
  55. package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
  56. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  57. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +6 -0
  58. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  59. package/lib/commonjs/skia/web/JsiSkData.d.ts +1 -1
  60. package/lib/commonjs/skia/web/JsiSkData.js +4 -2
  61. package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
  62. package/lib/commonjs/skia/web/JsiSkFont.d.ts +1 -0
  63. package/lib/commonjs/skia/web/JsiSkFont.js +6 -0
  64. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  65. package/lib/commonjs/skia/web/JsiSkImage.d.ts +1 -1
  66. package/lib/commonjs/skia/web/JsiSkImage.js +6 -4
  67. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  68. package/lib/commonjs/skia/web/JsiSkImageFilter.d.ts +1 -0
  69. package/lib/commonjs/skia/web/JsiSkImageFilter.js +6 -0
  70. package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
  71. package/lib/commonjs/skia/web/JsiSkMaskFilter.d.ts +1 -0
  72. package/lib/commonjs/skia/web/JsiSkMaskFilter.js +6 -0
  73. package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
  74. package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +1 -0
  75. package/lib/commonjs/skia/web/JsiSkMatrix.js +5 -0
  76. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  77. package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  78. package/lib/commonjs/skia/web/JsiSkPaint.js +6 -0
  79. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  80. package/lib/commonjs/skia/web/JsiSkPath.d.ts +1 -0
  81. package/lib/commonjs/skia/web/JsiSkPath.js +6 -0
  82. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  83. package/lib/commonjs/skia/web/JsiSkPathEffect.d.ts +1 -0
  84. package/lib/commonjs/skia/web/JsiSkPathEffect.js +6 -0
  85. package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
  86. package/lib/commonjs/skia/web/JsiSkPicture.d.ts +1 -0
  87. package/lib/commonjs/skia/web/JsiSkPicture.js +6 -1
  88. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  89. package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  90. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +6 -0
  91. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  92. package/lib/commonjs/skia/web/JsiSkPoint.d.ts +1 -0
  93. package/lib/commonjs/skia/web/JsiSkPoint.js +5 -0
  94. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
  95. package/lib/commonjs/skia/web/JsiSkRRect.d.ts +1 -0
  96. package/lib/commonjs/skia/web/JsiSkRRect.js +5 -0
  97. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
  98. package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -0
  99. package/lib/commonjs/skia/web/JsiSkRSXform.js +5 -0
  100. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  101. package/lib/commonjs/skia/web/JsiSkRect.d.ts +1 -0
  102. package/lib/commonjs/skia/web/JsiSkRect.js +5 -0
  103. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  104. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  105. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -0
  106. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  107. package/lib/commonjs/skia/web/JsiSkShader.d.ts +1 -0
  108. package/lib/commonjs/skia/web/JsiSkShader.js +6 -0
  109. package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
  110. package/lib/commonjs/skia/web/JsiSkSurface.d.ts +1 -0
  111. package/lib/commonjs/skia/web/JsiSkSurface.js +6 -0
  112. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  113. package/lib/commonjs/skia/web/JsiSkTextBlob.d.ts +1 -0
  114. package/lib/commonjs/skia/web/JsiSkTextBlob.js +6 -0
  115. package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
  116. package/lib/commonjs/skia/web/JsiSkTypeface.d.ts +1 -1
  117. package/lib/commonjs/skia/web/JsiSkTypeface.js +6 -4
  118. package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
  119. package/lib/commonjs/skia/web/JsiSkVertices.d.ts +1 -0
  120. package/lib/commonjs/skia/web/JsiSkVertices.js +6 -0
  121. package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
  122. package/lib/commonjs/values/hooks/useComputedValue.js +1 -1
  123. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  124. package/lib/commonjs/values/types.d.ts +1 -1
  125. package/lib/commonjs/values/types.js.map +1 -1
  126. package/lib/commonjs/values/web/RNSkComputedValue.d.ts +1 -1
  127. package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
  128. package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
  129. package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +1 -1
  130. package/lib/commonjs/values/web/RNSkReadonlyValue.js +1 -1
  131. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
  132. package/lib/commonjs/views/SkiaDomView.web.js +14 -4
  133. package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
  134. package/lib/commonjs/views/types.d.ts +2 -1
  135. package/lib/commonjs/views/types.js.map +1 -1
  136. package/lib/module/renderer/Canvas.js +15 -1
  137. package/lib/module/renderer/Canvas.js.map +1 -1
  138. package/lib/module/skia/core/Data.d.ts +2 -2
  139. package/lib/module/skia/core/Data.js.map +1 -1
  140. package/lib/module/skia/types/Data/Data.d.ts +2 -2
  141. package/lib/module/skia/types/Data/Data.js.map +1 -1
  142. package/lib/module/skia/types/Image/Image.d.ts +2 -2
  143. package/lib/module/skia/types/Image/Image.js.map +1 -1
  144. package/lib/module/skia/types/JsiInstance.d.ts +4 -4
  145. package/lib/module/skia/types/JsiInstance.js.map +1 -1
  146. package/lib/module/skia/types/SVG/SVG.d.ts +2 -2
  147. package/lib/module/skia/types/SVG/SVG.js.map +1 -1
  148. package/lib/module/skia/types/Typeface/Typeface.d.ts +2 -2
  149. package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
  150. package/lib/module/skia/web/Host.d.ts +1 -0
  151. package/lib/module/skia/web/Host.js +2 -0
  152. package/lib/module/skia/web/Host.js.map +1 -1
  153. package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -0
  154. package/lib/module/skia/web/JsiSkCanvas.js +6 -0
  155. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  156. package/lib/module/skia/web/JsiSkColorFilter.d.ts +1 -0
  157. package/lib/module/skia/web/JsiSkColorFilter.js +6 -0
  158. package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
  159. package/lib/module/skia/web/JsiSkContourMeasure.d.ts +1 -0
  160. package/lib/module/skia/web/JsiSkContourMeasure.js +6 -0
  161. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
  162. package/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  163. package/lib/module/skia/web/JsiSkContourMeasureIter.js +6 -0
  164. package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  165. package/lib/module/skia/web/JsiSkData.d.ts +1 -1
  166. package/lib/module/skia/web/JsiSkData.js +4 -2
  167. package/lib/module/skia/web/JsiSkData.js.map +1 -1
  168. package/lib/module/skia/web/JsiSkFont.d.ts +1 -0
  169. package/lib/module/skia/web/JsiSkFont.js +6 -0
  170. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  171. package/lib/module/skia/web/JsiSkImage.d.ts +1 -1
  172. package/lib/module/skia/web/JsiSkImage.js +6 -4
  173. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  174. package/lib/module/skia/web/JsiSkImageFilter.d.ts +1 -0
  175. package/lib/module/skia/web/JsiSkImageFilter.js +6 -0
  176. package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
  177. package/lib/module/skia/web/JsiSkMaskFilter.d.ts +1 -0
  178. package/lib/module/skia/web/JsiSkMaskFilter.js +6 -0
  179. package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
  180. package/lib/module/skia/web/JsiSkMatrix.d.ts +1 -0
  181. package/lib/module/skia/web/JsiSkMatrix.js +5 -0
  182. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  183. package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  184. package/lib/module/skia/web/JsiSkPaint.js +6 -0
  185. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  186. package/lib/module/skia/web/JsiSkPath.d.ts +1 -0
  187. package/lib/module/skia/web/JsiSkPath.js +6 -0
  188. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  189. package/lib/module/skia/web/JsiSkPathEffect.d.ts +1 -0
  190. package/lib/module/skia/web/JsiSkPathEffect.js +6 -0
  191. package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
  192. package/lib/module/skia/web/JsiSkPicture.d.ts +1 -0
  193. package/lib/module/skia/web/JsiSkPicture.js +6 -0
  194. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  195. package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  196. package/lib/module/skia/web/JsiSkPictureRecorder.js +6 -0
  197. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  198. package/lib/module/skia/web/JsiSkPoint.d.ts +1 -0
  199. package/lib/module/skia/web/JsiSkPoint.js +5 -0
  200. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  201. package/lib/module/skia/web/JsiSkRRect.d.ts +1 -0
  202. package/lib/module/skia/web/JsiSkRRect.js +5 -0
  203. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  204. package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -0
  205. package/lib/module/skia/web/JsiSkRSXform.js +5 -0
  206. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  207. package/lib/module/skia/web/JsiSkRect.d.ts +1 -0
  208. package/lib/module/skia/web/JsiSkRect.js +5 -0
  209. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  210. package/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  211. package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -0
  212. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  213. package/lib/module/skia/web/JsiSkShader.d.ts +1 -0
  214. package/lib/module/skia/web/JsiSkShader.js +6 -0
  215. package/lib/module/skia/web/JsiSkShader.js.map +1 -1
  216. package/lib/module/skia/web/JsiSkSurface.d.ts +1 -0
  217. package/lib/module/skia/web/JsiSkSurface.js +6 -0
  218. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  219. package/lib/module/skia/web/JsiSkTextBlob.d.ts +1 -0
  220. package/lib/module/skia/web/JsiSkTextBlob.js +6 -0
  221. package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
  222. package/lib/module/skia/web/JsiSkTypeface.d.ts +1 -1
  223. package/lib/module/skia/web/JsiSkTypeface.js +6 -4
  224. package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
  225. package/lib/module/skia/web/JsiSkVertices.d.ts +1 -0
  226. package/lib/module/skia/web/JsiSkVertices.js +6 -0
  227. package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
  228. package/lib/module/values/hooks/useComputedValue.js +1 -1
  229. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  230. package/lib/module/values/types.d.ts +1 -1
  231. package/lib/module/values/types.js.map +1 -1
  232. package/lib/module/values/web/RNSkComputedValue.d.ts +1 -1
  233. package/lib/module/values/web/RNSkComputedValue.js +1 -1
  234. package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
  235. package/lib/module/values/web/RNSkReadonlyValue.d.ts +1 -1
  236. package/lib/module/values/web/RNSkReadonlyValue.js +1 -1
  237. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
  238. package/lib/module/views/SkiaDomView.web.js +13 -4
  239. package/lib/module/views/SkiaDomView.web.js.map +1 -1
  240. package/lib/module/views/types.d.ts +2 -1
  241. package/lib/module/views/types.js.map +1 -1
  242. package/lib/typescript/src/skia/core/Data.d.ts +2 -2
  243. package/lib/typescript/src/skia/types/Data/Data.d.ts +2 -2
  244. package/lib/typescript/src/skia/types/Image/Image.d.ts +2 -2
  245. package/lib/typescript/src/skia/types/JsiInstance.d.ts +4 -4
  246. package/lib/typescript/src/skia/types/SVG/SVG.d.ts +2 -2
  247. package/lib/typescript/src/skia/types/Typeface/Typeface.d.ts +2 -2
  248. package/lib/typescript/src/skia/web/Host.d.ts +1 -0
  249. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -0
  250. package/lib/typescript/src/skia/web/JsiSkColorFilter.d.ts +1 -0
  251. package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +1 -0
  252. package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  253. package/lib/typescript/src/skia/web/JsiSkData.d.ts +1 -1
  254. package/lib/typescript/src/skia/web/JsiSkFont.d.ts +1 -0
  255. package/lib/typescript/src/skia/web/JsiSkImage.d.ts +1 -1
  256. package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +1 -0
  257. package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +1 -0
  258. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +1 -0
  259. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  260. package/lib/typescript/src/skia/web/JsiSkPath.d.ts +1 -0
  261. package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +1 -0
  262. package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +1 -0
  263. package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  264. package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +1 -0
  265. package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +1 -0
  266. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -0
  267. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +1 -0
  268. package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  269. package/lib/typescript/src/skia/web/JsiSkShader.d.ts +1 -0
  270. package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -0
  271. package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +1 -0
  272. package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +1 -1
  273. package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +1 -0
  274. package/lib/typescript/src/values/types.d.ts +1 -1
  275. package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +1 -1
  276. package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +1 -1
  277. package/lib/typescript/src/views/types.d.ts +2 -1
  278. package/package.json +1 -1
  279. package/src/renderer/Canvas.tsx +21 -1
  280. package/src/skia/core/Data.ts +3 -3
  281. package/src/skia/types/Data/Data.ts +2 -2
  282. package/src/skia/types/Image/Image.ts +2 -2
  283. package/src/skia/types/JsiInstance.ts +4 -4
  284. package/src/skia/types/SVG/SVG.ts +2 -2
  285. package/src/skia/types/Typeface/Typeface.ts +2 -2
  286. package/src/skia/web/Host.ts +2 -0
  287. package/src/skia/web/JsiSkCanvas.ts +4 -0
  288. package/src/skia/web/JsiSkColorFilter.ts +4 -0
  289. package/src/skia/web/JsiSkContourMeasure.ts +4 -0
  290. package/src/skia/web/JsiSkContourMeasureIter.ts +4 -0
  291. package/src/skia/web/JsiSkData.ts +3 -3
  292. package/src/skia/web/JsiSkFont.ts +4 -0
  293. package/src/skia/web/JsiSkImage.ts +2 -2
  294. package/src/skia/web/JsiSkImageFilter.ts +4 -0
  295. package/src/skia/web/JsiSkMaskFilter.ts +4 -0
  296. package/src/skia/web/JsiSkMatrix.ts +4 -0
  297. package/src/skia/web/JsiSkPaint.ts +4 -0
  298. package/src/skia/web/JsiSkPath.ts +4 -0
  299. package/src/skia/web/JsiSkPathEffect.ts +4 -0
  300. package/src/skia/web/JsiSkPicture.ts +4 -0
  301. package/src/skia/web/JsiSkPictureRecorder.ts +4 -0
  302. package/src/skia/web/JsiSkPoint.ts +4 -0
  303. package/src/skia/web/JsiSkRRect.ts +4 -0
  304. package/src/skia/web/JsiSkRSXform.ts +4 -0
  305. package/src/skia/web/JsiSkRect.ts +4 -0
  306. package/src/skia/web/JsiSkRuntimeEffect.ts +4 -0
  307. package/src/skia/web/JsiSkShader.ts +4 -0
  308. package/src/skia/web/JsiSkSurface.ts +4 -0
  309. package/src/skia/web/JsiSkTextBlob.ts +4 -0
  310. package/src/skia/web/JsiSkTypeface.ts +2 -2
  311. package/src/skia/web/JsiSkVertices.ts +4 -0
  312. package/src/values/hooks/useComputedValue.ts +1 -1
  313. package/src/values/types.ts +1 -1
  314. package/src/values/web/RNSkComputedValue.ts +1 -1
  315. package/src/values/web/RNSkReadonlyValue.ts +1 -1
  316. package/src/views/SkiaDomView.web.tsx +6 -1
  317. package/src/views/types.ts +2 -1
@@ -9,4 +9,5 @@ export declare class JsiSkContourMeasure extends HostObject<ContourMeasure, "Con
9
9
  getSegment(startD: number, stopD: number, startWithMoveTo: boolean): JsiSkPath;
10
10
  isClosed(): boolean;
11
11
  length(): number;
12
+ dispose: () => void;
12
13
  }
@@ -1,9 +1,15 @@
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
+
1
3
  import { HostObject } from "./Host";
2
4
  import { JsiSkPath } from "./JsiSkPath";
3
5
  import { JsiSkPoint } from "./JsiSkPoint";
4
6
  export class JsiSkContourMeasure extends HostObject {
5
7
  constructor(CanvasKit, ref) {
6
8
  super(CanvasKit, ref, "ContourMeasure");
9
+
10
+ _defineProperty(this, "dispose", () => {
11
+ this.ref.delete();
12
+ });
7
13
  }
8
14
 
9
15
  getPosTan(distance) {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkPath","JsiSkPoint","JsiSkContourMeasure","constructor","CanvasKit","ref","getPosTan","distance","posTan","slice","getSegment","startD","stopD","startWithMoveTo","isClosed","length"],"sources":["JsiSkContourMeasure.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasure } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasure } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkContourMeasure\n extends HostObject<ContourMeasure, \"ContourMeasure\">\n implements SkContourMeasure\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasure) {\n super(CanvasKit, ref, \"ContourMeasure\");\n }\n\n getPosTan(distance: number): [position: JsiSkPoint, tangent: JsiSkPoint] {\n const posTan = this.ref.getPosTan(distance);\n return [\n new JsiSkPoint(this.CanvasKit, posTan.slice(0, 2)),\n new JsiSkPoint(this.CanvasKit, posTan.slice(2)),\n ];\n }\n\n getSegment(startD: number, stopD: number, startWithMoveTo: boolean) {\n return new JsiSkPath(\n this.CanvasKit,\n this.ref.getSegment(startD, stopD, startWithMoveTo)\n );\n }\n\n isClosed() {\n return this.ref.isClosed();\n }\n\n length() {\n return this.ref.length();\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA,OAAO,MAAMC,mBAAN,SACGH,UADH,CAGP;EACEI,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA4C;IACrD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,gBAAtB;EACD;;EAEDC,SAAS,CAACC,QAAD,EAAgE;IACvE,MAAMC,MAAM,GAAG,KAAKH,GAAL,CAASC,SAAT,CAAmBC,QAAnB,CAAf;IACA,OAAO,CACL,IAAIN,UAAJ,CAAe,KAAKG,SAApB,EAA+BI,MAAM,CAACC,KAAP,CAAa,CAAb,EAAgB,CAAhB,CAA/B,CADK,EAEL,IAAIR,UAAJ,CAAe,KAAKG,SAApB,EAA+BI,MAAM,CAACC,KAAP,CAAa,CAAb,CAA/B,CAFK,CAAP;EAID;;EAEDC,UAAU,CAACC,MAAD,EAAiBC,KAAjB,EAAgCC,eAAhC,EAA0D;IAClE,OAAO,IAAIb,SAAJ,CACL,KAAKI,SADA,EAEL,KAAKC,GAAL,CAASK,UAAT,CAAoBC,MAApB,EAA4BC,KAA5B,EAAmCC,eAAnC,CAFK,CAAP;EAID;;EAEDC,QAAQ,GAAG;IACT,OAAO,KAAKT,GAAL,CAASS,QAAT,EAAP;EACD;;EAEDC,MAAM,GAAG;IACP,OAAO,KAAKV,GAAL,CAASU,MAAT,EAAP;EACD;;AA1BH"}
1
+ {"version":3,"names":["HostObject","JsiSkPath","JsiSkPoint","JsiSkContourMeasure","constructor","CanvasKit","ref","delete","getPosTan","distance","posTan","slice","getSegment","startD","stopD","startWithMoveTo","isClosed","length"],"sources":["JsiSkContourMeasure.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasure } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasure } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkContourMeasure\n extends HostObject<ContourMeasure, \"ContourMeasure\">\n implements SkContourMeasure\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasure) {\n super(CanvasKit, ref, \"ContourMeasure\");\n }\n\n getPosTan(distance: number): [position: JsiSkPoint, tangent: JsiSkPoint] {\n const posTan = this.ref.getPosTan(distance);\n return [\n new JsiSkPoint(this.CanvasKit, posTan.slice(0, 2)),\n new JsiSkPoint(this.CanvasKit, posTan.slice(2)),\n ];\n }\n\n getSegment(startD: number, stopD: number, startWithMoveTo: boolean) {\n return new JsiSkPath(\n this.CanvasKit,\n this.ref.getSegment(startD, stopD, startWithMoveTo)\n );\n }\n\n isClosed() {\n return this.ref.isClosed();\n }\n\n length() {\n return this.ref.length();\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA,OAAO,MAAMC,mBAAN,SACGH,UADH,CAGP;EACEI,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA4C;IACrD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,gBAAtB;;IADqD,iCA2B7C,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CA7BsD;EAEtD;;EAEDC,SAAS,CAACC,QAAD,EAAgE;IACvE,MAAMC,MAAM,GAAG,KAAKJ,GAAL,CAASE,SAAT,CAAmBC,QAAnB,CAAf;IACA,OAAO,CACL,IAAIP,UAAJ,CAAe,KAAKG,SAApB,EAA+BK,MAAM,CAACC,KAAP,CAAa,CAAb,EAAgB,CAAhB,CAA/B,CADK,EAEL,IAAIT,UAAJ,CAAe,KAAKG,SAApB,EAA+BK,MAAM,CAACC,KAAP,CAAa,CAAb,CAA/B,CAFK,CAAP;EAID;;EAEDC,UAAU,CAACC,MAAD,EAAiBC,KAAjB,EAAgCC,eAAhC,EAA0D;IAClE,OAAO,IAAId,SAAJ,CACL,KAAKI,SADA,EAEL,KAAKC,GAAL,CAASM,UAAT,CAAoBC,MAApB,EAA4BC,KAA5B,EAAmCC,eAAnC,CAFK,CAAP;EAID;;EAEDC,QAAQ,GAAG;IACT,OAAO,KAAKV,GAAL,CAASU,QAAT,EAAP;EACD;;EAEDC,MAAM,GAAG;IACP,OAAO,KAAKX,GAAL,CAASW,MAAT,EAAP;EACD;;AA1BH"}
@@ -5,4 +5,5 @@ import { JsiSkContourMeasure } from "./JsiSkContourMeasure";
5
5
  export declare class JsiSkContourMeasureIter extends HostObject<ContourMeasureIter, "ContourMeasureIter"> implements SkContourMeasureIter {
6
6
  constructor(CanvasKit: CanvasKit, ref: ContourMeasureIter);
7
7
  next(): JsiSkContourMeasure | null;
8
+ dispose: () => void;
8
9
  }
@@ -1,8 +1,14 @@
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
+
1
3
  import { HostObject } from "./Host";
2
4
  import { JsiSkContourMeasure } from "./JsiSkContourMeasure";
3
5
  export class JsiSkContourMeasureIter extends HostObject {
4
6
  constructor(CanvasKit, ref) {
5
7
  super(CanvasKit, ref, "ContourMeasureIter");
8
+
9
+ _defineProperty(this, "dispose", () => {
10
+ this.ref.delete();
11
+ });
6
12
  }
7
13
 
8
14
  next() {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkContourMeasure","JsiSkContourMeasureIter","constructor","CanvasKit","ref","next","result"],"sources":["JsiSkContourMeasureIter.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasureIter } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasureIter } from \"../types/ContourMeasure\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkContourMeasure } from \"./JsiSkContourMeasure\";\n\nexport class JsiSkContourMeasureIter\n extends HostObject<ContourMeasureIter, \"ContourMeasureIter\">\n implements SkContourMeasureIter\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasureIter) {\n super(CanvasKit, ref, \"ContourMeasureIter\");\n }\n\n next() {\n const result = this.ref.next();\n if (result === null) {\n return null;\n }\n return new JsiSkContourMeasure(this.CanvasKit, result);\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,mBAAT,QAAoC,uBAApC;AAEA,OAAO,MAAMC,uBAAN,SACGF,UADH,CAGP;EACEG,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAgD;IACzD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,oBAAtB;EACD;;EAEDC,IAAI,GAAG;IACL,MAAMC,MAAM,GAAG,KAAKF,GAAL,CAASC,IAAT,EAAf;;IACA,IAAIC,MAAM,KAAK,IAAf,EAAqB;MACnB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,mBAAJ,CAAwB,KAAKG,SAA7B,EAAwCG,MAAxC,CAAP;EACD;;AAXH"}
1
+ {"version":3,"names":["HostObject","JsiSkContourMeasure","JsiSkContourMeasureIter","constructor","CanvasKit","ref","delete","next","result"],"sources":["JsiSkContourMeasureIter.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasureIter } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasureIter } from \"../types/ContourMeasure\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkContourMeasure } from \"./JsiSkContourMeasure\";\n\nexport class JsiSkContourMeasureIter\n extends HostObject<ContourMeasureIter, \"ContourMeasureIter\">\n implements SkContourMeasureIter\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasureIter) {\n super(CanvasKit, ref, \"ContourMeasureIter\");\n }\n\n next() {\n const result = this.ref.next();\n if (result === null) {\n return null;\n }\n return new JsiSkContourMeasure(this.CanvasKit, result);\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,mBAAT,QAAoC,uBAApC;AAEA,OAAO,MAAMC,uBAAN,SACGF,UADH,CAGP;EACEG,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAgD;IACzD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,oBAAtB;;IADyD,iCAYjD,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAd0D;EAE1D;;EAEDC,IAAI,GAAG;IACL,MAAMC,MAAM,GAAG,KAAKH,GAAL,CAASE,IAAT,EAAf;;IACA,IAAIC,MAAM,KAAK,IAAf,EAAqB;MACnB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIP,mBAAJ,CAAwB,KAAKG,SAA7B,EAAwCI,MAAxC,CAAP;EACD;;AAXH"}
@@ -4,6 +4,6 @@ import { HostObject } from "./Host";
4
4
  declare type Data = ArrayBuffer;
5
5
  export declare class JsiSkData extends HostObject<Data, "Data"> implements SkData {
6
6
  constructor(CanvasKit: CanvasKit, ref: Data);
7
- dispose(): void;
7
+ dispose: () => void;
8
8
  }
9
9
  export {};
@@ -1,10 +1,12 @@
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
+
1
3
  import { HostObject } from "./Host";
2
4
  export class JsiSkData extends HostObject {
3
5
  constructor(CanvasKit, ref) {
4
6
  super(CanvasKit, ref, "Data");
5
- }
6
7
 
7
- dispose() {// Not implemented in data
8
+ _defineProperty(this, "dispose", () => {// Not implemented in data - since data is a raw ArrayBuffer
9
+ });
8
10
  }
9
11
 
10
12
  }
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkData","constructor","CanvasKit","ref","dispose"],"sources":["JsiSkData.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\ntype Data = ArrayBuffer;\n\nexport class JsiSkData extends HostObject<Data, \"Data\"> implements SkData {\n constructor(CanvasKit: CanvasKit, ref: Data) {\n super(CanvasKit, ref, \"Data\");\n }\n\n dispose() {\n // Not implemented in data\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAIA,OAAO,MAAMC,SAAN,SAAwBD,UAAxB,CAAmE;EACxEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;EACD;;EAEDC,OAAO,GAAG,CACR;EACD;;AAPuE"}
1
+ {"version":3,"names":["HostObject","JsiSkData","constructor","CanvasKit","ref"],"sources":["JsiSkData.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\ntype Data = ArrayBuffer;\n\nexport class JsiSkData extends HostObject<Data, \"Data\"> implements SkData {\n constructor(CanvasKit: CanvasKit, ref: Data) {\n super(CanvasKit, ref, \"Data\");\n }\n\n dispose = () => {\n // Not implemented in data - since data is a raw ArrayBuffer\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AAIA,OAAO,MAAMC,SAAN,SAAwBD,UAAxB,CAAmE;EACxEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAInC,MAAM,CACd;IACD,CAN4C;EAE5C;;AAHuE"}
@@ -5,6 +5,7 @@ import { JsiSkRect } from "./JsiSkRect";
5
5
  import { JsiSkTypeface } from "./JsiSkTypeface";
6
6
  export declare class JsiSkFont extends HostObject<Font, "Font"> implements SkFont {
7
7
  constructor(CanvasKit: CanvasKit, ref: Font);
8
+ dispose: () => void;
8
9
  getTextWidth(text: string, paint?: SkPaint | undefined): number;
9
10
  getMetrics(): {
10
11
  ascent: number;
@@ -1,3 +1,5 @@
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
+
1
3
  import { HostObject, ckEnum } from "./Host";
2
4
  import { JsiSkPaint } from "./JsiSkPaint";
3
5
  import { JsiSkPoint } from "./JsiSkPoint";
@@ -6,6 +8,10 @@ import { JsiSkTypeface } from "./JsiSkTypeface";
6
8
  export class JsiSkFont extends HostObject {
7
9
  constructor(CanvasKit, ref) {
8
10
  super(CanvasKit, ref, "Font");
11
+
12
+ _defineProperty(this, "dispose", () => {
13
+ this.ref.delete();
14
+ });
9
15
  }
10
16
 
11
17
  getTextWidth(text, paint) {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","ckEnum","JsiSkPaint","JsiSkPoint","JsiSkRect","JsiSkTypeface","JsiSkFont","constructor","CanvasKit","ref","getTextWidth","text","paint","ids","getGlyphIDs","widths","getGlyphWidths","reduce","a","b","getMetrics","result","ascent","descent","leading","bounds","undefined","str","numCodePoints","glyphs","fromValue","getGlyphIntercepts","positions","top","bottom","map","p","Array","from","flat","getScaleX","getSize","getSkewX","isEmbolden","getTypeface","tf","setEdging","edging","setEmbeddedBitmaps","embeddedBitmaps","setHinting","hinting","setLinearMetrics","linearMetrics","setScaleX","sx","setSize","points","setSkewX","setEmbolden","embolden","setSubpixel","subpixel","setTypeface","face"],"sources":["JsiSkFont.ts"],"sourcesContent":["import type { CanvasKit, Font } from \"canvaskit-wasm\";\n\nimport type {\n FontEdging,\n FontHinting,\n SkFont,\n SkPaint,\n SkPoint,\n SkTypeface,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkFont extends HostObject<Font, \"Font\"> implements SkFont {\n constructor(CanvasKit: CanvasKit, ref: Font) {\n super(CanvasKit, ref, \"Font\");\n }\n\n getTextWidth(text: string, paint?: SkPaint | undefined) {\n const ids = this.getGlyphIDs(text);\n const widths = this.getGlyphWidths(ids, paint);\n return widths.reduce((a, b) => a + b, 0);\n }\n\n getMetrics() {\n const result = this.ref.getMetrics();\n return {\n ascent: result.ascent,\n descent: result.descent,\n leading: result.leading,\n bounds: result.bounds\n ? new JsiSkRect(this.CanvasKit, result.bounds)\n : undefined,\n };\n }\n\n getGlyphIDs(str: string, numCodePoints?: number) {\n // TODO: Fix return value in the C++ implementation\n return [...this.ref.getGlyphIDs(str, numCodePoints)];\n }\n\n // TODO: Fix return value in the C++ implementation, it return float32\n getGlyphWidths(glyphs: number[], paint?: SkPaint | null) {\n return [\n ...this.ref.getGlyphWidths(\n glyphs,\n paint ? JsiSkPaint.fromValue(paint) : null\n ),\n ];\n }\n\n getGlyphIntercepts(\n glyphs: number[],\n positions: SkPoint[],\n top: number,\n bottom: number\n ) {\n return [\n ...this.ref.getGlyphIntercepts(\n glyphs,\n positions.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n top,\n bottom\n ),\n ];\n }\n\n getScaleX() {\n return this.ref.getScaleX();\n }\n\n getSize() {\n return this.ref.getSize();\n }\n\n getSkewX() {\n return this.ref.getSkewX();\n }\n\n isEmbolden() {\n return this.ref.isEmbolden();\n }\n\n getTypeface() {\n const tf = this.ref.getTypeface();\n return tf ? new JsiSkTypeface(this.CanvasKit, tf) : null;\n }\n\n setEdging(edging: FontEdging) {\n this.ref.setEdging(ckEnum(edging));\n }\n\n setEmbeddedBitmaps(embeddedBitmaps: boolean) {\n this.ref.setEmbeddedBitmaps(embeddedBitmaps);\n }\n\n setHinting(hinting: FontHinting) {\n this.ref.setHinting(ckEnum(hinting));\n }\n\n setLinearMetrics(linearMetrics: boolean) {\n this.ref.setLinearMetrics(linearMetrics);\n }\n\n setScaleX(sx: number) {\n this.ref.setScaleX(sx);\n }\n\n setSize(points: number) {\n this.ref.setSize(points);\n }\n\n setSkewX(sx: number) {\n this.ref.setSkewX(sx);\n }\n\n setEmbolden(embolden: boolean) {\n this.ref.setEmbolden(embolden);\n }\n\n setSubpixel(subpixel: boolean) {\n this.ref.setSubpixel(subpixel);\n }\n\n setTypeface(face: SkTypeface | null) {\n this.ref.setTypeface(face ? JsiSkTypeface.fromValue(face) : null);\n }\n}\n"],"mappings":"AAWA,SAASA,UAAT,EAAqBC,MAArB,QAAmC,QAAnC;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,OAAO,MAAMC,SAAN,SAAwBN,UAAxB,CAAmE;EACxEO,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;EACD;;EAEDC,YAAY,CAACC,IAAD,EAAeC,KAAf,EAA4C;IACtD,MAAMC,GAAG,GAAG,KAAKC,WAAL,CAAiBH,IAAjB,CAAZ;IACA,MAAMI,MAAM,GAAG,KAAKC,cAAL,CAAoBH,GAApB,EAAyBD,KAAzB,CAAf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ACD;;EAEDC,WAAW,CAACC,IAAD,EAA0B;IACnC,KAAKvD,GAAL,CAASsD,WAAT,CAAqBC,IAAI,GAAG3D,aAAa,CAACyB,SAAd,CAAwBkC,IAAxB,CAAH,GAAmC,IAA5D;EACD;;AAjHuE"}
1
+ {"version":3,"names":["HostObject","ckEnum","JsiSkPaint","JsiSkPoint","JsiSkRect","JsiSkTypeface","JsiSkFont","constructor","CanvasKit","ref","delete","getTextWidth","text","paint","ids","getGlyphIDs","widths","getGlyphWidths","reduce","a","b","getMetrics","result","ascent","descent","leading","bounds","undefined","str","numCodePoints","glyphs","fromValue","getGlyphIntercepts","positions","top","bottom","map","p","Array","from","flat","getScaleX","getSize","getSkewX","isEmbolden","getTypeface","tf","setEdging","edging","setEmbeddedBitmaps","embeddedBitmaps","setHinting","hinting","setLinearMetrics","linearMetrics","setScaleX","sx","setSize","points","setSkewX","setEmbolden","embolden","setSubpixel","subpixel","setTypeface","face"],"sources":["JsiSkFont.ts"],"sourcesContent":["import type { CanvasKit, Font } from \"canvaskit-wasm\";\n\nimport type {\n FontEdging,\n FontHinting,\n SkFont,\n SkPaint,\n SkPoint,\n SkTypeface,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkFont extends HostObject<Font, \"Font\"> implements SkFont {\n constructor(CanvasKit: CanvasKit, ref: Font) {\n super(CanvasKit, ref, \"Font\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n getTextWidth(text: string, paint?: SkPaint | undefined) {\n const ids = this.getGlyphIDs(text);\n const widths = this.getGlyphWidths(ids, paint);\n return widths.reduce((a, b) => a + b, 0);\n }\n\n getMetrics() {\n const result = this.ref.getMetrics();\n return {\n ascent: result.ascent,\n descent: result.descent,\n leading: result.leading,\n bounds: result.bounds\n ? new JsiSkRect(this.CanvasKit, result.bounds)\n : undefined,\n };\n }\n\n getGlyphIDs(str: string, numCodePoints?: number) {\n // TODO: Fix return value in the C++ implementation\n return [...this.ref.getGlyphIDs(str, numCodePoints)];\n }\n\n // TODO: Fix return value in the C++ implementation, it return float32\n getGlyphWidths(glyphs: number[], paint?: SkPaint | null) {\n return [\n ...this.ref.getGlyphWidths(\n glyphs,\n paint ? JsiSkPaint.fromValue(paint) : null\n ),\n ];\n }\n\n getGlyphIntercepts(\n glyphs: number[],\n positions: SkPoint[],\n top: number,\n bottom: number\n ) {\n return [\n ...this.ref.getGlyphIntercepts(\n glyphs,\n positions.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n top,\n bottom\n ),\n ];\n }\n\n getScaleX() {\n return this.ref.getScaleX();\n }\n\n getSize() {\n return this.ref.getSize();\n }\n\n getSkewX() {\n return this.ref.getSkewX();\n }\n\n isEmbolden() {\n return this.ref.isEmbolden();\n }\n\n getTypeface() {\n const tf = this.ref.getTypeface();\n return tf ? new JsiSkTypeface(this.CanvasKit, tf) : null;\n }\n\n setEdging(edging: FontEdging) {\n this.ref.setEdging(ckEnum(edging));\n }\n\n setEmbeddedBitmaps(embeddedBitmaps: boolean) {\n this.ref.setEmbeddedBitmaps(embeddedBitmaps);\n }\n\n setHinting(hinting: FontHinting) {\n this.ref.setHinting(ckEnum(hinting));\n }\n\n setLinearMetrics(linearMetrics: boolean) {\n this.ref.setLinearMetrics(linearMetrics);\n }\n\n setScaleX(sx: number) {\n this.ref.setScaleX(sx);\n }\n\n setSize(points: number) {\n this.ref.setSize(points);\n }\n\n setSkewX(sx: number) {\n this.ref.setSkewX(sx);\n }\n\n setEmbolden(embolden: boolean) {\n this.ref.setEmbolden(embolden);\n }\n\n setSubpixel(subpixel: boolean) {\n this.ref.setSubpixel(subpixel);\n }\n\n setTypeface(face: SkTypeface | null) {\n this.ref.setTypeface(face ? JsiSkTypeface.fromValue(face) : null);\n }\n}\n"],"mappings":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AT,CAAoBlD,MAAM,CAACmD,OAAD,CAA1B;EACD;;EAEDC,gBAAgB,CAACC,aAAD,EAAyB;IACvC,KAAK7C,GAAL,CAAS4C,gBAAT,CAA0BC,aAA1B;EACD;;EAEDC,SAAS,CAACC,EAAD,EAAa;IACpB,KAAK/C,GAAL,CAAS8C,SAAT,CAAmBC,EAAnB;EACD;;EAEDC,OAAO,CAACC,MAAD,EAAiB;IACtB,KAAKjD,GAAL,CAASgD,OAAT,CAAiBC,MAAjB;EACD;;EAEDC,QAAQ,CAACH,EAAD,EAAa;IACnB,KAAK/C,GAAL,CAASkD,QAAT,CAAkBH,EAAlB;EACD;;EAEDI,WAAW,CAACC,QAAD,EAAoB;IAC7B,KAAKpD,GAAL,CAASmD,WAAT,CAAqBC,QAArB;EACD;;EAEDC,WAAW,CAACC,QAAD,EAAoB;IAC7B,KAAKtD,GAAL,CAASqD,WAAT,CAAqBC,QAArB;EACD;;EAEDC,WAAW,CAACC,IAAD,EAA0B;IACnC,KAAKxD,GAAL,CAASuD,WAAT,CAAqBC,IAAI,GAAG5D,aAAa,CAAC0B,SAAd,CAAwBkC,IAAxB,CAAH,GAAmC,IAA5D;EACD;;AArHuE"}
@@ -10,6 +10,6 @@ export declare class JsiSkImage extends HostObject<Image, "Image"> implements Sk
10
10
  makeShaderCubic(tx: TileMode, ty: TileMode, B: number, C: number, localMatrix?: SkMatrix): SkShader;
11
11
  encodeToBytes(fmt?: ImageFormat, quality?: number): Uint8Array;
12
12
  encodeToBase64(fmt?: ImageFormat, quality?: number): string;
13
- dispose(): void;
13
+ dispose: () => void;
14
14
  makeNonTextureImage(): SkImage;
15
15
  }
@@ -1,3 +1,5 @@
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
+
1
3
  import { ckEnum, HostObject } from "./Host";
2
4
  import { JsiSkMatrix } from "./JsiSkMatrix";
3
5
  import { JsiSkShader } from "./JsiSkShader"; // https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js
@@ -33,6 +35,10 @@ export const toBase64String = bytes => {
33
35
  export class JsiSkImage extends HostObject {
34
36
  constructor(CanvasKit, ref) {
35
37
  super(CanvasKit, ref, "Image");
38
+
39
+ _defineProperty(this, "dispose", () => {
40
+ this.ref.delete();
41
+ });
36
42
  }
37
43
 
38
44
  height() {
@@ -74,10 +80,6 @@ export class JsiSkImage extends HostObject {
74
80
  return toBase64String(bytes);
75
81
  }
76
82
 
77
- dispose() {
78
- this.ref.delete();
79
- }
80
-
81
83
  makeNonTextureImage() {
82
84
  return new JsiSkImage(this.CanvasKit, this.CanvasKit.MakeImageFromEncoded(this.encodeToBytes()));
83
85
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ckEnum","HostObject","JsiSkMatrix","JsiSkShader","toBase64String","bytes","Buffer","from","toString","CHUNK_SIZE","index","length","result","slice","Math","min","String","fromCharCode","apply","btoa","JsiSkImage","constructor","CanvasKit","ref","height","width","makeShaderOptions","tx","ty","fm","mm","localMatrix","fromValue","undefined","makeShaderCubic","B","C","encodeToBytes","fmt","quality","Error","encodeToBase64","dispose","delete","makeNonTextureImage","MakeImageFromEncoded"],"sources":["JsiSkImage.ts"],"sourcesContent":["import type { CanvasKit, Image } from \"canvaskit-wasm\";\n\nimport type {\n ImageFormat,\n FilterMode,\n MipmapMode,\n SkImage,\n SkMatrix,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { ckEnum, HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\n// https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js\nexport const toBase64String = (bytes: Uint8Array) => {\n if (typeof Buffer !== \"undefined\") {\n // Are we on node?\n return Buffer.from(bytes).toString(\"base64\");\n } else {\n // From https://stackoverflow.com/a/25644409\n // because the naive solution of\n // btoa(String.fromCharCode.apply(null, bytes));\n // would occasionally throw \"Maximum call stack size exceeded\"\n var CHUNK_SIZE = 0x8000; //arbitrary number\n var index = 0;\n var { length } = bytes;\n var result = \"\";\n var slice;\n while (index < length) {\n slice = bytes.slice(index, Math.min(index + CHUNK_SIZE, length));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result += String.fromCharCode.apply(null, slice as any);\n index += CHUNK_SIZE;\n }\n return btoa(result);\n }\n};\n\nexport class JsiSkImage extends HostObject<Image, \"Image\"> implements SkImage {\n constructor(CanvasKit: CanvasKit, ref: Image) {\n super(CanvasKit, ref, \"Image\");\n }\n\n height() {\n return this.ref.height();\n }\n\n width() {\n return this.ref.width();\n }\n\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderOptions(\n ckEnum(tx),\n ckEnum(ty),\n ckEnum(fm),\n ckEnum(mm),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderCubic(\n ckEnum(tx),\n ckEnum(ty),\n B,\n C,\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n encodeToBytes(fmt?: ImageFormat, quality?: number) {\n let result: Uint8Array | null;\n if (fmt && quality) {\n result = this.ref.encodeToBytes(ckEnum(fmt), quality);\n } else if (fmt) {\n result = this.ref.encodeToBytes(ckEnum(fmt));\n } else {\n result = this.ref.encodeToBytes();\n }\n if (!result) {\n throw new Error(\"encodeToBytes failed\");\n }\n return result;\n }\n\n encodeToBase64(fmt?: ImageFormat, quality?: number) {\n const bytes = this.encodeToBytes(fmt, quality);\n return toBase64String(bytes);\n }\n\n dispose() {\n this.ref.delete();\n }\n\n makeNonTextureImage(): SkImage {\n return new JsiSkImage(\n this.CanvasKit,\n this.CanvasKit.MakeImageFromEncoded(this.encodeToBytes())!\n );\n }\n}\n"],"mappings":"AAYA,SAASA,MAAT,EAAiBC,UAAjB,QAAmC,QAAnC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B,C,CAEA;;AACA,OAAO,MAAMC,cAAc,GAAIC,KAAD,IAAuB;EACnD,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;IACjC;IACA,OAAOA,MAAM,CAACC,IAAP,CAAYF,KAAZ,EAAmBG,QAAnB,CAA4B,QAA5B,CAAP;EACD,CAHD,MAGO;IACL;IACA;IACA;IACA;IACA,IAAIC,UAAU,GAAG,MAAjB,CALK,CAKoB;;IACzB,IAAIC,KAAK,GAAG,CAAZ;IACA,IAAI;MAAEC;IAAF,IAAaN,KAAjB;IACA,IAAIO,MAAM,GAAG,EAAb;IACA,IAAIC,KAAJ;;IACA,OAAOH,KAAK,GAAGC,MAAf,EAAuB;MACrBE,KAAK,GAAGR,KAAK,CAACQ,KAAN,CAAYH,KAAZ,EAAmBI,IAAI,CAACC,GAAL,CAASL,KAAK,GAAGD,UAAjB,EAA6BE,MAA7B,CAAnB,CAAR,CADqB,CAErB;;MACAC,MAAM,IAAII,MAAM,CAACC,YAAP,CAAoBC,KAApB,CAA0B,IAA1B,EAAgCL,KAAhC,CAAV;MACAH,KAAK,IAAID,UAAT;IACD;;IACD,OAAOU,IAAI,CAACP,MAAD,CAAX;EACD;AACF,CAtBM;AAwBP,OAAO,MAAMQ,UAAN,SAAyBnB,UAAzB,CAAuE;EAC5EoB,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;EACD;;EAEDC,MAAM,GAAG;IACP,OAAO,KAAKD,GAAL,CAASC,MAAT,EA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D,IAAI,CAACzB,MAAL,EAAa;MACX,MAAM,IAAI4B,KAAJ,CAAU,sBAAV,CAAN;IACD;;IACD,OAAO5B,MAAP;EACD;;EAED6B,cAAc,CAACH,GAAD,EAAoBC,OAApB,EAAsC;IAClD,MAAMlC,KAAK,GAAG,KAAKgC,aAAL,CAAmBC,GAAnB,EAAwBC,OAAxB,CAAd;IACA,OAAOnC,cAAc,CAACC,KAAD,CAArB;EACD;;EAEDqC,OAAO,GAAG;IACR,KAAKnB,GAAL,CAASoB,MAAT;EACD;;EAEDC,mBAAmB,GAAY;IAC7B,OAAO,IAAIxB,UAAJ,CACL,KAAKE,SADA,EAEL,KAAKA,SAAL,CAAeuB,oBAAf,CAAoC,KAAKR,aAAL,EAApC,CAFK,CAAP;EAID;;AAhF2E"}
1
+ {"version":3,"names":["ckEnum","HostObject","JsiSkMatrix","JsiSkShader","toBase64String","bytes","Buffer","from","toString","CHUNK_SIZE","index","length","result","slice","Math","min","String","fromCharCode","apply","btoa","JsiSkImage","constructor","CanvasKit","ref","delete","height","width","makeShaderOptions","tx","ty","fm","mm","localMatrix","fromValue","undefined","makeShaderCubic","B","C","encodeToBytes","fmt","quality","Error","encodeToBase64","makeNonTextureImage","MakeImageFromEncoded"],"sources":["JsiSkImage.ts"],"sourcesContent":["import type { CanvasKit, Image } from \"canvaskit-wasm\";\n\nimport type {\n ImageFormat,\n FilterMode,\n MipmapMode,\n SkImage,\n SkMatrix,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { ckEnum, HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\n// https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js\nexport const toBase64String = (bytes: Uint8Array) => {\n if (typeof Buffer !== \"undefined\") {\n // Are we on node?\n return Buffer.from(bytes).toString(\"base64\");\n } else {\n // From https://stackoverflow.com/a/25644409\n // because the naive solution of\n // btoa(String.fromCharCode.apply(null, bytes));\n // would occasionally throw \"Maximum call stack size exceeded\"\n var CHUNK_SIZE = 0x8000; //arbitrary number\n var index = 0;\n var { length } = bytes;\n var result = \"\";\n var slice;\n while (index < length) {\n slice = bytes.slice(index, Math.min(index + CHUNK_SIZE, length));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result += String.fromCharCode.apply(null, slice as any);\n index += CHUNK_SIZE;\n }\n return btoa(result);\n }\n};\n\nexport class JsiSkImage extends HostObject<Image, \"Image\"> implements SkImage {\n constructor(CanvasKit: CanvasKit, ref: Image) {\n super(CanvasKit, ref, \"Image\");\n }\n\n height() {\n return this.ref.height();\n }\n\n width() {\n return this.ref.width();\n }\n\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderOptions(\n ckEnum(tx),\n ckEnum(ty),\n ckEnum(fm),\n ckEnum(mm),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderCubic(\n ckEnum(tx),\n ckEnum(ty),\n B,\n C,\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n encodeToBytes(fmt?: ImageFormat, quality?: number) {\n let result: Uint8Array | null;\n if (fmt && quality) {\n result = this.ref.encodeToBytes(ckEnum(fmt), quality);\n } else if (fmt) {\n result = this.ref.encodeToBytes(ckEnum(fmt));\n } else {\n result = this.ref.encodeToBytes();\n }\n if (!result) {\n throw new Error(\"encodeToBytes failed\");\n }\n return result;\n }\n\n encodeToBase64(fmt?: ImageFormat, quality?: number) {\n const bytes = this.encodeToBytes(fmt, quality);\n return toBase64String(bytes);\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n makeNonTextureImage(): SkImage {\n return new JsiSkImage(\n this.CanvasKit,\n this.CanvasKit.MakeImageFromEncoded(this.encodeToBytes())!\n );\n }\n}\n"],"mappings":";;AAYA,SAASA,MAAT,EAAiBC,UAAjB,QAAmC,QAAnC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B,C,CAEA;;AACA,OAAO,MAAMC,cAAc,GAAIC,KAAD,IAAuB;EACnD,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;IACjC;IACA,OAAOA,MAAM,CAACC,IAAP,CAAYF,KAAZ,EAAmBG,QAAnB,CAA4B,QAA5B,CAAP;EACD,CAHD,MAGO;IACL;IACA;IACA;IACA;IACA,IAAIC,UAAU,GAAG,MAAjB,CALK,CAKoB;;IACzB,IAAIC,KAAK,GAAG,CAAZ;IACA,IAAI;MAAEC;IAAF,IAAaN,KAAjB;IACA,IAAIO,MAAM,GAAG,EAAb;IACA,IAAIC,KAAJ;;IACA,OAAOH,KAAK,GAAGC,MAAf,EAAuB;MACrBE,KAAK,GAAGR,KAAK,CAACQ,KAAN,CAAYH,KAAZ,EAAmBI,IAAI,CAACC,GAAL,CAASL,KAAK,GAAGD,UAAjB,EAA6BE,MAA7B,CAAnB,CAAR,CADqB,CAErB;;MACAC,MAAM,IAAII,MAAM,CAACC,YAAP,CAAoBC,KAApB,CAA0B,IAA1B,EAAgCL,KAAhC,CAAV;MACAH,KAAK,IAAID,UAAT;IACD;;IACD,OAAOU,IAAI,CAACP,MAAD,CAAX;EACD;AACF,CAtBM;AAwBP,OAAO,MAAMQ,UAAN,SAAyBnB,UAAzB,CAAuE;EAC5EoB,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;;IAD4C,iCAsEpC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAxE6C;EAE7C;;EAEDC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,MAAM,GAAG,KAAKW,GAAL,CAASe,aAAT,EAAT;IACD;;IACD,IAAI,CAAC1B,MAAL,EAAa;MACX,MAAM,IAAI6B,KAAJ,CAAU,sBAAV,CAAN;IACD;;IACD,OAAO7B,MAAP;EACD;;EAED8B,cAAc,CAACH,GAAD,EAAoBC,OAApB,EAAsC;IAClD,MAAMnC,KAAK,GAAG,KAAKiC,aAAL,CAAmBC,GAAnB,EAAwBC,OAAxB,CAAd;IACA,OAAOpC,cAAc,CAACC,KAAD,CAArB;EACD;;EAMDsC,mBAAmB,GAAY;IAC7B,OAAO,IAAIvB,UAAJ,CACL,KAAKE,SADA,EAEL,KAAKA,SAAL,CAAesB,oBAAf,CAAoC,KAAKN,aAAL,EAApC,CAFK,CAAP;EAID;;AAhF2E"}
@@ -3,4 +3,5 @@ import type { SkImageFilter } from "../types";
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkImageFilter extends HostObject<ImageFilter, "ImageFilter"> implements SkImageFilter {
5
5
  constructor(CanvasKit: CanvasKit, ref: ImageFilter);
6
+ dispose: () => void;
6
7
  }
@@ -1,7 +1,13 @@
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
+
1
3
  import { HostObject } from "./Host";
2
4
  export class JsiSkImageFilter extends HostObject {
3
5
  constructor(CanvasKit, ref) {
4
6
  super(CanvasKit, ref, "ImageFilter");
7
+
8
+ _defineProperty(this, "dispose", () => {
9
+ this.ref.delete();
10
+ });
5
11
  }
6
12
 
7
13
  }
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkImageFilter","constructor","CanvasKit","ref"],"sources":["JsiSkImageFilter.ts"],"sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type { SkImageFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkImageFilter\n extends HostObject<ImageFilter, \"ImageFilter\">\n implements SkImageFilter\n{\n constructor(CanvasKit: CanvasKit, ref: ImageFilter) {\n super(CanvasKit, ref, \"ImageFilter\");\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,gBAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAyC;IAClD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,aAAtB;EACD;;AAHH"}
1
+ {"version":3,"names":["HostObject","JsiSkImageFilter","constructor","CanvasKit","ref","delete"],"sources":["JsiSkImageFilter.ts"],"sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type { SkImageFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkImageFilter\n extends HostObject<ImageFilter, \"ImageFilter\">\n implements SkImageFilter\n{\n constructor(CanvasKit: CanvasKit, ref: ImageFilter) {\n super(CanvasKit, ref, \"ImageFilter\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,gBAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAyC;IAClD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,aAAtB;;IADkD,iCAI1C,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANmD;EAEnD;;AAHH"}
@@ -3,4 +3,5 @@ import type { SkMaskFilter } from "../types";
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkMaskFilter extends HostObject<MaskFilter, "MaskFilter"> implements SkMaskFilter {
5
5
  constructor(CanvasKit: CanvasKit, ref: MaskFilter);
6
+ dispose: () => void;
6
7
  }
@@ -1,7 +1,13 @@
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
+
1
3
  import { HostObject } from "./Host";
2
4
  export class JsiSkMaskFilter extends HostObject {
3
5
  constructor(CanvasKit, ref) {
4
6
  super(CanvasKit, ref, "MaskFilter");
7
+
8
+ _defineProperty(this, "dispose", () => {
9
+ this.ref.delete();
10
+ });
5
11
  }
6
12
 
7
13
  }
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkMaskFilter","constructor","CanvasKit","ref"],"sources":["JsiSkMaskFilter.ts"],"sourcesContent":["import type { CanvasKit, MaskFilter } from \"canvaskit-wasm\";\n\nimport type { SkMaskFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMaskFilter\n extends HostObject<MaskFilter, \"MaskFilter\">\n implements SkMaskFilter\n{\n constructor(CanvasKit: CanvasKit, ref: MaskFilter) {\n super(CanvasKit, ref, \"MaskFilter\");\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,eAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAwC;IACjD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,YAAtB;EACD;;AAHH"}
1
+ {"version":3,"names":["HostObject","JsiSkMaskFilter","constructor","CanvasKit","ref","delete"],"sources":["JsiSkMaskFilter.ts"],"sourcesContent":["import type { CanvasKit, MaskFilter } from \"canvaskit-wasm\";\n\nimport type { SkMaskFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMaskFilter\n extends HostObject<MaskFilter, \"MaskFilter\">\n implements SkMaskFilter\n{\n constructor(CanvasKit: CanvasKit, ref: MaskFilter) {\n super(CanvasKit, ref, \"MaskFilter\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,eAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAwC;IACjD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,YAAtB;;IADiD,iCAIzC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANkD;EAElD;;AAHH"}
@@ -3,6 +3,7 @@ import type { SkMatrix } from "../types";
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkMatrix extends HostObject<Matrix3x3, "Matrix"> implements SkMatrix {
5
5
  constructor(CanvasKit: CanvasKit, ref: Matrix3x3);
6
+ dispose: () => void;
6
7
  concat(matrix: SkMatrix): this;
7
8
  translate(x: number, y: number): this;
8
9
  scale(x: number, y?: number): this;
@@ -1,7 +1,12 @@
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
+
1
3
  import { HostObject } from "./Host";
2
4
  export class JsiSkMatrix extends HostObject {
3
5
  constructor(CanvasKit, ref) {
4
6
  super(CanvasKit, ref, "Matrix");
7
+
8
+ _defineProperty(this, "dispose", () => {// Do nothing - the matrix is represenetd by a Float32Array
9
+ });
5
10
  }
6
11
 
7
12
  concat(matrix) {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkMatrix","constructor","CanvasKit","ref","concat","matrix","set","Matrix","multiply","fromValue","translate","x","y","Float32Array","of","translated","scale","scaled","skew","skewed","rotate","value","rotated","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 concat(matrix: SkMatrix) {\n this.ref.set(\n this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix))\n );\n return this;\n }\n\n translate(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.translated(x, y))\n )\n );\n return this;\n }\n\n scale(x: number, y?: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y ?? x))\n )\n );\n return this;\n }\n\n skew(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.skewed(x, y))\n )\n );\n return this;\n }\n\n rotate(value: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.rotated(value))\n )\n );\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;EACD;;EAEDC,MAAM,CAACC,MAAD,EAAmB;IACvB,KAAKF,GAAL,CAASG,GAAT,CACE,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+B,KAAKL,GAApC,EAAyCH,WAAW,CAACS,SAAZ,CAAsBJ,MAAtB,CAAzC,CADF;IAGA,OAAO,IAAP;EACD;;EAEDK,SAAS,CAACC,CAAD,EAAYC,CAAZ,EAAuB;IAC9B,KAAKR,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBQ,UAAtB,CAAiCJ,CAAjC,EAAoCC,CAApC,CAAnB,CAFF,CADF;IAMA,OAAO,IAAP;EACD;;EAEDI,KAAK,CAACL,CAAD,EAAYC,CAAZ,EAAwB;IAC3B,KAAKR,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBU,MAAtB,CAA6BN,CAA7B,EAAgCC,CAAhC,aAAgCA,CAAhC,cAAgCA,CAAhC,GAAqCD,CAArC,CAAnB,CAFF,CADF;IAMA,OAAO,IAAP;EACD;;EAEDO,IAAI,CAACP,CAAD,EAAYC,CAAZ,EAAuB;IACzB,KAAKR,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBY,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAnB,CAFF,CADF;IAMA,OAAO,IAAP;EACD;;EAEDQ,MAAM,CAACC,KAAD,EAAgB;IACpB,KAAKjB,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBe,OAAtB,CAA8BD,KAA9B,CAAnB,CAFF,CADF;IAMA,OAAO,IAAP;EACD;;EAEDE,QAAQ,GAAG;IACT,KAAKpB,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBgB,QAAtB,EAAb;IACA,OAAO,IAAP;EACD;;EAEDC,GAAG,GAAG;IACJ,OAAOC,KAAK,CAACC,IAAN,CAAW,KAAKvB,GAAhB,CAAP;EACD;;AA3DH"}
1
+ {"version":3,"names":["HostObject","JsiSkMatrix","constructor","CanvasKit","ref","concat","matrix","set","Matrix","multiply","fromValue","translate","x","y","Float32Array","of","translated","scale","scaled","skew","skewed","rotate","value","rotated","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 dispose = () => {\n // Do nothing - the matrix is represenetd by a Float32Array\n };\n\n concat(matrix: SkMatrix) {\n this.ref.set(\n this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix))\n );\n return this;\n }\n\n translate(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.translated(x, y))\n )\n );\n return this;\n }\n\n scale(x: number, y?: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y ?? x))\n )\n );\n return this;\n }\n\n skew(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.skewed(x, y))\n )\n );\n return this;\n }\n\n rotate(value: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.rotated(value))\n )\n );\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,iCAIxC,MAAM,CACd;IACD,CANiD;EAEjD;;EAMDC,MAAM,CAACC,MAAD,EAAmB;IACvB,KAAKF,GAAL,CAASG,GAAT,CACE,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+B,KAAKL,GAApC,EAAyCH,WAAW,CAACS,SAAZ,CAAsBJ,MAAtB,CAAzC,CADF;IAGA,OA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OC,KAAK,CAACC,IAAN,CAAW,KAAKvB,GAAhB,CAAP;EACD;;AA/DH"}
@@ -3,6 +3,7 @@ import type { StrokeJoin, BlendMode, SkColor, SkColorFilter, SkImageFilter, SkPa
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkPaint extends HostObject<Paint, "Paint"> implements SkPaint {
5
5
  constructor(CanvasKit: CanvasKit, ref: Paint);
6
+ dispose: () => void;
6
7
  copy(): JsiSkPaint;
7
8
  reset(): void;
8
9
  getAlphaf(): number;
@@ -1,3 +1,5 @@
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
+
1
3
  import { HostObject, ckEnum } from "./Host";
2
4
  import { JsiSkColorFilter } from "./JsiSkColorFilter";
3
5
  import { JsiSkImageFilter } from "./JsiSkImageFilter";
@@ -7,6 +9,10 @@ import { JsiSkShader } from "./JsiSkShader";
7
9
  export class JsiSkPaint extends HostObject {
8
10
  constructor(CanvasKit, ref) {
9
11
  super(CanvasKit, ref, "Paint");
12
+
13
+ _defineProperty(this, "dispose", () => {
14
+ this.ref.delete();
15
+ });
10
16
  }
11
17
 
12
18
  copy() {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","ckEnum","JsiSkColorFilter","JsiSkImageFilter","JsiSkMaskFilter","JsiSkPathEffect","JsiSkShader","JsiSkPaint","constructor","CanvasKit","ref","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","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 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 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;EACD;;EAEDC,IAAI,GAAG;IACL,OAAO,IAAIJ,UAAJ,CAAe,KAAKE,SAApB,EAA+B,KAAKC,GAAL,CAASC,IAAT,EAA/B,CAAP;EACD;;EAEDC,KAAK,GAAG;IACN,KAAKF,GAAL,GAAW,IAAI,KAAKD,SAAL,CAAeI,KAAnB,EAAX;EACD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKC,QAAL,GAAgB,CAAhB,CAAP;EACD;;EAEDA,QAAQ,GAAG;IACT,OAAO,KAAKL,GAAL,CAASK,QAAT,EAAP;EACD;;EAEDC,YAAY,GAAG;IACb,OAAO,KAAKN,GAAL,CAASM,YAAT,GAAwBC,KAA/B;EACD;;EAEDC,aAAa,GAAG;IACd,OAAO,KAAKR,GAAL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AM,GAAG/B,WAAW,CAACyB,SAAZ,CAAsBM,MAAtB,CAAH,GAAmC,IAA5D;EACD;;EAEDC,YAAY,CAACC,GAAD,EAAiB;IAC3B,KAAK7B,GAAL,CAAS4B,YAAT,CAAsBrC,MAAM,CAACsC,GAAD,CAA5B;EACD;;EAEDC,aAAa,CAACC,IAAD,EAAmB;IAC9B,KAAK/B,GAAL,CAAS8B,aAAT,CAAuBvC,MAAM,CAACwC,IAAD,CAA7B;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKjC,GAAL,CAASgC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKnC,GAAL,CAASkC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAoB;IAC1B,KAAKrC,GAAL,CAASoC,QAAT,CAAkB;MAAE7B,KAAK,EAAE8B;IAAT,CAAlB;EACD;;AA3F2E"}
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","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 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,G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;;EAEDC,YAAY,CAACC,GAAD,EAAiB;IAC3B,KAAK9B,GAAL,CAAS6B,YAAT,CAAsBtC,MAAM,CAACuC,GAAD,CAA5B;EACD;;EAEDC,aAAa,CAACC,IAAD,EAAmB;IAC9B,KAAKhC,GAAL,CAAS+B,aAAT,CAAuBxC,MAAM,CAACyC,IAAD,CAA7B;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKlC,GAAL,CAASiC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKpC,GAAL,CAASmC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAoB;IAC1B,KAAKtC,GAAL,CAASqC,QAAT,CAAkB;MAAE7B,KAAK,EAAE8B;IAAT,CAAlB;EACD;;AA/F2E"}
@@ -5,6 +5,7 @@ import { JsiSkPoint } from "./JsiSkPoint";
5
5
  import { JsiSkRect } from "./JsiSkRect";
6
6
  export declare class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
7
7
  constructor(CanvasKit: CanvasKit, ref: Path);
8
+ dispose: () => void;
8
9
  addPath(src: SkPath, matrix?: SkMatrix, extend?: boolean): this;
9
10
  addArc(oval: SkRect, startAngleInDegrees: number, sweepAngleInDegrees: number): this;
10
11
  addOval(oval: SkRect, isCCW?: boolean, startIndex?: number): this;
@@ -1,3 +1,5 @@
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
+
1
3
  import { PathVerb } from "../types";
2
4
  import { ckEnum, HostObject, optEnum } from "./Host";
3
5
  import { JsiSkPoint } from "./JsiSkPoint";
@@ -15,6 +17,10 @@ const CommandCount = {
15
17
  export class JsiSkPath extends HostObject {
16
18
  constructor(CanvasKit, ref) {
17
19
  super(CanvasKit, ref, "Path");
20
+
21
+ _defineProperty(this, "dispose", () => {
22
+ this.ref.delete();
23
+ });
18
24
  }
19
25
 
20
26
  addPath(src, matrix) {
@@ -1 +1 @@
1
- {"version":3,"names":["PathVerb","ckEnum","HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","JsiSkPath","constructor","CanvasKit","ref","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","startT","stopT","isComplement","transform","m3","interpolate","end","t","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\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\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 }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\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 }\n\n reset() {\n this.ref.reset();\n }\n\n rewind() {\n this.ref.rewind();\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 }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\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(startT: number, stopT: number, isComplement: boolean) {\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 }\n\n interpolate(end: SkPath, t: number) {\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 return new JsiSkPath(this.CanvasKit, path);\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,OAAO,MAAMC,SAAN,SAAwBb,UAAxB,CAAmE;EACxEc,WAAW,CAACC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,IAAR,CAAaF,GAAb;QACA,MAAMI,MAAM,GAAGxI,YAAY,CAACuI,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,GAAGxI,YAAY,CAACuI,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,OAAO7F,MAAP;EACD;;AAlVuE"}
1
+ {"version":3,"names":["PathVerb","ckEnum","HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","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","startT","stopT","isComplement","transform","m3","interpolate","end","t","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\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 }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\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 }\n\n reset() {\n this.ref.reset();\n }\n\n rewind() {\n this.ref.rewind();\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 }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\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(startT: number, stopT: number, isComplement: boolean) {\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 }\n\n interpolate(end: SkPath, t: number) {\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 return new JsiSkPath(this.CanvasKit, path);\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) {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D,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF;;MACD,OAAOH,GAAP;IACD,CArBc,EAqBZ,EArBY,CAAf;IAsBA,OAAO7F,MAAP;EACD;;AAtVuE"}
@@ -3,4 +3,5 @@ import type { SkPathEffect } from "../types/PathEffect";
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkPathEffect extends HostObject<PathEffect, "PathEffect"> implements SkPathEffect {
5
5
  constructor(CanvasKit: CanvasKit, ref: PathEffect);
6
+ dispose: () => void;
6
7
  }
@@ -1,7 +1,13 @@
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
+
1
3
  import { HostObject } from "./Host";
2
4
  export class JsiSkPathEffect extends HostObject {
3
5
  constructor(CanvasKit, ref) {
4
6
  super(CanvasKit, ref, "PathEffect");
7
+
8
+ _defineProperty(this, "dispose", () => {
9
+ this.ref.delete();
10
+ });
5
11
  }
6
12
 
7
13
  }
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkPathEffect","constructor","CanvasKit","ref"],"sources":["JsiSkPathEffect.ts"],"sourcesContent":["import type { CanvasKit, PathEffect } from \"canvaskit-wasm\";\n\nimport type { SkPathEffect } from \"../types/PathEffect\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkPathEffect\n extends HostObject<PathEffect, \"PathEffect\">\n implements SkPathEffect\n{\n constructor(CanvasKit: CanvasKit, ref: PathEffect) {\n super(CanvasKit, ref, \"PathEffect\");\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,eAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAwC;IACjD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,YAAtB;EACD;;AAHH"}
1
+ {"version":3,"names":["HostObject","JsiSkPathEffect","constructor","CanvasKit","ref","delete"],"sources":["JsiSkPathEffect.ts"],"sourcesContent":["import type { CanvasKit, PathEffect } from \"canvaskit-wasm\";\n\nimport type { SkPathEffect } from \"../types/PathEffect\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkPathEffect\n extends HostObject<PathEffect, \"PathEffect\">\n implements SkPathEffect\n{\n constructor(CanvasKit: CanvasKit, ref: PathEffect) {\n super(CanvasKit, ref, \"PathEffect\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,eAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAwC;IACjD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,YAAtB;;IADiD,iCAIzC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANkD;EAElD;;AAHH"}
@@ -4,6 +4,7 @@ import { HostObject } from "./Host";
4
4
  import { JsiSkShader } from "./JsiSkShader";
5
5
  export declare class JsiSkPicture extends HostObject<Picture, "Picture"> implements SkPicture {
6
6
  constructor(CanvasKit: CanvasKit, ref: Picture);
7
+ dispose: () => void;
7
8
  makeShader(tmx: TileMode, tmy: TileMode, mode: FilterMode, localMatrix?: SkMatrix, tileRect?: SkRect): JsiSkShader;
8
9
  serialize(): Uint8Array | null;
9
10
  }
@@ -1,3 +1,5 @@
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
+
1
3
  // TODO: suggest to rename SkPicture to Picture for consistency
2
4
  import { HostObject, ckEnum } from "./Host";
3
5
  import { JsiSkShader } from "./JsiSkShader";
@@ -6,6 +8,10 @@ import { JsiSkRect } from "./JsiSkRect";
6
8
  export class JsiSkPicture extends HostObject {
7
9
  constructor(CanvasKit, ref) {
8
10
  super(CanvasKit, ref, "Picture");
11
+
12
+ _defineProperty(this, "dispose", () => {
13
+ this.ref.delete();
14
+ });
9
15
  }
10
16
 
11
17
  makeShader(tmx, tmy, mode, localMatrix, tileRect) {