@shopify/react-native-skia 0.1.122 → 0.1.125

Sign up to get free protection for your applications and to get access to all the features.
Files changed (466) hide show
  1. package/android/CMakeLists.txt +6 -1
  2. package/android/build.gradle +1 -1
  3. package/android/cpp/jni/JniSkiaDrawView.cpp +14 -71
  4. package/android/cpp/jni/JniSkiaManager.cpp +1 -1
  5. package/android/cpp/jni/include/JniSkiaDrawView.h +18 -22
  6. package/android/cpp/jni/include/JniSkiaManager.h +4 -4
  7. package/android/cpp/rnskia-android/RNSkDrawViewImpl.cpp +68 -0
  8. package/android/cpp/rnskia-android/RNSkDrawViewImpl.h +48 -0
  9. package/android/cpp/{jni/include/JniPlatformContextWrapper.h → rnskia-android/RNSkPlatformContextImpl.h} +4 -4
  10. package/android/cpp/{jni → rnskia-android}/SkiaOpenGLRenderer.cpp +39 -54
  11. package/android/cpp/{jni/include → rnskia-android}/SkiaOpenGLRenderer.h +2 -31
  12. package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaViewManager.java +1 -1
  13. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +21 -28
  14. package/cpp/api/JsiSkApi.h +3 -1
  15. package/cpp/api/JsiSkCanvas.h +1 -1
  16. package/cpp/api/JsiSkColor.h +41 -7
  17. package/cpp/api/JsiSkColorFilterFactory.h +2 -1
  18. package/cpp/api/JsiSkImageFilter.h +0 -2
  19. package/cpp/api/JsiSkImageFilterFactory.h +37 -17
  20. package/cpp/api/JsiSkMatrix.h +44 -2
  21. package/cpp/api/JsiSkPaint.h +4 -7
  22. package/cpp/api/JsiSkRuntimeEffect.h +7 -0
  23. package/cpp/api/JsiSkRuntimeEffectFactory.h +3 -2
  24. package/cpp/api/JsiSkRuntimeShaderBuilder.h +70 -0
  25. package/cpp/api/JsiSkShaderFactory.h +2 -2
  26. package/cpp/api/JsiSkVertices.h +1 -1
  27. package/cpp/api/third_party/CSSColorParser.cpp +194 -0
  28. package/cpp/api/third_party/CSSColorParser.h +1 -191
  29. package/cpp/jsi/JsiSimpleValueWrapper.h +98 -0
  30. package/cpp/rnskia/RNSkAnimation.h +0 -2
  31. package/cpp/rnskia/RNSkDrawView.cpp +84 -126
  32. package/cpp/rnskia/RNSkDrawView.h +7 -37
  33. package/cpp/rnskia/RNSkJsiViewApi.h +8 -5
  34. package/cpp/rnskia/RNSkManager.cpp +2 -2
  35. package/cpp/rnskia/RNSkManager.h +2 -2
  36. package/cpp/rnskia/RNSkPlatformContext.h +1 -1
  37. package/cpp/rnskia/RNSkValueApi.h +6 -2
  38. package/cpp/rnskia/values/RNSkClockValue.h +18 -10
  39. package/cpp/rnskia/values/RNSkDerivedValue.h +12 -5
  40. package/cpp/rnskia/values/RNSkReadonlyValue.h +25 -17
  41. package/cpp/rnskia/values/RNSkValue.h +8 -3
  42. package/cpp/utils/RNSkTimingInfo.h +13 -1
  43. package/ios/RNSkia-iOS/PlatformContext.h +30 -4
  44. package/ios/RNSkia-iOS/RNSkDrawViewImpl.h +8 -10
  45. package/ios/RNSkia-iOS/RNSkDrawViewImpl.mm +25 -10
  46. package/ios/RNSkia-iOS/SkiaDrawView.mm +22 -20
  47. package/lib/commonjs/{values/animation → animation}/decay/decay.js +0 -0
  48. package/lib/commonjs/{values/animation → animation}/decay/decay.js.map +0 -0
  49. package/lib/commonjs/{values/animation → animation}/decay/index.js +0 -0
  50. package/lib/commonjs/{values/animation → animation}/decay/index.js.map +0 -0
  51. package/lib/commonjs/{values/animation → animation}/decay/runDecay.js +1 -1
  52. package/lib/commonjs/animation/decay/runDecay.js.map +1 -0
  53. package/lib/commonjs/{values/animation → animation}/decay/types.js +0 -0
  54. package/lib/commonjs/{values/animation → animation}/decay/types.js.map +0 -0
  55. package/lib/commonjs/{values/animation → animation}/functions/index.js +0 -0
  56. package/lib/commonjs/{values/animation → animation}/functions/index.js.map +0 -0
  57. package/lib/commonjs/animation/functions/interpolate.js +141 -0
  58. package/lib/commonjs/animation/functions/interpolate.js.map +1 -0
  59. package/lib/commonjs/animation/functions/interpolateColors.js +39 -0
  60. package/lib/commonjs/animation/functions/interpolateColors.js.map +1 -0
  61. package/lib/commonjs/{values/animation → animation}/index.js +0 -0
  62. package/lib/commonjs/{values/animation → animation}/index.js.map +0 -0
  63. package/lib/commonjs/{values/animation → animation}/spring/Spring.js +0 -0
  64. package/lib/commonjs/{values/animation → animation}/spring/Spring.js.map +0 -0
  65. package/lib/commonjs/{values/animation → animation}/spring/functions/index.js +0 -0
  66. package/lib/commonjs/{values/animation → animation}/spring/functions/index.js.map +0 -0
  67. package/lib/commonjs/{values/animation → animation}/spring/functions/spring.js +0 -0
  68. package/lib/commonjs/{values/animation → animation}/spring/functions/spring.js.map +0 -0
  69. package/lib/commonjs/{values/animation → animation}/spring/index.js +0 -0
  70. package/lib/commonjs/{values/animation → animation}/spring/index.js.map +0 -0
  71. package/lib/commonjs/{values/animation → animation}/spring/runSpring.js +0 -0
  72. package/lib/commonjs/animation/spring/runSpring.js.map +1 -0
  73. package/lib/commonjs/{values/animation → animation}/spring/types.js +0 -0
  74. package/lib/commonjs/{values/animation → animation}/spring/types.js.map +0 -0
  75. package/lib/commonjs/{values/animation → animation}/spring/useSpring.js +0 -0
  76. package/lib/commonjs/animation/spring/useSpring.js.map +1 -0
  77. package/lib/commonjs/{values/animation → animation}/timing/Easing.js +0 -0
  78. package/lib/commonjs/{values/animation → animation}/timing/Easing.js.map +0 -0
  79. package/lib/commonjs/{values/animation → animation}/timing/createTiming.js +1 -1
  80. package/lib/commonjs/animation/timing/createTiming.js.map +1 -0
  81. package/lib/commonjs/{values/animation → animation}/timing/functions/bezier.js +0 -0
  82. package/lib/commonjs/{values/animation → animation}/timing/functions/bezier.js.map +0 -0
  83. package/lib/commonjs/{values/animation → animation}/timing/functions/getResolvedParams.js +3 -3
  84. package/lib/commonjs/animation/timing/functions/getResolvedParams.js.map +1 -0
  85. package/lib/commonjs/{values/animation → animation}/timing/functions/index.js +0 -0
  86. package/lib/commonjs/{values/animation → animation}/timing/functions/index.js.map +0 -0
  87. package/lib/commonjs/{values/animation → animation}/timing/functions/timing.js +0 -0
  88. package/lib/commonjs/{values/animation → animation}/timing/functions/timing.js.map +1 -1
  89. package/lib/commonjs/{values/animation → animation}/timing/functions/types.js +0 -0
  90. package/lib/commonjs/{values/animation → animation}/timing/functions/types.js.map +0 -0
  91. package/lib/commonjs/{values/animation → animation}/timing/index.js +0 -0
  92. package/lib/commonjs/{values/animation → animation}/timing/index.js.map +0 -0
  93. package/lib/commonjs/{values/animation → animation}/timing/runTiming.js +0 -0
  94. package/lib/commonjs/animation/timing/runTiming.js.map +1 -0
  95. package/lib/commonjs/{values/animation → animation}/timing/useLoop.js +0 -0
  96. package/lib/commonjs/{values/animation → animation}/timing/useLoop.js.map +0 -0
  97. package/lib/commonjs/{values/animation → animation}/timing/useTiming.js +1 -1
  98. package/lib/commonjs/animation/timing/useTiming.js.map +1 -0
  99. package/lib/commonjs/{values/animation → animation}/types.js +0 -0
  100. package/lib/commonjs/{values/animation → animation}/types.js.map +0 -0
  101. package/lib/commonjs/index.js +13 -0
  102. package/lib/commonjs/index.js.map +1 -1
  103. package/lib/commonjs/renderer/Canvas.js +17 -8
  104. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  105. package/lib/commonjs/renderer/components/Paint.js +1 -1
  106. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  107. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
  108. package/lib/commonjs/renderer/components/colorFilters/Lerp.js +1 -1
  109. package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
  110. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +4 -2
  111. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +1 -1
  112. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js +37 -0
  113. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -0
  114. package/lib/commonjs/renderer/components/imageFilters/index.js +13 -0
  115. package/lib/commonjs/renderer/components/imageFilters/index.js.map +1 -1
  116. package/lib/commonjs/renderer/components/shaders/Gradient.js +1 -1
  117. package/lib/commonjs/renderer/components/shaders/Gradient.js.map +1 -1
  118. package/lib/commonjs/renderer/components/shaders/Shader.js +2 -2
  119. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  120. package/lib/commonjs/renderer/components/shapes/Path.js +9 -1
  121. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  122. package/lib/commonjs/renderer/processors/Circles.js +3 -2
  123. package/lib/commonjs/renderer/processors/Circles.js.map +1 -1
  124. package/lib/commonjs/renderer/processors/Font.js +1 -1
  125. package/lib/commonjs/renderer/processors/Font.js.map +1 -1
  126. package/lib/commonjs/renderer/processors/Paint.js +6 -1
  127. package/lib/commonjs/renderer/processors/Paint.js.map +1 -1
  128. package/lib/commonjs/renderer/processors/Rects.js +11 -21
  129. package/lib/commonjs/renderer/processors/Rects.js.map +1 -1
  130. package/lib/commonjs/renderer/processors/math/Matrix3.js +42 -63
  131. package/lib/commonjs/renderer/processors/math/Matrix3.js.map +1 -1
  132. package/lib/commonjs/renderer/processors/math/Vector.js +4 -5
  133. package/lib/commonjs/renderer/processors/math/Vector.js.map +1 -1
  134. package/lib/commonjs/skia/Color.js +14 -38
  135. package/lib/commonjs/skia/Color.js.map +1 -1
  136. package/lib/commonjs/skia/ImageFilter/ImageFilterFactory.js.map +1 -1
  137. package/lib/commonjs/skia/Matrix.js.map +1 -1
  138. package/lib/commonjs/skia/Paint/Paint.js +13 -1
  139. package/lib/commonjs/skia/Paint/Paint.js.map +1 -1
  140. package/lib/commonjs/skia/Paint/usePaint.js +2 -4
  141. package/lib/commonjs/skia/Paint/usePaint.js.map +1 -1
  142. package/lib/commonjs/skia/Shader/useShader.js +4 -1
  143. package/lib/commonjs/skia/Shader/useShader.js.map +1 -1
  144. package/lib/commonjs/skia/Skia.js +3 -43
  145. package/lib/commonjs/skia/Skia.js.map +1 -1
  146. package/lib/commonjs/skia/SkiaApi.js +4 -0
  147. package/lib/commonjs/skia/SkiaApi.js.map +1 -0
  148. package/lib/commonjs/values/api.js +4 -6
  149. package/lib/commonjs/values/api.js.map +1 -1
  150. package/lib/commonjs/values/api.web.js +18 -0
  151. package/lib/commonjs/values/api.web.js.map +1 -0
  152. package/lib/commonjs/values/index.js +0 -13
  153. package/lib/commonjs/values/index.js.map +1 -1
  154. package/lib/commonjs/values/web/RNSkAnimation.js +46 -0
  155. package/lib/commonjs/values/web/RNSkAnimation.js.map +1 -0
  156. package/lib/commonjs/values/web/RNSkClockValue.js +75 -0
  157. package/lib/commonjs/values/web/RNSkClockValue.js.map +1 -0
  158. package/lib/commonjs/values/web/RNSkDerivedValue.js +51 -0
  159. package/lib/commonjs/values/web/RNSkDerivedValue.js.map +1 -0
  160. package/lib/commonjs/values/web/RNSkReadonlyValue.js +45 -0
  161. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -0
  162. package/lib/commonjs/values/web/RNSkValue.js +73 -0
  163. package/lib/commonjs/values/web/RNSkValue.js.map +1 -0
  164. package/lib/commonjs/values/web/api.js +31 -0
  165. package/lib/commonjs/values/web/api.js.map +1 -0
  166. package/lib/commonjs/values/web/index.js +19 -0
  167. package/lib/commonjs/values/web/index.js.map +1 -0
  168. package/lib/commonjs/views/SkiaView.js +13 -10
  169. package/lib/commonjs/views/SkiaView.js.map +1 -1
  170. package/lib/commonjs/views/api.js +11 -0
  171. package/lib/commonjs/views/api.js.map +1 -0
  172. package/lib/commonjs/views/types.js.map +1 -1
  173. package/lib/module/{values/animation → animation}/decay/decay.js +0 -0
  174. package/lib/module/{values/animation → animation}/decay/decay.js.map +0 -0
  175. package/lib/module/{values/animation → animation}/decay/index.js +0 -0
  176. package/lib/module/{values/animation → animation}/decay/index.js.map +0 -0
  177. package/lib/module/{values/animation → animation}/decay/runDecay.js +1 -1
  178. package/lib/module/animation/decay/runDecay.js.map +1 -0
  179. package/lib/module/{values/animation → animation}/decay/types.js +0 -0
  180. package/lib/module/{values/animation → animation}/decay/types.js.map +0 -0
  181. package/lib/module/{values/animation → animation}/functions/index.js +0 -0
  182. package/lib/module/{values/animation → animation}/functions/index.js.map +0 -0
  183. package/lib/module/animation/functions/interpolate.js +132 -0
  184. package/lib/module/animation/functions/interpolate.js.map +1 -0
  185. package/lib/module/animation/functions/interpolateColors.js +23 -0
  186. package/lib/module/animation/functions/interpolateColors.js.map +1 -0
  187. package/lib/module/{values/animation → animation}/index.js +0 -0
  188. package/lib/module/{values/animation → animation}/index.js.map +0 -0
  189. package/lib/module/{values/animation → animation}/spring/Spring.js +0 -0
  190. package/lib/module/{values/animation → animation}/spring/Spring.js.map +0 -0
  191. package/lib/module/{values/animation → animation}/spring/functions/index.js +0 -0
  192. package/lib/module/{values/animation → animation}/spring/functions/index.js.map +0 -0
  193. package/lib/module/{values/animation → animation}/spring/functions/spring.js +0 -0
  194. package/lib/module/{values/animation → animation}/spring/functions/spring.js.map +0 -0
  195. package/lib/module/{values/animation → animation}/spring/index.js +0 -0
  196. package/lib/module/{values/animation → animation}/spring/index.js.map +0 -0
  197. package/lib/module/{values/animation → animation}/spring/runSpring.js +0 -0
  198. package/lib/module/animation/spring/runSpring.js.map +1 -0
  199. package/lib/module/{values/animation → animation}/spring/types.js +0 -0
  200. package/lib/module/{values/animation → animation}/spring/types.js.map +0 -0
  201. package/lib/module/{values/animation → animation}/spring/useSpring.js +0 -0
  202. package/lib/module/animation/spring/useSpring.js.map +1 -0
  203. package/lib/module/{values/animation → animation}/timing/Easing.js +0 -0
  204. package/lib/module/{values/animation → animation}/timing/Easing.js.map +0 -0
  205. package/lib/module/{values/animation → animation}/timing/createTiming.js +1 -1
  206. package/lib/module/animation/timing/createTiming.js.map +1 -0
  207. package/lib/module/{values/animation → animation}/timing/functions/bezier.js +0 -0
  208. package/lib/module/{values/animation → animation}/timing/functions/bezier.js.map +0 -0
  209. package/lib/module/{values/animation → animation}/timing/functions/getResolvedParams.js +3 -3
  210. package/lib/module/animation/timing/functions/getResolvedParams.js.map +1 -0
  211. package/lib/module/{values/animation → animation}/timing/functions/index.js +0 -0
  212. package/lib/module/{values/animation → animation}/timing/functions/index.js.map +0 -0
  213. package/lib/module/{values/animation → animation}/timing/functions/timing.js +0 -0
  214. package/lib/module/{values/animation → animation}/timing/functions/timing.js.map +1 -1
  215. package/lib/module/{values/animation → animation}/timing/functions/types.js +0 -0
  216. package/lib/module/{values/animation → animation}/timing/functions/types.js.map +0 -0
  217. package/lib/module/{values/animation → animation}/timing/index.js +0 -0
  218. package/lib/module/{values/animation → animation}/timing/index.js.map +0 -0
  219. package/lib/module/{values/animation → animation}/timing/runTiming.js +0 -0
  220. package/lib/module/animation/timing/runTiming.js.map +1 -0
  221. package/lib/module/{values/animation → animation}/timing/useLoop.js +0 -0
  222. package/lib/module/{values/animation → animation}/timing/useLoop.js.map +0 -0
  223. package/lib/module/{values/animation → animation}/timing/useTiming.js +1 -1
  224. package/lib/module/animation/timing/useTiming.js.map +1 -0
  225. package/lib/module/{values/animation → animation}/types.js +0 -0
  226. package/lib/module/{values/animation → animation}/types.js.map +0 -0
  227. package/lib/module/index.js +1 -0
  228. package/lib/module/index.js.map +1 -1
  229. package/lib/module/renderer/Canvas.js +12 -6
  230. package/lib/module/renderer/Canvas.js.map +1 -1
  231. package/lib/module/renderer/components/Paint.js +2 -2
  232. package/lib/module/renderer/components/Paint.js.map +1 -1
  233. package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
  234. package/lib/module/renderer/components/colorFilters/Lerp.js +1 -1
  235. package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
  236. package/lib/module/renderer/components/imageFilters/InnerShadow.js +3 -2
  237. package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +1 -1
  238. package/lib/module/renderer/components/imageFilters/RuntimeShader.js +19 -0
  239. package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -0
  240. package/lib/module/renderer/components/imageFilters/index.js +1 -0
  241. package/lib/module/renderer/components/imageFilters/index.js.map +1 -1
  242. package/lib/module/renderer/components/shaders/Gradient.js +2 -2
  243. package/lib/module/renderer/components/shaders/Gradient.js.map +1 -1
  244. package/lib/module/renderer/components/shaders/Shader.js +3 -2
  245. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  246. package/lib/module/renderer/components/shapes/Path.js +9 -2
  247. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  248. package/lib/module/renderer/processors/Circles.js +3 -2
  249. package/lib/module/renderer/processors/Circles.js.map +1 -1
  250. package/lib/module/renderer/processors/Font.js +1 -1
  251. package/lib/module/renderer/processors/Font.js.map +1 -1
  252. package/lib/module/renderer/processors/Paint.js +6 -1
  253. package/lib/module/renderer/processors/Paint.js.map +1 -1
  254. package/lib/module/renderer/processors/Rects.js +9 -21
  255. package/lib/module/renderer/processors/Rects.js.map +1 -1
  256. package/lib/module/renderer/processors/math/Matrix3.js +52 -72
  257. package/lib/module/renderer/processors/math/Matrix3.js.map +1 -1
  258. package/lib/module/renderer/processors/math/Vector.js +3 -5
  259. package/lib/module/renderer/processors/math/Vector.js.map +1 -1
  260. package/lib/module/skia/Color.js +9 -25
  261. package/lib/module/skia/Color.js.map +1 -1
  262. package/lib/module/skia/ImageFilter/ImageFilterFactory.js.map +1 -1
  263. package/lib/module/skia/Matrix.js.map +1 -1
  264. package/lib/module/skia/Paint/Paint.js +6 -0
  265. package/lib/module/skia/Paint/Paint.js.map +1 -1
  266. package/lib/module/skia/Paint/usePaint.js +2 -3
  267. package/lib/module/skia/Paint/usePaint.js.map +1 -1
  268. package/lib/module/skia/Shader/useShader.js +4 -1
  269. package/lib/module/skia/Shader/useShader.js.map +1 -1
  270. package/lib/module/skia/Skia.js +2 -44
  271. package/lib/module/skia/Skia.js.map +1 -1
  272. package/lib/module/skia/SkiaApi.js +2 -0
  273. package/lib/module/skia/SkiaApi.js.map +1 -0
  274. package/lib/module/values/api.js +4 -6
  275. package/lib/module/values/api.js.map +1 -1
  276. package/lib/module/values/api.web.js +7 -0
  277. package/lib/module/values/api.web.js.map +1 -0
  278. package/lib/module/values/index.js +0 -1
  279. package/lib/module/values/index.js.map +1 -1
  280. package/lib/module/values/web/RNSkAnimation.js +36 -0
  281. package/lib/module/values/web/RNSkAnimation.js.map +1 -0
  282. package/lib/module/values/web/RNSkClockValue.js +65 -0
  283. package/lib/module/values/web/RNSkClockValue.js.map +1 -0
  284. package/lib/module/values/web/RNSkDerivedValue.js +41 -0
  285. package/lib/module/values/web/RNSkDerivedValue.js.map +1 -0
  286. package/lib/module/values/web/RNSkReadonlyValue.js +36 -0
  287. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -0
  288. package/lib/module/values/web/RNSkValue.js +63 -0
  289. package/lib/module/values/web/RNSkValue.js.map +1 -0
  290. package/lib/module/values/web/api.js +19 -0
  291. package/lib/module/values/web/api.js.map +1 -0
  292. package/lib/module/values/web/index.js +2 -0
  293. package/lib/module/values/web/index.js.map +1 -0
  294. package/lib/module/views/SkiaView.js +1 -3
  295. package/lib/module/views/SkiaView.js.map +1 -1
  296. package/lib/module/views/api.js +4 -0
  297. package/lib/module/views/api.js.map +1 -0
  298. package/lib/module/views/types.js.map +1 -1
  299. package/lib/typescript/src/{values/animation → animation}/decay/decay.d.ts +0 -0
  300. package/lib/typescript/src/{values/animation → animation}/decay/index.d.ts +0 -0
  301. package/lib/typescript/src/{values/animation → animation}/decay/runDecay.d.ts +2 -2
  302. package/lib/typescript/src/{values/animation → animation}/decay/types.d.ts +1 -1
  303. package/lib/typescript/src/{values/animation → animation}/functions/index.d.ts +0 -0
  304. package/lib/typescript/src/animation/functions/interpolate.d.ts +11 -0
  305. package/lib/typescript/src/animation/functions/interpolateColors.d.ts +3 -0
  306. package/lib/typescript/src/{values/animation → animation}/index.d.ts +0 -0
  307. package/lib/typescript/src/{values/animation → animation}/spring/Spring.d.ts +0 -0
  308. package/lib/typescript/src/{values/animation → animation}/spring/functions/index.d.ts +0 -0
  309. package/lib/typescript/src/{values/animation → animation}/spring/functions/spring.d.ts +0 -0
  310. package/lib/typescript/src/{values/animation → animation}/spring/index.d.ts +0 -0
  311. package/lib/typescript/src/{values/animation → animation}/spring/runSpring.d.ts +1 -1
  312. package/lib/typescript/src/{values/animation → animation}/spring/types.d.ts +0 -0
  313. package/lib/typescript/src/{values/animation → animation}/spring/useSpring.d.ts +1 -1
  314. package/lib/typescript/src/{values/animation → animation}/timing/Easing.d.ts +0 -0
  315. package/lib/typescript/src/{values/animation → animation}/timing/createTiming.d.ts +2 -2
  316. package/lib/typescript/src/{values/animation → animation}/timing/functions/bezier.d.ts +0 -0
  317. package/lib/typescript/src/{values/animation → animation}/timing/functions/getResolvedParams.d.ts +0 -0
  318. package/lib/typescript/src/{values/animation → animation}/timing/functions/index.d.ts +0 -0
  319. package/lib/typescript/src/{values/animation → animation}/timing/functions/timing.d.ts +1 -1
  320. package/lib/typescript/src/{values/animation → animation}/timing/functions/types.d.ts +0 -0
  321. package/lib/typescript/src/{values/animation → animation}/timing/index.d.ts +0 -0
  322. package/lib/typescript/src/{values/animation → animation}/timing/runTiming.d.ts +1 -1
  323. package/lib/typescript/src/{values/animation → animation}/timing/useLoop.d.ts +0 -0
  324. package/lib/typescript/src/{values/animation → animation}/timing/useTiming.d.ts +1 -1
  325. package/lib/typescript/src/{values/animation → animation}/types.d.ts +5 -5
  326. package/lib/typescript/src/index.d.ts +1 -0
  327. package/lib/typescript/src/renderer/Canvas.d.ts +6 -0
  328. package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +1 -1
  329. package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +7 -0
  330. package/lib/typescript/src/renderer/components/imageFilters/index.d.ts +1 -0
  331. package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +1 -1
  332. package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -2
  333. package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +1 -4
  334. package/lib/typescript/src/renderer/components/shapes/Path.d.ts +3 -1
  335. package/lib/typescript/src/renderer/processors/Paint.d.ts +2 -1
  336. package/lib/typescript/src/renderer/processors/Rects.d.ts +9 -41
  337. package/lib/typescript/src/renderer/processors/math/Matrix3.d.ts +1 -5
  338. package/lib/typescript/src/renderer/processors/math/Vector.d.ts +5 -17
  339. package/lib/typescript/src/skia/Color.d.ts +8 -9
  340. package/lib/typescript/src/skia/ImageFilter/ImageFilterFactory.d.ts +16 -0
  341. package/lib/typescript/src/skia/Matrix.d.ts +7 -1
  342. package/lib/typescript/src/skia/Paint/Paint.d.ts +1 -0
  343. package/lib/typescript/src/skia/RuntimeEffect/RuntimeEffect.d.ts +2 -1
  344. package/lib/typescript/src/skia/RuntimeEffect/RuntimeEffectFactory.d.ts +2 -2
  345. package/lib/typescript/src/skia/Shader/useShader.d.ts +1 -1
  346. package/lib/typescript/src/skia/Skia.d.ts +28 -95
  347. package/lib/typescript/src/skia/SkiaApi.d.ts +71 -0
  348. package/lib/typescript/src/skia/Surface/Surface.d.ts +1 -1
  349. package/lib/typescript/src/skia/Surface/SurfaceFactory.d.ts +2 -2
  350. package/lib/typescript/src/values/api.d.ts +2 -25
  351. package/lib/typescript/src/values/api.web.d.ts +2 -0
  352. package/lib/typescript/src/values/index.d.ts +0 -1
  353. package/lib/typescript/src/values/types.d.ts +24 -1
  354. package/lib/typescript/src/values/web/RNSkAnimation.d.ts +9 -0
  355. package/lib/typescript/src/values/web/RNSkClockValue.d.ts +13 -0
  356. package/lib/typescript/src/values/web/RNSkDerivedValue.d.ts +9 -0
  357. package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +11 -0
  358. package/lib/typescript/src/values/web/RNSkValue.d.ts +14 -0
  359. package/lib/typescript/src/values/web/api.d.ts +2 -0
  360. package/lib/typescript/src/values/web/index.d.ts +1 -0
  361. package/lib/typescript/src/views/SkiaView.d.ts +3 -36
  362. package/lib/typescript/src/views/api.d.ts +5 -0
  363. package/lib/typescript/src/views/types.d.ts +32 -0
  364. package/package.json +2 -2
  365. package/src/{values/animation → animation}/decay/decay.ts +0 -0
  366. package/src/{values/animation → animation}/decay/index.ts +0 -0
  367. package/src/{values/animation → animation}/decay/runDecay.ts +2 -2
  368. package/src/{values/animation → animation}/decay/types.ts +1 -1
  369. package/src/{values/animation → animation}/functions/index.ts +0 -0
  370. package/src/animation/functions/interpolate.ts +182 -0
  371. package/src/animation/functions/interpolateColors.ts +58 -0
  372. package/src/{values/animation → animation}/index.ts +0 -0
  373. package/src/{values/animation → animation}/spring/Spring.ts +0 -0
  374. package/src/{values/animation → animation}/spring/functions/index.ts +0 -0
  375. package/src/{values/animation → animation}/spring/functions/spring.ts +0 -0
  376. package/src/{values/animation → animation}/spring/index.ts +0 -0
  377. package/src/{values/animation → animation}/spring/runSpring.ts +1 -1
  378. package/src/{values/animation → animation}/spring/types.ts +0 -0
  379. package/src/{values/animation → animation}/spring/useSpring.ts +1 -1
  380. package/src/{values/animation → animation}/timing/Easing.ts +0 -0
  381. package/src/{values/animation → animation}/timing/createTiming.ts +2 -2
  382. package/src/{values/animation → animation}/timing/functions/__tests__/timing.spec.ts +0 -0
  383. package/src/{values/animation → animation}/timing/functions/bezier.ts +0 -0
  384. package/src/{values/animation → animation}/timing/functions/getResolvedParams.ts +2 -2
  385. package/src/{values/animation → animation}/timing/functions/index.ts +0 -0
  386. package/src/{values/animation → animation}/timing/functions/timing.ts +1 -1
  387. package/src/{values/animation → animation}/timing/functions/types.ts +0 -0
  388. package/src/{values/animation → animation}/timing/index.ts +0 -0
  389. package/src/{values/animation → animation}/timing/runTiming.ts +1 -1
  390. package/src/{values/animation → animation}/timing/useLoop.ts +0 -0
  391. package/src/{values/animation → animation}/timing/useTiming.ts +2 -2
  392. package/src/{values/animation → animation}/types.ts +5 -5
  393. package/src/index.ts +1 -0
  394. package/src/renderer/Canvas.tsx +13 -6
  395. package/src/renderer/components/Paint.tsx +2 -2
  396. package/src/renderer/components/colorFilters/BlendColor.tsx +1 -1
  397. package/src/renderer/components/colorFilters/Lerp.tsx +1 -1
  398. package/src/renderer/components/imageFilters/InnerShadow.tsx +4 -2
  399. package/src/renderer/components/imageFilters/RuntimeShader.tsx +23 -0
  400. package/src/renderer/components/imageFilters/index.ts +1 -0
  401. package/src/renderer/components/shaders/Gradient.ts +2 -4
  402. package/src/renderer/components/shaders/Shader.tsx +3 -3
  403. package/src/renderer/components/shapes/Path.tsx +11 -3
  404. package/src/renderer/processors/Circles.ts +2 -1
  405. package/src/renderer/processors/Font.ts +1 -1
  406. package/src/renderer/processors/Paint.ts +5 -0
  407. package/src/renderer/processors/Rects.ts +9 -14
  408. package/src/renderer/processors/math/Matrix3.ts +24 -105
  409. package/src/renderer/processors/math/Vector.ts +3 -2
  410. package/src/skia/Color.ts +13 -27
  411. package/src/skia/ImageFilter/ImageFilterFactory.ts +20 -0
  412. package/src/skia/Matrix.ts +8 -1
  413. package/src/skia/Paint/Paint.ts +7 -0
  414. package/src/skia/Paint/usePaint.ts +2 -4
  415. package/src/skia/RuntimeEffect/RuntimeEffect.ts +3 -1
  416. package/src/skia/RuntimeEffect/RuntimeEffectFactory.ts +2 -2
  417. package/src/skia/Shader/useShader.ts +4 -1
  418. package/src/skia/Skia.ts +4 -123
  419. package/src/skia/SkiaApi.ts +86 -0
  420. package/src/skia/Surface/Surface.ts +1 -1
  421. package/src/skia/Surface/SurfaceFactory.ts +2 -2
  422. package/src/values/api.ts +3 -42
  423. package/src/values/api.web.ts +5 -0
  424. package/src/values/index.ts +0 -1
  425. package/src/values/types.ts +30 -1
  426. package/src/values/web/RNSkAnimation.ts +33 -0
  427. package/src/values/web/RNSkClockValue.ts +58 -0
  428. package/src/values/web/RNSkDerivedValue.ts +38 -0
  429. package/src/values/web/RNSkReadonlyValue.ts +32 -0
  430. package/src/values/web/RNSkValue.ts +57 -0
  431. package/src/values/web/__tests__/RNSkAnimation.spec.ts +21 -0
  432. package/src/values/web/__tests__/RNSkDerivedValue.spec.ts +15 -0
  433. package/src/values/web/__tests__/RNSkReadonlyValue.spec.ts +8 -0
  434. package/src/values/web/__tests__/RNSkValue.spec.ts +11 -0
  435. package/src/values/web/api.ts +33 -0
  436. package/src/values/web/index.ts +1 -0
  437. package/src/views/SkiaView.tsx +3 -49
  438. package/src/views/api.ts +7 -0
  439. package/src/views/types.ts +40 -0
  440. package/lib/commonjs/values/animation/decay/runDecay.js.map +0 -1
  441. package/lib/commonjs/values/animation/functions/interpolate.js +0 -139
  442. package/lib/commonjs/values/animation/functions/interpolate.js.map +0 -1
  443. package/lib/commonjs/values/animation/functions/interpolateColors.js +0 -47
  444. package/lib/commonjs/values/animation/functions/interpolateColors.js.map +0 -1
  445. package/lib/commonjs/values/animation/spring/runSpring.js.map +0 -1
  446. package/lib/commonjs/values/animation/spring/useSpring.js.map +0 -1
  447. package/lib/commonjs/values/animation/timing/createTiming.js.map +0 -1
  448. package/lib/commonjs/values/animation/timing/functions/getResolvedParams.js.map +0 -1
  449. package/lib/commonjs/values/animation/timing/runTiming.js.map +0 -1
  450. package/lib/commonjs/values/animation/timing/useTiming.js.map +0 -1
  451. package/lib/module/values/animation/decay/runDecay.js.map +0 -1
  452. package/lib/module/values/animation/functions/interpolate.js +0 -132
  453. package/lib/module/values/animation/functions/interpolate.js.map +0 -1
  454. package/lib/module/values/animation/functions/interpolateColors.js +0 -32
  455. package/lib/module/values/animation/functions/interpolateColors.js.map +0 -1
  456. package/lib/module/values/animation/spring/runSpring.js.map +0 -1
  457. package/lib/module/values/animation/spring/useSpring.js.map +0 -1
  458. package/lib/module/values/animation/timing/createTiming.js.map +0 -1
  459. package/lib/module/values/animation/timing/functions/getResolvedParams.js.map +0 -1
  460. package/lib/module/values/animation/timing/runTiming.js.map +0 -1
  461. package/lib/module/values/animation/timing/useTiming.js.map +0 -1
  462. package/lib/typescript/scripts/install-npm.d.ts +0 -1
  463. package/lib/typescript/src/values/animation/functions/interpolate.d.ts +0 -7
  464. package/lib/typescript/src/values/animation/functions/interpolateColors.d.ts +0 -3
  465. package/src/values/animation/functions/interpolate.ts +0 -169
  466. package/src/values/animation/functions/interpolateColors.ts +0 -62
@@ -9,7 +9,10 @@ var _react = require("react");
9
9
 
10
10
  var _Skia = require("../Skia");
11
11
 
12
- const useShader = sksl => (0, _react.useMemo)(() => _Skia.Skia.RuntimeEffect.Make(sksl), [sksl]);
12
+ const useShader = sksl => (0, _react.useMemo)(() => {
13
+ console.warn("Use shader will be deprecated.");
14
+ return _Skia.Skia.RuntimeEffect.Make(sksl);
15
+ }, [sksl]);
13
16
 
14
17
  exports.useShader = useShader;
15
18
  //# sourceMappingURL=useShader.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useShader.ts"],"names":["useShader","sksl","Skia","RuntimeEffect","Make"],"mappings":";;;;;;;AAAA;;AAEA;;AAEO,MAAMA,SAAS,GAAIC,IAAD,IACvB,oBAAQ,MAAMC,WAAKC,aAAL,CAAmBC,IAAnB,CAAwBH,IAAxB,CAAd,EAA6C,CAACA,IAAD,CAA7C,CADK","sourcesContent":["import { useMemo } from \"react\";\n\nimport { Skia } from \"../Skia\";\n\nexport const useShader = (sksl: string) =>\n useMemo(() => Skia.RuntimeEffect.Make(sksl), [sksl]);\n"]}
1
+ {"version":3,"sources":["useShader.ts"],"names":["useShader","sksl","console","warn","Skia","RuntimeEffect","Make"],"mappings":";;;;;;;AAAA;;AAEA;;AAEO,MAAMA,SAAS,GAAIC,IAAD,IACvB,oBAAQ,MAAM;AACZC,EAAAA,OAAO,CAACC,IAAR,CAAa,gCAAb;AACA,SAAOC,WAAKC,aAAL,CAAmBC,IAAnB,CAAwBL,IAAxB,CAAP;AACD,CAHD,EAGG,CAACA,IAAD,CAHH,CADK","sourcesContent":["import { useMemo } from \"react\";\n\nimport { Skia } from \"../Skia\";\n\nexport const useShader = (sksl: string) =>\n useMemo(() => {\n console.warn(\"Use shader will be deprecated.\");\n return Skia.RuntimeEffect.Make(sksl);\n }, [sksl]);\n"]}
@@ -5,48 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Skia = void 0;
7
7
 
8
- var _reactNative = require("react-native");
9
-
10
8
  require("./NativeSetup");
11
9
 
12
- /*
13
- * Parse CSS colors
14
- */
15
- const SkiaColor = cl => {
16
- if (typeof cl === "number") {
17
- return cl;
18
- }
19
-
20
- const color = Skia.parseColorString(cl);
21
-
22
- if (color !== undefined) {
23
- return color;
24
- } else {
25
- // If the color is not recognized, we fallback to React Native
26
- let rnColor = (0, _reactNative.processColor)(cl); // 1. Neither Skia or RN could parse the color
27
-
28
- if (typeof rnColor !== "number") {
29
- throw new Error("Skia couldn't parse the following color " + cl); // 2. The color is recognized by RN but not by Skia
30
- } else {
31
- console.warn("Skia couldn't parse the following color " + cl + ". The color parsing was delegated to React Native. Please file on issue with that color."); // On android we need to move the alpha byte to the start of the structure
32
-
33
- if (_reactNative.Platform.OS === "android") {
34
- rnColor = rnColor >>> 0;
35
- const a = rnColor >> 24 & 0xff;
36
- const r = rnColor >> 16 & 0xff;
37
- const g = rnColor >> 8 & 0xff;
38
- const b = rnColor & 0xff;
39
- rnColor = (a << 24 | r << 16 | g << 8 | b) >>> 0;
40
- }
41
-
42
- return rnColor;
43
- }
44
- }
45
- };
46
- /**
47
- * Declares the interface for the native Skia API
48
- */
49
-
10
+ /*global SkiaApi*/
50
11
 
51
12
  /**
52
13
  * Declares the implemented API with overrides.
@@ -69,15 +30,14 @@ const Skia = {
69
30
  Point: SkiaApi.Point,
70
31
  XYWHRect: SkiaApi.XYWHRect,
71
32
  RRectXY: SkiaApi.RRectXY,
33
+ RuntimeShaderBuilder: SkiaApi.RuntimeShaderBuilder,
72
34
  Paint: SkiaApi.Paint,
73
35
  PictureRecorder: SkiaApi.PictureRecorder,
74
36
  Picture: SkiaApi.Picture,
75
37
  Path: SkiaApi.Path,
76
38
  ColorFilter: SkiaApi.ColorFilter,
77
39
  ContourMeasureIter: SkiaApi.ContourMeasureIter,
78
- // Here are constructors for data types which are represented as typed arrays in CanvasKit
79
- Color: SkiaColor,
80
- parseColorString: SkiaApi.parseColorString,
40
+ Color: SkiaApi.Color,
81
41
  RSXform: SkiaApi.RSXform,
82
42
  // For the following methods the factory symmetry is broken to be comptatible with CanvasKit
83
43
  MakeSurface: SkiaApi.Surface.Make,
@@ -1 +1 @@
1
- {"version":3,"sources":["Skia.ts"],"names":["SkiaColor","cl","color","Skia","parseColorString","undefined","rnColor","Error","console","warn","Platform","OS","a","r","g","b","Typeface","SkiaApi","MaskFilter","RuntimeEffect","Shader","ImageFilter","PathEffect","Data","SVG","FontMgr","TextBlob","Matrix","Font","Point","XYWHRect","RRectXY","Paint","PictureRecorder","Picture","Path","ColorFilter","ContourMeasureIter","Color","RSXform","MakeSurface","Surface","Make","MakeImageFromEncoded","Image","MakeImage","MakeVertices"],"mappings":";;;;;;;AAAA;;AAwBA;;AAOA;AACA;AACA;AACA,MAAMA,SAAS,GAAIC,EAAD,IAAe;AAC/B,MAAI,OAAOA,EAAP,KAAc,QAAlB,EAA4B;AAC1B,WAAOA,EAAP;AACD;;AACD,QAAMC,KAAK,GAAGC,IAAI,CAACC,gBAAL,CAAsBH,EAAtB,CAAd;;AACA,MAAIC,KAAK,KAAKG,SAAd,EAAyB;AACvB,WAAOH,KAAP;AACD,GAFD,MAEO;AACL;AACA,QAAII,OAAO,GAAG,+BAAaL,EAAb,CAAd,CAFK,CAGL;;AACA,QAAI,OAAOK,OAAP,KAAmB,QAAvB,EAAiC;AAC/B,YAAM,IAAIC,KAAJ,CAAU,6CAA6CN,EAAvD,CAAN,CAD+B,CAE/B;AACD,KAHD,MAGO;AACLO,MAAAA,OAAO,CAACC,IAAR,CACE,6CACER,EADF,GAEE,0FAHJ,EADK,CAML;;AACA,UAAIS,sBAASC,EAAT,KAAgB,SAApB,EAA+B;AAC7BL,QAAAA,OAAO,GAAGA,OAAO,KAAK,CAAtB;AACA,cAAMM,CAAC,GAAIN,OAAO,IAAI,EAAZ,GAAkB,IAA5B;AACA,cAAMO,CAAC,GAAIP,OAAO,IAAI,EAAZ,GAAkB,IAA5B;AACA,cAAMQ,CAAC,GAAIR,OAAO,IAAI,CAAZ,GAAiB,IAA3B;AACA,cAAMS,CAAC,GAAGT,OAAO,GAAG,IAApB;AACAA,QAAAA,OAAO,GAAG,CAAEM,CAAC,IAAI,EAAN,GAAaC,CAAC,IAAI,EAAlB,GAAyBC,CAAC,IAAI,CAA9B,GAAmCC,CAApC,MAA2C,CAArD;AACD;;AACD,aAAOT,OAAP;AACD;AACF;AACF,CAhCD;AAkCA;AACA;AACA;;;AA2DA;AACA;AACA;AACO,MAAMH,IAAI,GAAG;AAClB;AACAa,EAAAA,QAAQ,EAAEC,OAAO,CAACD,QAFA;AAGlBE,EAAAA,UAAU,EAAED,OAAO,CAACC,UAHF;AAIlBC,EAAAA,aAAa,EAAEF,OAAO,CAACE,aAJL;AAKlBC,EAAAA,MAAM,EAAEH,OAAO,CAACG,MALE;AAMlBC,EAAAA,WAAW,EAAEJ,OAAO,CAACI,WANH;AAOlBC,EAAAA,UAAU,EAAEL,OAAO,CAACK,UAPF;AAQlBC,EAAAA,IAAI,EAAEN,OAAO,CAACM,IARI;AASlBC,EAAAA,GAAG,EAAEP,OAAO,CAACO,GATK;AAUlBC,EAAAA,OAAO,EAAER,OAAO,CAACQ,OAVC;AAWlBC,EAAAA,QAAQ,EAAET,OAAO,CAACS,QAXA;AAYlB;AACAC,EAAAA,MAAM,EAAEV,OAAO,CAACU,MAbE;AAclBC,EAAAA,IAAI,EAAEX,OAAO,CAACW,IAdI;AAelBC,EAAAA,KAAK,EAAEZ,OAAO,CAACY,KAfG;AAgBlBC,EAAAA,QAAQ,EAAEb,OAAO,CAACa,QAhBA;AAiBlBC,EAAAA,OAAO,EAAEd,OAAO,CAACc,OAjBC;AAkBlBC,EAAAA,KAAK,EAAEf,OAAO,CAACe,KAlBG;AAmBlBC,EAAAA,eAAe,EAAEhB,OAAO,CAACgB,eAnBP;AAoBlBC,EAAAA,OAAO,EAAEjB,OAAO,CAACiB,OApBC;AAqBlBC,EAAAA,IAAI,EAAElB,OAAO,CAACkB,IArBI;AAsBlBC,EAAAA,WAAW,EAAEnB,OAAO,CAACmB,WAtBH;AAuBlBC,EAAAA,kBAAkB,EAAEpB,OAAO,CAACoB,kBAvBV;AAwBlB;AACAC,EAAAA,KAAK,EAAEtC,SAzBW;AA0BlBI,EAAAA,gBAAgB,EAAEa,OAAO,CAACb,gBA1BR;AA2BlBmC,EAAAA,OAAO,EAAEtB,OAAO,CAACsB,OA3BC;AA4BlB;AACAC,EAAAA,WAAW,EAAEvB,OAAO,CAACwB,OAAR,CAAgBC,IA7BX;AA8BlBC,EAAAA,oBAAoB,EAAE1B,OAAO,CAAC2B,KAAR,CAAcD,oBA9BlB;AA+BlBE,EAAAA,SAAS,EAAE5B,OAAO,CAAC2B,KAAR,CAAcC,SA/BP;AAgClBC,EAAAA,YAAY,EAAE7B,OAAO,CAAC6B;AAhCJ,CAAb","sourcesContent":["import { Platform, processColor } from \"react-native\";\n\n/*global SkiaApi*/\nimport type { ImageFilterFactory } from \"./ImageFilter\";\nimport type { PathFactory } from \"./Path\";\nimport type { ColorFilterFactory } from \"./ColorFilter\";\nimport type { SkFont } from \"./Font\";\nimport type { SkTypeface, TypefaceFactory } from \"./Typeface\";\nimport type { ImageFactory } from \"./Image\";\nimport type { MaskFilterFactory } from \"./MaskFilter\";\nimport type { SkPaint } from \"./Paint\";\nimport type { SkRect } from \"./Rect\";\nimport type { SkRRect } from \"./RRect\";\nimport type { RuntimeEffectFactory } from \"./RuntimeEffect\";\nimport type { ShaderFactory } from \"./Shader\";\nimport type { SkMatrix } from \"./Matrix\";\nimport type { PathEffectFactory } from \"./PathEffect\";\nimport type { SkPoint } from \"./Point\";\nimport type { SkVertices, VertexMode } from \"./Vertices/Vertices\";\nimport type { DataFactory } from \"./Data\";\nimport type { SVGFactory } from \"./SVG\";\nimport type { TextBlobFactory } from \"./TextBlob\";\nimport type { FontMgrFactory } from \"./FontMgr/FontMgrFactory\";\nimport type { SurfaceFactory } from \"./Surface\";\nimport \"./NativeSetup\";\nimport type { SkRSXform } from \"./RSXform\";\nimport type { SkPath } from \"./Path/Path\";\nimport type { SkContourMeasureIter } from \"./ContourMeasure\";\nimport type { PictureFactory, SkPictureRecorder } from \"./Picture\";\nimport type { Color, SkColor } from \"./Color\";\n\n/*\n * Parse CSS colors\n */\nconst SkiaColor = (cl: Color) => {\n if (typeof cl === \"number\") {\n return cl;\n }\n const color = Skia.parseColorString(cl);\n if (color !== undefined) {\n return color;\n } else {\n // If the color is not recognized, we fallback to React Native\n let rnColor = processColor(cl);\n // 1. Neither Skia or RN could parse the color\n if (typeof rnColor !== \"number\") {\n throw new Error(\"Skia couldn't parse the following color \" + cl);\n // 2. The color is recognized by RN but not by Skia\n } else {\n console.warn(\n \"Skia couldn't parse the following color \" +\n cl +\n \". The color parsing was delegated to React Native. Please file on issue with that color.\"\n );\n // On android we need to move the alpha byte to the start of the structure\n if (Platform.OS === \"android\") {\n rnColor = rnColor >>> 0;\n const a = (rnColor >> 24) & 0xff;\n const r = (rnColor >> 16) & 0xff;\n const g = (rnColor >> 8) & 0xff;\n const b = rnColor & 0xff;\n rnColor = ((a << 24) | (r << 16) | (g << 8) | b) >>> 0;\n }\n return rnColor;\n }\n }\n};\n\n/**\n * Declares the interface for the native Skia API\n */\nexport interface Skia {\n Point: (x: number, y: number) => SkPoint;\n XYWHRect: (x: number, y: number, width: number, height: number) => SkRect;\n RRectXY: (rect: SkRect, rx: number, ry: number) => SkRRect;\n RSXform: (scos: number, ssin: number, tx: number, ty: number) => SkRSXform;\n Color: (color: Color) => SkColor;\n parseColorString: (color: string) => SkColor | undefined;\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ) => SkContourMeasureIter;\n Paint: () => SkPaint;\n PictureRecorder: () => SkPictureRecorder;\n Picture: PictureFactory;\n Path: PathFactory;\n Matrix: () => SkMatrix;\n ColorFilter: ColorFilterFactory;\n Font: (typeface?: SkTypeface, size?: number) => SkFont;\n Typeface: TypefaceFactory;\n MaskFilter: MaskFilterFactory;\n RuntimeEffect: RuntimeEffectFactory;\n ImageFilter: ImageFilterFactory;\n Shader: ShaderFactory;\n PathEffect: PathEffectFactory;\n /**\n * Returns an Vertices based on the given positions and optional parameters.\n * See SkVertices.h (especially the Builder) for more details.\n * @param mode\n * @param positions\n * @param textureCoordinates\n * @param colors - either a list of int colors or a flattened color array.\n * @param indices\n * @param isVolatile\n */\n MakeVertices(\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n ): SkVertices;\n Data: DataFactory;\n Image: ImageFactory;\n SVG: SVGFactory;\n FontMgr: FontMgrFactory;\n TextBlob: TextBlobFactory;\n Surface: SurfaceFactory;\n}\n\n/**\n * Declares the SkiaApi as an available object in the global scope\n */\ndeclare global {\n var SkiaApi: Skia;\n}\n\n/**\n * Declares the implemented API with overrides.\n */\nexport const Skia = {\n // Factories\n Typeface: SkiaApi.Typeface,\n MaskFilter: SkiaApi.MaskFilter,\n RuntimeEffect: SkiaApi.RuntimeEffect,\n Shader: SkiaApi.Shader,\n ImageFilter: SkiaApi.ImageFilter,\n PathEffect: SkiaApi.PathEffect,\n Data: SkiaApi.Data,\n SVG: SkiaApi.SVG,\n FontMgr: SkiaApi.FontMgr,\n TextBlob: SkiaApi.TextBlob,\n // Constructors\n Matrix: SkiaApi.Matrix,\n Font: SkiaApi.Font,\n Point: SkiaApi.Point,\n XYWHRect: SkiaApi.XYWHRect,\n RRectXY: SkiaApi.RRectXY,\n Paint: SkiaApi.Paint,\n PictureRecorder: SkiaApi.PictureRecorder,\n Picture: SkiaApi.Picture,\n Path: SkiaApi.Path,\n ColorFilter: SkiaApi.ColorFilter,\n ContourMeasureIter: SkiaApi.ContourMeasureIter,\n // Here are constructors for data types which are represented as typed arrays in CanvasKit\n Color: SkiaColor,\n parseColorString: SkiaApi.parseColorString,\n RSXform: SkiaApi.RSXform,\n // For the following methods the factory symmetry is broken to be comptatible with CanvasKit\n MakeSurface: SkiaApi.Surface.Make,\n MakeImageFromEncoded: SkiaApi.Image.MakeImageFromEncoded,\n MakeImage: SkiaApi.Image.MakeImage,\n MakeVertices: SkiaApi.MakeVertices,\n};\n"]}
1
+ {"version":3,"sources":["Skia.ts"],"names":["Skia","Typeface","SkiaApi","MaskFilter","RuntimeEffect","Shader","ImageFilter","PathEffect","Data","SVG","FontMgr","TextBlob","Matrix","Font","Point","XYWHRect","RRectXY","RuntimeShaderBuilder","Paint","PictureRecorder","Picture","Path","ColorFilter","ContourMeasureIter","Color","RSXform","MakeSurface","Surface","Make","MakeImageFromEncoded","Image","MakeImage","MakeVertices"],"mappings":";;;;;;;AACA;;AADA;;AAWA;AACA;AACA;AACO,MAAMA,IAAI,GAAG;AAClB;AACAC,EAAAA,QAAQ,EAAEC,OAAO,CAACD,QAFA;AAGlBE,EAAAA,UAAU,EAAED,OAAO,CAACC,UAHF;AAIlBC,EAAAA,aAAa,EAAEF,OAAO,CAACE,aAJL;AAKlBC,EAAAA,MAAM,EAAEH,OAAO,CAACG,MALE;AAMlBC,EAAAA,WAAW,EAAEJ,OAAO,CAACI,WANH;AAOlBC,EAAAA,UAAU,EAAEL,OAAO,CAACK,UAPF;AAQlBC,EAAAA,IAAI,EAAEN,OAAO,CAACM,IARI;AASlBC,EAAAA,GAAG,EAAEP,OAAO,CAACO,GATK;AAUlBC,EAAAA,OAAO,EAAER,OAAO,CAACQ,OAVC;AAWlBC,EAAAA,QAAQ,EAAET,OAAO,CAACS,QAXA;AAYlB;AACAC,EAAAA,MAAM,EAAEV,OAAO,CAACU,MAbE;AAclBC,EAAAA,IAAI,EAAEX,OAAO,CAACW,IAdI;AAelBC,EAAAA,KAAK,EAAEZ,OAAO,CAACY,KAfG;AAgBlBC,EAAAA,QAAQ,EAAEb,OAAO,CAACa,QAhBA;AAiBlBC,EAAAA,OAAO,EAAEd,OAAO,CAACc,OAjBC;AAkBlBC,EAAAA,oBAAoB,EAAEf,OAAO,CAACe,oBAlBZ;AAmBlBC,EAAAA,KAAK,EAAEhB,OAAO,CAACgB,KAnBG;AAoBlBC,EAAAA,eAAe,EAAEjB,OAAO,CAACiB,eApBP;AAqBlBC,EAAAA,OAAO,EAAElB,OAAO,CAACkB,OArBC;AAsBlBC,EAAAA,IAAI,EAAEnB,OAAO,CAACmB,IAtBI;AAuBlBC,EAAAA,WAAW,EAAEpB,OAAO,CAACoB,WAvBH;AAwBlBC,EAAAA,kBAAkB,EAAErB,OAAO,CAACqB,kBAxBV;AAyBlBC,EAAAA,KAAK,EAAEtB,OAAO,CAACsB,KAzBG;AA0BlBC,EAAAA,OAAO,EAAEvB,OAAO,CAACuB,OA1BC;AA2BlB;AACAC,EAAAA,WAAW,EAAExB,OAAO,CAACyB,OAAR,CAAgBC,IA5BX;AA6BlBC,EAAAA,oBAAoB,EAAE3B,OAAO,CAAC4B,KAAR,CAAcD,oBA7BlB;AA8BlBE,EAAAA,SAAS,EAAE7B,OAAO,CAAC4B,KAAR,CAAcC,SA9BP;AA+BlBC,EAAAA,YAAY,EAAE9B,OAAO,CAAC8B;AA/BJ,CAAb","sourcesContent":["/*global SkiaApi*/\nimport \"./NativeSetup\";\nimport type { SkiaApi as SkSkiaApi } from \"./SkiaApi\";\n\n/**\n * Declares the SkiaApi as an available object in the global scope\n */\ndeclare global {\n var SkiaApi: SkSkiaApi;\n}\n\n/**\n * Declares the implemented API with overrides.\n */\nexport const Skia = {\n // Factories\n Typeface: SkiaApi.Typeface,\n MaskFilter: SkiaApi.MaskFilter,\n RuntimeEffect: SkiaApi.RuntimeEffect,\n Shader: SkiaApi.Shader,\n ImageFilter: SkiaApi.ImageFilter,\n PathEffect: SkiaApi.PathEffect,\n Data: SkiaApi.Data,\n SVG: SkiaApi.SVG,\n FontMgr: SkiaApi.FontMgr,\n TextBlob: SkiaApi.TextBlob,\n // Constructors\n Matrix: SkiaApi.Matrix,\n Font: SkiaApi.Font,\n Point: SkiaApi.Point,\n XYWHRect: SkiaApi.XYWHRect,\n RRectXY: SkiaApi.RRectXY,\n RuntimeShaderBuilder: SkiaApi.RuntimeShaderBuilder,\n Paint: SkiaApi.Paint,\n PictureRecorder: SkiaApi.PictureRecorder,\n Picture: SkiaApi.Picture,\n Path: SkiaApi.Path,\n ColorFilter: SkiaApi.ColorFilter,\n ContourMeasureIter: SkiaApi.ContourMeasureIter,\n Color: SkiaApi.Color,\n RSXform: SkiaApi.RSXform,\n // For the following methods the factory symmetry is broken to be comptatible with CanvasKit\n MakeSurface: SkiaApi.Surface.Make,\n MakeImageFromEncoded: SkiaApi.Image.MakeImageFromEncoded,\n MakeImage: SkiaApi.Image.MakeImage,\n MakeVertices: SkiaApi.MakeVertices,\n};\n"]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ require("./NativeSetup");
4
+ //# sourceMappingURL=SkiaApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["SkiaApi.ts"],"names":[],"mappings":";;AAqBA","sourcesContent":["import type { ImageFilterFactory } from \"./ImageFilter\";\nimport type { PathFactory } from \"./Path\";\nimport type { ColorFilterFactory } from \"./ColorFilter\";\nimport type { SkFont } from \"./Font\";\nimport type { SkTypeface, TypefaceFactory } from \"./Typeface\";\nimport type { ImageFactory } from \"./Image\";\nimport type { MaskFilterFactory } from \"./MaskFilter\";\nimport type { SkPaint } from \"./Paint\";\nimport type { SkRect } from \"./Rect\";\nimport type { SkRRect } from \"./RRect\";\nimport type { RuntimeEffectFactory } from \"./RuntimeEffect\";\nimport type { ShaderFactory } from \"./Shader\";\nimport type { SkMatrix } from \"./Matrix\";\nimport type { PathEffectFactory } from \"./PathEffect\";\nimport type { SkPoint } from \"./Point\";\nimport type { SkVertices, VertexMode } from \"./Vertices/Vertices\";\nimport type { DataFactory } from \"./Data\";\nimport type { SVGFactory } from \"./SVG\";\nimport type { TextBlobFactory } from \"./TextBlob\";\nimport type { FontMgrFactory } from \"./FontMgr/FontMgrFactory\";\nimport type { SurfaceFactory } from \"./Surface\";\nimport \"./NativeSetup\";\nimport type { SkRSXform } from \"./RSXform\";\nimport type { SkPath } from \"./Path/Path\";\nimport type { SkContourMeasureIter } from \"./ContourMeasure\";\nimport type { PictureFactory, SkPictureRecorder } from \"./Picture\";\nimport type { Color, SkColor } from \"./Color\";\nimport type {\n SkRuntimeShaderBuilder,\n SkRuntimeEffect,\n} from \"./RuntimeEffect/RuntimeEffect\";\n\n/**\n * Declares the interface for the native Skia API\n */\nexport interface SkiaApi {\n Point: (x: number, y: number) => SkPoint;\n XYWHRect: (x: number, y: number, width: number, height: number) => SkRect;\n RuntimeShaderBuilder: (rt: SkRuntimeEffect) => SkRuntimeShaderBuilder;\n RRectXY: (rect: SkRect, rx: number, ry: number) => SkRRect;\n RSXform: (scos: number, ssin: number, tx: number, ty: number) => SkRSXform;\n Color: (color: Color) => SkColor;\n parseColorString: (color: string) => SkColor | undefined;\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ) => SkContourMeasureIter;\n Paint: () => SkPaint;\n PictureRecorder: () => SkPictureRecorder;\n Picture: PictureFactory;\n Path: PathFactory;\n Matrix: () => SkMatrix;\n ColorFilter: ColorFilterFactory;\n Font: (typeface?: SkTypeface, size?: number) => SkFont;\n Typeface: TypefaceFactory;\n MaskFilter: MaskFilterFactory;\n RuntimeEffect: RuntimeEffectFactory;\n ImageFilter: ImageFilterFactory;\n Shader: ShaderFactory;\n PathEffect: PathEffectFactory;\n /**\n * Returns an Vertices based on the given positions and optional parameters.\n * See SkVertices.h (especially the Builder) for more details.\n * @param mode\n * @param positions\n * @param textureCoordinates\n * @param colors - either a list of int colors or a flattened color array.\n * @param indices\n * @param isVolatile\n */\n MakeVertices(\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n ): SkVertices;\n Data: DataFactory;\n Image: ImageFactory;\n SVG: SVGFactory;\n FontMgr: FontMgrFactory;\n TextBlob: TextBlobFactory;\n Surface: SurfaceFactory;\n}\n"]}
@@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createValue = exports.createDerivedValue = exports.ValueApi = void 0;
7
- const ValueApi = {
8
- createValue: global.SkiaValueApi.createValue,
9
- createDerivedValue: global.SkiaValueApi.createDerivedValue,
10
- createClockValue: global.SkiaValueApi.createClockValue,
11
- createAnimation: global.SkiaValueApi.createAnimation
12
- };
7
+ const {
8
+ SkiaValueApi
9
+ } = global;
10
+ const ValueApi = SkiaValueApi;
13
11
  exports.ValueApi = ValueApi;
14
12
  const {
15
13
  createValue,
@@ -1 +1 @@
1
- {"version":3,"sources":["api.ts"],"names":["ValueApi","createValue","global","SkiaValueApi","createDerivedValue","createClockValue","createAnimation"],"mappings":";;;;;;AAyCO,MAAMA,QAAuB,GAAG;AACrCC,EAAAA,WAAW,EAAEC,MAAM,CAACC,YAAP,CAAoBF,WADI;AAErCG,EAAAA,kBAAkB,EAAEF,MAAM,CAACC,YAAP,CAAoBC,kBAFH;AAGrCC,EAAAA,gBAAgB,EAAEH,MAAM,CAACC,YAAP,CAAoBE,gBAHD;AAIrCC,EAAAA,eAAe,EAAEJ,MAAM,CAACC,YAAP,CAAoBG;AAJA,CAAhC;;AAOA,MAAM;AAAEL,EAAAA,WAAF;AAAeG,EAAAA;AAAf,IAAsCJ,QAA5C","sourcesContent":["import type {\n SkiaAnimation,\n AnimationState,\n SkiaReadonlyValue,\n SkiaClockValue,\n SkiaValue,\n} from \"./types\";\n\nexport interface ISkiaValueApi {\n /**\n * Creates a new value that holds the initial value and that\n * can be changed.\n */\n createValue: <T>(initialValue: T) => SkiaValue<T>;\n /**\n * Creates a derived value. This is a calculated value that returns the result of\n * a function that is called with the values of the dependencies.\n */\n createDerivedValue: <R>(\n cb: () => R,\n values: Array<SkiaReadonlyValue<unknown>>\n ) => SkiaReadonlyValue<R>;\n /**\n * Creates a clock value where the value is the number of milliseconds elapsed\n * since the clock was created\n */\n createClockValue: () => SkiaClockValue;\n /**\n * Creates an animation that is driven from a clock and updated every frame.\n * @param cb Callback to calculate next value from time.\n * @returns An animation object that can control a value.\n */\n createAnimation: <S extends AnimationState = AnimationState>(\n cb: (t: number, state: S | undefined) => S\n ) => SkiaAnimation;\n}\n\ndeclare global {\n var SkiaValueApi: ISkiaValueApi;\n}\n\nexport const ValueApi: ISkiaValueApi = {\n createValue: global.SkiaValueApi.createValue,\n createDerivedValue: global.SkiaValueApi.createDerivedValue,\n createClockValue: global.SkiaValueApi.createClockValue,\n createAnimation: global.SkiaValueApi.createAnimation,\n};\n\nexport const { createValue, createDerivedValue } = ValueApi;\n"]}
1
+ {"version":3,"sources":["api.ts"],"names":["SkiaValueApi","global","ValueApi","createValue","createDerivedValue"],"mappings":";;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAmBC,MAAzB;AACO,MAAMC,QAAQ,GAAGF,YAAjB;;AAEA,MAAM;AAAEG,EAAAA,WAAF;AAAeC,EAAAA;AAAf,IAAsCF,QAA5C","sourcesContent":["import type { ISkiaValueApi } from \"./types\";\n\ndeclare global {\n var SkiaValueApi: ISkiaValueApi;\n}\n\nconst { SkiaValueApi } = global;\nexport const ValueApi = SkiaValueApi;\n\nexport const { createValue, createDerivedValue } = ValueApi;\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createValue = exports.createDerivedValue = exports.ValueApi = void 0;
7
+
8
+ var _web = require("./web");
9
+
10
+ const ValueApi = _web.ValueApi;
11
+ exports.ValueApi = ValueApi;
12
+ const {
13
+ createValue,
14
+ createDerivedValue
15
+ } = ValueApi;
16
+ exports.createDerivedValue = createDerivedValue;
17
+ exports.createValue = createValue;
18
+ //# sourceMappingURL=api.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["api.web.ts"],"names":["ValueApi","ValueApiWeb","createValue","createDerivedValue"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,QAAQ,GAAGC,aAAjB;;AAEA,MAAM;AAAEC,EAAAA,WAAF;AAAeC,EAAAA;AAAf,IAAsCH,QAA5C","sourcesContent":["import { ValueApi as ValueApiWeb } from \"./web\";\n\nexport const ValueApi = ValueApiWeb;\n\nexport const { createValue, createDerivedValue } = ValueApi;\n"]}
@@ -30,19 +30,6 @@ Object.keys(_hooks).forEach(function (key) {
30
30
  });
31
31
  });
32
32
 
33
- var _animation = require("./animation");
34
-
35
- Object.keys(_animation).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (key in exports && exports[key] === _animation[key]) return;
38
- Object.defineProperty(exports, key, {
39
- enumerable: true,
40
- get: function () {
41
- return _animation[key];
42
- }
43
- });
44
- });
45
-
46
33
  var _api = require("./api");
47
34
 
48
35
  Object.keys(_api).forEach(function (key) {
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./types\";\nexport * from \"./hooks\";\nexport * from \"./animation\";\nexport * from \"./api\";\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./types\";\nexport * from \"./hooks\";\nexport * from \"./api\";\n"]}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RNSkAnimation = void 0;
7
+
8
+ var _RNSkClockValue = require("./RNSkClockValue");
9
+
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+
12
+ class RNSkAnimation extends _RNSkClockValue.RNSkClockValue {
13
+ constructor(callback, raf) {
14
+ super(raf);
15
+
16
+ _defineProperty(this, "_callback", void 0);
17
+
18
+ _defineProperty(this, "_animationState", undefined);
19
+
20
+ this._callback = callback;
21
+ }
22
+
23
+ cancel() {
24
+ this.stop();
25
+ }
26
+
27
+ update(nextValue) {
28
+ var _this$_animationState2, _this$_animationState3;
29
+
30
+ if (this._callback) {
31
+ var _this$_animationState;
32
+
33
+ this._animationState = this._callback(nextValue, this._animationState);
34
+
35
+ if ((_this$_animationState = this._animationState) !== null && _this$_animationState !== void 0 && _this$_animationState.finished) {
36
+ this.stop();
37
+ }
38
+ }
39
+
40
+ super.update((_this$_animationState2 = (_this$_animationState3 = this._animationState) === null || _this$_animationState3 === void 0 ? void 0 : _this$_animationState3.current) !== null && _this$_animationState2 !== void 0 ? _this$_animationState2 : nextValue);
41
+ }
42
+
43
+ }
44
+
45
+ exports.RNSkAnimation = RNSkAnimation;
46
+ //# sourceMappingURL=RNSkAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["RNSkAnimation.ts"],"names":["RNSkAnimation","RNSkClockValue","constructor","callback","raf","undefined","_callback","cancel","stop","update","nextValue","_animationState","finished","current"],"mappings":";;;;;;;AAEA;;;;AAEO,MAAMA,aAAN,SACGC,8BADH,CAGP;AACEC,EAAAA,WAAW,CACTC,QADS,EAETC,GAFS,EAGT;AACA,UAAMA,GAAN;;AADA;;AAAA,6CAMuCC,SANvC;;AAEA,SAAKC,SAAL,GAAiBH,QAAjB;AACD;;AAKMI,EAAAA,MAAM,GAAG;AACd,SAAKC,IAAL;AACD;;AAESC,EAAAA,MAAM,CAACC,SAAD,EAA0B;AAAA;;AACxC,QAAI,KAAKJ,SAAT,EAAoB;AAAA;;AAClB,WAAKK,eAAL,GAAuB,KAAKL,SAAL,CAAeI,SAAf,EAA0B,KAAKC,eAA/B,CAAvB;;AACA,mCAAI,KAAKA,eAAT,kDAAI,sBAAsBC,QAA1B,EAAoC;AAClC,aAAKJ,IAAL;AACD;AACF;;AACD,UAAMC,MAAN,qDAAa,KAAKE,eAAlB,2DAAa,uBAAsBE,OAAnC,2EAA8CH,SAA9C;AACD;;AAxBH","sourcesContent":["import type { AnimationState, SkiaAnimation } from \"../types\";\n\nimport { RNSkClockValue } from \"./RNSkClockValue\";\n\nexport class RNSkAnimation<S extends AnimationState = AnimationState>\n extends RNSkClockValue\n implements SkiaAnimation\n{\n constructor(\n callback: (t: number, state: S | undefined) => S,\n raf: (callback: (time: number) => void) => number\n ) {\n super(raf);\n this._callback = callback;\n }\n\n private _callback: (t: number, state: S | undefined) => S;\n private _animationState: S | undefined = undefined;\n\n public cancel() {\n this.stop();\n }\n\n protected update(nextValue: number): void {\n if (this._callback) {\n this._animationState = this._callback(nextValue, this._animationState);\n if (this._animationState?.finished) {\n this.stop();\n }\n }\n super.update(this._animationState?.current ?? nextValue);\n }\n}\n"]}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RNSkClockValue = void 0;
7
+
8
+ var _RNSkReadonlyValue = require("./RNSkReadonlyValue");
9
+
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+
12
+ var RNSkClockState;
13
+
14
+ (function (RNSkClockState) {
15
+ RNSkClockState[RNSkClockState["NotStarted"] = 0] = "NotStarted";
16
+ RNSkClockState[RNSkClockState["Running"] = 1] = "Running";
17
+ RNSkClockState[RNSkClockState["Stopped"] = 2] = "Stopped";
18
+ })(RNSkClockState || (RNSkClockState = {}));
19
+
20
+ class RNSkClockValue extends _RNSkReadonlyValue.RNSkReadonlyValue {
21
+ constructor(raf) {
22
+ super(0);
23
+
24
+ _defineProperty(this, "_raf", void 0);
25
+
26
+ _defineProperty(this, "_start", void 0);
27
+
28
+ _defineProperty(this, "_stop", void 0);
29
+
30
+ _defineProperty(this, "_state", RNSkClockState.NotStarted);
31
+
32
+ _defineProperty(this, "notifyUpdate", _ => {
33
+ if (this._state === RNSkClockState.Running) {
34
+ const now = Date.now();
35
+ const deltaFromStart = now - this._start;
36
+ this.tick(deltaFromStart);
37
+
38
+ this._raf(this.notifyUpdate);
39
+ }
40
+ });
41
+
42
+ this._raf = raf;
43
+ this.update(0);
44
+ }
45
+
46
+ tick(value) {
47
+ this.update(value);
48
+ }
49
+
50
+ start() {
51
+ if (this._state === RNSkClockState.NotStarted) {
52
+ this._start = Date.now();
53
+ this._stop = this._start;
54
+ } // Subtract pause time from start
55
+
56
+
57
+ const timeSinceStop = Date.now() - this._stop;
58
+
59
+ this._start += timeSinceStop;
60
+ this._state = RNSkClockState.Running;
61
+
62
+ this._raf(this.notifyUpdate);
63
+ }
64
+
65
+ stop() {
66
+ if (this._state === RNSkClockState.Running) {
67
+ this._state = RNSkClockState.Stopped;
68
+ this._stop = Date.now();
69
+ }
70
+ }
71
+
72
+ }
73
+
74
+ exports.RNSkClockValue = RNSkClockValue;
75
+ //# sourceMappingURL=RNSkClockValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["RNSkClockValue.ts"],"names":["RNSkClockState","RNSkClockValue","RNSkReadonlyValue","constructor","raf","NotStarted","_","_state","Running","now","Date","deltaFromStart","_start","tick","_raf","notifyUpdate","update","value","start","_stop","timeSinceStop","stop","Stopped"],"mappings":";;;;;;;AAEA;;;;IAEKA,c;;WAAAA,c;AAAAA,EAAAA,c,CAAAA,c;AAAAA,EAAAA,c,CAAAA,c;AAAAA,EAAAA,c,CAAAA,c;GAAAA,c,KAAAA,c;;AAME,MAAMC,cAAN,SACGC,oCADH,CAGP;AACEC,EAAAA,WAAW,CAACC,GAAD,EAAoD;AAC7D,UAAM,CAAN;;AAD6D;;AAAA;;AAAA;;AAAA,oCAS9BJ,cAAc,CAACK,UATe;;AAAA,0CAWvCC,CAAD,IAAe;AACpC,UAAI,KAAKC,MAAL,KAAgBP,cAAc,CAACQ,OAAnC,EAA4C;AAC1C,cAAMC,GAAG,GAAGC,IAAI,CAACD,GAAL,EAAZ;AACA,cAAME,cAAc,GAAGF,GAAG,GAAG,KAAKG,MAAlC;AACA,aAAKC,IAAL,CAAUF,cAAV;;AACA,aAAKG,IAAL,CAAU,KAAKC,YAAf;AACD;AACF,KAlB8D;;AAE7D,SAAKD,IAAL,GAAYV,GAAZ;AACA,SAAKY,MAAL,CAAY,CAAZ;AACD;;AAgBSH,EAAAA,IAAI,CAACI,KAAD,EAAgB;AAC5B,SAAKD,MAAL,CAAYC,KAAZ;AACD;;AAEMC,EAAAA,KAAK,GAAG;AACb,QAAI,KAAKX,MAAL,KAAgBP,cAAc,CAACK,UAAnC,EAA+C;AAC7C,WAAKO,MAAL,GAAcF,IAAI,CAACD,GAAL,EAAd;AACA,WAAKU,KAAL,GAAa,KAAKP,MAAlB;AACD,KAJY,CAKb;;;AACA,UAAMQ,aAAa,GAAGV,IAAI,CAACD,GAAL,KAAa,KAAKU,KAAxC;;AACA,SAAKP,MAAL,IAAgBQ,aAAhB;AAEA,SAAKb,MAAL,GAAcP,cAAc,CAACQ,OAA7B;;AACA,SAAKM,IAAL,CAAU,KAAKC,YAAf;AACD;;AAEMM,EAAAA,IAAI,GAAG;AACZ,QAAI,KAAKd,MAAL,KAAgBP,cAAc,CAACQ,OAAnC,EAA4C;AAC1C,WAAKD,MAAL,GAAcP,cAAc,CAACsB,OAA7B;AACA,WAAKH,KAAL,GAAaT,IAAI,CAACD,GAAL,EAAb;AACD;AACF;;AA3CH","sourcesContent":["import type { SkiaClockValue } from \"../types\";\n\nimport { RNSkReadonlyValue } from \"./RNSkReadonlyValue\";\n\nenum RNSkClockState {\n NotStarted = 0,\n Running = 1,\n Stopped = 2,\n}\n\nexport class RNSkClockValue\n extends RNSkReadonlyValue<number>\n implements SkiaClockValue\n{\n constructor(raf: (callback: (time: number) => void) => number) {\n super(0);\n this._raf = raf;\n this.update(0);\n }\n\n private _raf: (callback: (time: number) => void) => number;\n private _start: number | undefined;\n private _stop: number | undefined;\n private _state: RNSkClockState = RNSkClockState.NotStarted;\n\n private notifyUpdate = (_: number) => {\n if (this._state === RNSkClockState.Running) {\n const now = Date.now();\n const deltaFromStart = now - this._start!;\n this.tick(deltaFromStart);\n this._raf(this.notifyUpdate);\n }\n };\n\n protected tick(value: number) {\n this.update(value);\n }\n\n public start() {\n if (this._state === RNSkClockState.NotStarted) {\n this._start = Date.now();\n this._stop = this._start;\n }\n // Subtract pause time from start\n const timeSinceStop = Date.now() - this._stop!;\n this._start! += timeSinceStop;\n\n this._state = RNSkClockState.Running;\n this._raf(this.notifyUpdate);\n }\n\n public stop() {\n if (this._state === RNSkClockState.Running) {\n this._state = RNSkClockState.Stopped;\n this._stop = Date.now();\n }\n }\n}\n"]}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RNSkDerivedValue = void 0;
7
+
8
+ var _RNSkReadonlyValue = require("./RNSkReadonlyValue");
9
+
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+
12
+ class RNSkDerivedValue extends _RNSkReadonlyValue.RNSkReadonlyValue {
13
+ constructor(callback, dependencies) {
14
+ // Initialize dependencies - we can't call this yet, since
15
+ // super if not called and it requires a start value to be set.
16
+ const unsubscribers = [];
17
+ const notifyUpdateRef = {
18
+ current: undefined
19
+ };
20
+ dependencies.forEach(dep => {
21
+ if ("__typename__" in dep && "addListener" in dep) {
22
+ unsubscribers.push(dep.addListener(() => {
23
+ var _notifyUpdateRef$curr;
24
+
25
+ return (_notifyUpdateRef$curr = notifyUpdateRef.current) === null || _notifyUpdateRef$curr === void 0 ? void 0 : _notifyUpdateRef$curr.call(notifyUpdateRef);
26
+ }));
27
+ }
28
+ });
29
+ super(callback());
30
+
31
+ _defineProperty(this, "_callback", void 0);
32
+
33
+ _defineProperty(this, "_unsubscribers", void 0);
34
+
35
+ this._unsubscribers = unsubscribers;
36
+ notifyUpdateRef.current = this.dependecyUpdated.bind(this);
37
+ this._callback = callback;
38
+ }
39
+
40
+ dependecyUpdated() {
41
+ this.update(this._callback());
42
+ }
43
+
44
+ unsubscribe() {
45
+ this._unsubscribers.forEach(unsubscribe => unsubscribe());
46
+ }
47
+
48
+ }
49
+
50
+ exports.RNSkDerivedValue = RNSkDerivedValue;
51
+ //# sourceMappingURL=RNSkDerivedValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["RNSkDerivedValue.ts"],"names":["RNSkDerivedValue","RNSkReadonlyValue","constructor","callback","dependencies","unsubscribers","notifyUpdateRef","current","undefined","forEach","dep","push","addListener","_unsubscribers","dependecyUpdated","bind","_callback","update","unsubscribe"],"mappings":";;;;;;;AAEA;;;;AAEO,MAAMA,gBAAN,SAAkCC,oCAAlC,CAAuD;AAC5DC,EAAAA,WAAW,CAACC,QAAD,EAAoBC,YAApB,EAAkD;AAC3D;AACA;AACA,UAAMC,aAAgC,GAAG,EAAzC;AACA,UAAMC,eAAsD,GAAG;AAC7DC,MAAAA,OAAO,EAAEC;AADoD,KAA/D;AAGAJ,IAAAA,YAAY,CAACK,OAAb,CAAsBC,GAAD,IAAS;AAC5B,UAAI,kBAAkBA,GAAlB,IAAyB,iBAAiBA,GAA9C,EAAmD;AACjDL,QAAAA,aAAa,CAACM,IAAd,CACGD,GAAD,CAAoCE,WAApC,CAAgD;AAAA;;AAAA,0CAC9CN,eAAe,CAACC,OAD8B,0DAC9C,2BAAAD,eAAe,CAD+B;AAAA,SAAhD,CADF;AAKD;AACF,KARD;AASA,UAAMH,QAAQ,EAAd;;AAhB2D;;AAAA;;AAiB3D,SAAKU,cAAL,GAAsBR,aAAtB;AACAC,IAAAA,eAAe,CAACC,OAAhB,GAA0B,KAAKO,gBAAL,CAAsBC,IAAtB,CAA2B,IAA3B,CAA1B;AACA,SAAKC,SAAL,GAAiBb,QAAjB;AACD;;AAEOW,EAAAA,gBAAgB,GAAG;AACzB,SAAKG,MAAL,CAAY,KAAKD,SAAL,EAAZ;AACD;;AAKME,EAAAA,WAAW,GAAG;AACnB,SAAKL,cAAL,CAAoBJ,OAApB,CAA6BS,WAAD,IAAiBA,WAAW,EAAxD;AACD;;AAhC2D","sourcesContent":["import type { DependencyList } from \"react\";\n\nimport { RNSkReadonlyValue } from \"./RNSkReadonlyValue\";\n\nexport class RNSkDerivedValue<T> extends RNSkReadonlyValue<T> {\n constructor(callback: () => T, dependencies: DependencyList) {\n // Initialize dependencies - we can't call this yet, since\n // super if not called and it requires a start value to be set.\n const unsubscribers: Array<() => void> = [];\n const notifyUpdateRef: { current: (() => void) | undefined } = {\n current: undefined,\n };\n dependencies.forEach((dep) => {\n if (\"__typename__\" in dep && \"addListener\" in dep) {\n unsubscribers.push(\n (dep as RNSkReadonlyValue<unknown>).addListener(() =>\n notifyUpdateRef.current?.()\n )\n );\n }\n });\n super(callback());\n this._unsubscribers = unsubscribers;\n notifyUpdateRef.current = this.dependecyUpdated.bind(this);\n this._callback = callback;\n }\n\n private dependecyUpdated() {\n this.update(this._callback());\n }\n\n private _callback: () => T;\n private _unsubscribers: Array<() => void>;\n\n public unsubscribe() {\n this._unsubscribers.forEach((unsubscribe) => unsubscribe());\n }\n}\n"]}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RNSkReadonlyValue = void 0;
7
+
8
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+
10
+ class RNSkReadonlyValue {
11
+ constructor(value) {
12
+ _defineProperty(this, "_current", void 0);
13
+
14
+ _defineProperty(this, "_listeners", []);
15
+
16
+ _defineProperty(this, "__typename__", "RNSkValue");
17
+
18
+ this._current = value;
19
+ }
20
+
21
+ notifyListeners() {
22
+ this._listeners.forEach(cb => cb(this._current));
23
+ }
24
+
25
+ update(nextValue) {
26
+ this._current = nextValue;
27
+ this.notifyListeners();
28
+ }
29
+
30
+ get current() {
31
+ return this._current;
32
+ }
33
+
34
+ addListener(cb) {
35
+ this._listeners.push(cb);
36
+
37
+ return () => {
38
+ this._listeners.splice(this._listeners.indexOf(cb), 1);
39
+ };
40
+ }
41
+
42
+ }
43
+
44
+ exports.RNSkReadonlyValue = RNSkReadonlyValue;
45
+ //# sourceMappingURL=RNSkReadonlyValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["RNSkReadonlyValue.ts"],"names":["RNSkReadonlyValue","constructor","value","_current","notifyListeners","_listeners","forEach","cb","update","nextValue","current","addListener","push","splice","indexOf"],"mappings":";;;;;;;;;AAEO,MAAMA,iBAAN,CAA2D;AAChEC,EAAAA,WAAW,CAACC,KAAD,EAAW;AAAA;;AAAA,wCAK0B,EAL1B;;AAAA,0CAgBS,WAhBT;;AACpB,SAAKC,QAAL,GAAgBD,KAAhB;AACD;;AAKOE,EAAAA,eAAe,GAAS;AAC9B,SAAKC,UAAL,CAAgBC,OAAhB,CAAyBC,EAAD,IAAQA,EAAE,CAAC,KAAKJ,QAAN,CAAlC;AACD;;AAESK,EAAAA,MAAM,CAACC,SAAD,EAAqB;AACnC,SAAKN,QAAL,GAAgBM,SAAhB;AACA,SAAKL,eAAL;AACD;;AAIiB,MAAPM,OAAO,GAAM;AACtB,WAAO,KAAKP,QAAZ;AACD;;AAEMQ,EAAAA,WAAW,CAACJ,EAAD,EAAyB;AACzC,SAAKF,UAAL,CAAgBO,IAAhB,CAAqBL,EAArB;;AACA,WAAO,MAAM;AACX,WAAKF,UAAL,CAAgBQ,MAAhB,CAAuB,KAAKR,UAAL,CAAgBS,OAAhB,CAAwBP,EAAxB,CAAvB,EAAoD,CAApD;AACD,KAFD;AAGD;;AA5B+D","sourcesContent":["import type { SkiaReadonlyValue } from \"../types\";\n\nexport class RNSkReadonlyValue<T> implements SkiaReadonlyValue<T> {\n constructor(value: T) {\n this._current = value;\n }\n\n private _current: T;\n private _listeners: Array<(value: T) => void> = [];\n\n private notifyListeners(): void {\n this._listeners.forEach((cb) => cb(this._current));\n }\n\n protected update(nextValue: T): void {\n this._current = nextValue;\n this.notifyListeners();\n }\n\n public readonly __typename__ = \"RNSkValue\";\n\n public get current(): T {\n return this._current;\n }\n\n public addListener(cb: (value: T) => void) {\n this._listeners.push(cb);\n return () => {\n this._listeners.splice(this._listeners.indexOf(cb), 1);\n };\n }\n}\n"]}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RNSkValue = void 0;
7
+
8
+ var _RNSkReadonlyValue = require("./RNSkReadonlyValue");
9
+
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+
12
+ class RNSkValue extends _RNSkReadonlyValue.RNSkReadonlyValue {
13
+ constructor(value) {
14
+ super(value);
15
+
16
+ _defineProperty(this, "_unsubscribe", void 0);
17
+
18
+ _defineProperty(this, "_animation", void 0);
19
+
20
+ this._unsubscribe = undefined;
21
+ }
22
+
23
+ set current(value) {
24
+ this.update(value);
25
+ }
26
+
27
+ get current() {
28
+ return super.current;
29
+ }
30
+
31
+ unsubscribe() {
32
+ if (this._unsubscribe) {
33
+ this._unsubscribe();
34
+
35
+ this._unsubscribe = undefined;
36
+ }
37
+
38
+ if (this._animation) {
39
+ this._animation.cancel();
40
+
41
+ this._animation = undefined;
42
+ }
43
+ }
44
+
45
+ subscribe(animation) {
46
+ this.unsubscribe();
47
+
48
+ if (animation) {
49
+ this._animation = animation;
50
+ this._unsubscribe = animation.addListener( // eslint-disable-next-line @typescript-eslint/ban-ts-comment
51
+ // @ts-ignore
52
+ this.animationDidUpdate.bind(this));
53
+
54
+ this._animation.start();
55
+ }
56
+ }
57
+
58
+ animationDidUpdate(value) {
59
+ this.update(value);
60
+ }
61
+
62
+ get animation() {
63
+ return this._animation;
64
+ }
65
+
66
+ set animation(v) {
67
+ this.subscribe(v);
68
+ }
69
+
70
+ }
71
+
72
+ exports.RNSkValue = RNSkValue;
73
+ //# sourceMappingURL=RNSkValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["RNSkValue.ts"],"names":["RNSkValue","RNSkReadonlyValue","constructor","value","_unsubscribe","undefined","current","update","unsubscribe","_animation","cancel","subscribe","animation","addListener","animationDidUpdate","bind","start","v"],"mappings":";;;;;;;AAEA;;;;AAEO,MAAMA,SAAN,SAA2BC,oCAA3B,CAAwE;AAC7EC,EAAAA,WAAW,CAACC,KAAD,EAAW;AACpB,UAAMA,KAAN;;AADoB;;AAAA;;AAEpB,SAAKC,YAAL,GAAoBC,SAApB;AACD;;AAEiB,MAAPC,OAAO,CAACH,KAAD,EAAW;AAC3B,SAAKI,MAAL,CAAYJ,KAAZ;AACD;;AAEiB,MAAPG,OAAO,GAAM;AACtB,WAAO,MAAMA,OAAb;AACD;;AAIOE,EAAAA,WAAW,GAAG;AACpB,QAAI,KAAKJ,YAAT,EAAuB;AACrB,WAAKA,YAAL;;AACA,WAAKA,YAAL,GAAoBC,SAApB;AACD;;AACD,QAAI,KAAKI,UAAT,EAAqB;AACnB,WAAKA,UAAL,CAAgBC,MAAhB;;AACA,WAAKD,UAAL,GAAkBJ,SAAlB;AACD;AACF;;AAEOM,EAAAA,SAAS,CAACC,SAAD,EAAuC;AACtD,SAAKJ,WAAL;;AACA,QAAII,SAAJ,EAAe;AACb,WAAKH,UAAL,GAAkBG,SAAlB;AACA,WAAKR,YAAL,GAAoBQ,SAAS,CAACC,WAAV,EAClB;AACA;AACA,WAAKC,kBAAL,CAAwBC,IAAxB,CAA6B,IAA7B,CAHkB,CAApB;;AAKA,WAAKN,UAAL,CAAgBO,KAAhB;AACD;AACF;;AAEOF,EAAAA,kBAAkB,CAACX,KAAD,EAAW;AACnC,SAAKI,MAAL,CAAYJ,KAAZ;AACD;;AAGmB,MAATS,SAAS,GAA8B;AAChD,WAAO,KAAKH,UAAZ;AACD;;AAEmB,MAATG,SAAS,CAACK,CAAD,EAA+B;AACjD,SAAKN,SAAL,CAAeM,CAAf;AACD;;AAnD4E","sourcesContent":["import type { SkiaAnimation, SkiaValue } from \"../types\";\n\nimport { RNSkReadonlyValue } from \"./RNSkReadonlyValue\";\n\nexport class RNSkValue<T> extends RNSkReadonlyValue<T> implements SkiaValue<T> {\n constructor(value: T) {\n super(value);\n this._unsubscribe = undefined;\n }\n\n public set current(value: T) {\n this.update(value);\n }\n\n public get current(): T {\n return super.current;\n }\n\n private _unsubscribe: (() => void) | undefined;\n\n private unsubscribe() {\n if (this._unsubscribe) {\n this._unsubscribe();\n this._unsubscribe = undefined;\n }\n if (this._animation) {\n this._animation.cancel();\n this._animation = undefined;\n }\n }\n\n private subscribe(animation: SkiaAnimation | undefined) {\n this.unsubscribe();\n if (animation) {\n this._animation = animation;\n this._unsubscribe = animation.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.animationDidUpdate.bind(this)\n );\n this._animation.start();\n }\n }\n\n private animationDidUpdate(value: T) {\n this.update(value);\n }\n\n private _animation: SkiaAnimation | undefined;\n public get animation(): SkiaAnimation | undefined {\n return this._animation;\n }\n\n public set animation(v: SkiaAnimation | undefined) {\n this.subscribe(v);\n }\n}\n"]}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ValueApi = void 0;
7
+
8
+ var _RNSkAnimation = require("./RNSkAnimation");
9
+
10
+ var _RNSkClockValue = require("./RNSkClockValue");
11
+
12
+ var _RNSkDerivedValue = require("./RNSkDerivedValue");
13
+
14
+ var _RNSkValue = require("./RNSkValue");
15
+
16
+ const ValueApi = {
17
+ createValue: function (initialValue) {
18
+ return new _RNSkValue.RNSkValue(initialValue);
19
+ },
20
+ createDerivedValue: function (cb, values) {
21
+ return new _RNSkDerivedValue.RNSkDerivedValue(cb, values);
22
+ },
23
+ createClockValue: function () {
24
+ return new _RNSkClockValue.RNSkClockValue(requestAnimationFrame);
25
+ },
26
+ createAnimation: function (cb) {
27
+ return new _RNSkAnimation.RNSkAnimation(cb, requestAnimationFrame);
28
+ }
29
+ };
30
+ exports.ValueApi = ValueApi;
31
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["api.ts"],"names":["ValueApi","createValue","initialValue","RNSkValue","createDerivedValue","cb","values","RNSkDerivedValue","createClockValue","RNSkClockValue","requestAnimationFrame","createAnimation","RNSkAnimation"],"mappings":";;;;;;;AASA;;AACA;;AACA;;AACA;;AAEO,MAAMA,QAAuB,GAAG;AACrCC,EAAAA,WAAW,EAAE,UAAaC,YAAb,EAA4C;AACvD,WAAO,IAAIC,oBAAJ,CAAcD,YAAd,CAAP;AACD,GAHoC;AAIrCE,EAAAA,kBAAkB,EAAE,UAClBC,EADkB,EAElBC,MAFkB,EAGI;AACtB,WAAO,IAAIC,kCAAJ,CAAqBF,EAArB,EAAyBC,MAAzB,CAAP;AACD,GAToC;AAUrCE,EAAAA,gBAAgB,EAAE,YAA4B;AAC5C,WAAO,IAAIC,8BAAJ,CAAmBC,qBAAnB,CAAP;AACD,GAZoC;AAarCC,EAAAA,eAAe,EAAE,UACfN,EADe,EAEA;AACf,WAAO,IAAIO,4BAAJ,CAAkBP,EAAlB,EAAsBK,qBAAtB,CAAP;AACD;AAjBoC,CAAhC","sourcesContent":["import type {\n ISkiaValueApi,\n SkiaValue,\n SkiaReadonlyValue,\n SkiaClockValue,\n AnimationState,\n SkiaAnimation,\n} from \"../types\";\n\nimport { RNSkAnimation } from \"./RNSkAnimation\";\nimport { RNSkClockValue } from \"./RNSkClockValue\";\nimport { RNSkDerivedValue } from \"./RNSkDerivedValue\";\nimport { RNSkValue } from \"./RNSkValue\";\n\nexport const ValueApi: ISkiaValueApi = {\n createValue: function <T>(initialValue: T): SkiaValue<T> {\n return new RNSkValue(initialValue);\n },\n createDerivedValue: function <R>(\n cb: () => R,\n values: SkiaReadonlyValue<unknown>[]\n ): SkiaReadonlyValue<R> {\n return new RNSkDerivedValue(cb, values);\n },\n createClockValue: function (): SkiaClockValue {\n return new RNSkClockValue(requestAnimationFrame);\n },\n createAnimation: function <S extends AnimationState = AnimationState>(\n cb: (t: number, state: S | undefined) => S\n ): SkiaAnimation {\n return new RNSkAnimation(cb, requestAnimationFrame);\n },\n};\n"]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _api = require("./api");
8
+
9
+ Object.keys(_api).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _api[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _api[key];
16
+ }
17
+ });
18
+ });
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./api\";\n"]}