@shopify/react-native-skia 1.8.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.replay = void 0;
7
+ var _Drawing = require("./commands/Drawing");
8
+ var _Box = require("./commands/Box");
9
+ var _ColorFilters = require("./commands/ColorFilters");
10
+ var _CTM = require("./commands/CTM");
11
+ var _ImageFilters = require("./commands/ImageFilters");
12
+ var _Paint = require("./commands/Paint");
13
+ var _PathEffects = require("./commands/PathEffects");
14
+ var _Shaders = require("./commands/Shaders");
15
+ var _Core = require("./Core");
16
+ const play = (ctx, command) => {
17
+ "worklet";
18
+
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ (0, _Core.materializeProps)(command);
21
+ if ((0, _Core.isCommand)(command, _Core.CommandType.SaveBackdropFilter)) {
22
+ ctx.saveBackdropFilter();
23
+ } else if ((0, _Core.isCommand)(command, _Core.CommandType.SaveLayer)) {
24
+ ctx.materializePaint();
25
+ const paint = ctx.paintDeclarations.pop();
26
+ ctx.canvas.saveLayer(paint);
27
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.SavePaint)) {
28
+ if (command.props.paint) {
29
+ ctx.paints.push(command.props.paint);
30
+ } else {
31
+ ctx.savePaint();
32
+ (0, _Paint.setPaintProperties)(ctx.Skia, ctx.paint, command.props);
33
+ }
34
+ } else if ((0, _Core.isCommand)(command, _Core.CommandType.RestorePaint)) {
35
+ ctx.restorePaint();
36
+ } else if ((0, _Core.isCommand)(command, _Core.CommandType.ComposeColorFilter)) {
37
+ (0, _ColorFilters.composeColorFilters)(ctx);
38
+ } else if ((0, _Core.isCommand)(command, _Core.CommandType.RestorePaintDeclaration)) {
39
+ ctx.materializePaint();
40
+ const paint = ctx.restorePaint();
41
+ if (!paint) {
42
+ throw new Error("No paint declaration to push");
43
+ }
44
+ ctx.paintDeclarations.push(paint);
45
+ } else if ((0, _Core.isCommand)(command, _Core.CommandType.MaterializePaint)) {
46
+ ctx.materializePaint();
47
+ } else if ((0, _ColorFilters.isPushColorFilter)(command)) {
48
+ (0, _ColorFilters.pushColorFilter)(ctx, command);
49
+ } else if ((0, _Shaders.isPushShader)(command)) {
50
+ (0, _Shaders.pushShader)(ctx, command);
51
+ } else if ((0, _ImageFilters.isPushImageFilter)(command)) {
52
+ (0, _ImageFilters.pushImageFilter)(ctx, command);
53
+ } else if ((0, _PathEffects.isPushPathEffect)(command)) {
54
+ (0, _PathEffects.pushPathEffect)(ctx, command);
55
+ } else if ((0, _Core.isCommand)(command, _Core.CommandType.ComposePathEffect)) {
56
+ (0, _PathEffects.composePathEffects)(ctx);
57
+ } else if ((0, _Core.isCommand)(command, _Core.CommandType.ComposeImageFilter)) {
58
+ (0, _ImageFilters.composeImageFilters)(ctx);
59
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.PushBlurMaskFilter)) {
60
+ (0, _ImageFilters.setBlurMaskFilter)(ctx, command.props);
61
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.SaveCTM)) {
62
+ (0, _CTM.saveCTM)(ctx, command.props);
63
+ } else if ((0, _Core.isCommand)(command, _Core.CommandType.RestoreCTM)) {
64
+ ctx.canvas.restore();
65
+ } else {
66
+ const paints = [ctx.paint, ...ctx.paintDeclarations];
67
+ ctx.paintDeclarations = [];
68
+ paints.forEach(p => {
69
+ ctx.paints.push(p);
70
+ if ((0, _Box.isBoxCommand)(command)) {
71
+ (0, _Box.drawBox)(ctx, command);
72
+ } else if ((0, _Core.isCommand)(command, _Core.CommandType.DrawPaint)) {
73
+ ctx.canvas.drawPaint(ctx.paint);
74
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawImage)) {
75
+ (0, _Drawing.drawImage)(ctx, command.props);
76
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawCircle)) {
77
+ (0, _Drawing.drawCircle)(ctx, command.props);
78
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawPoints)) {
79
+ (0, _Drawing.drawPoints)(ctx, command.props);
80
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawPath)) {
81
+ (0, _Drawing.drawPath)(ctx, command.props);
82
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawRect)) {
83
+ (0, _Drawing.drawRect)(ctx, command.props);
84
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawRRect)) {
85
+ (0, _Drawing.drawRRect)(ctx, command.props);
86
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawOval)) {
87
+ (0, _Drawing.drawOval)(ctx, command.props);
88
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawLine)) {
89
+ (0, _Drawing.drawLine)(ctx, command.props);
90
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawPatch)) {
91
+ (0, _Drawing.drawPatch)(ctx, command.props);
92
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawVertices)) {
93
+ (0, _Drawing.drawVertices)(ctx, command.props);
94
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawDiffRect)) {
95
+ (0, _Drawing.drawDiffRect)(ctx, command.props);
96
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawText)) {
97
+ (0, _Drawing.drawText)(ctx, command.props);
98
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawTextPath)) {
99
+ (0, _Drawing.drawTextPath)(ctx, command.props);
100
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawTextBlob)) {
101
+ (0, _Drawing.drawTextBlob)(ctx, command.props);
102
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawGlyphs)) {
103
+ (0, _Drawing.drawGlyphs)(ctx, command.props);
104
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawPicture)) {
105
+ (0, _Drawing.drawPicture)(ctx, command.props);
106
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawImageSVG)) {
107
+ (0, _Drawing.drawImageSVG)(ctx, command.props);
108
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawParagraph)) {
109
+ (0, _Drawing.drawParagraph)(ctx, command.props);
110
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawAtlas)) {
111
+ (0, _Drawing.drawAtlas)(ctx, command.props);
112
+ } else {
113
+ console.warn(`Unknown command: ${command.type}`);
114
+ }
115
+ ctx.paints.pop();
116
+ });
117
+ }
118
+ };
119
+ const replay = (ctx, commands) => {
120
+ "worklet";
121
+
122
+ commands.forEach(command => {
123
+ play(ctx, command);
124
+ });
125
+ };
126
+ exports.replay = replay;
127
+ //# sourceMappingURL=Player.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Drawing","require","_Box","_ColorFilters","_CTM","_ImageFilters","_Paint","_PathEffects","_Shaders","_Core","play","ctx","command","materializeProps","isCommand","CommandType","SaveBackdropFilter","saveBackdropFilter","SaveLayer","materializePaint","paint","paintDeclarations","pop","canvas","saveLayer","isDrawCommand","SavePaint","props","paints","push","savePaint","setPaintProperties","Skia","RestorePaint","restorePaint","ComposeColorFilter","composeColorFilters","RestorePaintDeclaration","Error","MaterializePaint","isPushColorFilter","pushColorFilter","isPushShader","pushShader","isPushImageFilter","pushImageFilter","isPushPathEffect","pushPathEffect","ComposePathEffect","composePathEffects","ComposeImageFilter","composeImageFilters","PushBlurMaskFilter","setBlurMaskFilter","SaveCTM","saveCTM","RestoreCTM","restore","forEach","p","isBoxCommand","drawBox","DrawPaint","drawPaint","DrawImage","drawImage","DrawCircle","drawCircle","DrawPoints","drawPoints","DrawPath","drawPath","DrawRect","drawRect","DrawRRect","drawRRect","DrawOval","drawOval","DrawLine","drawLine","DrawPatch","drawPatch","DrawVertices","drawVertices","DrawDiffRect","drawDiffRect","DrawText","drawText","DrawTextPath","drawTextPath","DrawTextBlob","drawTextBlob","DrawGlyphs","drawGlyphs","DrawPicture","drawPicture","DrawImageSVG","drawImageSVG","DrawParagraph","drawParagraph","DrawAtlas","drawAtlas","console","warn","type","replay","commands","exports"],"sources":["Player.ts"],"sourcesContent":["import {\n drawCircle,\n drawImage,\n drawOval,\n drawPath,\n drawPoints,\n drawRect,\n drawRRect,\n drawLine,\n drawAtlas,\n drawParagraph,\n drawImageSVG,\n drawPicture,\n drawGlyphs,\n drawTextBlob,\n drawTextPath,\n drawText,\n drawDiffRect,\n drawVertices,\n drawPatch,\n} from \"./commands/Drawing\";\nimport { drawBox, isBoxCommand } from \"./commands/Box\";\nimport {\n composeColorFilters,\n isPushColorFilter,\n pushColorFilter,\n} from \"./commands/ColorFilters\";\nimport { saveCTM } from \"./commands/CTM\";\nimport {\n setBlurMaskFilter,\n isPushImageFilter,\n pushImageFilter,\n composeImageFilters,\n} from \"./commands/ImageFilters\";\nimport { setPaintProperties } from \"./commands/Paint\";\nimport {\n composePathEffects,\n isPushPathEffect,\n pushPathEffect,\n} from \"./commands/PathEffects\";\nimport { isPushShader, pushShader } from \"./commands/Shaders\";\nimport {\n CommandType,\n isCommand,\n isDrawCommand,\n materializeProps,\n type Command,\n} from \"./Core\";\nimport type { DrawingContext } from \"./DrawingContext\";\n\nconst play = (ctx: DrawingContext, command: Command) => {\n \"worklet\";\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n materializeProps(command as any);\n if (isCommand(command, CommandType.SaveBackdropFilter)) {\n ctx.saveBackdropFilter();\n } else if (isCommand(command, CommandType.SaveLayer)) {\n ctx.materializePaint();\n const paint = ctx.paintDeclarations.pop();\n ctx.canvas.saveLayer(paint);\n } else if (isDrawCommand(command, CommandType.SavePaint)) {\n if (command.props.paint) {\n ctx.paints.push(command.props.paint);\n } else {\n ctx.savePaint();\n setPaintProperties(ctx.Skia, ctx.paint, command.props);\n }\n } else if (isCommand(command, CommandType.RestorePaint)) {\n ctx.restorePaint();\n } else if (isCommand(command, CommandType.ComposeColorFilter)) {\n composeColorFilters(ctx);\n } else if (isCommand(command, CommandType.RestorePaintDeclaration)) {\n ctx.materializePaint();\n const paint = ctx.restorePaint();\n if (!paint) {\n throw new Error(\"No paint declaration to push\");\n }\n ctx.paintDeclarations.push(paint);\n } else if (isCommand(command, CommandType.MaterializePaint)) {\n ctx.materializePaint();\n } else if (isPushColorFilter(command)) {\n pushColorFilter(ctx, command);\n } else if (isPushShader(command)) {\n pushShader(ctx, command);\n } else if (isPushImageFilter(command)) {\n pushImageFilter(ctx, command);\n } else if (isPushPathEffect(command)) {\n pushPathEffect(ctx, command);\n } else if (isCommand(command, CommandType.ComposePathEffect)) {\n composePathEffects(ctx);\n } else if (isCommand(command, CommandType.ComposeImageFilter)) {\n composeImageFilters(ctx);\n } else if (isDrawCommand(command, CommandType.PushBlurMaskFilter)) {\n setBlurMaskFilter(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.SaveCTM)) {\n saveCTM(ctx, command.props);\n } else if (isCommand(command, CommandType.RestoreCTM)) {\n ctx.canvas.restore();\n } else {\n const paints = [ctx.paint, ...ctx.paintDeclarations];\n ctx.paintDeclarations = [];\n paints.forEach((p) => {\n ctx.paints.push(p);\n if (isBoxCommand(command)) {\n drawBox(ctx, command);\n } else if (isCommand(command, CommandType.DrawPaint)) {\n ctx.canvas.drawPaint(ctx.paint);\n } else if (isDrawCommand(command, CommandType.DrawImage)) {\n drawImage(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawCircle)) {\n drawCircle(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPoints)) {\n drawPoints(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPath)) {\n drawPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRect)) {\n drawRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRRect)) {\n drawRRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawOval)) {\n drawOval(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawLine)) {\n drawLine(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPatch)) {\n drawPatch(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawVertices)) {\n drawVertices(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawDiffRect)) {\n drawDiffRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawText)) {\n drawText(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextPath)) {\n drawTextPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextBlob)) {\n drawTextBlob(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawGlyphs)) {\n drawGlyphs(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPicture)) {\n drawPicture(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawImageSVG)) {\n drawImageSVG(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawParagraph)) {\n drawParagraph(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawAtlas)) {\n drawAtlas(ctx, command.props);\n } else {\n console.warn(`Unknown command: ${command.type}`);\n }\n ctx.paints.pop();\n });\n }\n};\n\nexport const replay = (ctx: DrawingContext, commands: Command[]) => {\n \"worklet\";\n commands.forEach((command) => {\n play(ctx, command);\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAqBA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AASA,MAAMS,IAAI,GAAGA,CAACC,GAAmB,EAAEC,OAAgB,KAAK;EACtD,SAAS;;EAET;EACA,IAAAC,sBAAgB,EAACD,OAAc,CAAC;EAChC,IAAI,IAAAE,eAAS,EAACF,OAAO,EAAEG,iBAAW,CAACC,kBAAkB,CAAC,EAAE;IACtDL,GAAG,CAACM,kBAAkB,CAAC,CAAC;EAC1B,CAAC,MAAM,IAAI,IAAAH,eAAS,EAACF,OAAO,EAAEG,iBAAW,CAACG,SAAS,CAAC,EAAE;IACpDP,GAAG,CAACQ,gBAAgB,CAAC,CAAC;IACtB,MAAMC,KAAK,GAAGT,GAAG,CAACU,iBAAiB,CAACC,GAAG,CAAC,CAAC;IACzCX,GAAG,CAACY,MAAM,CAACC,SAAS,CAACJ,KAAK,CAAC;EAC7B,CAAC,MAAM,IAAI,IAAAK,mBAAa,EAACb,OAAO,EAAEG,iBAAW,CAACW,SAAS,CAAC,EAAE;IACxD,IAAId,OAAO,CAACe,KAAK,CAACP,KAAK,EAAE;MACvBT,GAAG,CAACiB,MAAM,CAACC,IAAI,CAACjB,OAAO,CAAC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AW,CAAC6E,UAAU,CAAC,EAAE;QACzD,IAAAC,mBAAU,EAAClF,GAAG,EAAEC,OAAO,CAACe,KAAK,CAAC;MAChC,CAAC,MAAM,IAAI,IAAAF,mBAAa,EAACb,OAAO,EAAEG,iBAAW,CAAC+E,WAAW,CAAC,EAAE;QAC1D,IAAAC,oBAAW,EAACpF,GAAG,EAAEC,OAAO,CAACe,KAAK,CAAC;MACjC,CAAC,MAAM,IAAI,IAAAF,mBAAa,EAACb,OAAO,EAAEG,iBAAW,CAACiF,YAAY,CAAC,EAAE;QAC3D,IAAAC,qBAAY,EAACtF,GAAG,EAAEC,OAAO,CAACe,KAAK,CAAC;MAClC,CAAC,MAAM,IAAI,IAAAF,mBAAa,EAACb,OAAO,EAAEG,iBAAW,CAACmF,aAAa,CAAC,EAAE;QAC5D,IAAAC,sBAAa,EAACxF,GAAG,EAAEC,OAAO,CAACe,KAAK,CAAC;MACnC,CAAC,MAAM,IAAI,IAAAF,mBAAa,EAACb,OAAO,EAAEG,iBAAW,CAACqF,SAAS,CAAC,EAAE;QACxD,IAAAC,kBAAS,EAAC1F,GAAG,EAAEC,OAAO,CAACe,KAAK,CAAC;MAC/B,CAAC,MAAM;QACL2E,OAAO,CAACC,IAAI,CAAC,oBAAoB3F,OAAO,CAAC4F,IAAI,EAAE,CAAC;MAClD;MACA7F,GAAG,CAACiB,MAAM,CAACN,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC;EACJ;AACF,CAAC;AAEM,MAAMmF,MAAM,GAAGA,CAAC9F,GAAmB,EAAE+F,QAAmB,KAAK;EAClE,SAAS;;EACTA,QAAQ,CAAChD,OAAO,CAAE9C,OAAO,IAAK;IAC5BF,IAAI,CAACC,GAAG,EAAEC,OAAO,CAAC;EACpB,CAAC,CAAC;AACJ,CAAC;AAAC+F,OAAA,CAAAF,MAAA,GAAAA,MAAA","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ import type { SharedValue } from "react-native-reanimated";
2
+ import { NodeType } from "../../dom/types";
3
+ import type { BlurMaskFilterProps, CircleProps, CTMProps, ImageProps, PaintProps, PointsProps, PathProps, RectProps, RoundedRectProps, OvalProps, LineProps, PatchProps, VerticesProps, DiffRectProps, TextProps, TextPathProps, TextBlobProps, GlyphsProps, PictureProps, ImageSVGProps, ParagraphProps, AtlasProps, BoxProps, BoxShadowProps } from "../../dom/types";
4
+ import type { AnimatedProps } from "../../renderer";
5
+ import type { Command } from "./Core";
6
+ export declare class Recorder {
7
+ commands: Command[];
8
+ private processProps;
9
+ private add;
10
+ savePaint(props: AnimatedProps<PaintProps>): void;
11
+ restorePaint(): void;
12
+ restorePaintDeclaration(): void;
13
+ materializePaint(): void;
14
+ pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>): void;
15
+ pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>): void;
16
+ pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>): void;
17
+ pushShader(shaderType: NodeType, props: AnimatedProps<unknown>): void;
18
+ pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void;
19
+ composePathEffect(): void;
20
+ composeColorFilter(): void;
21
+ composeImageFilter(): void;
22
+ saveCTM(props: AnimatedProps<CTMProps>): void;
23
+ restoreCTM(): void;
24
+ drawPaint(): void;
25
+ saveLayer(): void;
26
+ saveBackdropFilter(): void;
27
+ drawBox(boxProps: AnimatedProps<BoxProps>, shadows: {
28
+ props: BoxShadowProps;
29
+ animatedProps?: Record<string, SharedValue<unknown>>;
30
+ }[]): void;
31
+ drawImage(props: AnimatedProps<ImageProps>): void;
32
+ drawCircle(props: AnimatedProps<CircleProps>): void;
33
+ drawPoints(props: AnimatedProps<PointsProps>): void;
34
+ drawPath(props: AnimatedProps<PathProps>): void;
35
+ drawRect(props: AnimatedProps<RectProps>): void;
36
+ drawRRect(props: AnimatedProps<RoundedRectProps>): void;
37
+ drawOval(props: AnimatedProps<OvalProps>): void;
38
+ drawLine(props: AnimatedProps<LineProps>): void;
39
+ drawPatch(props: AnimatedProps<PatchProps>): void;
40
+ drawVertices(props: AnimatedProps<VerticesProps>): void;
41
+ drawDiffRect(props: AnimatedProps<DiffRectProps>): void;
42
+ drawText(props: AnimatedProps<TextProps>): void;
43
+ drawTextPath(props: AnimatedProps<TextPathProps>): void;
44
+ drawTextBlob(props: AnimatedProps<TextBlobProps>): void;
45
+ drawGlyphs(props: AnimatedProps<GlyphsProps>): void;
46
+ drawPicture(props: AnimatedProps<PictureProps>): void;
47
+ drawImageSVG(props: AnimatedProps<ImageSVGProps>): void;
48
+ drawParagraph(props: AnimatedProps<ParagraphProps>): void;
49
+ drawAtlas(props: AnimatedProps<AtlasProps>): void;
50
+ }
@@ -0,0 +1,288 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Recorder = void 0;
7
+ var _types = require("../../dom/types");
8
+ var _utils = require("../utils");
9
+ var _Node = require("../Node");
10
+ var _Core = require("./Core");
11
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
13
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
+ class Recorder {
15
+ constructor() {
16
+ _defineProperty(this, "commands", []);
17
+ }
18
+ processProps(props) {
19
+ const animatedProps = {};
20
+ let hasAnimatedProps = false;
21
+ for (const key in props) {
22
+ const prop = props[key];
23
+ if ((0, _utils.isSharedValue)(prop)) {
24
+ props[key] = prop.value;
25
+ animatedProps[key] = prop;
26
+ hasAnimatedProps = true;
27
+ }
28
+ }
29
+ return {
30
+ props,
31
+ animatedProps: hasAnimatedProps ? animatedProps : undefined
32
+ };
33
+ }
34
+ add(command) {
35
+ if (command.props) {
36
+ const {
37
+ animatedProps
38
+ } = this.processProps(command.props);
39
+ if (animatedProps) {
40
+ command.animatedProps = animatedProps;
41
+ }
42
+ }
43
+ this.commands.push(command);
44
+ }
45
+ savePaint(props) {
46
+ this.add({
47
+ type: _Core.CommandType.SavePaint,
48
+ props
49
+ });
50
+ }
51
+ restorePaint() {
52
+ this.add({
53
+ type: _Core.CommandType.RestorePaint
54
+ });
55
+ }
56
+ restorePaintDeclaration() {
57
+ this.add({
58
+ type: _Core.CommandType.RestorePaintDeclaration
59
+ });
60
+ }
61
+ materializePaint() {
62
+ this.add({
63
+ type: _Core.CommandType.MaterializePaint
64
+ });
65
+ }
66
+ pushPathEffect(pathEffectType, props) {
67
+ if (!(0, _Node.isPathEffect)(pathEffectType)) {
68
+ throw new Error("Invalid color filter type: " + pathEffectType);
69
+ }
70
+ this.add({
71
+ type: _Core.CommandType.PushPathEffect,
72
+ pathEffectType,
73
+ props
74
+ });
75
+ }
76
+ pushImageFilter(imageFilterType, props) {
77
+ if (!(0, _Node.isImageFilter)(imageFilterType)) {
78
+ throw new Error("Invalid color filter type: " + imageFilterType);
79
+ }
80
+ this.add({
81
+ type: _Core.CommandType.PushImageFilter,
82
+ imageFilterType,
83
+ props
84
+ });
85
+ }
86
+ pushColorFilter(colorFilterType, props) {
87
+ if (!(0, _Node.isColorFilter)(colorFilterType)) {
88
+ throw new Error("Invalid color filter type: " + colorFilterType);
89
+ }
90
+ this.add({
91
+ type: _Core.CommandType.PushColorFilter,
92
+ colorFilterType,
93
+ props
94
+ });
95
+ }
96
+ pushShader(shaderType, props) {
97
+ if (!(0, _Node.isShader)(shaderType) && !(shaderType === _types.NodeType.Blend)) {
98
+ throw new Error("Invalid color filter type: " + shaderType);
99
+ }
100
+ this.add({
101
+ type: _Core.CommandType.PushShader,
102
+ shaderType,
103
+ props
104
+ });
105
+ }
106
+ pushBlurMaskFilter(props) {
107
+ this.add({
108
+ type: _Core.CommandType.PushBlurMaskFilter,
109
+ props
110
+ });
111
+ }
112
+ composePathEffect() {
113
+ this.add({
114
+ type: _Core.CommandType.ComposePathEffect
115
+ });
116
+ }
117
+ composeColorFilter() {
118
+ this.add({
119
+ type: _Core.CommandType.ComposeColorFilter
120
+ });
121
+ }
122
+ composeImageFilter() {
123
+ this.add({
124
+ type: _Core.CommandType.ComposeImageFilter
125
+ });
126
+ }
127
+ saveCTM(props) {
128
+ this.add({
129
+ type: _Core.CommandType.SaveCTM,
130
+ props
131
+ });
132
+ }
133
+ restoreCTM() {
134
+ this.add({
135
+ type: _Core.CommandType.RestoreCTM
136
+ });
137
+ }
138
+ drawPaint() {
139
+ this.add({
140
+ type: _Core.CommandType.DrawPaint
141
+ });
142
+ }
143
+ saveLayer() {
144
+ this.add({
145
+ type: _Core.CommandType.SaveLayer
146
+ });
147
+ }
148
+ saveBackdropFilter() {
149
+ this.add({
150
+ type: _Core.CommandType.SaveBackdropFilter
151
+ });
152
+ }
153
+ drawBox(boxProps, shadows) {
154
+ shadows.forEach(shadow => {
155
+ if (shadow.props) {
156
+ if (shadow.props) {
157
+ const {
158
+ animatedProps
159
+ } = this.processProps(shadow.props);
160
+ if (animatedProps) {
161
+ shadow.animatedProps = animatedProps;
162
+ }
163
+ }
164
+ }
165
+ });
166
+ this.add({
167
+ type: _Core.CommandType.DrawBox,
168
+ props: boxProps,
169
+ shadows
170
+ });
171
+ }
172
+ drawImage(props) {
173
+ this.add({
174
+ type: _Core.CommandType.DrawImage,
175
+ props
176
+ });
177
+ }
178
+ drawCircle(props) {
179
+ this.add({
180
+ type: _Core.CommandType.DrawCircle,
181
+ props
182
+ });
183
+ }
184
+ drawPoints(props) {
185
+ this.add({
186
+ type: _Core.CommandType.DrawPoints,
187
+ props
188
+ });
189
+ }
190
+ drawPath(props) {
191
+ this.add({
192
+ type: _Core.CommandType.DrawPath,
193
+ props
194
+ });
195
+ }
196
+ drawRect(props) {
197
+ this.add({
198
+ type: _Core.CommandType.DrawRect,
199
+ props
200
+ });
201
+ }
202
+ drawRRect(props) {
203
+ this.add({
204
+ type: _Core.CommandType.DrawRRect,
205
+ props
206
+ });
207
+ }
208
+ drawOval(props) {
209
+ this.add({
210
+ type: _Core.CommandType.DrawOval,
211
+ props
212
+ });
213
+ }
214
+ drawLine(props) {
215
+ this.add({
216
+ type: _Core.CommandType.DrawLine,
217
+ props
218
+ });
219
+ }
220
+ drawPatch(props) {
221
+ this.add({
222
+ type: _Core.CommandType.DrawPatch,
223
+ props
224
+ });
225
+ }
226
+ drawVertices(props) {
227
+ this.add({
228
+ type: _Core.CommandType.DrawVertices,
229
+ props
230
+ });
231
+ }
232
+ drawDiffRect(props) {
233
+ this.add({
234
+ type: _Core.CommandType.DrawDiffRect,
235
+ props
236
+ });
237
+ }
238
+ drawText(props) {
239
+ this.add({
240
+ type: _Core.CommandType.DrawText,
241
+ props
242
+ });
243
+ }
244
+ drawTextPath(props) {
245
+ this.add({
246
+ type: _Core.CommandType.DrawTextPath,
247
+ props
248
+ });
249
+ }
250
+ drawTextBlob(props) {
251
+ this.add({
252
+ type: _Core.CommandType.DrawTextBlob,
253
+ props
254
+ });
255
+ }
256
+ drawGlyphs(props) {
257
+ this.add({
258
+ type: _Core.CommandType.DrawGlyphs,
259
+ props
260
+ });
261
+ }
262
+ drawPicture(props) {
263
+ this.add({
264
+ type: _Core.CommandType.DrawPicture,
265
+ props
266
+ });
267
+ }
268
+ drawImageSVG(props) {
269
+ this.add({
270
+ type: _Core.CommandType.DrawImageSVG,
271
+ props
272
+ });
273
+ }
274
+ drawParagraph(props) {
275
+ this.add({
276
+ type: _Core.CommandType.DrawParagraph,
277
+ props
278
+ });
279
+ }
280
+ drawAtlas(props) {
281
+ this.add({
282
+ type: _Core.CommandType.DrawAtlas,
283
+ props
284
+ });
285
+ }
286
+ }
287
+ exports.Recorder = Recorder;
288
+ //# sourceMappingURL=Recorder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","_utils","_Node","_Core","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","Recorder","constructor","processProps","props","animatedProps","hasAnimatedProps","key","prop","isSharedValue","undefined","add","command","commands","push","savePaint","type","CommandType","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","isPathEffect","Error","PushPathEffect","pushImageFilter","imageFilterType","isImageFilter","PushImageFilter","pushColorFilter","colorFilterType","isColorFilter","PushColorFilter","pushShader","shaderType","isShader","NodeType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","forEach","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas","exports"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\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 BoxProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport class Recorder {\n commands: Command[] = [];\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n props[key] = prop.value;\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.commands.push(command);\n }\n\n savePaint(props: AnimatedProps<PaintProps>) {\n this.add({ type: CommandType.SavePaint, props });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AA4BA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AAAqC,SAAAI,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAA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AEC,iBAAW,CAACwF,SAAS;MAAErG;IAAM,CAAC,CAAC;EAClD;AACF;AAACsG,OAAA,CAAAzG,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import type { SkPaint } from "../../skia/types";
2
+ import type { Command } from "./Core";
3
+ export interface Recording {
4
+ commands: Command[];
5
+ paintPool: SkPaint[];
6
+ }
7
+ export declare const createRecording: (commands: Command[]) => Recording;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createRecording = void 0;
7
+ const createRecording = commands => ({
8
+ commands,
9
+ paintPool: []
10
+ });
11
+ exports.createRecording = createRecording;
12
+ //# sourceMappingURL=Recording.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createRecording","commands","paintPool","exports"],"sources":["Recording.ts"],"sourcesContent":["import type { SkPaint } from \"../../skia/types\";\n\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n}\n\nexport const createRecording = (commands: Command[]): Recording => ({\n commands,\n paintPool: [],\n});\n"],"mappings":";;;;;;AASO,MAAMA,eAAe,GAAIC,QAAmB,KAAiB;EAClEA,QAAQ;EACRC,SAAS,EAAE;AACb,CAAC,CAAC;AAACC,OAAA,CAAAH,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import type { DrawingNodeProps } from "../../dom/types";
2
+ import type { Node } from "../Node";
3
+ import type { Recorder } from "./Recorder";
4
+ export declare const processPaint: ({ opacity, color, strokeWidth, blendMode, style, strokeJoin, strokeCap, strokeMiter, antiAlias, dither, paint: paintRef, }: DrawingNodeProps) => DrawingNodeProps | null;
5
+ export declare const visit: (recorder: Recorder, root: Node[]) => void;