@shopify/react-native-skia 0.1.225 → 0.1.227

Sign up to get free protection for your applications and to get access to all the features.
Files changed (243) hide show
  1. package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h +3 -3
  2. package/cpp/api/JsiSkMatrix.h +8 -2
  3. package/cpp/api/JsiSkPictureRecorder.h +10 -3
  4. package/cpp/rnskia/dom/props/MatrixProp.h +8 -0
  5. package/cpp/rnskia/dom/props/TransformProp.h +76 -9
  6. package/lib/commonjs/animation/spring/runSpring.d.ts +3 -0
  7. package/lib/commonjs/animation/spring/runSpring.js +3 -0
  8. package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
  9. package/lib/commonjs/animation/spring/useSpring.d.ts +3 -0
  10. package/lib/commonjs/animation/spring/useSpring.js +3 -0
  11. package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
  12. package/lib/commonjs/animation/timing/runTiming.d.ts +3 -0
  13. package/lib/commonjs/animation/timing/runTiming.js +3 -0
  14. package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
  15. package/lib/commonjs/animation/timing/useLoop.d.ts +3 -0
  16. package/lib/commonjs/animation/timing/useLoop.js +3 -0
  17. package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
  18. package/lib/commonjs/animation/timing/useTiming.d.ts +3 -0
  19. package/lib/commonjs/animation/timing/useTiming.js +3 -0
  20. package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
  21. package/lib/commonjs/dom/nodes/JsiSkDOM.js +2 -0
  22. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  23. package/lib/commonjs/dom/nodes/datatypes/Fitting.d.ts +5 -5
  24. package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
  25. package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +235 -75
  26. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
  27. package/lib/commonjs/dom/types/Common.d.ts +3 -3
  28. package/lib/commonjs/dom/types/Common.js.map +1 -1
  29. package/lib/commonjs/external/reanimated/interpolators.js +10 -4
  30. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
  31. package/lib/commonjs/renderer/Canvas.js +34 -28
  32. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  33. package/lib/commonjs/renderer/components/Drawing.d.ts +5 -0
  34. package/lib/commonjs/renderer/components/Drawing.js +5 -0
  35. package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
  36. package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +5 -5
  37. package/lib/commonjs/skia/core/Matrix.d.ts +2 -2
  38. package/lib/commonjs/skia/core/Matrix.js.map +1 -1
  39. package/lib/commonjs/skia/core/Picture.d.ts +2 -2
  40. package/lib/commonjs/skia/core/Picture.js +12 -2
  41. package/lib/commonjs/skia/core/Picture.js.map +1 -1
  42. package/lib/commonjs/skia/core/Vector.d.ts +3 -3
  43. package/lib/commonjs/skia/core/Vector.js.map +1 -1
  44. package/lib/commonjs/skia/types/Canvas.d.ts +1 -1
  45. package/lib/commonjs/skia/types/Canvas.js.map +1 -1
  46. package/lib/commonjs/skia/types/Matrix.d.ts +4 -9
  47. package/lib/commonjs/skia/types/Matrix.js +5 -56
  48. package/lib/commonjs/skia/types/Matrix.js.map +1 -1
  49. package/lib/commonjs/skia/types/Matrix4.d.ts +39 -0
  50. package/lib/commonjs/skia/types/Matrix4.js +213 -0
  51. package/lib/commonjs/skia/types/Matrix4.js.map +1 -0
  52. package/lib/commonjs/skia/types/Path/Path.d.ts +1 -1
  53. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  54. package/lib/commonjs/skia/types/Picture/PictureRecorder.d.ts +1 -1
  55. package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
  56. package/lib/commonjs/skia/types/Rect.d.ts +1 -0
  57. package/lib/commonjs/skia/types/Rect.js +18 -0
  58. package/lib/commonjs/skia/types/Rect.js.map +1 -1
  59. package/lib/commonjs/skia/types/index.d.ts +1 -0
  60. package/lib/commonjs/skia/types/index.js +13 -0
  61. package/lib/commonjs/skia/types/index.js.map +1 -1
  62. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -1
  63. package/lib/commonjs/skia/web/JsiSkCanvas.js +1 -1
  64. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  65. package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +1 -1
  66. package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
  67. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  68. package/lib/commonjs/skia/web/JsiSkPath.js +1 -1
  69. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  70. package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  71. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +1 -1
  72. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  73. package/lib/commonjs/values/api.d.ts +23 -2
  74. package/lib/commonjs/values/api.js +44 -1
  75. package/lib/commonjs/values/api.js.map +1 -1
  76. package/lib/commonjs/values/hooks/useClockValue.d.ts +3 -0
  77. package/lib/commonjs/values/hooks/useClockValue.js +3 -0
  78. package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
  79. package/lib/commonjs/values/hooks/useComputedValue.d.ts +3 -0
  80. package/lib/commonjs/values/hooks/useComputedValue.js +3 -0
  81. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  82. package/lib/commonjs/values/hooks/useValue.d.ts +3 -0
  83. package/lib/commonjs/values/hooks/useValue.js +3 -0
  84. package/lib/commonjs/values/hooks/useValue.js.map +1 -1
  85. package/lib/commonjs/values/hooks/useValueEffect.d.ts +3 -0
  86. package/lib/commonjs/values/hooks/useValueEffect.js +3 -0
  87. package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
  88. package/lib/commonjs/values/types.d.ts +4 -4
  89. package/lib/commonjs/values/types.js.map +1 -1
  90. package/lib/commonjs/views/SkiaView.d.ts +5 -0
  91. package/lib/commonjs/views/SkiaView.js +9 -0
  92. package/lib/commonjs/views/SkiaView.js.map +1 -1
  93. package/lib/module/animation/spring/runSpring.d.ts +3 -0
  94. package/lib/module/animation/spring/runSpring.js +3 -0
  95. package/lib/module/animation/spring/runSpring.js.map +1 -1
  96. package/lib/module/animation/spring/useSpring.d.ts +3 -0
  97. package/lib/module/animation/spring/useSpring.js +3 -0
  98. package/lib/module/animation/spring/useSpring.js.map +1 -1
  99. package/lib/module/animation/timing/runTiming.d.ts +3 -0
  100. package/lib/module/animation/timing/runTiming.js +3 -0
  101. package/lib/module/animation/timing/runTiming.js.map +1 -1
  102. package/lib/module/animation/timing/useLoop.d.ts +3 -0
  103. package/lib/module/animation/timing/useLoop.js +3 -0
  104. package/lib/module/animation/timing/useLoop.js.map +1 -1
  105. package/lib/module/animation/timing/useTiming.d.ts +3 -0
  106. package/lib/module/animation/timing/useTiming.js +3 -0
  107. package/lib/module/animation/timing/useTiming.js.map +1 -1
  108. package/lib/module/dom/nodes/JsiSkDOM.js +2 -0
  109. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  110. package/lib/module/dom/nodes/datatypes/Fitting.d.ts +5 -5
  111. package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
  112. package/lib/module/dom/nodes/datatypes/Gradient.d.ts +235 -75
  113. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  114. package/lib/module/dom/types/Common.d.ts +3 -3
  115. package/lib/module/dom/types/Common.js.map +1 -1
  116. package/lib/module/external/reanimated/interpolators.js +11 -5
  117. package/lib/module/external/reanimated/interpolators.js.map +1 -1
  118. package/lib/module/renderer/Canvas.js +35 -29
  119. package/lib/module/renderer/Canvas.js.map +1 -1
  120. package/lib/module/renderer/components/Drawing.d.ts +5 -0
  121. package/lib/module/renderer/components/Drawing.js +6 -0
  122. package/lib/module/renderer/components/Drawing.js.map +1 -1
  123. package/lib/module/renderer/components/shapes/FitBox.d.ts +5 -5
  124. package/lib/module/skia/core/Matrix.d.ts +2 -2
  125. package/lib/module/skia/core/Matrix.js.map +1 -1
  126. package/lib/module/skia/core/Picture.d.ts +2 -2
  127. package/lib/module/skia/core/Picture.js +12 -3
  128. package/lib/module/skia/core/Picture.js.map +1 -1
  129. package/lib/module/skia/core/Vector.d.ts +3 -3
  130. package/lib/module/skia/core/Vector.js.map +1 -1
  131. package/lib/module/skia/types/Canvas.d.ts +1 -1
  132. package/lib/module/skia/types/Canvas.js.map +1 -1
  133. package/lib/module/skia/types/Matrix.d.ts +4 -9
  134. package/lib/module/skia/types/Matrix.js +3 -57
  135. package/lib/module/skia/types/Matrix.js.map +1 -1
  136. package/lib/module/skia/types/Matrix4.d.ts +39 -0
  137. package/lib/module/skia/types/Matrix4.js +200 -0
  138. package/lib/module/skia/types/Matrix4.js.map +1 -0
  139. package/lib/module/skia/types/Path/Path.d.ts +1 -1
  140. package/lib/module/skia/types/Path/Path.js.map +1 -1
  141. package/lib/module/skia/types/Picture/PictureRecorder.d.ts +1 -1
  142. package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
  143. package/lib/module/skia/types/Rect.d.ts +1 -0
  144. package/lib/module/skia/types/Rect.js +9 -0
  145. package/lib/module/skia/types/Rect.js.map +1 -1
  146. package/lib/module/skia/types/index.d.ts +1 -0
  147. package/lib/module/skia/types/index.js +1 -0
  148. package/lib/module/skia/types/index.js.map +1 -1
  149. package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -1
  150. package/lib/module/skia/web/JsiSkCanvas.js +1 -1
  151. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  152. package/lib/module/skia/web/JsiSkMatrix.d.ts +1 -1
  153. package/lib/module/skia/web/JsiSkMatrix.js +1 -1
  154. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  155. package/lib/module/skia/web/JsiSkPath.js +1 -1
  156. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  157. package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  158. package/lib/module/skia/web/JsiSkPictureRecorder.js +1 -1
  159. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  160. package/lib/module/values/api.d.ts +23 -2
  161. package/lib/module/values/api.js +44 -1
  162. package/lib/module/values/api.js.map +1 -1
  163. package/lib/module/values/hooks/useClockValue.d.ts +3 -0
  164. package/lib/module/values/hooks/useClockValue.js +3 -0
  165. package/lib/module/values/hooks/useClockValue.js.map +1 -1
  166. package/lib/module/values/hooks/useComputedValue.d.ts +3 -0
  167. package/lib/module/values/hooks/useComputedValue.js +3 -0
  168. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  169. package/lib/module/values/hooks/useValue.d.ts +3 -0
  170. package/lib/module/values/hooks/useValue.js +3 -0
  171. package/lib/module/values/hooks/useValue.js.map +1 -1
  172. package/lib/module/values/hooks/useValueEffect.d.ts +3 -0
  173. package/lib/module/values/hooks/useValueEffect.js +3 -0
  174. package/lib/module/values/hooks/useValueEffect.js.map +1 -1
  175. package/lib/module/values/types.d.ts +4 -4
  176. package/lib/module/values/types.js.map +1 -1
  177. package/lib/module/views/SkiaView.d.ts +5 -0
  178. package/lib/module/views/SkiaView.js +10 -0
  179. package/lib/module/views/SkiaView.js.map +1 -1
  180. package/lib/typescript/src/animation/spring/runSpring.d.ts +3 -0
  181. package/lib/typescript/src/animation/spring/useSpring.d.ts +3 -0
  182. package/lib/typescript/src/animation/timing/runTiming.d.ts +3 -0
  183. package/lib/typescript/src/animation/timing/useLoop.d.ts +3 -0
  184. package/lib/typescript/src/animation/timing/useTiming.d.ts +3 -0
  185. package/lib/typescript/src/dom/nodes/datatypes/Fitting.d.ts +5 -5
  186. package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +235 -75
  187. package/lib/typescript/src/dom/types/Common.d.ts +3 -3
  188. package/lib/typescript/src/renderer/components/Drawing.d.ts +5 -0
  189. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +5 -5
  190. package/lib/typescript/src/skia/core/Matrix.d.ts +2 -2
  191. package/lib/typescript/src/skia/core/Picture.d.ts +2 -2
  192. package/lib/typescript/src/skia/core/Vector.d.ts +3 -3
  193. package/lib/typescript/src/skia/types/Canvas.d.ts +1 -1
  194. package/lib/typescript/src/skia/types/Matrix.d.ts +4 -9
  195. package/lib/typescript/src/skia/types/Matrix4.d.ts +39 -0
  196. package/lib/typescript/src/skia/types/Path/Path.d.ts +1 -1
  197. package/lib/typescript/src/skia/types/Picture/PictureRecorder.d.ts +1 -1
  198. package/lib/typescript/src/skia/types/Rect.d.ts +1 -0
  199. package/lib/typescript/src/skia/types/index.d.ts +1 -0
  200. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -1
  201. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +1 -1
  202. package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -1
  203. package/lib/typescript/src/values/api.d.ts +23 -2
  204. package/lib/typescript/src/values/hooks/useClockValue.d.ts +3 -0
  205. package/lib/typescript/src/values/hooks/useComputedValue.d.ts +3 -0
  206. package/lib/typescript/src/values/hooks/useValue.d.ts +3 -0
  207. package/lib/typescript/src/values/hooks/useValueEffect.d.ts +3 -0
  208. package/lib/typescript/src/values/types.d.ts +4 -4
  209. package/lib/typescript/src/views/SkiaView.d.ts +5 -0
  210. package/package.json +1 -1
  211. package/src/animation/spring/runSpring.ts +3 -0
  212. package/src/animation/spring/useSpring.ts +3 -0
  213. package/src/animation/timing/runTiming.ts +3 -0
  214. package/src/animation/timing/useLoop.ts +3 -0
  215. package/src/animation/timing/useTiming.ts +3 -0
  216. package/src/dom/nodes/JsiSkDOM.ts +4 -0
  217. package/src/dom/nodes/datatypes/Fitting.ts +10 -2
  218. package/src/dom/nodes/datatypes/Gradient.ts +2 -2
  219. package/src/dom/types/Common.ts +3 -3
  220. package/src/external/reanimated/interpolators.ts +14 -6
  221. package/src/renderer/Canvas.tsx +41 -30
  222. package/src/renderer/components/Drawing.tsx +5 -0
  223. package/src/skia/core/Matrix.ts +2 -2
  224. package/src/skia/core/Picture.ts +11 -3
  225. package/src/skia/core/Vector.ts +5 -2
  226. package/src/skia/types/Canvas.ts +1 -1
  227. package/src/skia/types/Matrix.ts +7 -74
  228. package/src/skia/types/Matrix4.ts +266 -0
  229. package/src/skia/types/Path/Path.ts +1 -1
  230. package/src/skia/types/Picture/PictureRecorder.ts +1 -1
  231. package/src/skia/types/Rect.ts +14 -0
  232. package/src/skia/types/index.ts +1 -0
  233. package/src/skia/web/JsiSkCanvas.ts +2 -2
  234. package/src/skia/web/JsiSkMatrix.ts +4 -2
  235. package/src/skia/web/JsiSkPath.ts +1 -1
  236. package/src/skia/web/JsiSkPictureRecorder.ts +6 -2
  237. package/src/values/api.ts +55 -2
  238. package/src/values/hooks/useClockValue.ts +3 -0
  239. package/src/values/hooks/useComputedValue.ts +3 -0
  240. package/src/values/hooks/useValue.ts +3 -0
  241. package/src/values/hooks/useValueEffect.ts +3 -0
  242. package/src/values/types.ts +6 -6
  243. package/src/views/SkiaView.tsx +11 -0
@@ -1,4 +1,7 @@
1
1
  /**
2
+ * @deprecated Use Reanimated 3
3
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
4
+ *
2
5
  * Creates a new computed value - a value that will calculate its value depending
3
6
  * on other values.
4
7
  * @param cb Callback to calculate new value
@@ -2,6 +2,9 @@ import { useEffect, useMemo } from "react";
2
2
  import { ValueApi } from "../api";
3
3
  import { isValue } from "../../renderer/processors/Animations";
4
4
  /**
5
+ * @deprecated Use Reanimated 3
6
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
7
+ *
5
8
  * Creates a new computed value - a value that will calculate its value depending
6
9
  * on other values.
7
10
  * @param cb Callback to calculate new value
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useMemo","ValueApi","isValue","useComputedValue","cb","values","value","createComputedValue","filter","dispose"],"sources":["useComputedValue.ts"],"sourcesContent":["import { useEffect, useMemo } from \"react\";\n\nimport { ValueApi } from \"../api\";\nimport { isValue } from \"../../renderer/processors/Animations\";\n\n/**\n * Creates a new computed value - a value that will calculate its value depending\n * on other values.\n * @param cb Callback to calculate new value\n * @param values Dependant values\n * @returns A readonly value\n */\nexport const useComputedValue = <R>(cb: () => R, values: unknown[]) => {\n const value = useMemo(\n () => ValueApi.createComputedValue<R>(cb, values.filter(isValue)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n values\n );\n useEffect(() => () => value.dispose(), [value]);\n return value;\n};\n"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,OAApB,QAAmC,OAAnC;AAEA,SAASC,QAAT,QAAyB,QAAzB;AACA,SAASC,OAAT,QAAwB,sCAAxB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,gBAAgB,GAAG,CAAIC,EAAJ,EAAiBC,MAAjB,KAAuC;EACrE,MAAMC,KAAK,GAAGN,OAAO,CACnB,MAAMC,QAAQ,CAACM,mBAAT,CAAgCH,EAAhC,EAAoCC,MAAM,CAACG,MAAP,CAAcN,OAAd,CAApC,CADa,EAEnB;EACAG,MAHmB,CAArB;EAKAN,SAAS,CAAC,MAAM,MAAMO,KAAK,CAACG,OAAN,EAAb,EAA8B,CAACH,KAAD,CAA9B,CAAT;EACA,OAAOA,KAAP;AACD,CARM"}
1
+ {"version":3,"names":["useEffect","useMemo","ValueApi","isValue","useComputedValue","cb","values","value","createComputedValue","filter","dispose"],"sources":["useComputedValue.ts"],"sourcesContent":["import { useEffect, useMemo } from \"react\";\n\nimport { ValueApi } from \"../api\";\nimport { isValue } from \"../../renderer/processors/Animations\";\n\n/**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n *\n * Creates a new computed value - a value that will calculate its value depending\n * on other values.\n * @param cb Callback to calculate new value\n * @param values Dependant values\n * @returns A readonly value\n */\nexport const useComputedValue = <R>(cb: () => R, values: unknown[]) => {\n const value = useMemo(\n () => ValueApi.createComputedValue<R>(cb, values.filter(isValue)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n values\n );\n useEffect(() => () => value.dispose(), [value]);\n return value;\n};\n"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,OAApB,QAAmC,OAAnC;AAEA,SAASC,QAAT,QAAyB,QAAzB;AACA,SAASC,OAAT,QAAwB,sCAAxB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,gBAAgB,GAAG,CAAIC,EAAJ,EAAiBC,MAAjB,KAAuC;EACrE,MAAMC,KAAK,GAAGN,OAAO,CACnB,MAAMC,QAAQ,CAACM,mBAAT,CAAgCH,EAAhC,EAAoCC,MAAM,CAACG,MAAP,CAAcN,OAAd,CAApC,CADa,EAEnB;EACAG,MAHmB,CAArB;EAKAN,SAAS,CAAC,MAAM,MAAMO,KAAK,CAACG,OAAN,EAAb,EAA8B,CAACH,KAAD,CAA9B,CAAT;EACA,OAAOA,KAAP;AACD,CARM"}
@@ -1,5 +1,8 @@
1
1
  import type { SkiaMutableValue } from "../types";
2
2
  /**
3
+ * @deprecated Use Reanimated 3
4
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
5
+ *
3
6
  * Creates a new value that holds some data.
4
7
  * @param v Value to hold
5
8
  * @returns A Value of type of v
@@ -2,6 +2,9 @@ import { useMemo } from "react";
2
2
  import { ValueApi } from "../api";
3
3
 
4
4
  /**
5
+ * @deprecated Use Reanimated 3
6
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
7
+ *
5
8
  * Creates a new value that holds some data.
6
9
  * @param v Value to hold
7
10
  * @returns A Value of type of v
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","ValueApi","useValue","v","createValue"],"sources":["useValue.ts"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport { ValueApi } from \"../api\";\nimport type { SkiaMutableValue } from \"../types\";\n\n/**\n * Creates a new value that holds some data.\n * @param v Value to hold\n * @returns A Value of type of v\n */\nexport const useValue = <T>(v: T): SkiaMutableValue<T> => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => ValueApi.createValue(v), []);\n};\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAEA,SAASC,QAAT,QAAyB,QAAzB;;AAGA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAOC,CAAJ,IAAkC;EACxD;EACA,OAAOH,OAAO,CAAC,MAAMC,QAAQ,CAACG,WAAT,CAAqBD,CAArB,CAAP,EAAgC,EAAhC,CAAd;AACD,CAHM"}
1
+ {"version":3,"names":["useMemo","ValueApi","useValue","v","createValue"],"sources":["useValue.ts"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport { ValueApi } from \"../api\";\nimport type { SkiaMutableValue } from \"../types\";\n\n/**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n *\n * Creates a new value that holds some data.\n * @param v Value to hold\n * @returns A Value of type of v\n */\nexport const useValue = <T>(v: T): SkiaMutableValue<T> => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => ValueApi.createValue(v), []);\n};\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAEA,SAASC,QAAT,QAAyB,QAAzB;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAOC,CAAJ,IAAkC;EACxD;EACA,OAAOH,OAAO,CAAC,MAAMC,QAAQ,CAACG,WAAT,CAAqBD,CAArB,CAAP,EAAgC,EAAhC,CAAd;AACD,CAHM"}
@@ -1,5 +1,8 @@
1
1
  import type { SkiaValue } from "../types";
2
2
  /**
3
+ * @deprecated Use Reanimated 3
4
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
5
+ *
3
6
  * Sets up an effect that will be run whenever the value changes
4
7
  * @param value Value to subscribe to changes on
5
8
  * @param cb Callback to run when value changes
@@ -1,6 +1,9 @@
1
1
  import { useEffect } from "react";
2
2
 
3
3
  /**
4
+ * @deprecated Use Reanimated 3
5
+ * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
6
+ *
4
7
  * Sets up an effect that will be run whenever the value changes
5
8
  * @param value Value to subscribe to changes on
6
9
  * @param cb Callback to run when value changes
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useValueEffect","value","cb","addListener"],"sources":["useValueEffect.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport type { SkiaValue } from \"../types\";\n\n/**\n * Sets up an effect that will be run whenever the value changes\n * @param value Value to subscribe to changes on\n * @param cb Callback to run when value changes\n */\nexport const useValueEffect = <T>(value: SkiaValue<T>, cb: (v: T) => void) => {\n useEffect(() => {\n return value.addListener(cb);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n};\n"],"mappings":"AAAA,SAASA,SAAT,QAA0B,OAA1B;;AAIA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAG,CAAIC,KAAJ,EAAyBC,EAAzB,KAAgD;EAC5EH,SAAS,CAAC,MAAM;IACd,OAAOE,KAAK,CAACE,WAAN,CAAkBD,EAAlB,CAAP,CADc,CAEd;EACD,CAHQ,EAGN,CAACD,KAAD,CAHM,CAAT;AAID,CALM"}
1
+ {"version":3,"names":["useEffect","useValueEffect","value","cb","addListener"],"sources":["useValueEffect.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport type { SkiaValue } from \"../types\";\n\n/**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n *\n * Sets up an effect that will be run whenever the value changes\n * @param value Value to subscribe to changes on\n * @param cb Callback to run when value changes\n */\nexport const useValueEffect = <T>(value: SkiaValue<T>, cb: (v: T) => void) => {\n useEffect(() => {\n return value.addListener(cb);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n};\n"],"mappings":"AAAA,SAASA,SAAT,QAA0B,OAA1B;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAG,CAAIC,KAAJ,EAAyBC,EAAzB,KAAgD;EAC5EH,SAAS,CAAC,MAAM;IACd,OAAOE,KAAK,CAACE,WAAN,CAAkBD,EAAlB,CAAP,CADc,CAEd;EACD,CAHQ,EAGN,CAACD,KAAD,CAHM,CAAT;AAID,CALM"}
@@ -43,21 +43,21 @@ export interface ISkiaValueApi {
43
43
  * Creates a new value that holds the initial value and that
44
44
  * can be changed.
45
45
  */
46
- createValue: <T>(initialValue: T) => SkiaMutableValue<T>;
46
+ createValue<T>(initialValue: T): SkiaMutableValue<T>;
47
47
  /**
48
48
  * Creates a computed value. This is a calculated value that returns the result of
49
49
  * a function that is called with the values of the dependencies.
50
50
  */
51
- createComputedValue: <R>(cb: () => R, values: Array<SkiaValue<unknown>>) => SkiaValue<R>;
51
+ createComputedValue<R>(cb: () => R, values: Array<SkiaValue<unknown>>): SkiaValue<R>;
52
52
  /**
53
53
  * Creates a clock value where the value is the number of milliseconds elapsed
54
54
  * since the clock was created
55
55
  */
56
- createClockValue: () => SkiaClockValue;
56
+ createClockValue(): SkiaClockValue;
57
57
  /**
58
58
  * Creates an animation that is driven from a clock and updated every frame.
59
59
  * @param cb Callback to calculate next value from time.
60
60
  * @returns An animation object that can control a value.
61
61
  */
62
- createAnimation: <S extends AnimationState = AnimationState>(cb: (t: number, state: S | undefined) => S) => SkiaAnimation;
62
+ createAnimation<S extends AnimationState = AnimationState>(cb: (t: number, state: S | undefined) => S): SkiaAnimation;
63
63
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface SkiaValue<T = number> {\n /**\n * Gets the value hold by the Value object\n */\n readonly current: T;\n /**\n * Adds a listener that is called when value changes.\n * Returns unsubscribe method.\n */\n addListener: (cb: (value: T) => void) => () => void;\n /**\n * Invalidates the value. Has different meaning depending on the type of the value.\n */\n dispose: () => void;\n /**\n * Field to make typechecking easier\n */\n __typename__: \"RNSkValue\";\n}\n\nexport interface SkiaMutableValue<T = number> extends SkiaValue<T> {\n /**\n * Get/sets the value hold by the Value object\n */\n current: T;\n /**\n * Get/sets the animation controlling the value\n * */\n animation: SkiaAnimation | undefined;\n}\n\nexport interface SkiaClockValue extends SkiaValue<number> {\n start: () => void;\n stop: () => void;\n}\n\nexport interface SkiaAnimation extends SkiaClockValue {\n cancel: () => void;\n}\n\nexport interface AnimationState {\n current: number;\n finished: boolean;\n}\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) => SkiaMutableValue<T>;\n /**\n * Creates a computed 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 createComputedValue: <R>(\n cb: () => R,\n values: Array<SkiaValue<unknown>>\n ) => SkiaValue<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"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface SkiaValue<T = number> {\n /**\n * Gets the value hold by the Value object\n */\n readonly current: T;\n /**\n * Adds a listener that is called when value changes.\n * Returns unsubscribe method.\n */\n addListener: (cb: (value: T) => void) => () => void;\n /**\n * Invalidates the value. Has different meaning depending on the type of the value.\n */\n dispose: () => void;\n /**\n * Field to make typechecking easier\n */\n __typename__: \"RNSkValue\";\n}\n\nexport interface SkiaMutableValue<T = number> extends SkiaValue<T> {\n /**\n * Get/sets the value hold by the Value object\n */\n current: T;\n /**\n * Get/sets the animation controlling the value\n * */\n animation: SkiaAnimation | undefined;\n}\n\nexport interface SkiaClockValue extends SkiaValue<number> {\n start: () => void;\n stop: () => void;\n}\n\nexport interface SkiaAnimation extends SkiaClockValue {\n cancel: () => void;\n}\n\nexport interface AnimationState {\n current: number;\n finished: boolean;\n}\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): SkiaMutableValue<T>;\n /**\n * Creates a computed 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 createComputedValue<R>(\n cb: () => R,\n values: Array<SkiaValue<unknown>>\n ): SkiaValue<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"],"mappings":""}
@@ -5,6 +5,11 @@ import type { SkiaDrawViewProps } from "./types";
5
5
  export declare const SkiaViewNativeId: {
6
6
  current: number;
7
7
  };
8
+ /**
9
+ * @deprecated If you are looking to use the Skia imperative API, you can use:
10
+ * The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
11
+ * The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures
12
+ */
8
13
  export declare class SkiaView extends React.Component<SkiaDrawViewProps> {
9
14
  constructor(props: SkiaDrawViewProps);
10
15
  private _nativeId;
@@ -9,12 +9,22 @@ export const SkiaViewNativeId = {
9
9
  current: 1000
10
10
  };
11
11
  const NativeSkiaView = SkiaDrawViewNativeComponent;
12
+ /**
13
+ * @deprecated If you are looking to use the Skia imperative API, you can use:
14
+ * The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
15
+ * The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures
16
+ */
17
+
12
18
  export class SkiaView extends React.Component {
13
19
  constructor(props) {
14
20
  super(props);
15
21
 
16
22
  _defineProperty(this, "_nativeId", void 0);
17
23
 
24
+ console.warn(`The SkiaView component is deprecated and will be removed in the next release.
25
+ If you are looking to use the Skia imperative API, you can use:
26
+ * The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
27
+ * The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures`);
18
28
  this._nativeId = SkiaViewNativeId.current++;
19
29
  const {
20
30
  onDraw,
@@ -1 +1 @@
1
- {"version":3,"names":["React","SkiaDrawViewNativeComponent","SkiaViewApi","SkiaViewNativeId","current","NativeSkiaView","SkiaView","Component","constructor","props","_nativeId","onDraw","onSize","assertSkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport SkiaDrawViewNativeComponent from \"../specs/SkiaDrawViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaDrawViewProps } from \"./types\";\n\nexport const SkiaViewNativeId = { current: 1000 };\n\nconst NativeSkiaView = SkiaDrawViewNativeComponent;\n\nexport class SkiaView extends React.Component<SkiaDrawViewProps> {\n constructor(props: SkiaDrawViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { onDraw, onSize } = props;\n if (onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaDrawViewProps) {\n const { onDraw, onSize } = this.props;\n if (onDraw !== prevProps.onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, onSize, ...viewProps } = this.props;\n return (\n <NativeSkiaView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode ?? \"default\"}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAIA,OAAOC,2BAAP,MAAwC,sCAAxC;AAEA,SAASC,WAAT,QAA4B,OAA5B;AAGA,OAAO,MAAMC,gBAAgB,GAAG;EAAEC,OAAO,EAAE;AAAX,CAAzB;AAEP,MAAMC,cAAc,GAAGJ,2BAAvB;AAEA,OAAO,MAAMK,QAAN,SAAuBN,KAAK,CAACO,SAA7B,CAA0D;EAC/DC,WAAW,CAACC,KAAD,EAA2B;IACpC,MAAMA,KAAN;;IADoC;;IAEpC,KAAKC,SAAL,GAAiBP,gBAAgB,CAACC,OAAjB,EAAjB;IACA,MAAM;MAAEO,MAAF;MAAUC;IAAV,IAAqBH,KAA3B;;IACA,IAAIE,MAAJ,EAAY;MACVE,iBAAiB;MACjBX,WAAW,CAACY,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,cAA3C,EAA2DC,MAA3D;IACD;;IACD,IAAIC,MAAJ,EAAY;MACVC,iBAAiB;MACjBX,WAAW,CAACY,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,QAA3C,EAAqDE,MAArD;IACD;EACF;;EAIkB,IAARG,QAAQ,GAAG;IACpB,OAAO,KAAKL,SAAZ;EACD;;EAEDM,kBAAkB,CAACC,SAAD,EAA+B;IAC/C,MAAM;MAAEN,MAAF;MAAUC;IAAV,IAAqB,KAAKH,KAAhC;;IACA,IAAIE,MAAM,KAAKM,SAAS,CAACN,MAAzB,EAAiC;MAC/BE,iBAAiB;MACjBX,WAAW,CAACY,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,cAA3C,EAA2DC,MAA3D;IACD;;IACD,IAAIC,MAAM,KAAKK,SAAS,CAACL,MAAzB,EAAiC;MAC/BC,iBAAiB;MACjBX,WAAW,CAACY,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,QAA3C,EAAqDE,MAArD;IACD;EACF;EAED;AACF;AACA;AACA;AACA;;;EACSM,iBAAiB,CAACC,IAAD,EAAgB;IACtCN,iBAAiB;IACjB,OAAOX,WAAW,CAACgB,iBAAZ,CAA8B,KAAKR,SAAnC,EAA8CS,IAA9C,CAAP;EACD;EAED;AACF;AACA;;;EACSC,MAAM,GAAG;IACdP,iBAAiB;IACjBX,WAAW,CAACmB,aAAZ,CAA0B,KAAKX,SAA/B;EACD;EAED;AACF;AACA;AACA;AACA;;;EACSY,cAAc,CAACC,MAAD,EAA2C;IAC9DV,iBAAiB;IACjB,OAAOX,WAAW,CAACsB,oBAAZ,CAAiC,KAAKd,SAAtC,EAAiDa,MAAjD,CAAP;EACD;;EAEDE,MAAM,GAAG;IACP,MAAM;MAAEC,IAAF;MAAQC,KAAK,GAAG,KAAhB;MAAuBf,MAAvB;MAA+B,GAAGgB;IAAlC,IAAgD,KAAKnB,KAA3D;IACA,oBACE,oBAAC,cAAD;MACE,WAAW,EAAE,KADf;MAEE,QAAQ,EAAG,GAAE,KAAKC,SAAU,EAF9B;MAGE,IAAI,EAAEgB,IAAF,aAAEA,IAAF,cAAEA,IAAF,GAAU,SAHhB;MAIE,KAAK,EAAEC;IAJT,GAKMC,SALN,EADF;EASD;;AAxE8D;;AA2EjE,MAAMf,iBAAiB,GAAG,MAAM;EAC9B,IACEX,WAAW,KAAK,IAAhB,IACAA,WAAW,CAACY,cAAZ,KAA+B,IAD/B,IAEAZ,WAAW,CAAC2B,aAAZ,KAA8B,IAF9B,IAGA3B,WAAW,CAACsB,oBAAZ,KAAqC,IAHrC,IAIAtB,WAAW,CAACmB,aAAZ,KAA8B,IAJ9B,IAKAnB,WAAW,CAACgB,iBAAZ,KAAkC,IANpC,EAOE;IACA,MAAMY,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAXD"}
1
+ {"version":3,"names":["React","SkiaDrawViewNativeComponent","SkiaViewApi","SkiaViewNativeId","current","NativeSkiaView","SkiaView","Component","constructor","props","console","warn","_nativeId","onDraw","onSize","assertSkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport SkiaDrawViewNativeComponent from \"../specs/SkiaDrawViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaDrawViewProps } from \"./types\";\n\nexport const SkiaViewNativeId = { current: 1000 };\n\nconst NativeSkiaView = SkiaDrawViewNativeComponent;\n\n/**\n * @deprecated If you are looking to use the Skia imperative API, you can use:\n * The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/\n * The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures\n */\nexport class SkiaView extends React.Component<SkiaDrawViewProps> {\n constructor(props: SkiaDrawViewProps) {\n super(props);\n console.warn(\n `The SkiaView component is deprecated and will be removed in the next release.\nIf you are looking to use the Skia imperative API, you can use:\n* The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/\n* The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures`\n );\n this._nativeId = SkiaViewNativeId.current++;\n const { onDraw, onSize } = props;\n if (onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaDrawViewProps) {\n const { onDraw, onSize } = this.props;\n if (onDraw !== prevProps.onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, onSize, ...viewProps } = this.props;\n return (\n <NativeSkiaView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode ?? \"default\"}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAIA,OAAOC,2BAAP,MAAwC,sCAAxC;AAEA,SAASC,WAAT,QAA4B,OAA5B;AAGA,OAAO,MAAMC,gBAAgB,GAAG;EAAEC,OAAO,EAAE;AAAX,CAAzB;AAEP,MAAMC,cAAc,GAAGJ,2BAAvB;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMK,QAAN,SAAuBN,KAAK,CAACO,SAA7B,CAA0D;EAC/DC,WAAW,CAACC,KAAD,EAA2B;IACpC,MAAMA,KAAN;;IADoC;;IAEpCC,OAAO,CAACC,IAAR,CACG;AACP;AACA;AACA,0FAJI;IAMA,KAAKC,SAAL,GAAiBT,gBAAgB,CAACC,OAAjB,EAAjB;IACA,MAAM;MAAES,MAAF;MAAUC;IAAV,IAAqBL,KAA3B;;IACA,IAAII,MAAJ,EAAY;MACVE,iBAAiB;MACjBb,WAAW,CAACc,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,cAA3C,EAA2DC,MAA3D;IACD;;IACD,IAAIC,MAAJ,EAAY;MACVC,iBAAiB;MACjBb,WAAW,CAACc,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,QAA3C,EAAqDE,MAArD;IACD;EACF;;EAIkB,IAARG,QAAQ,GAAG;IACpB,OAAO,KAAKL,SAAZ;EACD;;EAEDM,kBAAkB,CAACC,SAAD,EAA+B;IAC/C,MAAM;MAAEN,MAAF;MAAUC;IAAV,IAAqB,KAAKL,KAAhC;;IACA,IAAII,MAAM,KAAKM,SAAS,CAACN,MAAzB,EAAiC;MAC/BE,iBAAiB;MACjBb,WAAW,CAACc,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,cAA3C,EAA2DC,MAA3D;IACD;;IACD,IAAIC,MAAM,KAAKK,SAAS,CAACL,MAAzB,EAAiC;MAC/BC,iBAAiB;MACjBb,WAAW,CAACc,cAAZ,CAA2B,KAAKJ,SAAhC,EAA2C,QAA3C,EAAqDE,MAArD;IACD;EACF;EAED;AACF;AACA;AACA;AACA;;;EACSM,iBAAiB,CAACC,IAAD,EAAgB;IACtCN,iBAAiB;IACjB,OAAOb,WAAW,CAACkB,iBAAZ,CAA8B,KAAKR,SAAnC,EAA8CS,IAA9C,CAAP;EACD;EAED;AACF;AACA;;;EACSC,MAAM,GAAG;IACdP,iBAAiB;IACjBb,WAAW,CAACqB,aAAZ,CAA0B,KAAKX,SAA/B;EACD;EAED;AACF;AACA;AACA;AACA;;;EACSY,cAAc,CAACC,MAAD,EAA2C;IAC9DV,iBAAiB;IACjB,OAAOb,WAAW,CAACwB,oBAAZ,CAAiC,KAAKd,SAAtC,EAAiDa,MAAjD,CAAP;EACD;;EAEDE,MAAM,GAAG;IACP,MAAM;MAAEC,IAAF;MAAQC,KAAK,GAAG,KAAhB;MAAuBf,MAAvB;MAA+B,GAAGgB;IAAlC,IAAgD,KAAKrB,KAA3D;IACA,oBACE,oBAAC,cAAD;MACE,WAAW,EAAE,KADf;MAEE,QAAQ,EAAG,GAAE,KAAKG,SAAU,EAF9B;MAGE,IAAI,EAAEgB,IAAF,aAAEA,IAAF,cAAEA,IAAF,GAAU,SAHhB;MAIE,KAAK,EAAEC;IAJT,GAKMC,SALN,EADF;EASD;;AA9E8D;;AAiFjE,MAAMf,iBAAiB,GAAG,MAAM;EAC9B,IACEb,WAAW,KAAK,IAAhB,IACAA,WAAW,CAACc,cAAZ,KAA+B,IAD/B,IAEAd,WAAW,CAAC6B,aAAZ,KAA8B,IAF9B,IAGA7B,WAAW,CAACwB,oBAAZ,KAAqC,IAHrC,IAIAxB,WAAW,CAACqB,aAAZ,KAA8B,IAJ9B,IAKArB,WAAW,CAACkB,iBAAZ,KAAkC,IANpC,EAOE;IACA,MAAMY,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAXD"}
@@ -1,6 +1,9 @@
1
1
  import type { SkiaMutableValue, SkiaAnimation } from "../../values/types";
2
2
  import type { AnimationParams, SpringConfig, AnimationCallback } from "../types";
3
3
  /**
4
+ * @deprecated Use Reanimated 3 for animations:
5
+ * https://shopify.github.io/react-native-skia/docs/animations/animations
6
+ *
4
7
  * Creates a new animation on an existing value that will be driven by
5
8
  * an animation value. The value will be run from / to the value in
6
9
  * params and modified by the provided easing curve for the length of
@@ -1,6 +1,9 @@
1
1
  import type { SkiaValue } from "../../values/types";
2
2
  import type { SpringConfig, AnimationParams, AnimationCallback } from "../types";
3
3
  /**
4
+ * @deprecated Use Reanimated 3 for animations:
5
+ * https://shopify.github.io/react-native-skia/docs/animations/animations
6
+ *
4
7
  * Creats a spring based animation value that will run whenever
5
8
  * the animation parameters change.
6
9
  * @param toOrParams
@@ -1,6 +1,9 @@
1
1
  import type { SkiaMutableValue, SkiaAnimation } from "../../values/types";
2
2
  import type { AnimationParams, TimingConfig, AnimationCallback } from "../types";
3
3
  /**
4
+ * @deprecated Use Reanimated 3 for animations:
5
+ * https://shopify.github.io/react-native-skia/docs/animations/animations
6
+ *
4
7
  * Creates a new animation on an existing value that will be driven by
5
8
  * an animation value. The value will be run from / to the value in
6
9
  * params and modified by the provided easing curve for the length of
@@ -1,5 +1,8 @@
1
1
  import type { TimingConfig } from "../types";
2
2
  /**
3
+ * @deprecated Use Reanimated 3 for animations:
4
+ * https://shopify.github.io/react-native-skia/docs/animations/animations
5
+ *
3
6
  * Configures a looped timing value. The value will go back and forth
4
7
  * between 0 and 1 and back.
5
8
  * @param config Timing configuration for easing and duration
@@ -1,6 +1,9 @@
1
1
  import type { SkiaValue } from "../../values/types";
2
2
  import type { AnimationParams, TimingConfig, AnimationCallback } from "../types";
3
3
  /**
4
+ * @deprecated Use Reanimated 3 for animations:
5
+ * https://shopify.github.io/react-native-skia/docs/animations/animations
6
+ *
4
7
  * Creats an animation value that will run whenever
5
8
  * the animation parameters change. The animation start immediately.
6
9
  * @param toOrParams
@@ -8,14 +8,14 @@ export declare const size: (width?: number, height?: number) => {
8
8
  width: number;
9
9
  height: number;
10
10
  };
11
- export declare const rect2rect: (src: SkRect, dst: SkRect) => readonly [{
12
- readonly translateX: number;
11
+ export declare const rect2rect: (src: SkRect, dst: SkRect) => [{
12
+ translateX: number;
13
13
  }, {
14
- readonly translateY: number;
14
+ translateY: number;
15
15
  }, {
16
- readonly scaleX: number;
16
+ scaleX: number;
17
17
  }, {
18
- readonly scaleY: number;
18
+ scaleY: number;
19
19
  }];
20
20
  export declare const fitRects: (fit: Fit, rect: SkRect, { x, y, width, height }: SkRect) => {
21
21
  src: {
@@ -1,87 +1,247 @@
1
- import type { Skia, SkRect, Transforms2d, Vector } from "../../../skia/types";
1
+ import type { Skia, SkRect, Transforms3d, Vector } from "../../../skia/types";
2
2
  import { TileMode } from "../../../skia/types";
3
3
  import type { GradientProps, ImageShaderProps } from "../../types";
4
- export declare const transformOrigin: (origin: Vector, transform: Transforms2d) => (Pick<{
5
- readonly translateX: number;
6
- readonly translateY: number;
7
- readonly scale: number;
8
- readonly skewX: number;
9
- readonly skewY: number;
10
- readonly scaleX: number;
11
- readonly scaleY: number;
12
- readonly rotateZ: number;
13
- readonly rotate: number;
4
+ export declare const transformOrigin: (origin: Vector, transform: Transforms3d) => (Pick<{
5
+ translateX: number;
6
+ translateY: number;
7
+ translateZ: number;
8
+ translate: readonly [number, number] | readonly [number, number, number];
9
+ scale: number;
10
+ scaleX: number;
11
+ scaleY: number;
12
+ skewX: number;
13
+ skewY: number;
14
+ rotateZ: number;
15
+ rotate: number;
16
+ perspective: number;
17
+ rotateX: number;
18
+ rotateY: number;
19
+ matrix: import("../../../skia/types").Matrix4;
14
20
  }, "translateX"> | Pick<{
15
- readonly translateX: number;
16
- readonly translateY: number;
17
- readonly scale: number;
18
- readonly skewX: number;
19
- readonly skewY: number;
20
- readonly scaleX: number;
21
- readonly scaleY: number;
22
- readonly rotateZ: number;
23
- readonly rotate: number;
21
+ translateX: number;
22
+ translateY: number;
23
+ translateZ: number;
24
+ translate: readonly [number, number] | readonly [number, number, number];
25
+ scale: number;
26
+ scaleX: number;
27
+ scaleY: number;
28
+ skewX: number;
29
+ skewY: number;
30
+ rotateZ: number;
31
+ rotate: number;
32
+ perspective: number;
33
+ rotateX: number;
34
+ rotateY: number;
35
+ matrix: import("../../../skia/types").Matrix4;
24
36
  }, "translateY"> | Pick<{
25
- readonly translateX: number;
26
- readonly translateY: number;
27
- readonly scale: number;
28
- readonly skewX: number;
29
- readonly skewY: number;
30
- readonly scaleX: number;
31
- readonly scaleY: number;
32
- readonly rotateZ: number;
33
- readonly rotate: number;
37
+ translateX: number;
38
+ translateY: number;
39
+ translateZ: number;
40
+ translate: readonly [number, number] | readonly [number, number, number];
41
+ scale: number;
42
+ scaleX: number;
43
+ scaleY: number;
44
+ skewX: number;
45
+ skewY: number;
46
+ rotateZ: number;
47
+ rotate: number;
48
+ perspective: number;
49
+ rotateX: number;
50
+ rotateY: number;
51
+ matrix: import("../../../skia/types").Matrix4;
52
+ }, "translateZ"> | Pick<{
53
+ translateX: number;
54
+ translateY: number;
55
+ translateZ: number;
56
+ translate: readonly [number, number] | readonly [number, number, number];
57
+ scale: number;
58
+ scaleX: number;
59
+ scaleY: number;
60
+ skewX: number;
61
+ skewY: number;
62
+ rotateZ: number;
63
+ rotate: number;
64
+ perspective: number;
65
+ rotateX: number;
66
+ rotateY: number;
67
+ matrix: import("../../../skia/types").Matrix4;
68
+ }, "translate"> | Pick<{
69
+ translateX: number;
70
+ translateY: number;
71
+ translateZ: number;
72
+ translate: readonly [number, number] | readonly [number, number, number];
73
+ scale: number;
74
+ scaleX: number;
75
+ scaleY: number;
76
+ skewX: number;
77
+ skewY: number;
78
+ rotateZ: number;
79
+ rotate: number;
80
+ perspective: number;
81
+ rotateX: number;
82
+ rotateY: number;
83
+ matrix: import("../../../skia/types").Matrix4;
34
84
  }, "scale"> | Pick<{
35
- readonly translateX: number;
36
- readonly translateY: number;
37
- readonly scale: number;
38
- readonly skewX: number;
39
- readonly skewY: number;
40
- readonly scaleX: number;
41
- readonly scaleY: number;
42
- readonly rotateZ: number;
43
- readonly rotate: number;
85
+ translateX: number;
86
+ translateY: number;
87
+ translateZ: number;
88
+ translate: readonly [number, number] | readonly [number, number, number];
89
+ scale: number;
90
+ scaleX: number;
91
+ scaleY: number;
92
+ skewX: number;
93
+ skewY: number;
94
+ rotateZ: number;
95
+ rotate: number;
96
+ perspective: number;
97
+ rotateX: number;
98
+ rotateY: number;
99
+ matrix: import("../../../skia/types").Matrix4;
44
100
  }, "scaleX"> | Pick<{
45
- readonly translateX: number;
46
- readonly translateY: number;
47
- readonly scale: number;
48
- readonly skewX: number;
49
- readonly skewY: number;
50
- readonly scaleX: number;
51
- readonly scaleY: number;
52
- readonly rotateZ: number;
53
- readonly rotate: number;
101
+ translateX: number;
102
+ translateY: number;
103
+ translateZ: number;
104
+ translate: readonly [number, number] | readonly [number, number, number];
105
+ scale: number;
106
+ scaleX: number;
107
+ scaleY: number;
108
+ skewX: number;
109
+ skewY: number;
110
+ rotateZ: number;
111
+ rotate: number;
112
+ perspective: number;
113
+ rotateX: number;
114
+ rotateY: number;
115
+ matrix: import("../../../skia/types").Matrix4;
54
116
  }, "scaleY"> | Pick<{
55
- readonly translateX: number;
56
- readonly translateY: number;
57
- readonly scale: number;
58
- readonly skewX: number;
59
- readonly skewY: number;
60
- readonly scaleX: number;
61
- readonly scaleY: number;
62
- readonly rotateZ: number;
63
- readonly rotate: number;
117
+ translateX: number;
118
+ translateY: number;
119
+ translateZ: number;
120
+ translate: readonly [number, number] | readonly [number, number, number];
121
+ scale: number;
122
+ scaleX: number;
123
+ scaleY: number;
124
+ skewX: number;
125
+ skewY: number;
126
+ rotateZ: number;
127
+ rotate: number;
128
+ perspective: number;
129
+ rotateX: number;
130
+ rotateY: number;
131
+ matrix: import("../../../skia/types").Matrix4;
64
132
  }, "skewX"> | Pick<{
65
- readonly translateX: number;
66
- readonly translateY: number;
67
- readonly scale: number;
68
- readonly skewX: number;
69
- readonly skewY: number;
70
- readonly scaleX: number;
71
- readonly scaleY: number;
72
- readonly rotateZ: number;
73
- readonly rotate: number;
133
+ translateX: number;
134
+ translateY: number;
135
+ translateZ: number;
136
+ translate: readonly [number, number] | readonly [number, number, number];
137
+ scale: number;
138
+ scaleX: number;
139
+ scaleY: number;
140
+ skewX: number;
141
+ skewY: number;
142
+ rotateZ: number;
143
+ rotate: number;
144
+ perspective: number;
145
+ rotateX: number;
146
+ rotateY: number;
147
+ matrix: import("../../../skia/types").Matrix4;
74
148
  }, "skewY"> | Pick<{
75
- readonly translateX: number;
76
- readonly translateY: number;
77
- readonly scale: number;
78
- readonly skewX: number;
79
- readonly skewY: number;
80
- readonly scaleX: number;
81
- readonly scaleY: number;
82
- readonly rotateZ: number;
83
- readonly rotate: number;
84
- }, "rotate">)[];
149
+ translateX: number;
150
+ translateY: number;
151
+ translateZ: number;
152
+ translate: readonly [number, number] | readonly [number, number, number];
153
+ scale: number;
154
+ scaleX: number;
155
+ scaleY: number;
156
+ skewX: number;
157
+ skewY: number;
158
+ rotateZ: number;
159
+ rotate: number;
160
+ perspective: number;
161
+ rotateX: number;
162
+ rotateY: number;
163
+ matrix: import("../../../skia/types").Matrix4;
164
+ }, "perspective"> | Pick<{
165
+ translateX: number;
166
+ translateY: number;
167
+ translateZ: number;
168
+ translate: readonly [number, number] | readonly [number, number, number];
169
+ scale: number;
170
+ scaleX: number;
171
+ scaleY: number;
172
+ skewX: number;
173
+ skewY: number;
174
+ rotateZ: number;
175
+ rotate: number;
176
+ perspective: number;
177
+ rotateX: number;
178
+ rotateY: number;
179
+ matrix: import("../../../skia/types").Matrix4;
180
+ }, "rotateX"> | Pick<{
181
+ translateX: number;
182
+ translateY: number;
183
+ translateZ: number;
184
+ translate: readonly [number, number] | readonly [number, number, number];
185
+ scale: number;
186
+ scaleX: number;
187
+ scaleY: number;
188
+ skewX: number;
189
+ skewY: number;
190
+ rotateZ: number;
191
+ rotate: number;
192
+ perspective: number;
193
+ rotateX: number;
194
+ rotateY: number;
195
+ matrix: import("../../../skia/types").Matrix4;
196
+ }, "rotateY"> | Pick<{
197
+ translateX: number;
198
+ translateY: number;
199
+ translateZ: number;
200
+ translate: readonly [number, number] | readonly [number, number, number];
201
+ scale: number;
202
+ scaleX: number;
203
+ scaleY: number;
204
+ skewX: number;
205
+ skewY: number;
206
+ rotateZ: number;
207
+ rotate: number;
208
+ perspective: number;
209
+ rotateX: number;
210
+ rotateY: number;
211
+ matrix: import("../../../skia/types").Matrix4;
212
+ }, "rotateZ"> | Pick<{
213
+ translateX: number;
214
+ translateY: number;
215
+ translateZ: number;
216
+ translate: readonly [number, number] | readonly [number, number, number];
217
+ scale: number;
218
+ scaleX: number;
219
+ scaleY: number;
220
+ skewX: number;
221
+ skewY: number;
222
+ rotateZ: number;
223
+ rotate: number;
224
+ perspective: number;
225
+ rotateX: number;
226
+ rotateY: number;
227
+ matrix: import("../../../skia/types").Matrix4;
228
+ }, "rotate"> | Pick<{
229
+ translateX: number;
230
+ translateY: number;
231
+ translateZ: number;
232
+ translate: readonly [number, number] | readonly [number, number, number];
233
+ scale: number;
234
+ scaleX: number;
235
+ scaleY: number;
236
+ skewX: number;
237
+ skewY: number;
238
+ rotateZ: number;
239
+ rotate: number;
240
+ perspective: number;
241
+ rotateX: number;
242
+ rotateY: number;
243
+ matrix: import("../../../skia/types").Matrix4;
244
+ }, "matrix">)[];
85
245
  export declare const processGradientProps: (Skia: Skia, { colors, positions, mode, flags, ...transform }: GradientProps) => {
86
246
  colors: Float32Array[];
87
247
  positions: number[] | null;
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
- import type { BlendMode, Color, PaintStyle, SkMatrix, SkPaint, SkPath, SkRect, SkRRect, StrokeCap, StrokeJoin, Transforms2d, Vector } from "../../skia/types";
2
+ import type { BlendMode, Color, PaintStyle, SkMatrix, SkPaint, SkPath, SkRect, SkRRect, StrokeCap, StrokeJoin, Transforms3d, Vector } from "../../skia/types";
3
3
  export type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;
4
4
  export type PathDef = string | SkPath;
5
5
  export type ClipDef = SkRRect | SkRect | PathDef;
@@ -34,9 +34,9 @@ export interface ScalarCircleDef {
34
34
  }
35
35
  export type CircleDef = PointCircleDef | ScalarCircleDef;
36
36
  export interface TransformProps {
37
- transform?: Transforms2d;
37
+ transform?: Transforms3d;
38
38
  origin?: Vector;
39
- matrix?: SkMatrix;
39
+ matrix?: SkMatrix | number[];
40
40
  }
41
41
  export interface PaintProps extends ChildrenProps {
42
42
  color?: Color;
@@ -1,3 +1,8 @@
1
1
  import React from "react";
2
2
  import type { CustomDrawingNodeProps } from "../../dom/types";
3
+ /**
4
+ * @deprecated If you are looking to use the Skia imperative API, you can use:
5
+ * The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
6
+ * The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures
7
+ */
3
8
  export declare const Drawing: (props: CustomDrawingNodeProps) => React.JSX.Element;
@@ -8,14 +8,14 @@ interface FitProps {
8
8
  dst: SkRect;
9
9
  children: ReactNode | ReactNode[];
10
10
  }
11
- export declare const fitbox: (fit: Fit, src: SkRect, dst: SkRect) => readonly [{
12
- readonly translateX: number;
11
+ export declare const fitbox: (fit: Fit, src: SkRect, dst: SkRect) => [{
12
+ translateX: number;
13
13
  }, {
14
- readonly translateY: number;
14
+ translateY: number;
15
15
  }, {
16
- readonly scaleX: number;
16
+ scaleX: number;
17
17
  }, {
18
- readonly scaleY: number;
18
+ scaleY: number;
19
19
  }];
20
20
  export declare const FitBox: ({ fit, src, dst, children }: FitProps) => React.JSX.Element;
21
21
  export {};