@shopify/react-native-skia 0.1.216 → 0.1.219

Sign up to get free protection for your applications and to get access to all the features.
Files changed (406) hide show
  1. package/android/build.gradle +22 -0
  2. package/android/src/main/java/com/shopify/reactnative/skia/PlatformContext.java +9 -10
  3. package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaModule.java +3 -3
  4. package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +56 -2
  5. package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +5 -1
  6. package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseViewManager.java +3 -3
  7. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomViewManager.java +14 -1
  8. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawViewManager.java +16 -1
  9. package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureViewManager.java +15 -1
  10. package/android/src/main/java/com/shopify/reactnative/skia/ViewScreenshotService.java +2 -2
  11. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerDelegate.java +34 -0
  12. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerInterface.java +18 -0
  13. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDrawViewManagerDelegate.java +34 -0
  14. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDrawViewManagerInterface.java +18 -0
  15. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerDelegate.java +34 -0
  16. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerInterface.java +18 -0
  17. package/android/src/paper/java/com/shopify/reactnative/skia/NativeSkiaModuleSpec.java +38 -0
  18. package/cpp/rnskia/RNSkView.h +1 -1
  19. package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -1
  20. package/ios/RNSkia-iOS/SkiaDomView.h +7 -0
  21. package/ios/RNSkia-iOS/SkiaDomView.mm +64 -0
  22. package/ios/RNSkia-iOS/SkiaDomViewManager.mm +1 -1
  23. package/ios/RNSkia-iOS/SkiaDrawView.h +7 -0
  24. package/ios/RNSkia-iOS/SkiaDrawView.mm +72 -0
  25. package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +1 -1
  26. package/ios/RNSkia-iOS/SkiaPictureView.h +7 -0
  27. package/ios/RNSkia-iOS/SkiaPictureView.mm +66 -0
  28. package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +1 -1
  29. package/ios/RNSkia-iOS/SkiaUIView.h +15 -2
  30. package/ios/RNSkia-iOS/SkiaUIView.mm +48 -16
  31. package/ios/RNSkiaModule.h +10 -1
  32. package/ios/RNSkiaModule.mm +8 -1
  33. package/lib/commonjs/Platform/IPlatform.d.ts +1 -3
  34. package/lib/commonjs/Platform/IPlatform.js.map +1 -1
  35. package/lib/commonjs/Platform/Platform.js +0 -2
  36. package/lib/commonjs/Platform/Platform.js.map +1 -1
  37. package/lib/commonjs/Platform/Platform.web.js +0 -4
  38. package/lib/commonjs/Platform/Platform.web.js.map +1 -1
  39. package/lib/commonjs/animation/functions/interpolate.d.ts +1 -1
  40. package/lib/commonjs/animation/timing/functions/types.d.ts +1 -1
  41. package/lib/commonjs/animation/types.d.ts +2 -2
  42. package/lib/commonjs/dom/nodes/Node.d.ts +1 -1
  43. package/lib/commonjs/dom/types/Common.d.ts +8 -8
  44. package/lib/commonjs/dom/types/DeclarationContext.d.ts +1 -1
  45. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
  46. package/lib/commonjs/dom/types/Drawings.d.ts +5 -5
  47. package/lib/commonjs/dom/types/Node.d.ts +1 -1
  48. package/lib/commonjs/dom/types/SkDOM.d.ts +4 -4
  49. package/lib/commonjs/external/reanimated/renderHelpers.js +0 -2
  50. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
  51. package/lib/commonjs/renderer/Canvas.d.ts +1 -1
  52. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  53. package/lib/commonjs/renderer/DependencyManager.d.ts +3 -3
  54. package/lib/commonjs/renderer/HostConfig.d.ts +12 -12
  55. package/lib/commonjs/renderer/Reconciler.d.ts +1 -1
  56. package/lib/commonjs/renderer/Reconciler.js +1 -0
  57. package/lib/commonjs/renderer/Reconciler.js.map +1 -1
  58. package/lib/commonjs/renderer/components/Blend.d.ts +2 -2
  59. package/lib/commonjs/renderer/components/Drawing.d.ts +2 -2
  60. package/lib/commonjs/renderer/components/Group.d.ts +2 -2
  61. package/lib/commonjs/renderer/components/Mask.d.ts +2 -1
  62. package/lib/commonjs/renderer/components/Paint.d.ts +2 -2
  63. package/lib/commonjs/renderer/components/Picture.d.ts +2 -2
  64. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.d.ts +2 -2
  65. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.d.ts +2 -1
  66. package/lib/commonjs/renderer/components/colorFilters/BlendColor.d.ts +2 -2
  67. package/lib/commonjs/renderer/components/colorFilters/Lerp.d.ts +2 -2
  68. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +2 -2
  69. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.d.ts +2 -2
  70. package/lib/commonjs/renderer/components/colorFilters/Matrix.d.ts +2 -2
  71. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +2 -2
  72. package/lib/commonjs/renderer/components/image/Image.d.ts +2 -2
  73. package/lib/commonjs/renderer/components/image/ImageSVG.d.ts +2 -2
  74. package/lib/commonjs/renderer/components/image/ImageShader.d.ts +2 -2
  75. package/lib/commonjs/renderer/components/imageFilters/Blur.d.ts +2 -2
  76. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.d.ts +2 -2
  77. package/lib/commonjs/renderer/components/imageFilters/Morphology.d.ts +2 -2
  78. package/lib/commonjs/renderer/components/imageFilters/Offset.d.ts +2 -2
  79. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.d.ts +2 -2
  80. package/lib/commonjs/renderer/components/imageFilters/Shadow.d.ts +2 -2
  81. package/lib/commonjs/renderer/components/maskFilters/Blur.d.ts +2 -2
  82. package/lib/commonjs/renderer/components/pathEffects/Corner.d.ts +2 -2
  83. package/lib/commonjs/renderer/components/pathEffects/Dash.d.ts +2 -2
  84. package/lib/commonjs/renderer/components/pathEffects/Discrete.d.ts +2 -2
  85. package/lib/commonjs/renderer/components/pathEffects/Line2D.d.ts +2 -2
  86. package/lib/commonjs/renderer/components/pathEffects/Path1D.d.ts +2 -2
  87. package/lib/commonjs/renderer/components/pathEffects/Path2D.d.ts +2 -2
  88. package/lib/commonjs/renderer/components/pathEffects/Sum.d.ts +2 -2
  89. package/lib/commonjs/renderer/components/shaders/Color.d.ts +2 -2
  90. package/lib/commonjs/renderer/components/shaders/FractalNoise.d.ts +2 -2
  91. package/lib/commonjs/renderer/components/shaders/LinearGradient.d.ts +2 -2
  92. package/lib/commonjs/renderer/components/shaders/RadialGradient.d.ts +2 -2
  93. package/lib/commonjs/renderer/components/shaders/Shader.d.ts +2 -2
  94. package/lib/commonjs/renderer/components/shaders/SweepGradient.d.ts +2 -2
  95. package/lib/commonjs/renderer/components/shaders/Turbulence.d.ts +2 -2
  96. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.d.ts +2 -2
  97. package/lib/commonjs/renderer/components/shapes/Box.d.ts +3 -3
  98. package/lib/commonjs/renderer/components/shapes/Circle.d.ts +2 -2
  99. package/lib/commonjs/renderer/components/shapes/DiffRect.d.ts +2 -2
  100. package/lib/commonjs/renderer/components/shapes/Fill.d.ts +2 -2
  101. package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +2 -1
  102. package/lib/commonjs/renderer/components/shapes/Line.d.ts +2 -2
  103. package/lib/commonjs/renderer/components/shapes/Oval.d.ts +2 -2
  104. package/lib/commonjs/renderer/components/shapes/Patch.d.ts +2 -2
  105. package/lib/commonjs/renderer/components/shapes/Path.d.ts +2 -2
  106. package/lib/commonjs/renderer/components/shapes/Points.d.ts +2 -2
  107. package/lib/commonjs/renderer/components/shapes/Rect.d.ts +2 -2
  108. package/lib/commonjs/renderer/components/shapes/RoundedRect.d.ts +2 -2
  109. package/lib/commonjs/renderer/components/shapes/Vertices.d.ts +2 -2
  110. package/lib/commonjs/renderer/components/text/Glyphs.d.ts +2 -2
  111. package/lib/commonjs/renderer/components/text/Text.d.ts +2 -2
  112. package/lib/commonjs/renderer/components/text/TextBlob.d.ts +2 -2
  113. package/lib/commonjs/renderer/components/text/TextPath.d.ts +2 -2
  114. package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +6 -6
  115. package/lib/commonjs/skia/NativeSetup.js +5 -1
  116. package/lib/commonjs/skia/NativeSetup.js.map +1 -1
  117. package/lib/commonjs/skia/core/Font.d.ts +2 -2
  118. package/lib/commonjs/skia/types/Color.d.ts +2 -2
  119. package/lib/commonjs/skia/types/ColorFilter/ColorFilter.d.ts +1 -1
  120. package/lib/commonjs/skia/types/ColorFilter/ColorFilterFactory.d.ts +1 -1
  121. package/lib/commonjs/skia/types/Data/Data.d.ts +6 -6
  122. package/lib/commonjs/skia/types/ImageFilter/ImageFilter.d.ts +1 -1
  123. package/lib/commonjs/skia/types/MaskFilter.d.ts +1 -1
  124. package/lib/commonjs/skia/types/Matrix.d.ts +3 -3
  125. package/lib/commonjs/skia/types/Path/Path.d.ts +1 -1
  126. package/lib/commonjs/skia/types/PathEffect.d.ts +1 -1
  127. package/lib/commonjs/skia/types/Point.d.ts +1 -1
  128. package/lib/commonjs/skia/types/RSXform.d.ts +1 -1
  129. package/lib/commonjs/skia/types/Shader/Shader.d.ts +2 -2
  130. package/lib/commonjs/skia/types/TextBlob.d.ts +1 -1
  131. package/lib/commonjs/skia/web/JsiSkData.d.ts +1 -1
  132. package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -1
  133. package/lib/commonjs/specs/NativeSkiaModule.d.ts +6 -0
  134. package/lib/commonjs/specs/NativeSkiaModule.js +14 -0
  135. package/lib/commonjs/specs/NativeSkiaModule.js.map +1 -0
  136. package/lib/commonjs/specs/NativeSkiaModule.web.d.ts +2 -0
  137. package/lib/commonjs/specs/NativeSkiaModule.web.js +13 -0
  138. package/lib/commonjs/specs/NativeSkiaModule.web.js.map +1 -0
  139. package/lib/commonjs/specs/SkiaDomViewNativeComponent.d.ts +8 -0
  140. package/lib/commonjs/specs/SkiaDomViewNativeComponent.js +16 -0
  141. package/lib/commonjs/specs/SkiaDomViewNativeComponent.js.map +1 -0
  142. package/lib/commonjs/specs/SkiaDrawViewNativeComponent.d.ts +8 -0
  143. package/lib/commonjs/specs/SkiaDrawViewNativeComponent.js +16 -0
  144. package/lib/commonjs/specs/SkiaDrawViewNativeComponent.js.map +1 -0
  145. package/lib/commonjs/specs/SkiaPictureViewNativeComponent.d.ts +8 -0
  146. package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js +16 -0
  147. package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js.map +1 -0
  148. package/lib/commonjs/values/selector.d.ts +1 -1
  149. package/lib/commonjs/views/SkiaBaseWebView.d.ts +1 -1
  150. package/lib/commonjs/views/SkiaDomView.d.ts +1 -1
  151. package/lib/commonjs/views/SkiaDomView.js +3 -1
  152. package/lib/commonjs/views/SkiaDomView.js.map +1 -1
  153. package/lib/commonjs/views/SkiaPictureView.d.ts +1 -1
  154. package/lib/commonjs/views/SkiaPictureView.js +3 -3
  155. package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
  156. package/lib/commonjs/views/SkiaView.d.ts +1 -1
  157. package/lib/commonjs/views/SkiaView.js +3 -4
  158. package/lib/commonjs/views/SkiaView.js.map +1 -1
  159. package/lib/commonjs/views/types.d.ts +6 -6
  160. package/lib/commonjs/web/WithSkiaWeb.d.ts +2 -2
  161. package/lib/module/Platform/IPlatform.d.ts +1 -3
  162. package/lib/module/Platform/IPlatform.js.map +1 -1
  163. package/lib/module/Platform/Platform.js +1 -3
  164. package/lib/module/Platform/Platform.js.map +1 -1
  165. package/lib/module/Platform/Platform.web.js +0 -4
  166. package/lib/module/Platform/Platform.web.js.map +1 -1
  167. package/lib/module/animation/functions/interpolate.d.ts +1 -1
  168. package/lib/module/animation/timing/functions/types.d.ts +1 -1
  169. package/lib/module/animation/types.d.ts +2 -2
  170. package/lib/module/dom/nodes/Node.d.ts +1 -1
  171. package/lib/module/dom/types/Common.d.ts +8 -8
  172. package/lib/module/dom/types/DeclarationContext.d.ts +1 -1
  173. package/lib/module/dom/types/DrawingContext.js.map +1 -1
  174. package/lib/module/dom/types/Drawings.d.ts +5 -5
  175. package/lib/module/dom/types/Node.d.ts +1 -1
  176. package/lib/module/dom/types/SkDOM.d.ts +4 -4
  177. package/lib/module/external/reanimated/renderHelpers.js +0 -2
  178. package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
  179. package/lib/module/renderer/Canvas.d.ts +1 -1
  180. package/lib/module/renderer/Canvas.js.map +1 -1
  181. package/lib/module/renderer/DependencyManager.d.ts +3 -3
  182. package/lib/module/renderer/HostConfig.d.ts +12 -12
  183. package/lib/module/renderer/Reconciler.d.ts +1 -1
  184. package/lib/module/renderer/Reconciler.js +1 -0
  185. package/lib/module/renderer/Reconciler.js.map +1 -1
  186. package/lib/module/renderer/components/Blend.d.ts +2 -2
  187. package/lib/module/renderer/components/Drawing.d.ts +2 -2
  188. package/lib/module/renderer/components/Group.d.ts +2 -2
  189. package/lib/module/renderer/components/Mask.d.ts +2 -1
  190. package/lib/module/renderer/components/Paint.d.ts +2 -2
  191. package/lib/module/renderer/components/Picture.d.ts +2 -2
  192. package/lib/module/renderer/components/backdrop/BackdropBlur.d.ts +2 -2
  193. package/lib/module/renderer/components/backdrop/BackdropFilter.d.ts +2 -1
  194. package/lib/module/renderer/components/colorFilters/BlendColor.d.ts +2 -2
  195. package/lib/module/renderer/components/colorFilters/Lerp.d.ts +2 -2
  196. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +2 -2
  197. package/lib/module/renderer/components/colorFilters/LumaColorFilter.d.ts +2 -2
  198. package/lib/module/renderer/components/colorFilters/Matrix.d.ts +2 -2
  199. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +2 -2
  200. package/lib/module/renderer/components/image/Image.d.ts +2 -2
  201. package/lib/module/renderer/components/image/ImageSVG.d.ts +2 -2
  202. package/lib/module/renderer/components/image/ImageShader.d.ts +2 -2
  203. package/lib/module/renderer/components/imageFilters/Blur.d.ts +2 -2
  204. package/lib/module/renderer/components/imageFilters/DisplacementMap.d.ts +2 -2
  205. package/lib/module/renderer/components/imageFilters/Morphology.d.ts +2 -2
  206. package/lib/module/renderer/components/imageFilters/Offset.d.ts +2 -2
  207. package/lib/module/renderer/components/imageFilters/RuntimeShader.d.ts +2 -2
  208. package/lib/module/renderer/components/imageFilters/Shadow.d.ts +2 -2
  209. package/lib/module/renderer/components/maskFilters/Blur.d.ts +2 -2
  210. package/lib/module/renderer/components/pathEffects/Corner.d.ts +2 -2
  211. package/lib/module/renderer/components/pathEffects/Dash.d.ts +2 -2
  212. package/lib/module/renderer/components/pathEffects/Discrete.d.ts +2 -2
  213. package/lib/module/renderer/components/pathEffects/Line2D.d.ts +2 -2
  214. package/lib/module/renderer/components/pathEffects/Path1D.d.ts +2 -2
  215. package/lib/module/renderer/components/pathEffects/Path2D.d.ts +2 -2
  216. package/lib/module/renderer/components/pathEffects/Sum.d.ts +2 -2
  217. package/lib/module/renderer/components/shaders/Color.d.ts +2 -2
  218. package/lib/module/renderer/components/shaders/FractalNoise.d.ts +2 -2
  219. package/lib/module/renderer/components/shaders/LinearGradient.d.ts +2 -2
  220. package/lib/module/renderer/components/shaders/RadialGradient.d.ts +2 -2
  221. package/lib/module/renderer/components/shaders/Shader.d.ts +2 -2
  222. package/lib/module/renderer/components/shaders/SweepGradient.d.ts +2 -2
  223. package/lib/module/renderer/components/shaders/Turbulence.d.ts +2 -2
  224. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.d.ts +2 -2
  225. package/lib/module/renderer/components/shapes/Box.d.ts +3 -3
  226. package/lib/module/renderer/components/shapes/Circle.d.ts +2 -2
  227. package/lib/module/renderer/components/shapes/DiffRect.d.ts +2 -2
  228. package/lib/module/renderer/components/shapes/Fill.d.ts +2 -2
  229. package/lib/module/renderer/components/shapes/FitBox.d.ts +2 -1
  230. package/lib/module/renderer/components/shapes/Line.d.ts +2 -2
  231. package/lib/module/renderer/components/shapes/Oval.d.ts +2 -2
  232. package/lib/module/renderer/components/shapes/Patch.d.ts +2 -2
  233. package/lib/module/renderer/components/shapes/Path.d.ts +2 -2
  234. package/lib/module/renderer/components/shapes/Points.d.ts +2 -2
  235. package/lib/module/renderer/components/shapes/Rect.d.ts +2 -2
  236. package/lib/module/renderer/components/shapes/RoundedRect.d.ts +2 -2
  237. package/lib/module/renderer/components/shapes/Vertices.d.ts +2 -2
  238. package/lib/module/renderer/components/text/Glyphs.d.ts +2 -2
  239. package/lib/module/renderer/components/text/Text.d.ts +2 -2
  240. package/lib/module/renderer/components/text/TextBlob.d.ts +2 -2
  241. package/lib/module/renderer/components/text/TextPath.d.ts +2 -2
  242. package/lib/module/renderer/processors/Animations/Animations.d.ts +6 -6
  243. package/lib/module/skia/NativeSetup.js +2 -1
  244. package/lib/module/skia/NativeSetup.js.map +1 -1
  245. package/lib/module/skia/core/Font.d.ts +2 -2
  246. package/lib/module/skia/types/Color.d.ts +2 -2
  247. package/lib/module/skia/types/ColorFilter/ColorFilter.d.ts +1 -1
  248. package/lib/module/skia/types/ColorFilter/ColorFilterFactory.d.ts +1 -1
  249. package/lib/module/skia/types/Data/Data.d.ts +6 -6
  250. package/lib/module/skia/types/ImageFilter/ImageFilter.d.ts +1 -1
  251. package/lib/module/skia/types/MaskFilter.d.ts +1 -1
  252. package/lib/module/skia/types/Matrix.d.ts +3 -3
  253. package/lib/module/skia/types/Path/Path.d.ts +1 -1
  254. package/lib/module/skia/types/PathEffect.d.ts +1 -1
  255. package/lib/module/skia/types/Point.d.ts +1 -1
  256. package/lib/module/skia/types/RSXform.d.ts +1 -1
  257. package/lib/module/skia/types/Shader/Shader.d.ts +2 -2
  258. package/lib/module/skia/types/TextBlob.d.ts +1 -1
  259. package/lib/module/skia/web/JsiSkData.d.ts +1 -1
  260. package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -1
  261. package/lib/module/specs/NativeSkiaModule.d.ts +6 -0
  262. package/lib/module/specs/NativeSkiaModule.js +4 -0
  263. package/lib/module/specs/NativeSkiaModule.js.map +1 -0
  264. package/lib/module/specs/NativeSkiaModule.web.d.ts +2 -0
  265. package/lib/module/specs/NativeSkiaModule.web.js +4 -0
  266. package/lib/module/specs/NativeSkiaModule.web.js.map +1 -0
  267. package/lib/module/specs/SkiaDomViewNativeComponent.d.ts +8 -0
  268. package/lib/module/specs/SkiaDomViewNativeComponent.js +4 -0
  269. package/lib/module/specs/SkiaDomViewNativeComponent.js.map +1 -0
  270. package/lib/module/specs/SkiaDrawViewNativeComponent.d.ts +8 -0
  271. package/lib/module/specs/SkiaDrawViewNativeComponent.js +4 -0
  272. package/lib/module/specs/SkiaDrawViewNativeComponent.js.map +1 -0
  273. package/lib/module/specs/SkiaPictureViewNativeComponent.d.ts +8 -0
  274. package/lib/module/specs/SkiaPictureViewNativeComponent.js +4 -0
  275. package/lib/module/specs/SkiaPictureViewNativeComponent.js.map +1 -0
  276. package/lib/module/values/selector.d.ts +1 -1
  277. package/lib/module/views/SkiaBaseWebView.d.ts +1 -1
  278. package/lib/module/views/SkiaDomView.d.ts +1 -1
  279. package/lib/module/views/SkiaDomView.js +2 -1
  280. package/lib/module/views/SkiaDomView.js.map +1 -1
  281. package/lib/module/views/SkiaPictureView.d.ts +1 -1
  282. package/lib/module/views/SkiaPictureView.js +3 -3
  283. package/lib/module/views/SkiaPictureView.js.map +1 -1
  284. package/lib/module/views/SkiaView.d.ts +1 -1
  285. package/lib/module/views/SkiaView.js +3 -3
  286. package/lib/module/views/SkiaView.js.map +1 -1
  287. package/lib/module/views/types.d.ts +6 -6
  288. package/lib/module/web/WithSkiaWeb.d.ts +2 -2
  289. package/lib/typescript/src/Platform/IPlatform.d.ts +1 -3
  290. package/lib/typescript/src/animation/functions/interpolate.d.ts +1 -1
  291. package/lib/typescript/src/animation/timing/functions/types.d.ts +1 -1
  292. package/lib/typescript/src/animation/types.d.ts +2 -2
  293. package/lib/typescript/src/dom/nodes/Node.d.ts +1 -1
  294. package/lib/typescript/src/dom/types/Common.d.ts +8 -8
  295. package/lib/typescript/src/dom/types/DeclarationContext.d.ts +1 -1
  296. package/lib/typescript/src/dom/types/Drawings.d.ts +5 -5
  297. package/lib/typescript/src/dom/types/Node.d.ts +1 -1
  298. package/lib/typescript/src/dom/types/SkDOM.d.ts +4 -4
  299. package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
  300. package/lib/typescript/src/renderer/DependencyManager.d.ts +3 -3
  301. package/lib/typescript/src/renderer/HostConfig.d.ts +12 -12
  302. package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
  303. package/lib/typescript/src/renderer/components/Blend.d.ts +2 -2
  304. package/lib/typescript/src/renderer/components/Drawing.d.ts +2 -2
  305. package/lib/typescript/src/renderer/components/Group.d.ts +2 -2
  306. package/lib/typescript/src/renderer/components/Mask.d.ts +2 -1
  307. package/lib/typescript/src/renderer/components/Paint.d.ts +2 -2
  308. package/lib/typescript/src/renderer/components/Picture.d.ts +2 -2
  309. package/lib/typescript/src/renderer/components/backdrop/BackdropBlur.d.ts +2 -2
  310. package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +2 -1
  311. package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +2 -2
  312. package/lib/typescript/src/renderer/components/colorFilters/Lerp.d.ts +2 -2
  313. package/lib/typescript/src/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +2 -2
  314. package/lib/typescript/src/renderer/components/colorFilters/LumaColorFilter.d.ts +2 -2
  315. package/lib/typescript/src/renderer/components/colorFilters/Matrix.d.ts +2 -2
  316. package/lib/typescript/src/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +2 -2
  317. package/lib/typescript/src/renderer/components/image/Image.d.ts +2 -2
  318. package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +2 -2
  319. package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -2
  320. package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +2 -2
  321. package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +2 -2
  322. package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +2 -2
  323. package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +2 -2
  324. package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +2 -2
  325. package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +2 -2
  326. package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +2 -2
  327. package/lib/typescript/src/renderer/components/pathEffects/Corner.d.ts +2 -2
  328. package/lib/typescript/src/renderer/components/pathEffects/Dash.d.ts +2 -2
  329. package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +2 -2
  330. package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +2 -2
  331. package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +2 -2
  332. package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +2 -2
  333. package/lib/typescript/src/renderer/components/pathEffects/Sum.d.ts +2 -2
  334. package/lib/typescript/src/renderer/components/shaders/Color.d.ts +2 -2
  335. package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +2 -2
  336. package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +2 -2
  337. package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +2 -2
  338. package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -2
  339. package/lib/typescript/src/renderer/components/shaders/SweepGradient.d.ts +2 -2
  340. package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +2 -2
  341. package/lib/typescript/src/renderer/components/shaders/TwoPointConicalGradient.d.ts +2 -2
  342. package/lib/typescript/src/renderer/components/shapes/Box.d.ts +3 -3
  343. package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +2 -2
  344. package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +2 -2
  345. package/lib/typescript/src/renderer/components/shapes/Fill.d.ts +2 -2
  346. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +2 -1
  347. package/lib/typescript/src/renderer/components/shapes/Line.d.ts +2 -2
  348. package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +2 -2
  349. package/lib/typescript/src/renderer/components/shapes/Patch.d.ts +2 -2
  350. package/lib/typescript/src/renderer/components/shapes/Path.d.ts +2 -2
  351. package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -2
  352. package/lib/typescript/src/renderer/components/shapes/Rect.d.ts +2 -2
  353. package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +2 -2
  354. package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -2
  355. package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +2 -2
  356. package/lib/typescript/src/renderer/components/text/Text.d.ts +2 -2
  357. package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +2 -2
  358. package/lib/typescript/src/renderer/components/text/TextPath.d.ts +2 -2
  359. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +6 -6
  360. package/lib/typescript/src/skia/core/Font.d.ts +2 -2
  361. package/lib/typescript/src/skia/types/Color.d.ts +2 -2
  362. package/lib/typescript/src/skia/types/ColorFilter/ColorFilter.d.ts +1 -1
  363. package/lib/typescript/src/skia/types/ColorFilter/ColorFilterFactory.d.ts +1 -1
  364. package/lib/typescript/src/skia/types/Data/Data.d.ts +6 -6
  365. package/lib/typescript/src/skia/types/ImageFilter/ImageFilter.d.ts +1 -1
  366. package/lib/typescript/src/skia/types/MaskFilter.d.ts +1 -1
  367. package/lib/typescript/src/skia/types/Matrix.d.ts +3 -3
  368. package/lib/typescript/src/skia/types/Path/Path.d.ts +1 -1
  369. package/lib/typescript/src/skia/types/PathEffect.d.ts +1 -1
  370. package/lib/typescript/src/skia/types/Point.d.ts +1 -1
  371. package/lib/typescript/src/skia/types/RSXform.d.ts +1 -1
  372. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +2 -2
  373. package/lib/typescript/src/skia/types/TextBlob.d.ts +1 -1
  374. package/lib/typescript/src/skia/web/JsiSkData.d.ts +1 -1
  375. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -1
  376. package/lib/typescript/src/specs/NativeSkiaModule.d.ts +6 -0
  377. package/lib/typescript/src/specs/NativeSkiaModule.web.d.ts +2 -0
  378. package/lib/typescript/src/specs/SkiaDomViewNativeComponent.d.ts +8 -0
  379. package/lib/typescript/src/specs/SkiaDrawViewNativeComponent.d.ts +8 -0
  380. package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.d.ts +8 -0
  381. package/lib/typescript/src/values/selector.d.ts +1 -1
  382. package/lib/typescript/src/views/SkiaBaseWebView.d.ts +1 -1
  383. package/lib/typescript/src/views/SkiaDomView.d.ts +1 -1
  384. package/lib/typescript/src/views/SkiaPictureView.d.ts +1 -1
  385. package/lib/typescript/src/views/SkiaView.d.ts +1 -1
  386. package/lib/typescript/src/views/types.d.ts +6 -6
  387. package/lib/typescript/src/web/WithSkiaWeb.d.ts +2 -2
  388. package/package.json +18 -6
  389. package/react-native-skia.podspec +11 -3
  390. package/src/Platform/IPlatform.ts +1 -3
  391. package/src/Platform/Platform.ts +0 -4
  392. package/src/Platform/Platform.web.tsx +0 -4
  393. package/src/dom/types/DrawingContext.ts +1 -1
  394. package/src/external/reanimated/renderHelpers.ts +1 -1
  395. package/src/renderer/Canvas.tsx +2 -1
  396. package/src/renderer/Reconciler.tsx +2 -1
  397. package/src/skia/NativeSetup.ts +2 -1
  398. package/src/specs/NativeSkiaModule.ts +9 -0
  399. package/src/specs/NativeSkiaModule.web.ts +4 -0
  400. package/src/specs/SkiaDomViewNativeComponent.ts +10 -0
  401. package/src/specs/SkiaDrawViewNativeComponent.ts +10 -0
  402. package/src/specs/SkiaPictureViewNativeComponent.ts +10 -0
  403. package/src/views/SkiaDomView.tsx +3 -2
  404. package/src/views/SkiaPictureView.tsx +4 -5
  405. package/src/views/SkiaView.tsx +4 -5
  406. /package/cpp/rnskia/dom/props/{ImageProps.h → SkImageProps.h} +0 -0
@@ -1,5 +1,5 @@
1
1
  import type { SkiaSelector, SkiaValue } from "../../../values";
2
- export declare type SharedValueType<T = number> = {
2
+ export type SharedValueType<T = number> = {
3
3
  value: T;
4
4
  };
5
5
  export declare const isValue: (value: unknown) => value is SkiaValue<unknown>;
@@ -8,13 +8,13 @@ export declare const isSelector: <T, R>(value: unknown) => value is {
8
8
  value: SkiaValue<T>;
9
9
  };
10
10
  export declare const isAnimated: <T>(props: AnimatedProps<T, never>) => boolean;
11
- export declare type AnimatedProp<T, P = any> = T | SkiaValue<T> | SkiaSelector<T, P> | SharedValueType<T>;
12
- export declare type AnimatedProps<T, O extends keyof T | never = never> = {
11
+ export type AnimatedProp<T, P = any> = T | SkiaValue<T> | SkiaSelector<T, P> | SharedValueType<T>;
12
+ export type AnimatedProps<T, O extends keyof T | never = never> = {
13
13
  [K in keyof T]: K extends "children" ? T[K] : K extends O ? T[K] : AnimatedProp<T[K]>;
14
14
  };
15
- export declare type SkiaProps<P = object, O extends keyof P | never = never> = AnimatedProps<P, O>;
16
- declare type WithOptional<T extends object, N extends keyof T> = Omit<T, N> & {
15
+ export type SkiaProps<P = object, O extends keyof P | never = never> = AnimatedProps<P, O>;
16
+ type WithOptional<T extends object, N extends keyof T> = Omit<T, N> & {
17
17
  [K in N]?: T[K];
18
18
  };
19
- export declare type SkiaDefaultProps<T extends object, N extends keyof T> = WithOptional<SkiaProps<T>, N>;
19
+ export type SkiaDefaultProps<T extends object, N extends keyof T> = WithOptional<SkiaProps<T>, N>;
20
20
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Platform } from "../Platform";
2
+ import NativeSkiaModule from "../specs/NativeSkiaModule";
2
3
 
3
4
  if (Platform.OS !== "web" && global.SkiaApi == null) {
4
5
  // Initialize RN Skia
5
- const SkiaModule = Platform.NativeModules.RNSkia;
6
+ const SkiaModule = NativeSkiaModule;
6
7
 
7
8
  if (SkiaModule == null || typeof SkiaModule.install !== "function") {
8
9
  throw new Error("Native RNSkia Module cannot be found! Make sure you correctly " + "installed native dependencies and rebuilt your app.");
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","OS","global","SkiaApi","SkiaModule","NativeModules","RNSkia","install","Error","result"],"sources":["NativeSetup.ts"],"sourcesContent":["import { Platform } from \"../Platform\";\n\nif (Platform.OS !== \"web\" && global.SkiaApi == null) {\n // Initialize RN Skia\n const SkiaModule = Platform.NativeModules.RNSkia;\n if (SkiaModule == null || typeof SkiaModule.install !== \"function\") {\n throw new Error(\n \"Native RNSkia Module cannot be found! Make sure you correctly \" +\n \"installed native dependencies and rebuilt your app.\"\n );\n }\n const result = SkiaModule.install();\n if (result !== true) {\n throw new Error(\n `Native Skia Module failed to correctly install JSI Bindings! Result: ${result}`\n );\n }\n}\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,aAAzB;;AAEA,IAAIA,QAAQ,CAACC,EAAT,KAAgB,KAAhB,IAAyBC,MAAM,CAACC,OAAP,IAAkB,IAA/C,EAAqD;EACnD;EACA,MAAMC,UAAU,GAAGJ,QAAQ,CAACK,aAAT,CAAuBC,MAA1C;;EACA,IAAIF,UAAU,IAAI,IAAd,IAAsB,OAAOA,UAAU,CAACG,OAAlB,KAA8B,UAAxD,EAAoE;IAClE,MAAM,IAAIC,KAAJ,CACJ,mEACE,qDAFE,CAAN;EAID;;EACD,MAAMC,MAAM,GAAGL,UAAU,CAACG,OAAX,EAAf;;EACA,IAAIE,MAAM,KAAK,IAAf,EAAqB;IACnB,MAAM,IAAID,KAAJ,CACH,wEAAuEC,MAAO,EAD3E,CAAN;EAGD;AACF"}
1
+ {"version":3,"names":["Platform","NativeSkiaModule","OS","global","SkiaApi","SkiaModule","install","Error","result"],"sources":["NativeSetup.ts"],"sourcesContent":["import { Platform } from \"../Platform\";\nimport NativeSkiaModule from \"../specs/NativeSkiaModule\";\n\nif (Platform.OS !== \"web\" && global.SkiaApi == null) {\n // Initialize RN Skia\n const SkiaModule = NativeSkiaModule;\n if (SkiaModule == null || typeof SkiaModule.install !== \"function\") {\n throw new Error(\n \"Native RNSkia Module cannot be found! Make sure you correctly \" +\n \"installed native dependencies and rebuilt your app.\"\n );\n }\n const result = SkiaModule.install();\n if (result !== true) {\n throw new Error(\n `Native Skia Module failed to correctly install JSI Bindings! Result: ${result}`\n );\n }\n}\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,aAAzB;AACA,OAAOC,gBAAP,MAA6B,2BAA7B;;AAEA,IAAID,QAAQ,CAACE,EAAT,KAAgB,KAAhB,IAAyBC,MAAM,CAACC,OAAP,IAAkB,IAA/C,EAAqD;EACnD;EACA,MAAMC,UAAU,GAAGJ,gBAAnB;;EACA,IAAII,UAAU,IAAI,IAAd,IAAsB,OAAOA,UAAU,CAACC,OAAlB,KAA8B,UAAxD,EAAoE;IAClE,MAAM,IAAIC,KAAJ,CACJ,mEACE,qDAFE,CAAN;EAID;;EACD,MAAMC,MAAM,GAAGH,UAAU,CAACC,OAAX,EAAf;;EACA,IAAIE,MAAM,KAAK,IAAf,EAAqB;IACnB,MAAM,IAAID,KAAJ,CACH,wEAAuEC,MAAO,EAD3E,CAAN;EAGD;AACF"}
@@ -4,8 +4,8 @@ import type { SkTypefaceFontProvider } from "../types/Paragraph/TypefaceFontProv
4
4
  * Returns a Skia Font object
5
5
  * */
6
6
  export declare const useFont: (font: DataSourceParam, size?: number, onError?: ((err: Error) => void) | undefined) => import("../types").SkFont | null;
7
- declare type Slant = "normal" | "italic" | "oblique";
8
- declare type Weight = "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
7
+ type Slant = "normal" | "italic" | "oblique";
8
+ type Weight = "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
9
9
  interface RNFontStyle {
10
10
  fontFamily: string;
11
11
  fontSize: number;
@@ -1,2 +1,2 @@
1
- export declare type SkColor = Float32Array;
2
- export declare type Color = string | Float32Array | number | number[];
1
+ export type SkColor = Float32Array;
2
+ export type Color = string | Float32Array | number | number[];
@@ -1,3 +1,3 @@
1
1
  import type { SkJSIInstance } from "../JsiInstance";
2
2
  export declare const isColorFilter: (obj: SkJSIInstance<string> | null) => obj is SkColorFilter;
3
- export declare type SkColorFilter = SkJSIInstance<"ColorFilter">;
3
+ export type SkColorFilter = SkJSIInstance<"ColorFilter">;
@@ -1,7 +1,7 @@
1
1
  import type { SkColor } from "../Color";
2
2
  import type { BlendMode } from "../Paint";
3
3
  import type { SkColorFilter } from "./ColorFilter";
4
- export declare type InputColorMatrix = number[];
4
+ export type InputColorMatrix = number[];
5
5
  export interface ColorFilterFactory {
6
6
  /**
7
7
  * Creates a color filter using the provided color matrix.
@@ -1,12 +1,12 @@
1
1
  import type { SkJSIInstance } from "../JsiInstance";
2
- export declare type SkData = SkJSIInstance<"Data">;
3
- declare type RNModule = number;
4
- declare type ESModule = {
2
+ export type SkData = SkJSIInstance<"Data">;
3
+ type RNModule = number;
4
+ type ESModule = {
5
5
  __esModule: true;
6
6
  default: string;
7
7
  };
8
- export declare type DataModule = RNModule | ESModule;
9
- export declare type DataSource = DataModule | string | Uint8Array;
10
- export declare type DataSourceParam = DataSource | null | undefined;
8
+ export type DataModule = RNModule | ESModule;
9
+ export type DataSource = DataModule | string | Uint8Array;
10
+ export type DataSourceParam = DataSource | null | undefined;
11
11
  export declare const isRNModule: (mod: DataModule) => mod is number;
12
12
  export {};
@@ -20,4 +20,4 @@ export declare enum TileMode {
20
20
  Decal = 3
21
21
  }
22
22
  export declare const isImageFilter: (obj: SkJSIInstance<string> | null) => obj is SkImageFilter;
23
- export declare type SkImageFilter = SkJSIInstance<"ImageFilter">;
23
+ export type SkImageFilter = SkJSIInstance<"ImageFilter">;
@@ -6,7 +6,7 @@ export declare enum BlurStyle {
6
6
  Inner = 3
7
7
  }
8
8
  export declare const isMaskFilter: (obj: SkJSIInstance<string> | null) => obj is SkMaskFilter;
9
- export declare type SkMaskFilter = SkJSIInstance<"MaskFilter">;
9
+ export type SkMaskFilter = SkJSIInstance<"MaskFilter">;
10
10
  /**
11
11
  * See SkMaskFilter.h for more details.
12
12
  */
@@ -25,11 +25,11 @@ export interface SkMatrix extends SkJSIInstance<"Matrix"> {
25
25
  identity: () => SkMatrix;
26
26
  get: () => number[];
27
27
  }
28
- declare type Transform2dName = "translateX" | "translateY" | "scale" | "skewX" | "skewY" | "scaleX" | "scaleY" | "rotateZ" | "rotate";
29
- declare type Transformations = {
28
+ type Transform2dName = "translateX" | "translateY" | "scale" | "skewX" | "skewY" | "scaleX" | "scaleY" | "rotateZ" | "rotate";
29
+ type Transformations = {
30
30
  readonly [Name in Transform2dName]: number;
31
31
  };
32
- export declare type Transforms2d = readonly (Pick<Transformations, "translateX"> | Pick<Transformations, "translateY"> | Pick<Transformations, "scale"> | Pick<Transformations, "scaleX"> | Pick<Transformations, "scaleY"> | Pick<Transformations, "skewX"> | Pick<Transformations, "skewY"> | Pick<Transformations, "rotate">)[];
32
+ export type Transforms2d = readonly (Pick<Transformations, "translateX"> | Pick<Transformations, "translateY"> | Pick<Transformations, "scale"> | Pick<Transformations, "scaleX"> | Pick<Transformations, "scaleY"> | Pick<Transformations, "skewX"> | Pick<Transformations, "skewY"> | Pick<Transformations, "rotate">)[];
33
33
  export interface TransformProp {
34
34
  transform?: Transforms2d;
35
35
  }
@@ -40,7 +40,7 @@ export declare enum PathVerb {
40
40
  Cubic = 4,
41
41
  Close = 5
42
42
  }
43
- export declare type PathCommand = number[];
43
+ export type PathCommand = number[];
44
44
  export declare const isPath: (obj: SkJSIInstance<string> | null) => obj is SkPath;
45
45
  export interface SkPath extends SkJSIInstance<"Path"> {
46
46
  /**
@@ -1,7 +1,7 @@
1
1
  import type { SkJSIInstance } from "./JsiInstance";
2
2
  import type { SkPath } from "./Path/Path";
3
3
  import type { SkMatrix } from "./Matrix";
4
- export declare type SkPathEffect = SkJSIInstance<"PathEffect">;
4
+ export type SkPathEffect = SkJSIInstance<"PathEffect">;
5
5
  export declare const isPathEffect: (obj: SkJSIInstance<string> | null) => obj is SkPathEffect;
6
6
  export declare enum Path1DEffectStyle {
7
7
  Translate = 0,
@@ -7,4 +7,4 @@ export interface SkPoint {
7
7
  readonly x: number;
8
8
  readonly y: number;
9
9
  }
10
- export declare type Vector = SkPoint;
10
+ export type Vector = SkPoint;
@@ -1,2 +1,2 @@
1
1
  import type { SkJSIInstance } from "./JsiInstance";
2
- export declare type SkRSXform = SkJSIInstance<"RSXform">;
2
+ export type SkRSXform = SkJSIInstance<"RSXform">;
@@ -2,8 +2,8 @@ import type { SkJSIInstance } from "../JsiInstance";
2
2
  import type { Vector } from "../Point";
3
3
  import type { SkRuntimeEffect, SkRuntimeShaderBuilder } from "../RuntimeEffect";
4
4
  export declare const isShader: (obj: SkJSIInstance<string> | null) => obj is SkShader;
5
- export declare type SkShader = SkJSIInstance<"Shader">;
6
- export declare type Uniform = number | Vector | Float32Array | Uniform[];
5
+ export type SkShader = SkJSIInstance<"Shader">;
6
+ export type Uniform = number | Vector | Float32Array | Uniform[];
7
7
  export interface Uniforms {
8
8
  [name: string]: Uniform;
9
9
  }
@@ -1,7 +1,7 @@
1
1
  import type { SkJSIInstance } from "./JsiInstance";
2
2
  import type { SkFont } from "./Font/Font";
3
3
  import type { SkRSXform } from "./RSXform";
4
- export declare type SkTextBlob = SkJSIInstance<"TextBlob">;
4
+ export type SkTextBlob = SkJSIInstance<"TextBlob">;
5
5
  export interface TextBlobFactory {
6
6
  /**
7
7
  * Return a TextBlob with a single run of text.
@@ -1,7 +1,7 @@
1
1
  import type { CanvasKit } from "canvaskit-wasm";
2
2
  import type { SkData } from "../types";
3
3
  import { HostObject } from "./Host";
4
- declare type Data = ArrayBuffer;
4
+ type Data = ArrayBuffer;
5
5
  export declare class JsiSkData extends HostObject<Data, "Data"> implements SkData {
6
6
  constructor(CanvasKit: CanvasKit, ref: Data);
7
7
  dispose: () => void;
@@ -1,7 +1,7 @@
1
1
  import type { CanvasKit } from "canvaskit-wasm";
2
2
  import type { SkRSXform } from "../types";
3
3
  import { HostObject } from "./Host";
4
- export declare type RSXform = Float32Array;
4
+ export type RSXform = Float32Array;
5
5
  export declare class JsiSkRSXform extends HostObject<RSXform, "RSXform"> implements SkRSXform {
6
6
  constructor(CanvasKit: CanvasKit, ref: RSXform);
7
7
  dispose: () => void;
@@ -0,0 +1,6 @@
1
+ import type { TurboModule } from "react-native/Libraries/TurboModule/RCTExport";
2
+ export interface Spec extends TurboModule {
3
+ install: () => boolean;
4
+ }
5
+ declare const _default: Spec;
6
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { TurboModuleRegistry } from "react-native";
2
+ // eslint-disable-next-line import/no-default-export
3
+ export default TurboModuleRegistry.getEnforcing("RNSkiaModule");
4
+ //# sourceMappingURL=NativeSkiaModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sources":["NativeSkiaModule.ts"],"sourcesContent":["import type { TurboModule } from \"react-native/Libraries/TurboModule/RCTExport\";\nimport { TurboModuleRegistry } from \"react-native\";\n\nexport interface Spec extends TurboModule {\n install: () => boolean;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default TurboModuleRegistry.getEnforcing<Spec>(\"RNSkiaModule\");\n"],"mappings":"AACA,SAASA,mBAAT,QAAoC,cAApC;AAMA;AACA,eAAeA,mBAAmB,CAACC,YAApB,CAAuC,cAAvC,CAAf"}
@@ -0,0 +1,2 @@
1
+ import { throwOnMissingReanimated } from "../external/reanimated/moduleWrapper";
2
+ export default throwOnMissingReanimated;
@@ -0,0 +1,4 @@
1
+ import { throwOnMissingReanimated } from "../external/reanimated/moduleWrapper"; // eslint-disable-next-line import/no-default-export
2
+
3
+ export default throwOnMissingReanimated;
4
+ //# sourceMappingURL=NativeSkiaModule.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["throwOnMissingReanimated"],"sources":["NativeSkiaModule.web.ts"],"sourcesContent":["import { throwOnMissingReanimated } from \"../external/reanimated/moduleWrapper\";\n\n// eslint-disable-next-line import/no-default-export\nexport default throwOnMissingReanimated;\n"],"mappings":"AAAA,SAASA,wBAAT,QAAyC,sCAAzC,C,CAEA;;AACA,eAAeA,wBAAf"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react-native/types/modules/Codegen" />
2
+ import type { ViewProps } from "react-native";
3
+ export interface NativeProps extends ViewProps {
4
+ mode: string;
5
+ debug?: boolean;
6
+ }
7
+ declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
8
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
2
+ // eslint-disable-next-line import/no-default-export
3
+ export default codegenNativeComponent("SkiaDomView");
4
+ //# sourceMappingURL=SkiaDomViewNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["codegenNativeComponent"],"sources":["SkiaDomViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\nimport type { ViewProps } from \"react-native\";\n\nexport interface NativeProps extends ViewProps {\n mode: string;\n debug?: boolean;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default codegenNativeComponent<NativeProps>(\"SkiaDomView\");\n"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,yDAAnC;AAQA;AACA,eAAeA,sBAAsB,CAAc,aAAd,CAArC"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react-native/types/modules/Codegen" />
2
+ import type { ViewProps } from "react-native";
3
+ export interface NativeProps extends ViewProps {
4
+ mode: string;
5
+ debug?: boolean;
6
+ }
7
+ declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
8
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
2
+ // eslint-disable-next-line import/no-default-export
3
+ export default codegenNativeComponent("SkiaDrawView");
4
+ //# sourceMappingURL=SkiaDrawViewNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["codegenNativeComponent"],"sources":["SkiaDrawViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\nimport type { ViewProps } from \"react-native\";\n\nexport interface NativeProps extends ViewProps {\n mode: string;\n debug?: boolean;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default codegenNativeComponent<NativeProps>(\"SkiaDrawView\");\n"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,yDAAnC;AAQA;AACA,eAAeA,sBAAsB,CAAc,cAAd,CAArC"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react-native/types/modules/Codegen" />
2
+ import type { ViewProps } from "react-native";
3
+ export interface NativeProps extends ViewProps {
4
+ mode: string;
5
+ debug?: boolean;
6
+ }
7
+ declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
8
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
2
+ // eslint-disable-next-line import/no-default-export
3
+ export default codegenNativeComponent("SkiaPictureView");
4
+ //# sourceMappingURL=SkiaPictureViewNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["codegenNativeComponent"],"sources":["SkiaPictureViewNativeComponent.ts"],"sourcesContent":["import codegenNativeComponent from \"react-native/Libraries/Utilities/codegenNativeComponent\";\nimport type { ViewProps } from \"react-native\";\n\nexport interface NativeProps extends ViewProps {\n mode: string;\n debug?: boolean;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default codegenNativeComponent<NativeProps>(\"SkiaPictureView\");\n"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,yDAAnC;AAQA;AACA,eAAeA,sBAAsB,CAAc,iBAAd,CAArC"}
@@ -1,5 +1,5 @@
1
1
  import type { SkiaValue } from "./types";
2
- export declare type SkiaSelector<TReturn, TInput = unknown> = {
2
+ export type SkiaSelector<TReturn, TInput = unknown> = {
3
3
  value: SkiaValue<TInput>;
4
4
  selector: (v: TInput) => TReturn;
5
5
  };
@@ -63,5 +63,5 @@ export declare abstract class SkiaBaseWebView<TProps extends SkiaBaseViewProps>
63
63
  private onCancel;
64
64
  private onEnd;
65
65
  private onLayout;
66
- render(): JSX.Element;
66
+ render(): React.JSX.Element;
67
67
  }
@@ -27,5 +27,5 @@ export declare class SkiaDomView extends React.Component<SkiaDomViewProps> {
27
27
  * Clear up the dom node when unmounting to release resources.
28
28
  */
29
29
  componentWillUnmount(): void;
30
- render(): JSX.Element;
30
+ render(): React.JSX.Element;
31
31
  }
@@ -4,9 +4,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
4
4
 
5
5
  import React from "react";
6
6
  import { Platform } from "../Platform";
7
+ import SkiaDomViewNativeComponent from "../specs/SkiaDomViewNativeComponent";
7
8
  import { SkiaViewApi } from "./api";
8
9
  import { SkiaViewNativeId } from "./SkiaView";
9
- const NativeSkiaDomView = Platform.OS !== "web" ? Platform.requireNativeComponent("SkiaDomView") : // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ const NativeSkiaDomView = Platform.OS !== "web" ? SkiaDomViewNativeComponent : // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
11
  null;
11
12
  export class SkiaDomView extends React.Component {
12
13
  constructor(props) {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","SkiaViewApi","SkiaViewNativeId","NativeSkiaDomView","OS","requireNativeComponent","SkiaDomView","Component","constructor","props","_nativeId","current","root","onTouch","onSize","assertSkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","componentWillUnmount","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaDomView.tsx"],"sourcesContent":["import React from \"react\";\nimport type { HostComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { Platform } from \"../Platform\";\n\nimport { SkiaViewApi } from \"./api\";\nimport { SkiaViewNativeId } from \"./SkiaView\";\nimport type { NativeSkiaViewProps, SkiaDomViewProps } from \"./types\";\n\nconst NativeSkiaDomView: HostComponent<SkiaDomViewProps> =\n Platform.OS !== \"web\"\n ? Platform.requireNativeComponent<NativeSkiaViewProps>(\"SkiaDomView\")\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (null as any);\n\nexport class SkiaDomView extends React.Component<SkiaDomViewProps> {\n constructor(props: SkiaDomViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { root, onTouch, onSize } = props;\n if (root) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", root);\n }\n if (onTouch) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onTouch\", onTouch);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaDomViewProps) {\n const { root, onTouch, onSize } = this.props;\n if (root !== prevProps.root) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", root);\n }\n if (onTouch !== prevProps.onTouch) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onTouch\", onTouch);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n /**\n * Clear up the dom node when unmounting to release resources.\n */\n componentWillUnmount(): void {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", null);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaDomView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,SAASC,QAAT,QAAyB,aAAzB;AAEA,SAASC,WAAT,QAA4B,OAA5B;AACA,SAASC,gBAAT,QAAiC,YAAjC;AAGA,MAAMC,iBAAkD,GACtDH,QAAQ,CAACI,EAAT,KAAgB,KAAhB,GACIJ,QAAQ,CAACK,sBAAT,CAAqD,aAArD,CADJ,GAEI;AACC,IAJP;AAMA,OAAO,MAAMC,WAAN,SAA0BP,KAAK,CAACQ,SAAhC,CAA4D;EACjEC,WAAW,CAACC,KAAD,EAA0B;IACnC,MAAMA,KAAN;;IADmC;;IAEnC,KAAKC,SAAL,GAAiBR,gBAAgB,CAACS,OAAjB,EAAjB;IACA,MAAM;MAAEC,IAAF;MAAQC,OAAR;MAAiBC;IAAjB,IAA4BL,KAAlC;;I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sB,aAAZ,CAA0B,KAAKb,SAA/B;EACD;EAED;AACF;AACA;AACA;AACA;;;EACSc,cAAc,CAACC,MAAD,EAA2C;IAC9DV,iBAAiB;IACjB,OAAOd,WAAW,CAACyB,oBAAZ,CAAiC,KAAKhB,SAAtC,EAAiDe,MAAjD,CAAP;EACD;EAED;AACF;AACA;;;EACEE,oBAAoB,GAAS;IAC3BZ,iBAAiB;IACjBd,WAAW,CAACe,cAAZ,CAA2B,KAAKN,SAAhC,EAA2C,MAA3C,EAAmD,IAAnD;EACD;;EAEDkB,MAAM,GAAG;IACP,MAAM;MAAEC,IAAF;MAAQC,KAAK,GAAG,KAAhB;MAAuB,GAAGC;IAA1B,IAAwC,KAAKtB,KAAnD;IACA,oBACE,oBAAC,iBAAD;MACE,WAAW,EAAE,KADf;MAEE,QAAQ,EAAG,GAAE,KAAKC,SAAU,EAF9B;MAGE,IAAI,EAAEmB,IAHR;MAIE,KAAK,EAAEC;IAJT,GAKMC,SALN,EADF;EASD;;AAxFgE;;AA2FnE,MAAMhB,iBAAiB,GAAG,MAAM;EAC9B,IACEd,WAAW,KAAK,IAAhB,IACAA,WAAW,CAACe,cAAZ,KAA+B,IAD/B,IAEAf,WAAW,CAAC+B,aAAZ,KAA8B,IAF9B,IAGA/B,WAAW,CAACyB,oBAAZ,KAAqC,IAHrC,IAIAzB,WAAW,CAACsB,aAAZ,KAA8B,IAJ9B,IAKAtB,WAAW,CAACmB,iBAAZ,KAAkC,IANpC,EAOE;IACA,MAAMa,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAXD"}
1
+ {"version":3,"names":["React","Platform","SkiaDomViewNativeComponent","SkiaViewApi","SkiaViewNativeId","NativeSkiaDomView","OS","SkiaDomView","Component","constructor","props","_nativeId","current","root","onTouch","onSize","assertSkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","componentWillUnmount","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaDomView.tsx"],"sourcesContent":["import React from \"react\";\nimport type { HostComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { Platform } from \"../Platform\";\nimport SkiaDomViewNativeComponent from \"../specs/SkiaDomViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport { SkiaViewNativeId } from \"./SkiaView\";\nimport type { SkiaDomViewProps } from \"./types\";\n\nconst NativeSkiaDomView: HostComponent<SkiaDomViewProps> =\n Platform.OS !== \"web\"\n ? SkiaDomViewNativeComponent\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (null as any);\n\nexport class SkiaDomView extends React.Component<SkiaDomViewProps> {\n constructor(props: SkiaDomViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { root, onTouch, onSize } = props;\n if (root) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", root);\n }\n if (onTouch) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onTouch\", onTouch);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaDomViewProps) {\n const { root, onTouch, onSize } = this.props;\n if (root !== prevProps.root) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", root);\n }\n if (onTouch !== prevProps.onTouch) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onTouch\", onTouch);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n /**\n * Clear up the dom node when unmounting to release resources.\n */\n componentWillUnmount(): void {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", null);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaDomView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,SAASC,QAAT,QAAyB,aAAzB;AACA,OAAOC,0BAAP,MAAuC,qCAAvC;AAEA,SAASC,WAAT,QAA4B,OAA5B;AACA,SAASC,gBAAT,QAAiC,YAAjC;AAGA,MAAMC,iBAAkD,GACtDJ,QAAQ,CAACK,EAAT,KAAgB,KAAhB,GACIJ,0BADJ,GAEI;AACC,IAJP;AAMA,OAAO,MAAMK,WAAN,SAA0BP,KAAK,CAACQ,SAAhC,CAA4D;EACjEC,WAAW,CAACC,KAAD,EAA0B;IACnC,MAAMA,KAAN;;IADmC;;IAEnC,KAAKC,SAAL,GAAiBP,gBAAgB,CAACQ,OAAjB,EAAjB;IACA,MAAM;MAA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AACA;;;EACSC,MAAM,GAAG;IACdP,iBAAiB;IACjBb,WAAW,CAACqB,aAAZ,CAA0B,KAAKb,SAA/B;EACD;EAED;AACF;AACA;AACA;AACA;;;EACSc,cAAc,CAACC,MAAD,EAA2C;IAC9DV,iBAAiB;IACjB,OAAOb,WAAW,CAACwB,oBAAZ,CAAiC,KAAKhB,SAAtC,EAAiDe,MAAjD,CAAP;EACD;EAED;AACF;AACA;;;EACEE,oBAAoB,GAAS;IAC3BZ,iBAAiB;IACjBb,WAAW,CAACc,cAAZ,CAA2B,KAAKN,SAAhC,EAA2C,MAA3C,EAAmD,IAAnD;EACD;;EAEDkB,MAAM,GAAG;IACP,MAAM;MAAEC,IAAF;MAAQC,KAAK,GAAG,KAAhB;MAAuB,GAAGC;IAA1B,IAAwC,KAAKtB,KAAnD;IACA,oBACE,oBAAC,iBAAD;MACE,WAAW,EAAE,KADf;MAEE,QAAQ,EAAG,GAAE,KAAKC,SAAU,EAF9B;MAGE,IAAI,EAAEmB,IAHR;MAIE,KAAK,EAAEC;IAJT,GAKMC,SALN,EADF;EASD;;AAxFgE;;AA2FnE,MAAMhB,iBAAiB,GAAG,MAAM;EAC9B,IACEb,WAAW,KAAK,IAAhB,IACAA,WAAW,CAACc,cAAZ,KAA+B,IAD/B,IAEAd,WAAW,CAAC8B,aAAZ,KAA8B,IAF9B,IAGA9B,WAAW,CAACwB,oBAAZ,KAAqC,IAHrC,IAIAxB,WAAW,CAACqB,aAAZ,KAA8B,IAJ9B,IAKArB,WAAW,CAACkB,iBAAZ,KAAkC,IANpC,EAOE;IACA,MAAMa,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAXD"}
@@ -23,5 +23,5 @@ export declare class SkiaPictureView extends React.Component<SkiaPictureViewProp
23
23
  * @param values Values to register
24
24
  */
25
25
  registerValues(values: SkiaValue<unknown>[]): () => void;
26
- render(): JSX.Element;
26
+ render(): React.JSX.Element;
27
27
  }
@@ -3,10 +3,10 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  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; }
4
4
 
5
5
  import React from "react";
6
- import { Platform } from "../Platform";
6
+ import SkiaPictureViewNativeComponent from "../specs/SkiaPictureViewNativeComponent";
7
7
  import { SkiaViewApi } from "./api";
8
8
  import { SkiaViewNativeId } from "./SkiaView";
9
- const NativeSkiaPictureView = Platform.requireNativeComponent("SkiaPictureView");
9
+ const NativeSkiaPictureView = SkiaPictureViewNativeComponent;
10
10
  export class SkiaPictureView extends React.Component {
11
11
  constructor(props) {
12
12
  super(props);
@@ -91,7 +91,7 @@ export class SkiaPictureView extends React.Component {
91
91
  return /*#__PURE__*/React.createElement(NativeSkiaPictureView, _extends({
92
92
  collapsable: false,
93
93
  nativeID: `${this._nativeId}`,
94
- mode: mode,
94
+ mode: mode !== null && mode !== void 0 ? mode : "default",
95
95
  debug: debug
96
96
  }, viewProps));
97
97
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","SkiaViewApi","SkiaViewNativeId","NativeSkiaPictureView","requireNativeComponent","SkiaPictureView","Component","constructor","props","_nativeId","current","picture","onSize","assertSkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaPictureView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { Platform } from \"../Platform\";\n\nimport { SkiaViewApi } from \"./api\";\nimport { SkiaViewNativeId } from \"./SkiaView\";\nimport type { NativeSkiaViewProps, SkiaPictureViewProps } from \"./types\";\n\nconst NativeSkiaPictureView =\n Platform.requireNativeComponent<NativeSkiaViewProps>(\"SkiaPictureView\");\n\nexport class SkiaPictureView extends React.Component<SkiaPictureViewProps> {\n constructor(props: SkiaPictureViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { picture, onSize } = props;\n if (picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaPictureViewProps) {\n const { picture, onSize } = this.props;\n if (picture !== prevProps.picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View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IAAD,EAAgB;IACtCN,iBAAiB;IACjB,OAAOZ,WAAW,CAACiB,iBAAZ,CAA8B,KAAKT,SAAnC,EAA8CU,IAA9C,CAAP;EACD;EAED;AACF;AACA;;;EACSC,MAAM,GAAG;IACdP,iBAAiB;IACjBZ,WAAW,CAACoB,aAAZ,CAA0B,KAAKZ,SAA/B;EACD;EAED;AACF;AACA;AACA;AACA;;;EACSa,cAAc,CAACC,MAAD,EAA2C;IAC9DV,iBAAiB;IACjB,OAAOZ,WAAW,CAACuB,oBAAZ,CAAiC,KAAKf,SAAtC,EAAiDc,MAAjD,CAAP;EACD;;EAEDE,MAAM,GAAG;IACP,MAAM;MAAEC,IAAF;MAAQC,KAAK,GAAG,KAAhB;MAAuB,GAAGC;IAA1B,IAAwC,KAAKpB,KAAnD;IACA,oBACE,oBAAC,qBAAD;MACE,WAAW,EAAE,KADf;MAEE,QAAQ,EAAG,GAAE,KAAKC,SAAU,EAF9B;MAGE,IAAI,EAAEiB,IAHR;MAIE,KAAK,EAAEC;IAJT,GAKMC,SALN,EADF;EASD;;AAxEwE;;AA2E3E,MAAMf,iBAAiB,GAAG,MAAM;EAC9B,IACEZ,WAAW,KAAK,IAAhB,IACAA,WAAW,CAACa,cAAZ,KAA+B,IAD/B,IAEAb,WAAW,CAAC4B,aAAZ,KAA8B,IAF9B,IAGA5B,WAAW,CAACuB,oBAAZ,KAAqC,IAHrC,IAIAvB,WAAW,CAACoB,aAAZ,KAA8B,IAJ9B,IAKApB,WAAW,CAACiB,iBAAZ,KAAkC,IANpC,EAOE;IACA,MAAMY,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAXD"}
1
+ {"version":3,"names":["React","SkiaPictureViewNativeComponent","SkiaViewApi","SkiaViewNativeId","NativeSkiaPictureView","SkiaPictureView","Component","constructor","props","_nativeId","current","picture","onSize","assertSkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaPictureView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport SkiaPictureViewNativeComponent from \"../specs/SkiaPictureViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport { SkiaViewNativeId } from \"./SkiaView\";\nimport type { SkiaPictureViewProps } from \"./types\";\n\nconst NativeSkiaPictureView = SkiaPictureViewNativeComponent;\n\nexport class SkiaPictureView extends React.Component<SkiaPictureViewProps> {\n constructor(props: SkiaPictureViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { picture, onSize } = props;\n if (picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaPictureViewProps) {\n const { picture, onSize } = this.props;\n if (picture !== prevProps.picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode ?? \"default\"}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAIA,OAAOC,8BAAP,MAA2C,yCAA3C;AAEA,SAASC,WAAT,QAA4B,OAA5B;AACA,SAASC,gBAAT,QAAiC,YAAjC;AAGA,MAAMC,qBAAqB,GAAGH,8BAA9B;AAEA,OAAO,MAAMI,eAAN,SAA8BL,KAAK,CAACM,SAApC,CAAoE;EACzEC,WAAW,CAACC,KAAD,EAA8B;IACvC,MAAMA,KAAN;;IADuC;;IAEvC,KAAKC,SAAL,GAAiBN,gBAAgB,CAACO,OAAjB,EAAjB;IACA,MAAM;MAAEC,OAAF;MAAWC;IAAX,IAAsBJ,KAA5B;;IACA,IAAIG,OAAJ,EAAa;MACXE,iBAAiB;MACjBX,WAAW,CAACY,cAAZ,CAA2B,KAAKL,SAAhC,EAA2C,SAA3C,EAAsDE,OAAtD;IACD;;IACD,IAAIC,MAAJ,EAAY;MACVC,iBAAiB;MACjBX,WAAW,CAACY,cAAZ,CAA2B,KAAKL,SAAhC,EAA2C,QAA3C,EAAqDG,MAArD;IACD;EACF;;EAIkB,IAARG,QAAQ,GAAG;IACpB,OAAO,KAAKN,SAAZ;EACD;;EAEDO,kBAAkB,CAACC,SAAD,EAAkC;IAClD,MAAM;MAAEN,OAAF;MAAWC;IAAX,IAAsB,KAAKJ,KAAjC;;IACA,IAAIG,OAA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C,IAHrC,IAIAtB,WAAW,CAACmB,aAAZ,KAA8B,IAJ9B,IAKAnB,WAAW,CAACgB,iBAAZ,KAAkC,IANpC,EAOE;IACA,MAAMY,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAXD"}
@@ -26,5 +26,5 @@ export declare class SkiaView extends React.Component<SkiaDrawViewProps> {
26
26
  * @param values Values to register
27
27
  */
28
28
  registerValues(values: SkiaValue<unknown>[]): () => void;
29
- render(): JSX.Element;
29
+ render(): React.JSX.Element;
30
30
  }
@@ -3,12 +3,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  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; }
4
4
 
5
5
  import React from "react";
6
- import { Platform } from "../Platform";
6
+ import SkiaDrawViewNativeComponent from "../specs/SkiaDrawViewNativeComponent";
7
7
  import { SkiaViewApi } from "./api";
8
8
  export const SkiaViewNativeId = {
9
9
  current: 1000
10
10
  };
11
- const NativeSkiaView = Platform.requireNativeComponent("SkiaDrawView");
11
+ const NativeSkiaView = SkiaDrawViewNativeComponent;
12
12
  export class SkiaView extends React.Component {
13
13
  constructor(props) {
14
14
  super(props);
@@ -94,7 +94,7 @@ export class SkiaView extends React.Component {
94
94
  return /*#__PURE__*/React.createElement(NativeSkiaView, _extends({
95
95
  collapsable: false,
96
96
  nativeID: `${this._nativeId}`,
97
- mode: mode,
97
+ mode: mode !== null && mode !== void 0 ? mode : "default",
98
98
  debug: debug
99
99
  }, viewProps));
100
100
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","SkiaViewApi","SkiaViewNativeId","current","NativeSkiaView","requireNativeComponent","SkiaView","Component","constructor","props","_nativeId","onDraw","onSize","assertSkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { Platform } from \"../Platform\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { NativeSkiaViewProps, SkiaDrawViewProps } from \"./types\";\n\nexport const SkiaViewNativeId = { current: 1000 };\n\nconst NativeSkiaView =\n Platform.requireNativeComponent<NativeSkiaViewProps>(\"SkiaDrawView\");\n\nexport class SkiaView extends React.Component<SkiaDrawViewProps> {\n constructor(props: SkiaDrawViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { onDraw, onSize } = props;\n if (onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaDrawViewProps) {\n const { onDraw, onSize } = this.props;\n if (onDraw !== prevProps.onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, onSize, ...viewProps } = this.props;\n return (\n <NativeSkiaView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAIA,SAASC,QAAT,QAAyB,aAAzB;AAEA,SAASC,WAAT,QAA4B,OAA5B;AAGA,OAAO,MAAMC,gBAAgB,GAAG;EAAEC,OAAO,EAAE;AAAX,CAAzB;AAEP,MAAMC,cAAc,GAClBJ,QAAQ,CAACK,sBAAT,CAAqD,cAArD,CADF;AAGA,OAAO,MAAMC,QAAN,SAAuBP,KAAK,CAACQ,SAA7B,CAA0D;EAC/DC,WAAW,CAACC,KAAD,EAA2B;IACpC,MAAMA,KAAN;;IADoC;;IAEpC,KAAKC,SAAL,GAAiBR,gBAAgB,CAACC,OAAjB,EAAjB;IACA,MAAM;MAAEQ,MAAF;MAAUC;IAAV,IAAqBH,KAA3B;;IACA,IAAIE,MAAJ,EAAY;MACVE,iBAAiB;MACjBZ,WAAW,CAACa,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,cAA3C,EAA2DC,MAA3D;IACD;;IACD,IAAIC,MAAJ,EAAY;MACVC,iBAAiB;MACjBZ,WAAW,CAACa,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,QAA3C,EAAqDE,MAArD;IACD;EACF;;EAIkB,IAARG,QAAQ,GAAG;IACpB,OAAO,KAAKL,SAAZ;EACD;;EAEDM,kBAAkB,CAACC,SAAD,EAA+B;IAC/C,MAAM;MAAEN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,IAF9B,IAGA5B,WAAW,CAACuB,oBAAZ,KAAqC,IAHrC,IAIAvB,WAAW,CAACoB,aAAZ,KAA8B,IAJ9B,IAKApB,WAAW,CAACiB,iBAAZ,KAAkC,IANpC,EAOE;IACA,MAAMY,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAXD"}
1
+ {"version":3,"names":["React","SkiaDrawViewNativeComponent","SkiaViewApi","SkiaViewNativeId","current","NativeSkiaView","SkiaView","Component","constructor","props","_nativeId","onDraw","onSize","assertSkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport SkiaDrawViewNativeComponent from \"../specs/SkiaDrawViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaDrawViewProps } from \"./types\";\n\nexport const SkiaViewNativeId = { current: 1000 };\n\nconst NativeSkiaView = SkiaDrawViewNativeComponent;\n\nexport class SkiaView extends React.Component<SkiaDrawViewProps> {\n constructor(props: SkiaDrawViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { onDraw, onSize } = props;\n if (onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaDrawViewProps) {\n const { onDraw, onSize } = this.props;\n if (onDraw !== prevProps.onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, onSize, ...viewProps } = this.props;\n return (\n <NativeSkiaView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode ?? \"default\"}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAIA,OAAOC,2BAAP,MAAwC,sCAAxC;AAEA,SAASC,WAAT,QAA4B,OAA5B;AAGA,OAAO,MAAMC,gBAAgB,GAAG;EAAEC,OAAO,EAAE;AAAX,CAAzB;AAEP,MAAMC,cAAc,GAAGJ,2BAAvB;AAEA,OAAO,MAAMK,QAAN,SAAuBN,KAAK,CAACO,SAA7B,CAA0D;EAC/DC,WAAW,CAACC,KAAD,EAA2B;IACpC,MAAMA,KAAN;;IADoC;;IAEpC,KAAKC,SAAL,GAAiBP,gBAAgB,CAACC,OAAjB,EAAjB;IACA,MAAM;MAAEO,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K,GAAG,KAAhB;MAAuBf,MAAvB;MAA+B,GAAGgB;IAAlC,IAAgD,KAAKnB,KAA3D;IACA,oBACE,oBAAC,cAAD;MACE,WAAW,EAAE,KADf;MAEE,QAAQ,EAAG,GAAE,KAAKC,SAAU,EAF9B;MAGE,IAAI,EAAEgB,IAAF,aAAEA,IAAF,cAAEA,IAAF,GAAU,SAHhB;MAIE,KAAK,EAAEC;IAJT,GAKMC,SALN,EADF;EASD;;AAxE8D;;AA2EjE,MAAMf,iBAAiB,GAAG,MAAM;EAC9B,IACEX,WAAW,KAAK,IAAhB,IACAA,WAAW,CAACY,cAAZ,KAA+B,IAD/B,IAEAZ,WAAW,CAAC2B,aAAZ,KAA8B,IAF9B,IAGA3B,WAAW,CAACsB,oBAAZ,KAAqC,IAHrC,IAIAtB,WAAW,CAACmB,aAAZ,KAA8B,IAJ9B,IAKAnB,WAAW,CAACgB,iBAAZ,KAAkC,IANpC,EAOE;IACA,MAAMY,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAXD"}
@@ -3,8 +3,8 @@ import type { GroupProps, RenderNode } from "../dom/types";
3
3
  import type { SkCanvas, SkImage, SkPicture, SkRect, SkSize } from "../skia/types";
4
4
  import type { SkiaMutableValue, SkiaValue } from "../values";
5
5
  import type { SharedValueType } from "../renderer/processors/Animations/Animations";
6
- export declare type DrawMode = "continuous" | "default";
7
- export declare type NativeSkiaViewProps = ViewProps & {
6
+ export type DrawMode = "continuous" | "default";
7
+ export type NativeSkiaViewProps = ViewProps & {
8
8
  mode?: DrawMode;
9
9
  debug?: boolean;
10
10
  };
@@ -28,17 +28,17 @@ export interface DrawingInfo {
28
28
  timestamp: number;
29
29
  touches: Array<Array<TouchInfo>>;
30
30
  }
31
- export declare type ExtendedTouchInfo = TouchInfo & {
31
+ export type ExtendedTouchInfo = TouchInfo & {
32
32
  velocityX: number;
33
33
  velocityY: number;
34
34
  };
35
- export declare type TouchHandlers = {
35
+ export type TouchHandlers = {
36
36
  onStart?: (touchInfo: TouchInfo) => void;
37
37
  onActive?: (touchInfo: ExtendedTouchInfo) => void;
38
38
  onEnd?: (touchInfo: ExtendedTouchInfo) => void;
39
39
  };
40
- export declare type TouchHandler = (touchInfo: Array<Array<TouchInfo>>) => void;
41
- export declare type RNSkiaDrawCallback = (canvas: SkCanvas, info: DrawingInfo) => void;
40
+ export type TouchHandler = (touchInfo: Array<Array<TouchInfo>>) => void;
41
+ export type RNSkiaDrawCallback = (canvas: SkCanvas, info: DrawingInfo) => void;
42
42
  /**
43
43
  * Listener interface for value changes
44
44
  */
@@ -1,5 +1,5 @@
1
1
  import type { ComponentProps, ComponentType } from "react";
2
- import { Suspense } from "react";
2
+ import React, { Suspense } from "react";
3
3
  import { LoadSkiaWeb } from "./LoadSkiaWeb";
4
4
  interface WithSkiaProps {
5
5
  fallback?: ComponentProps<typeof Suspense>["fallback"];
@@ -8,5 +8,5 @@ interface WithSkiaProps {
8
8
  }>;
9
9
  opts?: Parameters<typeof LoadSkiaWeb>[0];
10
10
  }
11
- export declare const WithSkiaWeb: ({ getComponent, fallback, opts, }: WithSkiaProps) => JSX.Element;
11
+ export declare const WithSkiaWeb: ({ getComponent, fallback, opts, }: WithSkiaProps) => React.JSX.Element;
12
12
  export {};
@@ -1,11 +1,9 @@
1
1
  /// <reference types="react" />
2
- import type { HostComponent, NodeHandle, ViewComponent } from "react-native";
2
+ import type { NodeHandle, ViewComponent } from "react-native";
3
3
  import type { DataModule } from "../skia/types";
4
4
  export interface IPlatform {
5
5
  OS: string;
6
- requireNativeComponent: <T>(viewName: string) => HostComponent<T>;
7
6
  PixelRatio: number;
8
- NativeModules: Record<string, any>;
9
7
  findNodeHandle: (componentOrHandle: null | number | React.Component<any, any> | React.ComponentClass<any>) => null | NodeHandle;
10
8
  resolveAsset: (source: DataModule) => string;
11
9
  View: typeof ViewComponent;
@@ -11,7 +11,7 @@ interface RequiredExtrapolationConfig {
11
11
  extrapolateLeft: Extrapolate;
12
12
  extrapolateRight: Extrapolate;
13
13
  }
14
- export declare type ExtrapolationType = ExtrapolationConfig | Extrapolate | string | undefined;
14
+ export type ExtrapolationType = ExtrapolationConfig | Extrapolate | string | undefined;
15
15
  export declare function validateInterpolationOptions(type: ExtrapolationType): RequiredExtrapolationConfig;
16
16
  export declare function interpolate(x: number, input: readonly number[], output: readonly number[], type?: ExtrapolationType): number;
17
17
  export {};
@@ -1,4 +1,4 @@
1
- export declare type EasingFunction = (value: number) => number;
1
+ export type EasingFunction = (value: number) => number;
2
2
  export interface TimingConfig {
3
3
  from?: number;
4
4
  to?: number;
@@ -14,5 +14,5 @@ export interface AnimationParams {
14
14
  loop?: boolean;
15
15
  yoyo?: boolean;
16
16
  }
17
- export declare type RequiredAnimationParams = Required<Omit<AnimationParams, "from">> & Pick<AnimationParams, "from">;
18
- export declare type AnimationCallback = (current: number) => void;
17
+ export type RequiredAnimationParams = Required<Omit<AnimationParams, "from">> & Pick<AnimationParams, "from">;
18
+ export type AnimationCallback = (current: number) => void;