@shopify/react-native-skia 0.1.124 → 0.1.127
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +3 -0
- package/android/build.gradle +1 -1
- package/cpp/api/JsiSkApi.h +3 -1
- package/cpp/api/JsiSkCanvas.h +1 -1
- package/cpp/api/JsiSkColor.h +41 -7
- package/cpp/api/JsiSkColorFilterFactory.h +2 -1
- package/cpp/api/JsiSkImageFilter.h +0 -2
- package/cpp/api/JsiSkImageFilterFactory.h +37 -17
- package/cpp/api/JsiSkMatrix.h +44 -2
- package/cpp/api/JsiSkPaint.h +4 -7
- package/cpp/api/JsiSkRuntimeEffect.h +7 -0
- package/cpp/api/JsiSkRuntimeEffectFactory.h +3 -2
- package/cpp/api/JsiSkRuntimeShaderBuilder.h +70 -0
- package/cpp/api/JsiSkShaderFactory.h +2 -2
- package/cpp/api/JsiSkVertices.h +1 -1
- package/cpp/api/third_party/CSSColorParser.cpp +194 -0
- package/cpp/api/third_party/CSSColorParser.h +1 -191
- package/cpp/jsi/JsiSimpleValueWrapper.h +108 -0
- package/cpp/rnskia/values/RNSkReadonlyValue.h +13 -12
- package/ios/RNSkia-iOS/PlatformContext.h +30 -4
- package/ios/RNSkia-iOS/SkiaDrawView.mm +9 -12
- package/lib/commonjs/{values/animation → animation}/decay/decay.js +0 -0
- package/lib/commonjs/{values/animation → animation}/decay/decay.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/decay/index.js +0 -0
- package/lib/commonjs/{values/animation → animation}/decay/index.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/decay/runDecay.js +1 -1
- package/lib/commonjs/animation/decay/runDecay.js.map +1 -0
- package/lib/commonjs/{values/animation → animation}/decay/types.js +0 -0
- package/lib/commonjs/{values/animation → animation}/decay/types.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/functions/index.js +0 -0
- package/lib/commonjs/{values/animation → animation}/functions/index.js.map +0 -0
- package/lib/commonjs/animation/functions/interpolate.js +141 -0
- package/lib/commonjs/animation/functions/interpolate.js.map +1 -0
- package/lib/commonjs/animation/functions/interpolateColors.js +39 -0
- package/lib/commonjs/animation/functions/interpolateColors.js.map +1 -0
- package/lib/commonjs/{values/animation → animation}/index.js +0 -0
- package/lib/commonjs/{values/animation → animation}/index.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/spring/Spring.js +0 -0
- package/lib/commonjs/{values/animation → animation}/spring/Spring.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/spring/functions/index.js +0 -0
- package/lib/commonjs/{values/animation → animation}/spring/functions/index.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/spring/functions/spring.js +0 -0
- package/lib/commonjs/{values/animation → animation}/spring/functions/spring.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/spring/index.js +0 -0
- package/lib/commonjs/{values/animation → animation}/spring/index.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/spring/runSpring.js +0 -0
- package/lib/commonjs/animation/spring/runSpring.js.map +1 -0
- package/lib/commonjs/{values/animation → animation}/spring/types.js +0 -0
- package/lib/commonjs/{values/animation → animation}/spring/types.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/spring/useSpring.js +0 -0
- package/lib/commonjs/animation/spring/useSpring.js.map +1 -0
- package/lib/commonjs/{values/animation → animation}/timing/Easing.js +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/Easing.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/createTiming.js +1 -1
- package/lib/commonjs/animation/timing/createTiming.js.map +1 -0
- package/lib/commonjs/{values/animation → animation}/timing/functions/bezier.js +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/functions/bezier.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/functions/getResolvedParams.js +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/functions/getResolvedParams.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/functions/index.js +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/functions/index.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/functions/timing.js +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/functions/timing.js.map +1 -1
- package/lib/commonjs/{values/animation → animation}/timing/functions/types.js +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/functions/types.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/index.js +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/index.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/runTiming.js +0 -0
- package/lib/commonjs/animation/timing/runTiming.js.map +1 -0
- package/lib/commonjs/{values/animation → animation}/timing/useLoop.js +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/useLoop.js.map +0 -0
- package/lib/commonjs/{values/animation → animation}/timing/useTiming.js +1 -1
- package/lib/commonjs/animation/timing/useTiming.js.map +1 -0
- package/lib/commonjs/{values/animation → animation}/types.js +0 -0
- package/lib/commonjs/{values/animation → animation}/types.js.map +0 -0
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +4 -2
- package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js +37 -0
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -0
- package/lib/commonjs/renderer/components/imageFilters/index.js +13 -0
- package/lib/commonjs/renderer/components/imageFilters/index.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Gradient.js +1 -1
- package/lib/commonjs/renderer/components/shaders/Gradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/commonjs/renderer/processors/Rects.js +5 -15
- package/lib/commonjs/renderer/processors/Rects.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Matrix3.js +42 -63
- package/lib/commonjs/renderer/processors/math/Matrix3.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Vector.js +4 -5
- package/lib/commonjs/renderer/processors/math/Vector.js.map +1 -1
- package/lib/commonjs/skia/Color.js +14 -38
- package/lib/commonjs/skia/Color.js.map +1 -1
- package/lib/commonjs/skia/ImageFilter/ImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/Matrix.js.map +1 -1
- package/lib/commonjs/skia/Shader/useShader.js +4 -1
- package/lib/commonjs/skia/Shader/useShader.js.map +1 -1
- package/lib/commonjs/skia/Skia.js +3 -45
- package/lib/commonjs/skia/Skia.js.map +1 -1
- package/lib/commonjs/skia/SkiaApi.js +4 -0
- package/lib/commonjs/skia/SkiaApi.js.map +1 -0
- package/lib/commonjs/values/api.js +4 -6
- package/lib/commonjs/values/api.js.map +1 -1
- package/lib/commonjs/values/api.web.js +18 -0
- package/lib/commonjs/values/api.web.js.map +1 -0
- package/lib/commonjs/values/index.js +0 -13
- package/lib/commonjs/values/index.js.map +1 -1
- package/lib/commonjs/values/web/RNSkAnimation.js +46 -0
- package/lib/commonjs/values/web/RNSkAnimation.js.map +1 -0
- package/lib/commonjs/values/web/RNSkClockValue.js +75 -0
- package/lib/commonjs/values/web/RNSkClockValue.js.map +1 -0
- package/lib/commonjs/values/web/RNSkDerivedValue.js +51 -0
- package/lib/commonjs/values/web/RNSkDerivedValue.js.map +1 -0
- package/lib/commonjs/values/web/RNSkReadonlyValue.js +45 -0
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -0
- package/lib/commonjs/values/web/RNSkValue.js +73 -0
- package/lib/commonjs/values/web/RNSkValue.js.map +1 -0
- package/lib/commonjs/values/web/api.js +31 -0
- package/lib/commonjs/values/web/api.js.map +1 -0
- package/lib/commonjs/values/web/index.js +19 -0
- package/lib/commonjs/values/web/index.js.map +1 -0
- package/lib/commonjs/views/SkiaView.js +13 -10
- package/lib/commonjs/views/SkiaView.js.map +1 -1
- package/lib/commonjs/views/api.js +11 -0
- package/lib/commonjs/views/api.js.map +1 -0
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/{values/animation → animation}/decay/decay.js +0 -0
- package/lib/module/{values/animation → animation}/decay/decay.js.map +0 -0
- package/lib/module/{values/animation → animation}/decay/index.js +0 -0
- package/lib/module/{values/animation → animation}/decay/index.js.map +0 -0
- package/lib/module/{values/animation → animation}/decay/runDecay.js +1 -1
- package/lib/module/animation/decay/runDecay.js.map +1 -0
- package/lib/module/{values/animation → animation}/decay/types.js +0 -0
- package/lib/module/{values/animation → animation}/decay/types.js.map +0 -0
- package/lib/module/{values/animation → animation}/functions/index.js +0 -0
- package/lib/module/{values/animation → animation}/functions/index.js.map +0 -0
- package/lib/module/animation/functions/interpolate.js +132 -0
- package/lib/module/animation/functions/interpolate.js.map +1 -0
- package/lib/module/animation/functions/interpolateColors.js +23 -0
- package/lib/module/animation/functions/interpolateColors.js.map +1 -0
- package/lib/module/{values/animation → animation}/index.js +0 -0
- package/lib/module/{values/animation → animation}/index.js.map +0 -0
- package/lib/module/{values/animation → animation}/spring/Spring.js +0 -0
- package/lib/module/{values/animation → animation}/spring/Spring.js.map +0 -0
- package/lib/module/{values/animation → animation}/spring/functions/index.js +0 -0
- package/lib/module/{values/animation → animation}/spring/functions/index.js.map +0 -0
- package/lib/module/{values/animation → animation}/spring/functions/spring.js +0 -0
- package/lib/module/{values/animation → animation}/spring/functions/spring.js.map +0 -0
- package/lib/module/{values/animation → animation}/spring/index.js +0 -0
- package/lib/module/{values/animation → animation}/spring/index.js.map +0 -0
- package/lib/module/{values/animation → animation}/spring/runSpring.js +0 -0
- package/lib/module/animation/spring/runSpring.js.map +1 -0
- package/lib/module/{values/animation → animation}/spring/types.js +0 -0
- package/lib/module/{values/animation → animation}/spring/types.js.map +0 -0
- package/lib/module/{values/animation → animation}/spring/useSpring.js +0 -0
- package/lib/module/animation/spring/useSpring.js.map +1 -0
- package/lib/module/{values/animation → animation}/timing/Easing.js +0 -0
- package/lib/module/{values/animation → animation}/timing/Easing.js.map +0 -0
- package/lib/module/{values/animation → animation}/timing/createTiming.js +1 -1
- package/lib/module/animation/timing/createTiming.js.map +1 -0
- package/lib/module/{values/animation → animation}/timing/functions/bezier.js +0 -0
- package/lib/module/{values/animation → animation}/timing/functions/bezier.js.map +0 -0
- package/lib/module/{values/animation → animation}/timing/functions/getResolvedParams.js +0 -0
- package/lib/module/{values/animation → animation}/timing/functions/getResolvedParams.js.map +0 -0
- package/lib/module/{values/animation → animation}/timing/functions/index.js +0 -0
- package/lib/module/{values/animation → animation}/timing/functions/index.js.map +0 -0
- package/lib/module/{values/animation → animation}/timing/functions/timing.js +0 -0
- package/lib/module/{values/animation → animation}/timing/functions/timing.js.map +1 -1
- package/lib/module/{values/animation → animation}/timing/functions/types.js +0 -0
- package/lib/module/{values/animation → animation}/timing/functions/types.js.map +0 -0
- package/lib/module/{values/animation → animation}/timing/index.js +0 -0
- package/lib/module/{values/animation → animation}/timing/index.js.map +0 -0
- package/lib/module/{values/animation → animation}/timing/runTiming.js +0 -0
- package/lib/module/animation/timing/runTiming.js.map +1 -0
- package/lib/module/{values/animation → animation}/timing/useLoop.js +0 -0
- package/lib/module/{values/animation → animation}/timing/useLoop.js.map +0 -0
- package/lib/module/{values/animation → animation}/timing/useTiming.js +1 -1
- package/lib/module/animation/timing/useTiming.js.map +1 -0
- package/lib/module/{values/animation → animation}/types.js +0 -0
- package/lib/module/{values/animation → animation}/types.js.map +0 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/InnerShadow.js +3 -2
- package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js +19 -0
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -0
- package/lib/module/renderer/components/imageFilters/index.js +1 -0
- package/lib/module/renderer/components/imageFilters/index.js.map +1 -1
- package/lib/module/renderer/components/shaders/Gradient.js +2 -2
- package/lib/module/renderer/components/shaders/Gradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/processors/Rects.js +4 -15
- package/lib/module/renderer/processors/Rects.js.map +1 -1
- package/lib/module/renderer/processors/math/Matrix3.js +52 -72
- package/lib/module/renderer/processors/math/Matrix3.js.map +1 -1
- package/lib/module/renderer/processors/math/Vector.js +3 -5
- package/lib/module/renderer/processors/math/Vector.js.map +1 -1
- package/lib/module/skia/Color.js +9 -25
- package/lib/module/skia/Color.js.map +1 -1
- package/lib/module/skia/ImageFilter/ImageFilterFactory.js.map +1 -1
- package/lib/module/skia/Matrix.js.map +1 -1
- package/lib/module/skia/Shader/useShader.js +4 -1
- package/lib/module/skia/Shader/useShader.js.map +1 -1
- package/lib/module/skia/Skia.js +2 -46
- package/lib/module/skia/Skia.js.map +1 -1
- package/lib/module/skia/SkiaApi.js +2 -0
- package/lib/module/skia/SkiaApi.js.map +1 -0
- package/lib/module/values/api.js +4 -6
- package/lib/module/values/api.js.map +1 -1
- package/lib/module/values/api.web.js +7 -0
- package/lib/module/values/api.web.js.map +1 -0
- package/lib/module/values/index.js +0 -1
- package/lib/module/values/index.js.map +1 -1
- package/lib/module/values/web/RNSkAnimation.js +36 -0
- package/lib/module/values/web/RNSkAnimation.js.map +1 -0
- package/lib/module/values/web/RNSkClockValue.js +65 -0
- package/lib/module/values/web/RNSkClockValue.js.map +1 -0
- package/lib/module/values/web/RNSkDerivedValue.js +41 -0
- package/lib/module/values/web/RNSkDerivedValue.js.map +1 -0
- package/lib/module/values/web/RNSkReadonlyValue.js +36 -0
- package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -0
- package/lib/module/values/web/RNSkValue.js +63 -0
- package/lib/module/values/web/RNSkValue.js.map +1 -0
- package/lib/module/values/web/api.js +19 -0
- package/lib/module/values/web/api.js.map +1 -0
- package/lib/module/values/web/index.js +2 -0
- package/lib/module/values/web/index.js.map +1 -0
- package/lib/module/views/SkiaView.js +1 -3
- package/lib/module/views/SkiaView.js.map +1 -1
- package/lib/module/views/api.js +4 -0
- package/lib/module/views/api.js.map +1 -0
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/src/{values/animation → animation}/decay/decay.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/decay/index.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/decay/runDecay.d.ts +2 -2
- package/lib/typescript/src/{values/animation → animation}/decay/types.d.ts +1 -1
- package/lib/typescript/src/{values/animation → animation}/functions/index.d.ts +0 -0
- package/lib/typescript/src/animation/functions/interpolate.d.ts +11 -0
- package/lib/typescript/src/animation/functions/interpolateColors.d.ts +3 -0
- package/lib/typescript/src/{values/animation → animation}/index.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/spring/Spring.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/spring/functions/index.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/spring/functions/spring.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/spring/index.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/spring/runSpring.d.ts +1 -1
- package/lib/typescript/src/{values/animation → animation}/spring/types.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/spring/useSpring.d.ts +1 -1
- package/lib/typescript/src/{values/animation → animation}/timing/Easing.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/timing/createTiming.d.ts +2 -2
- package/lib/typescript/src/{values/animation → animation}/timing/functions/bezier.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/timing/functions/getResolvedParams.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/timing/functions/index.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/timing/functions/timing.d.ts +1 -1
- package/lib/typescript/src/{values/animation → animation}/timing/functions/types.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/timing/index.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/timing/runTiming.d.ts +1 -1
- package/lib/typescript/src/{values/animation → animation}/timing/useLoop.d.ts +0 -0
- package/lib/typescript/src/{values/animation → animation}/timing/useTiming.d.ts +1 -1
- package/lib/typescript/src/{values/animation → animation}/types.d.ts +0 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +1 -1
- package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +7 -0
- package/lib/typescript/src/renderer/components/imageFilters/index.d.ts +1 -0
- package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +1 -4
- package/lib/typescript/src/renderer/processors/Rects.d.ts +9 -41
- package/lib/typescript/src/renderer/processors/math/Matrix3.d.ts +1 -5
- package/lib/typescript/src/renderer/processors/math/Vector.d.ts +5 -17
- package/lib/typescript/src/skia/Color.d.ts +8 -9
- package/lib/typescript/src/skia/ImageFilter/ImageFilterFactory.d.ts +16 -0
- package/lib/typescript/src/skia/Matrix.d.ts +7 -1
- package/lib/typescript/src/skia/RuntimeEffect/RuntimeEffect.d.ts +2 -1
- package/lib/typescript/src/skia/RuntimeEffect/RuntimeEffectFactory.d.ts +2 -2
- package/lib/typescript/src/skia/Shader/useShader.d.ts +1 -1
- package/lib/typescript/src/skia/Skia.d.ts +28 -95
- package/lib/typescript/src/skia/SkiaApi.d.ts +71 -0
- package/lib/typescript/src/skia/Surface/Surface.d.ts +1 -1
- package/lib/typescript/src/skia/Surface/SurfaceFactory.d.ts +2 -2
- package/lib/typescript/src/values/api.d.ts +2 -25
- package/lib/typescript/src/values/api.web.d.ts +2 -0
- package/lib/typescript/src/values/index.d.ts +0 -1
- package/lib/typescript/src/values/types.d.ts +24 -1
- package/lib/typescript/src/values/web/RNSkAnimation.d.ts +9 -0
- package/lib/typescript/src/values/web/RNSkClockValue.d.ts +13 -0
- package/lib/typescript/src/values/web/RNSkDerivedValue.d.ts +9 -0
- package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +11 -0
- package/lib/typescript/src/values/web/RNSkValue.d.ts +14 -0
- package/lib/typescript/src/values/web/api.d.ts +2 -0
- package/lib/typescript/src/values/web/index.d.ts +1 -0
- package/lib/typescript/src/views/SkiaView.d.ts +3 -36
- package/lib/typescript/src/views/api.d.ts +5 -0
- package/lib/typescript/src/views/types.d.ts +32 -0
- package/package.json +2 -2
- package/src/{values/animation → animation}/decay/decay.ts +0 -0
- package/src/{values/animation → animation}/decay/index.ts +0 -0
- package/src/{values/animation → animation}/decay/runDecay.ts +2 -2
- package/src/{values/animation → animation}/decay/types.ts +1 -1
- package/src/{values/animation → animation}/functions/index.ts +0 -0
- package/src/animation/functions/interpolate.ts +182 -0
- package/src/animation/functions/interpolateColors.ts +58 -0
- package/src/{values/animation → animation}/index.ts +0 -0
- package/src/{values/animation → animation}/spring/Spring.ts +0 -0
- package/src/{values/animation → animation}/spring/functions/index.ts +0 -0
- package/src/{values/animation → animation}/spring/functions/spring.ts +0 -0
- package/src/{values/animation → animation}/spring/index.ts +0 -0
- package/src/{values/animation → animation}/spring/runSpring.ts +1 -1
- package/src/{values/animation → animation}/spring/types.ts +0 -0
- package/src/{values/animation → animation}/spring/useSpring.ts +1 -1
- package/src/{values/animation → animation}/timing/Easing.ts +0 -0
- package/src/{values/animation → animation}/timing/createTiming.ts +2 -2
- package/src/{values/animation → animation}/timing/functions/__tests__/timing.spec.ts +0 -0
- package/src/{values/animation → animation}/timing/functions/bezier.ts +0 -0
- package/src/{values/animation → animation}/timing/functions/getResolvedParams.ts +0 -0
- package/src/{values/animation → animation}/timing/functions/index.ts +0 -0
- package/src/{values/animation → animation}/timing/functions/timing.ts +1 -1
- package/src/{values/animation → animation}/timing/functions/types.ts +0 -0
- package/src/{values/animation → animation}/timing/index.ts +0 -0
- package/src/{values/animation → animation}/timing/runTiming.ts +1 -1
- package/src/{values/animation → animation}/timing/useLoop.ts +0 -0
- package/src/{values/animation → animation}/timing/useTiming.ts +2 -2
- package/src/{values/animation → animation}/types.ts +0 -0
- package/src/index.ts +1 -0
- package/src/renderer/components/colorFilters/BlendColor.tsx +1 -1
- package/src/renderer/components/imageFilters/InnerShadow.tsx +4 -2
- package/src/renderer/components/imageFilters/RuntimeShader.tsx +23 -0
- package/src/renderer/components/imageFilters/index.ts +1 -0
- package/src/renderer/components/shaders/Gradient.ts +2 -4
- package/src/renderer/components/shaders/Shader.tsx +2 -2
- package/src/renderer/processors/Rects.ts +6 -12
- package/src/renderer/processors/math/Matrix3.ts +24 -105
- package/src/renderer/processors/math/Vector.ts +3 -2
- package/src/skia/Color.ts +13 -27
- package/src/skia/ImageFilter/ImageFilterFactory.ts +20 -0
- package/src/skia/Matrix.ts +8 -1
- package/src/skia/RuntimeEffect/RuntimeEffect.ts +3 -1
- package/src/skia/RuntimeEffect/RuntimeEffectFactory.ts +2 -2
- package/src/skia/Shader/useShader.ts +4 -1
- package/src/skia/Skia.ts +4 -126
- package/src/skia/SkiaApi.ts +86 -0
- package/src/skia/Surface/Surface.ts +1 -1
- package/src/skia/Surface/SurfaceFactory.ts +2 -2
- package/src/values/api.ts +3 -42
- package/src/values/api.web.ts +5 -0
- package/src/values/index.ts +0 -1
- package/src/values/types.ts +30 -1
- package/src/values/web/RNSkAnimation.ts +33 -0
- package/src/values/web/RNSkClockValue.ts +58 -0
- package/src/values/web/RNSkDerivedValue.ts +38 -0
- package/src/values/web/RNSkReadonlyValue.ts +32 -0
- package/src/values/web/RNSkValue.ts +57 -0
- package/src/values/web/__tests__/RNSkAnimation.spec.ts +21 -0
- package/src/values/web/__tests__/RNSkDerivedValue.spec.ts +15 -0
- package/src/values/web/__tests__/RNSkReadonlyValue.spec.ts +8 -0
- package/src/values/web/__tests__/RNSkValue.spec.ts +11 -0
- package/src/values/web/api.ts +33 -0
- package/src/values/web/index.ts +1 -0
- package/src/views/SkiaView.tsx +3 -49
- package/src/views/api.ts +7 -0
- package/src/views/types.ts +40 -0
- package/lib/commonjs/values/animation/decay/runDecay.js.map +0 -1
- package/lib/commonjs/values/animation/functions/interpolate.js +0 -139
- package/lib/commonjs/values/animation/functions/interpolate.js.map +0 -1
- package/lib/commonjs/values/animation/functions/interpolateColors.js +0 -47
- package/lib/commonjs/values/animation/functions/interpolateColors.js.map +0 -1
- package/lib/commonjs/values/animation/spring/runSpring.js.map +0 -1
- package/lib/commonjs/values/animation/spring/useSpring.js.map +0 -1
- package/lib/commonjs/values/animation/timing/createTiming.js.map +0 -1
- package/lib/commonjs/values/animation/timing/runTiming.js.map +0 -1
- package/lib/commonjs/values/animation/timing/useTiming.js.map +0 -1
- package/lib/module/values/animation/decay/runDecay.js.map +0 -1
- package/lib/module/values/animation/functions/interpolate.js +0 -132
- package/lib/module/values/animation/functions/interpolate.js.map +0 -1
- package/lib/module/values/animation/functions/interpolateColors.js +0 -32
- package/lib/module/values/animation/functions/interpolateColors.js.map +0 -1
- package/lib/module/values/animation/spring/runSpring.js.map +0 -1
- package/lib/module/values/animation/spring/useSpring.js.map +0 -1
- package/lib/module/values/animation/timing/createTiming.js.map +0 -1
- package/lib/module/values/animation/timing/runTiming.js.map +0 -1
- package/lib/module/values/animation/timing/useTiming.js.map +0 -1
- package/lib/typescript/scripts/install-npm.d.ts +0 -1
- package/lib/typescript/src/values/animation/functions/interpolate.d.ts +0 -7
- package/lib/typescript/src/values/animation/functions/interpolateColors.d.ts +0 -3
- package/src/values/animation/functions/interpolate.ts +0 -169
- package/src/values/animation/functions/interpolateColors.ts +0 -62
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["types.ts"],"names":["TouchType"],"mappings":"
|
1
|
+
{"version":3,"sources":["types.ts"],"names":["TouchType"],"mappings":"AAaA,WAAYA,SAAZ;;WAAYA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;GAAAA,S,KAAAA,S","sourcesContent":["import type { ViewProps } from \"react-native\";\n\nimport type { SkImage, SkRect } from \"../skia\";\nimport type { SkCanvas } from \"../skia/Canvas\";\nimport type { SkiaReadonlyValue } from \"../values\";\n\nexport type DrawMode = \"continuous\" | \"default\";\n\nexport type NativeSkiaViewProps = ViewProps & {\n mode?: DrawMode;\n debug?: boolean;\n};\n\nexport enum TouchType {\n Start,\n Active,\n End,\n Cancelled,\n}\n\nexport interface TouchInfo {\n x: number;\n y: number;\n force: number;\n type: TouchType;\n timestamp: number;\n}\n\nexport interface DrawingInfo {\n width: number;\n height: number;\n timestamp: number;\n touches: Array<Array<TouchInfo>>;\n}\n\nexport type ExtendedTouchInfo = TouchInfo & {\n // points per second\n velocityX: number;\n velocityY: number;\n};\n\nexport type TouchHandlers = {\n onStart?: (touchInfo: TouchInfo) => void;\n onActive?: (touchInfo: ExtendedTouchInfo) => void;\n onEnd?: (touchInfo: ExtendedTouchInfo) => void;\n};\n\nexport type TouchHandler = (touchInfo: Array<Array<TouchInfo>>) => void;\n\nexport type RNSkiaDrawCallback = (canvas: SkCanvas, info: DrawingInfo) => void;\n\n/**\n * Listener interface for value changes\n */\nexport interface ValueListener {\n addListener: (callback: () => void) => number;\n removeListener: (id: number) => void;\n}\n\nexport interface ISkiaViewApi {\n invalidateSkiaView: (nativeId: number) => void;\n makeImageSnapshot: (nativeId: number, rect?: SkRect) => SkImage;\n setDrawCallback: (\n nativeId: number,\n callback: RNSkiaDrawCallback | undefined\n ) => void;\n setDrawMode: (nativeId: number, mode: DrawMode) => void;\n registerValuesInView: (\n nativeId: number,\n values: SkiaReadonlyValue<unknown>[]\n ) => () => void;\n}\n\nexport interface SkiaViewProps extends ViewProps {\n /**\n * Sets the drawing mode for the skia view. There are two drawing\n * modes, \"continuous\" and \"default\", where the continuous mode will\n * continuously redraw the view, and the default mode will only\n * redraw when any of the regular react properties are changed like\n * sizes and margins.\n */\n mode?: DrawMode;\n /**\n * When set to true the view will display information about the\n * average time it takes to render.\n */\n debug?: boolean;\n /**\n * Draw callback. Will be called whenever the view is invalidated and\n * needs to redraw. This is either caused by a change in a react\n * property, a touch event, or a call to redraw. If the view is in\n * continuous mode the callback will be called 60 frames per second\n * by the native view.\n */\n onDraw?: RNSkiaDrawCallback;\n}\n"]}
|
File without changes
|
File without changes
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { SkiaValue } from "../../types";
|
1
|
+
import type { SkiaValue } from "../../values/types";
|
2
2
|
import type { DecayConfig } from "./types";
|
3
3
|
/**
|
4
4
|
* Runs a decay animation from the current value to zero with the given decay
|
@@ -7,4 +7,4 @@ import type { DecayConfig } from "./types";
|
|
7
7
|
* @param config Configuration or default configuration
|
8
8
|
* @returns Animation
|
9
9
|
*/
|
10
|
-
export declare const runDecay: (value: SkiaValue<number>, config?: DecayConfig | undefined) => import("../../types").SkiaAnimation;
|
10
|
+
export declare const runDecay: (value: SkiaValue<number>, config?: DecayConfig | undefined) => import("../../values/types").SkiaAnimation;
|
File without changes
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export declare enum Extrapolate {
|
2
|
+
IDENTITY = "identity",
|
3
|
+
CLAMP = "clamp",
|
4
|
+
EXTEND = "extend"
|
5
|
+
}
|
6
|
+
export interface ExtrapolationConfig {
|
7
|
+
extrapolateLeft?: Extrapolate | string;
|
8
|
+
extrapolateRight?: Extrapolate | string;
|
9
|
+
}
|
10
|
+
export declare type ExtrapolationType = ExtrapolationConfig | Extrapolate | string | undefined;
|
11
|
+
export declare function interpolate(x: number, input: readonly number[], output: readonly number[], type?: ExtrapolationType): number;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { SkiaValue, SkiaAnimation } from "../../types";
|
1
|
+
import type { SkiaValue, SkiaAnimation } from "../../values/types";
|
2
2
|
import type { AnimationParams, SpringConfig, AnimationCallback } from "../types";
|
3
3
|
/**
|
4
4
|
* Creates a new animation on an existing value that will be driven by
|
File without changes
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { TimingConfig, RequiredAnimationParams, AnimationCallback } from "../types";
|
2
|
-
import type { SkiaValue } from "../../types";
|
2
|
+
import type { SkiaValue } from "../../values/types";
|
3
3
|
/**
|
4
4
|
* Creates an animation that is driven by a clock value.
|
5
5
|
* The value will be run from / to the value in params and modified
|
@@ -14,4 +14,4 @@ import type { SkiaValue } from "../../types";
|
|
14
14
|
* @params an animation value that can be used to start/stop
|
15
15
|
* the animation.
|
16
16
|
*/
|
17
|
-
export declare const createTiming: (params: RequiredAnimationParams & Required<TimingConfig>, value?: SkiaValue<number> | undefined, callback?: AnimationCallback | undefined) => import("../../types").SkiaAnimation;
|
17
|
+
export declare const createTiming: (params: RequiredAnimationParams & Required<TimingConfig>, value?: SkiaValue<number> | undefined, callback?: AnimationCallback | undefined) => import("../../values/types").SkiaAnimation;
|
File without changes
|
package/lib/typescript/src/{values/animation → animation}/timing/functions/getResolvedParams.d.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { SkiaValue, SkiaAnimation } from "../../types";
|
1
|
+
import type { SkiaValue, SkiaAnimation } from "../../values/types";
|
2
2
|
import type { AnimationParams, TimingConfig, AnimationCallback } from "../types";
|
3
3
|
/**
|
4
4
|
* Creates a new animation on an existing value that will be driven by
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
|
+
import type { Color } from "../../../skia";
|
2
3
|
import { BlendMode } from "../../../skia";
|
3
4
|
import type { SkEnum, AnimatedProps } from "../../processors";
|
4
|
-
import type { Color } from "../../../skia";
|
5
5
|
export interface BlendColorProps {
|
6
6
|
mode: SkEnum<typeof BlendMode>;
|
7
7
|
color: Color;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { AnimatedProps } from "../../processors/Animations/Animations";
|
3
|
+
import type { SkRuntimeEffect } from "../../../skia/RuntimeEffect/RuntimeEffect";
|
4
|
+
export interface RuntimeShaderProps {
|
5
|
+
source: SkRuntimeEffect;
|
6
|
+
}
|
7
|
+
export declare const RuntimeShader: (props: AnimatedProps<RuntimeShaderProps>) => JSX.Element;
|
@@ -9,7 +9,7 @@ export interface GradientProps extends TransformProps {
|
|
9
9
|
flags?: number;
|
10
10
|
}
|
11
11
|
export declare const processGradientProps: ({ colors, positions, mode, flags, ...transform }: GradientProps) => {
|
12
|
-
colors:
|
12
|
+
colors: Float32Array[];
|
13
13
|
positions: number[] | null;
|
14
14
|
mode: TileMode;
|
15
15
|
flags: number | undefined;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
|
-
import type {
|
2
|
+
import type { SkRuntimeEffect } from "../../../skia";
|
3
3
|
import type { Vector, AnimatedProps, TransformProps } from "../../processors";
|
4
4
|
declare type UniformValue = number | Vector | readonly number[];
|
5
5
|
declare type Uniform = UniformValue | readonly UniformValue[];
|
@@ -7,7 +7,7 @@ interface Uniforms {
|
|
7
7
|
[name: string]: Uniform;
|
8
8
|
}
|
9
9
|
export interface ShaderProps extends TransformProps {
|
10
|
-
source:
|
10
|
+
source: SkRuntimeEffect;
|
11
11
|
uniforms: Uniforms;
|
12
12
|
opaque?: boolean;
|
13
13
|
children?: ReactNode | ReactNode[];
|
@@ -1,46 +1,14 @@
|
|
1
1
|
import type { SkRect, SkRRect } from "../../skia";
|
2
2
|
import type { Radius } from "./Radius";
|
3
|
-
export declare const point: (x: number, y: number) =>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
export declare const
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
};
|
13
|
-
export declare const rrect: (r: SkRect, rx: number, ry: number) => {
|
14
|
-
rect: SkRect;
|
15
|
-
rx: number;
|
16
|
-
ry: number;
|
17
|
-
};
|
18
|
-
export declare const bounds: (rects: SkRect[]) => {
|
19
|
-
x: number;
|
20
|
-
y: number;
|
21
|
-
width: number;
|
22
|
-
height: number;
|
23
|
-
};
|
24
|
-
export declare const topLeft: (r: SkRect | SkRRect) => {
|
25
|
-
x: number;
|
26
|
-
y: number;
|
27
|
-
};
|
28
|
-
export declare const topRight: (r: SkRect | SkRRect) => {
|
29
|
-
x: number;
|
30
|
-
y: number;
|
31
|
-
};
|
32
|
-
export declare const bottomLeft: (r: SkRect | SkRRect) => {
|
33
|
-
x: number;
|
34
|
-
y: number;
|
35
|
-
};
|
36
|
-
export declare const bottomRight: (r: SkRect | SkRRect) => {
|
37
|
-
x: number;
|
38
|
-
y: number;
|
39
|
-
};
|
40
|
-
export declare const center: (r: SkRect | SkRRect) => {
|
41
|
-
x: number;
|
42
|
-
y: number;
|
43
|
-
};
|
3
|
+
export declare const point: (x: number, y: number) => import("../../skia").SkPoint;
|
4
|
+
export declare const rect: (x: number, y: number, width: number, height: number) => SkRect;
|
5
|
+
export declare const rrect: (r: SkRect, rx: number, ry: number) => SkRRect;
|
6
|
+
export declare const bounds: (rects: SkRect[]) => SkRect;
|
7
|
+
export declare const topLeft: (r: SkRect | SkRRect) => import("../../skia").SkPoint;
|
8
|
+
export declare const topRight: (r: SkRect | SkRRect) => import("../../skia").SkPoint;
|
9
|
+
export declare const bottomLeft: (r: SkRect | SkRRect) => import("../../skia").SkPoint;
|
10
|
+
export declare const bottomRight: (r: SkRect | SkRRect) => import("../../skia").SkPoint;
|
11
|
+
export declare const center: (r: SkRect | SkRRect) => import("../../skia").SkPoint;
|
44
12
|
export declare const isRRect: (def: SkRect | SkRRect) => def is SkRRect;
|
45
13
|
export interface RectCtor {
|
46
14
|
x: number;
|
@@ -1,6 +1,3 @@
|
|
1
|
-
import type { SkMatrix } from "../../../skia/Matrix";
|
2
|
-
export declare type Vec3 = readonly [number, number, number];
|
3
|
-
export declare type Matrix3 = readonly [Vec3, Vec3, Vec3];
|
4
1
|
declare type Transform2dName = "translateX" | "translateY" | "scale" | "skewX" | "skewY" | "scaleX" | "scaleY" | "rotateZ" | "rotate";
|
5
2
|
export interface TransformProp {
|
6
3
|
transform?: Transforms2d;
|
@@ -9,6 +6,5 @@ declare type Transformations = {
|
|
9
6
|
readonly [Name in Transform2dName]: number;
|
10
7
|
};
|
11
8
|
export declare type Transforms2d = readonly (Pick<Transformations, "translateX"> | Pick<Transformations, "translateY"> | Pick<Transformations, "scale"> | Pick<Transformations, "scaleX"> | Pick<Transformations, "scaleY"> | Pick<Transformations, "skewX"> | Pick<Transformations, "skewY"> | Pick<Transformations, "rotate">)[];
|
12
|
-
export declare const
|
13
|
-
export declare const processTransform2d: (transforms: Transforms2d) => SkMatrix;
|
9
|
+
export declare const processTransform2d: (transforms: Transforms2d) => import("../../../skia").SkMatrix;
|
14
10
|
export {};
|
@@ -1,24 +1,12 @@
|
|
1
|
-
import { interpolate } from "../../../
|
1
|
+
import { interpolate } from "../../../animation/functions/interpolate";
|
2
2
|
export interface Vector {
|
3
3
|
x: number;
|
4
4
|
y: number;
|
5
5
|
}
|
6
|
-
export declare const vec: (x?: number, y?: number | undefined) =>
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
export declare const neg: (a: Vector) => {
|
11
|
-
x: number;
|
12
|
-
y: number;
|
13
|
-
};
|
14
|
-
export declare const add: (a: Vector, b: Vector) => {
|
15
|
-
x: number;
|
16
|
-
y: number;
|
17
|
-
};
|
18
|
-
export declare const sub: (a: Vector, b: Vector) => {
|
19
|
-
x: number;
|
20
|
-
y: number;
|
21
|
-
};
|
6
|
+
export declare const vec: (x?: number, y?: number | undefined) => import("../../../skia").SkPoint;
|
7
|
+
export declare const neg: (a: Vector) => import("../../../skia").SkPoint;
|
8
|
+
export declare const add: (a: Vector, b: Vector) => import("../../../skia").SkPoint;
|
9
|
+
export declare const sub: (a: Vector, b: Vector) => import("../../../skia").SkPoint;
|
22
10
|
export declare const dist: (a: Vector, b: Vector) => number;
|
23
11
|
export declare const translate: ({ x, y }: Vector) => readonly [{
|
24
12
|
readonly translateX: number;
|
@@ -1,9 +1,8 @@
|
|
1
|
-
export declare type SkColor =
|
2
|
-
export declare type Color = string | number;
|
3
|
-
export declare const
|
4
|
-
export declare const
|
5
|
-
export declare const
|
6
|
-
export declare const
|
7
|
-
export declare const rgbaColor: (r: number, g: number, b: number,
|
8
|
-
export declare const processColor: (cl: Color, currentOpacity: number) =>
|
9
|
-
export declare const processColorAsUnitArray: (cl: Color, currentOpacity: number) => readonly [number, number, number, number];
|
1
|
+
export declare type SkColor = Float32Array;
|
2
|
+
export declare type Color = string | Float32Array | number;
|
3
|
+
export declare const RED = 0;
|
4
|
+
export declare const GREEN = 1;
|
5
|
+
export declare const BLUE = 2;
|
6
|
+
export declare const ALPHA = 3;
|
7
|
+
export declare const rgbaColor: (r: number, g: number, b: number, a: number) => Float32Array;
|
8
|
+
export declare const processColor: (cl: Color, currentOpacity: number) => Float32Array;
|
@@ -3,6 +3,7 @@ import type { SkColorFilter } from "../ColorFilter/ColorFilter";
|
|
3
3
|
import type { SkShader } from "../Shader/Shader";
|
4
4
|
import type { SkRect } from "../Rect";
|
5
5
|
import type { BlendMode } from "../Paint/BlendMode";
|
6
|
+
import type { SkRuntimeShaderBuilder } from "../RuntimeEffect";
|
6
7
|
import type { SkImageFilter, TileMode } from "./ImageFilter";
|
7
8
|
export declare enum ColorChannel {
|
8
9
|
R = 0,
|
@@ -111,4 +112,19 @@ export interface ImageFilterFactory {
|
|
111
112
|
* @cropRect Optional rectangle to crop input and output.
|
112
113
|
*/
|
113
114
|
MakeBlend: (mode: BlendMode, background: SkImageFilter, foreground: SkImageFilter | null, cropRect?: SkRect) => SkImageFilter;
|
115
|
+
/**
|
116
|
+
* Create a filter that fills the output with the per-pixel evaluation of the SkShader produced
|
117
|
+
* by the SkRuntimeShaderBuilder. The shader is defined in the image filter's local coordinate
|
118
|
+
* system, so it will automatically be affected by SkCanvas' transform.
|
119
|
+
*
|
120
|
+
* @param builder The builder used to produce the runtime shader, that will in turn
|
121
|
+
* fill the result image
|
122
|
+
* @param childShaderName The name of the child shader defined in the builder that will be
|
123
|
+
* bound to the input param (or the source image if the input param
|
124
|
+
* is null). If null the builder can have exactly one child shader,
|
125
|
+
* which automatically binds the input param.
|
126
|
+
* @param input The image filter that will be provided as input to the runtime
|
127
|
+
* shader. If null the implicit source image is used instead
|
128
|
+
*/
|
129
|
+
MakeRuntimeShader: (builder: SkRuntimeShaderBuilder, childShaderName: string | null, input: SkImageFilter | null) => SkImageFilter;
|
114
130
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { SkJSIInstance } from "./JsiInstance";
|
1
2
|
export declare enum MatrixIndex {
|
2
3
|
ScaleX = 0,
|
3
4
|
SkewX = 1,
|
@@ -9,7 +10,7 @@ export declare enum MatrixIndex {
|
|
9
10
|
Persp1 = 7,
|
10
11
|
persp2 = 8
|
11
12
|
}
|
12
|
-
export interface SkMatrix {
|
13
|
+
export interface SkMatrix extends SkJSIInstance<"Matrix"> {
|
13
14
|
0: number;
|
14
15
|
1: number;
|
15
16
|
2: number;
|
@@ -19,4 +20,9 @@ export interface SkMatrix {
|
|
19
20
|
6: number;
|
20
21
|
7: number;
|
21
22
|
8: number;
|
23
|
+
preConcat: (matrix: SkMatrix) => void;
|
24
|
+
preTranslate: (x: number, y: number) => void;
|
25
|
+
preScale: (x: number, y: number) => void;
|
26
|
+
preSkew: (x: number, y: number) => void;
|
27
|
+
preRotate: (theta: number) => void;
|
22
28
|
}
|
@@ -8,7 +8,8 @@ export interface SkSLUniform {
|
|
8
8
|
slot: number;
|
9
9
|
isInteger: boolean;
|
10
10
|
}
|
11
|
-
export
|
11
|
+
export declare type SkRuntimeShaderBuilder = SkJSIInstance<"RuntimeShaderBuilder">;
|
12
|
+
export interface SkRuntimeEffect extends SkJSIInstance<"RuntimeEffect"> {
|
12
13
|
/**
|
13
14
|
* Returns a shader executed using the given uniform data.
|
14
15
|
* @param uniforms
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { SkRuntimeEffect } from "./RuntimeEffect";
|
2
2
|
export interface RuntimeEffectFactory {
|
3
3
|
/**
|
4
4
|
* Compiles a RuntimeEffect from the given shader code.
|
@@ -6,5 +6,5 @@ export interface RuntimeEffectFactory {
|
|
6
6
|
* @param callback - will be called with any compilation error. If not provided, errors will
|
7
7
|
* be printed to console.log().
|
8
8
|
*/
|
9
|
-
Make: (sksl: string) =>
|
9
|
+
Make: (sksl: string) => SkRuntimeEffect | null;
|
10
10
|
}
|
@@ -1 +1 @@
|
|
1
|
-
export declare const useShader: (sksl: string) => import("..").
|
1
|
+
export declare const useShader: (sksl: string) => import("..").SkRuntimeEffect | null;
|
@@ -1,108 +1,41 @@
|
|
1
|
-
import type { ImageFilterFactory } from "./ImageFilter";
|
2
|
-
import type { PathFactory } from "./Path";
|
3
|
-
import type { ColorFilterFactory } from "./ColorFilter";
|
4
|
-
import type { SkFont } from "./Font";
|
5
|
-
import type { SkTypeface, TypefaceFactory } from "./Typeface";
|
6
|
-
import type { ImageFactory } from "./Image";
|
7
|
-
import type { MaskFilterFactory } from "./MaskFilter";
|
8
|
-
import type { SkPaint } from "./Paint";
|
9
|
-
import type { SkRect } from "./Rect";
|
10
|
-
import type { SkRRect } from "./RRect";
|
11
|
-
import type { RuntimeEffectFactory } from "./RuntimeEffect";
|
12
|
-
import type { ShaderFactory } from "./Shader";
|
13
|
-
import type { SkMatrix } from "./Matrix";
|
14
|
-
import type { PathEffectFactory } from "./PathEffect";
|
15
|
-
import type { SkPoint } from "./Point";
|
16
|
-
import type { SkVertices, VertexMode } from "./Vertices/Vertices";
|
17
|
-
import type { DataFactory } from "./Data";
|
18
|
-
import type { SVGFactory } from "./SVG";
|
19
|
-
import type { TextBlobFactory } from "./TextBlob";
|
20
|
-
import type { FontMgrFactory } from "./FontMgr/FontMgrFactory";
|
21
|
-
import type { SurfaceFactory } from "./Surface";
|
22
1
|
import "./NativeSetup";
|
23
|
-
import type {
|
24
|
-
import type { SkPath } from "./Path/Path";
|
25
|
-
import type { SkContourMeasureIter } from "./ContourMeasure";
|
26
|
-
import type { PictureFactory, SkPictureRecorder } from "./Picture";
|
27
|
-
import type { Color, SkColor } from "./Color";
|
28
|
-
/**
|
29
|
-
* Declares the interface for the native Skia API
|
30
|
-
*/
|
31
|
-
export interface Skia {
|
32
|
-
Point: (x: number, y: number) => SkPoint;
|
33
|
-
XYWHRect: (x: number, y: number, width: number, height: number) => SkRect;
|
34
|
-
RRectXY: (rect: SkRect, rx: number, ry: number) => SkRRect;
|
35
|
-
RSXform: (scos: number, ssin: number, tx: number, ty: number) => SkRSXform;
|
36
|
-
Color: (color: Color) => SkColor;
|
37
|
-
parseColorString: (color: string) => SkColor | undefined;
|
38
|
-
ContourMeasureIter: (path: SkPath, forceClosed: boolean, resScale: number) => SkContourMeasureIter;
|
39
|
-
Paint: () => SkPaint;
|
40
|
-
PictureRecorder: () => SkPictureRecorder;
|
41
|
-
Picture: PictureFactory;
|
42
|
-
Path: PathFactory;
|
43
|
-
Matrix: () => SkMatrix;
|
44
|
-
ColorFilter: ColorFilterFactory;
|
45
|
-
Font: (typeface?: SkTypeface, size?: number) => SkFont;
|
46
|
-
Typeface: TypefaceFactory;
|
47
|
-
MaskFilter: MaskFilterFactory;
|
48
|
-
RuntimeEffect: RuntimeEffectFactory;
|
49
|
-
ImageFilter: ImageFilterFactory;
|
50
|
-
Shader: ShaderFactory;
|
51
|
-
PathEffect: PathEffectFactory;
|
52
|
-
/**
|
53
|
-
* Returns an Vertices based on the given positions and optional parameters.
|
54
|
-
* See SkVertices.h (especially the Builder) for more details.
|
55
|
-
* @param mode
|
56
|
-
* @param positions
|
57
|
-
* @param textureCoordinates
|
58
|
-
* @param colors - either a list of int colors or a flattened color array.
|
59
|
-
* @param indices
|
60
|
-
* @param isVolatile
|
61
|
-
*/
|
62
|
-
MakeVertices(mode: VertexMode, positions: SkPoint[], textureCoordinates?: SkPoint[] | null, colors?: SkColor[], indices?: number[] | null, isVolatile?: boolean): SkVertices;
|
63
|
-
Data: DataFactory;
|
64
|
-
Image: ImageFactory;
|
65
|
-
SVG: SVGFactory;
|
66
|
-
FontMgr: FontMgrFactory;
|
67
|
-
TextBlob: TextBlobFactory;
|
68
|
-
Surface: SurfaceFactory;
|
69
|
-
}
|
2
|
+
import type { SkiaApi as SkSkiaApi } from "./SkiaApi";
|
70
3
|
/**
|
71
4
|
* Declares the SkiaApi as an available object in the global scope
|
72
5
|
*/
|
73
6
|
declare global {
|
74
|
-
var SkiaApi:
|
7
|
+
var SkiaApi: SkSkiaApi;
|
75
8
|
}
|
76
9
|
/**
|
77
10
|
* Declares the implemented API with overrides.
|
78
11
|
*/
|
79
12
|
export declare const Skia: {
|
80
|
-
Typeface: TypefaceFactory;
|
81
|
-
MaskFilter: MaskFilterFactory;
|
82
|
-
RuntimeEffect: RuntimeEffectFactory;
|
83
|
-
Shader: ShaderFactory;
|
84
|
-
ImageFilter: ImageFilterFactory;
|
85
|
-
PathEffect: PathEffectFactory;
|
86
|
-
Data: DataFactory;
|
87
|
-
SVG: SVGFactory;
|
88
|
-
FontMgr: FontMgrFactory;
|
89
|
-
TextBlob: TextBlobFactory;
|
90
|
-
Matrix: () => SkMatrix;
|
91
|
-
Font: (typeface?: SkTypeface | undefined, size?: number | undefined) => SkFont;
|
92
|
-
Point: (x: number, y: number) => SkPoint;
|
93
|
-
XYWHRect: (x: number, y: number, width: number, height: number) => SkRect;
|
94
|
-
RRectXY: (rect: SkRect, rx: number, ry: number) => SkRRect;
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
RSXform: (scos: number, ssin: number, tx: number, ty: number) => SkRSXform;
|
104
|
-
MakeSurface: (width: number, height: number) => import("./Surface").
|
13
|
+
Typeface: import("./Typeface").TypefaceFactory;
|
14
|
+
MaskFilter: import("./MaskFilter").MaskFilterFactory;
|
15
|
+
RuntimeEffect: import("./RuntimeEffect").RuntimeEffectFactory;
|
16
|
+
Shader: import("./Shader").ShaderFactory;
|
17
|
+
ImageFilter: import("./ImageFilter").ImageFilterFactory;
|
18
|
+
PathEffect: import("./PathEffect").PathEffectFactory;
|
19
|
+
Data: import("./Data").DataFactory;
|
20
|
+
SVG: import("./SVG").SVGFactory;
|
21
|
+
FontMgr: import("./FontMgr").FontMgrFactory;
|
22
|
+
TextBlob: import("./TextBlob").TextBlobFactory;
|
23
|
+
Matrix: () => import("./Matrix").SkMatrix;
|
24
|
+
Font: (typeface?: import("./Typeface").SkTypeface | undefined, size?: number | undefined) => import("./Font").SkFont;
|
25
|
+
Point: (x: number, y: number) => import("./Point").SkPoint;
|
26
|
+
XYWHRect: (x: number, y: number, width: number, height: number) => import("./Rect").SkRect;
|
27
|
+
RRectXY: (rect: import("./Rect").SkRect, rx: number, ry: number) => import("./RRect").SkRRect;
|
28
|
+
RuntimeShaderBuilder: (rt: import("./RuntimeEffect").SkRuntimeEffect) => import("./RuntimeEffect").SkRuntimeShaderBuilder;
|
29
|
+
Paint: () => import("./Paint").SkPaint;
|
30
|
+
PictureRecorder: () => import("./Picture").SkPictureRecorder;
|
31
|
+
Picture: import("./Picture").PictureFactory;
|
32
|
+
Path: import("./Path").PathFactory;
|
33
|
+
ColorFilter: import("./ColorFilter").ColorFilterFactory;
|
34
|
+
ContourMeasureIter: (path: import("./Path").SkPath, forceClosed: boolean, resScale: number) => import("./ContourMeasure").SkContourMeasureIter;
|
35
|
+
Color: (color: import("./Color").Color) => Float32Array;
|
36
|
+
RSXform: (scos: number, ssin: number, tx: number, ty: number) => import("./RSXform").SkRSXform;
|
37
|
+
MakeSurface: (width: number, height: number) => import("./Surface").SkSurface | null;
|
105
38
|
MakeImageFromEncoded: (encoded: import("./Data").Data) => import("./Image").SkImage | null;
|
106
39
|
MakeImage: (info: import("./Image").ImageInfo, data: import("./Data").Data, bytesPerRow: number) => import("./Image").SkImage | null;
|
107
|
-
MakeVertices: (mode: VertexMode, positions: SkPoint[], textureCoordinates?: SkPoint[] | null | undefined, colors?:
|
40
|
+
MakeVertices: (mode: import("./Vertices").VertexMode, positions: import("./Point").SkPoint[], textureCoordinates?: import("./Point").SkPoint[] | null | undefined, colors?: Float32Array[] | undefined, indices?: number[] | null | undefined, isVolatile?: boolean | undefined) => import("./Vertices").SkVertices;
|
108
41
|
};
|