Refine app typings and drop type casts (#850)

* Refine typings and drop casts

* Fix type references

* Remove leftover casts

* format

* fix types

* fix typigns

* fix types. revert nfc method selection changes
This commit is contained in:
Justin Hernandez
2025-08-07 17:38:12 -07:00
committed by GitHub
parent fd899e3499
commit 026fda751b
29 changed files with 540 additions and 166 deletions

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
import React from 'react';
import type { ViewStyle } from 'react-native';
import type { GestureResponderEvent, ViewStyle } from 'react-native';
import { Platform, StyleSheet } from 'react-native';
import type { ViewProps } from 'tamagui';
import { Button, Text } from 'tamagui';
@@ -22,7 +22,7 @@ interface AbstractButtonProps extends ButtonProps {
borderColor?: string;
borderWidth?: number;
color: string;
onPress?: ((e: any) => void) | null | undefined;
onPress?: ((e: GestureResponderEvent) => void) | null | undefined;
}
const { trackEvent: analyticsTrackEvent } = analytics();
@@ -47,7 +47,7 @@ export default function AbstractButton({
}: AbstractButtonProps) {
const hasBorder = borderColor ? true : false;
const handlePress = (e: any) => {
const handlePress = (e: GestureResponderEvent) => {
if (trackEvent) {
// attempt to remove event category from click event
const parsedEvent = trackEvent?.split(':')?.[1]?.trim();

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
import React, { useCallback } from 'react';
import type { NativeSyntheticEvent } from 'react-native';
import type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
import { PixelRatio, Platform, requireNativeComponent } from 'react-native';
import { extractMRZInfo } from '../../utils/utils';
@@ -28,7 +28,7 @@ interface NativePassportOCRViewProps {
stackTrace: string;
}>,
) => void;
style?: any; // Or a more specific style type if available
style?: StyleProp<ViewStyle>;
}
const RCTPassportOCRViewNativeComponent = Platform.select({

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
import React, { useCallback } from 'react';
import type { NativeSyntheticEvent } from 'react-native';
import type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
import { PixelRatio, Platform, requireNativeComponent } from 'react-native';
import { RCTFragment } from './RCTFragment';
@@ -15,7 +15,7 @@ interface NativeQRCodeScannerViewProps {
stackTrace: string;
}>,
) => void;
style?: any; // Or a more specific style type
style?: StyleProp<ViewStyle>;
}
const QRCodeNativeComponent = Platform.select({