From 9c5ccd89b8ceb1845c0d94207367c9f517c5cba6 Mon Sep 17 00:00:00 2001 From: Thomas Vo Date: Tue, 29 Oct 2024 12:18:53 -0700 Subject: [PATCH] Strict type checking and linting (#114) * fix * fix * fix --------- Co-authored-by: thomasvo --- example/App.tsx | 18 +- example/style.ts | 32 +- lib/commonjs/ReactNativeZoomableView.js | 217 +- lib/commonjs/ReactNativeZoomableView.js.map | 2 +- .../ReactNativeZoomableViewWithGestures.js | 293 --- ...ReactNativeZoomableViewWithGestures.js.map | 1 - .../components/AnimatedTouchFeedback.js | 18 +- .../components/AnimatedTouchFeedback.js.map | 2 +- lib/commonjs/components/StaticPin.js | 19 +- lib/commonjs/components/StaticPin.js.map | 2 +- lib/commonjs/debugHelper/index.js | 8 +- lib/commonjs/debugHelper/index.js.map | 2 +- lib/commonjs/helper/coordinateConversion.js | 4 +- .../helper/coordinateConversion.js.map | 2 +- lib/commonjs/helper/index.js | 8 +- lib/commonjs/helper/index.js.map | 2 +- lib/commonjs/index.js | 8 - lib/commonjs/index.js.map | 2 +- lib/commonjs/typings/index.js.map | 2 +- lib/module/ReactNativeZoomableView.js | 217 +- lib/module/ReactNativeZoomableView.js.map | 2 +- .../ReactNativeZoomableViewWithGestures.js | 280 --- ...ReactNativeZoomableViewWithGestures.js.map | 1 - .../components/AnimatedTouchFeedback.js | 18 +- .../components/AnimatedTouchFeedback.js.map | 2 +- lib/module/components/StaticPin.js | 19 +- lib/module/components/StaticPin.js.map | 2 +- lib/module/debugHelper/index.js | 8 +- lib/module/debugHelper/index.js.map | 2 +- lib/module/helper/coordinateConversion.js | 4 +- lib/module/helper/coordinateConversion.js.map | 2 +- lib/module/helper/index.js | 8 +- lib/module/helper/index.js.map | 2 +- lib/module/index.js | 3 +- lib/module/index.js.map | 2 +- lib/module/typings/index.js.map | 2 +- lib/typescript/ReactNativeZoomableView.d.ts | 60 +- .../ReactNativeZoomableViewWithGestures.d.ts | 79 - .../components/AnimatedTouchFeedback.d.ts | 4 +- lib/typescript/components/StaticPin.d.ts | 8 +- lib/typescript/debugHelper/index.d.ts | 8 +- lib/typescript/index.d.ts | 3 +- lib/typescript/typings/index.d.ts | 21 +- package.json | 55 +- src/ReactNativeZoomableView.tsx | 242 ++- src/ReactNativeZoomableViewWithGestures.tsx | 253 --- src/components/AnimatedTouchFeedback.tsx | 14 +- src/components/StaticPin.tsx | 17 +- src/debugHelper/index.tsx | 4 +- src/helper/coordinateConversion.ts | 4 +- src/helper/index.ts | 4 +- src/index.tsx | 2 - src/typings/index.ts | 31 +- tsconfig.json | 4 +- yarn.lock | 1922 +++++++++++++---- 55 files changed, 2132 insertions(+), 1819 deletions(-) delete mode 100644 lib/commonjs/ReactNativeZoomableViewWithGestures.js delete mode 100644 lib/commonjs/ReactNativeZoomableViewWithGestures.js.map delete mode 100644 lib/module/ReactNativeZoomableViewWithGestures.js delete mode 100644 lib/module/ReactNativeZoomableViewWithGestures.js.map delete mode 100644 lib/typescript/ReactNativeZoomableViewWithGestures.d.ts delete mode 100644 src/ReactNativeZoomableViewWithGestures.tsx diff --git a/example/App.tsx b/example/App.tsx index 30344be..4bf694a 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -1,6 +1,6 @@ import React, { useCallback, useRef, useState } from 'react'; import { View, Text, Image, Animated, Button } from 'react-native'; -// @ts-ignore + import { ReactNativeZoomableView } from '@openspacelabs/react-native-zoomable-view'; import { styles } from './style'; import { debounce } from 'lodash'; @@ -33,16 +33,18 @@ export default function App() { [] )(); - const staticPinPosition = size - ? { x: size.width / 2, y: size.height / 2 } - : undefined; - + const staticPinPosition = { x: size.width / 2, y: size.height / 2 }; const { size: contentSize } = applyContainResizeMode(imageSize, size); return ( ReactNativeZoomableView - setSize(e.nativeEvent.layout)}> + { + setSize(e.nativeEvent.layout); + }} + > onStaticPinPositionMove: {stringifyPoint(movePin)}