@shopify/react-native-skia 0.1.225 → 0.1.228

Sign up to get free protection for your applications and to get access to all the features.
Files changed (326) hide show
  1. package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h +3 -3
  2. package/cpp/api/JsiSkCanvas.h +2 -1
  3. package/cpp/api/JsiSkMatrix.h +35 -13
  4. package/cpp/api/JsiSkPictureRecorder.h +10 -3
  5. package/cpp/api/JsiSkTypeface.h +1 -0
  6. package/cpp/rnskia/dom/props/MatrixProp.h +19 -0
  7. package/cpp/rnskia/dom/props/TransformProp.h +76 -9
  8. package/lib/commonjs/animation/spring/runSpring.d.ts +3 -0
  9. package/lib/commonjs/animation/spring/runSpring.js +3 -0
  10. package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
  11. package/lib/commonjs/animation/spring/useSpring.d.ts +3 -0
  12. package/lib/commonjs/animation/spring/useSpring.js +3 -0
  13. package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
  14. package/lib/commonjs/animation/timing/runTiming.d.ts +3 -0
  15. package/lib/commonjs/animation/timing/runTiming.js +3 -0
  16. package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
  17. package/lib/commonjs/animation/timing/useLoop.d.ts +3 -0
  18. package/lib/commonjs/animation/timing/useLoop.js +3 -0
  19. package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
  20. package/lib/commonjs/animation/timing/useTiming.d.ts +3 -0
  21. package/lib/commonjs/animation/timing/useTiming.js +3 -0
  22. package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
  23. package/lib/commonjs/dom/nodes/JsiSkDOM.js +2 -0
  24. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  25. package/lib/commonjs/dom/nodes/datatypes/Fitting.d.ts +5 -5
  26. package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
  27. package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +235 -75
  28. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
  29. package/lib/commonjs/dom/types/Common.d.ts +3 -3
  30. package/lib/commonjs/dom/types/Common.js.map +1 -1
  31. package/lib/commonjs/external/reanimated/interpolators.d.ts +1 -0
  32. package/lib/commonjs/external/reanimated/interpolators.js +24 -5
  33. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
  34. package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +2 -1
  35. package/lib/commonjs/external/reanimated/moduleWrapper.js +9 -7
  36. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
  37. package/lib/commonjs/renderer/Canvas.js +34 -28
  38. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  39. package/lib/commonjs/renderer/components/Drawing.d.ts +5 -0
  40. package/lib/commonjs/renderer/components/Drawing.js +5 -0
  41. package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
  42. package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +5 -5
  43. package/lib/commonjs/skia/core/Matrix.d.ts +2 -2
  44. package/lib/commonjs/skia/core/Matrix.js.map +1 -1
  45. package/lib/commonjs/skia/core/Picture.d.ts +2 -2
  46. package/lib/commonjs/skia/core/Picture.js +12 -2
  47. package/lib/commonjs/skia/core/Picture.js.map +1 -1
  48. package/lib/commonjs/skia/core/Vector.d.ts +0 -5
  49. package/lib/commonjs/skia/core/Vector.js +1 -17
  50. package/lib/commonjs/skia/core/Vector.js.map +1 -1
  51. package/lib/commonjs/skia/types/Canvas.d.ts +1 -1
  52. package/lib/commonjs/skia/types/Canvas.js.map +1 -1
  53. package/lib/commonjs/skia/types/Matrix.d.ts +4 -20
  54. package/lib/commonjs/skia/types/Matrix.js +4 -70
  55. package/lib/commonjs/skia/types/Matrix.js.map +1 -1
  56. package/lib/commonjs/skia/types/Matrix4.d.ts +90 -0
  57. package/lib/commonjs/skia/types/Matrix4.js +312 -0
  58. package/lib/commonjs/skia/types/Matrix4.js.map +1 -0
  59. package/lib/commonjs/skia/types/Path/Path.d.ts +1 -1
  60. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  61. package/lib/commonjs/skia/types/Picture/PictureRecorder.d.ts +1 -1
  62. package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
  63. package/lib/commonjs/skia/types/Rect.d.ts +1 -0
  64. package/lib/commonjs/skia/types/Rect.js +18 -0
  65. package/lib/commonjs/skia/types/Rect.js.map +1 -1
  66. package/lib/commonjs/skia/types/index.d.ts +1 -0
  67. package/lib/commonjs/skia/types/index.js +13 -0
  68. package/lib/commonjs/skia/types/index.js.map +1 -1
  69. package/lib/commonjs/skia/web/Host.d.ts +2 -3
  70. package/lib/commonjs/skia/web/Host.js +4 -12
  71. package/lib/commonjs/skia/web/Host.js.map +1 -1
  72. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -1
  73. package/lib/commonjs/skia/web/JsiSkCanvas.js +13 -13
  74. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  75. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +1 -1
  76. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  77. package/lib/commonjs/skia/web/JsiSkFont.js +2 -2
  78. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  79. package/lib/commonjs/skia/web/JsiSkImage.js +6 -6
  80. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  81. package/lib/commonjs/skia/web/JsiSkImageFactory.js +2 -2
  82. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  83. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +3 -3
  84. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  85. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +1 -1
  86. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  87. package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +2 -2
  88. package/lib/commonjs/skia/web/JsiSkMatrix.js +6 -1
  89. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  90. package/lib/commonjs/skia/web/JsiSkPaint.js +3 -3
  91. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  92. package/lib/commonjs/skia/web/JsiSkPath.js +5 -5
  93. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  94. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +1 -1
  95. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  96. package/lib/commonjs/skia/web/JsiSkPathFactory.js +1 -1
  97. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
  98. package/lib/commonjs/skia/web/JsiSkPicture.js +1 -1
  99. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  100. package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  101. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +1 -1
  102. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  103. package/lib/commonjs/skia/web/JsiSkShaderFactory.js +5 -5
  104. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
  105. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +3 -3
  106. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
  107. package/lib/commonjs/values/api.d.ts +23 -2
  108. package/lib/commonjs/values/api.js +44 -1
  109. package/lib/commonjs/values/api.js.map +1 -1
  110. package/lib/commonjs/values/hooks/useClockValue.d.ts +3 -0
  111. package/lib/commonjs/values/hooks/useClockValue.js +3 -0
  112. package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
  113. package/lib/commonjs/values/hooks/useComputedValue.d.ts +3 -0
  114. package/lib/commonjs/values/hooks/useComputedValue.js +3 -0
  115. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  116. package/lib/commonjs/values/hooks/useValue.d.ts +3 -0
  117. package/lib/commonjs/values/hooks/useValue.js +3 -0
  118. package/lib/commonjs/values/hooks/useValue.js.map +1 -1
  119. package/lib/commonjs/values/hooks/useValueEffect.d.ts +3 -0
  120. package/lib/commonjs/values/hooks/useValueEffect.js +3 -0
  121. package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
  122. package/lib/commonjs/values/types.d.ts +4 -4
  123. package/lib/commonjs/values/types.js.map +1 -1
  124. package/lib/commonjs/views/SkiaView.d.ts +5 -0
  125. package/lib/commonjs/views/SkiaView.js +9 -0
  126. package/lib/commonjs/views/SkiaView.js.map +1 -1
  127. package/lib/module/animation/spring/runSpring.d.ts +3 -0
  128. package/lib/module/animation/spring/runSpring.js +3 -0
  129. package/lib/module/animation/spring/runSpring.js.map +1 -1
  130. package/lib/module/animation/spring/useSpring.d.ts +3 -0
  131. package/lib/module/animation/spring/useSpring.js +3 -0
  132. package/lib/module/animation/spring/useSpring.js.map +1 -1
  133. package/lib/module/animation/timing/runTiming.d.ts +3 -0
  134. package/lib/module/animation/timing/runTiming.js +3 -0
  135. package/lib/module/animation/timing/runTiming.js.map +1 -1
  136. package/lib/module/animation/timing/useLoop.d.ts +3 -0
  137. package/lib/module/animation/timing/useLoop.js +3 -0
  138. package/lib/module/animation/timing/useLoop.js.map +1 -1
  139. package/lib/module/animation/timing/useTiming.d.ts +3 -0
  140. package/lib/module/animation/timing/useTiming.js +3 -0
  141. package/lib/module/animation/timing/useTiming.js.map +1 -1
  142. package/lib/module/dom/nodes/JsiSkDOM.js +2 -0
  143. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  144. package/lib/module/dom/nodes/datatypes/Fitting.d.ts +5 -5
  145. package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
  146. package/lib/module/dom/nodes/datatypes/Gradient.d.ts +235 -75
  147. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  148. package/lib/module/dom/types/Common.d.ts +3 -3
  149. package/lib/module/dom/types/Common.js.map +1 -1
  150. package/lib/module/external/reanimated/interpolators.d.ts +1 -0
  151. package/lib/module/external/reanimated/interpolators.js +22 -6
  152. package/lib/module/external/reanimated/interpolators.js.map +1 -1
  153. package/lib/module/external/reanimated/moduleWrapper.d.ts +2 -1
  154. package/lib/module/external/reanimated/moduleWrapper.js +7 -6
  155. package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
  156. package/lib/module/renderer/Canvas.js +35 -29
  157. package/lib/module/renderer/Canvas.js.map +1 -1
  158. package/lib/module/renderer/components/Drawing.d.ts +5 -0
  159. package/lib/module/renderer/components/Drawing.js +6 -0
  160. package/lib/module/renderer/components/Drawing.js.map +1 -1
  161. package/lib/module/renderer/components/shapes/FitBox.d.ts +5 -5
  162. package/lib/module/skia/core/Matrix.d.ts +2 -2
  163. package/lib/module/skia/core/Matrix.js.map +1 -1
  164. package/lib/module/skia/core/Picture.d.ts +2 -2
  165. package/lib/module/skia/core/Picture.js +12 -3
  166. package/lib/module/skia/core/Picture.js.map +1 -1
  167. package/lib/module/skia/core/Vector.d.ts +0 -5
  168. package/lib/module/skia/core/Vector.js +0 -13
  169. package/lib/module/skia/core/Vector.js.map +1 -1
  170. package/lib/module/skia/types/Canvas.d.ts +1 -1
  171. package/lib/module/skia/types/Canvas.js.map +1 -1
  172. package/lib/module/skia/types/Matrix.d.ts +4 -20
  173. package/lib/module/skia/types/Matrix.js +3 -71
  174. package/lib/module/skia/types/Matrix.js.map +1 -1
  175. package/lib/module/skia/types/Matrix4.d.ts +90 -0
  176. package/lib/module/skia/types/Matrix4.js +274 -0
  177. package/lib/module/skia/types/Matrix4.js.map +1 -0
  178. package/lib/module/skia/types/Path/Path.d.ts +1 -1
  179. package/lib/module/skia/types/Path/Path.js.map +1 -1
  180. package/lib/module/skia/types/Picture/PictureRecorder.d.ts +1 -1
  181. package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
  182. package/lib/module/skia/types/Rect.d.ts +1 -0
  183. package/lib/module/skia/types/Rect.js +9 -0
  184. package/lib/module/skia/types/Rect.js.map +1 -1
  185. package/lib/module/skia/types/index.d.ts +1 -0
  186. package/lib/module/skia/types/index.js +1 -0
  187. package/lib/module/skia/types/index.js.map +1 -1
  188. package/lib/module/skia/web/Host.d.ts +2 -3
  189. package/lib/module/skia/web/Host.js +2 -7
  190. package/lib/module/skia/web/Host.js.map +1 -1
  191. package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -1
  192. package/lib/module/skia/web/JsiSkCanvas.js +14 -14
  193. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  194. package/lib/module/skia/web/JsiSkColorFilterFactory.js +2 -2
  195. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  196. package/lib/module/skia/web/JsiSkFont.js +3 -3
  197. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  198. package/lib/module/skia/web/JsiSkImage.js +7 -7
  199. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  200. package/lib/module/skia/web/JsiSkImageFactory.js +3 -3
  201. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  202. package/lib/module/skia/web/JsiSkImageFilterFactory.js +4 -4
  203. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  204. package/lib/module/skia/web/JsiSkMaskFilterFactory.js +2 -2
  205. package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  206. package/lib/module/skia/web/JsiSkMatrix.d.ts +2 -2
  207. package/lib/module/skia/web/JsiSkMatrix.js +6 -1
  208. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  209. package/lib/module/skia/web/JsiSkPaint.js +4 -4
  210. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  211. package/lib/module/skia/web/JsiSkPath.js +6 -6
  212. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  213. package/lib/module/skia/web/JsiSkPathEffectFactory.js +2 -2
  214. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  215. package/lib/module/skia/web/JsiSkPathFactory.js +2 -2
  216. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
  217. package/lib/module/skia/web/JsiSkPicture.js +2 -2
  218. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  219. package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  220. package/lib/module/skia/web/JsiSkPictureRecorder.js +1 -1
  221. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  222. package/lib/module/skia/web/JsiSkShaderFactory.js +6 -6
  223. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
  224. package/lib/module/skia/web/JsiSkVerticesFactory.js +2 -2
  225. package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
  226. package/lib/module/values/api.d.ts +23 -2
  227. package/lib/module/values/api.js +44 -1
  228. package/lib/module/values/api.js.map +1 -1
  229. package/lib/module/values/hooks/useClockValue.d.ts +3 -0
  230. package/lib/module/values/hooks/useClockValue.js +3 -0
  231. package/lib/module/values/hooks/useClockValue.js.map +1 -1
  232. package/lib/module/values/hooks/useComputedValue.d.ts +3 -0
  233. package/lib/module/values/hooks/useComputedValue.js +3 -0
  234. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  235. package/lib/module/values/hooks/useValue.d.ts +3 -0
  236. package/lib/module/values/hooks/useValue.js +3 -0
  237. package/lib/module/values/hooks/useValue.js.map +1 -1
  238. package/lib/module/values/hooks/useValueEffect.d.ts +3 -0
  239. package/lib/module/values/hooks/useValueEffect.js +3 -0
  240. package/lib/module/values/hooks/useValueEffect.js.map +1 -1
  241. package/lib/module/values/types.d.ts +4 -4
  242. package/lib/module/values/types.js.map +1 -1
  243. package/lib/module/views/SkiaView.d.ts +5 -0
  244. package/lib/module/views/SkiaView.js +10 -0
  245. package/lib/module/views/SkiaView.js.map +1 -1
  246. package/lib/typescript/src/animation/spring/runSpring.d.ts +3 -0
  247. package/lib/typescript/src/animation/spring/useSpring.d.ts +3 -0
  248. package/lib/typescript/src/animation/timing/runTiming.d.ts +3 -0
  249. package/lib/typescript/src/animation/timing/useLoop.d.ts +3 -0
  250. package/lib/typescript/src/animation/timing/useTiming.d.ts +3 -0
  251. package/lib/typescript/src/dom/nodes/datatypes/Fitting.d.ts +5 -5
  252. package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +235 -75
  253. package/lib/typescript/src/dom/types/Common.d.ts +3 -3
  254. package/lib/typescript/src/external/reanimated/interpolators.d.ts +1 -0
  255. package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +2 -1
  256. package/lib/typescript/src/renderer/components/Drawing.d.ts +5 -0
  257. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +5 -5
  258. package/lib/typescript/src/skia/core/Matrix.d.ts +2 -2
  259. package/lib/typescript/src/skia/core/Picture.d.ts +2 -2
  260. package/lib/typescript/src/skia/core/Vector.d.ts +0 -5
  261. package/lib/typescript/src/skia/types/Canvas.d.ts +1 -1
  262. package/lib/typescript/src/skia/types/Matrix.d.ts +4 -20
  263. package/lib/typescript/src/skia/types/Matrix4.d.ts +90 -0
  264. package/lib/typescript/src/skia/types/Path/Path.d.ts +1 -1
  265. package/lib/typescript/src/skia/types/Picture/PictureRecorder.d.ts +1 -1
  266. package/lib/typescript/src/skia/types/Rect.d.ts +1 -0
  267. package/lib/typescript/src/skia/types/index.d.ts +1 -0
  268. package/lib/typescript/src/skia/web/Host.d.ts +2 -3
  269. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -1
  270. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +2 -2
  271. package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  272. package/lib/typescript/src/values/api.d.ts +23 -2
  273. package/lib/typescript/src/values/hooks/useClockValue.d.ts +3 -0
  274. package/lib/typescript/src/values/hooks/useComputedValue.d.ts +3 -0
  275. package/lib/typescript/src/values/hooks/useValue.d.ts +3 -0
  276. package/lib/typescript/src/values/hooks/useValueEffect.d.ts +3 -0
  277. package/lib/typescript/src/values/types.d.ts +4 -4
  278. package/lib/typescript/src/views/SkiaView.d.ts +5 -0
  279. package/package.json +2 -1
  280. package/src/animation/spring/runSpring.ts +3 -0
  281. package/src/animation/spring/useSpring.ts +3 -0
  282. package/src/animation/timing/runTiming.ts +3 -0
  283. package/src/animation/timing/useLoop.ts +3 -0
  284. package/src/animation/timing/useTiming.ts +3 -0
  285. package/src/dom/nodes/JsiSkDOM.ts +4 -0
  286. package/src/dom/nodes/datatypes/Fitting.ts +10 -2
  287. package/src/dom/nodes/datatypes/Gradient.ts +2 -2
  288. package/src/dom/types/Common.ts +5 -3
  289. package/src/external/reanimated/interpolators.ts +30 -7
  290. package/src/external/reanimated/moduleWrapper.ts +6 -0
  291. package/src/renderer/Canvas.tsx +41 -30
  292. package/src/renderer/components/Drawing.tsx +5 -0
  293. package/src/skia/core/Matrix.ts +2 -2
  294. package/src/skia/core/Picture.ts +11 -3
  295. package/src/skia/core/Vector.ts +0 -4
  296. package/src/skia/types/Canvas.ts +1 -1
  297. package/src/skia/types/Matrix.ts +7 -85
  298. package/src/skia/types/Matrix4.ts +344 -0
  299. package/src/skia/types/Path/Path.ts +1 -1
  300. package/src/skia/types/Picture/PictureRecorder.ts +1 -1
  301. package/src/skia/types/Rect.ts +14 -0
  302. package/src/skia/types/index.ts +1 -0
  303. package/src/skia/web/Host.ts +4 -3
  304. package/src/skia/web/JsiSkCanvas.ts +24 -17
  305. package/src/skia/web/JsiSkColorFilterFactory.ts +5 -2
  306. package/src/skia/web/JsiSkFont.ts +3 -3
  307. package/src/skia/web/JsiSkImage.ts +14 -11
  308. package/src/skia/web/JsiSkImageFactory.ts +3 -3
  309. package/src/skia/web/JsiSkImageFilterFactory.ts +5 -5
  310. package/src/skia/web/JsiSkMaskFilterFactory.ts +6 -2
  311. package/src/skia/web/JsiSkMatrix.ts +14 -3
  312. package/src/skia/web/JsiSkPaint.ts +4 -4
  313. package/src/skia/web/JsiSkPath.ts +9 -6
  314. package/src/skia/web/JsiSkPathEffectFactory.ts +2 -2
  315. package/src/skia/web/JsiSkPathFactory.ts +2 -2
  316. package/src/skia/web/JsiSkPicture.ts +4 -4
  317. package/src/skia/web/JsiSkPictureRecorder.ts +6 -2
  318. package/src/skia/web/JsiSkShaderFactory.ts +6 -6
  319. package/src/skia/web/JsiSkVerticesFactory.ts +2 -2
  320. package/src/values/api.ts +55 -2
  321. package/src/values/hooks/useClockValue.ts +3 -0
  322. package/src/values/hooks/useComputedValue.ts +3 -0
  323. package/src/values/hooks/useValue.ts +3 -0
  324. package/src/values/hooks/useValueEffect.ts +3 -0
  325. package/src/values/types.ts +6 -6
  326. package/src/views/SkiaView.tsx +11 -0
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.optEnum = exports.getCkEnum = exports.ckEnum = exports.NotImplementedOnRNWeb = exports.HostObject = exports.Host = exports.BaseHostObject = void 0;
6
+ exports.optEnum = exports.getEnum = exports.NotImplementedOnRNWeb = exports.HostObject = exports.Host = exports.BaseHostObject = void 0;
7
7
 
8
8
  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; }
9
9
 
@@ -52,24 +52,16 @@ class HostObject extends BaseHostObject {
52
52
 
53
53
  exports.HostObject = HostObject;
54
54
 
55
- const getCkEnum = (e, v) => Object.values(e).find(_ref => {
55
+ const getEnum = (e, v) => Object.values(e).find(_ref => {
56
56
  let {
57
57
  value
58
58
  } = _ref;
59
59
  return value === v;
60
60
  });
61
61
 
62
- exports.getCkEnum = getCkEnum;
62
+ exports.getEnum = getEnum;
63
63
 
64
- const ckEnum = value => ({
65
- value
66
- });
67
-
68
- exports.ckEnum = ckEnum;
69
-
70
- const optEnum = value => value === undefined ? undefined : {
71
- value
72
- };
64
+ const optEnum = (e, value) => value === undefined ? undefined : getEnum(e, value);
73
65
 
74
66
  exports.optEnum = optEnum;
75
67
  //# sourceMappingURL=Host.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NotImplementedOnRNWeb","Error","constructor","msg","Host","CanvasKit","BaseHostObject","ref","typename","__typename__","HostObject","fromValue","value","getCkEnum","e","v","Object","values","find","ckEnum","optEnum","undefined"],"sources":["Host.ts"],"sourcesContent":["import type { CanvasKit, EmbindEnumEntity, EmbindEnum } from \"canvaskit-wasm\";\n\nimport type { SkJSIInstance } from \"../types\";\n\nexport class NotImplementedOnRNWeb extends Error {\n constructor(msg?: string) {\n super(msg ?? \"Not implemented on React Native Web\");\n }\n}\n\nexport abstract class Host {\n readonly CanvasKit: CanvasKit;\n\n constructor(CanvasKit: CanvasKit) {\n this.CanvasKit = CanvasKit;\n }\n}\n\nexport abstract class BaseHostObject<T, N extends string>\n extends Host\n implements SkJSIInstance<N>\n{\n readonly __typename__: N;\n ref: T;\n\n constructor(CanvasKit: CanvasKit, ref: T, typename: N) {\n super(CanvasKit);\n this.ref = ref;\n this.__typename__ = typename;\n }\n\n abstract dispose(): void;\n}\n\nexport abstract class HostObject<T, N extends string> extends BaseHostObject<\n T,\n N\n> {\n static fromValue<T>(value: SkJSIInstance<string>) {\n return (value as HostObject<T, string>).ref;\n }\n}\n\nexport const getCkEnum = (e: EmbindEnum, v: number): EmbindEnumEntity =>\n Object.values(e).find(({ value }) => value === v);\nexport const ckEnum = (value: number): EmbindEnumEntity => ({ value });\nexport const optEnum = (\n value: number | undefined\n): EmbindEnumEntity | undefined =>\n value === undefined ? undefined : { value };\n"],"mappings":";;;;;;;;;AAIO,MAAMA,qBAAN,SAAoCC,KAApC,CAA0C;EAC/CC,WAAW,CAACC,GAAD,EAAe;IACxB,MAAMA,GAAG,IAAI,qCAAb;EACD;;AAH8C;;;;AAM1C,MAAeC,IAAf,CAAoB;EAGzBF,WAAW,CAACG,SAAD,EAAuB;IAAA;;IAChC,KAAKA,SAAL,GAAiBA,SAAjB;EACD;;AALwB;;;;AAQpB,MAAeC,cAAf,SACGF,IADH,CAGP;EAIEF,WAAW,CAACG,SAAD,EAAuBE,GAAvB,EAA+BC,QAA/B,EAA4C;IACrD,MAAMH,SAAN;;IADqD;;IAAA;;IAErD,KAAKE,GAAL,GAAWA,GAAX;IACA,KAAKE,YAAL,GAAoBD,QAApB;EACD;;AARH;;;;AAaO,MAAeE,UAAf,SAAuDJ,cAAvD,CAGL;EACgB,OAATK,SAAS,CAAIC,KAAJ,EAAkC;IAChD,OAAQA,KAAD,CAAiCL,GAAxC;EACD;;AAHD;;;;AAMK,MAAMM,SAAS,GAAG,CAACC,CAAD,EAAgBC,CAAhB,KACvBC,MAAM,CAACC,MAAP,CAAcH,CAAd,EAAiBI,IAAjB,CAAsB;EAAA,IAAC;IAAEN;EAAF,CAAD;EAAA,OAAeA,KAAK,KAAKG,CAAzB;AAAA,CAAtB,CADK;;;;AAEA,MAAMI,MAAM,GAAIP,KAAD,KAAsC;EAAEA;AAAF,CAAtC,CAAf;;;;AACA,MAAMQ,OAAO,GAClBR,KADqB,IAGrBA,KAAK,KAAKS,SAAV,GAAsBA,SAAtB,GAAkC;EAAET;AAAF,CAH7B"}
1
+ {"version":3,"names":["NotImplementedOnRNWeb","Error","constructor","msg","Host","CanvasKit","BaseHostObject","ref","typename","__typename__","HostObject","fromValue","value","getEnum","e","v","Object","values","find","optEnum","undefined"],"sources":["Host.ts"],"sourcesContent":["import type { CanvasKit, EmbindEnumEntity, EmbindEnum } from \"canvaskit-wasm\";\n\nimport type { SkJSIInstance } from \"../types\";\n\nexport class NotImplementedOnRNWeb extends Error {\n constructor(msg?: string) {\n super(msg ?? \"Not implemented on React Native Web\");\n }\n}\n\nexport abstract class Host {\n readonly CanvasKit: CanvasKit;\n\n constructor(CanvasKit: CanvasKit) {\n this.CanvasKit = CanvasKit;\n }\n}\n\nexport abstract class BaseHostObject<T, N extends string>\n extends Host\n implements SkJSIInstance<N>\n{\n readonly __typename__: N;\n ref: T;\n\n constructor(CanvasKit: CanvasKit, ref: T, typename: N) {\n super(CanvasKit);\n this.ref = ref;\n this.__typename__ = typename;\n }\n\n abstract dispose(): void;\n}\n\nexport abstract class HostObject<T, N extends string> extends BaseHostObject<\n T,\n N\n> {\n static fromValue<T>(value: SkJSIInstance<string>) {\n return (value as HostObject<T, string>).ref;\n }\n}\n\nexport const getEnum = (e: EmbindEnum, v: number): EmbindEnumEntity =>\n Object.values(e).find(({ value }) => value === v);\n\nexport const optEnum = (\n e: EmbindEnum,\n value: number | undefined\n): EmbindEnumEntity | undefined =>\n value === undefined ? undefined : getEnum(e, value);\n"],"mappings":";;;;;;;;;AAIO,MAAMA,qBAAN,SAAoCC,KAApC,CAA0C;EAC/CC,WAAW,CAACC,GAAD,EAAe;IACxB,MAAMA,GAAG,IAAI,qCAAb;EACD;;AAH8C;;;;AAM1C,MAAeC,IAAf,CAAoB;EAGzBF,WAAW,CAACG,SAAD,EAAuB;IAAA;;IAChC,KAAKA,SAAL,GAAiBA,SAAjB;EACD;;AALwB;;;;AAQpB,MAAeC,cAAf,SACGF,IADH,CAGP;EAIEF,WAAW,CAACG,SAAD,EAAuBE,GAAvB,EAA+BC,QAA/B,EAA4C;IACrD,MAAMH,SAAN;;IADqD;;IAAA;;IAErD,KAAKE,GAAL,GAAWA,GAAX;IACA,KAAKE,YAAL,GAAoBD,QAApB;EACD;;AARH;;;;AAaO,MAAeE,UAAf,SAAuDJ,cAAvD,CAGL;EACgB,OAATK,SAAS,CAAIC,KAAJ,EAAkC;IAChD,OAAQA,KAAD,CAAiCL,GAAxC;EACD;;AAHD;;;;AAMK,MAAMM,OAAO,GAAG,CAACC,CAAD,EAAgBC,CAAhB,KACrBC,MAAM,CAACC,MAAP,CAAcH,CAAd,EAAiBI,IAAjB,CAAsB;EAAA,IAAC;IAAEN;EAAF,CAAD;EAAA,OAAeA,KAAK,KAAKG,CAAzB;AAAA,CAAtB,CADK;;;;AAGA,MAAMI,OAAO,GAAG,CACrBL,CADqB,EAErBF,KAFqB,KAIrBA,KAAK,KAAKQ,SAAV,GAAsBA,SAAtB,GAAkCP,OAAO,CAACC,CAAD,EAAIF,KAAJ,CAJpC"}
@@ -40,7 +40,7 @@ export declare class JsiSkCanvas extends HostObject<Canvas, "Canvas"> implements
40
40
  clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean): void;
41
41
  clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean): void;
42
42
  clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean): void;
43
- concat(m: SkMatrix): void;
43
+ concat(m: SkMatrix | number[]): void;
44
44
  drawPicture(skp: SkPicture): void;
45
45
  readPixels(srcX: number, srcY: number, imageInfo: ImageInfo): Float32Array | Uint8Array | null;
46
46
  }
@@ -59,11 +59,11 @@ class JsiSkCanvas extends _Host.HostObject {
59
59
  }
60
60
 
61
61
  drawImageOptions(img, left, top, fm, mm, paint) {
62
- this.ref.drawImageOptions(_JsiSkImage.JsiSkImage.fromValue(img), left, top, (0, _Host.ckEnum)(fm), (0, _Host.ckEnum)(mm), paint ? _JsiSkPaint.JsiSkPaint.fromValue(paint) : paint);
62
+ this.ref.drawImageOptions(_JsiSkImage.JsiSkImage.fromValue(img), left, top, (0, _Host.getEnum)(this.CanvasKit.FilterMode, fm), (0, _Host.getEnum)(this.CanvasKit.MipmapMode, mm), paint ? _JsiSkPaint.JsiSkPaint.fromValue(paint) : paint);
63
63
  }
64
64
 
65
65
  drawImageNine(img, center, dest, filter, paint) {
66
- this.ref.drawImageNine(_JsiSkImage.JsiSkImage.fromValue(img), Array.from(_JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, center)), _JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, dest), (0, _Host.ckEnum)(filter), paint ? _JsiSkPaint.JsiSkPaint.fromValue(paint) : paint);
66
+ this.ref.drawImageNine(_JsiSkImage.JsiSkImage.fromValue(img), Array.from(_JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, center)), _JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, dest), (0, _Host.getEnum)(this.CanvasKit.FilterMode, filter), paint ? _JsiSkPaint.JsiSkPaint.fromValue(paint) : paint);
67
67
  }
68
68
 
69
69
  drawImageRectCubic(img, src, dest, B, C, paint) {
@@ -71,7 +71,7 @@ class JsiSkCanvas extends _Host.HostObject {
71
71
  }
72
72
 
73
73
  drawImageRectOptions(img, src, dest, fm, mm, paint) {
74
- this.ref.drawImageRectOptions(_JsiSkImage.JsiSkImage.fromValue(img), _JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, src), _JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, dest), (0, _Host.ckEnum)(fm), (0, _Host.ckEnum)(mm), paint ? _JsiSkPaint.JsiSkPaint.fromValue(paint) : paint);
74
+ this.ref.drawImageRectOptions(_JsiSkImage.JsiSkImage.fromValue(img), _JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, src), _JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, dest), (0, _Host.getEnum)(this.CanvasKit.FilterMode, fm), (0, _Host.getEnum)(this.CanvasKit.MipmapMode, mm), paint ? _JsiSkPaint.JsiSkPaint.fromValue(paint) : paint);
75
75
  }
76
76
 
77
77
  drawPaint(paint) {
@@ -87,7 +87,7 @@ class JsiSkCanvas extends _Host.HostObject {
87
87
  }
88
88
 
89
89
  drawVertices(verts, mode, paint) {
90
- this.ref.drawVertices(_JsiSkVertices.JsiSkVertices.fromValue(verts), (0, _Host.ckEnum)(mode), _JsiSkPaint.JsiSkPaint.fromValue(paint));
90
+ this.ref.drawVertices(_JsiSkVertices.JsiSkVertices.fromValue(verts), (0, _Host.getEnum)(this.CanvasKit.BlendMode, mode), _JsiSkPaint.JsiSkPaint.fromValue(paint));
91
91
  }
92
92
 
93
93
  drawPatch(cubics, colors, texs, mode, paint) {
@@ -97,7 +97,7 @@ class JsiSkCanvas extends _Host.HostObject {
97
97
  y
98
98
  } = _ref;
99
99
  return [x, y];
100
- }).flat(), colors, texs ? texs.flatMap(p => Array.from(_JsiSkPoint.JsiSkPoint.fromValue(p))) : texs, mode ? (0, _Host.ckEnum)(mode) : null, paint ? _JsiSkPaint.JsiSkPaint.fromValue(paint) : undefined);
100
+ }).flat(), colors, texs ? texs.flatMap(p => Array.from(_JsiSkPoint.JsiSkPoint.fromValue(p))) : texs, mode ? (0, _Host.getEnum)(this.CanvasKit.BlendMode, mode) : null, paint ? _JsiSkPaint.JsiSkPaint.fromValue(paint) : undefined);
101
101
  }
102
102
 
103
103
  restoreToCount(saveCount) {
@@ -105,7 +105,7 @@ class JsiSkCanvas extends _Host.HostObject {
105
105
  }
106
106
 
107
107
  drawPoints(mode, points, paint) {
108
- this.ref.drawPoints((0, _Host.ckEnum)(mode), points.map(_ref2 => {
108
+ this.ref.drawPoints((0, _Host.getEnum)(this.CanvasKit.PointMode, mode), points.map(_ref2 => {
109
109
  let {
110
110
  x,
111
111
  y
@@ -179,7 +179,7 @@ class JsiSkCanvas extends _Host.HostObject {
179
179
  }
180
180
 
181
181
  drawColor(color, blendMode) {
182
- this.ref.drawColor(color, blendMode ? (0, _Host.ckEnum)(blendMode) : undefined);
182
+ this.ref.drawColor(color, blendMode ? (0, _Host.getEnum)(this.CanvasKit.BlendMode, blendMode) : undefined);
183
183
  }
184
184
 
185
185
  clear(color) {
@@ -187,19 +187,19 @@ class JsiSkCanvas extends _Host.HostObject {
187
187
  }
188
188
 
189
189
  clipPath(path, op, doAntiAlias) {
190
- this.ref.clipPath(_JsiSkPath.JsiSkPath.fromValue(path), (0, _Host.ckEnum)(op), doAntiAlias);
190
+ this.ref.clipPath(_JsiSkPath.JsiSkPath.fromValue(path), (0, _Host.getEnum)(this.CanvasKit.PathOp, op), doAntiAlias);
191
191
  }
192
192
 
193
193
  clipRect(rect, op, doAntiAlias) {
194
- this.ref.clipRect(_JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, rect), (0, _Host.ckEnum)(op), doAntiAlias);
194
+ this.ref.clipRect(_JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, rect), (0, _Host.getEnum)(this.CanvasKit.PathOp, op), doAntiAlias);
195
195
  }
196
196
 
197
197
  clipRRect(rrect, op, doAntiAlias) {
198
- this.ref.clipRRect(_JsiSkRRect.JsiSkRRect.fromValue(this.CanvasKit, rrect), (0, _Host.ckEnum)(op), doAntiAlias);
198
+ this.ref.clipRRect(_JsiSkRRect.JsiSkRRect.fromValue(this.CanvasKit, rrect), (0, _Host.getEnum)(this.CanvasKit.PathOp, op), doAntiAlias);
199
199
  }
200
200
 
201
201
  concat(m) {
202
- this.ref.concat(_JsiSkMatrix.JsiSkMatrix.fromValue(m));
202
+ this.ref.concat(Array.isArray(m) ? m : _JsiSkMatrix.JsiSkMatrix.fromValue(m));
203
203
  }
204
204
 
205
205
  drawPicture(skp) {
@@ -211,8 +211,8 @@ class JsiSkCanvas extends _Host.HostObject {
211
211
  width: imageInfo.width,
212
212
  height: imageInfo.height,
213
213
  colorSpace: this.CanvasKit.ColorSpace.SRGB,
214
- alphaType: (0, _Host.getCkEnum)(this.CanvasKit.AlphaType, imageInfo.alphaType),
215
- colorType: (0, _Host.getCkEnum)(this.CanvasKit.ColorType, imageInfo.colorType)
214
+ alphaType: (0, _Host.getEnum)(this.CanvasKit.AlphaType, imageInfo.alphaType),
215
+ colorType: (0, _Host.getEnum)(this.CanvasKit.ColorType, imageInfo.colorType)
216
216
  };
217
217
  return this.ref.readPixels(srcX, srcY, pxInfo);
218
218
  }
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkCanvas","HostObject","constructor","CanvasKit","ref","delete","drawRect","rect","paint","JsiSkRect","fromValue","JsiSkPaint","drawImage","image","x","y","JsiSkImage","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","ckEnum","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","JsiSkVertices","drawPatch","cubics","colors","texs","map","flat","flatMap","p","JsiSkPoint","undefined","restoreToCount","saveCount","drawPoints","points","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","JsiSkRRect","drawDRRect","outer","inner","drawOval","drawPath","path","JsiSkPath","drawText","str","font","JsiSkFont","drawTextBlob","blob","JsiSkTextBlob","drawGlyphs","glyphs","positions","drawSvg","_svgDom","_width","_height","Error","save","saveLayer","bounds","backdrop","flags","JsiSkImageFilter","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","clipRect","clipRRect","concat","m","JsiSkMatrix","drawPicture","skp","JsiSkPicture","readPixels","srcX","srcY","imageInfo","pxInfo","width","height","colorSpace","ColorSpace","SRGB","alphaType","getCkEnum","AlphaType","colorType","ColorType"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type { Canvas, CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n ClipOp,\n FilterMode,\n MipmapMode,\n PointMode,\n SaveLayerFlag,\n ImageInfo,\n SkCanvas,\n SkColor,\n SkFont,\n SkImage,\n SkImageFilter,\n SkMatrix,\n SkPaint,\n SkPath,\n SkPicture,\n SkPoint,\n SkRect,\n SkRRect,\n SkSVG,\n SkTextBlob,\n SkVertices,\n} from \"../types\";\n\nimport { ckEnum, getCkEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkCanvas\n extends HostObject<Canvas, \"Canvas\">\n implements SkCanvas\n{\n constructor(CanvasKit: CanvasKit, ref: Canvas) {\n super(CanvasKit, ref, \"Canvas\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n drawRect(rect: SkRect, paint: SkPaint) {\n this.ref.drawRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n this.ref.drawImage(\n JsiSkImage.fromValue(image),\n x,\n y,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRect(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n paint: SkPaint,\n fastSample?: boolean\n ) {\n this.ref.drawImageRect(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n JsiSkPaint.fromValue(paint),\n fastSample\n );\n }\n\n drawImageCubic(\n img: SkImage,\n left: number,\n top: number,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageCubic(\n JsiSkImage.fromValue(img),\n left,\n top,\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageOptions(\n img: SkImage,\n left: number,\n top: number,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageOptions(\n JsiSkImage.fromValue(img),\n left,\n top,\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageNine(\n img: SkImage,\n center: SkRect,\n dest: SkRect,\n filter: FilterMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageNine(\n JsiSkImage.fromValue(img),\n Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(filter),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectCubic(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectCubic(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectOptions(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectOptions(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawPaint(paint: SkPaint) {\n this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n }\n\n drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n }\n\n drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n }\n\n drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n this.ref.drawVertices(\n JsiSkVertices.fromValue(verts),\n ckEnum(mode),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPatch(\n cubics: SkPoint[],\n colors?: SkColor[] | null,\n texs?: SkPoint[] | null,\n mode?: BlendMode | null,\n paint?: SkPaint\n ) {\n this.ref.drawPatch(\n cubics.map(({ x, y }) => [x, y]).flat(),\n colors,\n texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n mode ? ckEnum(mode) : null,\n paint ? JsiSkPaint.fromValue(paint) : undefined\n );\n }\n\n restoreToCount(saveCount: number) {\n this.ref.restoreToCount(saveCount);\n }\n\n drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n this.ref.drawPoints(\n ckEnum(mode),\n points.map(({ x, y }) => [x, y]).flat(),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawArc(\n oval: SkRect,\n startAngle: number,\n sweepAngle: number,\n useCenter: boolean,\n paint: SkPaint\n ) {\n this.ref.drawArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngle,\n sweepAngle,\n useCenter,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawRRect(rrect: SkRRect, paint: SkPaint) {\n this.ref.drawRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawDRRect(outer: SkRRect, inner: SkRRect, paint: SkPaint) {\n this.ref.drawDRRect(\n JsiSkRRect.fromValue(this.CanvasKit, outer),\n JsiSkRRect.fromValue(this.CanvasKit, inner),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawOval(oval: SkRect, paint: SkPaint) {\n this.ref.drawOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPath(path: SkPath, paint: SkPaint) {\n this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n }\n\n drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n this.ref.drawText(\n str,\n x,\n y,\n JsiSkPaint.fromValue(paint),\n JsiSkFont.fromValue(font)\n );\n }\n\n drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n this.ref.drawTextBlob(\n JsiSkTextBlob.fromValue(blob),\n x,\n y,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawGlyphs(\n glyphs: number[],\n positions: SkPoint[],\n x: number,\n y: number,\n font: SkFont,\n paint: SkPaint\n ) {\n this.ref.drawGlyphs(\n glyphs,\n positions.map((p) => [p.x, p.y]).flat(),\n x,\n y,\n JsiSkFont.fromValue(font),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawSvg(_svgDom: SkSVG, _width?: number, _height?: number) {\n throw new Error(\"drawSvg is not implemented on React Native Web\");\n }\n\n save() {\n return this.ref.save();\n }\n\n saveLayer(\n paint?: SkPaint,\n bounds?: SkRect | null,\n backdrop?: SkImageFilter | null,\n flags?: SaveLayerFlag\n ) {\n return this.ref.saveLayer(\n paint ? JsiSkPaint.fromValue(paint) : undefined,\n bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n flags\n );\n }\n\n restore() {\n this.ref.restore();\n }\n\n rotate(rotationInDegrees: number, rx: number, ry: number) {\n this.ref.rotate(rotationInDegrees, rx, ry);\n }\n\n scale(sx: number, sy: number) {\n this.ref.scale(sx, sy);\n }\n\n skew(sx: number, sy: number) {\n this.ref.skew(sx, sy);\n }\n\n translate(dx: number, dy: number) {\n this.ref.translate(dx, dy);\n }\n\n drawColor(color: SkColor, blendMode?: BlendMode) {\n this.ref.drawColor(color, blendMode ? ckEnum(blendMode) : undefined);\n }\n\n clear(color: SkColor) {\n this.ref.clear(color);\n }\n\n clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipPath(JsiSkPath.fromValue(path), ckEnum(op), doAntiAlias);\n }\n\n clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n concat(m: SkMatrix) {\n this.ref.concat(JsiSkMatrix.fromValue(m));\n }\n\n drawPicture(skp: SkPicture) {\n this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n }\n\n readPixels(srcX: number, srcY: number, imageInfo: ImageInfo) {\n const pxInfo = {\n width: imageInfo.width,\n height: imageInfo.height,\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n alphaType: getCkEnum(this.CanvasKit.AlphaType, imageInfo.alphaType),\n colorType: getCkEnum(this.CanvasKit.ColorType, imageInfo.colorType),\n };\n return this.ref.readPixels(srcX, sr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e0I,SAAzB,EAAoCT,SAAS,CAACO,SAA9C,CAJE;MAKbG,SAAS,EAAE,IAAAF,eAAA,EAAU,KAAKzI,SAAL,CAAe4I,SAAzB,EAAoCX,SAAS,CAACU,SAA9C;IALE,CAAf;IAOA,OAAO,KAAK1I,GAAL,CAAS6H,UAAT,CAAoBC,IAApB,EAA0BC,IAA1B,EAAgCE,MAAhC,CAAP;EACD;;AAvVH"}
1
+ {"version":3,"names":["JsiSkCanvas","HostObject","constructor","CanvasKit","ref","delete","drawRect","rect","paint","JsiSkRect","fromValue","JsiSkPaint","drawImage","image","x","y","JsiSkImage","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","getEnum","FilterMode","MipmapMode","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","JsiSkVertices","BlendMode","drawPatch","cubics","colors","texs","map","flat","flatMap","p","JsiSkPoint","undefined","restoreToCount","saveCount","drawPoints","points","PointMode","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","JsiSkRRect","drawDRRect","outer","inner","drawOval","drawPath","path","JsiSkPath","drawText","str","font","JsiSkFont","drawTextBlob","blob","JsiSkTextBlob","drawGlyphs","glyphs","positions","drawSvg","_svgDom","_width","_height","Error","save","saveLayer","bounds","backdrop","flags","JsiSkImageFilter","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","PathOp","clipRect","clipRRect","concat","m","isArray","JsiSkMatrix","drawPicture","skp","JsiSkPicture","readPixels","srcX","srcY","imageInfo","pxInfo","width","height","colorSpace","ColorSpace","SRGB","alphaType","AlphaType","colorType","ColorType"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type { Canvas, CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n ClipOp,\n FilterMode,\n MipmapMode,\n PointMode,\n SaveLayerFlag,\n ImageInfo,\n SkCanvas,\n SkColor,\n SkFont,\n SkImage,\n SkImageFilter,\n SkMatrix,\n SkPaint,\n SkPath,\n SkPicture,\n SkPoint,\n SkRect,\n SkRRect,\n SkSVG,\n SkTextBlob,\n SkVertices,\n} from \"../types\";\n\nimport { getEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkCanvas\n extends HostObject<Canvas, \"Canvas\">\n implements SkCanvas\n{\n constructor(CanvasKit: CanvasKit, ref: Canvas) {\n super(CanvasKit, ref, \"Canvas\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n drawRect(rect: SkRect, paint: SkPaint) {\n this.ref.drawRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n this.ref.drawImage(\n JsiSkImage.fromValue(image),\n x,\n y,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRect(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n paint: SkPaint,\n fastSample?: boolean\n ) {\n this.ref.drawImageRect(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n JsiSkPaint.fromValue(paint),\n fastSample\n );\n }\n\n drawImageCubic(\n img: SkImage,\n left: number,\n top: number,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageCubic(\n JsiSkImage.fromValue(img),\n left,\n top,\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageOptions(\n img: SkImage,\n left: number,\n top: number,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageOptions(\n JsiSkImage.fromValue(img),\n left,\n top,\n getEnum(this.CanvasKit.FilterMode, fm),\n getEnum(this.CanvasKit.MipmapMode, mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageNine(\n img: SkImage,\n center: SkRect,\n dest: SkRect,\n filter: FilterMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageNine(\n JsiSkImage.fromValue(img),\n Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n getEnum(this.CanvasKit.FilterMode, filter),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectCubic(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectCubic(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectOptions(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectOptions(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n getEnum(this.CanvasKit.FilterMode, fm),\n getEnum(this.CanvasKit.MipmapMode, mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawPaint(paint: SkPaint) {\n this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n }\n\n drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n }\n\n drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n }\n\n drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n this.ref.drawVertices(\n JsiSkVertices.fromValue(verts),\n getEnum(this.CanvasKit.BlendMode, mode),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPatch(\n cubics: SkPoint[],\n colors?: SkColor[] | null,\n texs?: SkPoint[] | null,\n mode?: BlendMode | null,\n paint?: SkPaint\n ) {\n this.ref.drawPatch(\n cubics.map(({ x, y }) => [x, y]).flat(),\n colors,\n texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n mode ? getEnum(this.CanvasKit.BlendMode, mode) : null,\n paint ? JsiSkPaint.fromValue(paint) : undefined\n );\n }\n\n restoreToCount(saveCount: number) {\n this.ref.restoreToCount(saveCount);\n }\n\n drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n this.ref.drawPoints(\n getEnum(this.CanvasKit.PointMode, mode),\n points.map(({ x, y }) => [x, y]).flat(),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawArc(\n oval: SkRect,\n startAngle: number,\n sweepAngle: number,\n useCenter: boolean,\n paint: SkPaint\n ) {\n this.ref.drawArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngle,\n sweepAngle,\n useCenter,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawRRect(rrect: SkRRect, paint: SkPaint) {\n this.ref.drawRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawDRRect(outer: SkRRect, inner: SkRRect, paint: SkPaint) {\n this.ref.drawDRRect(\n JsiSkRRect.fromValue(this.CanvasKit, outer),\n JsiSkRRect.fromValue(this.CanvasKit, inner),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawOval(oval: SkRect, paint: SkPaint) {\n this.ref.drawOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPath(path: SkPath, paint: SkPaint) {\n this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n }\n\n drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n this.ref.drawText(\n str,\n x,\n y,\n JsiSkPaint.fromValue(paint),\n JsiSkFont.fromValue(font)\n );\n }\n\n drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n this.ref.drawTextBlob(\n JsiSkTextBlob.fromValue(blob),\n x,\n y,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawGlyphs(\n glyphs: number[],\n positions: SkPoint[],\n x: number,\n y: number,\n font: SkFont,\n paint: SkPaint\n ) {\n this.ref.drawGlyphs(\n glyphs,\n positions.map((p) => [p.x, p.y]).flat(),\n x,\n y,\n JsiSkFont.fromValue(font),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawSvg(_svgDom: SkSVG, _width?: number, _height?: number) {\n throw new Error(\"drawSvg is not implemented on React Native Web\");\n }\n\n save() {\n return this.ref.save();\n }\n\n saveLayer(\n paint?: SkPaint,\n bounds?: SkRect | null,\n backdrop?: SkImageFilter | null,\n flags?: SaveLayerFlag\n ) {\n return this.ref.saveLayer(\n paint ? JsiSkPaint.fromValue(paint) : undefined,\n bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n flags\n );\n }\n\n restore() {\n this.ref.restore();\n }\n\n rotate(rotationInDegrees: number, rx: number, ry: number) {\n this.ref.rotate(rotationInDegrees, rx, ry);\n }\n\n scale(sx: number, sy: number) {\n this.ref.scale(sx, sy);\n }\n\n skew(sx: number, sy: number) {\n this.ref.skew(sx, sy);\n }\n\n translate(dx: number, dy: number) {\n this.ref.translate(dx, dy);\n }\n\n drawColor(color: SkColor, blendMode?: BlendMode) {\n this.ref.drawColor(\n color,\n blendMode ? getEnum(this.CanvasKit.BlendMode, blendMode) : undefined\n );\n }\n\n clear(color: SkColor) {\n this.ref.clear(color);\n }\n\n clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipPath(\n JsiSkPath.fromValue(path),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n concat(m: SkMatrix | number[]) {\n this.ref.concat(Array.isArray(m) ? m : JsiSkMatrix.fromValue(m));\n }\n\n drawPicture(skp: SkPicture) {\n this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n }\n\n readPixels(srcX: number, srcY: number, imageInfo: ImageInfo) {\n const pxInfo = {\n width: imageInfo.width,\n height: imageInfo.height,\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n alphaType: getEnum(this.CanvasKit.AlphaType, imageInfo.alphaType),\n colorType: getEnum(this.CanvasKit.ColorType, imageInfo.colorType),\n };\n return this.ref.readPixels(srcX, srcY, pxInfo);\n }\n}\n"],"mappings":";;;;;;;AA2BA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,WAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAoC;IAC7C,MAAMD,SA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ArB;EACD;;EAEDE,UAAU,CAACC,IAAD,EAAeC,IAAf,EAA6BC,SAA7B,EAAmD;IAC3D,MAAMC,MAAM,GAAG;MACbC,KAAK,EAAEF,SAAS,CAACE,KADJ;MAEbC,MAAM,EAAEH,SAAS,CAACG,MAFL;MAGbC,UAAU,EAAE,KAAK3I,SAAL,CAAe4I,UAAf,CAA0BC,IAHzB;MAIbC,SAAS,EAAE,IAAAnH,aAAA,EAAQ,KAAK3B,SAAL,CAAe+I,SAAvB,EAAkCR,SAAS,CAACO,SAA5C,CAJE;MAKbE,SAAS,EAAE,IAAArH,aAAA,EAAQ,KAAK3B,SAAL,CAAeiJ,SAAvB,EAAkCV,SAAS,CAACS,SAA5C;IALE,CAAf;IAOA,OAAO,KAAK/I,GAAL,CAASmI,UAAT,CAAoBC,IAApB,EAA0BC,IAA1B,EAAgCE,MAAhC,CAAP;EACD;;AA9VH"}
@@ -19,7 +19,7 @@ class JsiSkColorFilterFactory extends _Host.Host {
19
19
  }
20
20
 
21
21
  MakeBlend(color, mode) {
22
- return new _JsiSkColorFilter.JsiSkColorFilter(this.CanvasKit, this.CanvasKit.ColorFilter.MakeBlend(color, (0, _Host.ckEnum)(mode)));
22
+ return new _JsiSkColorFilter.JsiSkColorFilter(this.CanvasKit, this.CanvasKit.ColorFilter.MakeBlend(color, (0, _Host.getEnum)(this.CanvasKit.BlendMode, mode)));
23
23
  }
24
24
 
25
25
  MakeCompose(outer, inner) {
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkColorFilterFactory","Host","constructor","CanvasKit","MakeMatrix","cMatrix","JsiSkColorFilter","ColorFilter","MakeBlend","color","mode","ckEnum","MakeCompose","outer","inner","fromValue","MakeLerp","t","dst","src","MakeLinearToSRGBGamma","MakeSRGBToLinearGamma","MakeLumaColorFilter","MakeLuma"],"sources":["JsiSkColorFilterFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n ColorFilterFactory,\n SkColorFilter,\n InputColorMatrix,\n SkColor,\n BlendMode,\n} from \"../types\";\n\nimport { ckEnum, Host } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\n\nexport class JsiSkColorFilterFactory\n extends Host\n implements ColorFilterFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeMatrix(cMatrix: InputColorMatrix) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeMatrix(cMatrix)\n );\n }\n\n MakeBlend(color: SkColor, mode: BlendMode) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeBlend(color, ckEnum(mode))\n );\n }\n\n MakeCompose(outer: SkColorFilter, inner: SkColorFilter) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeCompose(\n JsiSkColorFilter.fromValue(outer),\n JsiSkColorFilter.fromValue(inner)\n )\n );\n }\n\n MakeLerp(t: number, dst: SkColorFilter, src: SkColorFilter) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeLerp(\n t,\n JsiSkColorFilter.fromValue(dst),\n JsiSkColorFilter.fromValue(src)\n )\n );\n }\n\n MakeLinearToSRGBGamma() {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeLinearToSRGBGamma()\n );\n }\n\n MakeSRGBToLinearGamma() {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeSRGBToLinearGamma()\n );\n }\n\n MakeLumaColorFilter(): SkColorFilter {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeLuma()\n );\n }\n}\n"],"mappings":";;;;;;;AAUA;;AACA;;AAEO,MAAMA,uBAAN,SACGC,UADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,OAAD,EAA4B;IACpC,OAAO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A,SAAL,CAAeI,WAAf,CAA2BgB,QAA3B,EAFK,CAAP;EAID;;AA3DH"}
1
+ {"version":3,"names":["JsiSkColorFilterFactory","Host","constructor","CanvasKit","MakeMatrix","cMatrix","JsiSkColorFilter","ColorFilter","MakeBlend","color","mode","getEnum","BlendMode","MakeCompose","outer","inner","fromValue","MakeLerp","t","dst","src","MakeLinearToSRGBGamma","MakeSRGBToLinearGamma","MakeLumaColorFilter","MakeLuma"],"sources":["JsiSkColorFilterFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n ColorFilterFactory,\n SkColorFilter,\n InputColorMatrix,\n SkColor,\n BlendMode,\n} from \"../types\";\n\nimport { getEnum, Host } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\n\nexport class JsiSkColorFilterFactory\n extends Host\n implements ColorFilterFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeMatrix(cMatrix: InputColorMatrix) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeMatrix(cMatrix)\n );\n }\n\n MakeBlend(color: SkColor, mode: BlendMode) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeBlend(\n color,\n getEnum(this.CanvasKit.BlendMode, mode)\n )\n );\n }\n\n MakeCompose(outer: SkColorFilter, inner: SkColorFilter) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeCompose(\n JsiSkColorFilter.fromValue(outer),\n JsiSkColorFilter.fromValue(inner)\n )\n );\n }\n\n MakeLerp(t: number, dst: SkColorFilter, src: SkColorFilter) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeLerp(\n t,\n JsiSkColorFilter.fromValue(dst),\n JsiSkColorFilter.fromValue(src)\n )\n );\n }\n\n MakeLinearToSRGBGamma() {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeLinearToSRGBGamma()\n );\n }\n\n MakeSRGBToLinearGamma() {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeSRGBToLinearGamma()\n );\n }\n\n MakeLumaColorFilter(): SkColorFilter {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeLuma()\n );\n }\n}\n"],"mappings":";;;;;;;AAUA;;AACA;;AAEO,MAAMA,uBAAN,SACGC,UADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,OAAD,EAA4B;IACpC,OAAO,IAAIC,kCAAJ,CACL,KAAKH,SADA,EAEL,KAAKA,SAAL,CAAeI,WAAf,CAA2BH,UAA3B,CAAsCC,OAAtC,CAFK,CAAP;EAID;;EAEDG,SAAS,CAACC,KAAD,EAAiBC,IAAjB,EAAkC;IACzC,OAAO,IAAIJ,kCAAJ,CACL,KAAKH,SADA,EAEL,KAAKA,SAAL,CAAeI,WAAf,CAA2BC,SAA3B,CACEC,KADF,EAEE,IAAAE,aAAA,EAAQ,KAAKR,SAAL,CAAeS,SAAvB,EAAkCF,IAAlC,CAFF,CAFK,CAAP;EAOD;;EAEDG,WAAW,CAACC,KAAD,EAAuBC,KAAvB,EAA6C;IACtD,OAAO,IAAIT,kCAAJ,CACL,KAAKH,SADA,EAEL,KAAKA,SAAL,CAAeI,WAAf,CAA2BM,WAA3B,CACEP,kCAAA,CAAiBU,SAAjB,CAA2BF,KAA3B,CADF,EAEER,kCAAA,CAAiBU,SAAjB,CAA2BD,KAA3B,CAFF,CAFK,CAAP;EAOD;;EAEDE,QAAQ,CAACC,CAAD,EAAYC,GAAZ,EAAgCC,GAAhC,EAAoD;IAC1D,OAAO,IAAId,kCAAJ,CACL,KAAKH,SADA,EAEL,KAAKA,SAAL,CAAeI,WAAf,CAA2BU,QAA3B,CACEC,CADF,EAEEZ,kCAAA,CAAiBU,SAAjB,CAA2BG,GAA3B,CAFF,EAGEb,kCAAA,CAAiBU,SAAjB,CAA2BI,GAA3B,CAHF,CAFK,CAAP;EAQD;;EAEDC,qBAAqB,GAAG;IACtB,OAAO,IAAIf,kCAAJ,CACL,KAAKH,SADA,EAEL,KAAKA,SAAL,CAAeI,WAAf,CAA2Bc,qBAA3B,EAFK,CAAP;EAID;;EAEDC,qBAAqB,GAAG;IACtB,OAAO,IAAIhB,kCAAJ,CACL,KAAKH,SADA,EAEL,KAAKA,SAAL,CAAeI,WAAf,CAA2Be,qBAA3B,EAFK,CAAP;EAID;;EAEDC,mBAAmB,GAAkB;IACnC,OAAO,IAAIjB,kCAAJ,CACL,KAAKH,SADA,EAEL,KAAKA,SAAL,CAAeI,WAAf,CAA2BiB,QAA3B,EAFK,CAAP;EAID;;AA9DH"}
@@ -82,7 +82,7 @@ class JsiSkFont extends _Host.HostObject {
82
82
  }
83
83
 
84
84
  setEdging(edging) {
85
- this.ref.setEdging((0, _Host.ckEnum)(edging));
85
+ this.ref.setEdging((0, _Host.getEnum)(this.CanvasKit.FontEdging, edging));
86
86
  }
87
87
 
88
88
  setEmbeddedBitmaps(embeddedBitmaps) {
@@ -90,7 +90,7 @@ class JsiSkFont extends _Host.HostObject {
90
90
  }
91
91
 
92
92
  setHinting(hinting) {
93
- this.ref.setHinting((0, _Host.ckEnum)(hinting));
93
+ this.ref.setHinting((0, _Host.getEnum)(this.CanvasKit.FontHinting, hinting));
94
94
  }
95
95
 
96
96
  setLinearMetrics(linearMetrics) {
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkFont","HostObject","constructor","CanvasKit","ref","delete","measureText","_text","_paint","NotImplementedOnRNWeb","getTextWidth","text","paint","ids","getGlyphIDs","widths","getGlyphWidths","reduce","a","b","getMetrics","result","ascent","descent","leading","bounds","JsiSkRect","undefined","str","numCodePoints","glyphs","JsiSkPaint","fromValue","getGlyphIntercepts","positions","top","bottom","map","p","Array","from","JsiSkPoint","flat","getScaleX","getSize","getSkewX","isEmbolden","getTypeface","tf","JsiSkTypeface","setEdging","edging","ckEnum","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 SkRect,\n SkTypeface,\n} from \"../types\";\n\nimport { HostObject, NotImplementedOnRNWeb, 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 measureText(_text: string, _paint?: SkPaint | undefined): SkRect {\n throw new NotImplementedOnRNWeb();\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":";;;;;;;AAYA;;AACA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,SAAN,SAAwBC,gBAAxB,CAAmE;EACxEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAQnC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAV4C;EAE5C;;EAEDC,WAAW,CAACC,KAAD,EAAgBC,MAAhB,EAAsD;IAC/D,MAA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AKxD,GAAL,CAAS2D,QAAT,CAAkBH,EAAlB;EACD;;EAEDI,WAAW,CAACC,QAAD,EAAoB;IAC7B,KAAK7D,GAAL,CAAS4D,WAAT,CAAqBC,QAArB;EACD;;EAEDC,WAAW,CAACC,QAAD,EAAoB;IAC7B,KAAK/D,GAAL,CAAS8D,WAAT,CAAqBC,QAArB;EACD;;EAEDC,WAAW,CAACC,IAAD,EAA0B;IACnC,KAAKjE,GAAL,CAASgE,WAAT,CAAqBC,IAAI,GAAGpB,4BAAA,CAAcjB,SAAd,CAAwBqC,IAAxB,CAAH,GAAmC,IAA5D;EACD;;AAzHuE"}
1
+ {"version":3,"names":["JsiSkFont","HostObject","constructor","CanvasKit","ref","delete","measureText","_text","_paint","NotImplementedOnRNWeb","getTextWidth","text","paint","ids","getGlyphIDs","widths","getGlyphWidths","reduce","a","b","getMetrics","result","ascent","descent","leading","bounds","JsiSkRect","undefined","str","numCodePoints","glyphs","JsiSkPaint","fromValue","getGlyphIntercepts","positions","top","bottom","map","p","Array","from","JsiSkPoint","flat","getScaleX","getSize","getSkewX","isEmbolden","getTypeface","tf","JsiSkTypeface","setEdging","edging","getEnum","FontEdging","setEmbeddedBitmaps","embeddedBitmaps","setHinting","hinting","FontHinting","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 SkRect,\n SkTypeface,\n} from \"../types\";\n\nimport { HostObject, NotImplementedOnRNWeb, getEnum } 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 measureText(_text: string, _paint?: SkPaint | undefined): SkRect {\n throw new NotImplementedOnRNWeb();\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(getEnum(this.CanvasKit.FontEdging, edging));\n }\n\n setEmbeddedBitmaps(embeddedBitmaps: boolean) {\n this.ref.setEmbeddedBitmaps(embeddedBitmaps);\n }\n\n setHinting(hinting: FontHinting) {\n this.ref.setHinting(getEnum(this.CanvasKit.FontHinting, 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":";;;;;;;AAYA;;AACA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,SAAN,SAAwBC,gBAAxB,CAAmE;EACxEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAQnC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAV4C;EAE5C;;EAEDC,WAAW,CAACC,KAAD,EAAgBC,MAAhB,EAAsD;IAC/D,MAAM,IAAIC,2BAAJ,EAAN;EACD;;EAMDC,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;IACA,OAAOG,MAAM,CAACE,MAAP,CAAc,CAACC,CAAD,EAAIC,CAAJ,KAAUD,CAAC,GAAGC,CAA5B,EAA+B,CAA/B,CAAP;EACD;;EAEDC,UAAU,GAAG;IACX,MAAMC,MAAM,GAAG,KAAKjB,GAAL,CAASgB,UAAT,EAAf;IACA,OAAO;MACLE,MAAM,EAAED,MAAM,CAACC,MADV;MAELC,OAAO,EAAEF,MAAM,CAACE,OAFX;MAGLC,OAAO,EAAEH,MAAM,CAACG,OAHX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
 
75
75
  makeShaderOptions(tx, ty, fm, mm, localMatrix) {
76
- return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShaderOptions((0, _Host.ckEnum)(tx), (0, _Host.ckEnum)(ty), (0, _Host.ckEnum)(fm), (0, _Host.ckEnum)(mm), localMatrix ? _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix) : undefined));
76
+ return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShaderOptions((0, _Host.getEnum)(this.CanvasKit.TileMode, tx), (0, _Host.getEnum)(this.CanvasKit.TileMode, ty), (0, _Host.getEnum)(this.CanvasKit.FilterMode, fm), (0, _Host.getEnum)(this.CanvasKit.MipmapMode, mm), localMatrix ? _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix) : undefined));
77
77
  }
78
78
 
79
79
  makeShaderCubic(tx, ty, B, C, localMatrix) {
80
- return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShaderCubic((0, _Host.ckEnum)(tx), (0, _Host.ckEnum)(ty), B, C, localMatrix ? _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix) : undefined));
80
+ return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShaderCubic((0, _Host.getEnum)(this.CanvasKit.TileMode, tx), (0, _Host.getEnum)(this.CanvasKit.TileMode, ty), B, C, localMatrix ? _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix) : undefined));
81
81
  }
82
82
 
83
83
  encodeToBytes(fmt, quality) {
84
84
  let result;
85
85
 
86
86
  if (fmt && quality) {
87
- result = this.ref.encodeToBytes((0, _Host.ckEnum)(fmt), quality);
87
+ result = this.ref.encodeToBytes((0, _Host.getEnum)(this.CanvasKit.ImageFormat, fmt), quality);
88
88
  } else if (fmt) {
89
- result = this.ref.encodeToBytes((0, _Host.ckEnum)(fmt));
89
+ result = this.ref.encodeToBytes((0, _Host.getEnum)(this.CanvasKit.ImageFormat, fmt));
90
90
  } else {
91
91
  result = this.ref.encodeToBytes();
92
92
  }
@@ -109,8 +109,8 @@ class JsiSkImage extends _Host.HostObject {
109
109
  colorSpace: this.CanvasKit.ColorSpace.SRGB,
110
110
  width: (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.width) ?? info.width,
111
111
  height: (imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.height) ?? info.height,
112
- alphaType: (0, _Host.getCkEnum)(this.CanvasKit.AlphaType, (imageInfo ?? info).alphaType),
113
- colorType: (0, _Host.getCkEnum)(this.CanvasKit.ColorType, (imageInfo ?? info).colorType)
112
+ alphaType: (0, _Host.getEnum)(this.CanvasKit.AlphaType, (imageInfo ?? info).alphaType),
113
+ colorType: (0, _Host.getEnum)(this.CanvasKit.ColorType, (imageInfo ?? info).colorType)
114
114
  };
115
115
  return this.ref.readPixels(srcX ?? 0, srcY ?? 0, pxInfo);
116
116
  }
@@ -1 +1 @@
1
- {"version":3,"names":["toBase64String","bytes","Buffer","from","toString","CHUNK_SIZE","index","length","result","slice","Math","min","String","fromCharCode","apply","btoa","JsiSkImage","HostObject","constructor","CanvasKit","ref","delete","height","width","getImageInfo","info","colorType","value","alphaType","makeShaderOptions","tx","ty","fm","mm","localMatrix","JsiSkShader","ckEnum","JsiSkMatrix","fromValue","undefined","makeShaderCubic","B","C","encodeToBytes","fmt","quality","Error","encodeToBase64","readPixels","srcX","srcY","imageInfo","pxInfo","colorSpace","ColorSpace","SRGB","getCkEnum","AlphaType","ColorType","makeNonTextureImage","MakeImageFromEncoded"],"sources":["JsiSkImage.ts"],"sourcesContent":["import type {\n CanvasKit,\n ImageInfo as CKImageInfo,\n Image,\n} from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n MipmapMode,\n SkImage,\n SkMatrix,\n SkShader,\n TileMode,\n ImageFormat,\n ImageInfo,\n} from \"../types\";\n\nimport { ckEnum, getCkEnum, 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 getImageInfo(): ImageInfo {\n const info = this.ref.getImageInfo();\n return {\n width: info.width,\n height: info.height,\n colorType: info.colorType.value,\n alphaType: info.alphaType.value,\n };\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 readPixels(srcX?: number, srcY?: number, imageInfo?: ImageInfo) {\n const info = this.getImageInfo();\n const pxInfo: CKImageInfo = {\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n width: imageInfo?.width ?? info.width,\n height: imageInfo?.height ?? info.height,\n alphaType: getCkEnum(\n this.CanvasKit.AlphaType,\n (imageInfo ?? info).alphaType\n ),\n colorType: getCkEnum(\n this.CanvasKit.ColorType,\n (imageInfo ?? info).colorType\n ),\n };\n return this.ref.readPixels(srcX ?? 0, srcY ?? 0, pxInfo);\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":";;;;;;;AAiBA;;AACA;;AACA;;;;AAEA;AACO,MAAMA,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,E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AhB,EAA+BC,SAA/B,EAAsD;IAC9D,MAAM1B,IAAI,GAAG,KAAKD,YAAL,EAAb;IACA,MAAM4B,MAAmB,GAAG;MAC1BC,UAAU,EAAE,KAAKlC,SAAL,CAAemC,UAAf,CAA0BC,IADZ;MAE1BhC,KAAK,EAAE,CAAA4B,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAE5B,KAAX,KAAoBE,IAAI,CAACF,KAFN;MAG1BD,MAAM,EAAE,CAAA6B,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAE7B,MAAX,KAAqBG,IAAI,CAACH,MAHR;MAI1BM,SAAS,EAAE,IAAA4B,eAAA,EACT,KAAKrC,SAAL,CAAesC,SADN,EAET,CAACN,SAAS,IAAI1B,IAAd,EAAoBG,SAFX,CAJe;MAQ1BF,SAAS,EAAE,IAAA8B,eAAA,EACT,KAAKrC,SAAL,CAAeuC,SADN,EAET,CAACP,SAAS,IAAI1B,IAAd,EAAoBC,SAFX;IARe,CAA5B;IAaA,OAAO,KAAKN,GAAL,CAAS4B,UAAT,CAAoBC,IAAI,IAAI,CAA5B,EAA+BC,IAAI,IAAI,CAAvC,EAA0CE,MAA1C,CAAP;EACD;;EAMDO,mBAAmB,GAAY;IAC7B,OAAO,IAAI3C,UAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeyC,oBAAf,CAAoC,KAAKjB,aAAL,EAApC,CAFK,CAAP;EAID;;AA5G2E"}
1
+ {"version":3,"names":["toBase64String","bytes","Buffer","from","toString","CHUNK_SIZE","index","length","result","slice","Math","min","String","fromCharCode","apply","btoa","JsiSkImage","HostObject","constructor","CanvasKit","ref","delete","height","width","getImageInfo","info","colorType","value","alphaType","makeShaderOptions","tx","ty","fm","mm","localMatrix","JsiSkShader","getEnum","TileMode","FilterMode","MipmapMode","JsiSkMatrix","fromValue","undefined","makeShaderCubic","B","C","encodeToBytes","fmt","quality","ImageFormat","Error","encodeToBase64","readPixels","srcX","srcY","imageInfo","pxInfo","colorSpace","ColorSpace","SRGB","AlphaType","ColorType","makeNonTextureImage","MakeImageFromEncoded"],"sources":["JsiSkImage.ts"],"sourcesContent":["import type {\n CanvasKit,\n ImageInfo as CKImageInfo,\n Image,\n} from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n MipmapMode,\n SkImage,\n SkMatrix,\n SkShader,\n TileMode,\n ImageFormat,\n ImageInfo,\n} from \"../types\";\n\nimport { getEnum, 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 getImageInfo(): ImageInfo {\n const info = this.ref.getImageInfo();\n return {\n width: info.width,\n height: info.height,\n colorType: info.colorType.value,\n alphaType: info.alphaType.value,\n };\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 getEnum(this.CanvasKit.TileMode, tx),\n getEnum(this.CanvasKit.TileMode, ty),\n getEnum(this.CanvasKit.FilterMode, fm),\n getEnum(this.CanvasKit.MipmapMode, 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 getEnum(this.CanvasKit.TileMode, tx),\n getEnum(this.CanvasKit.TileMode, 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(\n getEnum(this.CanvasKit.ImageFormat, fmt),\n quality\n );\n } else if (fmt) {\n result = this.ref.encodeToBytes(getEnum(this.CanvasKit.ImageFormat, 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 readPixels(srcX?: number, srcY?: number, imageInfo?: ImageInfo) {\n const info = this.getImageInfo();\n const pxInfo: CKImageInfo = {\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n width: imageInfo?.width ?? info.width,\n height: imageInfo?.height ?? info.height,\n alphaType: getEnum(\n this.CanvasKit.AlphaType,\n (imageInfo ?? info).alphaType\n ),\n colorType: getEnum(\n this.CanvasKit.ColorType,\n (imageInfo ?? info).colorType\n ),\n };\n return this.ref.readPixels(srcX ?? 0, srcY ?? 0, pxInfo);\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n makeNonTextureImage(): SkImage {\n return new JsiSkImage(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S,EAAE,IAAAQ,aAAA,EACT,KAAKjB,SAAL,CAAeyC,SADN,EAET,CAACL,SAAS,IAAI9B,IAAd,EAAoBG,SAFX,CAJe;MAQ1BF,SAAS,EAAE,IAAAU,aAAA,EACT,KAAKjB,SAAL,CAAe0C,SADN,EAET,CAACN,SAAS,IAAI9B,IAAd,EAAoBC,SAFX;IARe,CAA5B;IAaA,OAAO,KAAKN,GAAL,CAASgC,UAAT,CAAoBC,IAAI,IAAI,CAA5B,EAA+BC,IAAI,IAAI,CAAvC,EAA0CE,MAA1C,CAAP;EACD;;EAMDM,mBAAmB,GAAY;IAC7B,OAAO,IAAI9C,UAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAe4C,oBAAf,CAAoC,KAAKjB,aAAL,EAApC,CAFK,CAAP;EAID;;AA/G2E"}
@@ -36,9 +36,9 @@ class JsiSkImageFactory extends _Host.Host {
36
36
  MakeImage(info, data, bytesPerRow) {
37
37
  // see toSkImageInfo() from canvaskit
38
38
  const image = this.CanvasKit.MakeImage({
39
- alphaType: (0, _Host.ckEnum)(info.alphaType),
39
+ alphaType: (0, _Host.getEnum)(this.CanvasKit.AlphaType, info.alphaType),
40
40
  colorSpace: this.CanvasKit.ColorSpace.SRGB,
41
- colorType: (0, _Host.ckEnum)(info.colorType),
41
+ colorType: (0, _Host.getEnum)(this.CanvasKit.ColorType, info.colorType),
42
42
  height: info.height,
43
43
  width: info.width
44
44
  }, _JsiSkData.JsiSkData.fromValue(data), bytesPerRow);
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkImageFactory","Host","constructor","CanvasKit","MakeImageFromViewTag","viewTag","view","console","log","Promise","resolve","MakeImageFromEncoded","encoded","image","JsiSkData","fromValue","JsiSkImage","MakeImage","info","data","bytesPerRow","alphaType","ckEnum","colorSpace","ColorSpace","SRGB","colorType","height","width"],"sources":["JsiSkImageFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData, ImageInfo, SkImage } from \"../types\";\nimport type { ImageFactory } from \"../types/Image/ImageFactory\";\n\nimport { Host, ckEnum } from \"./Host\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkData } from \"./JsiSkData\";\n\nexport class JsiSkImageFactory extends Host implements ImageFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeImageFromViewTag(viewTag: number): Promise<SkImage | null> {\n const view = viewTag as unknown as HTMLElement;\n // TODO: Implement screenshot from view in React JS\n console.log(view);\n return Promise.resolve(null);\n }\n\n MakeImageFromEncoded(encoded: SkData) {\n const image = this.CanvasKit.MakeImageFromEncoded(\n JsiSkData.fromValue(encoded)\n );\n if (image === null) {\n return null;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n\n MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number) {\n // see toSkImageInfo() from canvaskit\n const image = this.CanvasKit.MakeImage(\n {\n alphaType: ckEnum(info.alphaType),\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n colorType: ckEnum(info.colorType),\n height: info.height,\n width: info.width,\n },\n JsiSkData.fromValue(data),\n bytesPerRow\n );\n if (image === null) {\n return null;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n}\n"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;AAEO,MAAMA,iBAAN,SAAgCC,UAAhC,CAA6D;EAClEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,oBAAoB,CAACC,OAAD,EAA2C;IAC7D,MAAMC,IAAI,GAAGD,OAAb,CAD6D,CAE7D;;IACAE,OAAO,CAACC,GAAR,CAAYF,IAAZ;IACA,OAAOG,OAAO,CAACC,OAAR,CAAgB,IAAhB,CAAP;EACD;;EAEDC,oBAAoB,CAACC,OAAD,EAAkB;IACpC,MAAMC,KAAK,GAAG,KAAKV,SAAL,CAAeQ,oBAAf,CACZG,oBAAA,CAAUC,SAAV,CAAoBH,OAApB,CADY,CAAd;;IAGA,IAAIC,KAAK,KAAK,IAAd,EAAoB;MAClB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIG,sBAAJ,CAAe,KAAKb,SAApB,EAA+BU,KAA/B,CAAP;EACD;;EAEDI,SAAS,CAACC,IAAD,EAAkBC,IAAlB,EAAgCC,WAAhC,EAAqD;IAC5D;IACA,MAAMP,KAAK,GAAG,KAAKV,SAAL,CAAec,SAAf,CACZ;MACEI,SAAS,EAAE,IAAAC,YAAA,EAAOJ,IAAI,CAACG,SAAZ,CADb;MAEEE,UAAU,EAAE,KAAKpB,SAAL,CAAeqB,UAAf,CAA0BC,IAFxC;MAGEC,SAAS,EAAE,IAAAJ,YAAA,EAAOJ,IAAI,CAACQ,SAAZ,CAHb;MAIEC,MAAM,EAAET,IAAI,CAACS,MAJf;MAKEC,KAAK,EAAEV,IAAI,CAACU;IALd,CADY,EAQZd,oBAAA,CAAUC,SAAV,CAAoBI,IAApB,CARY,EASZC,WATY,CAAd;;IAWA,IAAIP,KAAK,KAAK,IAAd,EAAoB;MAClB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIG,sBAAJ,CAAe,KAAKb,SAApB,EAA+BU,KAA/B,CAAP;EACD;;AAvCiE"}
1
+ {"version":3,"names":["JsiSkImageFactory","Host","constructor","CanvasKit","MakeImageFromViewTag","viewTag","view","console","log","Promise","resolve","MakeImageFromEncoded","encoded","image","JsiSkData","fromValue","JsiSkImage","MakeImage","info","data","bytesPerRow","alphaType","getEnum","AlphaType","colorSpace","ColorSpace","SRGB","colorType","ColorType","height","width"],"sources":["JsiSkImageFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData, ImageInfo, SkImage } from \"../types\";\nimport type { ImageFactory } from \"../types/Image/ImageFactory\";\n\nimport { Host, getEnum } from \"./Host\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkData } from \"./JsiSkData\";\n\nexport class JsiSkImageFactory extends Host implements ImageFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeImageFromViewTag(viewTag: number): Promise<SkImage | null> {\n const view = viewTag as unknown as HTMLElement;\n // TODO: Implement screenshot from view in React JS\n console.log(view);\n return Promise.resolve(null);\n }\n\n MakeImageFromEncoded(encoded: SkData) {\n const image = this.CanvasKit.MakeImageFromEncoded(\n JsiSkData.fromValue(encoded)\n );\n if (image === null) {\n return null;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n\n MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number) {\n // see toSkImageInfo() from canvaskit\n const image = this.CanvasKit.MakeImage(\n {\n alphaType: getEnum(this.CanvasKit.AlphaType, info.alphaType),\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n colorType: getEnum(this.CanvasKit.ColorType, info.colorType),\n height: info.height,\n width: info.width,\n },\n JsiSkData.fromValue(data),\n bytesPerRow\n );\n if (image === null) {\n return null;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n}\n"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;AAEO,MAAMA,iBAAN,SAAgCC,UAAhC,CAA6D;EAClEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,oBAAoB,CAACC,OAAD,EAA2C;IAC7D,MAAMC,IAAI,GAAGD,OAAb,CAD6D,CAE7D;;IACAE,OAAO,CAACC,GAAR,CAAYF,IAAZ;IACA,OAAOG,OAAO,CAACC,OAAR,CAAgB,IAAhB,CAAP;EACD;;EAEDC,oBAAoB,CAACC,OAAD,EAAkB;IACpC,MAAMC,KAAK,GAAG,KAAKV,SAAL,CAAeQ,oBAAf,CACZG,oBAAA,CAAUC,SAAV,CAAoBH,OAApB,CADY,CAAd;;IAGA,IAAIC,KAAK,KAAK,IAAd,EAAoB;MAClB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIG,sBAAJ,CAAe,KAAKb,SAApB,EAA+BU,KAA/B,CAAP;EACD;;EAEDI,SAAS,CAACC,IAAD,EAAkBC,IAAlB,EAAgCC,WAAhC,EAAqD;IAC5D;IACA,MAAMP,KAAK,GAAG,KAAKV,SAAL,CAAec,SAAf,CACZ;MACEI,SAAS,EAAE,IAAAC,aAAA,EAAQ,KAAKnB,SAAL,CAAeoB,SAAvB,EAAkCL,IAAI,CAACG,SAAvC,CADb;MAEEG,UAAU,EAAE,KAAKrB,SAAL,CAAesB,UAAf,CAA0BC,IAFxC;MAGEC,SAAS,EAAE,IAAAL,aAAA,EAAQ,KAAKnB,SAAL,CAAeyB,SAAvB,EAAkCV,IAAI,CAACS,SAAvC,CAHb;MAIEE,MAAM,EAAEX,IAAI,CAACW,MAJf;MAKEC,KAAK,EAAEZ,IAAI,CAACY;IALd,CADY,EAQZhB,oBAAA,CAAUC,SAAV,CAAoBI,IAApB,CARY,EASZC,WATY,CAAd;;IAWA,IAAIP,KAAK,KAAK,IAAd,EAAoB;MAClB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIG,sBAAJ,CAAe,KAAKb,SAApB,EAA+BU,KAA/B,CAAP;EACD;;AAvCiE"}
@@ -24,7 +24,7 @@ class JsiSkImageFilterFactory extends _Host.Host {
24
24
 
25
25
  MakeDisplacementMap(channelX, channelY, scale, in1, input) {
26
26
  const inputFilter = input === null ? null : _JsiSkImageFilter.JsiSkImageFilter.fromValue(input);
27
- const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap((0, _Host.ckEnum)(channelX), (0, _Host.ckEnum)(channelY), scale, _JsiSkImageFilter.JsiSkImageFilter.fromValue(in1), inputFilter);
27
+ const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap((0, _Host.getEnum)(this.CanvasKit.ColorChannel, channelX), (0, _Host.getEnum)(this.CanvasKit.ColorChannel, channelY), scale, _JsiSkImageFilter.JsiSkImageFilter.fromValue(in1), inputFilter);
28
28
  return new _JsiSkImageFilter.JsiSkImageFilter(this.CanvasKit, filter);
29
29
  }
30
30
 
@@ -34,7 +34,7 @@ class JsiSkImageFilterFactory extends _Host.Host {
34
34
  }
35
35
 
36
36
  MakeBlur(sigmaX, sigmaY, mode, input) {
37
- return new _JsiSkImageFilter.JsiSkImageFilter(this.CanvasKit, this.CanvasKit.ImageFilter.MakeBlur(sigmaX, sigmaY, (0, _Host.ckEnum)(mode), input === null ? null : _JsiSkImageFilter.JsiSkImageFilter.fromValue(input)));
37
+ return new _JsiSkImageFilter.JsiSkImageFilter(this.CanvasKit, this.CanvasKit.ImageFilter.MakeBlur(sigmaX, sigmaY, (0, _Host.getEnum)(this.CanvasKit.TileMode, mode), input === null ? null : _JsiSkImageFilter.JsiSkImageFilter.fromValue(input)));
38
38
  }
39
39
 
40
40
  MakeColorFilter(cf, input) {
@@ -96,7 +96,7 @@ class JsiSkImageFilterFactory extends _Host.Host {
96
96
  throw new _Host.NotImplementedOnRNWeb("The cropRect argument is not yet supported on React Native Web.");
97
97
  }
98
98
 
99
- const filter = this.CanvasKit.ImageFilter.MakeBlend((0, _Host.ckEnum)(mode), _JsiSkImageFilter.JsiSkImageFilter.fromValue(background), inputFilter);
99
+ const filter = this.CanvasKit.ImageFilter.MakeBlend((0, _Host.getEnum)(this.CanvasKit.BlendMode, mode), _JsiSkImageFilter.JsiSkImageFilter.fromValue(background), inputFilter);
100
100
  return new _JsiSkImageFilter.JsiSkImageFilter(this.CanvasKit, filter);
101
101
  }
102
102
 
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkImageFilterFactory","Host","constructor","CanvasKit","MakeOffset","dx","dy","input","inputFilter","JsiSkImageFilter","fromValue","filter","ImageFilter","MakeDisplacementMap","channelX","channelY","scale","in1","ckEnum","MakeShader","shader","_input","MakeBlur","sigmaX","sigmaY","mode","MakeColorFilter","cf","JsiSkColorFilter","MakeCompose","outer","inner","MakeDropShadow","color","cropRect","NotImplementedOnRNWeb","MakeDropShadowOnly","MakeErode","rx","ry","MakeDilate","MakeBlend","background","foreground","MakeRuntimeShader","_builder","_childShaderName"],"sources":["JsiSkImageFilterFactory.ts"],"sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type {\n ColorChannel,\n ImageFilterFactory,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n BlendMode,\n SkRect,\n SkRuntimeShaderBuilder,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { Host, NotImplementedOnRNWeb, ckEnum } from \"./Host\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\n\nexport class JsiSkImageFilterFactory\n extends Host\n implements ImageFilterFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeOffset(dx: number, dy: number, input: SkImageFilter | null) {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeOffset(dx, dy, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDisplacementMap(\n channelX: ColorChannel,\n channelY: ColorChannel,\n scale: number,\n in1: SkImageFilter,\n input: SkImageFilter | null\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap(\n ckEnum(channelX),\n ckEnum(channelY),\n scale,\n JsiSkImageFilter.fromValue(in1),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeShader(shader: SkShader, _input: SkImageFilter | null): SkImageFilter {\n const filter = this.CanvasKit.ImageFilter.MakeShader(\n JsiSkImageFilter.fromValue(shader)\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlur(\n sigmaX: number,\n sigmaY: number,\n mode: TileMode,\n input: SkImageFilter | null\n ) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeBlur(\n sigmaX,\n sigmaY,\n ckEnum(mode),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeColorFilter(cf: SkColorFilter, input: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeColorFilter(\n JsiSkColorFilter.fromValue(cf),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeCompose(outer: SkImageFilter | null, inner: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeCompose(\n outer === null ? null : JsiSkImageFilter.fromValue(outer),\n inner === null ? null : JsiSkImageFilter.fromValue(inner)\n )\n );\n }\n\n MakeDropShadow(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadow(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDropShadowOnly(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadowOnly(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeErode(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeErode(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDilate(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDilate(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlend(\n mode: BlendMode,\n background: SkImageFilter,\n foreground: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n foreground === null\n ? null\n : JsiSkImageFilter.fromValue<ImageFilter>(foreground);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeBlend(\n ckEnum(mode),\n JsiSkImageFilter.fromValue(background),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeRuntimeShader(\n _builder: SkRuntimeShaderBuilder,\n _childShaderName: string | null,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n}\n"],"mappings":";;;;;;;AAeA;;AACA;;AACA;;AAEO,MAAMA,uBAAN,SACGC,UADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,EAAD,EAAaC,EAAb,EAAyBC,KAAzB,EAAsD;IAC9D,MAAMC,WAAW,GACfD,KAAK,KAAK,IAAV,GAAiB,IAAjB,GAAwBE,kCAAA,CAAiBC,SAAjB,CAAwCH,KAAxC,CAD1B;IAEA,MAAMI,MAAM,GAAG,KAAKR,SAAL,CAAeS,WAAf,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AAIC,2BAAJ,CACJ,iEADI,CAAN;IAGD;;IACD,MAAMxB,MAAM,GAAG,KAAKR,SAAL,CAAeS,WAAf,CAA2B4B,UAA3B,CAAsCF,EAAtC,EAA0CC,EAA1C,EAA8C/B,WAA9C,CAAf;IACA,OAAO,IAAIC,kCAAJ,CAAqB,KAAKN,SAA1B,EAAqCQ,MAArC,CAAP;EACD;;EAED8B,SAAS,CACPhB,IADO,EAEPiB,UAFO,EAGPC,UAHO,EAIPT,QAJO,EAKQ;IACf,MAAM1B,WAAW,GACfmC,UAAU,KAAK,IAAf,GACI,IADJ,GAEIlC,kCAAA,CAAiBC,SAAjB,CAAwCiC,UAAxC,CAHN;;IAIA,IAAIT,QAAJ,EAAc;MACZ,MAAM,IAAIC,2BAAJ,CACJ,iEADI,CAAN;IAGD;;IACD,MAAMxB,MAAM,GAAG,KAAKR,SAAL,CAAeS,WAAf,CAA2B6B,SAA3B,CACb,IAAAvB,YAAA,EAAOO,IAAP,CADa,EAEbhB,kCAAA,CAAiBC,SAAjB,CAA2BgC,UAA3B,CAFa,EAGblC,WAHa,CAAf;IAKA,OAAO,IAAIC,kCAAJ,CAAqB,KAAKN,SAA1B,EAAqCQ,MAArC,CAAP;EACD;;EAEDiC,iBAAiB,CACfC,QADe,EAEfC,gBAFe,EAGfzB,MAHe,EAIA;IACf,MAAM,IAAIc,2BAAJ,EAAN;EACD;;AAhMH"}
1
+ {"version":3,"names":["JsiSkImageFilterFactory","Host","constructor","CanvasKit","MakeOffset","dx","dy","input","inputFilter","JsiSkImageFilter","fromValue","filter","ImageFilter","MakeDisplacementMap","channelX","channelY","scale","in1","getEnum","ColorChannel","MakeShader","shader","_input","MakeBlur","sigmaX","sigmaY","mode","TileMode","MakeColorFilter","cf","JsiSkColorFilter","MakeCompose","outer","inner","MakeDropShadow","color","cropRect","NotImplementedOnRNWeb","MakeDropShadowOnly","MakeErode","rx","ry","MakeDilate","MakeBlend","background","foreground","BlendMode","MakeRuntimeShader","_builder","_childShaderName"],"sources":["JsiSkImageFilterFactory.ts"],"sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type {\n ColorChannel,\n ImageFilterFactory,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n BlendMode,\n SkRect,\n SkRuntimeShaderBuilder,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { Host, NotImplementedOnRNWeb, getEnum } from \"./Host\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\n\nexport class JsiSkImageFilterFactory\n extends Host\n implements ImageFilterFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeOffset(dx: number, dy: number, input: SkImageFilter | null) {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeOffset(dx, dy, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDisplacementMap(\n channelX: ColorChannel,\n channelY: ColorChannel,\n scale: number,\n in1: SkImageFilter,\n input: SkImageFilter | null\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap(\n getEnum(this.CanvasKit.ColorChannel, channelX),\n getEnum(this.CanvasKit.ColorChannel, channelY),\n scale,\n JsiSkImageFilter.fromValue(in1),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeShader(shader: SkShader, _input: SkImageFilter | null): SkImageFilter {\n const filter = this.CanvasKit.ImageFilter.MakeShader(\n JsiSkImageFilter.fromValue(shader)\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlur(\n sigmaX: number,\n sigmaY: number,\n mode: TileMode,\n input: SkImageFilter | null\n ) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeBlur(\n sigmaX,\n sigmaY,\n getEnum(this.CanvasKit.TileMode, mode),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeColorFilter(cf: SkColorFilter, input: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeColorFilter(\n JsiSkColorFilter.fromValue(cf),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeCompose(outer: SkImageFilter | null, inner: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeCompose(\n outer === null ? null : JsiSkImageFilter.fromValue(outer),\n inner === null ? null : JsiSkImageFilter.fromValue(inner)\n )\n );\n }\n\n MakeDropShadow(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadow(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDropShadowOnly(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadowOnly(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeErode(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeErode(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDilate(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDilate(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlend(\n mode: BlendMode,\n background: SkImageFilter,\n foreground: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n foreground === null\n ? null\n : JsiSkImageFilter.fromValue<ImageFilter>(foreground);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeBlend(\n getEnum(this.CanvasKit.BlendMode, mode),\n JsiSkImageFilter.fromValue(background),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeRuntimeShader(\n _builder: SkRuntimeShaderBuilder,\n _childShaderName: string | null,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n}\n"],"mappings":";;;;;;;AAeA;;AACA;;AACA;;AAEO,MAAMA,uBAAN,SACGC,UADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,EAAD,EAAaC,EAAb,EAAyBC,KAAzB,EAAsD;IAC9D,MAAMC,WAAW,GACfD,KAAK,KAAK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sigma, respectCTM) {
18
- return new _JsiSkMaskFilter.JsiSkMaskFilter(this.CanvasKit, this.CanvasKit.MaskFilter.MakeBlur((0, _Host.ckEnum)(style), sigma, respectCTM));
18
+ return new _JsiSkMaskFilter.JsiSkMaskFilter(this.CanvasKit, this.CanvasKit.MaskFilter.MakeBlur((0, _Host.getEnum)(this.CanvasKit.BlurStyle, style), sigma, respectCTM));
19
19
  }
20
20
 
21
21
  }
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkMaskFilterFactory","Host","constructor","CanvasKit","MakeBlur","style","sigma","respectCTM","JsiSkMaskFilter","MaskFilter","ckEnum"],"sources":["JsiSkMaskFilterFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { BlurStyle } from \"../types\";\nimport type { MaskFilterFactory } from \"../types/MaskFilter\";\n\nimport { Host, ckEnum } from \"./Host\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\n\nexport class JsiSkMaskFilterFactory extends Host implements MaskFilterFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeBlur(style: BlurStyle, sigma: number, respectCTM: boolean) {\n return new JsiSkMaskFilter(\n this.CanvasKit,\n this.CanvasKit.MaskFilter.MakeBlur(ckEnum(style), sigma, respectCTM)\n );\n }\n}\n"],"mappings":";;;;;;;AAKA;;AACA;;AAEO,MAAMA,sBAAN,SAAqCC,UAArC,CAAuE;EAC5EC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAmBC,KAAnB,EAAkCC,UAAlC,EAAuD;IAC7D,OAAO,IAAIC,gCAAJ,CACL,KAAKL,SADA,EAEL,KAAKA,SAAL,CAAeM,UAAf,CAA0BL,QAA1B,CAAmC,IAAAM,YAAA,EAAOL,KAAP,CAAnC,EAAkDC,KAAlD,EAAyDC,UAAzD,CAFK,CAAP;EAID;;AAV2E"}
1
+ {"version":3,"names":["JsiSkMaskFilterFactory","Host","constructor","CanvasKit","MakeBlur","style","sigma","respectCTM","JsiSkMaskFilter","MaskFilter","getEnum","BlurStyle"],"sources":["JsiSkMaskFilterFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { BlurStyle } from \"../types\";\nimport type { MaskFilterFactory } from \"../types/MaskFilter\";\n\nimport { Host, getEnum } from \"./Host\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\n\nexport class JsiSkMaskFilterFactory extends Host implements MaskFilterFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeBlur(style: BlurStyle, sigma: number, respectCTM: boolean) {\n return new JsiSkMaskFilter(\n this.CanvasKit,\n this.CanvasKit.MaskFilter.MakeBlur(\n getEnum(this.CanvasKit.BlurStyle, style),\n sigma,\n respectCTM\n )\n );\n }\n}\n"],"mappings":";;;;;;;AAKA;;AACA;;AAEO,MAAMA,sBAAN,SAAqCC,UAArC,CAAuE;EAC5EC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAmBC,KAAnB,EAAkCC,UAAlC,EAAuD;IAC7D,OAAO,IAAIC,gCAAJ,CACL,KAAKL,SADA,EAEL,KAAKA,SAAL,CAAeM,UAAf,CAA0BL,QAA1B,CACE,IAAAM,aAAA,EAAQ,KAAKP,SAAL,CAAeQ,SAAvB,EAAkCN,KAAlC,CADF,EAEEC,KAFF,EAGEC,UAHF,CAFK,CAAP;EAQD;;AAd2E"}
@@ -1,12 +1,12 @@
1
1
  import type { CanvasKit, Matrix3x3 } from "canvaskit-wasm";
2
- import type { SkMatrix } from "../types";
2
+ import { type Matrix3, type Matrix4, 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
6
  private preMultiply;
7
7
  private postMultiply;
8
8
  dispose: () => void;
9
- concat(matrix: SkMatrix): this;
9
+ concat(matrix: SkMatrix | number[] | Matrix4 | Matrix3): this;
10
10
  translate(x: number, y: number): this;
11
11
  postTranslate(x: number, y: number): this;
12
12
  scale(x: number, y?: number): this;