@shopify/react-native-skia 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/cpp/api/JsiSkPaint.h +8 -1
  2. package/lib/commonjs/dom/types/Common.d.ts +6 -4
  3. package/lib/commonjs/dom/types/Common.js.map +1 -1
  4. package/lib/commonjs/dom/types/ImageFilters.d.ts +1 -1
  5. package/lib/commonjs/dom/types/ImageFilters.js.map +1 -1
  6. package/lib/commonjs/dom/types/Node.d.ts +0 -2
  7. package/lib/commonjs/dom/types/Node.js.map +1 -1
  8. package/lib/commonjs/external/reanimated/index.d.ts +0 -1
  9. package/lib/commonjs/external/reanimated/index.js +0 -11
  10. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  11. package/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -1
  12. package/lib/commonjs/external/reanimated/renderHelpers.js +5 -43
  13. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
  14. package/lib/commonjs/skia/types/Paint/Paint.d.ts +1 -0
  15. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  16. package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  17. package/lib/commonjs/skia/web/JsiSkPaint.js +3 -0
  18. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  19. package/lib/commonjs/sksg/Container.d.ts +3 -2
  20. package/lib/commonjs/sksg/Container.js +32 -26
  21. package/lib/commonjs/sksg/Container.js.map +1 -1
  22. package/lib/commonjs/sksg/HostConfig.d.ts +2 -2
  23. package/lib/commonjs/sksg/HostConfig.js +7 -25
  24. package/lib/commonjs/sksg/HostConfig.js.map +1 -1
  25. package/lib/commonjs/sksg/Node.d.ts +19 -0
  26. package/lib/commonjs/sksg/Node.js +78 -0
  27. package/lib/commonjs/sksg/Node.js.map +1 -0
  28. package/lib/commonjs/sksg/Reconciler.d.ts +1 -1
  29. package/lib/commonjs/sksg/Recorder/Core.d.ts +79 -0
  30. package/lib/commonjs/sksg/Recorder/Core.js +110 -0
  31. package/lib/commonjs/sksg/Recorder/Core.js.map +1 -0
  32. package/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +18 -0
  33. package/lib/commonjs/sksg/Recorder/DrawingContext.js +105 -0
  34. package/lib/commonjs/sksg/Recorder/DrawingContext.js.map +1 -0
  35. package/lib/commonjs/sksg/Recorder/Player.d.ts +3 -0
  36. package/lib/commonjs/sksg/Recorder/Player.js +127 -0
  37. package/lib/commonjs/sksg/Recorder/Player.js.map +1 -0
  38. package/lib/commonjs/sksg/Recorder/Recorder.d.ts +50 -0
  39. package/lib/commonjs/sksg/Recorder/Recorder.js +288 -0
  40. package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -0
  41. package/lib/commonjs/sksg/Recorder/Recording.d.ts +7 -0
  42. package/lib/commonjs/sksg/Recorder/Recording.js +12 -0
  43. package/lib/commonjs/sksg/Recorder/Recording.js.map +1 -0
  44. package/lib/commonjs/sksg/Recorder/Visitor.d.ts +5 -0
  45. package/lib/commonjs/sksg/Recorder/Visitor.js +293 -0
  46. package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -0
  47. package/lib/commonjs/sksg/Recorder/commands/Box.d.ts +13 -0
  48. package/lib/commonjs/sksg/Recorder/commands/Box.js +71 -0
  49. package/lib/commonjs/sksg/Recorder/commands/Box.js.map +1 -0
  50. package/lib/commonjs/sksg/Recorder/commands/CTM.d.ts +3 -0
  51. package/lib/commonjs/sksg/Recorder/commands/CTM.js +79 -0
  52. package/lib/commonjs/sksg/Recorder/commands/CTM.js.map +1 -0
  53. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  54. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.js +76 -0
  55. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.js.map +1 -0
  56. package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +24 -0
  57. package/lib/commonjs/sksg/{nodes/drawings.js → Recorder/commands/Drawing.js} +5 -5
  58. package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -0
  59. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  60. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +183 -0
  61. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -0
  62. package/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +4 -0
  63. package/lib/commonjs/sksg/Recorder/commands/Paint.js +70 -0
  64. package/lib/commonjs/sksg/Recorder/commands/Paint.js.map +1 -0
  65. package/lib/commonjs/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  66. package/lib/commonjs/sksg/Recorder/commands/PathEffects.js +137 -0
  67. package/lib/commonjs/sksg/Recorder/commands/PathEffects.js.map +1 -0
  68. package/lib/commonjs/sksg/Recorder/commands/Shaders.d.ts +5 -0
  69. package/lib/commonjs/sksg/{nodes/shaders.js → Recorder/commands/Shaders.js} +58 -15
  70. package/lib/commonjs/sksg/Recorder/commands/Shaders.js.map +1 -0
  71. package/lib/commonjs/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  72. package/lib/commonjs/sksg/{nodes/utils.js → utils.js} +12 -2
  73. package/lib/commonjs/sksg/utils.js.map +1 -0
  74. package/lib/module/dom/types/Common.d.ts +6 -4
  75. package/lib/module/dom/types/Common.js.map +1 -1
  76. package/lib/module/dom/types/ImageFilters.d.ts +1 -1
  77. package/lib/module/dom/types/ImageFilters.js.map +1 -1
  78. package/lib/module/dom/types/Node.d.ts +0 -2
  79. package/lib/module/dom/types/Node.js.map +1 -1
  80. package/lib/module/external/reanimated/index.d.ts +0 -1
  81. package/lib/module/external/reanimated/index.js +0 -1
  82. package/lib/module/external/reanimated/index.js.map +1 -1
  83. package/lib/module/external/reanimated/renderHelpers.d.ts +0 -1
  84. package/lib/module/external/reanimated/renderHelpers.js +4 -42
  85. package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
  86. package/lib/module/skia/types/Paint/Paint.d.ts +1 -0
  87. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  88. package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  89. package/lib/module/skia/web/JsiSkPaint.js +3 -0
  90. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  91. package/lib/module/sksg/Container.d.ts +3 -2
  92. package/lib/module/sksg/Container.js +30 -24
  93. package/lib/module/sksg/Container.js.map +1 -1
  94. package/lib/module/sksg/HostConfig.d.ts +2 -2
  95. package/lib/module/sksg/HostConfig.js +7 -25
  96. package/lib/module/sksg/HostConfig.js.map +1 -1
  97. package/lib/module/sksg/Node.d.ts +19 -0
  98. package/lib/module/sksg/Node.js +67 -0
  99. package/lib/module/sksg/Node.js.map +1 -0
  100. package/lib/module/sksg/Reconciler.d.ts +1 -1
  101. package/lib/module/sksg/Recorder/Core.d.ts +79 -0
  102. package/lib/module/sksg/Recorder/Core.js +101 -0
  103. package/lib/module/sksg/Recorder/Core.js.map +1 -0
  104. package/lib/module/sksg/Recorder/DrawingContext.d.ts +18 -0
  105. package/lib/module/sksg/Recorder/DrawingContext.js +98 -0
  106. package/lib/module/sksg/Recorder/DrawingContext.js.map +1 -0
  107. package/lib/module/sksg/Recorder/Player.d.ts +3 -0
  108. package/lib/module/sksg/Recorder/Player.js +120 -0
  109. package/lib/module/sksg/Recorder/Player.js.map +1 -0
  110. package/lib/module/sksg/Recorder/Recorder.d.ts +50 -0
  111. package/lib/module/sksg/Recorder/Recorder.js +281 -0
  112. package/lib/module/sksg/Recorder/Recorder.js.map +1 -0
  113. package/lib/module/sksg/Recorder/Recording.d.ts +7 -0
  114. package/lib/module/sksg/Recorder/Recording.js +5 -0
  115. package/lib/module/sksg/Recorder/Recording.js.map +1 -0
  116. package/lib/module/sksg/Recorder/Visitor.d.ts +5 -0
  117. package/lib/module/sksg/Recorder/Visitor.js +285 -0
  118. package/lib/module/sksg/Recorder/Visitor.js.map +1 -0
  119. package/lib/module/sksg/Recorder/commands/Box.d.ts +13 -0
  120. package/lib/module/sksg/Recorder/commands/Box.js +63 -0
  121. package/lib/module/sksg/Recorder/commands/Box.js.map +1 -0
  122. package/lib/module/sksg/Recorder/commands/CTM.d.ts +3 -0
  123. package/lib/module/sksg/Recorder/commands/CTM.js +72 -0
  124. package/lib/module/sksg/Recorder/commands/CTM.js.map +1 -0
  125. package/lib/module/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  126. package/lib/module/sksg/Recorder/commands/ColorFilters.js +67 -0
  127. package/lib/module/sksg/Recorder/commands/ColorFilters.js.map +1 -0
  128. package/lib/module/sksg/Recorder/commands/Drawing.d.ts +24 -0
  129. package/lib/module/sksg/{nodes/drawings.js → Recorder/commands/Drawing.js} +5 -5
  130. package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -0
  131. package/lib/module/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  132. package/lib/module/sksg/{nodes/imageFilters.js → Recorder/commands/ImageFilters.js} +87 -95
  133. package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -0
  134. package/lib/module/sksg/Recorder/commands/Paint.d.ts +4 -0
  135. package/lib/module/sksg/Recorder/commands/Paint.js +62 -0
  136. package/lib/module/sksg/Recorder/commands/Paint.js.map +1 -0
  137. package/lib/module/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  138. package/lib/module/sksg/Recorder/commands/PathEffects.js +128 -0
  139. package/lib/module/sksg/Recorder/commands/PathEffects.js.map +1 -0
  140. package/lib/module/sksg/Recorder/commands/Shaders.d.ts +5 -0
  141. package/lib/module/sksg/{nodes/shaders.js → Recorder/commands/Shaders.js} +63 -13
  142. package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -0
  143. package/lib/module/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  144. package/lib/module/sksg/{nodes/utils.js → utils.js} +10 -1
  145. package/lib/module/sksg/utils.js.map +1 -0
  146. package/lib/typescript/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -1
  147. package/lib/typescript/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  148. package/lib/typescript/lib/commonjs/sksg/Container.d.ts +4 -0
  149. package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +1 -3
  150. package/lib/typescript/lib/commonjs/sksg/Node.d.ts +14 -0
  151. package/lib/typescript/lib/commonjs/sksg/Recorder/Core.d.ts +5 -0
  152. package/lib/typescript/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +17 -0
  153. package/lib/typescript/lib/commonjs/sksg/Recorder/Player.d.ts +2 -0
  154. package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +45 -0
  155. package/lib/typescript/lib/commonjs/sksg/Recorder/Recording.d.ts +5 -0
  156. package/lib/typescript/lib/commonjs/sksg/Recorder/Visitor.d.ts +27 -0
  157. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Box.d.ts +3 -0
  158. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/CTM.d.ts +2 -0
  159. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/ColorFilters.d.ts +4 -0
  160. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/ImageFilters.d.ts +6 -0
  161. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +14 -0
  162. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/PathEffects.d.ts +4 -0
  163. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Shaders.d.ts +3 -0
  164. package/lib/typescript/lib/commonjs/sksg/{nodes/utils.d.ts → utils.d.ts} +1 -0
  165. package/lib/typescript/lib/module/external/reanimated/index.d.ts +0 -1
  166. package/lib/typescript/lib/module/external/reanimated/renderHelpers.d.ts +0 -1
  167. package/lib/typescript/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  168. package/lib/typescript/lib/module/sksg/Container.d.ts +4 -0
  169. package/lib/typescript/lib/module/sksg/HostConfig.d.ts +1 -3
  170. package/lib/typescript/lib/module/sksg/Node.d.ts +13 -0
  171. package/lib/typescript/lib/module/sksg/Recorder/Core.d.ts +4 -0
  172. package/lib/typescript/lib/module/sksg/Recorder/DrawingContext.d.ts +16 -0
  173. package/lib/typescript/lib/module/sksg/Recorder/Player.d.ts +1 -0
  174. package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +44 -0
  175. package/lib/typescript/lib/module/sksg/Recorder/Recording.d.ts +4 -0
  176. package/lib/typescript/lib/module/sksg/Recorder/Visitor.d.ts +26 -0
  177. package/lib/typescript/lib/module/sksg/Recorder/commands/Box.d.ts +2 -0
  178. package/lib/typescript/lib/module/sksg/Recorder/commands/CTM.d.ts +1 -0
  179. package/lib/typescript/lib/module/sksg/Recorder/commands/ColorFilters.d.ts +3 -0
  180. package/lib/typescript/lib/module/sksg/Recorder/commands/ImageFilters.d.ts +5 -0
  181. package/lib/typescript/lib/module/sksg/Recorder/commands/Paint.d.ts +13 -0
  182. package/lib/typescript/lib/module/sksg/Recorder/commands/PathEffects.d.ts +3 -0
  183. package/lib/typescript/lib/module/sksg/Recorder/commands/Shaders.d.ts +2 -0
  184. package/lib/typescript/lib/module/sksg/{nodes/utils.d.ts → utils.d.ts} +1 -0
  185. package/lib/typescript/src/dom/types/Common.d.ts +6 -4
  186. package/lib/typescript/src/dom/types/ImageFilters.d.ts +1 -1
  187. package/lib/typescript/src/dom/types/Node.d.ts +0 -2
  188. package/lib/typescript/src/external/reanimated/index.d.ts +0 -1
  189. package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +0 -1
  190. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +1 -0
  191. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  192. package/lib/typescript/src/sksg/Container.d.ts +3 -2
  193. package/lib/typescript/src/sksg/HostConfig.d.ts +2 -2
  194. package/lib/typescript/src/sksg/Node.d.ts +19 -0
  195. package/lib/typescript/src/sksg/Reconciler.d.ts +1 -1
  196. package/lib/typescript/src/sksg/Recorder/Core.d.ts +79 -0
  197. package/lib/typescript/src/sksg/Recorder/DrawingContext.d.ts +18 -0
  198. package/lib/typescript/src/sksg/Recorder/Player.d.ts +3 -0
  199. package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +50 -0
  200. package/lib/typescript/src/sksg/Recorder/Recording.d.ts +7 -0
  201. package/lib/typescript/src/sksg/Recorder/Visitor.d.ts +5 -0
  202. package/lib/typescript/src/sksg/Recorder/commands/Box.d.ts +13 -0
  203. package/lib/typescript/src/sksg/Recorder/commands/CTM.d.ts +3 -0
  204. package/lib/typescript/src/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  205. package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +24 -0
  206. package/lib/typescript/src/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  207. package/lib/typescript/src/sksg/Recorder/commands/Paint.d.ts +4 -0
  208. package/lib/typescript/src/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  209. package/lib/typescript/src/sksg/Recorder/commands/Shaders.d.ts +5 -0
  210. package/lib/typescript/src/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  211. package/package.json +1 -1
  212. package/src/__tests__/snapshots/image-filter/test-shadow.png +0 -0
  213. package/src/dom/types/Common.ts +7 -5
  214. package/src/dom/types/ImageFilters.ts +2 -1
  215. package/src/dom/types/Node.ts +0 -4
  216. package/src/external/reanimated/index.ts +0 -1
  217. package/src/external/reanimated/renderHelpers.ts +4 -44
  218. package/src/renderer/__tests__/e2e/ColorFilters.spec.tsx +15 -0
  219. package/src/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.tsx +23 -2
  220. package/src/renderer/__tests__/e2e/ImageFilters.spec.tsx +91 -2
  221. package/src/renderer/__tests__/setup.tsx +1 -1
  222. package/src/skia/types/Paint/Paint.ts +2 -0
  223. package/src/skia/web/JsiSkPaint.ts +4 -0
  224. package/src/sksg/Container.ts +35 -29
  225. package/src/sksg/HostConfig.ts +5 -50
  226. package/src/sksg/Node.ts +105 -0
  227. package/src/sksg/Recorder/Core.ts +171 -0
  228. package/src/sksg/Recorder/DrawingContext.ts +130 -0
  229. package/src/sksg/Recorder/Player.ts +160 -0
  230. package/src/sksg/Recorder/Recorder.ts +259 -0
  231. package/src/sksg/Recorder/Recording.ts +13 -0
  232. package/src/sksg/Recorder/Visitor.ts +324 -0
  233. package/src/sksg/Recorder/commands/Box.ts +63 -0
  234. package/src/sksg/Recorder/commands/CTM.ts +72 -0
  235. package/src/sksg/Recorder/commands/ColorFilters.ts +87 -0
  236. package/src/sksg/{nodes/drawings.ts → Recorder/commands/Drawing.ts} +29 -65
  237. package/src/sksg/Recorder/commands/ImageFilters.ts +255 -0
  238. package/src/sksg/Recorder/commands/Paint.ts +77 -0
  239. package/src/sksg/Recorder/commands/PathEffects.ts +169 -0
  240. package/src/sksg/{nodes/shaders.ts → Recorder/commands/Shaders.ts} +100 -26
  241. package/src/sksg/{nodes/utils.ts → utils.ts} +14 -1
  242. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  243. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js +0 -24
  244. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js.map +0 -1
  245. package/lib/commonjs/sksg/DeclarationContext.d.ts +0 -56
  246. package/lib/commonjs/sksg/DeclarationContext.js +0 -77
  247. package/lib/commonjs/sksg/DeclarationContext.js.map +0 -1
  248. package/lib/commonjs/sksg/DrawingContext.d.ts +0 -13
  249. package/lib/commonjs/sksg/DrawingContext.js +0 -172
  250. package/lib/commonjs/sksg/DrawingContext.js.map +0 -1
  251. package/lib/commonjs/sksg/__tests__/Declarations.spec.d.ts +0 -1
  252. package/lib/commonjs/sksg/__tests__/MockDeclaration.d.ts +0 -57
  253. package/lib/commonjs/sksg/nodes/Node.d.ts +0 -7
  254. package/lib/commonjs/sksg/nodes/Node.js +0 -6
  255. package/lib/commonjs/sksg/nodes/Node.js.map +0 -1
  256. package/lib/commonjs/sksg/nodes/colorFilters.d.ts +0 -10
  257. package/lib/commonjs/sksg/nodes/colorFilters.js +0 -79
  258. package/lib/commonjs/sksg/nodes/colorFilters.js.map +0 -1
  259. package/lib/commonjs/sksg/nodes/context.d.ts +0 -3
  260. package/lib/commonjs/sksg/nodes/context.js +0 -394
  261. package/lib/commonjs/sksg/nodes/context.js.map +0 -1
  262. package/lib/commonjs/sksg/nodes/drawings.d.ts +0 -30
  263. package/lib/commonjs/sksg/nodes/drawings.js.map +0 -1
  264. package/lib/commonjs/sksg/nodes/imageFilters.d.ts +0 -17
  265. package/lib/commonjs/sksg/nodes/imageFilters.js +0 -197
  266. package/lib/commonjs/sksg/nodes/imageFilters.js.map +0 -1
  267. package/lib/commonjs/sksg/nodes/index.d.ts +0 -3
  268. package/lib/commonjs/sksg/nodes/index.js +0 -39
  269. package/lib/commonjs/sksg/nodes/index.js.map +0 -1
  270. package/lib/commonjs/sksg/nodes/paint.d.ts +0 -3
  271. package/lib/commonjs/sksg/nodes/paint.js +0 -81
  272. package/lib/commonjs/sksg/nodes/paint.js.map +0 -1
  273. package/lib/commonjs/sksg/nodes/pathEffects.d.ts +0 -11
  274. package/lib/commonjs/sksg/nodes/pathEffects.js +0 -111
  275. package/lib/commonjs/sksg/nodes/pathEffects.js.map +0 -1
  276. package/lib/commonjs/sksg/nodes/shaders.d.ts +0 -11
  277. package/lib/commonjs/sksg/nodes/shaders.js.map +0 -1
  278. package/lib/commonjs/sksg/nodes/utils.js.map +0 -1
  279. package/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  280. package/lib/module/external/reanimated/useDerivedValueOnJS.js +0 -16
  281. package/lib/module/external/reanimated/useDerivedValueOnJS.js.map +0 -1
  282. package/lib/module/sksg/DeclarationContext.d.ts +0 -56
  283. package/lib/module/sksg/DeclarationContext.js +0 -69
  284. package/lib/module/sksg/DeclarationContext.js.map +0 -1
  285. package/lib/module/sksg/DrawingContext.d.ts +0 -13
  286. package/lib/module/sksg/DrawingContext.js +0 -165
  287. package/lib/module/sksg/DrawingContext.js.map +0 -1
  288. package/lib/module/sksg/__tests__/Declarations.spec.d.ts +0 -1
  289. package/lib/module/sksg/__tests__/MockDeclaration.d.ts +0 -57
  290. package/lib/module/sksg/nodes/Node.d.ts +0 -7
  291. package/lib/module/sksg/nodes/Node.js +0 -2
  292. package/lib/module/sksg/nodes/Node.js.map +0 -1
  293. package/lib/module/sksg/nodes/colorFilters.d.ts +0 -10
  294. package/lib/module/sksg/nodes/colorFilters.js +0 -66
  295. package/lib/module/sksg/nodes/colorFilters.js.map +0 -1
  296. package/lib/module/sksg/nodes/context.d.ts +0 -3
  297. package/lib/module/sksg/nodes/context.js +0 -387
  298. package/lib/module/sksg/nodes/context.js.map +0 -1
  299. package/lib/module/sksg/nodes/drawings.d.ts +0 -30
  300. package/lib/module/sksg/nodes/drawings.js.map +0 -1
  301. package/lib/module/sksg/nodes/imageFilters.d.ts +0 -17
  302. package/lib/module/sksg/nodes/imageFilters.js.map +0 -1
  303. package/lib/module/sksg/nodes/index.d.ts +0 -3
  304. package/lib/module/sksg/nodes/index.js +0 -4
  305. package/lib/module/sksg/nodes/index.js.map +0 -1
  306. package/lib/module/sksg/nodes/paint.d.ts +0 -3
  307. package/lib/module/sksg/nodes/paint.js +0 -74
  308. package/lib/module/sksg/nodes/paint.js.map +0 -1
  309. package/lib/module/sksg/nodes/pathEffects.d.ts +0 -11
  310. package/lib/module/sksg/nodes/pathEffects.js +0 -97
  311. package/lib/module/sksg/nodes/pathEffects.js.map +0 -1
  312. package/lib/module/sksg/nodes/shaders.d.ts +0 -11
  313. package/lib/module/sksg/nodes/shaders.js.map +0 -1
  314. package/lib/module/sksg/nodes/utils.js.map +0 -1
  315. package/lib/typescript/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +0 -2
  316. package/lib/typescript/lib/commonjs/sksg/DeclarationContext.d.ts +0 -53
  317. package/lib/typescript/lib/commonjs/sksg/DrawingContext.d.ts +0 -22
  318. package/lib/typescript/lib/commonjs/sksg/nodes/Node.d.ts +0 -1
  319. package/lib/typescript/lib/commonjs/sksg/nodes/colorFilters.d.ts +0 -8
  320. package/lib/typescript/lib/commonjs/sksg/nodes/context.d.ts +0 -2
  321. package/lib/typescript/lib/commonjs/sksg/nodes/imageFilters.d.ts +0 -12
  322. package/lib/typescript/lib/commonjs/sksg/nodes/index.d.ts +0 -1
  323. package/lib/typescript/lib/commonjs/sksg/nodes/paint.d.ts +0 -2
  324. package/lib/typescript/lib/commonjs/sksg/nodes/pathEffects.d.ts +0 -9
  325. package/lib/typescript/lib/commonjs/sksg/nodes/shaders.d.ts +0 -10
  326. package/lib/typescript/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  327. package/lib/typescript/lib/module/sksg/DeclarationContext.d.ts +0 -52
  328. package/lib/typescript/lib/module/sksg/DrawingContext.d.ts +0 -21
  329. package/lib/typescript/lib/module/sksg/nodes/Node.d.ts +0 -1
  330. package/lib/typescript/lib/module/sksg/nodes/colorFilters.d.ts +0 -7
  331. package/lib/typescript/lib/module/sksg/nodes/context.d.ts +0 -1
  332. package/lib/typescript/lib/module/sksg/nodes/imageFilters.d.ts +0 -11
  333. package/lib/typescript/lib/module/sksg/nodes/index.d.ts +0 -3
  334. package/lib/typescript/lib/module/sksg/nodes/paint.d.ts +0 -1
  335. package/lib/typescript/lib/module/sksg/nodes/pathEffects.d.ts +0 -8
  336. package/lib/typescript/lib/module/sksg/nodes/shaders.d.ts +0 -9
  337. package/lib/typescript/src/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  338. package/lib/typescript/src/sksg/DeclarationContext.d.ts +0 -56
  339. package/lib/typescript/src/sksg/DrawingContext.d.ts +0 -13
  340. package/lib/typescript/src/sksg/__tests__/Declarations.spec.d.ts +0 -1
  341. package/lib/typescript/src/sksg/__tests__/MockDeclaration.d.ts +0 -57
  342. package/lib/typescript/src/sksg/nodes/Node.d.ts +0 -7
  343. package/lib/typescript/src/sksg/nodes/colorFilters.d.ts +0 -10
  344. package/lib/typescript/src/sksg/nodes/context.d.ts +0 -3
  345. package/lib/typescript/src/sksg/nodes/drawings.d.ts +0 -30
  346. package/lib/typescript/src/sksg/nodes/imageFilters.d.ts +0 -17
  347. package/lib/typescript/src/sksg/nodes/index.d.ts +0 -3
  348. package/lib/typescript/src/sksg/nodes/paint.d.ts +0 -3
  349. package/lib/typescript/src/sksg/nodes/pathEffects.d.ts +0 -11
  350. package/lib/typescript/src/sksg/nodes/shaders.d.ts +0 -11
  351. package/src/external/reanimated/useDerivedValueOnJS.ts +0 -20
  352. package/src/sksg/DeclarationContext.ts +0 -85
  353. package/src/sksg/DrawingContext.ts +0 -226
  354. package/src/sksg/__tests__/Declarations.spec.tsx +0 -235
  355. package/src/sksg/__tests__/MockDeclaration.ts +0 -138
  356. package/src/sksg/nodes/Node.ts +0 -8
  357. package/src/sksg/nodes/colorFilters.ts +0 -79
  358. package/src/sksg/nodes/context.ts +0 -412
  359. package/src/sksg/nodes/imageFilters.ts +0 -235
  360. package/src/sksg/nodes/index.ts +0 -3
  361. package/src/sksg/nodes/paint.ts +0 -75
  362. package/src/sksg/nodes/pathEffects.ts +0 -118
  363. /package/lib/typescript/lib/commonjs/sksg/{nodes/drawings.d.ts → Recorder/commands/Drawing.d.ts} +0 -0
  364. /package/lib/typescript/lib/module/sksg/{nodes/drawings.d.ts → Recorder/commands/Drawing.d.ts} +0 -0
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.sksgHostConfig = exports.debug = void 0;
7
7
  var _constants = require("react-reconciler/constants");
8
- var _types = require("../dom/types");
9
8
  var _typeddash = require("../renderer/typeddash");
10
9
  /*global NodeJS*/
11
10
 
@@ -16,26 +15,6 @@ const debug = (...args) => {
16
15
  }
17
16
  };
18
17
  exports.debug = debug;
19
- const isDeclaration = type => {
20
- "worklet";
21
-
22
- return (
23
- // BlurMaskFilters
24
- type === _types.NodeType.BlurMaskFilter ||
25
- // ImageFilters
26
- type === _types.NodeType.BlendImageFilter || type === _types.NodeType.BlurImageFilter || type === _types.NodeType.OffsetImageFilter || type === _types.NodeType.DropShadowImageFilter || type === _types.NodeType.MorphologyImageFilter || type === _types.NodeType.DisplacementMapImageFilter || type === _types.NodeType.RuntimeShaderImageFilter ||
27
- // ColorFilters
28
- type === _types.NodeType.MatrixColorFilter || type === _types.NodeType.BlendColorFilter || type === _types.NodeType.LumaColorFilter || type === _types.NodeType.LinearToSRGBGammaColorFilter || type === _types.NodeType.SRGBToLinearGammaColorFilter || type === _types.NodeType.LerpColorFilter ||
29
- // Shaders
30
- type === _types.NodeType.Shader || type === _types.NodeType.ImageShader || type === _types.NodeType.ColorShader || type === _types.NodeType.Turbulence || type === _types.NodeType.FractalNoise || type === _types.NodeType.LinearGradient || type === _types.NodeType.RadialGradient || type === _types.NodeType.SweepGradient || type === _types.NodeType.TwoPointConicalGradient ||
31
- // Path Effects
32
- type === _types.NodeType.CornerPathEffect || type === _types.NodeType.DiscretePathEffect || type === _types.NodeType.DashPathEffect || type === _types.NodeType.Path1DPathEffect || type === _types.NodeType.Path2DPathEffect || type === _types.NodeType.SumPathEffect || type === _types.NodeType.Line2DPathEffect ||
33
- // Mixed
34
- type === _types.NodeType.Blend ||
35
- // Paint
36
- type === _types.NodeType.Paint
37
- );
38
- };
39
18
  const sksgHostConfig = exports.sksgHostConfig = {
40
19
  /**
41
20
  * This function is used by the reconciler in order to calculate current time for prioritising work.
@@ -64,12 +43,16 @@ const sksgHostConfig = exports.sksgHostConfig = {
64
43
  // return SpanNode({}, text) as SkNode;
65
44
  throw new Error("Text nodes are not supported yet");
66
45
  },
67
- createInstance(type, props, container, _hostContext, _internalInstanceHandle) {
46
+ createInstance(type, propsWithChildren, container, _hostContext, _internalInstanceHandle) {
47
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
+ const {
49
+ children,
50
+ ...props
51
+ } = propsWithChildren;
68
52
  debug("createInstance", type);
69
53
  container.registerValues(props);
70
54
  const instance = {
71
55
  type,
72
- isDeclaration: isDeclaration(type),
73
56
  props,
74
57
  children: []
75
58
  };
@@ -123,8 +106,7 @@ const sksgHostConfig = exports.sksgHostConfig = {
123
106
  return {
124
107
  type: instance.type,
125
108
  props: newProps,
126
- children: keepChildren ? [...instance.children] : [],
127
- isDeclaration: instance.isDeclaration
109
+ children: keepChildren ? [...instance.children] : []
128
110
  };
129
111
  },
130
112
  createContainerChildSet() {
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","require","_types","_typeddash","DEBUG","debug","args","console","log","exports","isDeclaration","type","NodeType","BlurMaskFilter","BlendImageFilter","BlurImageFilter","OffsetImageFilter","DropShadowImageFilter","MorphologyImageFilter","DisplacementMapImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","LerpColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","Paint","sksgHostConfig","supportsMutation","isPrimaryRenderer","supportsPersistence","supportsHydration","scheduleTimeout","setTimeout","cancelTimeout","clearTimeout","noTimeout","getRootHostContext","_rootContainerInstance","getChildHostContext","_parentHostContext","_type","shouldSetTextContent","_props","createTextInstance","_text","_hostContext","_internalInstanceHandle","Error","createInstance","props","container","registerValues","instance","children","appendInitialChild","parentInstance","child","push","finalizeInitialChildren","commitMount","prepareForCommit","_containerInfo","resetAfterCommit","redraw","getPublicInstance","node","commitTextUpdate","_textInstance","_oldText","_newText","clearContainer","clear","prepareUpdate","_instance","oldProps","newProps","propsAreEqual","shallowEq","unregisterValues","preparePortalMount","cloneInstance","_updatePayload","_oldProps","keepChildren","_recyclableInstance","createContainerChildSet","appendChildToContainerChildSet","childSet","finalizeContainerChildren","newChildren","root","replaceContainerChildren","cloneHiddenInstance","cloneHiddenTextInstance","getCurrentEventPriority","DefaultEventPriority","beforeActiveInstanceBlur","afterActiveInstanceBlur","detachDeletedInstance","getInstanceFromNode","_node","prepareScopeUpdate","_scopeInstance","getInstanceFromScope"],"sources":["HostConfig.ts"],"sourcesContent":["/*global NodeJS*/\nimport type { Fiber, HostConfig } from \"react-reconciler\";\nimport { DefaultEventPriority } from \"react-reconciler/constants\";\n\nimport { NodeType } from \"../dom/types\";\nimport { shallowEq } from \"../renderer/typeddash\";\n\nimport type { Node } from \"./nodes/Node\";\nimport type { Container } from \"./Container\";\n\nconst DEBUG = false;\nexport const debug = (...args: Parameters<typeof console.log>) => {\n if (DEBUG) {\n console.log(...args);\n }\n};\n\nconst isDeclaration = (type: NodeType) => {\n \"worklet\";\n return (\n // BlurMaskFilters\n type === NodeType.BlurMaskFilter ||\n // ImageFilters\n type === NodeType.BlendImageFilter ||\n type === NodeType.BlurImageFilter ||\n type === NodeType.OffsetImageFilter ||\n type === NodeType.DropShadowImageFilter ||\n type === NodeType.MorphologyImageFilter ||\n type === NodeType.DisplacementMapImageFilter ||\n type === NodeType.RuntimeShaderImageFilter ||\n // ColorFilters\n type === NodeType.MatrixColorFilter ||\n type === NodeType.BlendColorFilter ||\n type === NodeType.LumaColorFilter ||\n type === NodeType.LinearToSRGBGammaColorFilter ||\n type === NodeType.SRGBToLinearGammaColorFilter ||\n type === NodeType.LerpColorFilter ||\n // Shaders\n type === NodeType.Shader ||\n type === NodeType.ImageShader ||\n type === NodeType.ColorShader ||\n type === NodeType.Turbulence ||\n type === NodeType.FractalNoise ||\n type === NodeType.LinearGradient ||\n type === NodeType.RadialGradient ||\n type === NodeType.SweepGradient ||\n type === NodeType.TwoPointConicalGradient ||\n // Path Effects\n type === NodeType.CornerPathEffect ||\n type === NodeType.DiscretePathEffect ||\n type === NodeType.DashPathEffect ||\n type === NodeType.Path1DPathEffect ||\n type === NodeType.Path2DPathEffect ||\n type === NodeType.SumPathEffect ||\n type === NodeType.Line2DPathEffect ||\n // Mixed\n type === NodeType.Blend ||\n // Paint\n type === NodeType.Paint\n );\n};\n\ntype Instance = Node;\n\ntype Props = object;\ntype TextInstance = Node;\ntype SuspenseInstance = Instance;\ntype HydratableInstance = Instance;\ntype PublicInstance = Instance;\ntype HostContext = null;\ntype UpdatePayload = Container;\ntype ChildSet = Node[];\ntype TimeoutHandle = NodeJS.Timeout;\ntype NoTimeout = -1;\n\ntype SkiaHostConfig = HostConfig<\n NodeType,\n Props,\n Container,\n Instance,\n TextInstance,\n SuspenseInstance,\n HydratableInstance,\n PublicInstance,\n HostContext,\n UpdatePayload,\n ChildSet,\n TimeoutHandle,\n NoTimeout\n>;\n\nexport const sksgHostConfig: SkiaHostConfig = {\n /**\n * This function is used by the reconciler in order to calculate current time for prioritising work.\n */\n supportsMutation: false,\n isPrimaryRenderer: false,\n supportsPersistence: true,\n supportsHydration: false,\n //supportsMicrotask: true,\n scheduleTimeout: setTimeout,\n cancelTimeout: clearTimeout,\n noTimeout: -1,\n\n getRootHostContext: (_rootContainerInstance: Container) => {\n debug(\"getRootHostContext\");\n return null;\n },\n\n getChildHostContext(_parentHostContext, _type, _rootContainerInstance) {\n debug(\"getChildHostContext\");\n return null;\n },\n\n shouldSetTextContent(_type, _props) {\n return false;\n },\n\n createTextInstance(\n _text,\n _rootContainerInstance,\n _hostContext,\n _internalInstanceHandle\n ) {\n debug(\"createTextInstance\");\n // return SpanNode({}, text) as SkNode;\n throw new Error(\"Text nodes are not supported yet\");\n },\n\n createInstance(\n type,\n props,\n container,\n _hostContext,\n _internalInstanceHandle\n ) {\n debug(\"createInstance\", type);\n container.registerValues(props);\n const instance = {\n type,\n isDeclaration: isDeclaration(type),\n props,\n children: [],\n };\n return instance;\n },\n\n appendInitialChild(parentInstance: Instance, child: Instance | TextInstance) {\n parentInstance.children.push(child);\n },\n\n finalizeInitialChildren(\n parentInstance,\n _type,\n _props,\n _rootContainerInstance,\n _hostContext\n ) {\n debug(\"finalizeInitialChildren\", parentInstance);\n return false;\n },\n\n commitMount() {\n // if finalizeInitialChildren = true\n debug(\"commitMount\");\n },\n\n prepareForCommit(_containerInfo) {\n debug(\"prepareForCommit\");\n return null;\n },\n\n resetAfterCommit(container) {\n debug(\"resetAfterCommit\");\n container.redraw();\n },\n\n getPublicInstance(node: Instance) {\n debug(\"getPublicInstance\");\n return node;\n },\n\n commitTextUpdate: (\n _textInstance: TextInstance,\n _oldText: string,\n _newText: string\n ) => {\n // textInstance.instance = newText;\n },\n\n clearContainer: (container) => {\n debug(\"clearContainer\");\n container.clear();\n },\n\n prepareUpdate(\n _instance: Instance,\n _type: string,\n oldProps: Props,\n newProps: Props,\n container: Container,\n _hostContext: HostContext\n ) {\n debug(\"prepareUpdate\");\n const propsAreEqual = shallowEq(oldProps, newProps);\n if (propsAreEqual) {\n return null;\n }\n container.unregisterValues(oldProps);\n container.registerValues(newProps);\n return container;\n },\n\n preparePortalMount: () => {\n debug(\"preparePortalMount\");\n },\n\n cloneInstance(\n instance,\n _updatePayload,\n _type,\n _oldProps,\n newProps,\n _internalInstanceHandle,\n keepChildren: boolean,\n _recyclableInstance: null | Instance\n ) {\n debug(\"cloneInstance\");\n\n return {\n type: instance.type,\n props: newProps,\n children: keepChildren ? [...instance.children] : [],\n isDeclaration: instance.isDeclaration,\n };\n },\n\n createContainerChildSet(): ChildSet {\n debug(\"createContainerChildSet\");\n return [];\n },\n\n appendChildToContainerChildSet(\n childSet: ChildSet,\n child: Instance | TextInstance\n ): void {\n childSet.push(child);\n },\n\n finalizeContainerChildren(container: Container, newChildren: ChildSet) {\n debug(\"finalizeContainerChildren\");\n container.root = newChildren;\n },\n\n replaceContainerChildren(container: Container, newChildren: ChildSet) {\n debug(\"replaceContainerChildren\");\n container.root = newChildren;\n },\n\n cloneHiddenInstance(\n _instance: Instance,\n _type: string,\n _props: Props\n ): Instance {\n debug(\"cloneHiddenInstance\");\n throw new Error(\"Not yet implemented.\");\n },\n\n cloneHiddenTextInstance(_instance: Instance, _text: string): TextInstance {\n debug(\"cloneHiddenTextInstance\");\n throw new Error(\"Not yet implemented.\");\n },\n // see https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874\n getCurrentEventPriority: () => DefaultEventPriority,\n beforeActiveInstanceBlur: () => {},\n afterActiveInstanceBlur: () => {},\n detachDeletedInstance: () => {},\n getInstanceFromNode: function (_node): Fiber | null | undefined {\n throw new Error(\"Function not implemented.\");\n },\n prepareScopeUpdate: function (_scopeInstance, _instance): void {\n throw new Error(\"Function not implemented.\");\n },\n getInstanceFromScope: function (_scopeInstance): Instance | null {\n throw new Error(\"Function not implemented.\");\n },\n};\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AALA;;AAUA,MAAMG,KAAK,GAAG,KAAK;AACZ,MAAMC,KAAK,GAAGA,CAAC,GAAGC,IAAoC,KAAK;EAChE,IAAIF,KAAK,EAAE;IACTG,OAAO,CAACC,GAAG,CAAC,GAAGF,IAAI,CAAC;EACtB;AACF,CAAC;AAACG,OAAA,CAAAJ,KAAA,GAAAA,KAAA;AAEF,MAAMK,aAAa,GAAIC,IAAc,IAAK;EACxC,SAAS;;EACT;IACE;IACAA,IAAI,KAAKC,eAAQ,CAACC,cAAc;IAChC;IACAF,IAAI,KAAKC,eAAQ,CAACE,gBAAgB,IAClCH,IAAI,KAAKC,eAAQ,CAACG,eAAe,IACjCJ,IAAI,KAAKC,eAAQ,CAACI,iBAAiB,IACnCL,IAAI,KAAKC,eAAQ,CAACK,qBAAqB,IACvCN,IAAI,KAAKC,eAAQ,CAACM,qBAAqB,IACvCP,IAAI,KAAKC,eAAQ,CAACO,0BAA0B,IAC5CR,IAAI,KAAKC,eAAQ,CAACQ,wBAAwB;IAC1C;IACAT,IAAI,KAAKC,eAAQ,CAACS,iBAAiB,IACnCV,IAAI,KAAKC,eAAQ,CAACU,gBAAgB,IAClCX,IAAI,KAAKC,eAAQ,CAACW,eAAe,IACjCZ,IAAI,KAAKC,eAAQ,CAACY,4BAA4B,IAC9Cb,IAAI,KAAKC,eAA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,KAAK,CAAC,2BAA2B,CAAC;EAC9C,CAAC;EACDwD,oBAAoB,EAAE,SAAAA,CAAUD,cAAc,EAAmB;IAC/D,MAAM,IAAIvD,KAAK,CAAC,2BAA2B,CAAC;EAC9C;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_constants","require","_typeddash","DEBUG","debug","args","console","log","exports","sksgHostConfig","supportsMutation","isPrimaryRenderer","supportsPersistence","supportsHydration","scheduleTimeout","setTimeout","cancelTimeout","clearTimeout","noTimeout","getRootHostContext","_rootContainerInstance","getChildHostContext","_parentHostContext","_type","shouldSetTextContent","_props","createTextInstance","_text","_hostContext","_internalInstanceHandle","Error","createInstance","type","propsWithChildren","container","children","props","registerValues","instance","appendInitialChild","parentInstance","child","push","finalizeInitialChildren","commitMount","prepareForCommit","_containerInfo","resetAfterCommit","redraw","getPublicInstance","node","commitTextUpdate","_textInstance","_oldText","_newText","clearContainer","clear","prepareUpdate","_instance","oldProps","newProps","propsAreEqual","shallowEq","unregisterValues","preparePortalMount","cloneInstance","_updatePayload","_oldProps","keepChildren","_recyclableInstance","createContainerChildSet","appendChildToContainerChildSet","childSet","finalizeContainerChildren","newChildren","root","replaceContainerChildren","cloneHiddenInstance","cloneHiddenTextInstance","getCurrentEventPriority","DefaultEventPriority","beforeActiveInstanceBlur","afterActiveInstanceBlur","detachDeletedInstance","getInstanceFromNode","_node","prepareScopeUpdate","_scopeInstance","getInstanceFromScope"],"sources":["HostConfig.ts"],"sourcesContent":["/*global NodeJS*/\nimport type { Fiber, HostConfig } from \"react-reconciler\";\nimport { DefaultEventPriority } from \"react-reconciler/constants\";\n\nimport type { NodeType } from \"../dom/types\";\nimport { shallowEq } from \"../renderer/typeddash\";\n\nimport type { Node } from \"./Node\";\nimport type { Container } from \"./Container\";\n\nconst DEBUG = false;\nexport const debug = (...args: Parameters<typeof console.log>) => {\n if (DEBUG) {\n console.log(...args);\n }\n};\n\ntype Instance = Node;\n\ntype Props = object;\ntype TextInstance = Node;\ntype SuspenseInstance = Instance;\ntype HydratableInstance = Instance;\ntype PublicInstance = Instance;\ntype HostContext = null;\ntype UpdatePayload = Container;\ntype ChildSet = Node[];\ntype TimeoutHandle = NodeJS.Timeout;\ntype NoTimeout = -1;\n\ntype SkiaHostConfig = HostConfig<\n NodeType,\n Props,\n Container,\n Instance,\n TextInstance,\n SuspenseInstance,\n HydratableInstance,\n PublicInstance,\n HostContext,\n UpdatePayload,\n ChildSet,\n TimeoutHandle,\n NoTimeout\n>;\n\nexport const sksgHostConfig: SkiaHostConfig = {\n /**\n * This function is used by the reconciler in order to calculate current time for prioritising work.\n */\n supportsMutation: false,\n isPrimaryRenderer: false,\n supportsPersistence: true,\n supportsHydration: false,\n //supportsMicrotask: true,\n scheduleTimeout: setTimeout,\n cancelTimeout: clearTimeout,\n noTimeout: -1,\n\n getRootHostContext: (_rootContainerInstance: Container) => {\n debug(\"getRootHostContext\");\n return null;\n },\n\n getChildHostContext(_parentHostContext, _type, _rootContainerInstance) {\n debug(\"getChildHostContext\");\n return null;\n },\n\n shouldSetTextContent(_type, _props) {\n return false;\n },\n\n createTextInstance(\n _text,\n _rootContainerInstance,\n _hostContext,\n _internalInstanceHandle\n ) {\n debug(\"createTextInstance\");\n // return SpanNode({}, text) as SkNode;\n throw new Error(\"Text nodes are not supported yet\");\n },\n\n createInstance(\n type,\n propsWithChildren,\n container,\n _hostContext,\n _internalInstanceHandle\n ) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const { children, ...props } = propsWithChildren as any;\n debug(\"createInstance\", type);\n container.registerValues(props);\n const instance = {\n type,\n props,\n children: [],\n };\n return instance;\n },\n\n appendInitialChild(parentInstance: Instance, child: Instance | TextInstance) {\n parentInstance.children.push(child);\n },\n\n finalizeInitialChildren(\n parentInstance,\n _type,\n _props,\n _rootContainerInstance,\n _hostContext\n ) {\n debug(\"finalizeInitialChildren\", parentInstance);\n return false;\n },\n\n commitMount() {\n // if finalizeInitialChildren = true\n debug(\"commitMount\");\n },\n\n prepareForCommit(_containerInfo) {\n debug(\"prepareForCommit\");\n return null;\n },\n\n resetAfterCommit(container) {\n debug(\"resetAfterCommit\");\n container.redraw();\n },\n\n getPublicInstance(node: Instance) {\n debug(\"getPublicInstance\");\n return node;\n },\n\n commitTextUpdate: (\n _textInstance: TextInstance,\n _oldText: string,\n _newText: string\n ) => {\n // textInstance.instance = newText;\n },\n\n clearContainer: (container) => {\n debug(\"clearContainer\");\n container.clear();\n },\n\n prepareUpdate(\n _instance: Instance,\n _type: string,\n oldProps: Props,\n newProps: Props,\n container: Container,\n _hostContext: HostContext\n ) {\n debug(\"prepareUpdate\");\n const propsAreEqual = shallowEq(oldProps, newProps);\n if (propsAreEqual) {\n return null;\n }\n container.unregisterValues(oldProps);\n container.registerValues(newProps);\n return container;\n },\n\n preparePortalMount: () => {\n debug(\"preparePortalMount\");\n },\n\n cloneInstance(\n instance,\n _updatePayload,\n _type,\n _oldProps,\n newProps,\n _internalInstanceHandle,\n keepChildren: boolean,\n _recyclableInstance: null | Instance\n ) {\n debug(\"cloneInstance\");\n\n return {\n type: instance.type,\n props: newProps,\n children: keepChildren ? [...instance.children] : [],\n };\n },\n\n createContainerChildSet(): ChildSet {\n debug(\"createContainerChildSet\");\n return [];\n },\n\n appendChildToContainerChildSet(\n childSet: ChildSet,\n child: Instance | TextInstance\n ): void {\n childSet.push(child);\n },\n\n finalizeContainerChildren(container: Container, newChildren: ChildSet) {\n debug(\"finalizeContainerChildren\");\n container.root = newChildren;\n },\n\n replaceContainerChildren(container: Container, newChildren: ChildSet) {\n debug(\"replaceContainerChildren\");\n container.root = newChildren;\n },\n\n cloneHiddenInstance(\n _instance: Instance,\n _type: string,\n _props: Props\n ): Instance {\n debug(\"cloneHiddenInstance\");\n throw new Error(\"Not yet implemented.\");\n },\n\n cloneHiddenTextInstance(_instance: Instance, _text: string): TextInstance {\n debug(\"cloneHiddenTextInstance\");\n throw new Error(\"Not yet implemented.\");\n },\n // see https://github.com/pmndrs/react-three-fiber/pull/2360#discussion_r916356874\n getCurrentEventPriority: () => DefaultEventPriority,\n beforeActiveInstanceBlur: () => {},\n afterActiveInstanceBlur: () => {},\n detachDeletedInstance: () => {},\n getInstanceFromNode: function (_node): Fiber | null | undefined {\n throw new Error(\"Function not implemented.\");\n },\n prepareScopeUpdate: function (_scopeInstance, _instance): void {\n throw new Error(\"Function not implemented.\");\n },\n getInstanceFromScope: function (_scopeInstance): Instance | null {\n throw new Error(\"Function not implemented.\");\n },\n};\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAD,OAAA;AALA;;AAUA,MAAME,KAAK,GAAG,KAAK;AACZ,MAAMC,KAAK,GAAGA,CAAC,GAAGC,IAAoC,KAAK;EAChE,IAAIF,KAAK,EAAE;IACTG,OAAO,CAACC,GAAG,CAAC,GAAGF,IAAI,CAAC;EACtB;AACF,CAAC;AAACG,OAAA,CAAAJ,KAAA,GAAAA,KAAA;AA+BK,MAAMK,cAA8B,GAAAD,OAAA,CAAAC,cAAA,GAAG;EAC5C;AACF;AACA;EACEC,gBAAgB,EAAE,KAAK;EACvBC,iBAAiB,EAAE,KAAK;EACxBC,mBAAmB,EAAE,IAAI;EACzBC,iBAAiB,EAAE,KAAK;EACxB;EACAC,eAAe,EAAEC,UAAU;EAC3BC,aAAa,EAAEC,YAAY;EAC3BC,SAAS,EAAE,CAAC,CAAC;EAEbC,kBAAkB,EAAGC,sBAAiC,IAAK;IACzDhB,KAAK,CAAC,oBAAoB,CAAC;IAC3B,OAAO,IAAI;EACb,CAAC;EAEDiB,mBAAmBA,CAACC,kBAAkB,EAAEC,KAAK,EAAEH,sBAAsB,EAAE;IACrEhB,KAAK,CAAC,qBAAqB,CAAC;IAC5B,OAAO,IAAI;EACb,CAAC;EAEDoB,oBAAoBA,CAACD,KAAK,EAAEE,MAAM,EAAE;IAClC,OAAO,KAAK;EACd,CAAC;EAEDC,kBAAkBA,CAChBC,KAAK,EACLP,sBAAsB,EACtB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B,EAAE;IACrEtE,KAAK,CAAC,2BAA2B,CAAC;IAClC8B,SAAS,CAACyC,IAAI,GAAGD,WAAW;EAC9B,CAAC;EAEDE,wBAAwBA,CAAC1C,SAAoB,EAAEwC,WAAqB,EAAE;IACpEtE,KAAK,CAAC,0BAA0B,CAAC;IACjC8B,SAAS,CAACyC,IAAI,GAAGD,WAAW;EAC9B,CAAC;EAEDG,mBAAmBA,CACjBnB,SAAmB,EACnBnC,KAAa,EACbE,MAAa,EACH;IACVrB,KAAK,CAAC,qBAAqB,CAAC;IAC5B,MAAM,IAAI0B,KAAK,CAAC,sBAAsB,CAAC;EACzC,CAAC;EAEDgD,uBAAuBA,CAACpB,SAAmB,EAAE/B,KAAa,EAAgB;IACxEvB,KAAK,CAAC,yBAAyB,CAAC;IAChC,MAAM,IAAI0B,KAAK,CAAC,sBAAsB,CAAC;EACzC,CAAC;EACD;EACAiD,uBAAuB,EAAEA,CAAA,KAAMC,+BAAoB;EACnDC,wBAAwB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAClCC,uBAAuB,EAAEA,CAAA,KAAM,CAAC,CAAC;EACjCC,qBAAqB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC/BC,mBAAmB,EAAE,SAAAA,CAAUC,KAAK,EAA4B;IAC9D,MAAM,IAAIvD,KAAK,CAAC,2BAA2B,CAAC;EAC9C,CAAC;EACDwD,kBAAkB,EAAE,SAAAA,CAAUC,cAAc,EAAE7B,SAAS,EAAQ;IAC7D,MAAM,IAAI5B,KAAK,CAAC,2BAA2B,CAAC;EAC9C,CAAC;EACD0D,oBAAoB,EAAE,SAAAA,CAAUD,cAAc,EAAmB;IAC/D,MAAM,IAAIzD,KAAK,CAAC,2BAA2B,CAAC;EAC9C;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ import { NodeType } from "../dom/types";
2
+ export interface Node<Props = unknown> {
3
+ type: NodeType;
4
+ props: Props;
5
+ children: Node[];
6
+ }
7
+ export declare const isColorFilter: (type: NodeType) => type is NodeType.MatrixColorFilter | NodeType.BlendColorFilter | NodeType.LinearToSRGBGammaColorFilter | NodeType.SRGBToLinearGammaColorFilter | NodeType.LumaColorFilter | NodeType.LerpColorFilter;
8
+ export declare const isPathEffect: (type: NodeType) => type is NodeType.DiscretePathEffect | NodeType.DashPathEffect | NodeType.Path1DPathEffect | NodeType.Path2DPathEffect | NodeType.CornerPathEffect | NodeType.SumPathEffect | NodeType.Line2DPathEffect;
9
+ export declare const isImageFilter: (type: NodeType) => type is NodeType.OffsetImageFilter | NodeType.DisplacementMapImageFilter | NodeType.BlurImageFilter | NodeType.DropShadowImageFilter | NodeType.MorphologyImageFilter | NodeType.BlendImageFilter | NodeType.RuntimeShaderImageFilter;
10
+ export declare const isShader: (type: NodeType) => type is NodeType.Shader | NodeType.ImageShader | NodeType.ColorShader | NodeType.Turbulence | NodeType.FractalNoise | NodeType.LinearGradient | NodeType.RadialGradient | NodeType.SweepGradient | NodeType.TwoPointConicalGradient;
11
+ export declare const sortNodeChildren: (parent: Node) => {
12
+ colorFilters: Node<unknown>[];
13
+ drawings: Node<unknown>[];
14
+ maskFilters: Node<unknown>[];
15
+ shaders: Node<unknown>[];
16
+ pathEffects: Node<unknown>[];
17
+ imageFilters: Node<unknown>[];
18
+ paints: Node<unknown>[];
19
+ };
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.sortNodeChildren = exports.isShader = exports.isPathEffect = exports.isImageFilter = exports.isColorFilter = void 0;
7
+ var _types = require("../dom/types");
8
+ const isColorFilter = type => {
9
+ "worklet";
10
+
11
+ return type === _types.NodeType.BlendColorFilter || type === _types.NodeType.MatrixColorFilter || type === _types.NodeType.LerpColorFilter || type === _types.NodeType.LumaColorFilter || type === _types.NodeType.SRGBToLinearGammaColorFilter || type === _types.NodeType.LinearToSRGBGammaColorFilter;
12
+ };
13
+ exports.isColorFilter = isColorFilter;
14
+ const isPathEffect = type => {
15
+ "worklet";
16
+
17
+ return type === _types.NodeType.DiscretePathEffect || type === _types.NodeType.DashPathEffect || type === _types.NodeType.Path1DPathEffect || type === _types.NodeType.Path2DPathEffect || type === _types.NodeType.CornerPathEffect || type === _types.NodeType.SumPathEffect || type === _types.NodeType.Line2DPathEffect;
18
+ };
19
+ exports.isPathEffect = isPathEffect;
20
+ const isImageFilter = type => {
21
+ "worklet";
22
+
23
+ return type === _types.NodeType.OffsetImageFilter || type === _types.NodeType.DisplacementMapImageFilter || type === _types.NodeType.BlurImageFilter || type === _types.NodeType.DropShadowImageFilter || type === _types.NodeType.MorphologyImageFilter || type === _types.NodeType.BlendImageFilter || type === _types.NodeType.RuntimeShaderImageFilter;
24
+ };
25
+ exports.isImageFilter = isImageFilter;
26
+ const isShader = type => {
27
+ "worklet";
28
+
29
+ return type === _types.NodeType.Shader || type === _types.NodeType.ImageShader || type === _types.NodeType.ColorShader || type === _types.NodeType.Turbulence || type === _types.NodeType.FractalNoise || type === _types.NodeType.LinearGradient || type === _types.NodeType.RadialGradient || type === _types.NodeType.SweepGradient || type === _types.NodeType.TwoPointConicalGradient;
30
+ };
31
+ exports.isShader = isShader;
32
+ const sortNodeChildren = parent => {
33
+ "worklet";
34
+
35
+ const maskFilters = [];
36
+ const colorFilters = [];
37
+ const shaders = [];
38
+ const imageFilters = [];
39
+ const pathEffects = [];
40
+ const drawings = [];
41
+ const paints = [];
42
+ parent.children.forEach(node => {
43
+ if (isColorFilter(node.type)) {
44
+ colorFilters.push(node);
45
+ } else if (node.type === _types.NodeType.BlurMaskFilter) {
46
+ maskFilters.push(node);
47
+ } else if (isPathEffect(node.type)) {
48
+ pathEffects.push(node);
49
+ } else if (isImageFilter(node.type)) {
50
+ imageFilters.push(node);
51
+ } else if (isShader(node.type)) {
52
+ shaders.push(node);
53
+ } else if (node.type === _types.NodeType.Paint) {
54
+ paints.push(node);
55
+ } else if (node.type === _types.NodeType.Blend) {
56
+ if (node.children[0] && isImageFilter(node.children[0].type)) {
57
+ node.type = _types.NodeType.BlendImageFilter;
58
+ imageFilters.push(node);
59
+ } else {
60
+ node.type = _types.NodeType.Blend;
61
+ shaders.push(node);
62
+ }
63
+ } else {
64
+ drawings.push(node);
65
+ }
66
+ });
67
+ return {
68
+ colorFilters,
69
+ drawings,
70
+ maskFilters,
71
+ shaders,
72
+ pathEffects,
73
+ imageFilters,
74
+ paints
75
+ };
76
+ };
77
+ exports.sortNodeChildren = sortNodeChildren;
78
+ //# sourceMappingURL=Node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","isColorFilter","type","NodeType","BlendColorFilter","MatrixColorFilter","LerpColorFilter","LumaColorFilter","SRGBToLinearGammaColorFilter","LinearToSRGBGammaColorFilter","exports","isPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","CornerPathEffect","SumPathEffect","Line2DPathEffect","isImageFilter","OffsetImageFilter","DisplacementMapImageFilter","BlurImageFilter","DropShadowImageFilter","MorphologyImageFilter","BlendImageFilter","RuntimeShaderImageFilter","isShader","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","sortNodeChildren","parent","maskFilters","colorFilters","shaders","imageFilters","pathEffects","drawings","paints","children","forEach","node","push","BlurMaskFilter","Paint","Blend"],"sources":["Node.ts"],"sourcesContent":["import { NodeType } from \"../dom/types\";\n\nexport interface Node<Props = unknown> {\n type: NodeType;\n props: Props;\n children: Node[];\n}\n\nexport const isColorFilter = (type: NodeType) => {\n \"worklet\";\n return (\n type === NodeType.BlendColorFilter ||\n type === NodeType.MatrixColorFilter ||\n type === NodeType.LerpColorFilter ||\n type === NodeType.LumaColorFilter ||\n type === NodeType.SRGBToLinearGammaColorFilter ||\n type === NodeType.LinearToSRGBGammaColorFilter\n );\n};\n\nexport const isPathEffect = (type: NodeType) => {\n \"worklet\";\n return (\n type === NodeType.DiscretePathEffect ||\n type === NodeType.DashPathEffect ||\n type === NodeType.Path1DPathEffect ||\n type === NodeType.Path2DPathEffect ||\n type === NodeType.CornerPathEffect ||\n type === NodeType.SumPathEffect ||\n type === NodeType.Line2DPathEffect\n );\n};\n\nexport const isImageFilter = (type: NodeType) => {\n \"worklet\";\n return (\n type === NodeType.OffsetImageFilter ||\n type === NodeType.DisplacementMapImageFilter ||\n type === NodeType.BlurImageFilter ||\n type === NodeType.DropShadowImageFilter ||\n type === NodeType.MorphologyImageFilter ||\n type === NodeType.BlendImageFilter ||\n type === NodeType.RuntimeShaderImageFilter\n );\n};\n\nexport const isShader = (type: NodeType) => {\n \"worklet\";\n return (\n type === NodeType.Shader ||\n type === NodeType.ImageShader ||\n type === NodeType.ColorShader ||\n type === NodeType.Turbulence ||\n type === NodeType.FractalNoise ||\n type === NodeType.LinearGradient ||\n type === NodeType.RadialGradient ||\n type === NodeType.SweepGradient ||\n type === NodeType.TwoPointConicalGradient\n );\n};\n\nexport const sortNodeChildren = (parent: Node) => {\n \"worklet\";\n const maskFilters: Node[] = [];\n const colorFilters: Node[] = [];\n const shaders: Node[] = [];\n const imageFilters: Node[] = [];\n const pathEffects: Node[] = [];\n const drawings: Node[] = [];\n const paints: Node[] = [];\n parent.children.forEach((node) => {\n if (isColorFilter(node.type)) {\n colorFilters.push(node);\n } else if (node.type === NodeType.BlurMaskFilter) {\n maskFilters.push(node);\n } else if (isPathEffect(node.type)) {\n pathEffects.push(node);\n } else if (isImageFilter(node.type)) {\n imageFilters.push(node);\n } else if (isShader(node.type)) {\n shaders.push(node);\n } else if (node.type === NodeType.Paint) {\n paints.push(node);\n } else if (node.type === NodeType.Blend) {\n if (node.children[0] && isImageFilter(node.children[0].type)) {\n node.type = NodeType.BlendImageFilter;\n imageFilters.push(node);\n } else {\n node.type = NodeType.Blend;\n shaders.push(node);\n }\n } else {\n drawings.push(node);\n }\n });\n return {\n colorFilters,\n drawings,\n maskFilters,\n shaders,\n pathEffects,\n imageFilters,\n paints,\n };\n};\n"],"mappings":";;;;;;AAAA,IAA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AAC,EAAE;MACnCwC,YAAY,CAACO,IAAI,CAACD,IAAI,CAAC;IACzB,CAAC,MAAM,IAAIrB,QAAQ,CAACqB,IAAI,CAAC9C,IAAI,CAAC,EAAE;MAC9BuC,OAAO,CAACQ,IAAI,CAACD,IAAI,CAAC;IACpB,CAAC,MAAM,IAAIA,IAAI,CAAC9C,IAAI,KAAKC,eAAQ,CAACgD,KAAK,EAAE;MACvCN,MAAM,CAACI,IAAI,CAACD,IAAI,CAAC;IACnB,CAAC,MAAM,IAAIA,IAAI,CAAC9C,IAAI,KAAKC,eAAQ,CAACiD,KAAK,EAAE;MACvC,IAAIJ,IAAI,CAACF,QAAQ,CAAC,CAAC,CAAC,IAAI3B,aAAa,CAAC6B,IAAI,CAACF,QAAQ,CAAC,CAAC,CAAC,CAAC5C,IAAI,CAAC,EAAE;QAC5D8C,IAAI,CAAC9C,IAAI,GAAGC,eAAQ,CAACsB,gBAAgB;QACrCiB,YAAY,CAACO,IAAI,CAACD,IAAI,CAAC;MACzB,CAAC,MAAM;QACLA,IAAI,CAAC9C,IAAI,GAAGC,eAAQ,CAACiD,KAAK;QAC1BX,OAAO,CAACQ,IAAI,CAACD,IAAI,CAAC;MACpB;IACF,CAAC,MAAM;MACLJ,QAAQ,CAACK,IAAI,CAACD,IAAI,CAAC;IACrB;EACF,CAAC,CAAC;EACF,OAAO;IACLR,YAAY;IACZI,QAAQ;IACRL,WAAW;IACXE,OAAO;IACPE,WAAW;IACXD,YAAY;IACZG;EACF,CAAC;AACH,CAAC;AAACnC,OAAA,CAAA2B,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -9,7 +9,7 @@ export declare class SkiaSGRoot {
9
9
  get sg(): {
10
10
  type: NodeType;
11
11
  props: {};
12
- children: import("./nodes").Node<unknown>[];
12
+ children: import("./Node").Node<unknown>[];
13
13
  isDeclaration: boolean;
14
14
  };
15
15
  render(element: ReactNode): void;
@@ -0,0 +1,79 @@
1
+ import type { SharedValue } from "react-native-reanimated";
2
+ import type { BlurMaskFilterProps, CircleProps, CTMProps, ImageProps, PointsProps, PathProps, RectProps, RoundedRectProps, OvalProps, LineProps, PatchProps, VerticesProps, DiffRectProps, TextProps, TextPathProps, TextBlobProps, GlyphsProps, PictureProps, ImageSVGProps, ParagraphProps, AtlasProps, DrawingNodeProps } from "../../dom/types";
3
+ export declare enum CommandType {
4
+ SavePaint = 0,
5
+ RestorePaint = 1,
6
+ SaveCTM = 2,
7
+ RestoreCTM = 3,
8
+ PushColorFilter = 4,
9
+ PushBlurMaskFilter = 5,
10
+ PushImageFilter = 6,
11
+ PushPathEffect = 7,
12
+ PushShader = 8,
13
+ ComposeColorFilter = 9,
14
+ ComposeImageFilter = 10,
15
+ ComposePathEffect = 11,
16
+ MaterializePaint = 12,
17
+ SaveBackdropFilter = 13,
18
+ SaveLayer = 14,
19
+ RestorePaintDeclaration = 15,
20
+ DrawBox = 16,
21
+ DrawImage = 17,
22
+ DrawCircle = 18,
23
+ DrawPaint = 19,
24
+ DrawPoints = 20,
25
+ DrawPath = 21,
26
+ DrawRect = 22,
27
+ DrawRRect = 23,
28
+ DrawOval = 24,
29
+ DrawLine = 25,
30
+ DrawPatch = 26,
31
+ DrawVertices = 27,
32
+ DrawDiffRect = 28,
33
+ DrawText = 29,
34
+ DrawTextPath = 30,
35
+ DrawTextBlob = 31,
36
+ DrawGlyphs = 32,
37
+ DrawPicture = 33,
38
+ DrawImageSVG = 34,
39
+ DrawParagraph = 35,
40
+ DrawAtlas = 36
41
+ }
42
+ export type Command<T extends CommandType = CommandType> = {
43
+ type: T;
44
+ [key: string]: unknown;
45
+ };
46
+ export declare const materializeProps: (command: {
47
+ props: Record<string, unknown>;
48
+ animatedProps?: Record<string, SharedValue<unknown>>;
49
+ }) => void;
50
+ export declare const isCommand: <T extends CommandType>(command: Command, type: T) => command is Command<T>;
51
+ interface Props {
52
+ [CommandType.DrawImage]: ImageProps;
53
+ [CommandType.DrawCircle]: CircleProps;
54
+ [CommandType.SaveCTM]: CTMProps;
55
+ [CommandType.SavePaint]: DrawingNodeProps;
56
+ [CommandType.PushBlurMaskFilter]: BlurMaskFilterProps;
57
+ [CommandType.DrawPoints]: PointsProps;
58
+ [CommandType.DrawPath]: PathProps;
59
+ [CommandType.DrawRect]: RectProps;
60
+ [CommandType.DrawRRect]: RoundedRectProps;
61
+ [CommandType.DrawOval]: OvalProps;
62
+ [CommandType.DrawLine]: LineProps;
63
+ [CommandType.DrawPatch]: PatchProps;
64
+ [CommandType.DrawVertices]: VerticesProps;
65
+ [CommandType.DrawDiffRect]: DiffRectProps;
66
+ [CommandType.DrawText]: TextProps;
67
+ [CommandType.DrawTextPath]: TextPathProps;
68
+ [CommandType.DrawTextBlob]: TextBlobProps;
69
+ [CommandType.DrawGlyphs]: GlyphsProps;
70
+ [CommandType.DrawPicture]: PictureProps;
71
+ [CommandType.DrawImageSVG]: ImageSVGProps;
72
+ [CommandType.DrawParagraph]: ParagraphProps;
73
+ [CommandType.DrawAtlas]: AtlasProps;
74
+ }
75
+ interface DrawCommand<T extends CommandType> extends Command<T> {
76
+ props: T extends keyof Props ? Props[T] : never;
77
+ }
78
+ export declare const isDrawCommand: <T extends keyof Props>(command: Command, type: T) => command is DrawCommand<T>;
79
+ export {};
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.materializeProps = exports.isDrawCommand = exports.isCommand = exports.CommandType = void 0;
7
+ // export enum CommandType {
8
+ // // Context
9
+ // SavePaint = "SavePaint",
10
+ // RestorePaint = "RestorePaint",
11
+ // SaveCTM = "SaveCTM",
12
+ // RestoreCTM = "RestoreCTM",
13
+ // PushColorFilter = "PushColorFilter",
14
+ // PushBlurMaskFilter = "PushBlurMaskFilter",
15
+ // PushImageFilter = "PushImageFilter",
16
+ // PushPathEffect = "PushPathEffect",
17
+ // PushShader = "PushShader",
18
+ // ComposeColorFilter = "ComposeColorFilter",
19
+ // ComposeImageFilter = "ComposeImageFilter",
20
+ // ComposePathEffect = "ComposePathEffect",
21
+ // MaterializePaint = "MaterializePaint",
22
+ // SaveBackdropFilter = "SaveBackdropFilter",
23
+ // SaveLayer = "SaveLayer",
24
+ // RestorePaintDeclaration = "RestorePaintDeclaration",
25
+ // // Drawing
26
+ // DrawBox = "DrawBox",
27
+ // DrawImage = "DrawImage",
28
+ // DrawCircle = "DrawCircle",
29
+ // DrawPaint = "DrawPaint",
30
+ // DrawPoints = "DrawPoints",
31
+ // DrawPath = "DrawPath",
32
+ // DrawRect = "DrawRect",
33
+ // DrawRRect = "DrawRRect",
34
+ // DrawOval = "DrawOval",
35
+ // DrawLine = "DrawLine",
36
+ // DrawPatch = "DrawPatch",
37
+ // DrawVertices = "DrawVertices",
38
+ // DrawDiffRect = "DrawDiffRect",
39
+ // DrawText = "DrawText",
40
+ // DrawTextPath = "DrawTextPath",
41
+ // DrawTextBlob = "DrawTextBlob",
42
+ // DrawGlyphs = "DrawGlyphs",
43
+ // DrawPicture = "DrawPicture",
44
+ // DrawImageSVG = "DrawImageSVG",
45
+ // DrawParagraph = "DrawParagraph",
46
+ // DrawAtlas = "DrawAtlas",
47
+ // }
48
+ let CommandType = exports.CommandType = /*#__PURE__*/function (CommandType) {
49
+ CommandType[CommandType["SavePaint"] = 0] = "SavePaint";
50
+ CommandType[CommandType["RestorePaint"] = 1] = "RestorePaint";
51
+ CommandType[CommandType["SaveCTM"] = 2] = "SaveCTM";
52
+ CommandType[CommandType["RestoreCTM"] = 3] = "RestoreCTM";
53
+ CommandType[CommandType["PushColorFilter"] = 4] = "PushColorFilter";
54
+ CommandType[CommandType["PushBlurMaskFilter"] = 5] = "PushBlurMaskFilter";
55
+ CommandType[CommandType["PushImageFilter"] = 6] = "PushImageFilter";
56
+ CommandType[CommandType["PushPathEffect"] = 7] = "PushPathEffect";
57
+ CommandType[CommandType["PushShader"] = 8] = "PushShader";
58
+ CommandType[CommandType["ComposeColorFilter"] = 9] = "ComposeColorFilter";
59
+ CommandType[CommandType["ComposeImageFilter"] = 10] = "ComposeImageFilter";
60
+ CommandType[CommandType["ComposePathEffect"] = 11] = "ComposePathEffect";
61
+ CommandType[CommandType["MaterializePaint"] = 12] = "MaterializePaint";
62
+ CommandType[CommandType["SaveBackdropFilter"] = 13] = "SaveBackdropFilter";
63
+ CommandType[CommandType["SaveLayer"] = 14] = "SaveLayer";
64
+ CommandType[CommandType["RestorePaintDeclaration"] = 15] = "RestorePaintDeclaration";
65
+ CommandType[CommandType["DrawBox"] = 16] = "DrawBox";
66
+ CommandType[CommandType["DrawImage"] = 17] = "DrawImage";
67
+ CommandType[CommandType["DrawCircle"] = 18] = "DrawCircle";
68
+ CommandType[CommandType["DrawPaint"] = 19] = "DrawPaint";
69
+ CommandType[CommandType["DrawPoints"] = 20] = "DrawPoints";
70
+ CommandType[CommandType["DrawPath"] = 21] = "DrawPath";
71
+ CommandType[CommandType["DrawRect"] = 22] = "DrawRect";
72
+ CommandType[CommandType["DrawRRect"] = 23] = "DrawRRect";
73
+ CommandType[CommandType["DrawOval"] = 24] = "DrawOval";
74
+ CommandType[CommandType["DrawLine"] = 25] = "DrawLine";
75
+ CommandType[CommandType["DrawPatch"] = 26] = "DrawPatch";
76
+ CommandType[CommandType["DrawVertices"] = 27] = "DrawVertices";
77
+ CommandType[CommandType["DrawDiffRect"] = 28] = "DrawDiffRect";
78
+ CommandType[CommandType["DrawText"] = 29] = "DrawText";
79
+ CommandType[CommandType["DrawTextPath"] = 30] = "DrawTextPath";
80
+ CommandType[CommandType["DrawTextBlob"] = 31] = "DrawTextBlob";
81
+ CommandType[CommandType["DrawGlyphs"] = 32] = "DrawGlyphs";
82
+ CommandType[CommandType["DrawPicture"] = 33] = "DrawPicture";
83
+ CommandType[CommandType["DrawImageSVG"] = 34] = "DrawImageSVG";
84
+ CommandType[CommandType["DrawParagraph"] = 35] = "DrawParagraph";
85
+ CommandType[CommandType["DrawAtlas"] = 36] = "DrawAtlas";
86
+ return CommandType;
87
+ }({});
88
+ const materializeProps = command => {
89
+ "worklet";
90
+
91
+ if (command.animatedProps) {
92
+ for (const key in command.animatedProps) {
93
+ command.props[key] = command.animatedProps[key].value;
94
+ }
95
+ }
96
+ };
97
+ exports.materializeProps = materializeProps;
98
+ const isCommand = (command, type) => {
99
+ "worklet";
100
+
101
+ return command.type === type;
102
+ };
103
+ exports.isCommand = isCommand;
104
+ const isDrawCommand = (command, type) => {
105
+ "worklet";
106
+
107
+ return command.type === type;
108
+ };
109
+ exports.isDrawCommand = isDrawCommand;
110
+ //# sourceMappingURL=Core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CommandType","exports","materializeProps","command","animatedProps","key","props","value","isCommand","type","isDrawCommand"],"sources":["Core.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n DrawingNodeProps,\n} from \"../../dom/types\";\n\n// export enum CommandType {\n// // Context\n// SavePaint = \"SavePaint\",\n// RestorePaint = \"RestorePaint\",\n// SaveCTM = \"SaveCTM\",\n// RestoreCTM = \"RestoreCTM\",\n// PushColorFilter = \"PushColorFilter\",\n// PushBlurMaskFilter = \"PushBlurMaskFilter\",\n// PushImageFilter = \"PushImageFilter\",\n// PushPathEffect = \"PushPathEffect\",\n// PushShader = \"PushShader\",\n// ComposeColorFilter = \"ComposeColorFilter\",\n// ComposeImageFilter = \"ComposeImageFilter\",\n// ComposePathEffect = \"ComposePathEffect\",\n// MaterializePaint = \"MaterializePaint\",\n// SaveBackdropFilter = \"SaveBackdropFilter\",\n// SaveLayer = \"SaveLayer\",\n// RestorePaintDeclaration = \"RestorePaintDeclaration\",\n// // Drawing\n// DrawBox = \"DrawBox\",\n// DrawImage = \"DrawImage\",\n// DrawCircle = \"DrawCircle\",\n// DrawPaint = \"DrawPaint\",\n// DrawPoints = \"DrawPoints\",\n// DrawPath = \"DrawPath\",\n// DrawRect = \"DrawRect\",\n// DrawRRect = \"DrawRRect\",\n// DrawOval = \"DrawOval\",\n// DrawLine = \"DrawLine\",\n// DrawPatch = \"DrawPatch\",\n// DrawVertices = \"DrawVertices\",\n// DrawDiffRect = \"DrawDiffRect\",\n// DrawText = \"DrawText\",\n// DrawTextPath = \"DrawTextPath\",\n// DrawTextBlob = \"DrawTextBlob\",\n// DrawGlyphs = \"DrawGlyphs\",\n// DrawPicture = \"DrawPicture\",\n// DrawImageSVG = \"DrawImageSVG\",\n// DrawParagraph = \"DrawParagraph\",\n// DrawAtlas = \"DrawAtlas\",\n// }\nexport enum CommandType {\n // Context\n SavePaint,\n RestorePaint,\n SaveCTM,\n RestoreCTM,\n PushColorFilter,\n PushBlurMaskFilter,\n PushImageFilter,\n PushPathEffect,\n PushShader,\n ComposeColorFilter,\n ComposeImageFilter,\n ComposePathEffect,\n MaterializePaint,\n SaveBackdropFilter,\n SaveLayer,\n RestorePaintDeclaration,\n // Drawing\n DrawBox,\n DrawImage,\n DrawCircle,\n DrawPaint,\n DrawPoints,\n DrawPath,\n DrawRect,\n DrawRRect,\n DrawOval,\n DrawLine,\n DrawPatch,\n DrawVertices,\n DrawDiffRect,\n DrawText,\n DrawTextPath,\n DrawTextBlob,\n DrawGlyphs,\n DrawPicture,\n DrawImageSVG,\n DrawParagraph,\n DrawAtlas,\n}\n\nexport type Command<T extends CommandType = CommandType> = {\n type: T;\n [key: string]: unknown;\n};\n\nexport const materializeProps = (command: {\n props: Record<string, unknown>;\n animatedProps?: Record<string, SharedValue<unknown>>;\n}) => {\n \"worklet\";\n if (command.animatedProps) {\n for (const key in command.animatedProps) {\n command.props[key] = command.animatedProps[key].value;\n }\n }\n};\n\nexport const isCommand = <T extends CommandType>(\n command: Command,\n type: T\n): command is Command<T> => {\n \"worklet\";\n return command.type === type;\n};\n\ninterface Props {\n [CommandType.DrawImage]: ImageProps;\n [CommandType.DrawCircle]: CircleProps;\n [CommandType.SaveCTM]: CTMProps;\n [CommandType.SavePaint]: DrawingNodeProps;\n [CommandType.PushBlurMaskFilter]: BlurMaskFilterProps;\n [CommandType.DrawPoints]: PointsProps;\n [CommandType.DrawPath]: PathProps;\n [CommandType.DrawRect]: RectProps;\n [CommandType.DrawRRect]: RoundedRectProps;\n [CommandType.DrawOval]: OvalProps;\n [CommandType.DrawLine]: LineProps;\n [CommandType.DrawPatch]: PatchProps;\n [CommandType.DrawVertices]: VerticesProps;\n [CommandType.DrawDiffRect]: DiffRectProps;\n [CommandType.DrawText]: TextProps;\n [CommandType.DrawTextPath]: TextPathProps;\n [CommandType.DrawTextBlob]: TextBlobProps;\n [CommandType.DrawGlyphs]: GlyphsProps;\n [CommandType.DrawPicture]: PictureProps;\n [CommandType.DrawImageSVG]: ImageSVGProps;\n [CommandType.DrawParagraph]: ParagraphProps;\n [CommandType.DrawAtlas]: AtlasProps;\n}\n\ninterface DrawCommand<T extends CommandType> extends Command<T> {\n props: T extends keyof Props ? Props[T] : never;\n}\n\nexport const isDrawCommand = <T extends keyof Props>(\n command: Command,\n type: T\n): command is DrawCommand<T> => {\n \"worklet\";\n return command.type === type;\n};\n"],"mappings":";;;;;;AA2BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,IACYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;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AAO,KACmB;EAC1B,SAAS;;EACT,OAAON,OAAO,CAACM,IAAI,KAAKA,IAAI;AAC9B,CAAC;AAACR,OAAA,CAAAO,SAAA,GAAAA,SAAA;AA+BK,MAAME,aAAa,GAAGA,CAC3BP,OAAgB,EAChBM,IAAO,KACuB;EAC9B,SAAS;;EACT,OAAON,OAAO,CAACM,IAAI,KAAKA,IAAI;AAC9B,CAAC;AAACR,OAAA,CAAAS,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ import type { Skia, SkCanvas, SkColorFilter, SkPaint, SkShader, SkImageFilter, SkPathEffect } from "../../skia/types";
2
+ export declare const createDrawingContext: (Skia: Skia, paintPool: SkPaint[], canvas: SkCanvas) => {
3
+ Skia: Skia;
4
+ canvas: SkCanvas;
5
+ paints: SkPaint[];
6
+ colorFilters: SkColorFilter[];
7
+ shaders: SkShader[];
8
+ imageFilters: SkImageFilter[];
9
+ pathEffects: SkPathEffect[];
10
+ paintDeclarations: SkPaint[];
11
+ paintPool: SkPaint[];
12
+ savePaint: () => void;
13
+ saveBackdropFilter: () => void;
14
+ readonly paint: SkPaint;
15
+ restorePaint: () => SkPaint | undefined;
16
+ materializePaint: () => void;
17
+ };
18
+ export type DrawingContext = ReturnType<typeof createDrawingContext>;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createDrawingContext = void 0;
7
+ const createDrawingContext = (Skia, paintPool, canvas) => {
8
+ "worklet";
9
+
10
+ // State (formerly class fields)
11
+ const paints = [];
12
+ const colorFilters = [];
13
+ const shaders = [];
14
+ const imageFilters = [];
15
+ const pathEffects = [];
16
+ const paintDeclarations = [];
17
+ let nextPaintIndex = 1;
18
+
19
+ // Initialize first paint
20
+ paintPool[0] = Skia.Paint();
21
+ paints.push(paintPool[0]);
22
+
23
+ // Methods (formerly class methods)
24
+ const savePaint = () => {
25
+ // Get next available paint from pool or create new one if needed
26
+ if (nextPaintIndex >= paintPool.length) {
27
+ paintPool.push(Skia.Paint());
28
+ }
29
+ const nextPaint = paintPool[nextPaintIndex];
30
+ nextPaint.assign(getCurrentPaint()); // Reuse allocation by copying properties
31
+ paints.push(nextPaint);
32
+ nextPaintIndex++;
33
+ };
34
+ const saveBackdropFilter = () => {
35
+ let imageFilter = null;
36
+ const imgf = imageFilters.pop();
37
+ if (imgf) {
38
+ imageFilter = imgf;
39
+ } else {
40
+ const cf = colorFilters.pop();
41
+ if (cf) {
42
+ imageFilter = Skia.ImageFilter.MakeColorFilter(cf, null);
43
+ }
44
+ }
45
+ canvas.saveLayer(undefined, null, imageFilter);
46
+ canvas.restore();
47
+ };
48
+
49
+ // Equivalent to the `get paint()` getter in the original class
50
+ const getCurrentPaint = () => {
51
+ return paints[paints.length - 1];
52
+ };
53
+ const restorePaint = () => {
54
+ return paints.pop();
55
+ };
56
+ const materializePaint = () => {
57
+ // Color Filters
58
+ if (colorFilters.length > 0) {
59
+ getCurrentPaint().setColorFilter(colorFilters.reduceRight((inner, outer) => inner ? Skia.ColorFilter.MakeCompose(outer, inner) : outer));
60
+ }
61
+ // Shaders
62
+ if (shaders.length > 0) {
63
+ getCurrentPaint().setShader(shaders[shaders.length - 1]);
64
+ }
65
+ // Image Filters
66
+ if (imageFilters.length > 0) {
67
+ getCurrentPaint().setImageFilter(imageFilters.reduceRight((inner, outer) => inner ? Skia.ImageFilter.MakeCompose(outer, inner) : outer));
68
+ }
69
+ // Path Effects
70
+ if (pathEffects.length > 0) {
71
+ getCurrentPaint().setPathEffect(pathEffects.reduceRight((inner, outer) => inner ? Skia.PathEffect.MakeCompose(outer, inner) : outer));
72
+ }
73
+
74
+ // Clear arrays
75
+ colorFilters.length = 0;
76
+ shaders.length = 0;
77
+ imageFilters.length = 0;
78
+ pathEffects.length = 0;
79
+ };
80
+
81
+ // Return an object containing the Skia reference, the canvas, and the methods
82
+ return {
83
+ // Public fields
84
+ Skia,
85
+ canvas,
86
+ paints,
87
+ colorFilters,
88
+ shaders,
89
+ imageFilters,
90
+ pathEffects,
91
+ paintDeclarations,
92
+ paintPool,
93
+ // Public methods
94
+ savePaint,
95
+ saveBackdropFilter,
96
+ get paint() {
97
+ return paints[paints.length - 1];
98
+ },
99
+ // the "getter" for the current paint
100
+ restorePaint,
101
+ materializePaint
102
+ };
103
+ };
104
+ exports.createDrawingContext = createDrawingContext;
105
+ //# sourceMappingURL=DrawingContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createDrawingContext","Skia","paintPool","canvas","paints","colorFilters","shaders","imageFilters","pathEffects","paintDeclarations","nextPaintIndex","Paint","push","savePaint","length","nextPaint","assign","getCurrentPaint","saveBackdropFilter","imageFilter","imgf","pop","cf","ImageFilter","MakeColorFilter","saveLayer","undefined","restore","restorePaint","materializePaint","setColorFilter","reduceRight","inner","outer","ColorFilter","MakeCompose","setShader","setImageFilter","setPathEffect","PathEffect","paint","exports"],"sources":["DrawingContext.ts"],"sourcesContent":["import type {\n Skia,\n SkCanvas,\n SkColorFilter,\n SkPaint,\n SkShader,\n SkImageFilter,\n SkPathEffect,\n} from \"../../skia/types\";\n\nexport const createDrawingContext = (\n Skia: Skia,\n paintPool: SkPaint[],\n canvas: SkCanvas\n) => {\n \"worklet\";\n\n // State (formerly class fields)\n const paints: SkPaint[] = [];\n const colorFilters: SkColorFilter[] = [];\n const shaders: SkShader[] = [];\n const imageFilters: SkImageFilter[] = [];\n const pathEffects: SkPathEffect[] = [];\n const paintDeclarations: SkPaint[] = [];\n\n let nextPaintIndex = 1;\n\n // Initialize first paint\n paintPool[0] = Skia.Paint();\n paints.push(paintPool[0]);\n\n // Methods (formerly class methods)\n const savePaint = () => {\n // Get next available paint from pool or create new one if needed\n if (nextPaintIndex >= paintPool.length) {\n paintPool.push(Skia.Paint());\n }\n\n const nextPaint = paintPool[nextPaintIndex];\n nextPaint.assign(getCurrentPaint()); // Reuse allocation by copying properties\n paints.push(nextPaint);\n nextPaintIndex++;\n };\n\n const saveBackdropFilter = () => {\n let imageFilter: SkImageFilter | null = null;\n const imgf = imageFilters.pop();\n if (imgf) {\n imageFilter = imgf;\n } else {\n const cf = colorFilters.pop();\n if (cf) {\n imageFilter = Skia.ImageFilter.MakeColorFilter(cf, null);\n }\n }\n canvas.saveLayer(undefined, null, imageFilter);\n canvas.restore();\n };\n\n // Equivalent to the `get paint()` getter in the original class\n const getCurrentPaint = () => {\n return paints[paints.length - 1];\n };\n\n const restorePaint = () => {\n return paints.pop();\n };\n\n const materializePaint = () => {\n // Color Filters\n if (colorFilters.length > 0) {\n getCurrentPaint().setColorFilter(\n colorFilters.reduceRight((inner, outer) =>\n inner ? Skia.ColorFilter.MakeCompose(outer, inner) : outer\n )\n );\n }\n // Shaders\n if (shaders.length > 0) {\n getCurrentPaint().setShader(shaders[shaders.length - 1]);\n }\n // Image Filters\n if (imageFilters.length > 0) {\n getCurrentPaint().setImageFilter(\n imageFilters.reduceRight((inner, outer) =>\n inner ? Skia.ImageFilter.MakeCompose(outer, inner) : outer\n )\n );\n }\n // Path Effects\n if (pathEffects.length > 0) {\n getCurrentPaint().setPathEffect(\n pathEffects.reduceRight((inner, outer) =>\n inner ? Skia.PathEffect.MakeCompose(outer, inner) : outer\n )\n );\n }\n\n // Clear arrays\n colorFilters.length = 0;\n shaders.length = 0;\n imageFilters.length = 0;\n pathEffects.length = 0;\n };\n\n // Return an object containing the Skia reference, the canvas, and the methods\n return {\n // Public fields\n Skia,\n canvas,\n paints,\n colorFilters,\n shaders,\n imageFilters,\n pathEffects,\n paintDeclarations,\n paintPool,\n\n // Public methods\n savePaint,\n saveBackdropFilter,\n get paint() {\n return paints[paints.length - 1];\n }, // the \"getter\" for the current paint\n restorePaint,\n materializePaint,\n };\n};\n\nexport type DrawingContext = ReturnType<typeof createDrawingContext>;\n"],"mappings":";;;;;;AAUO,MAAMA,oBAAoB,GAAGA,CAClCC,IAAU,EACVC,SAAoB,EACpBC,MAAgB,KACb;EACH,SAAS;;EAET;EACA,MAAM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B,YAAY,CAACS,MAAM,GAAG,CAAC;IACvBR,OAAO,CAACQ,MAAM,GAAG,CAAC;IAClBP,YAAY,CAACO,MAAM,GAAG,CAAC;IACvBN,WAAW,CAACM,MAAM,GAAG,CAAC;EACxB,CAAC;;EAED;EACA,OAAO;IACL;IACAb,IAAI;IACJE,MAAM;IACNC,MAAM;IACNC,YAAY;IACZC,OAAO;IACPC,YAAY;IACZC,WAAW;IACXC,iBAAiB;IACjBP,SAAS;IAET;IACAW,SAAS;IACTK,kBAAkB;IAClB,IAAIsB,KAAKA,CAAA,EAAG;MACV,OAAOpC,MAAM,CAACA,MAAM,CAACU,MAAM,GAAG,CAAC,CAAC;IAClC,CAAC;IAAE;IACHc,YAAY;IACZC;EACF,CAAC;AACH,CAAC;AAACY,OAAA,CAAAzC,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import { type Command } from "./Core";
2
+ import type { DrawingContext } from "./DrawingContext";
3
+ export declare const replay: (ctx: DrawingContext, commands: Command[]) => void;