@shopify/react-native-skia 0.1.116 → 0.1.118
Sign up to get free protection for your applications and to get access to all the features.
- package/cpp/api/JsiSkApi.h +13 -9
- package/cpp/api/JsiSkCanvas.h +9 -1
- package/cpp/api/JsiSkPicture.h +71 -0
- package/cpp/api/JsiSkPictureFactory.h +50 -0
- package/cpp/api/JsiSkPictureRecorder.h +53 -0
- package/lib/commonjs/renderer/Canvas.js +22 -36
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +2 -24
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/components/Drawing.js +31 -0
- package/lib/commonjs/renderer/components/Drawing.js.map +1 -0
- package/lib/commonjs/renderer/components/Group.js +1 -1
- package/lib/commonjs/renderer/components/Group.js.map +1 -1
- package/lib/commonjs/renderer/components/Picture.js +35 -0
- package/lib/commonjs/renderer/components/Picture.js.map +1 -0
- package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +5 -34
- package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/{DropShadow.js → Shadow.js} +19 -8
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -0
- package/lib/commonjs/renderer/components/imageFilters/index.js +4 -17
- package/lib/commonjs/renderer/components/imageFilters/index.js.map +1 -1
- package/lib/commonjs/renderer/components/index.js +26 -0
- package/lib/commonjs/renderer/components/index.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Box.js +126 -0
- package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -0
- package/lib/commonjs/renderer/components/shapes/index.js +13 -0
- package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
- package/lib/commonjs/renderer/index.js +13 -0
- package/lib/commonjs/renderer/index.js.map +1 -1
- package/lib/commonjs/renderer/nodes/Declaration.js +8 -1
- package/lib/commonjs/renderer/nodes/Declaration.js.map +1 -1
- package/lib/commonjs/renderer/nodes/Drawing.js +5 -8
- package/lib/commonjs/renderer/nodes/Drawing.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Math.js +19 -1
- package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Matrix3.js +11 -5
- package/lib/commonjs/renderer/processors/math/Matrix3.js.map +1 -1
- package/lib/commonjs/renderer/typeddash.js +26 -2
- package/lib/commonjs/renderer/typeddash.js.map +1 -1
- package/lib/commonjs/renderer/useContextBridge.js +35 -0
- package/lib/commonjs/renderer/useContextBridge.js.map +1 -0
- package/lib/commonjs/skia/Canvas.js.map +1 -1
- package/lib/commonjs/skia/Picture/Picture.js +6 -0
- package/lib/commonjs/skia/Picture/Picture.js.map +1 -0
- package/lib/commonjs/skia/Picture/PictureFactory.js +6 -0
- package/lib/commonjs/skia/Picture/PictureFactory.js.map +1 -0
- package/lib/commonjs/skia/Picture/PictureRecorder.js +6 -0
- package/lib/commonjs/skia/Picture/PictureRecorder.js.map +1 -0
- package/lib/commonjs/skia/Picture/index.js +58 -0
- package/lib/commonjs/skia/Picture/index.js.map +1 -0
- package/lib/commonjs/skia/Picture/usePicture.js +30 -0
- package/lib/commonjs/skia/Picture/usePicture.js.map +1 -0
- package/lib/commonjs/skia/Skia.js +2 -0
- package/lib/commonjs/skia/Skia.js.map +1 -1
- package/lib/commonjs/skia/index.js +14 -0
- package/lib/commonjs/skia/index.js.map +1 -1
- package/lib/commonjs/values/hooks/useDerivedValue.js +2 -2
- package/lib/commonjs/values/hooks/useDerivedValue.js.map +1 -1
- package/lib/commonjs/views/SkiaView.js +6 -5
- package/lib/commonjs/views/SkiaView.js.map +1 -1
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/renderer/Canvas.js +20 -32
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +1 -23
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/components/Drawing.js +17 -0
- package/lib/module/renderer/components/Drawing.js.map +1 -0
- package/lib/module/renderer/components/Group.js +1 -1
- package/lib/module/renderer/components/Group.js.map +1 -1
- package/lib/module/renderer/components/Picture.js +21 -0
- package/lib/module/renderer/components/Picture.js.map +1 -0
- package/lib/module/renderer/components/imageFilters/InnerShadow.js +4 -26
- package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/{DropShadow.js → Shadow.js} +16 -6
- package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -0
- package/lib/module/renderer/components/imageFilters/index.js +1 -2
- package/lib/module/renderer/components/imageFilters/index.js.map +1 -1
- package/lib/module/renderer/components/index.js +2 -0
- package/lib/module/renderer/components/index.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/shapes/Box.js +102 -0
- package/lib/module/renderer/components/shapes/Box.js.map +1 -0
- package/lib/module/renderer/components/shapes/index.js +1 -0
- package/lib/module/renderer/components/shapes/index.js.map +1 -1
- package/lib/module/renderer/index.js +1 -0
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/nodes/Declaration.js +3 -0
- package/lib/module/renderer/nodes/Declaration.js.map +1 -1
- package/lib/module/renderer/nodes/Drawing.js +3 -4
- package/lib/module/renderer/nodes/Drawing.js.map +1 -1
- package/lib/module/renderer/processors/math/Math.js +15 -0
- package/lib/module/renderer/processors/math/Math.js.map +1 -1
- package/lib/module/renderer/processors/math/Matrix3.js +6 -2
- package/lib/module/renderer/processors/math/Matrix3.js.map +1 -1
- package/lib/module/renderer/typeddash.js +21 -0
- package/lib/module/renderer/typeddash.js.map +1 -1
- package/lib/module/renderer/useContextBridge.js +21 -0
- package/lib/module/renderer/useContextBridge.js.map +1 -0
- package/lib/module/skia/Canvas.js.map +1 -1
- package/lib/module/skia/Picture/Picture.js +2 -0
- package/lib/module/skia/Picture/Picture.js.map +1 -0
- package/lib/module/skia/Picture/PictureFactory.js +2 -0
- package/lib/module/skia/Picture/PictureFactory.js.map +1 -0
- package/lib/module/skia/Picture/PictureRecorder.js +2 -0
- package/lib/module/skia/Picture/PictureRecorder.js.map +1 -0
- package/lib/module/skia/Picture/index.js +5 -0
- package/lib/module/skia/Picture/index.js.map +1 -0
- package/lib/module/skia/Picture/usePicture.js +19 -0
- package/lib/module/skia/Picture/usePicture.js.map +1 -0
- package/lib/module/skia/Skia.js +2 -0
- package/lib/module/skia/Skia.js.map +1 -1
- package/lib/module/skia/index.js +1 -0
- package/lib/module/skia/index.js.map +1 -1
- package/lib/module/values/hooks/useDerivedValue.js +1 -1
- package/lib/module/values/hooks/useDerivedValue.js.map +1 -1
- package/lib/module/views/SkiaView.js +6 -5
- package/lib/module/views/SkiaView.js.map +1 -1
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +5 -10
- package/lib/typescript/src/renderer/components/Drawing.d.ts +7 -0
- package/lib/typescript/src/renderer/components/Picture.d.ts +6 -0
- package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +3 -12
- package/lib/typescript/src/renderer/components/imageFilters/{DropShadow.d.ts → Shadow.d.ts} +3 -2
- package/lib/typescript/src/renderer/components/imageFilters/index.d.ts +1 -2
- package/lib/typescript/src/renderer/components/index.d.ts +2 -0
- package/lib/typescript/src/renderer/components/shapes/Box.d.ts +23 -0
- package/lib/typescript/src/renderer/components/shapes/index.d.ts +1 -0
- package/lib/typescript/src/renderer/index.d.ts +1 -0
- package/lib/typescript/src/renderer/nodes/Declaration.d.ts +2 -0
- package/lib/typescript/src/renderer/nodes/Drawing.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/math/Math.d.ts +14 -0
- package/lib/typescript/src/renderer/processors/math/Matrix3.d.ts +1 -0
- package/lib/typescript/src/renderer/typeddash.d.ts +1 -0
- package/lib/typescript/src/renderer/useContextBridge.d.ts +5 -0
- package/lib/typescript/src/skia/Canvas.d.ts +6 -0
- package/lib/typescript/src/skia/Picture/Picture.d.ts +26 -0
- package/lib/typescript/src/skia/Picture/PictureFactory.d.ts +8 -0
- package/lib/typescript/src/skia/Picture/PictureRecorder.d.ts +15 -0
- package/lib/typescript/src/skia/Picture/index.d.ts +4 -0
- package/lib/typescript/src/skia/Picture/usePicture.d.ts +11 -0
- package/lib/typescript/src/skia/Skia.d.ts +5 -0
- package/lib/typescript/src/skia/index.d.ts +1 -0
- package/lib/typescript/src/views/SkiaView.d.ts +25 -1
- package/lib/typescript/src/views/types.d.ts +0 -24
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libsvg.xcframework/Info.plist +5 -5
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +1 -1
- package/src/renderer/Canvas.tsx +14 -30
- package/src/renderer/HostConfig.ts +1 -19
- package/src/renderer/components/Drawing.tsx +16 -0
- package/src/renderer/components/Group.tsx +1 -1
- package/src/renderer/components/Picture.tsx +17 -0
- package/src/renderer/components/imageFilters/InnerShadow.tsx +33 -47
- package/src/renderer/components/imageFilters/Shadow.tsx +39 -0
- package/src/renderer/components/imageFilters/index.ts +1 -2
- package/src/renderer/components/index.ts +2 -0
- package/src/renderer/components/maskFilters/Blur.tsx +1 -1
- package/src/renderer/components/shapes/Box.tsx +98 -0
- package/src/renderer/components/shapes/index.ts +1 -0
- package/src/renderer/index.ts +1 -0
- package/src/renderer/nodes/Declaration.tsx +10 -0
- package/src/renderer/nodes/Drawing.tsx +6 -6
- package/src/renderer/processors/math/Math.ts +16 -0
- package/src/renderer/processors/math/Matrix3.ts +35 -31
- package/src/renderer/typeddash.ts +18 -0
- package/src/renderer/useContextBridge.tsx +21 -0
- package/src/skia/Canvas.ts +7 -0
- package/src/skia/Picture/Picture.ts +34 -0
- package/src/skia/Picture/PictureFactory.ts +9 -0
- package/src/skia/Picture/PictureRecorder.ts +18 -0
- package/src/skia/Picture/index.ts +4 -0
- package/src/skia/Picture/usePicture.ts +28 -0
- package/src/skia/Skia.ts +5 -0
- package/src/skia/index.ts +1 -0
- package/src/values/hooks/useDerivedValue.ts +1 -1
- package/src/views/SkiaView.tsx +27 -3
- package/src/views/types.ts +0 -25
- package/lib/commonjs/renderer/components/imageFilters/DropShadow.js.map +0 -1
- package/lib/module/renderer/components/imageFilters/DropShadow.js.map +0 -1
- package/src/renderer/components/imageFilters/DropShadow.tsx +0 -31
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useDerivedValue.ts"],"names":["useMemo","ValueApi","isValue","useDerivedValue","cb","values","createDerivedValue","filter"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAEA,SAASC,QAAT,QAAyB,QAAzB;AACA,SAASC,OAAT,QAAwB,
|
1
|
+
{"version":3,"sources":["useDerivedValue.ts"],"names":["useMemo","ValueApi","isValue","useDerivedValue","cb","values","createDerivedValue","filter"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAEA,SAASC,QAAT,QAAyB,QAAzB;AACA,SAASC,OAAT,QAAwB,2BAAxB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,eAAe,GAAG,CAAIC,EAAJ,EAAiBC,MAAjB,KAC7BL,OAAO,CACL,MAAMC,QAAQ,CAACK,kBAAT,CAA+BF,EAA/B,EAAmCC,MAAM,CAACE,MAAP,CAAcL,OAAd,CAAnC,CADD,EAEL;AACAG,MAHK,CADF","sourcesContent":["import { useMemo } from \"react\";\n\nimport { ValueApi } from \"../api\";\nimport { isValue } from \"../../renderer/processors\";\n\n/**\n * Creates a new derived 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 useDerivedValue = <R>(cb: () => R, values: unknown[]) =>\n useMemo(\n () => ValueApi.createDerivedValue<R>(cb, values.filter(isValue)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n values\n );\n"]}
|
@@ -1,3 +1,5 @@
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
1
3
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
4
|
|
3
5
|
import React from "react";
|
@@ -87,17 +89,16 @@ export class SkiaView extends React.Component {
|
|
87
89
|
|
88
90
|
render() {
|
89
91
|
const {
|
90
|
-
style,
|
91
92
|
mode,
|
92
|
-
debug = false
|
93
|
+
debug = false,
|
94
|
+
...viewProps
|
93
95
|
} = this.props;
|
94
|
-
return /*#__PURE__*/React.createElement(NativeSkiaView, {
|
95
|
-
style: style,
|
96
|
+
return /*#__PURE__*/React.createElement(NativeSkiaView, _extends({
|
96
97
|
collapsable: false,
|
97
98
|
nativeID: `${this._nativeId}`,
|
98
99
|
mode: mode,
|
99
100
|
debug: debug
|
100
|
-
});
|
101
|
+
}, viewProps));
|
101
102
|
}
|
102
103
|
|
103
104
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["SkiaView.tsx"],"names":["React","requireNativeComponent","SkiaViewNativeId","NativeSkiaView","SkiaViewApi","global","SkiaView","Component","constructor","props","_nativeId","onDraw","assertDrawCallbacksEnabled","setDrawCallback","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","invalidateSkiaView","setDrawMode","mode","registerValues","values","registerValuesInView","render","
|
1
|
+
{"version":3,"sources":["SkiaView.tsx"],"names":["React","requireNativeComponent","SkiaViewNativeId","NativeSkiaView","SkiaViewApi","global","SkiaView","Component","constructor","props","_nativeId","onDraw","assertDrawCallbacksEnabled","setDrawCallback","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","invalidateSkiaView","setDrawMode","mode","registerValues","values","registerValuesInView","render","debug","viewProps","Error"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAASC,sBAAT,QAAuC,cAAvC;AAWA,IAAIC,gBAAgB,GAAG,IAAvB;AAEA,MAAMC,cAAc,GAAGF,sBAAsB,CAC3C,qBAD2C,CAA7C;AAoBA,MAAM;AAAEG,EAAAA;AAAF,IAAkBC,MAAxB;AA0BA,OAAO,MAAMC,QAAN,SAAuBN,KAAK,CAACO,SAA7B,CAAsD;AAC3DC,EAAAA,WAAW,CAACC,KAAD,EAAuB;AAChC,UAAMA,KAAN;;AADgC;;AAEhC,SAAKC,SAAL,GAAiBR,gBAAgB,EAAjC;AACA,UAAM;AAAES,MAAAA;AAAF,QAAaF,KAAnB;;AACA,QAAIE,MAAJ,EAAY;AACVC,MAAAA,0BAA0B;AAC1BR,MAAAA,WAAW,CAACS,eAAZ,CAA4B,KAAKH,SAAjC,EAA4CC,MAA5C;AACD;AACF;;AAIkB,MAARG,QAAQ,GAAG;AACpB,WAAO,KAAKJ,SAAZ;AACD;;AAEDK,EAAAA,kBAAkB,CAACC,SAAD,EAA2B;AAC3C,UAAM;AAAEL,MAAAA;AAAF,QAAa,KAAKF,KAAxB;;AACA,QAAIE,MAAM,KAAKK,SAAS,CAACL,MAAzB,EAAiC;AAC/BC,MAAAA,0BAA0B;AAC1BR,MAAAA,WAAW,CAACS,eAAZ,CAA4B,KAAKH,SAAjC,EAA4CC,MAA5C;AACD;AACF;AAED;AACF;AACA;AACA;AACA;;;AACSM,EAAAA,iBAAiB,CAACC,IAAD,EAAgB;AACtCN,IAAAA,0BAA0B;AAC1B,WAAOR,WAAW,CAACa,iBAAZ,CAA8B,KAAKP,SAAnC,EAA8CQ,IAA9C,CAAP;AACD;AAED;AACF;AACA;;;AACSC,EAAAA,MAAM,GAAG;AACdP,IAAAA,0BAA0B;AAC1BR,IAAAA,WAAW,CAACgB,kBAAZ,CAA+B,KAAKV,SAApC;AACD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACSW,EAAAA,WAAW,CAACC,IAAD,EAAiB;AACjCV,IAAAA,0BAA0B;AAC1BR,IAAAA,WAAW,CAACiB,WAAZ,CAAwB,KAAKX,SAA7B,EAAwCY,IAAxC;AACD;AAED;AACF;AACA;AACA;AACA;;;AACSC,EAAAA,cAAc,CAACC,MAAD,EAAuC;AAC1DZ,IAAAA,0BAA0B;AAC1B,WAAOR,WAAW,CAACqB,oBAAZ,CAAiC,KAAKf,SAAtC,EAAiDc,MAAjD,CAAP;AACD;;AAEDE,EAAAA,MAAM,GAAG;AACP,UAAM;AAAEJ,MAAAA,IAAF;AAAQK,MAAAA,KAAK,GAAG,KAAhB;AAAuB,SAAGC;AAA1B,QAAwC,KAAKnB,KAAnD;AACA,wBACE,oBAAC,cAAD;AACE,MAAA,WAAW,EAAE,KADf;AAEE,MAAA,QAAQ,EAAG,GAAE,KAAKC,SAAU,EAF9B;AAGE,MAAA,IAAI,EAAEY,IAHR;AAIE,MAAA,KAAK,EAAEK;AAJT,OAKMC,SALN,EADF;AASD;;AA9E0D;;AAiF7D,MAAMhB,0BAA0B,GAAG,MAAM;AACvC,MACER,WAAW,KAAK,IAAhB,IACAA,WAAW,CAACS,eAAZ,IAA+B,IAD/B,IAEAT,WAAW,CAACgB,kBAAZ,IAAkC,IAHpC,EAIE;AACA,UAAMS,KAAK,CAAC,0BAAD,CAAX;AACD;AACF,CARD","sourcesContent":["import React from \"react\";\nimport type { ViewProps } from \"react-native\";\nimport { requireNativeComponent } from \"react-native\";\n\nimport type { SkImage, SkRect } from \"../skia\";\nimport type { SkiaReadonlyValue } from \"../values\";\n\nimport type {\n DrawMode,\n RNSkiaDrawCallback,\n NativeSkiaViewProps,\n} from \"./types\";\n\nlet SkiaViewNativeId = 1000;\n\nconst NativeSkiaView = requireNativeComponent<NativeSkiaViewProps>(\n \"ReactNativeSkiaView\"\n);\n\ndeclare global {\n var SkiaViewApi: {\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}\n\nconst { SkiaViewApi } = global;\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\nexport class SkiaView extends React.Component<SkiaViewProps> {\n constructor(props: SkiaViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId++;\n const { onDraw } = props;\n if (onDraw) {\n assertDrawCallbacksEnabled();\n SkiaViewApi.setDrawCallback(this._nativeId, onDraw);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaViewProps) {\n const { onDraw } = this.props;\n if (onDraw !== prevProps.onDraw) {\n assertDrawCallbacksEnabled();\n SkiaViewApi.setDrawCallback(this._nativeId, onDraw);\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 assertDrawCallbacksEnabled();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertDrawCallbacksEnabled();\n SkiaViewApi.invalidateSkiaView(this._nativeId);\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n assertDrawCallbacksEnabled();\n SkiaViewApi.setDrawMode(this._nativeId, mode);\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: SkiaReadonlyValue<unknown>[]) {\n assertDrawCallbacksEnabled();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertDrawCallbacksEnabled = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setDrawCallback == null ||\n SkiaViewApi.invalidateSkiaView == null\n ) {\n throw Error(\"Skia Api is not enabled.\");\n }\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["types.ts"],"names":["TouchType"],"mappings":"AAWA,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 { SkCanvas } from \"../skia/Canvas\";\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\
|
1
|
+
{"version":3,"sources":["types.ts"],"names":["TouchType"],"mappings":"AAWA,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 { SkCanvas } from \"../skia/Canvas\";\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"]}
|
@@ -1,19 +1,15 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import type { RefObject, ReactNode, ComponentProps
|
2
|
+
import type { RefObject, ReactNode, ComponentProps } from "react";
|
3
3
|
import ReactReconciler from "react-reconciler";
|
4
4
|
import { SkiaView } from "../views";
|
5
5
|
import type { TouchHandler } from "../views";
|
6
6
|
import type { FontMgr } from "../skia/FontMgr/FontMgr";
|
7
|
+
import type { SkiaReadonlyValue } from "../values/types";
|
7
8
|
import { Container } from "./nodes";
|
8
|
-
export declare const
|
9
|
-
children: ReactNode;
|
10
|
-
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
11
|
-
interface CanvasContext {
|
9
|
+
export declare const useCanvasSize: () => SkiaReadonlyValue<{
|
12
10
|
width: number;
|
13
11
|
height: number;
|
14
|
-
}
|
15
|
-
declare const CanvasContext: React.Context<CanvasContext | null>;
|
16
|
-
export declare const useCanvas: () => CanvasContext;
|
12
|
+
}>;
|
17
13
|
export declare const skiaReconciler: ReactReconciler.Reconciler<Container, import("./nodes").Node<unknown>, import("./nodes").Node<unknown>, import("./nodes").Node<unknown>, import("./nodes").Node<unknown>>;
|
18
14
|
export declare const useCanvasRef: () => React.RefObject<SkiaView>;
|
19
15
|
export interface CanvasProps extends ComponentProps<typeof SkiaView> {
|
@@ -22,5 +18,4 @@ export interface CanvasProps extends ComponentProps<typeof SkiaView> {
|
|
22
18
|
onTouch?: TouchHandler;
|
23
19
|
fontMgr?: FontMgr;
|
24
20
|
}
|
25
|
-
export declare const Canvas: React.ForwardRefExoticComponent<Pick<CanvasProps, "style" | "mode" | "debug" | "onDraw" | "
|
26
|
-
export {};
|
21
|
+
export declare const Canvas: React.ForwardRefExoticComponent<Pick<CanvasProps, "style" | "children" | "mode" | "debug" | "onDraw" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "onTouch" | "fontMgr"> & React.RefAttributes<SkiaView>>;
|
@@ -1,12 +1,3 @@
|
|
1
|
-
|
2
|
-
import type {
|
3
|
-
|
4
|
-
export interface InnerShadowProps {
|
5
|
-
dx: number;
|
6
|
-
dy: number;
|
7
|
-
blur: number;
|
8
|
-
color: Color;
|
9
|
-
shadowOnly?: boolean;
|
10
|
-
inner?: boolean;
|
11
|
-
}
|
12
|
-
export declare const InnerShadow: (props: AnimatedProps<InnerShadowProps>) => JSX.Element;
|
1
|
+
import type { SkColor } from "../../../skia";
|
2
|
+
import type { SkImageFilter } from "../../../skia/ImageFilter/ImageFilter";
|
3
|
+
export declare const MakeInnerShadow: (shadowOnly: boolean | undefined, dx: number, dy: number, sigmaX: number, sigmaY: number, color: SkColor, input: SkImageFilter | null) => SkImageFilter;
|
@@ -1,11 +1,12 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { AnimatedProps } from "../../processors/Animations/Animations";
|
3
3
|
import type { Color } from "../../../skia/Color";
|
4
|
-
export interface
|
4
|
+
export interface ShadowProps {
|
5
5
|
dx: number;
|
6
6
|
dy: number;
|
7
7
|
blur: number;
|
8
8
|
color: Color;
|
9
|
+
inner?: boolean;
|
9
10
|
shadowOnly?: boolean;
|
10
11
|
}
|
11
|
-
export declare const
|
12
|
+
export declare const Shadow: (props: AnimatedProps<ShadowProps>) => JSX.Element;
|
@@ -8,9 +8,11 @@ export * from "./maskFilters";
|
|
8
8
|
export * from "./imageFilters";
|
9
9
|
export * from "./pathEffects";
|
10
10
|
export * from "../processors";
|
11
|
+
export * from "./Picture";
|
11
12
|
export * from "./Group";
|
12
13
|
export * from "./Mask";
|
13
14
|
export * from "./Paint";
|
14
15
|
export * from "./Compose";
|
15
16
|
export * from "./Blend";
|
16
17
|
export * from "./Defs";
|
18
|
+
export * from "./Drawing";
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { Color, SkRRect } from "../../../skia";
|
3
|
+
import type { AnimatedProps, CustomPaintProps } from "../../processors";
|
4
|
+
import type { SkRect } from "../../../skia/Rect";
|
5
|
+
interface BoxShadowProps {
|
6
|
+
dx?: number;
|
7
|
+
dy?: number;
|
8
|
+
spread?: number;
|
9
|
+
blur: number;
|
10
|
+
color?: Color;
|
11
|
+
inner?: boolean;
|
12
|
+
}
|
13
|
+
export declare const BoxShadow: (props: AnimatedProps<BoxShadowProps>) => JSX.Element;
|
14
|
+
interface BoxProps extends CustomPaintProps {
|
15
|
+
box: SkRRect | SkRect;
|
16
|
+
}
|
17
|
+
export declare const Box: {
|
18
|
+
(props: AnimatedProps<BoxProps>): JSX.Element;
|
19
|
+
defaultProps: {
|
20
|
+
shadows: never[];
|
21
|
+
};
|
22
|
+
};
|
23
|
+
export {};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { DependencyList } from "react";
|
1
2
|
import type { DrawingContext } from "../DrawingContext";
|
2
3
|
import type { SkJSIInstance } from "../../skia/JsiInstance";
|
3
4
|
import type { AnimatedProps } from "../processors";
|
@@ -6,6 +7,7 @@ import { Node } from "./Node";
|
|
6
7
|
export declare type DeclarationResult = SkJSIInstance<string> | null;
|
7
8
|
declare type DeclarationCallback<T> = (props: T, children: DeclarationResult[], ctx: DrawingContext) => DeclarationResult;
|
8
9
|
export declare const createDeclaration: <T>(cb: DeclarationCallback<T>) => DeclarationCallback<T>;
|
10
|
+
export declare const useDeclaration: <P>(cb: DeclarationCallback<P>, deps?: DependencyList | undefined) => DeclarationCallback<P>;
|
9
11
|
export interface DeclarationProps<P> {
|
10
12
|
onDeclare: DeclarationCallback<P>;
|
11
13
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { ReactNode } from "react";
|
1
|
+
import type { DependencyList, ReactNode } from "react";
|
2
2
|
import type { DrawingContext } from "../DrawingContext";
|
3
3
|
import type { AnimatedProps } from "../processors/Animations/Animations";
|
4
4
|
import type { DependencyManager } from "../DependencyManager";
|
@@ -6,12 +6,12 @@ import { Node } from "./Node";
|
|
6
6
|
declare type DrawingCallback<P> = (ctx: DrawingContext, props: P, node: Node<P>) => void;
|
7
7
|
declare type OnDrawCallback<P> = (ctx: DrawingContext, props: P, node: Node<P>) => void;
|
8
8
|
export declare const createDrawing: <P>(cb: OnDrawCallback<P>) => DrawingCallback<P>;
|
9
|
+
export declare const useDrawing: <P>(cb: OnDrawCallback<P>, deps?: DependencyList | undefined) => OnDrawCallback<P>;
|
9
10
|
export declare type DrawingProps<T> = {
|
10
11
|
onDraw: DrawingCallback<T>;
|
11
12
|
skipProcessing?: boolean;
|
12
13
|
children?: ReactNode | ReactNode[];
|
13
14
|
};
|
14
|
-
export declare const Drawing: <P>(props: DrawingProps<P>) => JSX.Element;
|
15
15
|
export declare class DrawingNode<P> extends Node<P> {
|
16
16
|
onDraw: DrawingCallback<P>;
|
17
17
|
skipProcessing: boolean;
|
@@ -1 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* Linear interpolation
|
3
|
+
* @param value
|
4
|
+
* @param x
|
5
|
+
* @param y
|
6
|
+
*/
|
1
7
|
export declare const mix: (value: number, x: number, y: number) => number;
|
8
|
+
/**
|
9
|
+
* @summary Clamps a node with a lower and upper bound.
|
10
|
+
* @example
|
11
|
+
clamp(-1, 0, 100); // 0
|
12
|
+
clamp(1, 0, 100); // 1
|
13
|
+
clamp(101, 0, 100); // 100
|
14
|
+
*/
|
15
|
+
export declare const clamp: (value: number, lowerBound: number, upperBound: number) => number;
|
@@ -9,5 +9,6 @@ declare type Transformations = {
|
|
9
9
|
readonly [Name in Transform2dName]: number;
|
10
10
|
};
|
11
11
|
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 matrixVecMul3: (m: Matrix3, v: Vec3) => readonly [number, number, number];
|
12
13
|
export declare const processTransform2d: (transforms: Transforms2d) => SkMatrix;
|
13
14
|
export {};
|
@@ -12,6 +12,7 @@ import type { SkMatrix } from "./Matrix";
|
|
12
12
|
import type { SkImageFilter } from "./ImageFilter";
|
13
13
|
import type { SkVertices } from "./Vertices";
|
14
14
|
import type { SkTextBlob } from "./TextBlob";
|
15
|
+
import type { SkPicture } from "./Picture";
|
15
16
|
export declare enum ClipOp {
|
16
17
|
Difference = 0,
|
17
18
|
Intersect = 1
|
@@ -372,4 +373,9 @@ export interface SkCanvas {
|
|
372
373
|
* @param m
|
373
374
|
*/
|
374
375
|
concat(m: SkMatrix): void;
|
376
|
+
/**
|
377
|
+
* Draws the given picture using the current clip, current matrix, and the provided paint.
|
378
|
+
* @param skp
|
379
|
+
*/
|
380
|
+
drawPicture(skp: SkPicture): void;
|
375
381
|
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import type { InputColorMatrix } from "../ColorFilter";
|
2
|
+
import type { FilterMode } from "../Image";
|
3
|
+
import type { TileMode } from "../ImageFilter";
|
4
|
+
import type { SkRect } from "../Rect";
|
5
|
+
import type { IShader } from "../Shader";
|
6
|
+
export interface SkPicture {
|
7
|
+
/**
|
8
|
+
* Returns a new shader that will draw with this picture.
|
9
|
+
*
|
10
|
+
* @param tmx The tiling mode to use when sampling in the x-direction.
|
11
|
+
* @param tmy The tiling mode to use when sampling in the y-direction.
|
12
|
+
* @param mode How to filter the tiles
|
13
|
+
* @param localMatrix Optional matrix used when sampling
|
14
|
+
* @param tileRect The tile rectangle in picture coordinates: this represents the subset
|
15
|
+
* (or superset) of the picture used when building a tile. It is not
|
16
|
+
* affected by localMatrix and does not imply scaling (only translation
|
17
|
+
* and cropping). If null, the tile rect is considered equal to the picture
|
18
|
+
* bounds.
|
19
|
+
*/
|
20
|
+
makeShader(tmx: TileMode, tmy: TileMode, mode: FilterMode, localMatrix?: InputColorMatrix, tileRect?: SkRect): IShader;
|
21
|
+
/**
|
22
|
+
* Returns the serialized format of this SkPicture. The format may change at anytime and
|
23
|
+
* no promises are made for backwards or forward compatibility.
|
24
|
+
*/
|
25
|
+
serialize(): Uint8Array | null;
|
26
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { SkCanvas } from "../Canvas";
|
2
|
+
import type { SkRect } from "../Rect";
|
3
|
+
import type { SkPicture } from "./Picture";
|
4
|
+
export interface SkPictureRecorder {
|
5
|
+
/**
|
6
|
+
* Returns a canvas on which to draw. When done drawing, call finishRecordingAsPicture()
|
7
|
+
*
|
8
|
+
* @param bounds - a rect to cull the results.
|
9
|
+
*/
|
10
|
+
beginRecording(bounds: SkRect): SkCanvas;
|
11
|
+
/**
|
12
|
+
* Returns the captured draw commands as a picture and invalidates the canvas returned earlier.
|
13
|
+
*/
|
14
|
+
finishRecordingAsPicture(): SkPicture;
|
15
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { DependencyList } from "react";
|
2
|
+
import type { SkCanvas } from "../Canvas";
|
3
|
+
import type { SkRect } from "../Rect";
|
4
|
+
import type { SkPicture } from "./Picture";
|
5
|
+
/**
|
6
|
+
* Memoizes and returns an SkPicture that can be drawn to another canvas.
|
7
|
+
* @param rect Picture bounds
|
8
|
+
* @param cb Callback for drawing to the canvas
|
9
|
+
* @returns SkPicture
|
10
|
+
*/
|
11
|
+
export declare const usePicture: (rect: SkRect, cb: (canvas: SkCanvas) => void, deps?: DependencyList) => SkPicture;
|
@@ -25,6 +25,7 @@ import "./NativeSetup";
|
|
25
25
|
import type { SkRSXform } from "./RSXform";
|
26
26
|
import type { SkPath } from "./Path/Path";
|
27
27
|
import type { SkContourMeasureIter } from "./ContourMeasure";
|
28
|
+
import type { PictureFactory, SkPictureRecorder } from "./Picture";
|
28
29
|
/**
|
29
30
|
* Declares the interface for the native Skia API
|
30
31
|
*/
|
@@ -35,6 +36,8 @@ export interface Skia {
|
|
35
36
|
RSXform: (scos: number, ssin: number, tx: number, ty: number) => SkRSXform;
|
36
37
|
ContourMeasureIter: (path: SkPath, forceClosed: boolean, resScale: number) => SkContourMeasureIter;
|
37
38
|
Paint: () => SkPaint;
|
39
|
+
PictureRecorder: () => SkPictureRecorder;
|
40
|
+
Picture: PictureFactory;
|
38
41
|
Path: PathFactory;
|
39
42
|
Matrix: () => SkMatrix;
|
40
43
|
ColorFilter: ColorFilterFactory;
|
@@ -89,6 +92,8 @@ export declare const Skia: {
|
|
89
92
|
XYWHRect: (x: number, y: number, width: number, height: number) => SkRect;
|
90
93
|
RRectXY: (rect: SkRect, rx: number, ry: number) => SkRRect;
|
91
94
|
Paint: () => SkPaint;
|
95
|
+
PictureRecorder: () => SkPictureRecorder;
|
96
|
+
Picture: PictureFactory;
|
92
97
|
Path: PathFactory;
|
93
98
|
ColorFilter: ColorFilterFactory;
|
94
99
|
ContourMeasureIter: (path: SkPath, forceClosed: boolean, resScale: number) => SkContourMeasureIter;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import React from "react";
|
2
|
+
import type { ViewProps } from "react-native";
|
2
3
|
import type { SkImage, SkRect } from "../skia";
|
3
4
|
import type { SkiaReadonlyValue } from "../values";
|
4
|
-
import type { DrawMode,
|
5
|
+
import type { DrawMode, RNSkiaDrawCallback } from "./types";
|
5
6
|
declare global {
|
6
7
|
var SkiaViewApi: {
|
7
8
|
invalidateSkiaView: (nativeId: number) => void;
|
@@ -11,6 +12,29 @@ declare global {
|
|
11
12
|
registerValuesInView: (nativeId: number, values: SkiaReadonlyValue<unknown>[]) => () => void;
|
12
13
|
};
|
13
14
|
}
|
15
|
+
export interface SkiaViewProps extends ViewProps {
|
16
|
+
/**
|
17
|
+
* Sets the drawing mode for the skia view. There are two drawing
|
18
|
+
* modes, "continuous" and "default", where the continuous mode will
|
19
|
+
* continuously redraw the view, and the default mode will only
|
20
|
+
* redraw when any of the regular react properties are changed like
|
21
|
+
* sizes and margins.
|
22
|
+
*/
|
23
|
+
mode?: DrawMode;
|
24
|
+
/**
|
25
|
+
* When set to true the view will display information about the
|
26
|
+
* average time it takes to render.
|
27
|
+
*/
|
28
|
+
debug?: boolean;
|
29
|
+
/**
|
30
|
+
* Draw callback. Will be called whenever the view is invalidated and
|
31
|
+
* needs to redraw. This is either caused by a change in a react
|
32
|
+
* property, a touch event, or a call to redraw. If the view is in
|
33
|
+
* continuous mode the callback will be called 60 frames per second
|
34
|
+
* by the native view.
|
35
|
+
*/
|
36
|
+
onDraw?: RNSkiaDrawCallback;
|
37
|
+
}
|
14
38
|
export declare class SkiaView extends React.Component<SkiaViewProps> {
|
15
39
|
constructor(props: SkiaViewProps);
|
16
40
|
private _nativeId;
|
@@ -35,30 +35,6 @@ export declare type TouchHandlers = {
|
|
35
35
|
};
|
36
36
|
export declare type TouchHandler = (touchInfo: Array<Array<TouchInfo>>) => void;
|
37
37
|
export declare type RNSkiaDrawCallback = (canvas: SkCanvas, info: DrawingInfo) => void;
|
38
|
-
export declare type SkiaViewProps = {
|
39
|
-
style?: ViewProps["style"];
|
40
|
-
/**
|
41
|
-
* Sets the drawing mode for the skia view. There are two drawing
|
42
|
-
* modes, "continuous" and "default", where the continuous mode will
|
43
|
-
* continuously redraw the view, and the default mode will only
|
44
|
-
* redraw when any of the regular react properties are changed like
|
45
|
-
* sizes and margins.
|
46
|
-
*/
|
47
|
-
mode?: DrawMode;
|
48
|
-
/**
|
49
|
-
* When set to true the view will display information about the
|
50
|
-
* average time it takes to render.
|
51
|
-
*/
|
52
|
-
debug?: boolean;
|
53
|
-
/**
|
54
|
-
* Draw callback. Will be called whenever the view is invalidated and
|
55
|
-
* needs to redraw. This is either caused by a change in a react
|
56
|
-
* property, a touch event, or a call to redraw. If the view is in
|
57
|
-
* continuous mode the callback will be called 60 frames per second
|
58
|
-
* by the native view.
|
59
|
-
*/
|
60
|
-
onDraw?: RNSkiaDrawCallback;
|
61
|
-
};
|
62
38
|
/**
|
63
39
|
* Listener interface for value changes
|
64
40
|
*/
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -6,32 +6,32 @@
|
|
6
6
|
<array>
|
7
7
|
<dict>
|
8
8
|
<key>LibraryIdentifier</key>
|
9
|
-
<string>ios-
|
9
|
+
<string>ios-arm64_arm64e</string>
|
10
10
|
<key>LibraryPath</key>
|
11
11
|
<string>libsvg.a</string>
|
12
12
|
<key>SupportedArchitectures</key>
|
13
13
|
<array>
|
14
14
|
<string>arm64</string>
|
15
15
|
<string>arm64e</string>
|
16
|
-
<string>x86_64</string>
|
17
16
|
</array>
|
18
17
|
<key>SupportedPlatform</key>
|
19
18
|
<string>ios</string>
|
20
|
-
<key>SupportedPlatformVariant</key>
|
21
|
-
<string>simulator</string>
|
22
19
|
</dict>
|
23
20
|
<dict>
|
24
21
|
<key>LibraryIdentifier</key>
|
25
|
-
<string>ios-
|
22
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
26
23
|
<key>LibraryPath</key>
|
27
24
|
<string>libsvg.a</string>
|
28
25
|
<key>SupportedArchitectures</key>
|
29
26
|
<array>
|
30
27
|
<string>arm64</string>
|
31
28
|
<string>arm64e</string>
|
29
|
+
<string>x86_64</string>
|
32
30
|
</array>
|
33
31
|
<key>SupportedPlatform</key>
|
34
32
|
<string>ios</string>
|
33
|
+
<key>SupportedPlatformVariant</key>
|
34
|
+
<string>simulator</string>
|
35
35
|
</dict>
|
36
36
|
</array>
|
37
37
|
<key>CFBundlePackageType</key>
|
Binary file
|
Binary file
|