@shopify/react-native-skia 0.1.171 → 0.1.173

Sign up to get free protection for your applications and to get access to all the features.
Files changed (919) hide show
  1. package/android/CMakeLists.txt +1 -0
  2. package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +5 -0
  3. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +106 -5
  4. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +3 -1
  5. package/cpp/api/JsiSkSurface.h +7 -1
  6. package/cpp/api/JsiSkSurfaceFactory.h +15 -2
  7. package/cpp/rnskia/RNSkDomView.cpp +2 -4
  8. package/cpp/rnskia/RNSkJsView.cpp +3 -0
  9. package/cpp/rnskia/RNSkJsiViewApi.h +2 -2
  10. package/cpp/rnskia/RNSkPictureView.h +3 -0
  11. package/cpp/rnskia/RNSkPlatformContext.h +9 -0
  12. package/cpp/rnskia/dom/JsiDomApi.h +1 -0
  13. package/cpp/rnskia/dom/base/ConcatablePaint.cpp +117 -0
  14. package/cpp/rnskia/dom/base/ConcatablePaint.h +49 -0
  15. package/cpp/rnskia/dom/base/Declaration.h +88 -0
  16. package/cpp/rnskia/dom/base/DeclarationContext.h +79 -0
  17. package/cpp/rnskia/dom/base/DerivedNodeProp.h +25 -9
  18. package/cpp/rnskia/dom/base/DrawingContext.cpp +32 -186
  19. package/cpp/rnskia/dom/base/DrawingContext.h +45 -64
  20. package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +35 -106
  21. package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +28 -9
  22. package/cpp/rnskia/dom/base/JsiDomNode.h +46 -17
  23. package/cpp/rnskia/dom/base/JsiDomRenderNode.h +81 -67
  24. package/cpp/rnskia/dom/base/NodeProp.h +12 -2
  25. package/cpp/rnskia/dom/base/NodePropsContainer.h +15 -16
  26. package/cpp/rnskia/dom/nodes/JsiBackdropFilterNode.h +22 -11
  27. package/cpp/rnskia/dom/nodes/JsiBlendNode.h +43 -59
  28. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +16 -17
  29. package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +6 -5
  30. package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +45 -69
  31. package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +8 -1
  32. package/cpp/rnskia/dom/nodes/JsiGroupNode.h +1 -1
  33. package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +121 -161
  34. package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -0
  35. package/cpp/rnskia/dom/nodes/JsiLayerNode.h +28 -18
  36. package/cpp/rnskia/dom/nodes/JsiPaintNode.h +82 -45
  37. package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +68 -101
  38. package/cpp/rnskia/dom/nodes/JsiPathNode.h +3 -2
  39. package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +150 -207
  40. package/cpp/rnskia/dom/props/BezierProps.h +4 -2
  41. package/cpp/rnskia/dom/props/BlendModeProp.h +4 -2
  42. package/cpp/rnskia/dom/props/BoxShadowProps.h +8 -10
  43. package/cpp/rnskia/dom/props/CircleProp.h +6 -5
  44. package/cpp/rnskia/dom/props/ClipProp.h +6 -4
  45. package/cpp/rnskia/dom/props/ColorProp.h +8 -4
  46. package/cpp/rnskia/dom/props/DrawingProp.h +5 -3
  47. package/cpp/rnskia/dom/props/FontProp.h +4 -2
  48. package/cpp/rnskia/dom/props/GlyphsProp.h +4 -2
  49. package/cpp/rnskia/dom/props/ImageProps.h +9 -6
  50. package/cpp/rnskia/dom/props/LayerProp.h +6 -4
  51. package/cpp/rnskia/dom/props/MatrixProp.h +4 -2
  52. package/cpp/rnskia/dom/props/NumbersProp.h +8 -4
  53. package/cpp/rnskia/dom/props/PaintProps.h +55 -92
  54. package/cpp/rnskia/dom/props/PathProp.h +4 -2
  55. package/cpp/rnskia/dom/props/PictureProp.h +4 -2
  56. package/cpp/rnskia/dom/props/PointProp.h +4 -2
  57. package/cpp/rnskia/dom/props/PointsProp.h +8 -4
  58. package/cpp/rnskia/dom/props/RRectProp.h +23 -16
  59. package/cpp/rnskia/dom/props/RadiusProp.h +4 -2
  60. package/cpp/rnskia/dom/props/RectProp.h +18 -12
  61. package/cpp/rnskia/dom/props/StrokeProps.h +8 -4
  62. package/cpp/rnskia/dom/props/SvgProp.h +4 -2
  63. package/cpp/rnskia/dom/props/TextBlobProp.h +10 -8
  64. package/cpp/rnskia/dom/props/TileModeProp.h +4 -2
  65. package/cpp/rnskia/dom/props/TransformProp.h +4 -2
  66. package/cpp/rnskia/dom/props/TransformsProps.h +5 -7
  67. package/cpp/rnskia/dom/props/UniformsProp.h +4 -2
  68. package/cpp/rnskia/dom/props/VertexModeProp.h +4 -2
  69. package/cpp/rnskia/dom/props/VerticesProps.h +7 -11
  70. package/ios/RNSkia-iOS/DisplayLink.mm +22 -24
  71. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +57 -50
  72. package/ios/RNSkia-iOS/RNSkiOSPlatformContext.h +2 -0
  73. package/ios/RNSkia-iOS/RNSkiOSPlatformContext.mm +38 -25
  74. package/ios/RNSkia-iOS/SkiaDomViewManager.mm +17 -17
  75. package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +17 -17
  76. package/ios/RNSkia-iOS/SkiaManager.mm +12 -10
  77. package/ios/RNSkia-iOS/SkiaMetalRenderer.h +5 -0
  78. package/ios/RNSkia-iOS/SkiaMetalRenderer.mm +53 -0
  79. package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +17 -17
  80. package/ios/RNSkia-iOS/SkiaUIView.mm +63 -53
  81. package/ios/RNSkiaModule.mm +5 -7
  82. package/lib/commonjs/animation/decay/decay.d.ts +2 -0
  83. package/lib/commonjs/animation/decay/index.d.ts +1 -0
  84. package/lib/commonjs/animation/decay/runDecay.d.ts +10 -0
  85. package/lib/commonjs/animation/decay/types.d.ts +21 -0
  86. package/lib/commonjs/animation/functions/index.d.ts +4 -0
  87. package/lib/commonjs/animation/functions/interpolate.d.ts +17 -0
  88. package/lib/commonjs/animation/functions/interpolateColors.d.ts +3 -0
  89. package/lib/commonjs/animation/functions/interpolatePaths.d.ts +19 -0
  90. package/lib/commonjs/animation/functions/interpolateVector.d.ts +10 -0
  91. package/lib/commonjs/animation/index.d.ts +4 -0
  92. package/lib/commonjs/animation/spring/Spring.d.ts +65 -0
  93. package/lib/commonjs/animation/spring/functions/index.d.ts +1 -0
  94. package/lib/commonjs/animation/spring/functions/spring.d.ts +10 -0
  95. package/lib/commonjs/animation/spring/index.d.ts +3 -0
  96. package/lib/commonjs/animation/spring/runSpring.d.ts +16 -0
  97. package/lib/commonjs/animation/spring/types.d.ts +6 -0
  98. package/lib/commonjs/animation/spring/useSpring.d.ts +10 -0
  99. package/lib/commonjs/animation/timing/Easing.d.ts +19 -0
  100. package/lib/commonjs/animation/timing/createTiming.d.ts +17 -0
  101. package/lib/commonjs/animation/timing/functions/bezier.d.ts +1 -0
  102. package/lib/commonjs/animation/timing/functions/getResolvedParams.d.ts +7 -0
  103. package/lib/commonjs/animation/timing/functions/index.d.ts +4 -0
  104. package/lib/commonjs/animation/timing/functions/timing.d.ts +17 -0
  105. package/lib/commonjs/animation/timing/functions/types.d.ts +7 -0
  106. package/lib/commonjs/animation/timing/index.d.ts +4 -0
  107. package/lib/commonjs/animation/timing/runTiming.d.ts +16 -0
  108. package/lib/commonjs/animation/timing/useLoop.d.ts +8 -0
  109. package/lib/commonjs/animation/timing/useTiming.d.ts +10 -0
  110. package/lib/commonjs/animation/types.d.ts +18 -0
  111. package/lib/commonjs/dom/nodes/DrawingNode.d.ts +14 -0
  112. package/lib/commonjs/dom/nodes/DrawingNode.js +5 -1
  113. package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
  114. package/lib/commonjs/dom/nodes/GroupNode.d.ts +7 -0
  115. package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +64 -0
  116. package/lib/commonjs/dom/nodes/LayerNode.d.ts +8 -0
  117. package/lib/commonjs/dom/nodes/LayerNode.js +13 -6
  118. package/lib/commonjs/dom/nodes/LayerNode.js.map +1 -1
  119. package/lib/commonjs/dom/nodes/Node.d.ts +38 -0
  120. package/lib/commonjs/dom/nodes/Node.js +8 -26
  121. package/lib/commonjs/dom/nodes/Node.js.map +1 -1
  122. package/lib/commonjs/dom/nodes/PaintContext.d.ts +18 -0
  123. package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -1
  124. package/lib/commonjs/dom/nodes/PaintNode.d.ts +8 -0
  125. package/lib/commonjs/dom/nodes/PaintNode.js +32 -15
  126. package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -1
  127. package/lib/commonjs/dom/nodes/RenderNode.d.ts +26 -0
  128. package/lib/commonjs/dom/nodes/RenderNode.js +19 -187
  129. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  130. package/lib/commonjs/dom/nodes/datatypes/Circle.d.ts +7 -0
  131. package/lib/commonjs/dom/nodes/datatypes/Enum.d.ts +1 -0
  132. package/lib/commonjs/dom/nodes/datatypes/Fitting.d.ts +33 -0
  133. package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +92 -0
  134. package/lib/commonjs/dom/nodes/datatypes/Path.d.ts +4 -0
  135. package/lib/commonjs/dom/nodes/datatypes/Radius.d.ts +3 -0
  136. package/lib/commonjs/dom/nodes/datatypes/Rect.d.ts +5 -0
  137. package/lib/commonjs/dom/nodes/datatypes/Transform.d.ts +3 -0
  138. package/lib/commonjs/dom/nodes/datatypes/index.d.ts +8 -0
  139. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.d.ts +8 -0
  140. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +25 -7
  141. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
  142. package/lib/commonjs/dom/nodes/drawings/Box.d.ts +15 -0
  143. package/lib/commonjs/dom/nodes/drawings/Box.js +3 -0
  144. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  145. package/lib/commonjs/dom/nodes/drawings/CircleNode.d.ts +9 -0
  146. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.d.ts +8 -0
  147. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.d.ts +8 -0
  148. package/lib/commonjs/dom/nodes/drawings/FillNode.d.ts +8 -0
  149. package/lib/commonjs/dom/nodes/drawings/ImageNode.d.ts +25 -0
  150. package/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +8 -0
  151. package/lib/commonjs/dom/nodes/drawings/LineNode.d.ts +8 -0
  152. package/lib/commonjs/dom/nodes/drawings/OvalNode.d.ts +9 -0
  153. package/lib/commonjs/dom/nodes/drawings/PatchNode.d.ts +18 -0
  154. package/lib/commonjs/dom/nodes/drawings/PathNode.d.ts +9 -0
  155. package/lib/commonjs/dom/nodes/drawings/PictureNode.d.ts +8 -0
  156. package/lib/commonjs/dom/nodes/drawings/PointsNode.d.ts +8 -0
  157. package/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +10 -0
  158. package/lib/commonjs/dom/nodes/drawings/RectNode.d.ts +9 -0
  159. package/lib/commonjs/dom/nodes/drawings/Text.d.ts +30 -0
  160. package/lib/commonjs/dom/nodes/drawings/VerticesNode.d.ts +9 -0
  161. package/lib/commonjs/dom/nodes/drawings/index.d.ts +18 -0
  162. package/lib/commonjs/dom/nodes/index.d.ts +3 -0
  163. package/lib/commonjs/dom/nodes/paint/BlendNode.d.ts +8 -0
  164. package/lib/commonjs/dom/nodes/paint/BlendNode.js +16 -47
  165. package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -1
  166. package/lib/commonjs/dom/nodes/paint/ColorFilters.d.ts +35 -0
  167. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +29 -43
  168. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
  169. package/lib/commonjs/dom/nodes/paint/ImageFilters.d.ts +42 -0
  170. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +45 -42
  171. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
  172. package/lib/commonjs/dom/nodes/paint/MaskFilters.d.ts +8 -0
  173. package/lib/commonjs/dom/nodes/paint/MaskFilters.js +3 -2
  174. package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -1
  175. package/lib/commonjs/dom/nodes/paint/PathEffects.d.ts +39 -0
  176. package/lib/commonjs/dom/nodes/paint/PathEffects.js +30 -72
  177. package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -1
  178. package/lib/commonjs/dom/nodes/paint/Shaders.d.ts +43 -0
  179. package/lib/commonjs/dom/nodes/paint/Shaders.js +28 -18
  180. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
  181. package/lib/commonjs/dom/nodes/paint/index.d.ts +6 -0
  182. package/lib/commonjs/dom/types/ColorFilters.d.ts +12 -0
  183. package/lib/commonjs/dom/types/Common.d.ts +56 -0
  184. package/lib/commonjs/dom/types/DeclarationContext.d.ts +29 -0
  185. package/lib/commonjs/dom/types/DeclarationContext.js +118 -0
  186. package/lib/commonjs/dom/types/DeclarationContext.js.map +1 -0
  187. package/lib/commonjs/dom/types/DrawingContext.d.ts +22 -0
  188. package/lib/commonjs/dom/types/DrawingContext.js +330 -0
  189. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
  190. package/lib/commonjs/dom/types/Drawings.d.ts +104 -0
  191. package/lib/commonjs/dom/types/ImageFilters.d.ts +37 -0
  192. package/lib/commonjs/dom/types/MaskFilters.d.ts +7 -0
  193. package/lib/commonjs/dom/types/Node.d.ts +23 -0
  194. package/lib/commonjs/dom/types/Node.js.map +1 -1
  195. package/lib/commonjs/dom/types/NodeType.d.ts +67 -0
  196. package/lib/commonjs/dom/types/PathEffects.d.ts +28 -0
  197. package/lib/commonjs/dom/types/Shaders.d.ts +59 -0
  198. package/lib/commonjs/dom/types/SkDOM.d.ts +71 -0
  199. package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
  200. package/lib/commonjs/dom/types/index.d.ts +12 -0
  201. package/lib/commonjs/dom/types/index.js +13 -0
  202. package/lib/commonjs/dom/types/index.js.map +1 -1
  203. package/lib/commonjs/external/index.d.ts +1 -0
  204. package/lib/commonjs/external/reanimated/index.d.ts +1 -0
  205. package/lib/commonjs/external/reanimated/useSharedValueEffect.d.ts +11 -0
  206. package/lib/commonjs/index.d.ts +11 -0
  207. package/lib/commonjs/index.js +13 -0
  208. package/lib/commonjs/index.js.map +1 -1
  209. package/lib/commonjs/mock/index.d.ts +16 -0
  210. package/lib/commonjs/renderer/Canvas.d.ts +11 -0
  211. package/lib/commonjs/renderer/Canvas.js +3 -3
  212. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  213. package/lib/commonjs/renderer/Container.d.ts +12 -0
  214. package/lib/commonjs/renderer/DependencyManager.d.ts +46 -0
  215. package/lib/commonjs/renderer/DrawingContext.d.ts +7 -0
  216. package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
  217. package/lib/commonjs/renderer/HostComponents.d.ts +132 -0
  218. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  219. package/lib/commonjs/renderer/HostConfig.d.ts +19 -0
  220. package/lib/commonjs/renderer/HostConfig.js +1 -0
  221. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  222. package/lib/commonjs/renderer/Offscreen.d.ts +2 -0
  223. package/lib/commonjs/renderer/Offscreen.js +31 -0
  224. package/lib/commonjs/renderer/Offscreen.js.map +1 -0
  225. package/lib/commonjs/renderer/Reconciler.d.ts +13 -0
  226. package/lib/commonjs/renderer/Reconciler.js +0 -1
  227. package/lib/commonjs/renderer/Reconciler.js.map +1 -1
  228. package/lib/commonjs/renderer/components/Blend.d.ts +4 -0
  229. package/lib/commonjs/renderer/components/Drawing.d.ts +3 -0
  230. package/lib/commonjs/renderer/components/Group.d.ts +8 -0
  231. package/lib/commonjs/renderer/components/Mask.d.ts +9 -0
  232. package/lib/commonjs/renderer/components/Paint.d.ts +4 -0
  233. package/lib/commonjs/renderer/components/Picture.d.ts +4 -0
  234. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.d.ts +9 -0
  235. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.d.ts +7 -0
  236. package/lib/commonjs/renderer/components/backdrop/index.d.ts +2 -0
  237. package/lib/commonjs/renderer/components/colorFilters/BlendColor.d.ts +4 -0
  238. package/lib/commonjs/renderer/components/colorFilters/Lerp.d.ts +4 -0
  239. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +4 -0
  240. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.d.ts +4 -0
  241. package/lib/commonjs/renderer/components/colorFilters/Matrix.d.ts +5 -0
  242. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +4 -0
  243. package/lib/commonjs/renderer/components/colorFilters/index.d.ts +6 -0
  244. package/lib/commonjs/renderer/components/image/Image.d.ts +4 -0
  245. package/lib/commonjs/renderer/components/image/ImageSVG.d.ts +4 -0
  246. package/lib/commonjs/renderer/components/image/ImageShader.d.ts +4 -0
  247. package/lib/commonjs/renderer/components/image/index.d.ts +3 -0
  248. package/lib/commonjs/renderer/components/imageFilters/Blur.d.ts +4 -0
  249. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.d.ts +4 -0
  250. package/lib/commonjs/renderer/components/imageFilters/Morphology.d.ts +4 -0
  251. package/lib/commonjs/renderer/components/imageFilters/Offset.d.ts +4 -0
  252. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.d.ts +4 -0
  253. package/lib/commonjs/renderer/components/imageFilters/Shadow.d.ts +4 -0
  254. package/lib/commonjs/renderer/components/imageFilters/index.d.ts +6 -0
  255. package/lib/commonjs/renderer/components/index.d.ts +16 -0
  256. package/lib/commonjs/renderer/components/maskFilters/Blur.d.ts +4 -0
  257. package/lib/commonjs/renderer/components/maskFilters/index.d.ts +1 -0
  258. package/lib/commonjs/renderer/components/pathEffects/Corner.d.ts +4 -0
  259. package/lib/commonjs/renderer/components/pathEffects/Dash.d.ts +4 -0
  260. package/lib/commonjs/renderer/components/pathEffects/Discrete.d.ts +4 -0
  261. package/lib/commonjs/renderer/components/pathEffects/Line2D.d.ts +4 -0
  262. package/lib/commonjs/renderer/components/pathEffects/Path1D.d.ts +4 -0
  263. package/lib/commonjs/renderer/components/pathEffects/Path2D.d.ts +4 -0
  264. package/lib/commonjs/renderer/components/pathEffects/Sum.d.ts +3 -0
  265. package/lib/commonjs/renderer/components/pathEffects/index.d.ts +7 -0
  266. package/lib/commonjs/renderer/components/shaders/Color.d.ts +4 -0
  267. package/lib/commonjs/renderer/components/shaders/FractalNoise.d.ts +4 -0
  268. package/lib/commonjs/renderer/components/shaders/LinearGradient.d.ts +4 -0
  269. package/lib/commonjs/renderer/components/shaders/RadialGradient.d.ts +4 -0
  270. package/lib/commonjs/renderer/components/shaders/Shader.d.ts +4 -0
  271. package/lib/commonjs/renderer/components/shaders/ShaderLib.d.ts +4 -0
  272. package/lib/commonjs/renderer/components/shaders/SweepGradient.d.ts +4 -0
  273. package/lib/commonjs/renderer/components/shaders/Turbulence.d.ts +4 -0
  274. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.d.ts +4 -0
  275. package/lib/commonjs/renderer/components/shaders/index.d.ts +9 -0
  276. package/lib/commonjs/renderer/components/shapes/Box.d.ts +5 -0
  277. package/lib/commonjs/renderer/components/shapes/Circle.d.ts +4 -0
  278. package/lib/commonjs/renderer/components/shapes/DiffRect.d.ts +4 -0
  279. package/lib/commonjs/renderer/components/shapes/Fill.d.ts +4 -0
  280. package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +20 -0
  281. package/lib/commonjs/renderer/components/shapes/Line.d.ts +4 -0
  282. package/lib/commonjs/renderer/components/shapes/Oval.d.ts +4 -0
  283. package/lib/commonjs/renderer/components/shapes/Patch.d.ts +4 -0
  284. package/lib/commonjs/renderer/components/shapes/Path.d.ts +4 -0
  285. package/lib/commonjs/renderer/components/shapes/Points.d.ts +4 -0
  286. package/lib/commonjs/renderer/components/shapes/Rect.d.ts +4 -0
  287. package/lib/commonjs/renderer/components/shapes/RoundedRect.d.ts +4 -0
  288. package/lib/commonjs/renderer/components/shapes/Vertices.d.ts +4 -0
  289. package/lib/commonjs/renderer/components/shapes/index.d.ts +13 -0
  290. package/lib/commonjs/renderer/components/text/Glyphs.d.ts +4 -0
  291. package/lib/commonjs/renderer/components/text/Text.d.ts +4 -0
  292. package/lib/commonjs/renderer/components/text/TextBlob.d.ts +4 -0
  293. package/lib/commonjs/renderer/components/text/TextPath.d.ts +4 -0
  294. package/lib/commonjs/renderer/components/text/index.d.ts +4 -0
  295. package/lib/commonjs/renderer/index.d.ts +2 -0
  296. package/lib/commonjs/renderer/index.js +0 -13
  297. package/lib/commonjs/renderer/index.js.map +1 -1
  298. package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +17 -0
  299. package/lib/commonjs/renderer/processors/Animations/index.d.ts +1 -0
  300. package/lib/commonjs/renderer/processors/index.d.ts +2 -0
  301. package/lib/commonjs/renderer/processors/math/Coordinates.d.ts +29 -0
  302. package/lib/commonjs/renderer/processors/math/Math.d.ts +15 -0
  303. package/lib/commonjs/renderer/processors/math/Transforms.d.ts +5 -0
  304. package/lib/commonjs/renderer/processors/math/index.d.ts +3 -0
  305. package/lib/commonjs/renderer/typeddash.d.ts +3 -0
  306. package/lib/commonjs/skia/NativeSetup.d.ts +1 -0
  307. package/lib/commonjs/skia/Skia.d.ts +8 -0
  308. package/lib/commonjs/skia/Skia.web.d.ts +1 -0
  309. package/lib/commonjs/skia/core/Data.d.ts +3 -0
  310. package/lib/commonjs/skia/core/Font.d.ts +5 -0
  311. package/lib/commonjs/skia/core/Image.d.ts +5 -0
  312. package/lib/commonjs/skia/core/Matrix.d.ts +2 -0
  313. package/lib/commonjs/skia/core/Picture.d.ts +8 -0
  314. package/lib/commonjs/skia/core/RRect.d.ts +2 -0
  315. package/lib/commonjs/skia/core/Rect.d.ts +8 -0
  316. package/lib/commonjs/skia/core/SVG.d.ts +2 -0
  317. package/lib/commonjs/skia/core/Typeface.d.ts +5 -0
  318. package/lib/commonjs/skia/core/Vector.d.ts +12 -0
  319. package/lib/commonjs/skia/core/index.d.ts +10 -0
  320. package/lib/commonjs/skia/index.d.ts +3 -0
  321. package/lib/commonjs/skia/types/Canvas.d.ts +381 -0
  322. package/lib/commonjs/skia/types/Color.d.ts +2 -0
  323. package/lib/commonjs/skia/types/ColorFilter/ColorFilter.d.ts +3 -0
  324. package/lib/commonjs/skia/types/ColorFilter/ColorFilterFactory.d.ts +43 -0
  325. package/lib/commonjs/skia/types/ColorFilter/index.d.ts +2 -0
  326. package/lib/commonjs/skia/types/ContourMeasure.d.ts +41 -0
  327. package/lib/commonjs/skia/types/Data/Data.d.ts +12 -0
  328. package/lib/commonjs/skia/types/Data/DataFactory.d.ts +18 -0
  329. package/lib/commonjs/skia/types/Data/index.d.ts +2 -0
  330. package/lib/commonjs/skia/types/Font/Font.d.ts +180 -0
  331. package/lib/commonjs/skia/types/Font/index.d.ts +1 -0
  332. package/lib/commonjs/skia/types/Image/Image.d.ts +75 -0
  333. package/lib/commonjs/skia/types/Image/ImageFactory.d.ts +62 -0
  334. package/lib/commonjs/skia/types/Image/index.d.ts +2 -0
  335. package/lib/commonjs/skia/types/ImageFilter/ImageFilter.d.ts +23 -0
  336. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.d.ts +130 -0
  337. package/lib/commonjs/skia/types/ImageFilter/index.d.ts +2 -0
  338. package/lib/commonjs/skia/types/JsiInstance.d.ts +3 -0
  339. package/lib/commonjs/skia/types/MaskFilter.d.ts +21 -0
  340. package/lib/commonjs/skia/types/Matrix.d.ts +34 -0
  341. package/lib/commonjs/skia/types/Paint/BlendMode.d.ts +58 -0
  342. package/lib/commonjs/skia/types/Paint/Paint.d.ts +136 -0
  343. package/lib/commonjs/skia/types/Paint/index.d.ts +2 -0
  344. package/lib/commonjs/skia/types/Path/Path.d.ts +474 -0
  345. package/lib/commonjs/skia/types/Path/PathFactory.d.ts +29 -0
  346. package/lib/commonjs/skia/types/Path/index.d.ts +2 -0
  347. package/lib/commonjs/skia/types/PathEffect.d.ts +75 -0
  348. package/lib/commonjs/skia/types/Picture/Picture.d.ts +27 -0
  349. package/lib/commonjs/skia/types/Picture/PictureFactory.d.ts +8 -0
  350. package/lib/commonjs/skia/types/Picture/PictureRecorder.d.ts +15 -0
  351. package/lib/commonjs/skia/types/Picture/index.d.ts +3 -0
  352. package/lib/commonjs/skia/types/Point.d.ts +10 -0
  353. package/lib/commonjs/skia/types/RRect.d.ts +7 -0
  354. package/lib/commonjs/skia/types/RSXform.d.ts +2 -0
  355. package/lib/commonjs/skia/types/Rect.d.ts +6 -0
  356. package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.d.ts +52 -0
  357. package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffectFactory.d.ts +10 -0
  358. package/lib/commonjs/skia/types/RuntimeEffect/index.d.ts +2 -0
  359. package/lib/commonjs/skia/types/SVG/SVG.d.ts +2 -0
  360. package/lib/commonjs/skia/types/SVG/SVGFactory.d.ts +6 -0
  361. package/lib/commonjs/skia/types/SVG/index.d.ts +2 -0
  362. package/lib/commonjs/skia/types/Shader/Shader.d.ts +10 -0
  363. package/lib/commonjs/skia/types/Shader/ShaderFactory.d.ts +104 -0
  364. package/lib/commonjs/skia/types/Shader/index.d.ts +2 -0
  365. package/lib/commonjs/skia/types/Size.d.ts +4 -0
  366. package/lib/commonjs/skia/types/Skia.d.ts +66 -0
  367. package/lib/commonjs/skia/types/Surface/Surface.d.ts +29 -0
  368. package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
  369. package/lib/commonjs/skia/types/Surface/SurfaceFactory.d.ts +17 -0
  370. package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
  371. package/lib/commonjs/skia/types/Surface/index.d.ts +2 -0
  372. package/lib/commonjs/skia/types/TextBlob.d.ts +44 -0
  373. package/lib/commonjs/skia/types/Typeface/Typeface.d.ts +2 -0
  374. package/lib/commonjs/skia/types/Typeface/TypefaceFactory.d.ts +5 -0
  375. package/lib/commonjs/skia/types/Typeface/index.d.ts +2 -0
  376. package/lib/commonjs/skia/types/Vertices/Vertices.d.ts +17 -0
  377. package/lib/commonjs/skia/types/Vertices/index.d.ts +1 -0
  378. package/lib/commonjs/skia/types/index.d.ts +28 -0
  379. package/lib/commonjs/skia/web/Host.d.ts +19 -0
  380. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +44 -0
  381. package/lib/commonjs/skia/web/JsiSkColor.d.ts +2 -0
  382. package/lib/commonjs/skia/web/JsiSkColorFilter.d.ts +6 -0
  383. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.d.ts +14 -0
  384. package/lib/commonjs/skia/web/JsiSkContourMeasure.d.ts +12 -0
  385. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.d.ts +8 -0
  386. package/lib/commonjs/skia/web/JsiSkData.d.ts +8 -0
  387. package/lib/commonjs/skia/web/JsiSkDataFactory.d.ts +19 -0
  388. package/lib/commonjs/skia/web/JsiSkFont.d.ts +33 -0
  389. package/lib/commonjs/skia/web/JsiSkImage.d.ts +12 -0
  390. package/lib/commonjs/skia/web/JsiSkImageFactory.d.ts +10 -0
  391. package/lib/commonjs/skia/web/JsiSkImageFilter.d.ts +6 -0
  392. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +19 -0
  393. package/lib/commonjs/skia/web/JsiSkMaskFilter.d.ts +6 -0
  394. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.d.ts +9 -0
  395. package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +13 -0
  396. package/lib/commonjs/skia/web/JsiSkPaint.d.ts +28 -0
  397. package/lib/commonjs/skia/web/JsiSkPath.d.ts +57 -0
  398. package/lib/commonjs/skia/web/JsiSkPathEffect.d.ts +6 -0
  399. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.d.ts +15 -0
  400. package/lib/commonjs/skia/web/JsiSkPathFactory.d.ts +13 -0
  401. package/lib/commonjs/skia/web/JsiSkPicture.d.ts +9 -0
  402. package/lib/commonjs/skia/web/JsiSkPictureFactory.d.ts +8 -0
  403. package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +11 -0
  404. package/lib/commonjs/skia/web/JsiSkPoint.d.ts +9 -0
  405. package/lib/commonjs/skia/web/JsiSkRRect.d.ts +11 -0
  406. package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +7 -0
  407. package/lib/commonjs/skia/web/JsiSkRect.d.ts +11 -0
  408. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.d.ts +16 -0
  409. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.d.ts +8 -0
  410. package/lib/commonjs/skia/web/JsiSkSVGFactory.d.ts +9 -0
  411. package/lib/commonjs/skia/web/JsiSkShader.d.ts +6 -0
  412. package/lib/commonjs/skia/web/JsiSkShaderFactory.d.ts +16 -0
  413. package/lib/commonjs/skia/web/JsiSkSurface.d.ts +9 -0
  414. package/lib/commonjs/skia/web/JsiSkSurface.js +4 -0
  415. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  416. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.d.ts +9 -0
  417. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js +21 -1
  418. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  419. package/lib/commonjs/skia/web/JsiSkTextBlob.d.ts +6 -0
  420. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.d.ts +13 -0
  421. package/lib/commonjs/skia/web/JsiSkTypeface.d.ts +8 -0
  422. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.d.ts +8 -0
  423. package/lib/commonjs/skia/web/JsiSkVertices.d.ts +9 -0
  424. package/lib/commonjs/skia/web/JsiSkVerticesFactory.d.ts +4 -0
  425. package/lib/commonjs/skia/web/JsiSkia.d.ts +3 -0
  426. package/lib/commonjs/skia/web/index.d.ts +1 -0
  427. package/lib/commonjs/values/api.d.ts +5 -0
  428. package/lib/commonjs/values/api.web.d.ts +2 -0
  429. package/lib/commonjs/values/hooks/index.d.ts +4 -0
  430. package/lib/commonjs/values/hooks/useClockValue.d.ts +6 -0
  431. package/lib/commonjs/values/hooks/useComputedValue.d.ts +8 -0
  432. package/lib/commonjs/values/hooks/useValue.d.ts +7 -0
  433. package/lib/commonjs/values/hooks/useValueEffect.d.ts +7 -0
  434. package/lib/commonjs/values/index.d.ts +4 -0
  435. package/lib/commonjs/values/selector.d.ts +14 -0
  436. package/lib/commonjs/values/types.d.ts +63 -0
  437. package/lib/commonjs/values/web/RNSkAnimation.d.ts +9 -0
  438. package/lib/commonjs/values/web/RNSkClockValue.d.ts +13 -0
  439. package/lib/commonjs/values/web/RNSkComputedValue.d.ts +10 -0
  440. package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +12 -0
  441. package/lib/commonjs/values/web/RNSkValue.d.ts +14 -0
  442. package/lib/commonjs/values/web/api.d.ts +2 -0
  443. package/lib/commonjs/values/web/index.d.ts +1 -0
  444. package/lib/commonjs/views/SkiaBaseWebView.d.ts +62 -0
  445. package/lib/commonjs/views/SkiaBaseWebView.js +6 -4
  446. package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
  447. package/lib/commonjs/views/SkiaDomView.d.ts +31 -0
  448. package/lib/commonjs/views/SkiaDomView.web.d.ts +7 -0
  449. package/lib/commonjs/views/SkiaDomView.web.js +3 -14
  450. package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
  451. package/lib/commonjs/views/SkiaPictureView.d.ts +27 -0
  452. package/lib/commonjs/views/SkiaPictureView.web.d.ts +7 -0
  453. package/lib/commonjs/views/SkiaPictureView.web.js +0 -7
  454. package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -1
  455. package/lib/commonjs/views/SkiaView.d.ts +30 -0
  456. package/lib/commonjs/views/SkiaView.web.d.ts +7 -0
  457. package/lib/commonjs/views/SkiaView.web.js +0 -7
  458. package/lib/commonjs/views/SkiaView.web.js.map +1 -1
  459. package/lib/commonjs/views/api.d.ts +5 -0
  460. package/lib/commonjs/views/index.d.ts +6 -0
  461. package/lib/commonjs/views/types.d.ts +91 -0
  462. package/lib/commonjs/views/useDrawCallback.d.ts +8 -0
  463. package/lib/commonjs/views/useTouchHandler.d.ts +22 -0
  464. package/lib/commonjs/web/LoadSkiaWeb.d.ts +6 -0
  465. package/lib/commonjs/web/WithSkiaWeb.d.ts +12 -0
  466. package/lib/commonjs/web/index.d.ts +2 -0
  467. package/lib/module/animation/decay/decay.d.ts +2 -0
  468. package/lib/module/animation/decay/index.d.ts +1 -0
  469. package/lib/module/animation/decay/runDecay.d.ts +10 -0
  470. package/lib/module/animation/decay/types.d.ts +21 -0
  471. package/lib/module/animation/functions/index.d.ts +4 -0
  472. package/lib/module/animation/functions/interpolate.d.ts +17 -0
  473. package/lib/module/animation/functions/interpolateColors.d.ts +3 -0
  474. package/lib/module/animation/functions/interpolatePaths.d.ts +19 -0
  475. package/lib/module/animation/functions/interpolateVector.d.ts +10 -0
  476. package/lib/module/animation/index.d.ts +4 -0
  477. package/lib/module/animation/spring/Spring.d.ts +65 -0
  478. package/lib/module/animation/spring/functions/index.d.ts +1 -0
  479. package/lib/module/animation/spring/functions/spring.d.ts +10 -0
  480. package/lib/module/animation/spring/index.d.ts +3 -0
  481. package/lib/module/animation/spring/runSpring.d.ts +16 -0
  482. package/lib/module/animation/spring/types.d.ts +6 -0
  483. package/lib/module/animation/spring/useSpring.d.ts +10 -0
  484. package/lib/module/animation/timing/Easing.d.ts +19 -0
  485. package/lib/module/animation/timing/createTiming.d.ts +17 -0
  486. package/lib/module/animation/timing/functions/bezier.d.ts +1 -0
  487. package/lib/module/animation/timing/functions/getResolvedParams.d.ts +7 -0
  488. package/lib/module/animation/timing/functions/index.d.ts +4 -0
  489. package/lib/module/animation/timing/functions/timing.d.ts +17 -0
  490. package/lib/module/animation/timing/functions/types.d.ts +7 -0
  491. package/lib/module/animation/timing/index.d.ts +4 -0
  492. package/lib/module/animation/timing/runTiming.d.ts +16 -0
  493. package/lib/module/animation/timing/useLoop.d.ts +8 -0
  494. package/lib/module/animation/timing/useTiming.d.ts +10 -0
  495. package/lib/module/animation/types.d.ts +18 -0
  496. package/lib/module/dom/nodes/DrawingNode.d.ts +14 -0
  497. package/lib/module/dom/nodes/DrawingNode.js +5 -1
  498. package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
  499. package/lib/module/dom/nodes/GroupNode.d.ts +7 -0
  500. package/lib/module/dom/nodes/JsiSkDOM.d.ts +64 -0
  501. package/lib/module/dom/nodes/LayerNode.d.ts +8 -0
  502. package/lib/module/dom/nodes/LayerNode.js +13 -7
  503. package/lib/module/dom/nodes/LayerNode.js.map +1 -1
  504. package/lib/module/dom/nodes/Node.d.ts +38 -0
  505. package/lib/module/dom/nodes/Node.js +8 -25
  506. package/lib/module/dom/nodes/Node.js.map +1 -1
  507. package/lib/module/dom/nodes/PaintContext.d.ts +18 -0
  508. package/lib/module/dom/nodes/PaintContext.js.map +1 -1
  509. package/lib/module/dom/nodes/PaintNode.d.ts +8 -0
  510. package/lib/module/dom/nodes/PaintNode.js +32 -15
  511. package/lib/module/dom/nodes/PaintNode.js.map +1 -1
  512. package/lib/module/dom/nodes/RenderNode.d.ts +26 -0
  513. package/lib/module/dom/nodes/RenderNode.js +20 -187
  514. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  515. package/lib/module/dom/nodes/datatypes/Circle.d.ts +7 -0
  516. package/lib/module/dom/nodes/datatypes/Enum.d.ts +1 -0
  517. package/lib/module/dom/nodes/datatypes/Fitting.d.ts +33 -0
  518. package/lib/module/dom/nodes/datatypes/Gradient.d.ts +92 -0
  519. package/lib/module/dom/nodes/datatypes/Path.d.ts +4 -0
  520. package/lib/module/dom/nodes/datatypes/Radius.d.ts +3 -0
  521. package/lib/module/dom/nodes/datatypes/Rect.d.ts +5 -0
  522. package/lib/module/dom/nodes/datatypes/Transform.d.ts +3 -0
  523. package/lib/module/dom/nodes/datatypes/index.d.ts +8 -0
  524. package/lib/module/dom/nodes/drawings/BackdropFilterNode.d.ts +8 -0
  525. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +23 -4
  526. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
  527. package/lib/module/dom/nodes/drawings/Box.d.ts +15 -0
  528. package/lib/module/dom/nodes/drawings/Box.js +3 -0
  529. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  530. package/lib/module/dom/nodes/drawings/CircleNode.d.ts +9 -0
  531. package/lib/module/dom/nodes/drawings/CustomDrawingNode.d.ts +8 -0
  532. package/lib/module/dom/nodes/drawings/DiffRectNode.d.ts +8 -0
  533. package/lib/module/dom/nodes/drawings/FillNode.d.ts +8 -0
  534. package/lib/module/dom/nodes/drawings/ImageNode.d.ts +25 -0
  535. package/lib/module/dom/nodes/drawings/ImageSVG.d.ts +8 -0
  536. package/lib/module/dom/nodes/drawings/LineNode.d.ts +8 -0
  537. package/lib/module/dom/nodes/drawings/OvalNode.d.ts +9 -0
  538. package/lib/module/dom/nodes/drawings/PatchNode.d.ts +18 -0
  539. package/lib/module/dom/nodes/drawings/PathNode.d.ts +9 -0
  540. package/lib/module/dom/nodes/drawings/PictureNode.d.ts +8 -0
  541. package/lib/module/dom/nodes/drawings/PointsNode.d.ts +8 -0
  542. package/lib/module/dom/nodes/drawings/RRectNode.d.ts +10 -0
  543. package/lib/module/dom/nodes/drawings/RectNode.d.ts +9 -0
  544. package/lib/module/dom/nodes/drawings/Text.d.ts +30 -0
  545. package/lib/module/dom/nodes/drawings/VerticesNode.d.ts +9 -0
  546. package/lib/module/dom/nodes/drawings/index.d.ts +18 -0
  547. package/lib/module/dom/nodes/index.d.ts +3 -0
  548. package/lib/module/dom/nodes/paint/BlendNode.d.ts +8 -0
  549. package/lib/module/dom/nodes/paint/BlendNode.js +15 -46
  550. package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -1
  551. package/lib/module/dom/nodes/paint/ColorFilters.d.ts +35 -0
  552. package/lib/module/dom/nodes/paint/ColorFilters.js +29 -43
  553. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
  554. package/lib/module/dom/nodes/paint/ImageFilters.d.ts +42 -0
  555. package/lib/module/dom/nodes/paint/ImageFilters.js +48 -41
  556. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
  557. package/lib/module/dom/nodes/paint/MaskFilters.d.ts +8 -0
  558. package/lib/module/dom/nodes/paint/MaskFilters.js +3 -2
  559. package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -1
  560. package/lib/module/dom/nodes/paint/PathEffects.d.ts +39 -0
  561. package/lib/module/dom/nodes/paint/PathEffects.js +29 -72
  562. package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -1
  563. package/lib/module/dom/nodes/paint/Shaders.d.ts +43 -0
  564. package/lib/module/dom/nodes/paint/Shaders.js +28 -18
  565. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
  566. package/lib/module/dom/nodes/paint/index.d.ts +6 -0
  567. package/lib/module/dom/types/ColorFilters.d.ts +12 -0
  568. package/lib/module/dom/types/Common.d.ts +56 -0
  569. package/lib/module/dom/types/DeclarationContext.d.ts +29 -0
  570. package/lib/module/dom/types/DeclarationContext.js +107 -0
  571. package/lib/module/dom/types/DeclarationContext.js.map +1 -0
  572. package/lib/module/dom/types/DrawingContext.d.ts +22 -0
  573. package/lib/module/dom/types/DrawingContext.js +322 -1
  574. package/lib/module/dom/types/DrawingContext.js.map +1 -1
  575. package/lib/module/dom/types/Drawings.d.ts +104 -0
  576. package/lib/module/dom/types/ImageFilters.d.ts +37 -0
  577. package/lib/module/dom/types/MaskFilters.d.ts +7 -0
  578. package/lib/module/dom/types/Node.d.ts +23 -0
  579. package/lib/module/dom/types/Node.js.map +1 -1
  580. package/lib/module/dom/types/NodeType.d.ts +67 -0
  581. package/lib/module/dom/types/PathEffects.d.ts +28 -0
  582. package/lib/module/dom/types/Shaders.d.ts +59 -0
  583. package/lib/module/dom/types/SkDOM.d.ts +71 -0
  584. package/lib/module/dom/types/SkDOM.js.map +1 -1
  585. package/lib/module/dom/types/index.d.ts +12 -0
  586. package/lib/module/dom/types/index.js +1 -0
  587. package/lib/module/dom/types/index.js.map +1 -1
  588. package/lib/module/external/index.d.ts +1 -0
  589. package/lib/module/external/reanimated/index.d.ts +1 -0
  590. package/lib/module/external/reanimated/useSharedValueEffect.d.ts +11 -0
  591. package/lib/module/index.d.ts +11 -0
  592. package/lib/module/index.js +1 -0
  593. package/lib/module/index.js.map +1 -1
  594. package/lib/module/mock/index.d.ts +16 -0
  595. package/lib/module/renderer/Canvas.d.ts +11 -0
  596. package/lib/module/renderer/Canvas.js +3 -3
  597. package/lib/module/renderer/Canvas.js.map +1 -1
  598. package/lib/module/renderer/Container.d.ts +12 -0
  599. package/lib/module/renderer/DependencyManager.d.ts +46 -0
  600. package/lib/module/renderer/DrawingContext.d.ts +7 -0
  601. package/lib/module/renderer/DrawingContext.js.map +1 -1
  602. package/lib/module/renderer/HostComponents.d.ts +132 -0
  603. package/lib/module/renderer/HostComponents.js.map +1 -1
  604. package/lib/module/renderer/HostConfig.d.ts +19 -0
  605. package/lib/module/renderer/HostConfig.js +1 -0
  606. package/lib/module/renderer/HostConfig.js.map +1 -1
  607. package/lib/module/renderer/Offscreen.d.ts +2 -0
  608. package/lib/module/renderer/Offscreen.js +19 -0
  609. package/lib/module/renderer/Offscreen.js.map +1 -0
  610. package/lib/module/renderer/Reconciler.d.ts +13 -0
  611. package/lib/module/renderer/Reconciler.js +0 -1
  612. package/lib/module/renderer/Reconciler.js.map +1 -1
  613. package/lib/module/renderer/components/Blend.d.ts +4 -0
  614. package/lib/module/renderer/components/Drawing.d.ts +3 -0
  615. package/lib/module/renderer/components/Group.d.ts +8 -0
  616. package/lib/module/renderer/components/Mask.d.ts +9 -0
  617. package/lib/module/renderer/components/Paint.d.ts +4 -0
  618. package/lib/module/renderer/components/Picture.d.ts +4 -0
  619. package/lib/module/renderer/components/backdrop/BackdropBlur.d.ts +9 -0
  620. package/lib/module/renderer/components/backdrop/BackdropFilter.d.ts +7 -0
  621. package/lib/module/renderer/components/backdrop/index.d.ts +2 -0
  622. package/lib/module/renderer/components/colorFilters/BlendColor.d.ts +4 -0
  623. package/lib/module/renderer/components/colorFilters/Lerp.d.ts +4 -0
  624. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +4 -0
  625. package/lib/module/renderer/components/colorFilters/LumaColorFilter.d.ts +4 -0
  626. package/lib/module/renderer/components/colorFilters/Matrix.d.ts +5 -0
  627. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +4 -0
  628. package/lib/module/renderer/components/colorFilters/index.d.ts +6 -0
  629. package/lib/module/renderer/components/image/Image.d.ts +4 -0
  630. package/lib/module/renderer/components/image/ImageSVG.d.ts +4 -0
  631. package/lib/module/renderer/components/image/ImageShader.d.ts +4 -0
  632. package/lib/module/renderer/components/image/index.d.ts +3 -0
  633. package/lib/module/renderer/components/imageFilters/Blur.d.ts +4 -0
  634. package/lib/module/renderer/components/imageFilters/DisplacementMap.d.ts +4 -0
  635. package/lib/module/renderer/components/imageFilters/Morphology.d.ts +4 -0
  636. package/lib/module/renderer/components/imageFilters/Offset.d.ts +4 -0
  637. package/lib/module/renderer/components/imageFilters/RuntimeShader.d.ts +4 -0
  638. package/lib/module/renderer/components/imageFilters/Shadow.d.ts +4 -0
  639. package/lib/module/renderer/components/imageFilters/index.d.ts +6 -0
  640. package/lib/module/renderer/components/index.d.ts +16 -0
  641. package/lib/module/renderer/components/maskFilters/Blur.d.ts +4 -0
  642. package/lib/module/renderer/components/maskFilters/index.d.ts +1 -0
  643. package/lib/module/renderer/components/pathEffects/Corner.d.ts +4 -0
  644. package/lib/module/renderer/components/pathEffects/Dash.d.ts +4 -0
  645. package/lib/module/renderer/components/pathEffects/Discrete.d.ts +4 -0
  646. package/lib/module/renderer/components/pathEffects/Line2D.d.ts +4 -0
  647. package/lib/module/renderer/components/pathEffects/Path1D.d.ts +4 -0
  648. package/lib/module/renderer/components/pathEffects/Path2D.d.ts +4 -0
  649. package/lib/module/renderer/components/pathEffects/Sum.d.ts +3 -0
  650. package/lib/module/renderer/components/pathEffects/index.d.ts +7 -0
  651. package/lib/module/renderer/components/shaders/Color.d.ts +4 -0
  652. package/lib/module/renderer/components/shaders/FractalNoise.d.ts +4 -0
  653. package/lib/module/renderer/components/shaders/LinearGradient.d.ts +4 -0
  654. package/lib/module/renderer/components/shaders/RadialGradient.d.ts +4 -0
  655. package/lib/module/renderer/components/shaders/Shader.d.ts +4 -0
  656. package/lib/module/renderer/components/shaders/ShaderLib.d.ts +4 -0
  657. package/lib/module/renderer/components/shaders/SweepGradient.d.ts +4 -0
  658. package/lib/module/renderer/components/shaders/Turbulence.d.ts +4 -0
  659. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.d.ts +4 -0
  660. package/lib/module/renderer/components/shaders/index.d.ts +9 -0
  661. package/lib/module/renderer/components/shapes/Box.d.ts +5 -0
  662. package/lib/module/renderer/components/shapes/Circle.d.ts +4 -0
  663. package/lib/module/renderer/components/shapes/DiffRect.d.ts +4 -0
  664. package/lib/module/renderer/components/shapes/Fill.d.ts +4 -0
  665. package/lib/module/renderer/components/shapes/FitBox.d.ts +20 -0
  666. package/lib/module/renderer/components/shapes/Line.d.ts +4 -0
  667. package/lib/module/renderer/components/shapes/Oval.d.ts +4 -0
  668. package/lib/module/renderer/components/shapes/Patch.d.ts +4 -0
  669. package/lib/module/renderer/components/shapes/Path.d.ts +4 -0
  670. package/lib/module/renderer/components/shapes/Points.d.ts +4 -0
  671. package/lib/module/renderer/components/shapes/Rect.d.ts +4 -0
  672. package/lib/module/renderer/components/shapes/RoundedRect.d.ts +4 -0
  673. package/lib/module/renderer/components/shapes/Vertices.d.ts +4 -0
  674. package/lib/module/renderer/components/shapes/index.d.ts +13 -0
  675. package/lib/module/renderer/components/text/Glyphs.d.ts +4 -0
  676. package/lib/module/renderer/components/text/Text.d.ts +4 -0
  677. package/lib/module/renderer/components/text/TextBlob.d.ts +4 -0
  678. package/lib/module/renderer/components/text/TextPath.d.ts +4 -0
  679. package/lib/module/renderer/components/text/index.d.ts +4 -0
  680. package/lib/module/renderer/index.d.ts +2 -0
  681. package/lib/module/renderer/index.js +0 -1
  682. package/lib/module/renderer/index.js.map +1 -1
  683. package/lib/module/renderer/processors/Animations/Animations.d.ts +17 -0
  684. package/lib/module/renderer/processors/Animations/index.d.ts +1 -0
  685. package/lib/module/renderer/processors/index.d.ts +2 -0
  686. package/lib/module/renderer/processors/math/Coordinates.d.ts +29 -0
  687. package/lib/module/renderer/processors/math/Math.d.ts +15 -0
  688. package/lib/module/renderer/processors/math/Transforms.d.ts +5 -0
  689. package/lib/module/renderer/processors/math/index.d.ts +3 -0
  690. package/lib/module/renderer/typeddash.d.ts +3 -0
  691. package/lib/module/skia/NativeSetup.d.ts +1 -0
  692. package/lib/module/skia/Skia.d.ts +8 -0
  693. package/lib/module/skia/Skia.web.d.ts +1 -0
  694. package/lib/module/skia/core/Data.d.ts +3 -0
  695. package/lib/module/skia/core/Font.d.ts +5 -0
  696. package/lib/module/skia/core/Image.d.ts +5 -0
  697. package/lib/module/skia/core/Matrix.d.ts +2 -0
  698. package/lib/module/skia/core/Picture.d.ts +8 -0
  699. package/lib/module/skia/core/RRect.d.ts +2 -0
  700. package/lib/module/skia/core/Rect.d.ts +8 -0
  701. package/lib/module/skia/core/SVG.d.ts +2 -0
  702. package/lib/module/skia/core/Typeface.d.ts +5 -0
  703. package/lib/module/skia/core/Vector.d.ts +12 -0
  704. package/lib/module/skia/core/index.d.ts +10 -0
  705. package/lib/module/skia/index.d.ts +3 -0
  706. package/lib/module/skia/types/Canvas.d.ts +381 -0
  707. package/lib/module/skia/types/Color.d.ts +2 -0
  708. package/lib/module/skia/types/ColorFilter/ColorFilter.d.ts +3 -0
  709. package/lib/module/skia/types/ColorFilter/ColorFilterFactory.d.ts +43 -0
  710. package/lib/module/skia/types/ColorFilter/index.d.ts +2 -0
  711. package/lib/module/skia/types/ContourMeasure.d.ts +41 -0
  712. package/lib/module/skia/types/Data/Data.d.ts +12 -0
  713. package/lib/module/skia/types/Data/DataFactory.d.ts +18 -0
  714. package/lib/module/skia/types/Data/index.d.ts +2 -0
  715. package/lib/module/skia/types/Font/Font.d.ts +180 -0
  716. package/lib/module/skia/types/Font/index.d.ts +1 -0
  717. package/lib/module/skia/types/Image/Image.d.ts +75 -0
  718. package/lib/module/skia/types/Image/ImageFactory.d.ts +62 -0
  719. package/lib/module/skia/types/Image/index.d.ts +2 -0
  720. package/lib/module/skia/types/ImageFilter/ImageFilter.d.ts +23 -0
  721. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.d.ts +130 -0
  722. package/lib/module/skia/types/ImageFilter/index.d.ts +2 -0
  723. package/lib/module/skia/types/JsiInstance.d.ts +3 -0
  724. package/lib/module/skia/types/MaskFilter.d.ts +21 -0
  725. package/lib/module/skia/types/Matrix.d.ts +34 -0
  726. package/lib/module/skia/types/Paint/BlendMode.d.ts +58 -0
  727. package/lib/module/skia/types/Paint/Paint.d.ts +136 -0
  728. package/lib/module/skia/types/Paint/index.d.ts +2 -0
  729. package/lib/module/skia/types/Path/Path.d.ts +474 -0
  730. package/lib/module/skia/types/Path/PathFactory.d.ts +29 -0
  731. package/lib/module/skia/types/Path/index.d.ts +2 -0
  732. package/lib/module/skia/types/PathEffect.d.ts +75 -0
  733. package/lib/module/skia/types/Picture/Picture.d.ts +27 -0
  734. package/lib/module/skia/types/Picture/PictureFactory.d.ts +8 -0
  735. package/lib/module/skia/types/Picture/PictureRecorder.d.ts +15 -0
  736. package/lib/module/skia/types/Picture/index.d.ts +3 -0
  737. package/lib/module/skia/types/Point.d.ts +10 -0
  738. package/lib/module/skia/types/RRect.d.ts +7 -0
  739. package/lib/module/skia/types/RSXform.d.ts +2 -0
  740. package/lib/module/skia/types/Rect.d.ts +6 -0
  741. package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.d.ts +52 -0
  742. package/lib/module/skia/types/RuntimeEffect/RuntimeEffectFactory.d.ts +10 -0
  743. package/lib/module/skia/types/RuntimeEffect/index.d.ts +2 -0
  744. package/lib/module/skia/types/SVG/SVG.d.ts +2 -0
  745. package/lib/module/skia/types/SVG/SVGFactory.d.ts +6 -0
  746. package/lib/module/skia/types/SVG/index.d.ts +2 -0
  747. package/lib/module/skia/types/Shader/Shader.d.ts +10 -0
  748. package/lib/module/skia/types/Shader/ShaderFactory.d.ts +104 -0
  749. package/lib/module/skia/types/Shader/index.d.ts +2 -0
  750. package/lib/module/skia/types/Size.d.ts +4 -0
  751. package/lib/module/skia/types/Skia.d.ts +66 -0
  752. package/lib/module/skia/types/Surface/Surface.d.ts +29 -0
  753. package/lib/module/skia/types/Surface/Surface.js.map +1 -1
  754. package/lib/module/skia/types/Surface/SurfaceFactory.d.ts +17 -0
  755. package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
  756. package/lib/module/skia/types/Surface/index.d.ts +2 -0
  757. package/lib/module/skia/types/TextBlob.d.ts +44 -0
  758. package/lib/module/skia/types/Typeface/Typeface.d.ts +2 -0
  759. package/lib/module/skia/types/Typeface/TypefaceFactory.d.ts +5 -0
  760. package/lib/module/skia/types/Typeface/index.d.ts +2 -0
  761. package/lib/module/skia/types/Vertices/Vertices.d.ts +17 -0
  762. package/lib/module/skia/types/Vertices/index.d.ts +1 -0
  763. package/lib/module/skia/types/index.d.ts +28 -0
  764. package/lib/module/skia/web/Host.d.ts +19 -0
  765. package/lib/module/skia/web/JsiSkCanvas.d.ts +44 -0
  766. package/lib/module/skia/web/JsiSkColor.d.ts +2 -0
  767. package/lib/module/skia/web/JsiSkColorFilter.d.ts +6 -0
  768. package/lib/module/skia/web/JsiSkColorFilterFactory.d.ts +14 -0
  769. package/lib/module/skia/web/JsiSkContourMeasure.d.ts +12 -0
  770. package/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +8 -0
  771. package/lib/module/skia/web/JsiSkData.d.ts +8 -0
  772. package/lib/module/skia/web/JsiSkDataFactory.d.ts +19 -0
  773. package/lib/module/skia/web/JsiSkFont.d.ts +33 -0
  774. package/lib/module/skia/web/JsiSkImage.d.ts +12 -0
  775. package/lib/module/skia/web/JsiSkImageFactory.d.ts +10 -0
  776. package/lib/module/skia/web/JsiSkImageFilter.d.ts +6 -0
  777. package/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +19 -0
  778. package/lib/module/skia/web/JsiSkMaskFilter.d.ts +6 -0
  779. package/lib/module/skia/web/JsiSkMaskFilterFactory.d.ts +9 -0
  780. package/lib/module/skia/web/JsiSkMatrix.d.ts +13 -0
  781. package/lib/module/skia/web/JsiSkPaint.d.ts +28 -0
  782. package/lib/module/skia/web/JsiSkPath.d.ts +57 -0
  783. package/lib/module/skia/web/JsiSkPathEffect.d.ts +6 -0
  784. package/lib/module/skia/web/JsiSkPathEffectFactory.d.ts +15 -0
  785. package/lib/module/skia/web/JsiSkPathFactory.d.ts +13 -0
  786. package/lib/module/skia/web/JsiSkPicture.d.ts +9 -0
  787. package/lib/module/skia/web/JsiSkPictureFactory.d.ts +8 -0
  788. package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +11 -0
  789. package/lib/module/skia/web/JsiSkPoint.d.ts +9 -0
  790. package/lib/module/skia/web/JsiSkRRect.d.ts +11 -0
  791. package/lib/module/skia/web/JsiSkRSXform.d.ts +7 -0
  792. package/lib/module/skia/web/JsiSkRect.d.ts +11 -0
  793. package/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +16 -0
  794. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.d.ts +8 -0
  795. package/lib/module/skia/web/JsiSkSVGFactory.d.ts +9 -0
  796. package/lib/module/skia/web/JsiSkShader.d.ts +6 -0
  797. package/lib/module/skia/web/JsiSkShaderFactory.d.ts +16 -0
  798. package/lib/module/skia/web/JsiSkSurface.d.ts +9 -0
  799. package/lib/module/skia/web/JsiSkSurface.js +4 -0
  800. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  801. package/lib/module/skia/web/JsiSkSurfaceFactory.d.ts +9 -0
  802. package/lib/module/skia/web/JsiSkSurfaceFactory.js +21 -1
  803. package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  804. package/lib/module/skia/web/JsiSkTextBlob.d.ts +6 -0
  805. package/lib/module/skia/web/JsiSkTextBlobFactory.d.ts +13 -0
  806. package/lib/module/skia/web/JsiSkTypeface.d.ts +8 -0
  807. package/lib/module/skia/web/JsiSkTypefaceFactory.d.ts +8 -0
  808. package/lib/module/skia/web/JsiSkVertices.d.ts +9 -0
  809. package/lib/module/skia/web/JsiSkVerticesFactory.d.ts +4 -0
  810. package/lib/module/skia/web/JsiSkia.d.ts +3 -0
  811. package/lib/module/skia/web/index.d.ts +1 -0
  812. package/lib/module/values/api.d.ts +5 -0
  813. package/lib/module/values/api.web.d.ts +2 -0
  814. package/lib/module/values/hooks/index.d.ts +4 -0
  815. package/lib/module/values/hooks/useClockValue.d.ts +6 -0
  816. package/lib/module/values/hooks/useComputedValue.d.ts +8 -0
  817. package/lib/module/values/hooks/useValue.d.ts +7 -0
  818. package/lib/module/values/hooks/useValueEffect.d.ts +7 -0
  819. package/lib/module/values/index.d.ts +4 -0
  820. package/lib/module/values/selector.d.ts +14 -0
  821. package/lib/module/values/types.d.ts +63 -0
  822. package/lib/module/values/web/RNSkAnimation.d.ts +9 -0
  823. package/lib/module/values/web/RNSkClockValue.d.ts +13 -0
  824. package/lib/module/values/web/RNSkComputedValue.d.ts +10 -0
  825. package/lib/module/values/web/RNSkReadonlyValue.d.ts +12 -0
  826. package/lib/module/values/web/RNSkValue.d.ts +14 -0
  827. package/lib/module/values/web/api.d.ts +2 -0
  828. package/lib/module/values/web/index.d.ts +1 -0
  829. package/lib/module/views/SkiaBaseWebView.d.ts +62 -0
  830. package/lib/module/views/SkiaBaseWebView.js +6 -4
  831. package/lib/module/views/SkiaBaseWebView.js.map +1 -1
  832. package/lib/module/views/SkiaDomView.d.ts +31 -0
  833. package/lib/module/views/SkiaDomView.web.d.ts +7 -0
  834. package/lib/module/views/SkiaDomView.web.js +2 -11
  835. package/lib/module/views/SkiaDomView.web.js.map +1 -1
  836. package/lib/module/views/SkiaPictureView.d.ts +27 -0
  837. package/lib/module/views/SkiaPictureView.web.d.ts +7 -0
  838. package/lib/module/views/SkiaPictureView.web.js +0 -5
  839. package/lib/module/views/SkiaPictureView.web.js.map +1 -1
  840. package/lib/module/views/SkiaView.d.ts +30 -0
  841. package/lib/module/views/SkiaView.web.d.ts +7 -0
  842. package/lib/module/views/SkiaView.web.js +0 -5
  843. package/lib/module/views/SkiaView.web.js.map +1 -1
  844. package/lib/module/views/api.d.ts +5 -0
  845. package/lib/module/views/index.d.ts +6 -0
  846. package/lib/module/views/types.d.ts +91 -0
  847. package/lib/module/views/useDrawCallback.d.ts +8 -0
  848. package/lib/module/views/useTouchHandler.d.ts +22 -0
  849. package/lib/module/web/LoadSkiaWeb.d.ts +6 -0
  850. package/lib/module/web/WithSkiaWeb.d.ts +12 -0
  851. package/lib/module/web/index.d.ts +2 -0
  852. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +33 -34
  853. package/lib/typescript/src/dom/nodes/Node.d.ts +6 -11
  854. package/lib/typescript/src/dom/nodes/PaintNode.d.ts +3 -3
  855. package/lib/typescript/src/dom/nodes/RenderNode.d.ts +2 -3
  856. package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +1 -1
  857. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +3 -1
  858. package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +3 -7
  859. package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +10 -11
  860. package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +11 -11
  861. package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +3 -3
  862. package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +15 -18
  863. package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +11 -12
  864. package/lib/typescript/src/dom/types/DeclarationContext.d.ts +29 -0
  865. package/lib/typescript/src/dom/types/DrawingContext.d.ts +18 -1
  866. package/lib/typescript/src/dom/types/Node.d.ts +4 -10
  867. package/lib/typescript/src/dom/types/SkDOM.d.ts +22 -23
  868. package/lib/typescript/src/dom/types/index.d.ts +1 -0
  869. package/lib/typescript/src/index.d.ts +1 -0
  870. package/lib/typescript/src/renderer/DrawingContext.d.ts +4 -3
  871. package/lib/typescript/src/renderer/HostComponents.d.ts +35 -35
  872. package/lib/typescript/src/renderer/Offscreen.d.ts +2 -0
  873. package/lib/typescript/src/renderer/index.d.ts +0 -1
  874. package/lib/typescript/src/skia/types/Surface/Surface.d.ts +4 -0
  875. package/lib/typescript/src/skia/types/Surface/SurfaceFactory.d.ts +6 -0
  876. package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -0
  877. package/lib/typescript/src/skia/web/JsiSkSurfaceFactory.d.ts +2 -1
  878. package/package.json +5 -4
  879. package/src/dom/nodes/DrawingNode.ts +5 -1
  880. package/src/dom/nodes/LayerNode.ts +13 -11
  881. package/src/dom/nodes/Node.ts +18 -41
  882. package/src/dom/nodes/PaintContext.ts +1 -0
  883. package/src/dom/nodes/PaintNode.ts +28 -18
  884. package/src/dom/nodes/RenderNode.ts +25 -183
  885. package/src/dom/nodes/drawings/BackdropFilterNode.ts +18 -11
  886. package/src/dom/nodes/drawings/Box.ts +6 -4
  887. package/src/dom/nodes/paint/BlendNode.ts +16 -63
  888. package/src/dom/nodes/paint/ColorFilters.ts +32 -55
  889. package/src/dom/nodes/paint/ImageFilters.ts +58 -53
  890. package/src/dom/nodes/paint/MaskFilters.ts +5 -7
  891. package/src/dom/nodes/paint/PathEffects.ts +37 -90
  892. package/src/dom/nodes/paint/Shaders.ts +31 -29
  893. package/src/dom/types/DeclarationContext.ts +105 -0
  894. package/src/dom/types/DrawingContext.ts +304 -1
  895. package/src/dom/types/Node.ts +4 -20
  896. package/src/dom/types/SkDOM.ts +22 -43
  897. package/src/dom/types/index.ts +1 -0
  898. package/src/index.ts +1 -0
  899. package/src/renderer/Canvas.tsx +3 -3
  900. package/src/renderer/DrawingContext.ts +4 -5
  901. package/src/renderer/HostComponents.ts +34 -53
  902. package/src/renderer/HostConfig.ts +1 -0
  903. package/src/renderer/Offscreen.tsx +24 -0
  904. package/src/renderer/Reconciler.tsx +0 -1
  905. package/src/renderer/index.ts +0 -1
  906. package/src/skia/types/Surface/Surface.ts +5 -0
  907. package/src/skia/types/Surface/SurfaceFactory.ts +7 -0
  908. package/src/skia/web/JsiSkSurface.ts +4 -0
  909. package/src/skia/web/JsiSkSurfaceFactory.ts +21 -2
  910. package/src/views/SkiaBaseWebView.tsx +6 -2
  911. package/src/views/SkiaDomView.web.tsx +2 -13
  912. package/src/views/SkiaPictureView.web.tsx +0 -7
  913. package/src/views/SkiaView.web.tsx +0 -7
  914. package/lib/commonjs/renderer/useContextBridge.js +0 -35
  915. package/lib/commonjs/renderer/useContextBridge.js.map +0 -1
  916. package/lib/module/renderer/useContextBridge.js +0 -21
  917. package/lib/module/renderer/useContextBridge.js.map +0 -1
  918. package/lib/typescript/src/renderer/useContextBridge.d.ts +0 -5
  919. package/src/renderer/useContextBridge.tsx +0 -21
@@ -11,8 +11,6 @@ var _datatypes = require("./datatypes");
11
11
 
12
12
  var _Node = require("./Node");
13
13
 
14
- var _Enum = require("./datatypes/Enum");
15
-
16
14
  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; }
17
15
 
18
16
  const paintProps = ["color", "strokeWidth", "blendMode", "strokeCap", "strokeJoin", "strokeMiter", "style", "antiAlias", "opacity"];
@@ -38,7 +36,6 @@ class JsiRenderNode extends _Node.JsiNode {
38
36
  setProps(props) {
39
37
  super.setProps(props);
40
38
  this.onPropChange();
41
- this.paintCache = null;
42
39
  }
43
40
 
44
41
  setProp(key, value) {
@@ -66,7 +63,9 @@ class JsiRenderNode extends _Node.JsiNode {
66
63
 
67
64
  addChild(child) {
68
65
  if (child instanceof _Node.JsiDeclarationNode) {
69
- child.setInvalidate(() => this.paintCache = null);
66
+ child.setInvalidate(() => {
67
+ this.paintCache = null;
68
+ });
70
69
  }
71
70
 
72
71
  super.addChild(child);
@@ -74,7 +73,9 @@ class JsiRenderNode extends _Node.JsiNode {
74
73
 
75
74
  insertChildBefore(child, before) {
76
75
  if (child instanceof _Node.JsiDeclarationNode) {
77
- child.setInvalidate(() => this.paintCache = null);
76
+ child.setInvalidate(() => {
77
+ this.paintCache = null;
78
+ });
78
79
  }
79
80
 
80
81
  super.insertChildBefore(child, before);
@@ -100,92 +101,7 @@ class JsiRenderNode extends _Node.JsiNode {
100
101
  (0, _datatypes.processTransformProps)(this.matrix, this.props);
101
102
  }
102
103
 
103
- getPaintCtx() {
104
- let ctx;
105
- const {
106
- color,
107
- strokeWidth,
108
- blendMode,
109
- style,
110
- strokeJoin,
111
- strokeCap,
112
- strokeMiter,
113
- opacity,
114
- antiAlias
115
- } = this.props;
116
-
117
- if (color !== undefined || strokeWidth !== undefined || blendMode !== undefined || style !== undefined || strokeJoin !== undefined || strokeCap !== undefined || strokeMiter !== undefined || opacity !== undefined || antiAlias !== undefined) {
118
- ctx = {
119
- opacity: 1
120
- };
121
-
122
- if (color !== undefined) {
123
- ctx.color = this.Skia.Color(color);
124
- }
125
-
126
- if (strokeWidth !== undefined) {
127
- ctx.strokeWidth = strokeWidth;
128
- }
129
-
130
- if (blendMode !== undefined) {
131
- ctx.blendMode = _types.BlendMode[(0, _Enum.enumKey)(blendMode)];
132
- }
133
-
134
- if (style !== undefined) {
135
- ctx.style = _types.PaintStyle[(0, _Enum.enumKey)(style)];
136
- }
137
-
138
- if (strokeJoin !== undefined) {
139
- ctx.strokeJoin = _types.StrokeJoin[(0, _Enum.enumKey)(strokeJoin)];
140
- }
141
-
142
- if (strokeCap !== undefined) {
143
- ctx.strokeCap = _types.StrokeCap[(0, _Enum.enumKey)(strokeCap)];
144
- }
145
-
146
- if (strokeMiter !== undefined) {
147
- ctx.strokeMiter = strokeMiter;
148
- }
149
-
150
- if (opacity !== undefined) {
151
- ctx.opacity = opacity;
152
- }
153
-
154
- if (antiAlias !== undefined) {
155
- ctx.antiAlias = antiAlias;
156
- }
157
- }
158
-
159
- this._children.forEach(child => {
160
- if (child instanceof _Node.JsiDeclarationNode) {
161
- if (child.isColorFilter()) {
162
- ctx = ctx || {};
163
- const cf = child.materialize();
164
- ctx.colorFilter = ctx.colorFilter ? this.Skia.ColorFilter.MakeCompose(cf, ctx.colorFilter) : cf;
165
- } else if (child.isShader()) {
166
- ctx = ctx || {};
167
- const shader = child.materialize();
168
- ctx.shader = shader;
169
- } else if (child.isPathEffect()) {
170
- ctx = ctx || {};
171
- const pe = child.materialize();
172
- ctx.pathEffect = ctx.pathEffect ? this.Skia.PathEffect.MakeCompose(pe, ctx.pathEffect) : pe;
173
- } else if (child.isImageFilter()) {
174
- ctx = ctx || {};
175
- const filter = child.materialize();
176
- ctx.imageFilter = ctx.imageFilter ? this.Skia.ImageFilter.MakeCompose(filter, ctx.imageFilter) : filter;
177
- } else if (child.isMaskFilter()) {
178
- ctx = ctx || {};
179
- const filter = child.materialize();
180
- ctx.maskFilter = filter;
181
- }
182
- }
183
- });
184
-
185
- return ctx;
186
- }
187
-
188
- render(parentCtx) {
104
+ render(ctx) {
189
105
  const {
190
106
  invertClip,
191
107
  layer,
@@ -194,22 +110,10 @@ class JsiRenderNode extends _Node.JsiNode {
194
110
  } = this.props;
195
111
  const {
196
112
  canvas
197
- } = parentCtx;
198
-
199
- if (this.paintCache === null || this.paintCache.parent !== parentCtx.paint) {
200
- const paintCtx = this.getPaintCtx();
201
- const child = paintCtx ? concatPaint(parentCtx.paint.copy(), paintCtx) : parentCtx.paint;
202
- this.paintCache = {
203
- parent: parentCtx.paint,
204
- child
205
- };
206
- }
207
-
208
- const paint = this.paintCache.child; // TODO: can we only recreate a new context here if needed?
209
-
210
- const ctx = { ...parentCtx,
211
- paint
212
- };
113
+ } = ctx;
114
+ const parentPaint = ctx.paint;
115
+ const cache = this.paintCache !== null && this.paintCache.parent === ctx.paint ? this.paintCache.child : undefined;
116
+ const shouldRestore = ctx.saveAndConcat(this, cache);
213
117
  const hasTransform = matrix !== undefined || transform !== undefined;
214
118
  const hasClip = this.clipRect !== undefined || this.clipPath !== undefined || this.clipRRect !== undefined;
215
119
  const shouldSave = hasTransform || hasClip || !!layer;
@@ -244,89 +148,17 @@ class JsiRenderNode extends _Node.JsiNode {
244
148
  if (shouldSave) {
245
149
  canvas.restore();
246
150
  }
151
+
152
+ if (shouldRestore) {
153
+ this.paintCache = {
154
+ parent: parentPaint,
155
+ child: ctx.paint
156
+ };
157
+ ctx.restore();
158
+ }
247
159
  }
248
160
 
249
161
  }
250
162
 
251
163
  exports.JsiRenderNode = JsiRenderNode;
252
-
253
- const concatPaint = (paint, _ref) => {
254
- let {
255
- color,
256
- strokeWidth,
257
- shader,
258
- antiAlias,
259
- blendMode,
260
- colorFilter,
261
- imageFilter,
262
- maskFilter,
263
- pathEffect,
264
- opacity,
265
- strokeCap,
266
- strokeJoin,
267
- strokeMiter,
268
- style
269
- } = _ref;
270
-
271
- if (opacity !== undefined) {
272
- paint.setAlphaf(paint.getAlphaf() * opacity);
273
- }
274
-
275
- if (color !== undefined) {
276
- const currentOpacity = paint.getAlphaf();
277
- paint.setShader(null);
278
- paint.setColor(color);
279
- paint.setAlphaf(currentOpacity * paint.getAlphaf());
280
- }
281
-
282
- if (strokeWidth !== undefined) {
283
- paint.setStrokeWidth(strokeWidth);
284
- }
285
-
286
- if (shader !== undefined) {
287
- paint.setShader(shader);
288
- }
289
-
290
- if (antiAlias !== undefined) {
291
- paint.setAntiAlias(antiAlias);
292
- }
293
-
294
- if (blendMode !== undefined) {
295
- paint.setBlendMode(blendMode);
296
- }
297
-
298
- if (colorFilter !== undefined) {
299
- paint.setColorFilter(colorFilter);
300
- }
301
-
302
- if (imageFilter !== undefined) {
303
- paint.setImageFilter(imageFilter);
304
- }
305
-
306
- if (maskFilter !== undefined) {
307
- paint.setMaskFilter(maskFilter);
308
- }
309
-
310
- if (pathEffect !== undefined) {
311
- paint.setPathEffect(pathEffect);
312
- }
313
-
314
- if (strokeCap !== undefined) {
315
- paint.setStrokeCap(strokeCap);
316
- }
317
-
318
- if (strokeJoin !== undefined) {
319
- paint.setStrokeJoin(strokeJoin);
320
- }
321
-
322
- if (strokeMiter !== undefined) {
323
- paint.setStrokeMiter(strokeMiter);
324
- }
325
-
326
- if (style !== undefined) {
327
- paint.setStyle(style);
328
- }
329
-
330
- return paint;
331
- };
332
164
  //# sourceMappingURL=RenderNode.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["paintProps","JsiRenderNode","JsiNode","constructor","ctx","type","props","matrix","Skia","Matrix","onPropChange","setProps","paintCache","setProp","key","value","hasChanged","includes","identity","clipPath","undefined","clipRect","clipRRect","computeMatrix","computeClip","addChild","child","JsiDeclarationNode","setInvalidate","insertChildBefore","before","clip","isPathDef","processPath","isRRect","processTransformProps","getPaintCtx","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","opacity","antiAlias","Color","BlendMode","enumKey","PaintStyle","StrokeJoin","StrokeCap","_children","forEach","isColorFilter","cf","materialize","colorFilter","ColorFilter","MakeCompose","isShader","shader","isPathEffect","pe","pathEffect","PathEffect","isImageFilter","filter","imageFilter","ImageFilter","isMaskFilter","maskFilter","render","parentCtx","invertClip","layer","transform","canvas","parent","paint","paintCtx","concatPaint","copy","hasTransform","hasClip","shouldSave","op","ClipOp","Difference","Intersect","saveLayer","save","concat","renderNode","restore","setAlphaf","getAlphaf","currentOpacity","setShader","setColor","setStrokeWidth","setAntiAlias","setBlendMode","setColorFilter","setImageFilter","setMaskFilter","setPathEffect","setStrokeCap","setStrokeJoin","setStrokeMiter","setStyle"],"sources":["RenderNode.ts"],"sourcesContent":["import type {\n SkMatrix,\n SkRect,\n SkRRect,\n SkPath,\n SkPaint,\n} from \"../../skia/types\";\nimport {\n StrokeCap,\n StrokeJoin,\n PaintStyle,\n BlendMode,\n ClipOp,\n isRRect,\n} from \"../../skia/types\";\nimport type {\n RenderNode,\n GroupProps,\n DrawingContext,\n NodeType,\n Node,\n} from \"../types\";\n\nimport { isPathDef, processPath, processTransformProps } from \"./datatypes\";\nimport type { NodeContext } from \"./Node\";\nimport { JsiNode, JsiDeclarationNode } from \"./Node\";\nimport type { PaintContext } from \"./PaintContext\";\nimport { enumKey } from \"./datatypes/Enum\";\n\nconst paintProps = [\n \"color\",\n \"strokeWidth\",\n \"blendMode\",\n \"strokeCap\",\n \"strokeJoin\",\n \"strokeMiter\",\n \"style\",\n \"antiAlias\",\n \"opacity\",\n];\n\ninterface PaintCache {\n parent: SkPaint;\n child: SkPaint;\n}\n\nexport abstract class JsiRenderNode<P extends GroupProps>\n extends JsiNode<P>\n implements RenderNode<P>\n{\n paintCache: PaintCache | null = null;\n matrix: SkMatrix;\n clipRect?: SkRect;\n clipRRect?: SkRRect;\n clipPath?: SkPath;\n\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, type, props);\n this.matrix = this.Skia.Matrix();\n this.onPropChange();\n }\n\n setProps(props: P) {\n super.setProps(props);\n this.onPropChange();\n this.paintCache = null;\n }\n\n setProp<K extends keyof P>(key: K, value: P[K]) {\n const hasChanged = super.setProp(key, value);\n if (hasChanged) {\n this.onPropChange();\n if (paintProps.includes(key as string)) {\n this.paintCache = null;\n }\n }\n return hasChanged;\n }\n\n protected onPropChange() {\n this.matrix.identity();\n this.clipPath = undefined;\n this.clipRect = undefined;\n this.clipRRect = undefined;\n this.computeMatrix();\n this.computeClip();\n }\n\n addChild(child: Node<unknown>) {\n if (child instanceof JsiDeclarationNode) {\n child.setInvalidate(() => (this.paintCache = null));\n }\n super.addChild(child);\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>) {\n if (child instanceof JsiDeclarationNode) {\n child.setInvalidate(() => (this.paintCache = null));\n }\n super.insertChildBefore(child, before);\n }\n\n private computeClip() {\n const { clip } = this.props;\n if (clip) {\n if (isPathDef(clip)) {\n this.clipPath = processPath(this.Skia, clip);\n } else if (isRRect(clip)) {\n this.clipRRect = clip;\n } else {\n this.clipRect = clip;\n }\n }\n }\n\n private computeMatrix() {\n processTransformProps(this.matrix, this.props);\n }\n\n private getPaintCtx() {\n let ctx: PaintContext | undefined;\n const {\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n opacity,\n antiAlias,\n } = this.props;\n if (\n color !== undefined ||\n strokeWidth !== undefined ||\n blendMode !== undefined ||\n style !== undefined ||\n strokeJoin !== undefined ||\n strokeCap !== undefined ||\n strokeMiter !== undefined ||\n opacity !== undefined ||\n antiAlias !== undefined\n ) {\n ctx = { opacity: 1 };\n if (color !== undefined) {\n ctx.color = this.Skia.Color(color);\n }\n if (strokeWidth !== undefined) {\n ctx.strokeWidth = strokeWidth;\n }\n if (blendMode !== undefined) {\n ctx.blendMode = BlendMode[enumKey(blendMode)];\n }\n if (style !== undefined) {\n ctx.style = PaintStyle[enumKey(style)];\n }\n if (strokeJoin !== undefined) {\n ctx.strokeJoin = StrokeJoin[enumKey(strokeJoin)];\n }\n if (strokeCap !== undefined) {\n ctx.strokeCap = StrokeCap[enumKey(strokeCap)];\n }\n if (strokeMiter !== undefined) {\n ctx.strokeMiter = strokeMiter;\n }\n if (opacity !== undefined) {\n ctx.opacity = opacity;\n }\n if (antiAlias !== undefined) {\n ctx.antiAlias = antiAlias;\n }\n }\n this._children.forEach((child) => {\n if (child instanceof JsiDeclarationNode) {\n if (child.isColorFilter()) {\n ctx = ctx || {};\n const cf = child.materialize();\n ctx.colorFilter = ctx.colorFilter\n ? this.Skia.ColorFilter.MakeCompose(cf, ctx.colorFilter)\n : cf;\n } else if (child.isShader()) {\n ctx = ctx || {};\n const shader = child.materialize();\n ctx.shader = shader;\n } else if (child.isPathEffect()) {\n ctx = ctx || {};\n const pe = child.materialize();\n ctx.pathEffect = ctx.pathEffect\n ? this.Skia.PathEffect.MakeCompose(pe, ctx.pathEffect)\n : pe;\n } else if (child.isImageFilter()) {\n ctx = ctx || {};\n const filter = child.materialize();\n ctx.imageFilter = ctx.imageFilter\n ? this.Skia.ImageFilter.MakeCompose(filter, ctx.imageFilter)\n : filter;\n } else if (child.isMaskFilter()) {\n ctx = ctx || {};\n const filter = child.materialize();\n ctx.maskFilter = filter;\n }\n }\n });\n return ctx;\n }\n\n render(parentCtx: DrawingContext) {\n const { invertClip, layer, matrix, transform } = this.props;\n const { canvas } = parentCtx;\n\n if (\n this.paintCache === null ||\n this.paintCache.parent !== parentCtx.paint\n ) {\n const paintCtx = this.getPaintCtx();\n const child = paintCtx\n ? concatPaint(parentCtx.paint.copy(), paintCtx)\n : parentCtx.paint;\n this.paintCache = { parent: parentCtx.paint, child };\n }\n const paint = this.paintCache.child;\n // TODO: can we only recreate a new context here if needed?\n const ctx = { ...parentCtx, paint };\n const hasTransform = matrix !== undefined || transform !== undefined;\n const hasClip =\n this.clipRect !== undefined ||\n this.clipPath !== undefined ||\n this.clipRRect !== undefined;\n const shouldSave = hasTransform || hasClip || !!layer;\n const op = invertClip ? ClipOp.Difference : ClipOp.Intersect;\n if (shouldSave) {\n if (layer) {\n if (typeof layer === \"boolean\") {\n canvas.saveLayer();\n } else {\n canvas.saveLayer(layer);\n }\n } else {\n canvas.save();\n }\n }\n\n if (this.matrix) {\n canvas.concat(this.matrix);\n }\n if (this.clipRect) {\n canvas.clipRect(this.clipRect, op, true);\n } else if (this.clipRRect) {\n canvas.clipRRect(this.clipRRect, op, true);\n } else if (this.clipPath) {\n canvas.clipPath(this.clipPath, op, true);\n }\n\n this.renderNode(ctx);\n\n if (shouldSave) {\n canvas.restore();\n }\n }\n\n abstract renderNode(ctx: DrawingContext): void;\n}\n\nconst concatPaint = (\n paint: SkPaint,\n {\n color,\n strokeWidth,\n shader,\n antiAlias,\n blendMode,\n colorFilter,\n imageFilter,\n maskFilter,\n pathEffect,\n opacity,\n strokeCap,\n strokeJoin,\n strokeMiter,\n style,\n }: PaintContext\n) => {\n if (opacity !== undefined) {\n paint.setAlphaf(paint.getAlphaf() * opacity);\n }\n if (color !== undefined) {\n const currentOpacity = paint.getAlphaf();\n paint.setShader(null);\n paint.setColor(color);\n paint.setAlphaf(currentOpacity * paint.getAlphaf());\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (shader !== undefined) {\n paint.setShader(shader);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(blendMode);\n }\n if (colorFilter !== undefined) {\n paint.setColorFilter(colorFilter);\n }\n if (imageFilter !== undefined) {\n paint.setImageFilter(imageFilter);\n }\n if (maskFilter !== undefined) {\n paint.setMaskFilter(maskFilter);\n }\n if (pathEffect !== undefined) {\n paint.setPathEffect(pathEffect);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(strokeCap);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(strokeJoin);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (style !== undefined) {\n paint.setStyle(style);\n }\n return paint;\n};\n"],"mappings":";;;;;;;AAOA;;AAgBA;;AAEA;;AAEA;;;;AAEA,MAAMA,UAAU,GAAG,CACjB,OADiB,EAEjB,aAFiB,EAGjB,WAHiB,EAIjB,WAJiB,EAKjB,YALiB,EAMjB,aANiB,EAOjB,OAPiB,EAQjB,WARiB,EASjB,SATiB,CAAnB;;AAiBO,MAAeC,aAAf,SACGC,aADH,CAGP;EAOEC,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;IACtD,MAAMF,GAAN,EAAWC,IAAX,EAAiBC,KAAjB;;IADsD,oCANxB,IAMwB;;IAAA;;IAAA;;IAAA;;IAAA;;IAEtD,KAAKC,MAAL,GAAc,KAAKC,IAAL,CAAUC,MAAV,EAAd;IACA,KAAKC,YAAL;EACD;;EAEDC,QAAQ,CAACL,KAAD,EAAW;IACjB,MAAMK,QAAN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AIkB,WAAW,KAAKrC,SAApB,EAA+B;IAC7B2D,KAAK,CAACwB,cAAN,CAAqB9C,WAArB;EACD;;EACD,IAAIW,WAAW,KAAKhD,SAApB,EAA+B;IAC7B2D,KAAK,CAACyB,cAAN,CAAqBpC,WAArB;EACD;;EACD,IAAIG,UAAU,KAAKnD,SAAnB,EAA8B;IAC5B2D,KAAK,CAAC0B,aAAN,CAAoBlC,UAApB;EACD;;EACD,IAAIP,UAAU,KAAK5C,SAAnB,EAA8B;IAC5B2D,KAAK,CAAC2B,aAAN,CAAoB1C,UAApB;EACD;;EACD,IAAItB,SAAS,KAAKtB,SAAlB,EAA6B;IAC3B2D,KAAK,CAAC4B,YAAN,CAAmBjE,SAAnB;EACD;;EACD,IAAID,UAAU,KAAKrB,SAAnB,EAA8B;IAC5B2D,KAAK,CAAC6B,aAAN,CAAoBnE,UAApB;EACD;;EACD,IAAIE,WAAW,KAAKvB,SAApB,EAA+B;IAC7B2D,KAAK,CAAC8B,cAAN,CAAqBlE,WAArB;EACD;;EACD,IAAIH,KAAK,KAAKpB,SAAd,EAAyB;IACvB2D,KAAK,CAAC+B,QAAN,CAAetE,KAAf;EACD;;EACD,OAAOuC,KAAP;AACD,CAjED"}
1
+ {"version":3,"names":["paintProps","JsiRenderNode","JsiNode","constructor","ctx","type","props","matrix","Skia","Matrix","onPropChange","setProps","setProp","key","value","hasChanged","includes","paintCache","identity","clipPath","undefined","clipRect","clipRRect","computeMatrix","computeClip","addChild","child","JsiDeclarationNode","setInvalidate","insertChildBefore","before","clip","isPathDef","processPath","isRRect","processTransformProps","render","invertClip","layer","transform","canvas","parentPaint","paint","cache","parent","shouldRestore","saveAndConcat","hasTransform","hasClip","shouldSave","op","ClipOp","Difference","Intersect","saveLayer","save","concat","renderNode","restore"],"sources":["RenderNode.ts"],"sourcesContent":["import type {\n SkMatrix,\n SkRect,\n SkRRect,\n SkPath,\n SkPaint,\n} from \"../../skia/types\";\nimport { ClipOp, isRRect } from \"../../skia/types\";\nimport type {\n RenderNode,\n GroupProps,\n NodeType,\n Node,\n DrawingContext,\n} from \"../types\";\n\nimport { isPathDef, processPath, processTransformProps } from \"./datatypes\";\nimport type { NodeContext } from \"./Node\";\nimport { JsiNode, JsiDeclarationNode } from \"./Node\";\n\nconst paintProps = [\n \"color\",\n \"strokeWidth\",\n \"blendMode\",\n \"strokeCap\",\n \"strokeJoin\",\n \"strokeMiter\",\n \"style\",\n \"antiAlias\",\n \"opacity\",\n];\n\ninterface PaintCache {\n parent: SkPaint;\n child: SkPaint;\n}\n\nexport abstract class JsiRenderNode<P extends GroupProps>\n extends JsiNode<P>\n implements RenderNode<P>\n{\n paintCache: PaintCache | null = null;\n\n matrix: SkMatrix;\n clipRect?: SkRect;\n clipRRect?: SkRRect;\n clipPath?: SkPath;\n\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, type, props);\n this.matrix = this.Skia.Matrix();\n this.onPropChange();\n }\n\n setProps(props: P) {\n super.setProps(props);\n this.onPropChange();\n }\n\n setProp<K extends keyof P>(key: K, value: P[K]) {\n const hasChanged = super.setProp(key, value);\n if (hasChanged) {\n this.onPropChange();\n if (paintProps.includes(key as string)) {\n this.paintCache = null;\n }\n }\n return hasChanged;\n }\n\n protected onPropChange() {\n this.matrix.identity();\n this.clipPath = undefined;\n this.clipRect = undefined;\n this.clipRRect = undefined;\n this.computeMatrix();\n this.computeClip();\n }\n\n addChild(child: Node<unknown>) {\n if (child instanceof JsiDeclarationNode) {\n child.setInvalidate(() => {\n this.paintCache = null;\n });\n }\n super.addChild(child);\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>) {\n if (child instanceof JsiDeclarationNode) {\n child.setInvalidate(() => {\n this.paintCache = null;\n });\n }\n super.insertChildBefore(child, before);\n }\n\n private computeClip() {\n const { clip } = this.props;\n if (clip) {\n if (isPathDef(clip)) {\n this.clipPath = processPath(this.Skia, clip);\n } else if (isRRect(clip)) {\n this.clipRRect = clip;\n } else {\n this.clipRect = clip;\n }\n }\n }\n\n private computeMatrix() {\n processTransformProps(this.matrix, this.props);\n }\n\n render(ctx: DrawingContext) {\n const { invertClip, layer, matrix, transform } = this.props;\n const { canvas } = ctx;\n const parentPaint = ctx.paint;\n\n const cache =\n this.paintCache !== null && this.paintCache.parent === ctx.paint\n ? this.paintCache.child\n : undefined;\n const shouldRestore = ctx.saveAndConcat(this, cache);\n\n const hasTransform = matrix !== undefined || transform !== undefined;\n const hasClip =\n this.clipRect !== undefined ||\n this.clipPath !== undefined ||\n this.clipRRect !== undefined;\n const shouldSave = hasTransform || hasClip || !!layer;\n const op = invertClip ? ClipOp.Difference : ClipOp.Intersect;\n if (shouldSave) {\n if (layer) {\n if (typeof layer === \"boolean\") {\n canvas.saveLayer();\n } else {\n canvas.saveLayer(layer);\n }\n } else {\n canvas.save();\n }\n }\n\n if (this.matrix) {\n canvas.concat(this.matrix);\n }\n if (this.clipRect) {\n canvas.clipRect(this.clipRect, op, true);\n } else if (this.clipRRect) {\n canvas.clipRRect(this.clipRRect, op, true);\n } else if (this.clipPath) {\n canvas.clipPath(this.clipPath, op, true);\n }\n\n this.renderNode(ctx);\n\n if (shouldSave) {\n canvas.restore();\n }\n if (shouldRestore) {\n this.paintCache = {\n parent: parentPaint,\n child: ctx.paint,\n };\n ctx.restore();\n }\n }\n\n abstract renderNode(ctx: DrawingContext): void;\n}\n"],"mappings":";;;;;;;AAOA;;AASA;;AAEA;;;;AAEA,MAAMA,UAAU,GAAG,CACjB,OADiB,EAEjB,aAFiB,EAGjB,WAHiB,EAIjB,WAJiB,EAKjB,YALiB,EAMjB,aANiB,EAOjB,OAPiB,EAQjB,WARiB,EASjB,SATiB,CAAnB;;AAiBO,MAAeC,aAAf,SACGC,aADH,CAGP;EAQEC,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;IACtD,MAAMF,GAAN,EAAWC,IAAX,EAAiBC,KAAjB;;IADsD,oCAPxB,IAOwB;;IAAA;;IAAA;;IAAA;;IA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AgB;MACd,IAAIX,KAAJ,EAAW;QACT,IAAI,OAAOA,KAAP,KAAiB,SAArB,EAAgC;UAC9BE,MAAM,CAACc,SAAP;QACD,CAFD,MAEO;UACLd,MAAM,CAACc,SAAP,CAAiBhB,KAAjB;QACD;MACF,CAND,MAMO;QACLE,MAAM,CAACe,IAAP;MACD;IACF;;IAED,IAAI,KAAKhD,MAAT,EAAiB;MACfiC,MAAM,CAACgB,MAAP,CAAc,KAAKjD,MAAnB;IACD;;IACD,IAAI,KAAKc,QAAT,EAAmB;MACjBmB,MAAM,CAACnB,QAAP,CAAgB,KAAKA,QAArB,EAA+B6B,EAA/B,EAAmC,IAAnC;IACD,CAFD,MAEO,IAAI,KAAK5B,SAAT,EAAoB;MACzBkB,MAAM,CAAClB,SAAP,CAAiB,KAAKA,SAAtB,EAAiC4B,EAAjC,EAAqC,IAArC;IACD,CAFM,MAEA,IAAI,KAAK/B,QAAT,EAAmB;MACxBqB,MAAM,CAACrB,QAAP,CAAgB,KAAKA,QAArB,EAA+B+B,EAA/B,EAAmC,IAAnC;IACD;;IAED,KAAKO,UAAL,CAAgBrD,GAAhB;;IAEA,IAAI6C,UAAJ,EAAgB;MACdT,MAAM,CAACkB,OAAP;IACD;;IACD,IAAIb,aAAJ,EAAmB;MACjB,KAAK5B,UAAL,GAAkB;QAChB2B,MAAM,EAAEH,WADQ;QAEhBf,KAAK,EAAEtB,GAAG,CAACsC;MAFK,CAAlB;MAIAtC,GAAG,CAACsD,OAAJ;IACD;EACF;;AA/HH"}
@@ -0,0 +1,7 @@
1
+ import type { Skia } from "../../../skia/types";
2
+ import type { CircleDef, ScalarCircleDef } from "../../types";
3
+ export declare const isCircleScalarDef: (def: CircleDef) => def is ScalarCircleDef;
4
+ export declare const processCircle: (Skia: Skia, def: CircleDef) => {
5
+ c: import("../../../skia/types").SkPoint;
6
+ r: number;
7
+ };
@@ -0,0 +1 @@
1
+ export declare const enumKey: <K extends string>(k: K) => Capitalize<K>;
@@ -0,0 +1,33 @@
1
+ import type { SkRect } from "../../../skia/types";
2
+ import type { Fit } from "../../types";
3
+ export interface Size {
4
+ width: number;
5
+ height: number;
6
+ }
7
+ export declare const size: (width?: number, height?: number) => {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ export declare const rect2rect: (src: SkRect, dst: SkRect) => readonly [{
12
+ readonly translateX: number;
13
+ }, {
14
+ readonly translateY: number;
15
+ }, {
16
+ readonly scaleX: number;
17
+ }, {
18
+ readonly scaleY: number;
19
+ }];
20
+ export declare const fitRects: (fit: Fit, rect: SkRect, { x, y, width, height }: SkRect) => {
21
+ src: {
22
+ x: number;
23
+ y: number;
24
+ width: number;
25
+ height: number;
26
+ };
27
+ dst: {
28
+ x: number;
29
+ y: number;
30
+ width: number;
31
+ height: number;
32
+ };
33
+ };
@@ -0,0 +1,92 @@
1
+ import type { Skia, SkRect, Transforms2d, Vector } from "../../../skia/types";
2
+ import { TileMode } from "../../../skia/types";
3
+ import type { GradientProps, ImageShaderProps } from "../../types";
4
+ export declare const transformOrigin: (origin: Vector, transform: Transforms2d) => (Pick<{
5
+ readonly translateX: number;
6
+ readonly translateY: number;
7
+ readonly scale: number;
8
+ readonly skewX: number;
9
+ readonly skewY: number;
10
+ readonly scaleX: number;
11
+ readonly scaleY: number;
12
+ readonly rotateZ: number;
13
+ readonly rotate: number;
14
+ }, "translateX"> | Pick<{
15
+ readonly translateX: number;
16
+ readonly translateY: number;
17
+ readonly scale: number;
18
+ readonly skewX: number;
19
+ readonly skewY: number;
20
+ readonly scaleX: number;
21
+ readonly scaleY: number;
22
+ readonly rotateZ: number;
23
+ readonly rotate: number;
24
+ }, "translateY"> | Pick<{
25
+ readonly translateX: number;
26
+ readonly translateY: number;
27
+ readonly scale: number;
28
+ readonly skewX: number;
29
+ readonly skewY: number;
30
+ readonly scaleX: number;
31
+ readonly scaleY: number;
32
+ readonly rotateZ: number;
33
+ readonly rotate: number;
34
+ }, "scale"> | Pick<{
35
+ readonly translateX: number;
36
+ readonly translateY: number;
37
+ readonly scale: number;
38
+ readonly skewX: number;
39
+ readonly skewY: number;
40
+ readonly scaleX: number;
41
+ readonly scaleY: number;
42
+ readonly rotateZ: number;
43
+ readonly rotate: number;
44
+ }, "scaleX"> | Pick<{
45
+ readonly translateX: number;
46
+ readonly translateY: number;
47
+ readonly scale: number;
48
+ readonly skewX: number;
49
+ readonly skewY: number;
50
+ readonly scaleX: number;
51
+ readonly scaleY: number;
52
+ readonly rotateZ: number;
53
+ readonly rotate: number;
54
+ }, "scaleY"> | Pick<{
55
+ readonly translateX: number;
56
+ readonly translateY: number;
57
+ readonly scale: number;
58
+ readonly skewX: number;
59
+ readonly skewY: number;
60
+ readonly scaleX: number;
61
+ readonly scaleY: number;
62
+ readonly rotateZ: number;
63
+ readonly rotate: number;
64
+ }, "skewX"> | Pick<{
65
+ readonly translateX: number;
66
+ readonly translateY: number;
67
+ readonly scale: number;
68
+ readonly skewX: number;
69
+ readonly skewY: number;
70
+ readonly scaleX: number;
71
+ readonly scaleY: number;
72
+ readonly rotateZ: number;
73
+ readonly rotate: number;
74
+ }, "skewY"> | Pick<{
75
+ readonly translateX: number;
76
+ readonly translateY: number;
77
+ readonly scale: number;
78
+ readonly skewX: number;
79
+ readonly skewY: number;
80
+ readonly scaleX: number;
81
+ readonly scaleY: number;
82
+ readonly rotateZ: number;
83
+ readonly rotate: number;
84
+ }, "rotate">)[];
85
+ export declare const processGradientProps: (Skia: Skia, { colors, positions, mode, flags, ...transform }: GradientProps) => {
86
+ colors: Float32Array[];
87
+ positions: number[] | null;
88
+ mode: TileMode;
89
+ flags: number | undefined;
90
+ localMatrix: import("../../../skia/types").SkMatrix;
91
+ };
92
+ export declare const getRect: (Skia: Skia, props: Omit<ImageShaderProps, "tx" | "ty" | "fm" | "mm" | "fit" | "image">) => SkRect | undefined;
@@ -0,0 +1,4 @@
1
+ import type { Skia } from "../../../skia/types";
2
+ import type { PathDef } from "../../types";
3
+ export declare const processPath: (Skia: Skia, rawPath: PathDef) => import("../../../skia/types").SkPath;
4
+ export declare const isPathDef: (def: any) => def is PathDef;
@@ -0,0 +1,3 @@
1
+ import type { Skia, Vector } from "../../../skia/types";
2
+ import type { Radius } from "../../types";
3
+ export declare const processRadius: (Skia: Skia, radius: Radius) => Vector;
@@ -0,0 +1,5 @@
1
+ import type { Skia, SkRect, Vector } from "../../../skia/types";
2
+ import type { RectDef, RRectDef } from "../../types";
3
+ export declare const isEdge: (pos: Vector, b: SkRect) => boolean;
4
+ export declare const processRect: (Skia: Skia, def: RectDef) => SkRect;
5
+ export declare const processRRect: (Skia: Skia, def: RRectDef) => import("../../../skia/types").SkRRect;
@@ -0,0 +1,3 @@
1
+ import type { TransformProps } from "../../types";
2
+ import type { SkMatrix } from "../../../skia/types";
3
+ export declare const processTransformProps: (m3: SkMatrix, props: TransformProps) => void;
@@ -0,0 +1,8 @@
1
+ export * from "./Enum";
2
+ export * from "./Path";
3
+ export * from "./Fitting";
4
+ export * from "./Rect";
5
+ export * from "./Radius";
6
+ export * from "./Circle";
7
+ export * from "./Gradient";
8
+ export * from "./Transform";
@@ -0,0 +1,8 @@
1
+ import type { ChildrenProps, DrawingContext } from "../../types";
2
+ import { JsiDrawingNode } from "../DrawingNode";
3
+ import type { NodeContext } from "../Node";
4
+ export declare class BackdropFilterNode extends JsiDrawingNode<ChildrenProps, null> {
5
+ constructor(ctx: NodeContext, props: ChildrenProps);
6
+ protected deriveProps(): null;
7
+ draw({ canvas, declarationCtx }: DrawingContext): void;
8
+ }
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.BackdropFilterNode = void 0;
7
7
 
8
- var _types = require("../../../skia/types");
9
-
10
- var _types2 = require("../../types");
8
+ var _types = require("../../types");
11
9
 
12
10
  var _DrawingNode = require("../DrawingNode");
13
11
 
@@ -15,7 +13,7 @@ var _Node = require("../Node");
15
13
 
16
14
  class BackdropFilterNode extends _DrawingNode.JsiDrawingNode {
17
15
  constructor(ctx, props) {
18
- super(ctx, _types2.NodeType.BackdropFilter, props);
16
+ super(ctx, _types.NodeType.BackdropFilter, props);
19
17
  }
20
18
 
21
19
  deriveProps() {
@@ -24,11 +22,31 @@ class BackdropFilterNode extends _DrawingNode.JsiDrawingNode {
24
22
 
25
23
  draw(_ref) {
26
24
  let {
27
- canvas
25
+ canvas,
26
+ declarationCtx
28
27
  } = _ref;
29
28
  const child = this._children[0];
30
- const filter = child instanceof _Node.JsiDeclarationNode ? child.materialize() : null;
31
- canvas.saveLayer(undefined, null, (0, _types.isColorFilter)(filter) ? this.Skia.ImageFilter.MakeColorFilter(filter, null) : filter);
29
+ let imageFilter = null;
30
+
31
+ if (child instanceof _Node.JsiDeclarationNode) {
32
+ declarationCtx.save();
33
+ child.decorate(declarationCtx);
34
+ const imgf = declarationCtx.imageFilters.pop();
35
+
36
+ if (imgf) {
37
+ imageFilter = imgf;
38
+ } else {
39
+ const cf = declarationCtx.colorFilters.pop();
40
+
41
+ if (cf) {
42
+ imageFilter = this.Skia.ImageFilter.MakeColorFilter(cf, null);
43
+ }
44
+ }
45
+
46
+ declarationCtx.restore();
47
+ }
48
+
49
+ canvas.saveLayer(undefined, null, imageFilter);
32
50
  canvas.restore();
33
51
  }
34
52
 
@@ -1 +1 @@
1
- {"version":3,"names":["BackdropFilterNode","JsiDrawingNode","constructor","ctx","props","NodeType","BackdropFilter","deriveProps","draw","canvas","child","_children","filter","JsiDeclarationNode","materialize","saveLayer","undefined","isColorFilter","Skia","ImageFilter","MakeColorFilter","restore"],"sources":["BackdropFilterNode.ts"],"sourcesContent":["import { isColorFilter } from \"../../../skia/types\";\nimport type { ChildrenProps, DrawingContext } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\n\nexport class BackdropFilterNode extends JsiDrawingNode<ChildrenProps, null> {\n constructor(ctx: NodeContext, props: ChildrenProps) {\n super(ctx, NodeType.BackdropFilter, props);\n }\n\n protected deriveProps() {\n return null;\n }\n\n draw({ canvas }: DrawingContext) {\n const child = this._children[0];\n const filter =\n child instanceof JsiDeclarationNode ? child.materialize() : null;\n canvas.saveLayer(\n undefined,\n null,\n isColorFilter(filter)\n ? this.Skia.ImageFilter.MakeColorFilter(filter, null)\n : filter\n );\n canvas.restore();\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAEA;;AAEO,MAAMA,kBAAN,SAAiCC,2BAAjC,CAAqE;EAC1EC,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAyC;IAClD,MAAMD,GAAN,EAAWE,gBAAA,CAASC,cAApB,EAAoCF,KAApC;EACD;;EAESG,WAAW,GAAG;IACtB,OAAO,IAAP;EACD;;EAEDC,IAAI,OAA6B;IAAA,IAA5B;MAAEC;IAAF,CAA4B;IAC/B,MAAMC,KAAK,GAAG,KAAKC,SAAL,CAAe,CAAf,CAAd;IACA,MAAMC,MAAM,GACVF,KAAK,YAAYG,wBAAjB,GAAsCH,KAAK,CAACI,WAAN,EAAtC,GAA4D,IAD9D;IAEAL,MAAM,CAACM,SAAP,CACEC,SADF,EAEE,IAFF,EAGE,IAAAC,oBAAA,EAAcL,MAAd,IACI,KAAKM,IAAL,CAAUC,WAAV,CAAsBC,eAAtB,CAAsCR,MAAtC,EAA8C,IAA9C,CADJ,GAEIA,MALN;IAOAH,MAAM,CAACY,OAAP;EACD;;AArByE"}
1
+ {"version":3,"names":["BackdropFilterNode","JsiDrawingNode","constructor","ctx","props","NodeType","BackdropFilter","deriveProps","draw","canvas","declarationCtx","child","_children","imageFilter","JsiDeclarationNode","save","decorate","imgf","imageFilters","pop","cf","colorFilters","Skia","ImageFilter","MakeColorFilter","restore","saveLayer","undefined"],"sources":["BackdropFilterNode.ts"],"sourcesContent":["import type { ChildrenProps, DrawingContext } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type { SkImageFilter } from \"../../../skia/types/ImageFilter/ImageFilter\";\n\nexport class BackdropFilterNode extends JsiDrawingNode<ChildrenProps, null> {\n constructor(ctx: NodeContext, props: ChildrenProps) {\n super(ctx, NodeType.BackdropFilter, props);\n }\n\n protected deriveProps() {\n return null;\n }\n\n draw({ canvas, declarationCtx }: DrawingContext) {\n const child = this._children[0];\n let imageFilter: SkImageFilter | null = null;\n if (child instanceof JsiDeclarationNode) {\n declarationCtx.save();\n child.decorate(declarationCtx);\n const imgf = declarationCtx.imageFilters.pop();\n if (imgf) {\n imageFilter = imgf;\n } else {\n const cf = declarationCtx.colorFilters.pop();\n if (cf) {\n imageFilter = this.Skia.ImageFilter.MakeColorFilter(cf, null);\n }\n }\n declarationCtx.restore();\n }\n canvas.saveLayer(undefined, null, imageFilter);\n canvas.restore();\n }\n}\n"],"mappings":";;;;;;;AACA;;AACA;;AAEA;;AAGO,MAAMA,kBAAN,SAAiCC,2BAAjC,CAAqE;EAC1EC,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAyC;IAClD,MAAMD,GAAN,EAAWE,eAAA,CAASC,cAApB,EAAoCF,KAApC;EACD;;EAESG,WAAW,GAAG;IACtB,OAAO,IAAP;EACD;;EAEDC,IAAI,OAA6C;IAAA,IAA5C;MAAEC,MAAF;MAAUC;IAAV,CAA4C;IAC/C,MAAMC,KAAK,GAAG,KAAKC,SAAL,CAAe,CAAf,CAAd;IACA,IAAIC,WAAiC,GAAG,IAAxC;;IACA,IAAIF,KAAK,YAAYG,wBAArB,EAAyC;MACvCJ,cAAc,CAACK,IAAf;MACAJ,KAAK,CAACK,QAAN,CAAeN,cAAf;MACA,MAAMO,IAAI,GAAGP,cAAc,CAACQ,YAAf,CAA4BC,GAA5B,EAAb;;MACA,IAAIF,IAAJ,EAAU;QACRJ,WAAW,GAAGI,IAAd;MACD,CAFD,MAEO;QACL,MAAMG,EAAE,GAAGV,cAAc,CAACW,YAAf,CAA4BF,GAA5B,EAAX;;QACA,IAAIC,EAAJ,EAAQ;UACNP,WAAW,GAAG,KAAKS,IAAL,CAAUC,WAAV,CAAsBC,eAAtB,CAAsCJ,EAAtC,EAA0C,IAA1C,CAAd;QACD;MACF;;MACDV,cAAc,CAACe,OAAf;IACD;;IACDhB,MAAM,CAACiB,SAAP,CAAiBC,SAAjB,EAA4B,IAA5B,EAAkCd,WAAlC;IACAJ,MAAM,CAACgB,OAAP;EACD;;AA5ByE"}
@@ -0,0 +1,15 @@
1
+ import type { DrawingContext } from "../../types";
2
+ import type { BoxShadowProps, BoxProps } from "../../types/Drawings";
3
+ import type { NodeContext } from "../Node";
4
+ import { JsiDeclarationNode } from "../Node";
5
+ import { JsiRenderNode } from "../RenderNode";
6
+ import type { DeclarationContext } from "../../types/DeclarationContext";
7
+ export declare class BoxShadowNode extends JsiDeclarationNode<BoxShadowProps> {
8
+ constructor(ctx: NodeContext, props: BoxShadowProps);
9
+ decorate(_ctx: DeclarationContext): void;
10
+ materialize(): BoxShadowProps;
11
+ }
12
+ export declare class BoxNode extends JsiRenderNode<BoxProps> {
13
+ constructor(ctx: NodeContext, props: BoxProps);
14
+ renderNode({ canvas, paint }: DrawingContext): void;
15
+ }
@@ -30,6 +30,9 @@ class BoxShadowNode extends _Node.JsiDeclarationNode {
30
30
  super(ctx, _types2.DeclarationType.Unknown, _types2.NodeType.BoxShadow, props);
31
31
  }
32
32
 
33
+ decorate(_ctx) {// do nothing
34
+ }
35
+
33
36
  materialize() {
34
37
  return this.props;
35
38
  }
@@ -1 +1 @@
1
- {"version":3,"names":["inflate","Skia","box","dx","dy","tx","ty","RRectXY","XYWHRect","rect","x","y","width","height","rx","ry","deflate","BoxShadowNode","JsiDeclarationNode","constructor","ctx","props","DeclarationType","Unknown","NodeType","BoxShadow","materialize","BoxNode","JsiRenderNode","Box","renderNode","canvas","paint","defaultBox","opacity","getAlphaf","isRRect","shadows","_children","map","node","filter","n","shadow","inner","color","blur","spread","lPaint","Paint","setColor","Color","setAlphaf","setMaskFilter","MaskFilter","MakeBlur","BlurStyle","Normal","drawRRect","delta","Point","Math","abs","save","clipRRect","ClipOp","Intersect","outer","drawDRRect","restore"],"sources":["Box.ts"],"sourcesContent":["import type { SkRRect, Skia } from \"../../../skia/types\";\nimport { BlurStyle, ClipOp, isRRect } from \"../../../skia/types\";\nimport type { DrawingContext } from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport type { BoxShadowProps, BoxProps } from \"../../types/Drawings\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport { JsiRenderNode } from \"../RenderNode\";\n\nconst inflate = (\n Skia: Skia,\n box: SkRRect,\n dx: number,\n dy: number,\n tx = 0,\n ty = 0\n) =>\n Skia.RRectXY(\n Skia.XYWHRect(\n box.rect.x - dx + tx,\n box.rect.y - dy + ty,\n box.rect.width + 2 * dx,\n box.rect.height + 2 * dy\n ),\n box.rx + dx,\n box.ry + dy\n );\n\nconst deflate = (\n Skia: Skia,\n box: SkRRect,\n dx: number,\n dy: number,\n tx = 0,\n ty = 0\n) => inflate(Skia, box, -dx, -dy, tx, ty);\n\nexport class BoxShadowNode extends JsiDeclarationNode<\n BoxShadowProps,\n BoxShadowProps\n> {\n constructor(ctx: NodeContext, props: BoxShadowProps) {\n super(ctx, DeclarationType.Unknown, NodeType.BoxShadow, props);\n }\n\n materialize() {\n return this.props;\n }\n}\n\nexport class BoxNode extends JsiRenderNode<BoxProps> {\n constructor(ctx: NodeContext, props: BoxProps) {\n super(ctx, NodeType.Box, props);\n }\n\n renderNode({ canvas, paint }: DrawingContext) {\n const { box: defaultBox } = this.props;\n const opacity = paint.getAlphaf();\n const box = isRRect(defaultBox)\n ? defaultBox\n : this.Skia.RRectXY(defaultBox, 0, 0);\n const shadows = this._children\n .map((node) => {\n if (node instanceof BoxShadowNode) {\n return node.materialize();\n }\n return null;\n })\n .filter((n): n is BoxShadowProps => n !== null);\n shadows\n .filter((shadow) => !shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const lPaint = this.Skia.Paint();\n lPaint.setColor(this.Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n lPaint.setMaskFilter(\n this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(\n inflate(this.Skia, box, spread, spread, dx, dy),\n lPaint\n );\n });\n\n canvas.drawRRect(box, paint);\n\n shadows\n .filter((shadow) => shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const delta = this.Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = this.Skia.Paint();\n lPaint.setColor(this.Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n\n lPaint.setMaskFilter(\n this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(this.Skia, box, spread, spread, dx, dy);\n const outer = inflate(this.Skia, box, delta.x, delta.y);\n canvas.drawDRRect(outer, inner, lPaint);\n canvas.restore();\n });\n }\n}\n"],"mappings":";;;;;;;AACA;;AAEA;;AAGA;;AACA;;AAEA,MAAMA,OAAO,GAAG,UACdC,IADc,EAEdC,GAFc,EAGdC,EAHc,EAIdC,EAJc;EAAA,IAKdC,EALc,uEAKT,CALS;EAAA,IAMdC,EANc,uEAMT,CANS;EAAA,OAQdL,IAAI,CAACM,OAAL,CACEN,IAAI,CAACO,QAAL,CACEN,GAAG,CAACO,IAAJ,CAASC,CAAT,GAAaP,EAAb,GAAkBE,EADpB,EAEEH,GAAG,CAACO,IAAJ,CAASE,CAAT,GAAaP,EAAb,GAAkBE,EAFpB,EAGEJ,GAAG,CAACO,IAAJ,CAASG,KAAT,GAAiB,IAAIT,EAHvB,EAIED,GAAG,CAACO,IAAJ,CAASI,MAAT,GAAkB,IAAIT,EAJx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K1D,IAAL,CAAU2D,KAAV,CAAgB,KAAKC,IAAI,CAACC,GAAL,CAAS3D,EAAT,CAArB,EAAmC,KAAK0D,IAAI,CAACC,GAAL,CAAS1D,EAAT,CAAxC,CAAd;MACA2B,MAAM,CAACgC,IAAP;MACAhC,MAAM,CAACiC,SAAP,CAAiB9D,GAAjB,EAAsB+D,aAAA,CAAOC,SAA7B,EAAwC,KAAxC;MACA,MAAMlB,MAAM,GAAG,KAAK/C,IAAL,CAAUgD,KAAV,EAAf;MACAD,MAAM,CAACE,QAAP,CAAgB,KAAKjD,IAAL,CAAUkD,KAAV,CAAgBN,KAAhB,CAAhB;MACAG,MAAM,CAACI,SAAP,CAAiBpB,KAAK,CAACG,SAAN,KAAoBD,OAArC;MAEAc,MAAM,CAACK,aAAP,CACE,KAAKpD,IAAL,CAAUqD,UAAV,CAAqBC,QAArB,CAA8BC,gBAAA,CAAUC,MAAxC,EAAgDX,IAAhD,EAAsD,IAAtD,CADF;MAGA,MAAMF,KAAK,GAAG5B,OAAO,CAAC,KAAKf,IAAN,EAAYC,GAAZ,EAAiB6C,MAAjB,EAAyBA,MAAzB,EAAiC5C,EAAjC,EAAqCC,EAArC,CAArB;MACA,MAAM+D,KAAK,GAAGnE,OAAO,CAAC,KAAKC,IAAN,EAAYC,GAAZ,EAAiByD,KAAK,CAACjD,CAAvB,EAA0BiD,KAAK,CAAChD,CAAhC,CAArB;MACAoB,MAAM,CAACqC,UAAP,CAAkBD,KAAlB,EAAyBvB,KAAzB,EAAgCI,MAAhC;MACAjB,MAAM,CAACsC,OAAP;IACD,CAlBH;EAmBD;;AAxDkD"}
1
+ {"version":3,"names":["inflate","Skia","box","dx","dy","tx","ty","RRectXY","XYWHRect","rect","x","y","width","height","rx","ry","deflate","BoxShadowNode","JsiDeclarationNode","constructor","ctx","props","DeclarationType","Unknown","NodeType","BoxShadow","decorate","_ctx","materialize","BoxNode","JsiRenderNode","Box","renderNode","canvas","paint","defaultBox","opacity","getAlphaf","isRRect","shadows","_children","map","node","filter","n","shadow","inner","color","blur","spread","lPaint","Paint","setColor","Color","setAlphaf","setMaskFilter","MaskFilter","MakeBlur","BlurStyle","Normal","drawRRect","delta","Point","Math","abs","save","clipRRect","ClipOp","Intersect","outer","drawDRRect","restore"],"sources":["Box.ts"],"sourcesContent":["import type { SkRRect, Skia } from \"../../../skia/types\";\nimport { BlurStyle, ClipOp, isRRect } from \"../../../skia/types\";\nimport type { DrawingContext } from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport type { BoxShadowProps, BoxProps } from \"../../types/Drawings\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport { JsiRenderNode } from \"../RenderNode\";\nimport type { DeclarationContext } from \"../../types/DeclarationContext\";\n\nconst inflate = (\n Skia: Skia,\n box: SkRRect,\n dx: number,\n dy: number,\n tx = 0,\n ty = 0\n) =>\n Skia.RRectXY(\n Skia.XYWHRect(\n box.rect.x - dx + tx,\n box.rect.y - dy + ty,\n box.rect.width + 2 * dx,\n box.rect.height + 2 * dy\n ),\n box.rx + dx,\n box.ry + dy\n );\n\nconst deflate = (\n Skia: Skia,\n box: SkRRect,\n dx: number,\n dy: number,\n tx = 0,\n ty = 0\n) => inflate(Skia, box, -dx, -dy, tx, ty);\n\nexport class BoxShadowNode extends JsiDeclarationNode<BoxShadowProps> {\n constructor(ctx: NodeContext, props: BoxShadowProps) {\n super(ctx, DeclarationType.Unknown, NodeType.BoxShadow, props);\n }\n\n decorate(_ctx: DeclarationContext) {\n // do nothing\n }\n\n materialize() {\n return this.props;\n }\n}\n\nexport class BoxNode extends JsiRenderNode<BoxProps> {\n constructor(ctx: NodeContext, props: BoxProps) {\n super(ctx, NodeType.Box, props);\n }\n\n renderNode({ canvas, paint }: DrawingContext) {\n const { box: defaultBox } = this.props;\n const opacity = paint.getAlphaf();\n const box = isRRect(defaultBox)\n ? defaultBox\n : this.Skia.RRectXY(defaultBox, 0, 0);\n const shadows = this._children\n .map((node) => {\n if (node instanceof BoxShadowNode) {\n return node.materialize();\n }\n return null;\n })\n .filter((n): n is BoxShadowProps => n !== null);\n shadows\n .filter((shadow) => !shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const lPaint = this.Skia.Paint();\n lPaint.setColor(this.Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n lPaint.setMaskFilter(\n this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(\n inflate(this.Skia, box, spread, spread, dx, dy),\n lPaint\n );\n });\n\n canvas.drawRRect(box, paint);\n\n shadows\n .filter((shadow) => shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const delta = this.Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = this.Skia.Paint();\n lPaint.setColor(this.Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n\n lPaint.setMaskFilter(\n this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(this.Skia, box, spread, spread, dx, dy);\n const outer = inflate(this.Skia, box, delta.x, delta.y);\n canvas.drawDRRect(outer, inner, lPaint);\n canvas.restore();\n });\n }\n}\n"],"mappings":";;;;;;;AACA;;AAEA;;AAGA;;AACA;;AAGA,MAAMA,OAAO,GAAG,UACdC,IADc,EAEdC,GAFc,EAGdC,EAHc,EAIdC,EAJc;EAAA,IAKdC,EALc,uEAKT,CALS;EAAA,IAMdC,EANc,uEAMT,CANS;EAAA,OAQdL,IAAI,CAACM,OAAL,CACEN,IAAI,CAACO,QAAL,CACEN,GAAG,CAACO,IAAJ,CAASC,CAAT,GAAaP,EAAb,GAAkBE,EADpB,EAEEH,GAAG,CAACO,IAAJ,CAASE,CAAT,GAAaP,EAAb,GAAkBE,EAFpB,EAGEJ,GA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ext } from "../../types";
3
+ import { JsiDrawingNode } from "../DrawingNode";
4
+ import type { NodeContext } from "../Node";
5
+ export declare class CircleNode extends JsiDrawingNode<CircleProps, SkPoint> {
6
+ constructor(ctx: NodeContext, props: CircleProps);
7
+ protected deriveProps(): SkPoint;
8
+ draw({ canvas, paint }: DrawingContext): void;
9
+ }