diff --git a/.github/actions/javascript/authorChecklist/categories/index.ts b/.github/actions/javascript/authorChecklist/categories/index.ts index 53e0ed2ab838..5ed63c647e74 100644 --- a/.github/actions/javascript/authorChecklist/categories/index.ts +++ b/.github/actions/javascript/authorChecklist/categories/index.ts @@ -1,4 +1,4 @@ -import Category from './Category'; +import type Category from './Category'; import newComponent from './newComponentCategory'; const categories: Category[] = [newComponent]; diff --git a/.github/actions/javascript/authorChecklist/categories/newComponentCategory.ts b/.github/actions/javascript/authorChecklist/categories/newComponentCategory.ts index 63e26c015a5a..405a687b5d3e 100644 --- a/.github/actions/javascript/authorChecklist/categories/newComponentCategory.ts +++ b/.github/actions/javascript/authorChecklist/categories/newComponentCategory.ts @@ -4,7 +4,7 @@ import traverse from '@babel/traverse'; import CONST from '../../../../libs/CONST'; import GithubUtils from '../../../../libs/GithubUtils'; import promiseSome from '../../../../libs/promiseSome'; -import Category from './Category'; +import type Category from './Category'; type SuperClassType = {superClass: {name?: string; object: {name: string}; property: {name: string}} | null; name: string}; diff --git a/assets/emojis/common.ts b/assets/emojis/common.ts index cbefb21cf2d6..b23383590c51 100644 --- a/assets/emojis/common.ts +++ b/assets/emojis/common.ts @@ -7,7 +7,7 @@ import TravelAndPlaces from '@assets/images/emojiCategoryIcons/plane.svg'; import AnimalsAndNature from '@assets/images/emojiCategoryIcons/plant.svg'; import Activities from '@assets/images/emojiCategoryIcons/soccer-ball.svg'; import FrequentlyUsed from '@assets/images/history.svg'; -import {HeaderEmoji, PickerEmojis} from './types'; +import type {HeaderEmoji, PickerEmojis} from './types'; const skinTones = [ { diff --git a/assets/emojis/en.ts b/assets/emojis/en.ts index 0a1ca7611117..28051e5ecd99 100644 --- a/assets/emojis/en.ts +++ b/assets/emojis/en.ts @@ -1,4 +1,4 @@ -import {EmojisList} from './types'; +import type {EmojisList} from './types'; /* eslint-disable @typescript-eslint/naming-convention */ const enEmojis: EmojisList = { diff --git a/assets/emojis/es.ts b/assets/emojis/es.ts index 46f825643859..0d23f887f556 100644 --- a/assets/emojis/es.ts +++ b/assets/emojis/es.ts @@ -1,4 +1,4 @@ -import {EmojisList} from './types'; +import type {EmojisList} from './types'; /* eslint-disable @typescript-eslint/naming-convention */ const esEmojis: EmojisList = { diff --git a/assets/emojis/index.ts b/assets/emojis/index.ts index bc62adc4b252..5e5565da1499 100644 --- a/assets/emojis/index.ts +++ b/assets/emojis/index.ts @@ -1,7 +1,7 @@ import emojis from './common'; import enEmojis from './en'; import esEmojis from './es'; -import {Emoji} from './types'; +import type {Emoji} from './types'; type EmojiTable = Record; diff --git a/assets/emojis/types.ts b/assets/emojis/types.ts index c3a3b692f202..e8c222fde948 100644 --- a/assets/emojis/types.ts +++ b/assets/emojis/types.ts @@ -1,4 +1,4 @@ -import IconAsset from '@src/types/utils/IconAsset'; +import type IconAsset from '@src/types/utils/IconAsset'; type Emoji = { code: string; diff --git a/src/CONFIG.ts b/src/CONFIG.ts index 61e347671269..37da65f0c305 100644 --- a/src/CONFIG.ts +++ b/src/CONFIG.ts @@ -1,5 +1,6 @@ import {Platform} from 'react-native'; -import Config, {NativeConfig} from 'react-native-config'; +import type {NativeConfig} from 'react-native-config'; +import Config from 'react-native-config'; import CONST from './CONST'; import getPlatform from './libs/getPlatform'; import * as Url from './libs/Url'; diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index dff3a0aa441b..89ddbdc06883 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -1,8 +1,8 @@ -import {OnyxEntry} from 'react-native-onyx/lib/types'; -import {ValueOf} from 'type-fest'; -import CONST from './CONST'; -import * as OnyxTypes from './types/onyx'; -import DeepValueOf from './types/utils/DeepValueOf'; +import type {OnyxEntry} from 'react-native-onyx/lib/types'; +import type {ValueOf} from 'type-fest'; +import type CONST from './CONST'; +import type * as OnyxTypes from './types/onyx'; +import type DeepValueOf from './types/utils/DeepValueOf'; /** * This is a file containing constants for all the top level keys in our store diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 49067d1c7b8f..35fa4bbf0837 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -1,5 +1,5 @@ -import {IsEqual, ValueOf} from 'type-fest'; -import CONST from './CONST'; +import type {IsEqual, ValueOf} from 'type-fest'; +import type CONST from './CONST'; // This is a file containing constants for all the routes we want to be able to go to diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 26a23e7efadc..91c4153bacd2 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -2,7 +2,7 @@ * This is a file containing constants for all of the screen names. In most cases, we should use the routes for * navigation. But there are situations where we may need to access screen names directly. */ -import DeepValueOf from './types/utils/DeepValueOf'; +import type DeepValueOf from './types/utils/DeepValueOf'; const PROTECTED_SCREENS = { HOME: 'Home', diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly.tsx b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly.tsx index 1bcdbb383f7a..48774699fcb5 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly.tsx +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly.tsx @@ -1,6 +1,7 @@ import Str from 'expensify-common/lib/str'; import React, {useEffect, useRef} from 'react'; -import {Text as RNText, StyleSheet} from 'react-native'; +import type {Text as RNText} from 'react-native'; +import { StyleSheet} from 'react-native'; import PressableWithSecondaryInteraction from '@components/PressableWithSecondaryInteraction'; import Text from '@components/Text'; import Tooltip from '@components/Tooltip'; diff --git a/src/components/AnchorForCommentsOnly/types.ts b/src/components/AnchorForCommentsOnly/types.ts index 005364c2077f..eea8571f5277 100644 --- a/src/components/AnchorForCommentsOnly/types.ts +++ b/src/components/AnchorForCommentsOnly/types.ts @@ -1,5 +1,5 @@ -import {StyleProp, TextStyle} from 'react-native'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type {StyleProp, TextStyle} from 'react-native'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type AnchorForCommentsOnlyProps = ChildrenProps & { /** The URL to open */ diff --git a/src/components/AnimatedStep/AnimatedStepContext.ts b/src/components/AnimatedStep/AnimatedStepContext.ts index 3b4c5f79a34f..14dba4b27cc2 100644 --- a/src/components/AnimatedStep/AnimatedStepContext.ts +++ b/src/components/AnimatedStep/AnimatedStepContext.ts @@ -1,6 +1,7 @@ -import React, {createContext} from 'react'; -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; +import type React from 'react'; +import {createContext} from 'react'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; type AnimationDirection = ValueOf; diff --git a/src/components/AnimatedStep/AnimatedStepProvider.tsx b/src/components/AnimatedStep/AnimatedStepProvider.tsx index 53b3a0e0a53d..ea268e1d52cb 100644 --- a/src/components/AnimatedStep/AnimatedStepProvider.tsx +++ b/src/components/AnimatedStep/AnimatedStepProvider.tsx @@ -1,7 +1,8 @@ import React, {useMemo, useState} from 'react'; import CONST from '@src/CONST'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; -import AnimatedStepContext, {AnimationDirection} from './AnimatedStepContext'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; +import type {AnimationDirection} from './AnimatedStepContext'; +import AnimatedStepContext from './AnimatedStepContext'; function AnimatedStepProvider({children}: ChildrenProps): React.ReactNode { const [animationDirection, setAnimationDirection] = useState(CONST.ANIMATION_DIRECTION.IN); diff --git a/src/components/AnimatedStep/index.tsx b/src/components/AnimatedStep/index.tsx index e2b9952c0617..66d2108ca5d8 100644 --- a/src/components/AnimatedStep/index.tsx +++ b/src/components/AnimatedStep/index.tsx @@ -1,11 +1,11 @@ import React, {useMemo} from 'react'; -import {StyleProp, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; import * as Animatable from 'react-native-animatable'; import useThemeStyles from '@hooks/useThemeStyles'; import useNativeDriver from '@libs/useNativeDriver'; import CONST from '@src/CONST'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; -import {AnimationDirection} from './AnimatedStepContext'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; +import type {AnimationDirection} from './AnimatedStepContext'; type AnimatedStepProps = ChildrenProps & { /** Styles to be assigned to Container */ diff --git a/src/components/AnimatedStep/useAnimatedStepContext.ts b/src/components/AnimatedStep/useAnimatedStepContext.ts index 3edc71e5289e..2adde8fd576e 100644 --- a/src/components/AnimatedStep/useAnimatedStepContext.ts +++ b/src/components/AnimatedStep/useAnimatedStepContext.ts @@ -1,5 +1,6 @@ import {useContext} from 'react'; -import AnimatedStepContext, {StepContext} from './AnimatedStepContext'; +import type {StepContext} from './AnimatedStepContext'; +import AnimatedStepContext from './AnimatedStepContext'; function useAnimatedStepContext(): StepContext { const context = useContext(AnimatedStepContext); diff --git a/src/components/AnonymousReportFooter.tsx b/src/components/AnonymousReportFooter.tsx index 877ca9444661..ad79e316baf3 100644 --- a/src/components/AnonymousReportFooter.tsx +++ b/src/components/AnonymousReportFooter.tsx @@ -1,11 +1,11 @@ import React from 'react'; import {Text, View} from 'react-native'; -import {OnyxCollection} from 'react-native-onyx'; -import {OnyxEntry} from 'react-native-onyx/lib/types'; +import type {OnyxCollection} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx/lib/types'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as Session from '@userActions/Session'; -import {PersonalDetails, Report} from '@src/types/onyx'; +import type {PersonalDetails, Report} from '@src/types/onyx'; import AvatarWithDisplayName from './AvatarWithDisplayName'; import Button from './Button'; import ExpensifyWordmark from './ExpensifyWordmark'; diff --git a/src/components/ArchivedReportFooter.tsx b/src/components/ArchivedReportFooter.tsx index 2dae84106971..98736f39b96a 100644 --- a/src/components/ArchivedReportFooter.tsx +++ b/src/components/ArchivedReportFooter.tsx @@ -1,6 +1,7 @@ import lodashEscape from 'lodash/escape'; import React from 'react'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; diff --git a/src/components/AutoCompleteSuggestions/BaseAutoCompleteSuggestions.tsx b/src/components/AutoCompleteSuggestions/BaseAutoCompleteSuggestions.tsx index b72662f989dc..8ea3b3ac6c9e 100644 --- a/src/components/AutoCompleteSuggestions/BaseAutoCompleteSuggestions.tsx +++ b/src/components/AutoCompleteSuggestions/BaseAutoCompleteSuggestions.tsx @@ -1,6 +1,7 @@ import {FlashList} from '@shopify/flash-list'; -import React, {ForwardedRef, forwardRef, ReactElement, useCallback, useEffect, useMemo, useRef} from 'react'; -import {View} from 'react-native'; +import type {ForwardedRef, ReactElement} from 'react'; +import React, { forwardRef, useCallback, useEffect, useMemo, useRef} from 'react'; +import type {View} from 'react-native'; // We take ScrollView from this package to properly handle the scrolling of AutoCompleteSuggestions in chats since one scroll is nested inside another import {ScrollView} from 'react-native-gesture-handler'; import Animated, {Easing, FadeOutDown, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; diff --git a/src/components/AutoCompleteSuggestions/types.ts b/src/components/AutoCompleteSuggestions/types.ts index 9130f5139d71..61d614dcf2e4 100644 --- a/src/components/AutoCompleteSuggestions/types.ts +++ b/src/components/AutoCompleteSuggestions/types.ts @@ -1,4 +1,4 @@ -import {ReactElement} from 'react'; +import type {ReactElement} from 'react'; type MeasureParentContainerCallback = (x: number, y: number, width: number) => void; diff --git a/src/components/AutoUpdateTime.tsx b/src/components/AutoUpdateTime.tsx index 258bdb281eb2..f6be32fd3970 100644 --- a/src/components/AutoUpdateTime.tsx +++ b/src/components/AutoUpdateTime.tsx @@ -6,9 +6,10 @@ import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; import {View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; import DateUtils from '@libs/DateUtils'; -import {Timezone} from '@src/types/onyx/PersonalDetails'; +import type {Timezone} from '@src/types/onyx/PersonalDetails'; import Text from './Text'; -import withLocalize, {WithLocalizeProps} from './withLocalize'; +import type {WithLocalizeProps} from './withLocalize'; +import withLocalize from './withLocalize'; type AutoUpdateTimeProps = WithLocalizeProps & { /** Timezone of the user from their personal details */ diff --git a/src/components/Avatar.tsx b/src/components/Avatar.tsx index 65b0b6c36061..5f25229a9a97 100644 --- a/src/components/Avatar.tsx +++ b/src/components/Avatar.tsx @@ -1,14 +1,15 @@ import React, {useEffect, useState} from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useNetwork from '@hooks/useNetwork'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import * as ReportUtils from '@libs/ReportUtils'; -import {AvatarSource} from '@libs/UserUtils'; +import type {AvatarSource} from '@libs/UserUtils'; import type {AvatarSizeName} from '@styles/utils'; import CONST from '@src/CONST'; -import {AvatarType} from '@src/types/onyx/OnyxCommon'; +import type {AvatarType} from '@src/types/onyx/OnyxCommon'; import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; import Image from './Image'; diff --git a/src/components/AvatarWithDisplayName.tsx b/src/components/AvatarWithDisplayName.tsx index b9bae33d7e23..024ca0243d12 100644 --- a/src/components/AvatarWithDisplayName.tsx +++ b/src/components/AvatarWithDisplayName.tsx @@ -1,7 +1,8 @@ import React, {useCallback, useEffect, useRef} from 'react'; import {View} from 'react-native'; -import {OnyxCollection, OnyxEntry, withOnyx} from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -11,7 +12,7 @@ import * as ReportUtils from '@libs/ReportUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import {PersonalDetails, Policy, Report, ReportActions} from '@src/types/onyx'; +import type {PersonalDetails, Policy, Report, ReportActions} from '@src/types/onyx'; import DisplayNames from './DisplayNames'; import MultipleAvatars from './MultipleAvatars'; import ParentNavigationSubtitle from './ParentNavigationSubtitle'; diff --git a/src/components/Badge.tsx b/src/components/Badge.tsx index 70aebc30ee83..f49068f601fd 100644 --- a/src/components/Badge.tsx +++ b/src/components/Badge.tsx @@ -1,5 +1,6 @@ import React, {useCallback} from 'react'; -import {GestureResponderEvent, PressableStateCallbackType, StyleProp, TextStyle, View, ViewStyle} from 'react-native'; +import type {GestureResponderEvent, PressableStateCallbackType, StyleProp, TextStyle, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; diff --git a/src/components/Banner.tsx b/src/components/Banner.tsx index d57257efab49..acb6d377bfa9 100644 --- a/src/components/Banner.tsx +++ b/src/components/Banner.tsx @@ -1,5 +1,6 @@ import React, {memo} from 'react'; -import {StyleProp, TextStyle, View, ViewStyle} from 'react-native'; +import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; diff --git a/src/components/BaseMiniContextMenuItem.tsx b/src/components/BaseMiniContextMenuItem.tsx index 8d115a37cba7..44a259e50e4d 100644 --- a/src/components/BaseMiniContextMenuItem.tsx +++ b/src/components/BaseMiniContextMenuItem.tsx @@ -1,5 +1,7 @@ -import React, {ForwardedRef} from 'react'; -import {PressableStateCallbackType, View} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React from 'react'; +import type {PressableStateCallbackType} from 'react-native'; +import { View} from 'react-native'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; import DomUtils from '@libs/DomUtils'; diff --git a/src/components/BlockingViews/BlockingView.tsx b/src/components/BlockingViews/BlockingView.tsx index 3a038c58d886..e343e9b54ee4 100644 --- a/src/components/BlockingViews/BlockingView.tsx +++ b/src/components/BlockingViews/BlockingView.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import {ImageSourcePropType, View} from 'react-native'; -import {SvgProps} from 'react-native-svg'; +import type {ImageSourcePropType} from 'react-native'; +import { View} from 'react-native'; +import type {SvgProps} from 'react-native-svg'; import AutoEmailLink from '@components/AutoEmailLink'; import Icon from '@components/Icon'; import Text from '@components/Text'; @@ -9,7 +10,7 @@ import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; import variables from '@styles/variables'; -import {TranslationPaths} from '@src/languages/types'; +import type {TranslationPaths} from '@src/languages/types'; type BlockingViewProps = { /** Expensicon for the page */ diff --git a/src/components/BlockingViews/FullPageNotFoundView.tsx b/src/components/BlockingViews/FullPageNotFoundView.tsx index 6d7f838bf6c2..5993e60861f5 100644 --- a/src/components/BlockingViews/FullPageNotFoundView.tsx +++ b/src/components/BlockingViews/FullPageNotFoundView.tsx @@ -6,7 +6,7 @@ import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; import variables from '@styles/variables'; -import {TranslationPaths} from '@src/languages/types'; +import type {TranslationPaths} from '@src/languages/types'; import ROUTES from '@src/ROUTES'; import BlockingView from './BlockingView'; diff --git a/src/components/BlockingViews/FullPageOfflineBlockingView.tsx b/src/components/BlockingViews/FullPageOfflineBlockingView.tsx index a9ebcf969ae5..787752dd4e72 100644 --- a/src/components/BlockingViews/FullPageOfflineBlockingView.tsx +++ b/src/components/BlockingViews/FullPageOfflineBlockingView.tsx @@ -3,7 +3,7 @@ import * as Expensicons from '@components/Icon/Expensicons'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import useTheme from '@hooks/useTheme'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; import BlockingView from './BlockingView'; function FullPageOfflineBlockingView({children}: ChildrenProps) { diff --git a/src/components/Breadcrumbs.tsx b/src/components/Breadcrumbs.tsx index fa761218b4a0..fe623f773f99 100644 --- a/src/components/Breadcrumbs.tsx +++ b/src/components/Breadcrumbs.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import LogoComponent from '@assets/images/expensify-wordmark.svg'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index c6f6cd619c09..993fdc579f0c 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -1,6 +1,8 @@ import {useIsFocused} from '@react-navigation/native'; -import React, {ForwardedRef, useCallback} from 'react'; -import {ActivityIndicator, GestureResponderEvent, StyleProp, TextStyle, View, ViewStyle} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React, { useCallback} from 'react'; +import type { GestureResponderEvent, StyleProp, TextStyle, ViewStyle} from 'react-native'; +import {ActivityIndicator, View} from 'react-native'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; @@ -12,8 +14,8 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import HapticFeedback from '@libs/HapticFeedback'; import CONST from '@src/CONST'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; -import IconAsset from '@src/types/utils/IconAsset'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; +import type IconAsset from '@src/types/utils/IconAsset'; import validateSubmitShortcut from './validateSubmitShortcut'; type ButtonWithText = { diff --git a/src/components/Button/validateSubmitShortcut/index.native.ts b/src/components/Button/validateSubmitShortcut/index.native.ts index 7687855f109b..3f277ed208a1 100644 --- a/src/components/Button/validateSubmitShortcut/index.native.ts +++ b/src/components/Button/validateSubmitShortcut/index.native.ts @@ -1,4 +1,4 @@ -import ValidateSubmitShortcut from './types'; +import type ValidateSubmitShortcut from './types'; /** * Validate if the submit shortcut should be triggered depending on the button state diff --git a/src/components/Button/validateSubmitShortcut/index.ts b/src/components/Button/validateSubmitShortcut/index.ts index 55b3e44192e4..695c56af7bb7 100644 --- a/src/components/Button/validateSubmitShortcut/index.ts +++ b/src/components/Button/validateSubmitShortcut/index.ts @@ -1,4 +1,4 @@ -import ValidateSubmitShortcut from './types'; +import type ValidateSubmitShortcut from './types'; /** * Validate if the submit shortcut should be triggered depending on the button state diff --git a/src/components/Button/validateSubmitShortcut/types.ts b/src/components/Button/validateSubmitShortcut/types.ts index 9970e1478a4c..088718d0334e 100644 --- a/src/components/Button/validateSubmitShortcut/types.ts +++ b/src/components/Button/validateSubmitShortcut/types.ts @@ -1,4 +1,4 @@ -import {GestureResponderEvent} from 'react-native'; +import type {GestureResponderEvent} from 'react-native'; type ValidateSubmitShortcut = (isFocused: boolean, isDisabled: boolean, isLoading: boolean, event?: GestureResponderEvent | KeyboardEvent) => boolean; diff --git a/src/components/CardPreview.tsx b/src/components/CardPreview.tsx index 2196e6f441bb..827e2f99dd5a 100644 --- a/src/components/CardPreview.tsx +++ b/src/components/CardPreview.tsx @@ -1,12 +1,13 @@ import React from 'react'; import {View} from 'react-native'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import ExpensifyCardImage from '@assets/images/expensify-card.svg'; import usePrivatePersonalDetails from '@hooks/usePrivatePersonalDetails'; import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; import ONYXKEYS from '@src/ONYXKEYS'; -import {PrivatePersonalDetails, Session} from '@src/types/onyx'; +import type {PrivatePersonalDetails, Session} from '@src/types/onyx'; import ImageSVG from './ImageSVG'; import Text from './Text'; diff --git a/src/components/Checkbox.tsx b/src/components/Checkbox.tsx index ac18b550501d..82038125f229 100644 --- a/src/components/Checkbox.tsx +++ b/src/components/Checkbox.tsx @@ -1,10 +1,12 @@ -import React, {type ForwardedRef, forwardRef, type MouseEventHandler, type KeyboardEvent as ReactKeyboardEvent} from 'react'; -import {GestureResponderEvent, StyleProp, View, ViewStyle} from 'react-native'; +import React, { forwardRef } from 'react'; +import type {ForwardedRef, MouseEventHandler, KeyboardEvent as ReactKeyboardEvent} from 'react'; +import type {GestureResponderEvent, StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; import PressableWithFeedback from './Pressable/PressableWithFeedback'; diff --git a/src/components/CheckboxWithLabel.tsx b/src/components/CheckboxWithLabel.tsx index 9660c9e1a2e5..5eb46939395d 100644 --- a/src/components/CheckboxWithLabel.tsx +++ b/src/components/CheckboxWithLabel.tsx @@ -1,5 +1,7 @@ -import React, {ComponentType, ForwardedRef, useState} from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {ComponentType, ForwardedRef} from 'react'; +import React, { useState} from 'react'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; import Checkbox from './Checkbox'; diff --git a/src/components/CollapsibleSection/Collapsible/index.native.tsx b/src/components/CollapsibleSection/Collapsible/index.native.tsx index e8d3dc9439d0..63cb427f845f 100644 --- a/src/components/CollapsibleSection/Collapsible/index.native.tsx +++ b/src/components/CollapsibleSection/Collapsible/index.native.tsx @@ -1,6 +1,6 @@ import React from 'react'; import CollapsibleRN from 'react-native-collapsible'; -import CollapsibleProps from './types'; +import type CollapsibleProps from './types'; function Collapsible({isOpened = false, children}: CollapsibleProps) { return {children}; diff --git a/src/components/CollapsibleSection/Collapsible/index.tsx b/src/components/CollapsibleSection/Collapsible/index.tsx index 2585fd92f42b..5bf31c10ee68 100644 --- a/src/components/CollapsibleSection/Collapsible/index.tsx +++ b/src/components/CollapsibleSection/Collapsible/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {Collapse} from 'react-collapse'; -import CollapsibleProps from './types'; +import type CollapsibleProps from './types'; function Collapsible({isOpened = false, children}: CollapsibleProps) { return {children}; diff --git a/src/components/CollapsibleSection/Collapsible/types.ts b/src/components/CollapsibleSection/Collapsible/types.ts index 8b8e8aba6860..a60b8d79f935 100644 --- a/src/components/CollapsibleSection/Collapsible/types.ts +++ b/src/components/CollapsibleSection/Collapsible/types.ts @@ -1,4 +1,4 @@ -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type CollapsibleProps = ChildrenProps & { /** Whether the section should start expanded. False by default */ diff --git a/src/components/CollapsibleSection/index.tsx b/src/components/CollapsibleSection/index.tsx index 18b24269b773..393a48e85616 100644 --- a/src/components/CollapsibleSection/index.tsx +++ b/src/components/CollapsibleSection/index.tsx @@ -7,7 +7,7 @@ import Text from '@components/Text'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; import Collapsible from './Collapsible'; type CollapsibleSectionProps = ChildrenProps & { diff --git a/src/components/ComposeProviders.tsx b/src/components/ComposeProviders.tsx index 2c73719358d8..8fc487c78251 100644 --- a/src/components/ComposeProviders.tsx +++ b/src/components/ComposeProviders.tsx @@ -1,5 +1,6 @@ -import React, {ComponentType, ReactNode} from 'react'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type {ComponentType, ReactNode} from 'react'; +import React from 'react'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type ComposeProvidersProps = ChildrenProps & { /** Provider components go here */ diff --git a/src/components/Composer/index.android.tsx b/src/components/Composer/index.android.tsx index 46c2a5f06ded..f00f8b4aac24 100644 --- a/src/components/Composer/index.android.tsx +++ b/src/components/Composer/index.android.tsx @@ -1,10 +1,12 @@ -import React, {ForwardedRef, useCallback, useEffect, useMemo, useRef} from 'react'; -import {StyleSheet, TextInput} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React, { useCallback, useEffect, useMemo, useRef} from 'react'; +import type { TextInput} from 'react-native'; +import {StyleSheet} from 'react-native'; import RNTextInput from '@components/RNTextInput'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import * as ComposerUtils from '@libs/ComposerUtils'; -import {ComposerProps} from './types'; +import type {ComposerProps} from './types'; function Composer( { diff --git a/src/components/Composer/index.ios.tsx b/src/components/Composer/index.ios.tsx index 240dfabded0b..c25212b74460 100644 --- a/src/components/Composer/index.ios.tsx +++ b/src/components/Composer/index.ios.tsx @@ -1,10 +1,12 @@ -import React, {ForwardedRef, useCallback, useEffect, useMemo, useRef} from 'react'; -import {StyleSheet, TextInput} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React, { useCallback, useEffect, useMemo, useRef} from 'react'; +import type { TextInput} from 'react-native'; +import {StyleSheet} from 'react-native'; import RNTextInput from '@components/RNTextInput'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import * as ComposerUtils from '@libs/ComposerUtils'; -import {ComposerProps} from './types'; +import type {ComposerProps} from './types'; function Composer( { diff --git a/src/components/Composer/index.tsx b/src/components/Composer/index.tsx index 4ff5c6dbd75f..8f7f55b0a68d 100755 --- a/src/components/Composer/index.tsx +++ b/src/components/Composer/index.tsx @@ -1,9 +1,11 @@ import {useNavigation} from '@react-navigation/native'; import ExpensiMark from 'expensify-common/lib/ExpensiMark'; -import React, {BaseSyntheticEvent, ForwardedRef, useCallback, useEffect, useMemo, useRef, useState} from 'react'; +import type {BaseSyntheticEvent, ForwardedRef} from 'react'; +import React, { useCallback, useEffect, useMemo, useRef, useState} from 'react'; import {flushSync} from 'react-dom'; -import {DimensionValue, NativeSyntheticEvent, Text as RNText, StyleSheet, TextInput, TextInputKeyPressEventData, TextInputProps, TextInputSelectionChangeEventData, View} from 'react-native'; -import {AnimatedProps} from 'react-native-reanimated'; +import type {DimensionValue, NativeSyntheticEvent, Text as RNText, TextInput, TextInputKeyPressEventData, TextInputProps, TextInputSelectionChangeEventData} from 'react-native'; +import { StyleSheet, View} from 'react-native'; +import type {AnimatedProps} from 'react-native-reanimated'; import RNTextInput from '@components/RNTextInput'; import Text from '@components/Text'; import useIsScrollBarVisible from '@hooks/useIsScrollBarVisible'; @@ -17,7 +19,7 @@ import updateIsFullComposerAvailable from '@libs/ComposerUtils/updateIsFullCompo import isEnterWhileComposition from '@libs/KeyboardShortcut/isEnterWhileComposition'; import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManager'; import CONST from '@src/CONST'; -import {ComposerProps} from './types'; +import type {ComposerProps} from './types'; /** * Retrieves the characters from the specified cursor position up to the next space or new line. diff --git a/src/components/Composer/types.ts b/src/components/Composer/types.ts index cc0654b68019..bfdcb6715d40 100644 --- a/src/components/Composer/types.ts +++ b/src/components/Composer/types.ts @@ -1,4 +1,4 @@ -import {NativeSyntheticEvent, StyleProp, TextInputFocusEventData, TextInputKeyPressEventData, TextInputSelectionChangeEventData, TextStyle} from 'react-native'; +import type {NativeSyntheticEvent, StyleProp, TextInputFocusEventData, TextInputKeyPressEventData, TextInputSelectionChangeEventData, TextStyle} from 'react-native'; type TextSelection = { start: number; diff --git a/src/components/ConfirmContent.tsx b/src/components/ConfirmContent.tsx index 9e4ffa8720da..4e907065c9c0 100644 --- a/src/components/ConfirmContent.tsx +++ b/src/components/ConfirmContent.tsx @@ -1,11 +1,13 @@ -import React, {ReactNode} from 'react'; -import {StyleProp, TextStyle, View, ViewStyle} from 'react-native'; +import type {ReactNode} from 'react'; +import React from 'react'; +import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; -import IconAsset from '@src/types/utils/IconAsset'; +import type IconAsset from '@src/types/utils/IconAsset'; import Button from './Button'; import Header from './Header'; import Icon from './Icon'; diff --git a/src/components/ConfirmationPage.tsx b/src/components/ConfirmationPage.tsx index 21813edd693d..fe4036a4435f 100644 --- a/src/components/ConfirmationPage.tsx +++ b/src/components/ConfirmationPage.tsx @@ -5,7 +5,7 @@ import Button from './Button'; import FixedFooter from './FixedFooter'; import Lottie from './Lottie'; import LottieAnimations from './LottieAnimations'; -import DotLottieAnimation from './LottieAnimations/types'; +import type DotLottieAnimation from './LottieAnimations/types'; import Text from './Text'; type ConfirmationPageProps = { diff --git a/src/components/CopyTextToClipboard.tsx b/src/components/CopyTextToClipboard.tsx index 6f3b42e88fee..3c99a85fd0e7 100644 --- a/src/components/CopyTextToClipboard.tsx +++ b/src/components/CopyTextToClipboard.tsx @@ -1,5 +1,5 @@ import React, {useCallback} from 'react'; -import {AccessibilityRole, StyleProp, TextStyle} from 'react-native'; +import type {AccessibilityRole, StyleProp, TextStyle} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import Clipboard from '@libs/Clipboard'; import * as Expensicons from './Icon/Expensicons'; diff --git a/src/components/CurrentUserPersonalDetailsSkeletonView/index.tsx b/src/components/CurrentUserPersonalDetailsSkeletonView/index.tsx index 02c308705994..367e54e8be64 100644 --- a/src/components/CurrentUserPersonalDetailsSkeletonView/index.tsx +++ b/src/components/CurrentUserPersonalDetailsSkeletonView/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {View} from 'react-native'; import {Circle, Rect} from 'react-native-svg'; -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import SkeletonViewContentLoader from '@components/SkeletonViewContentLoader'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; diff --git a/src/components/CurrentWalletBalance.tsx b/src/components/CurrentWalletBalance.tsx index 28a83fb1ae50..6808ebbcbc1a 100644 --- a/src/components/CurrentWalletBalance.tsx +++ b/src/components/CurrentWalletBalance.tsx @@ -1,10 +1,11 @@ import React from 'react'; -import {StyleProp, TextStyle} from 'react-native'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {StyleProp, TextStyle} from 'react-native'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import useThemeStyles from '@hooks/useThemeStyles'; import * as CurrencyUtils from '@libs/CurrencyUtils'; import ONYXKEYS from '@src/ONYXKEYS'; -import UserWallet from '@src/types/onyx/UserWallet'; +import type UserWallet from '@src/types/onyx/UserWallet'; import Text from './Text'; type CurrentWalletBalanceOnyxProps = { diff --git a/src/components/CustomDevMenu/index.native.tsx b/src/components/CustomDevMenu/index.native.tsx index d8a0ea987171..54f1336b4fef 100644 --- a/src/components/CustomDevMenu/index.native.tsx +++ b/src/components/CustomDevMenu/index.native.tsx @@ -1,7 +1,7 @@ import {useEffect} from 'react'; import DevMenu from 'react-native-dev-menu'; import toggleTestToolsModal from '@userActions/TestTool'; -import CustomDevMenuElement from './types'; +import type CustomDevMenuElement from './types'; const CustomDevMenu: CustomDevMenuElement = Object.assign( () => { diff --git a/src/components/CustomDevMenu/index.tsx b/src/components/CustomDevMenu/index.tsx index c8eae861b676..4306d0cae090 100644 --- a/src/components/CustomDevMenu/index.tsx +++ b/src/components/CustomDevMenu/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import CustomDevMenuElement from './types'; +import type CustomDevMenuElement from './types'; const CustomDevMenu: CustomDevMenuElement = Object.assign(() => <>, {displayName: 'CustomDevMenu'}); diff --git a/src/components/CustomDevMenu/types.ts b/src/components/CustomDevMenu/types.ts index bdfc800a17f0..17e2b30ef4f6 100644 --- a/src/components/CustomDevMenu/types.ts +++ b/src/components/CustomDevMenu/types.ts @@ -1,4 +1,4 @@ -import {ReactElement} from 'react'; +import type {ReactElement} from 'react'; type CustomDevMenuElement = { (): ReactElement; diff --git a/src/components/CustomStatusBarAndBackground/updateGlobalBackgroundColor/index.website.ts b/src/components/CustomStatusBarAndBackground/updateGlobalBackgroundColor/index.website.ts index 481d866dbe4f..f92016048bde 100644 --- a/src/components/CustomStatusBarAndBackground/updateGlobalBackgroundColor/index.website.ts +++ b/src/components/CustomStatusBarAndBackground/updateGlobalBackgroundColor/index.website.ts @@ -1,4 +1,4 @@ -import UpdateGlobalBackgroundColor from './types'; +import type UpdateGlobalBackgroundColor from './types'; const updateGlobalBackgroundColor: UpdateGlobalBackgroundColor = (theme) => { const htmlElement = document.getElementsByTagName('html')[0]; diff --git a/src/components/CustomStatusBarAndBackground/updateGlobalBackgroundColor/types.ts b/src/components/CustomStatusBarAndBackground/updateGlobalBackgroundColor/types.ts index 83bd36a9428a..078703e3846d 100644 --- a/src/components/CustomStatusBarAndBackground/updateGlobalBackgroundColor/types.ts +++ b/src/components/CustomStatusBarAndBackground/updateGlobalBackgroundColor/types.ts @@ -1,4 +1,4 @@ -import {ThemeColors} from '@styles/theme/types'; +import type {ThemeColors} from '@styles/theme/types'; type UpdateGlobalBackgroundColor = (theme: ThemeColors) => void; diff --git a/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.android.ts b/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.android.ts index b7651d4549de..c25f45bfb050 100644 --- a/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.android.ts +++ b/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.android.ts @@ -1,5 +1,5 @@ import StatusBar from '@libs/StatusBar'; -import UpdateStatusBarAppearanceProps from './types'; +import type UpdateStatusBarAppearanceProps from './types'; // eslint-disable-next-line @typescript-eslint/naming-convention export default function updateStatusBarAppearance({statusBarStyle}: UpdateStatusBarAppearanceProps) { diff --git a/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.ios.ts b/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.ios.ts index 61fcb056bba5..e887b5f0a98b 100644 --- a/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.ios.ts +++ b/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.ios.ts @@ -1,5 +1,5 @@ import StatusBar from '@libs/StatusBar'; -import UpdateStatusBarAppearanceProps from './types'; +import type UpdateStatusBarAppearanceProps from './types'; // eslint-disable-next-line @typescript-eslint/naming-convention export default function updateStatusBarAppearance({statusBarStyle}: UpdateStatusBarAppearanceProps) { diff --git a/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.ts b/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.ts index 574efd90f0b5..a11b3619f8d9 100644 --- a/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.ts +++ b/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/index.ts @@ -1,5 +1,5 @@ import StatusBar from '@libs/StatusBar'; -import UpdateStatusBarAppearanceProps from './types'; +import type UpdateStatusBarAppearanceProps from './types'; export default function updateStatusBarAppearance({backgroundColor, statusBarStyle}: UpdateStatusBarAppearanceProps) { if (backgroundColor) { diff --git a/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/types.ts b/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/types.ts index 823f0059eccf..775082187395 100644 --- a/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/types.ts +++ b/src/components/CustomStatusBarAndBackground/updateStatusBarAppearance/types.ts @@ -1,4 +1,4 @@ -import {StatusBarStyle} from '@styles/index'; +import type {StatusBarStyle} from '@styles/index'; type UpdateStatusBarAppearanceProps = { backgroundColor?: string; diff --git a/src/components/DeeplinkWrapper/DeeplinkRedirectLoadingIndicator.tsx b/src/components/DeeplinkWrapper/DeeplinkRedirectLoadingIndicator.tsx index 0e8996bf5022..edc55aeafef6 100644 --- a/src/components/DeeplinkWrapper/DeeplinkRedirectLoadingIndicator.tsx +++ b/src/components/DeeplinkWrapper/DeeplinkRedirectLoadingIndicator.tsx @@ -1,6 +1,7 @@ import React from 'react'; import {View} from 'react-native'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; @@ -12,7 +13,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import * as OnyxTypes from '@src/types/onyx'; +import type * as OnyxTypes from '@src/types/onyx'; type DeeplinkRedirectLoadingIndicatorOnyxProps = { /** Current user session */ diff --git a/src/components/DeeplinkWrapper/index.tsx b/src/components/DeeplinkWrapper/index.tsx index 4b0382bd6b14..076e6b91460d 100644 --- a/src/components/DeeplinkWrapper/index.tsx +++ b/src/components/DeeplinkWrapper/index.tsx @@ -1,4 +1,4 @@ -import DeeplinkWrapperProps from './types'; +import type DeeplinkWrapperProps from './types'; function DeeplinkWrapper({children}: DeeplinkWrapperProps) { return children; diff --git a/src/components/DeeplinkWrapper/index.website.tsx b/src/components/DeeplinkWrapper/index.website.tsx index 2cae91e2f2a0..1d509666ec98 100644 --- a/src/components/DeeplinkWrapper/index.website.tsx +++ b/src/components/DeeplinkWrapper/index.website.tsx @@ -8,7 +8,7 @@ import * as App from '@userActions/App'; import CONFIG from '@src/CONFIG'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; -import DeeplinkWrapperProps from './types'; +import type DeeplinkWrapperProps from './types'; function isMacOSWeb(): boolean { return !Browser.isMobile() && typeof navigator === 'object' && typeof navigator.userAgent === 'string' && /Mac/i.test(navigator.userAgent) && !/Electron/i.test(navigator.userAgent); diff --git a/src/components/DeeplinkWrapper/types.ts b/src/components/DeeplinkWrapper/types.ts index dfd56b62573d..db61e5b01c24 100644 --- a/src/components/DeeplinkWrapper/types.ts +++ b/src/components/DeeplinkWrapper/types.ts @@ -1,4 +1,4 @@ -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type DeeplinkWrapperProps = ChildrenProps & { /** User authentication status */ diff --git a/src/components/DisplayNames/DisplayNamesTooltipItem.tsx b/src/components/DisplayNames/DisplayNamesTooltipItem.tsx index 440457d22965..db6023b0215e 100644 --- a/src/components/DisplayNames/DisplayNamesTooltipItem.tsx +++ b/src/components/DisplayNames/DisplayNamesTooltipItem.tsx @@ -1,9 +1,10 @@ -import React, {RefObject, useCallback} from 'react'; -import {Text as RNText, StyleProp, TextStyle} from 'react-native'; +import type {RefObject} from 'react'; +import React, { useCallback} from 'react'; +import type {Text as RNText, StyleProp, TextStyle} from 'react-native'; import Text from '@components/Text'; import UserDetailsTooltip from '@components/UserDetailsTooltip'; import useThemeStyles from '@hooks/useThemeStyles'; -import {AvatarSource} from '@libs/UserUtils'; +import type {AvatarSource} from '@libs/UserUtils'; type DisplayNamesTooltipItemProps = { index?: number; diff --git a/src/components/DisplayNames/DisplayNamesWithTooltip.tsx b/src/components/DisplayNames/DisplayNamesWithTooltip.tsx index 43061ada9a94..62da9a97a724 100644 --- a/src/components/DisplayNames/DisplayNamesWithTooltip.tsx +++ b/src/components/DisplayNames/DisplayNamesWithTooltip.tsx @@ -1,10 +1,11 @@ import React, {Fragment, useCallback, useRef} from 'react'; -import {Text as RNText, View} from 'react-native'; +import type {Text as RNText} from 'react-native'; +import { View} from 'react-native'; import Text from '@components/Text'; import Tooltip from '@components/Tooltip'; import useThemeStyles from '@hooks/useThemeStyles'; import DisplayNamesTooltipItem from './DisplayNamesTooltipItem'; -import DisplayNamesProps from './types'; +import type DisplayNamesProps from './types'; type HTMLElementWithText = HTMLElement & RNText; diff --git a/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx b/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx index 761b0b66ee2c..177bdb6a9fc4 100644 --- a/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx +++ b/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {StyleProp, TextStyle} from 'react-native'; +import type {StyleProp, TextStyle} from 'react-native'; import Text from '@components/Text'; import useThemeStyles from '@hooks/useThemeStyles'; diff --git a/src/components/DisplayNames/index.native.tsx b/src/components/DisplayNames/index.native.tsx index 8f1fef37a6ba..b3eceb794bcb 100644 --- a/src/components/DisplayNames/index.native.tsx +++ b/src/components/DisplayNames/index.native.tsx @@ -1,7 +1,7 @@ import React from 'react'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; -import DisplayNamesProps from './types'; +import type DisplayNamesProps from './types'; // As we don't have to show tooltips of the Native platform so we simply render the full display names list. function DisplayNames({accessibilityLabel, fullTitle, textStyles = [], numberOfLines = 1}: DisplayNamesProps) { diff --git a/src/components/DisplayNames/index.tsx b/src/components/DisplayNames/index.tsx index 7ff1081937d5..155193368cc5 100644 --- a/src/components/DisplayNames/index.tsx +++ b/src/components/DisplayNames/index.tsx @@ -2,7 +2,7 @@ import React from 'react'; import useLocalize from '@hooks/useLocalize'; import DisplayNamesWithoutTooltip from './DisplayNamesWithoutTooltip'; import DisplayNamesWithToolTip from './DisplayNamesWithTooltip'; -import DisplayNamesProps from './types'; +import type DisplayNamesProps from './types'; function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, shouldUseFullTitle, displayNamesWithTooltips}: DisplayNamesProps) { const {translate} = useLocalize(); diff --git a/src/components/DisplayNames/types.ts b/src/components/DisplayNames/types.ts index 5137d6f54108..b0959d43aa96 100644 --- a/src/components/DisplayNames/types.ts +++ b/src/components/DisplayNames/types.ts @@ -1,4 +1,4 @@ -import {StyleProp, TextStyle} from 'react-native'; +import type {StyleProp, TextStyle} from 'react-native'; import type {AvatarSource} from '@libs/UserUtils'; type DisplayNameWithTooltip = { diff --git a/src/components/DistanceMapView/index.android.tsx b/src/components/DistanceMapView/index.android.tsx index 38e92163c3eb..168a480c6100 100644 --- a/src/components/DistanceMapView/index.android.tsx +++ b/src/components/DistanceMapView/index.android.tsx @@ -6,7 +6,7 @@ import MapView from '@components/MapView'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import useThemeStyles from '@hooks/useThemeStyles'; -import DistanceMapViewProps from './types'; +import type DistanceMapViewProps from './types'; function DistanceMapView({overlayStyle, ...rest}: DistanceMapViewProps) { const styles = useThemeStyles(); diff --git a/src/components/DistanceMapView/index.tsx b/src/components/DistanceMapView/index.tsx index 2abdc29865b0..3f1b3b8439ed 100644 --- a/src/components/DistanceMapView/index.tsx +++ b/src/components/DistanceMapView/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import MapView from '@components/MapView'; -import DistanceMapViewProps from './types'; +import type DistanceMapViewProps from './types'; function DistanceMapView({overlayStyle, ...rest}: DistanceMapViewProps) { // eslint-disable-next-line react/jsx-props-no-spreading diff --git a/src/components/DistanceMapView/types.ts b/src/components/DistanceMapView/types.ts index 5ab3dbd8238e..18213235445f 100644 --- a/src/components/DistanceMapView/types.ts +++ b/src/components/DistanceMapView/types.ts @@ -1,4 +1,4 @@ -import {StyleProp, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; import type {MapViewProps} from '@components/MapView/MapViewTypes'; type DistanceMapViewProps = MapViewProps & { diff --git a/src/components/DotIndicatorMessage.tsx b/src/components/DotIndicatorMessage.tsx index 2787804c5f76..11bc6d53b8fa 100644 --- a/src/components/DotIndicatorMessage.tsx +++ b/src/components/DotIndicatorMessage.tsx @@ -1,6 +1,7 @@ /* eslint-disable react/no-array-index-key */ import React from 'react'; -import {StyleProp, TextStyle, View, ViewStyle} from 'react-native'; +import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; diff --git a/src/components/DragAndDrop/Consumer/types.ts b/src/components/DragAndDrop/Consumer/types.ts index 1f85f32a0153..03bdee3f23d8 100644 --- a/src/components/DragAndDrop/Consumer/types.ts +++ b/src/components/DragAndDrop/Consumer/types.ts @@ -1,4 +1,4 @@ -import {ReactNode} from 'react'; +import type {ReactNode} from 'react'; type DragAndDropConsumerProps = { /** Children to render inside this component. */ diff --git a/src/components/DragAndDrop/NoDropZone/types.ts b/src/components/DragAndDrop/NoDropZone/types.ts index 09715ecd942f..0735f4936ada 100644 --- a/src/components/DragAndDrop/NoDropZone/types.ts +++ b/src/components/DragAndDrop/NoDropZone/types.ts @@ -1,4 +1,4 @@ -import {ReactNode} from 'react'; +import type {ReactNode} from 'react'; type NoDropZoneProps = { /** Content */ diff --git a/src/components/DragAndDrop/Provider/types.ts b/src/components/DragAndDrop/Provider/types.ts index eae83d10682a..b4394056cac5 100644 --- a/src/components/DragAndDrop/Provider/types.ts +++ b/src/components/DragAndDrop/Provider/types.ts @@ -1,4 +1,4 @@ -import {ReactNode} from 'react'; +import type {ReactNode} from 'react'; type DragAndDropProviderProps = { /** Children to render inside this component. */ diff --git a/src/components/DraggableList/index.native.tsx b/src/components/DraggableList/index.native.tsx index f532b21720da..7cf33112bece 100644 --- a/src/components/DraggableList/index.native.tsx +++ b/src/components/DraggableList/index.native.tsx @@ -1,6 +1,6 @@ import React from 'react'; import DraggableFlatList from 'react-native-draggable-flatlist'; -import {FlatList} from 'react-native-gesture-handler'; +import type {FlatList} from 'react-native-gesture-handler'; import useThemeStyles from '@hooks/useThemeStyles'; import type {DraggableListProps} from './types'; diff --git a/src/components/DraggableList/index.tsx b/src/components/DraggableList/index.tsx index b92691075424..69a46ba47d5f 100644 --- a/src/components/DraggableList/index.tsx +++ b/src/components/DraggableList/index.tsx @@ -1,5 +1,6 @@ import React, {useCallback} from 'react'; -import {DragDropContext, Draggable, Droppable, type OnDragEndResponder} from 'react-beautiful-dnd'; +import {DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd'; +import type {OnDragEndResponder} from 'react-beautiful-dnd'; import {ScrollView} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; import type {DraggableListProps} from './types'; diff --git a/src/components/EmojiSuggestions.tsx b/src/components/EmojiSuggestions.tsx index 2fcf8e827b4e..3a71abce01c9 100644 --- a/src/components/EmojiSuggestions.tsx +++ b/src/components/EmojiSuggestions.tsx @@ -1,4 +1,5 @@ -import React, {ReactElement, useCallback} from 'react'; +import type {ReactElement} from 'react'; +import React, { useCallback} from 'react'; import {View} from 'react-native'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; diff --git a/src/components/ErrorBoundary/BaseErrorBoundary.tsx b/src/components/ErrorBoundary/BaseErrorBoundary.tsx index 2a6524d5a993..6a0f1a0ae55e 100644 --- a/src/components/ErrorBoundary/BaseErrorBoundary.tsx +++ b/src/components/ErrorBoundary/BaseErrorBoundary.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {ErrorBoundary} from 'react-error-boundary'; import BootSplash from '@libs/BootSplash'; import GenericErrorPage from '@pages/ErrorPage/GenericErrorPage'; -import {BaseErrorBoundaryProps, LogError} from './types'; +import type {BaseErrorBoundaryProps, LogError} from './types'; /** * This component captures an error in the child component tree and logs it to the server diff --git a/src/components/ErrorBoundary/index.native.tsx b/src/components/ErrorBoundary/index.native.tsx index b8e56ee528c2..5e0c9ca9af38 100644 --- a/src/components/ErrorBoundary/index.native.tsx +++ b/src/components/ErrorBoundary/index.native.tsx @@ -2,7 +2,7 @@ import crashlytics from '@react-native-firebase/crashlytics'; import React from 'react'; import Log from '@libs/Log'; import BaseErrorBoundary from './BaseErrorBoundary'; -import {BaseErrorBoundaryProps, LogError} from './types'; +import type {BaseErrorBoundaryProps, LogError} from './types'; const logError: LogError = (errorMessage, error, errorInfo) => { // Log the error to the server diff --git a/src/components/ErrorBoundary/index.tsx b/src/components/ErrorBoundary/index.tsx index fce70674dd97..890cf5f4e587 100644 --- a/src/components/ErrorBoundary/index.tsx +++ b/src/components/ErrorBoundary/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; import Log from '@libs//Log'; import BaseErrorBoundary from './BaseErrorBoundary'; -import {BaseErrorBoundaryProps, LogError} from './types'; +import type {BaseErrorBoundaryProps, LogError} from './types'; const logError: LogError = (errorMessage, error, errorInfo) => { // Log the error to the server diff --git a/src/components/ExpensifyWordmark.tsx b/src/components/ExpensifyWordmark.tsx index 798907c7eeb6..3ef5f283b200 100644 --- a/src/components/ExpensifyWordmark.tsx +++ b/src/components/ExpensifyWordmark.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import AdHocLogo from '@assets/images/expensify-logo--adhoc.svg'; import DevLogo from '@assets/images/expensify-logo--dev.svg'; import StagingLogo from '@assets/images/expensify-logo--staging.svg'; diff --git a/src/components/FixedFooter.tsx b/src/components/FixedFooter.tsx index 7fd6811c1df6..484113b0ca7d 100644 --- a/src/components/FixedFooter.tsx +++ b/src/components/FixedFooter.tsx @@ -1,5 +1,7 @@ -import React, {ReactNode} from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {ReactNode} from 'react'; +import React from 'react'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; type FixedFooterProps = { diff --git a/src/components/FlatList/index.android.tsx b/src/components/FlatList/index.android.tsx index 84345f6e0ed4..3940e23c3667 100644 --- a/src/components/FlatList/index.android.tsx +++ b/src/components/FlatList/index.android.tsx @@ -1,6 +1,8 @@ import {useFocusEffect} from '@react-navigation/native'; -import React, {ForwardedRef, forwardRef, useCallback, useContext} from 'react'; -import {FlatList, FlatListProps} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef, useCallback, useContext} from 'react'; +import type { FlatListProps} from 'react-native'; +import {FlatList} from 'react-native'; import {ActionListContext} from '@pages/home/ReportScreenContext'; // FlatList wrapped with the freeze component will lose its scroll state when frozen (only for Android). diff --git a/src/components/FormAlertWithSubmitButton.tsx b/src/components/FormAlertWithSubmitButton.tsx index d8e30b27371d..56c1cd05cade 100644 --- a/src/components/FormAlertWithSubmitButton.tsx +++ b/src/components/FormAlertWithSubmitButton.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; import Button from './Button'; import FormAlertWrapper from './FormAlertWrapper'; diff --git a/src/components/FormAlertWrapper.tsx b/src/components/FormAlertWrapper.tsx index a144bf069502..2811cdab65fa 100644 --- a/src/components/FormAlertWrapper.tsx +++ b/src/components/FormAlertWrapper.tsx @@ -1,8 +1,10 @@ -import React, {ReactNode} from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {ReactNode} from 'react'; +import React from 'react'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; -import Network from '@src/types/onyx/Network'; +import type Network from '@src/types/onyx/Network'; import FormHelpMessage from './FormHelpMessage'; import {withNetwork} from './OnyxProvider'; import RenderHTML from './RenderHTML'; diff --git a/src/components/FormElement.tsx b/src/components/FormElement.tsx index c61a09b9d1ec..dc7792c5e443 100644 --- a/src/components/FormElement.tsx +++ b/src/components/FormElement.tsx @@ -1,5 +1,7 @@ -import React, {ForwardedRef, forwardRef} from 'react'; -import {View, ViewProps} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef} from 'react'; +import type { ViewProps} from 'react-native'; +import {View} from 'react-native'; import * as ComponentUtils from '@libs/ComponentUtils'; function FormElement(props: ViewProps, ref: ForwardedRef) { diff --git a/src/components/FormHelpMessage.tsx b/src/components/FormHelpMessage.tsx index 43709b51db44..6675f038c105 100644 --- a/src/components/FormHelpMessage.tsx +++ b/src/components/FormHelpMessage.tsx @@ -1,6 +1,7 @@ import isEmpty from 'lodash/isEmpty'; import React from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import * as Localize from '@libs/Localize'; diff --git a/src/components/FormScrollView.tsx b/src/components/FormScrollView.tsx index 4646a534e750..0b8583ec1071 100644 --- a/src/components/FormScrollView.tsx +++ b/src/components/FormScrollView.tsx @@ -1,5 +1,7 @@ -import React, {ForwardedRef} from 'react'; -import {ScrollView, ScrollViewProps} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React from 'react'; +import type { ScrollViewProps} from 'react-native'; +import {ScrollView} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; type FormScrollViewProps = ScrollViewProps & { diff --git a/src/components/FormSubmit/index.native.tsx b/src/components/FormSubmit/index.native.tsx index 22bf5353949d..5eae7b51d988 100644 --- a/src/components/FormSubmit/index.native.tsx +++ b/src/components/FormSubmit/index.native.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {View} from 'react-native'; -import {FormSubmitProps, FormSubmitRef} from './types'; +import type {FormSubmitProps, FormSubmitRef} from './types'; function FormSubmit({style, children}: FormSubmitProps, ref: FormSubmitRef) { return ( diff --git a/src/components/FormSubmit/index.tsx b/src/components/FormSubmit/index.tsx index ef3f3c39bbaa..1adbfa288403 100644 --- a/src/components/FormSubmit/index.tsx +++ b/src/components/FormSubmit/index.tsx @@ -1,9 +1,10 @@ -import React, {KeyboardEvent, useEffect} from 'react'; +import type {KeyboardEvent} from 'react'; +import React, { useEffect} from 'react'; import {View} from 'react-native'; import * as ComponentUtils from '@libs/ComponentUtils'; import isEnterWhileComposition from '@libs/KeyboardShortcut/isEnterWhileComposition'; import CONST from '@src/CONST'; -import {FormSubmitProps, FormSubmitRef} from './types'; +import type {FormSubmitProps, FormSubmitRef} from './types'; function FormSubmit({children, onSubmit, style}: FormSubmitProps, ref: FormSubmitRef) { /** diff --git a/src/components/FormSubmit/types.ts b/src/components/FormSubmit/types.ts index 20910647ecb8..722a3fbf746e 100644 --- a/src/components/FormSubmit/types.ts +++ b/src/components/FormSubmit/types.ts @@ -1,5 +1,6 @@ -import React, {ForwardedRef} from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {ForwardedRef} from 'react'; +import type React from 'react'; +import type {StyleProp, View, ViewStyle} from 'react-native'; type FormSubmitProps = { children: React.ReactNode; diff --git a/src/components/FullscreenLoadingIndicator.tsx b/src/components/FullscreenLoadingIndicator.tsx index 2b5f7b3ada72..143476a02446 100644 --- a/src/components/FullscreenLoadingIndicator.tsx +++ b/src/components/FullscreenLoadingIndicator.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {ActivityIndicator, StyleProp, StyleSheet, View, ViewStyle} from 'react-native'; +import type { StyleProp, ViewStyle} from 'react-native'; +import {ActivityIndicator, StyleSheet, View} from 'react-native'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 4eac2c7a6994..01199c0a0559 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,5 +1,7 @@ -import React, {ReactNode} from 'react'; -import {StyleProp, TextStyle, View} from 'react-native'; +import type {ReactNode} from 'react'; +import React from 'react'; +import type {StyleProp, TextStyle} from 'react-native'; +import { View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; import EnvironmentBadge from './EnvironmentBadge'; import Text from './Text'; diff --git a/src/components/HeaderGap/types.ts b/src/components/HeaderGap/types.ts index 55a202c2e48c..1333ceac6198 100644 --- a/src/components/HeaderGap/types.ts +++ b/src/components/HeaderGap/types.ts @@ -1,5 +1,5 @@ -import {ReactNode} from 'react'; -import {StyleProp, ViewStyle} from 'react-native'; +import type {ReactNode} from 'react'; +import type {StyleProp, ViewStyle} from 'react-native'; type HeaderGapProps = { styles?: StyleProp; diff --git a/src/components/HeaderWithBackButton/index.tsx b/src/components/HeaderWithBackButton/index.tsx index 9ec8bca55a95..209803f2a5d1 100755 --- a/src/components/HeaderWithBackButton/index.tsx +++ b/src/components/HeaderWithBackButton/index.tsx @@ -19,7 +19,7 @@ import getButtonState from '@libs/getButtonState'; import Navigation from '@libs/Navigation/Navigation'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; -import HeaderWithBackButtonProps from './types'; +import type HeaderWithBackButtonProps from './types'; function HeaderWithBackButton({ iconFill, diff --git a/src/components/HeaderWithBackButton/types.ts b/src/components/HeaderWithBackButton/types.ts index 99e93e8d18d2..9ffb0b5ef2f3 100644 --- a/src/components/HeaderWithBackButton/types.ts +++ b/src/components/HeaderWithBackButton/types.ts @@ -1,5 +1,5 @@ -import {ReactNode} from 'react'; -import {OnyxCollection, OnyxEntry} from 'react-native-onyx'; +import type {ReactNode} from 'react'; +import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; import type {Action} from '@hooks/useSingleExecution'; import type {StepCounterParams} from '@src/languages/types'; import type {AnchorPosition} from '@src/styles'; diff --git a/src/components/Hoverable/index.native.tsx b/src/components/Hoverable/index.native.tsx index b3d49db9d96e..47268e0f440a 100644 --- a/src/components/Hoverable/index.native.tsx +++ b/src/components/Hoverable/index.native.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {View} from 'react-native'; -import HoverableProps from './types'; +import type HoverableProps from './types'; /** * On mobile, there is no concept of hovering, so we return a plain wrapper around the component's children, diff --git a/src/components/Hoverable/index.tsx b/src/components/Hoverable/index.tsx index 9c641cfc19be..e001f00ea968 100644 --- a/src/components/Hoverable/index.tsx +++ b/src/components/Hoverable/index.tsx @@ -1,8 +1,9 @@ -import React, {ForwardedRef, forwardRef, MutableRefObject, ReactElement, RefAttributes, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'; +import type {ForwardedRef, MutableRefObject, ReactElement, RefAttributes} from 'react'; +import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'; import {DeviceEventEmitter} from 'react-native'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import CONST from '@src/CONST'; -import HoverableProps from './types'; +import type HoverableProps from './types'; /** * Maps the children of a Hoverable component to diff --git a/src/components/Hoverable/types.ts b/src/components/Hoverable/types.ts index 430b865f50c5..3b1d5fad4111 100644 --- a/src/components/Hoverable/types.ts +++ b/src/components/Hoverable/types.ts @@ -1,4 +1,4 @@ -import {ReactElement} from 'react'; +import type {ReactElement} from 'react'; type HoverableProps = { /** Children to wrap with Hoverable. */ diff --git a/src/components/IFrame.tsx b/src/components/IFrame.tsx index 7520ad869507..b9943811d48d 100644 --- a/src/components/IFrame.tsx +++ b/src/components/IFrame.tsx @@ -1,7 +1,8 @@ import React, {useEffect, useState} from 'react'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; -import {Session} from '@src/types/onyx'; +import type {Session} from '@src/types/onyx'; type OldDotIFrameOnyxProps = { session: OnyxEntry; diff --git a/src/components/Icon/BankIcons/index.native.ts b/src/components/Icon/BankIcons/index.native.ts index 2011b71588af..cc4660f59392 100644 --- a/src/components/Icon/BankIcons/index.native.ts +++ b/src/components/Icon/BankIcons/index.native.ts @@ -1,9 +1,10 @@ import GenericBank from '@assets/images/bankicons/generic-bank-account.svg'; import GenericBankCard from '@assets/images/cardicons/generic-bank-card.svg'; -import {BankIconParams, getBankIconAsset, getBankNameKey} from '@components/Icon/BankIconsUtils'; +import type {BankIconParams} from '@components/Icon/BankIconsUtils'; +import { getBankIconAsset, getBankNameKey} from '@components/Icon/BankIconsUtils'; import variables from '@styles/variables'; import CONST from '@src/CONST'; -import {BankIcon} from '@src/types/onyx/Bank'; +import type {BankIcon} from '@src/types/onyx/Bank'; /** * Returns Bank Icon Object that matches to existing bank icons or default icons diff --git a/src/components/Icon/BankIcons/index.ts b/src/components/Icon/BankIcons/index.ts index 0e0935b103e4..379fba482613 100644 --- a/src/components/Icon/BankIcons/index.ts +++ b/src/components/Icon/BankIcons/index.ts @@ -1,10 +1,11 @@ import GenericBank from '@assets/images/bankicons/generic-bank-account.svg'; import GenericBankCard from '@assets/images/cardicons/generic-bank-card.svg'; -import {BankIconParams, getBankIconAsset, getBankNameKey} from '@components/Icon/BankIconsUtils'; +import type {BankIconParams} from '@components/Icon/BankIconsUtils'; +import { getBankIconAsset, getBankNameKey} from '@components/Icon/BankIconsUtils'; import variables from '@styles/variables'; import CONST from '@src/CONST'; -import {BankIcon} from '@src/types/onyx/Bank'; -import IconAsset from '@src/types/utils/IconAsset'; +import type {BankIcon} from '@src/types/onyx/Bank'; +import type IconAsset from '@src/types/utils/IconAsset'; /** * It's a wrapper type for a bank icon asset. Bank icons are imported using require(), on the web platform after importing in this way it's necessary to use the property "default" diff --git a/src/components/Icon/BankIconsUtils.ts b/src/components/Icon/BankIconsUtils.ts index cc877ef9ef6f..c91ec030c9ba 100644 --- a/src/components/Icon/BankIconsUtils.ts +++ b/src/components/Icon/BankIconsUtils.ts @@ -1,7 +1,7 @@ -import {type ThemeStyles} from '@styles/index'; +import type {ThemeStyles} from '@styles/index'; import CONST from '@src/CONST'; -import {BankName, BankNameKey} from '@src/types/onyx/Bank'; -import IconAsset from '@src/types/utils/IconAsset'; +import type {BankName, BankNameKey} from '@src/types/onyx/Bank'; +import type IconAsset from '@src/types/utils/IconAsset'; type BankIconParams = { styles: ThemeStyles; diff --git a/src/components/Icon/IconWrapperStyles/index.ios.ts b/src/components/Icon/IconWrapperStyles/index.ios.ts index 9507502d9d26..b039cff95f58 100644 --- a/src/components/Icon/IconWrapperStyles/index.ios.ts +++ b/src/components/Icon/IconWrapperStyles/index.ios.ts @@ -1,4 +1,4 @@ -import IconWrapperStyle from './types'; +import type IconWrapperStyle from './types'; const style: IconWrapperStyle = { top: 1, diff --git a/src/components/Icon/IconWrapperStyles/index.ts b/src/components/Icon/IconWrapperStyles/index.ts index 541a2c296c17..2c4be7b706e8 100644 --- a/src/components/Icon/IconWrapperStyles/index.ts +++ b/src/components/Icon/IconWrapperStyles/index.ts @@ -1,4 +1,4 @@ -import IconWrapperStyle from './types'; +import type IconWrapperStyle from './types'; const style: IconWrapperStyle = { top: 2, diff --git a/src/components/Icon/index.tsx b/src/components/Icon/index.tsx index 732fe90deae2..b4528df660d8 100644 --- a/src/components/Icon/index.tsx +++ b/src/components/Icon/index.tsx @@ -1,11 +1,12 @@ -import {ImageContentFit} from 'expo-image'; +import type {ImageContentFit} from 'expo-image'; import React from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import ImageSVG from '@components/ImageSVG'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; -import IconAsset from '@src/types/utils/IconAsset'; +import type IconAsset from '@src/types/utils/IconAsset'; import IconWrapperStyles from './IconWrapperStyles'; type IconProps = { diff --git a/src/components/ImageSVG/index.native.tsx b/src/components/ImageSVG/index.native.tsx index c397e047b7e0..bdd0b3830a22 100644 --- a/src/components/ImageSVG/index.native.tsx +++ b/src/components/ImageSVG/index.native.tsx @@ -1,7 +1,7 @@ import {Image} from 'expo-image'; import React from 'react'; -import {ImageSourcePropType} from 'react-native'; -import ImageSVGProps from './types'; +import type {ImageSourcePropType} from 'react-native'; +import type ImageSVGProps from './types'; function ImageSVG({src, width = '100%', height = '100%', fill, contentFit = 'cover', style}: ImageSVGProps) { const tintColorProp = fill ? {tintColor: fill} : {}; diff --git a/src/components/ImageSVG/index.tsx b/src/components/ImageSVG/index.tsx index 32d83fdcadd3..3ce04a1a190a 100644 --- a/src/components/ImageSVG/index.tsx +++ b/src/components/ImageSVG/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import {SvgProps} from 'react-native-svg'; -import ImageSVGProps from './types'; +import type {SvgProps} from 'react-native-svg'; +import type ImageSVGProps from './types'; function ImageSVG({src, width = '100%', height = '100%', fill, hovered = false, pressed = false, style, pointerEvents, preserveAspectRatio}: ImageSVGProps) { const ImageSvgComponent = src as React.FC; diff --git a/src/components/ImageSVG/types.ts b/src/components/ImageSVG/types.ts index cc580651c30c..341934852303 100644 --- a/src/components/ImageSVG/types.ts +++ b/src/components/ImageSVG/types.ts @@ -1,6 +1,6 @@ -import {ImageContentFit, ImageStyle} from 'expo-image'; -import {StyleProp, ViewStyle} from 'react-native'; -import IconAsset from '@src/types/utils/IconAsset'; +import type {ImageContentFit, ImageStyle} from 'expo-image'; +import type {StyleProp, ViewStyle} from 'react-native'; +import type IconAsset from '@src/types/utils/IconAsset'; type ImageSVGProps = { /** The asset to render. */ diff --git a/src/components/ImageWithSizeCalculation.tsx b/src/components/ImageWithSizeCalculation.tsx index af803bb360ee..b488fd461f29 100644 --- a/src/components/ImageWithSizeCalculation.tsx +++ b/src/components/ImageWithSizeCalculation.tsx @@ -1,6 +1,7 @@ import delay from 'lodash/delay'; import React, {useEffect, useRef, useState} from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; import Log from '@libs/Log'; import FullscreenLoadingIndicator from './FullscreenLoadingIndicator'; diff --git a/src/components/Indicator.tsx b/src/components/Indicator.tsx index 7b7eae97fd86..d736000feb00 100644 --- a/src/components/Indicator.tsx +++ b/src/components/Indicator.tsx @@ -1,7 +1,8 @@ import React from 'react'; import {StyleSheet, View} from 'react-native'; -import {OnyxCollection, withOnyx} from 'react-native-onyx'; -import {OnyxEntry} from 'react-native-onyx/lib/types'; +import type {OnyxCollection} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx/lib/types'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import * as PolicyUtils from '@libs/PolicyUtils'; diff --git a/src/components/InlineCodeBlock/WrappedText.tsx b/src/components/InlineCodeBlock/WrappedText.tsx index 1c66cef234ed..c8ba754853a9 100644 --- a/src/components/InlineCodeBlock/WrappedText.tsx +++ b/src/components/InlineCodeBlock/WrappedText.tsx @@ -1,5 +1,6 @@ import React, {Fragment} from 'react'; -import {StyleProp, TextStyle, View, ViewStyle} from 'react-native'; +import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import Text from '@components/Text'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; diff --git a/src/components/InlineCodeBlock/types.ts b/src/components/InlineCodeBlock/types.ts index a100177e41a7..ae847b293a60 100644 --- a/src/components/InlineCodeBlock/types.ts +++ b/src/components/InlineCodeBlock/types.ts @@ -1,4 +1,4 @@ -import {StyleProp, TextStyle, ViewStyle} from 'react-native'; +import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; import type {TDefaultRenderer, TDefaultRendererProps, TText} from 'react-native-render-html'; type InlineCodeBlockProps = { diff --git a/src/components/InvertedFlatList/BaseInvertedFlatList.tsx b/src/components/InvertedFlatList/BaseInvertedFlatList.tsx index 08d990583572..f89daa8a7710 100644 --- a/src/components/InvertedFlatList/BaseInvertedFlatList.tsx +++ b/src/components/InvertedFlatList/BaseInvertedFlatList.tsx @@ -1,5 +1,6 @@ -import React, {ForwardedRef, forwardRef} from 'react'; -import {FlatListProps} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef} from 'react'; +import type {FlatListProps} from 'react-native'; import FlatList from '@components/FlatList'; const AUTOSCROLL_TO_TOP_THRESHOLD = 128; diff --git a/src/components/InvertedFlatList/CellRendererComponent.tsx b/src/components/InvertedFlatList/CellRendererComponent.tsx index 252d47989064..f7455b0ef9c2 100644 --- a/src/components/InvertedFlatList/CellRendererComponent.tsx +++ b/src/components/InvertedFlatList/CellRendererComponent.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {StyleProp, View, ViewProps} from 'react-native'; +import type {StyleProp, ViewProps} from 'react-native'; +import { View} from 'react-native'; type CellRendererComponentProps = ViewProps & { index: number; diff --git a/src/components/InvertedFlatList/index.native.tsx b/src/components/InvertedFlatList/index.native.tsx index 906ef6d6ae94..dd47e78fe756 100644 --- a/src/components/InvertedFlatList/index.native.tsx +++ b/src/components/InvertedFlatList/index.native.tsx @@ -1,5 +1,6 @@ -import React, {ForwardedRef, forwardRef} from 'react'; -import {FlatList, FlatListProps} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef} from 'react'; +import type {FlatList, FlatListProps} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; import BaseInvertedFlatList from './BaseInvertedFlatList'; import CellRendererComponent from './CellRendererComponent'; diff --git a/src/components/InvertedFlatList/index.tsx b/src/components/InvertedFlatList/index.tsx index 6871b010a385..fc141d2af906 100644 --- a/src/components/InvertedFlatList/index.tsx +++ b/src/components/InvertedFlatList/index.tsx @@ -1,5 +1,7 @@ -import React, {ForwardedRef, forwardRef, useEffect, useRef} from 'react'; -import {DeviceEventEmitter, FlatList, FlatListProps, NativeScrollEvent, NativeSyntheticEvent} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef, useEffect, useRef} from 'react'; +import type { FlatList, FlatListProps, NativeScrollEvent, NativeSyntheticEvent} from 'react-native'; +import {DeviceEventEmitter} from 'react-native'; import CONST from '@src/CONST'; import BaseInvertedFlatList from './BaseInvertedFlatList'; diff --git a/src/components/KeyboardAvoidingView/index.ios.tsx b/src/components/KeyboardAvoidingView/index.ios.tsx index fde4df6fc05b..a7cd767377ef 100644 --- a/src/components/KeyboardAvoidingView/index.ios.tsx +++ b/src/components/KeyboardAvoidingView/index.ios.tsx @@ -3,7 +3,7 @@ */ import React from 'react'; import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native'; -import KeyboardAvoidingViewProps from './types'; +import type KeyboardAvoidingViewProps from './types'; function KeyboardAvoidingView(props: KeyboardAvoidingViewProps) { // eslint-disable-next-line react/jsx-props-no-spreading diff --git a/src/components/KeyboardAvoidingView/index.tsx b/src/components/KeyboardAvoidingView/index.tsx index cf3a5c5ebef7..09ec21e5b219 100644 --- a/src/components/KeyboardAvoidingView/index.tsx +++ b/src/components/KeyboardAvoidingView/index.tsx @@ -3,7 +3,7 @@ */ import React from 'react'; import {View} from 'react-native'; -import KeyboardAvoidingViewProps from './types'; +import type KeyboardAvoidingViewProps from './types'; function KeyboardAvoidingView(props: KeyboardAvoidingViewProps) { const {behavior, contentContainerStyle, enabled, keyboardVerticalOffset, ...rest} = props; diff --git a/src/components/LinearGradient/index.native.ts b/src/components/LinearGradient/index.native.ts index 46bed24ebc10..29af26b96b64 100644 --- a/src/components/LinearGradient/index.native.ts +++ b/src/components/LinearGradient/index.native.ts @@ -1,5 +1,5 @@ import LinearGradientNative from 'react-native-linear-gradient'; -import LinearGradient from './types'; +import type LinearGradient from './types'; const LinearGradientImplementation: LinearGradient = LinearGradientNative; diff --git a/src/components/LinearGradient/index.ts b/src/components/LinearGradient/index.ts index 7246ccf2fb69..84d0fc2ce5c8 100644 --- a/src/components/LinearGradient/index.ts +++ b/src/components/LinearGradient/index.ts @@ -1,5 +1,5 @@ import LinearGradientWeb from 'react-native-web-linear-gradient'; -import LinearGradient from './types'; +import type LinearGradient from './types'; const LinearGradientImplementation: LinearGradient = LinearGradientWeb; diff --git a/src/components/LinearGradient/types.ts b/src/components/LinearGradient/types.ts index cf6661eaecaa..9e238ef71f12 100644 --- a/src/components/LinearGradient/types.ts +++ b/src/components/LinearGradient/types.ts @@ -1,4 +1,4 @@ -import LinearGradientNative from 'react-native-linear-gradient'; +import type LinearGradientNative from 'react-native-linear-gradient'; type LinearGradient = typeof LinearGradientNative; diff --git a/src/components/LocaleContextProvider.tsx b/src/components/LocaleContextProvider.tsx index 3c649a8cb546..4cf7551ab249 100644 --- a/src/components/LocaleContextProvider.tsx +++ b/src/components/LocaleContextProvider.tsx @@ -1,6 +1,7 @@ import React, {createContext, useMemo} from 'react'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; import compose from '@libs/compose'; import DateUtils from '@libs/DateUtils'; import * as LocaleDigitUtils from '@libs/LocaleDigitUtils'; @@ -8,9 +9,10 @@ import * as LocalePhoneNumber from '@libs/LocalePhoneNumber'; import * as Localize from '@libs/Localize'; import * as NumberFormatUtils from '@libs/NumberFormatUtils'; import CONST from '@src/CONST'; -import {TranslationPaths} from '@src/languages/types'; +import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; -import withCurrentUserPersonalDetails, {WithCurrentUserPersonalDetailsProps} from './withCurrentUserPersonalDetails'; +import type {WithCurrentUserPersonalDetailsProps} from './withCurrentUserPersonalDetails'; +import withCurrentUserPersonalDetails from './withCurrentUserPersonalDetails'; type Locale = ValueOf; diff --git a/src/components/LocalePicker.tsx b/src/components/LocalePicker.tsx index 46adb1a4895e..20a86d41aa55 100644 --- a/src/components/LocalePicker.tsx +++ b/src/components/LocalePicker.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; diff --git a/src/components/LocationErrorMessage/BaseLocationErrorMessage.tsx b/src/components/LocationErrorMessage/BaseLocationErrorMessage.tsx index ceeb33d5e6bc..33a0bba7481c 100644 --- a/src/components/LocationErrorMessage/BaseLocationErrorMessage.tsx +++ b/src/components/LocationErrorMessage/BaseLocationErrorMessage.tsx @@ -12,7 +12,7 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import colors from '@styles/theme/colors'; import CONST from '@src/CONST'; -import LocationErrorMessageProps from './types'; +import type LocationErrorMessageProps from './types'; type BaseLocationErrorMessageProps = LocationErrorMessageProps & { /** A callback that runs when 'allow location permission' link is pressed */ diff --git a/src/components/LocationErrorMessage/index.native.tsx b/src/components/LocationErrorMessage/index.native.tsx index 3f3813084a47..7936fff73c06 100644 --- a/src/components/LocationErrorMessage/index.native.tsx +++ b/src/components/LocationErrorMessage/index.native.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {Linking} from 'react-native'; import BaseLocationErrorMessage from './BaseLocationErrorMessage'; -import LocationErrorMessageProps from './types'; +import type LocationErrorMessageProps from './types'; /** Opens app level settings from the native system settings */ const openAppSettings = () => { diff --git a/src/components/LocationErrorMessage/index.tsx b/src/components/LocationErrorMessage/index.tsx index bd9523ca5c1c..193d38069d65 100644 --- a/src/components/LocationErrorMessage/index.tsx +++ b/src/components/LocationErrorMessage/index.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {Linking} from 'react-native'; import CONST from '@src/CONST'; import BaseLocationErrorMessage from './BaseLocationErrorMessage'; -import LocationErrorMessageProps from './types'; +import type LocationErrorMessageProps from './types'; /** Opens expensify help site in a new browser tab */ const navigateToExpensifyHelpSite = () => { diff --git a/src/components/Lottie/index.tsx b/src/components/Lottie/index.tsx index 2bf7df056c4d..8f29cd953460 100644 --- a/src/components/Lottie/index.tsx +++ b/src/components/Lottie/index.tsx @@ -1,7 +1,9 @@ -import LottieView, {LottieViewProps} from 'lottie-react-native'; -import React, {ForwardedRef, forwardRef} from 'react'; +import type {LottieViewProps} from 'lottie-react-native'; +import LottieView from 'lottie-react-native'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef} from 'react'; import {View} from 'react-native'; -import DotLottieAnimation from '@components/LottieAnimations/types'; +import type DotLottieAnimation from '@components/LottieAnimations/types'; import useNetwork from '@hooks/useNetwork'; import useThemeStyles from '@hooks/useThemeStyles'; diff --git a/src/components/LottieAnimations/index.tsx b/src/components/LottieAnimations/index.tsx index 078cdc0c6987..0d2cac253135 100644 --- a/src/components/LottieAnimations/index.tsx +++ b/src/components/LottieAnimations/index.tsx @@ -1,4 +1,4 @@ -import DotLottieAnimation from './types'; +import type DotLottieAnimation from './types'; const DotLottieAnimations: Record = { ExpensifyLounge: { diff --git a/src/components/LottieAnimations/types.ts b/src/components/LottieAnimations/types.ts index fcd793c6dfed..6000b9f853f0 100644 --- a/src/components/LottieAnimations/types.ts +++ b/src/components/LottieAnimations/types.ts @@ -1,4 +1,4 @@ -import {LottieViewProps} from 'lottie-react-native'; +import type {LottieViewProps} from 'lottie-react-native'; type DotLottieAnimation = { file: LottieViewProps['source']; diff --git a/src/components/MapView/Direction.tsx b/src/components/MapView/Direction.tsx index b3162149a48d..729d3c71e91f 100644 --- a/src/components/MapView/Direction.tsx +++ b/src/components/MapView/Direction.tsx @@ -1,6 +1,6 @@ import Mapbox from '@rnmapbox/maps'; import useThemeStyles from '@hooks/useThemeStyles'; -import {DirectionProps} from './MapViewTypes'; +import type {DirectionProps} from './MapViewTypes'; function Direction({coordinates}: DirectionProps) { const styles = useThemeStyles(); diff --git a/src/components/MapView/Direction.website.tsx b/src/components/MapView/Direction.website.tsx index f85bda125473..02fee83042a2 100644 --- a/src/components/MapView/Direction.website.tsx +++ b/src/components/MapView/Direction.website.tsx @@ -6,7 +6,7 @@ import React from 'react'; import {Layer, Source} from 'react-map-gl'; import {View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; -import {DirectionProps} from './MapViewTypes'; +import type {DirectionProps} from './MapViewTypes'; function Direction({coordinates}: DirectionProps) { const styles = useThemeStyles(); diff --git a/src/components/MapView/MapView.tsx b/src/components/MapView/MapView.tsx index f7a15ba10d2c..35e0ccca2124 100644 --- a/src/components/MapView/MapView.tsx +++ b/src/components/MapView/MapView.tsx @@ -1,5 +1,6 @@ import {useFocusEffect, useNavigation} from '@react-navigation/native'; -import Mapbox, {MapState, MarkerView, setAccessToken} from '@rnmapbox/maps'; +import type {MapState} from '@rnmapbox/maps'; +import Mapbox, { MarkerView, setAccessToken} from '@rnmapbox/maps'; import {forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef, useState} from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; @@ -12,10 +13,10 @@ import useLocalize from '@src/hooks/useLocalize'; import useNetwork from '@src/hooks/useNetwork'; import ONYXKEYS from '@src/ONYXKEYS'; import Direction from './Direction'; -import {MapViewHandle} from './MapViewTypes'; +import type {MapViewHandle} from './MapViewTypes'; import PendingMapView from './PendingMapView'; import responder from './responder'; -import {ComponentProps, MapViewOnyxProps} from './types'; +import type {ComponentProps, MapViewOnyxProps} from './types'; import utils from './utils'; const MapView = forwardRef( diff --git a/src/components/MapView/MapView.website.tsx b/src/components/MapView/MapView.website.tsx index 82909001fefd..13bea67ab012 100644 --- a/src/components/MapView/MapView.website.tsx +++ b/src/components/MapView/MapView.website.tsx @@ -6,7 +6,8 @@ import {useFocusEffect} from '@react-navigation/native'; import mapboxgl from 'mapbox-gl'; import 'mapbox-gl/dist/mapbox-gl.css'; import React, {forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState} from 'react'; -import Map, {MapRef, Marker} from 'react-map-gl'; +import type {MapRef} from 'react-map-gl'; +import Map, { Marker} from 'react-map-gl'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import useStyleUtils from '@hooks/useStyleUtils'; @@ -20,10 +21,10 @@ import getCurrentPosition from '@src/libs/getCurrentPosition'; import ONYXKEYS from '@src/ONYXKEYS'; import Direction from './Direction'; import './mapbox.css'; -import {MapViewHandle} from './MapViewTypes'; +import type {MapViewHandle} from './MapViewTypes'; import PendingMapView from './PendingMapView'; import responder from './responder'; -import {ComponentProps, MapViewOnyxProps} from './types'; +import type {ComponentProps, MapViewOnyxProps} from './types'; import utils from './utils'; const MapView = forwardRef( diff --git a/src/components/MapView/MapViewTypes.ts b/src/components/MapView/MapViewTypes.ts index 6cc52ac91d18..4b9ab6af233b 100644 --- a/src/components/MapView/MapViewTypes.ts +++ b/src/components/MapView/MapViewTypes.ts @@ -1,4 +1,4 @@ -import {ComponentType} from 'react'; +import type {ComponentType} from 'react'; import type {StyleProp, ViewStyle} from 'react-native'; type MapViewProps = { diff --git a/src/components/MapView/PendingMapView.tsx b/src/components/MapView/PendingMapView.tsx index 0af816785e9a..32bf42a14b10 100644 --- a/src/components/MapView/PendingMapView.tsx +++ b/src/components/MapView/PendingMapView.tsx @@ -6,7 +6,7 @@ import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; -import {PendingMapViewProps} from './MapViewTypes'; +import type {PendingMapViewProps} from './MapViewTypes'; function PendingMapView({title = '', subtitle = '', style}: PendingMapViewProps) { const hasTextContent = !_.isEmpty(title) || !_.isEmpty(subtitle); diff --git a/src/components/MapView/types.ts b/src/components/MapView/types.ts index 2c8b9240c445..a0494a9ac499 100644 --- a/src/components/MapView/types.ts +++ b/src/components/MapView/types.ts @@ -1,6 +1,6 @@ -import {OnyxEntry} from 'react-native-onyx'; -import * as OnyxTypes from '@src/types/onyx'; -import {MapViewProps} from './MapViewTypes'; +import type {OnyxEntry} from 'react-native-onyx'; +import type * as OnyxTypes from '@src/types/onyx'; +import type {MapViewProps} from './MapViewTypes'; type MapViewOnyxProps = { userLocation: OnyxEntry; diff --git a/src/components/MentionSuggestions.tsx b/src/components/MentionSuggestions.tsx index 3e235a2fc88a..459131ecc434 100644 --- a/src/components/MentionSuggestions.tsx +++ b/src/components/MentionSuggestions.tsx @@ -5,7 +5,7 @@ import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import getStyledTextArray from '@libs/GetStyledTextArray'; import CONST from '@src/CONST'; -import {Icon} from '@src/types/onyx/OnyxCommon'; +import type {Icon} from '@src/types/onyx/OnyxCommon'; import AutoCompleteSuggestions from './AutoCompleteSuggestions'; import Avatar from './Avatar'; import Text from './Text'; diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index 9faabc403c75..ff9dba0d96c1 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -1,9 +1,11 @@ import ExpensiMark from 'expensify-common/lib/ExpensiMark'; -import {ImageContentFit} from 'expo-image'; -import React, {ForwardedRef, forwardRef, ReactNode, useEffect, useMemo, useRef, useState} from 'react'; -import {GestureResponderEvent, StyleProp, TextStyle, View, ViewStyle} from 'react-native'; -import {AnimatedStyle} from 'react-native-reanimated'; -import {ValueOf} from 'type-fest'; +import type {ImageContentFit} from 'expo-image'; +import type {ForwardedRef, ReactNode} from 'react'; +import React, { forwardRef, useEffect, useMemo, useRef, useState} from 'react'; +import type {GestureResponderEvent, StyleProp, TextStyle, ViewStyle} from 'react-native'; +import { View} from 'react-native'; +import type {AnimatedStyle} from 'react-native-reanimated'; +import type {ValueOf} from 'type-fest'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -12,16 +14,16 @@ import ControlSelection from '@libs/ControlSelection'; import convertToLTR from '@libs/convertToLTR'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import getButtonState from '@libs/getButtonState'; -import {AvatarSource} from '@libs/UserUtils'; +import type {AvatarSource} from '@libs/UserUtils'; import variables from '@styles/variables'; import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; -import {Icon as IconType} from '@src/types/onyx/OnyxCommon'; -import IconAsset from '@src/types/utils/IconAsset'; +import type {Icon as IconType} from '@src/types/onyx/OnyxCommon'; +import type IconAsset from '@src/types/utils/IconAsset'; import Avatar from './Avatar'; import Badge from './Badge'; import DisplayNames from './DisplayNames'; -import {DisplayNameWithTooltip} from './DisplayNames/types'; +import type {DisplayNameWithTooltip} from './DisplayNames/types'; import FormHelpMessage from './FormHelpMessage'; import Hoverable from './Hoverable'; import Icon from './Icon'; diff --git a/src/components/MenuItemWithTopDescription.tsx b/src/components/MenuItemWithTopDescription.tsx index 48fa95ecf637..8e4db73848b5 100644 --- a/src/components/MenuItemWithTopDescription.tsx +++ b/src/components/MenuItemWithTopDescription.tsx @@ -1,5 +1,6 @@ -import React, {ForwardedRef, forwardRef} from 'react'; -import {View} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef} from 'react'; +import type {View} from 'react-native'; import MenuItem from './MenuItem'; import type {MenuItemProps} from './MenuItem'; diff --git a/src/components/MessagesRow.tsx b/src/components/MessagesRow.tsx index f49a0927de06..45d35f36ed92 100644 --- a/src/components/MessagesRow.tsx +++ b/src/components/MessagesRow.tsx @@ -1,9 +1,10 @@ import React from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as Localize from '@libs/Localize'; +import type * as Localize from '@libs/Localize'; import CONST from '@src/CONST'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; import DotIndicatorMessage from './DotIndicatorMessage'; diff --git a/src/components/Modal/BaseModal.tsx b/src/components/Modal/BaseModal.tsx index e03c32f6bfcc..6e5b4eddae9e 100644 --- a/src/components/Modal/BaseModal.tsx +++ b/src/components/Modal/BaseModal.tsx @@ -13,7 +13,7 @@ import useNativeDriver from '@libs/useNativeDriver'; import variables from '@styles/variables'; import * as Modal from '@userActions/Modal'; import CONST from '@src/CONST'; -import BaseModalProps from './types'; +import type BaseModalProps from './types'; function BaseModal( { diff --git a/src/components/Modal/index.android.tsx b/src/components/Modal/index.android.tsx index 2343cb4c70a9..4d7ae128a114 100644 --- a/src/components/Modal/index.android.tsx +++ b/src/components/Modal/index.android.tsx @@ -3,7 +3,7 @@ import {AppState} from 'react-native'; import withWindowDimensions from '@components/withWindowDimensions'; import ComposerFocusManager from '@libs/ComposerFocusManager'; import BaseModal from './BaseModal'; -import BaseModalProps from './types'; +import type BaseModalProps from './types'; AppState.addEventListener('focus', () => { ComposerFocusManager.setReadyToFocus(); diff --git a/src/components/Modal/index.ios.tsx b/src/components/Modal/index.ios.tsx index f780775ec216..cbe58a071d7d 100644 --- a/src/components/Modal/index.ios.tsx +++ b/src/components/Modal/index.ios.tsx @@ -1,7 +1,7 @@ import React from 'react'; import withWindowDimensions from '@components/withWindowDimensions'; import BaseModal from './BaseModal'; -import BaseModalProps from './types'; +import type BaseModalProps from './types'; function Modal({children, ...rest}: BaseModalProps) { return ( diff --git a/src/components/Modal/index.tsx b/src/components/Modal/index.tsx index 4269420dcd7f..56f3c76a8879 100644 --- a/src/components/Modal/index.tsx +++ b/src/components/Modal/index.tsx @@ -5,7 +5,7 @@ import useTheme from '@hooks/useTheme'; import StatusBar from '@libs/StatusBar'; import CONST from '@src/CONST'; import BaseModal from './BaseModal'; -import BaseModalProps from './types'; +import type BaseModalProps from './types'; function Modal({fullscreen = true, onModalHide = () => {}, type, onModalShow = () => {}, children, ...rest}: BaseModalProps) { const theme = useTheme(); diff --git a/src/components/Modal/types.ts b/src/components/Modal/types.ts index 461a5935eda9..0fed37ffea8b 100644 --- a/src/components/Modal/types.ts +++ b/src/components/Modal/types.ts @@ -1,8 +1,8 @@ -import {ViewStyle} from 'react-native'; -import {ModalProps} from 'react-native-modal'; -import {ValueOf} from 'type-fest'; -import {WindowDimensionsProps} from '@components/withWindowDimensions/types'; -import CONST from '@src/CONST'; +import type {ViewStyle} from 'react-native'; +import type {ModalProps} from 'react-native-modal'; +import type {ValueOf} from 'type-fest'; +import type {WindowDimensionsProps} from '@components/withWindowDimensions/types'; +import type CONST from '@src/CONST'; type PopoverAnchorPosition = { top?: number; diff --git a/src/components/MoneyReportHeaderStatusBar.tsx b/src/components/MoneyReportHeaderStatusBar.tsx index 9d96d93423c5..4b30276a204f 100644 --- a/src/components/MoneyReportHeaderStatusBar.tsx +++ b/src/components/MoneyReportHeaderStatusBar.tsx @@ -4,7 +4,7 @@ import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as NextStepUtils from '@libs/NextStepUtils'; import CONST from '@src/CONST'; -import ReportNextStep from '@src/types/onyx/ReportNextStep'; +import type ReportNextStep from '@src/types/onyx/ReportNextStep'; import RenderHTML from './RenderHTML'; type MoneyReportHeaderStatusBarProps = { diff --git a/src/components/MultipleAvatars.tsx b/src/components/MultipleAvatars.tsx index 23c795f281f6..38ced7551a74 100644 --- a/src/components/MultipleAvatars.tsx +++ b/src/components/MultipleAvatars.tsx @@ -1,10 +1,11 @@ import React, {memo, useMemo} from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; -import {ValueOf} from 'type-fest'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; +import type {ValueOf} from 'type-fest'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -import {AvatarSource} from '@libs/UserUtils'; +import type {AvatarSource} from '@libs/UserUtils'; import variables from '@styles/variables'; import CONST from '@src/CONST'; import type {Icon} from '@src/types/onyx/OnyxCommon'; diff --git a/src/components/OfflineIndicator.tsx b/src/components/OfflineIndicator.tsx index 035058ab9be9..8bc7ba69fd36 100644 --- a/src/components/OfflineIndicator.tsx +++ b/src/components/OfflineIndicator.tsx @@ -1,5 +1,6 @@ import React, {useMemo} from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import useTheme from '@hooks/useTheme'; diff --git a/src/components/OfflineWithFeedback.tsx b/src/components/OfflineWithFeedback.tsx index 29fd0c2700dc..1d715da78b69 100644 --- a/src/components/OfflineWithFeedback.tsx +++ b/src/components/OfflineWithFeedback.tsx @@ -1,12 +1,13 @@ import React, {useCallback} from 'react'; -import {ImageStyle, StyleProp, TextStyle, View, ViewStyle} from 'react-native'; +import type {ImageStyle, StyleProp, TextStyle, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useNetwork from '@hooks/useNetwork'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; import shouldRenderOffscreen from '@libs/shouldRenderOffscreen'; import CONST from '@src/CONST'; -import * as OnyxCommon from '@src/types/onyx/OnyxCommon'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type * as OnyxCommon from '@src/types/onyx/OnyxCommon'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; import {isNotEmptyObject} from '@src/types/utils/EmptyObject'; import MessagesRow from './MessagesRow'; diff --git a/src/components/OpacityView.tsx b/src/components/OpacityView.tsx index 6f82658bcac1..1de09aad6b22 100644 --- a/src/components/OpacityView.tsx +++ b/src/components/OpacityView.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import {StyleProp, ViewStyle} from 'react-native'; -import Animated, {AnimatedStyle, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; +import type {StyleProp, ViewStyle} from 'react-native'; +import type {AnimatedStyle} from 'react-native-reanimated'; +import Animated, { useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; import shouldRenderOffscreen from '@libs/shouldRenderOffscreen'; import variables from '@styles/variables'; diff --git a/src/components/OptionRow.tsx b/src/components/OptionRow.tsx index 5a2f6902c4c0..994d297bc97c 100644 --- a/src/components/OptionRow.tsx +++ b/src/components/OptionRow.tsx @@ -1,6 +1,7 @@ import lodashIsEqual from 'lodash/isEqual'; import React, {useEffect, useRef, useState} from 'react'; -import {InteractionManager, StyleProp, StyleSheet, TextStyle, View, ViewStyle} from 'react-native'; +import type { StyleProp, TextStyle, ViewStyle} from 'react-native'; +import {InteractionManager, StyleSheet, View} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; diff --git a/src/components/ParentNavigationSubtitle.tsx b/src/components/ParentNavigationSubtitle.tsx index b3f1653fda1a..2816715dae2c 100644 --- a/src/components/ParentNavigationSubtitle.tsx +++ b/src/components/ParentNavigationSubtitle.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import {StyleProp, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; import CONST from '@src/CONST'; -import {ParentNavigationSummaryParams} from '@src/languages/types'; +import type {ParentNavigationSummaryParams} from '@src/languages/types'; import ROUTES from '@src/ROUTES'; import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback'; import Text from './Text'; diff --git a/src/components/Picker/BasePicker.tsx b/src/components/Picker/BasePicker.tsx index edaab2693e7b..2a45d99c4996 100644 --- a/src/components/Picker/BasePicker.tsx +++ b/src/components/Picker/BasePicker.tsx @@ -1,6 +1,8 @@ import lodashDefer from 'lodash/defer'; -import React, {ForwardedRef, forwardRef, ReactElement, ReactNode, RefObject, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'; -import {ScrollView, View} from 'react-native'; +import type {ForwardedRef, ReactElement, ReactNode, RefObject} from 'react'; +import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'; +import type {ScrollView} from 'react-native'; +import { View} from 'react-native'; import RNPickerSelect from 'react-native-picker-select'; import FormHelpMessage from '@components/FormHelpMessage'; import Icon from '@components/Icon'; diff --git a/src/components/Picker/index.native.tsx b/src/components/Picker/index.native.tsx index 7373f5a6f280..aaf7efed89d3 100644 --- a/src/components/Picker/index.native.tsx +++ b/src/components/Picker/index.native.tsx @@ -1,6 +1,7 @@ -import React, {ForwardedRef, forwardRef} from 'react'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef} from 'react'; import BasePicker from './BasePicker'; -import {BasePickerHandle, BasePickerProps} from './types'; +import type {BasePickerHandle, BasePickerProps} from './types'; function Picker(props: BasePickerProps, ref: ForwardedRef) { return ( diff --git a/src/components/Picker/index.tsx b/src/components/Picker/index.tsx index 18184b130bba..6dab7d01418d 100644 --- a/src/components/Picker/index.tsx +++ b/src/components/Picker/index.tsx @@ -1,4 +1,5 @@ -import React, {ForwardedRef, forwardRef} from 'react'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef} from 'react'; import BasePicker from './BasePicker'; import type {AdditionalPickerEvents, BasePickerHandle, BasePickerProps, OnChange, OnMouseDown} from './types'; diff --git a/src/components/Picker/types.ts b/src/components/Picker/types.ts index 58eed0371893..edf39a59c9d8 100644 --- a/src/components/Picker/types.ts +++ b/src/components/Picker/types.ts @@ -1,5 +1,5 @@ -import {ChangeEvent, Component, ReactElement} from 'react'; -import {MeasureLayoutOnSuccessCallback, NativeMethods, StyleProp, ViewStyle} from 'react-native'; +import type {ChangeEvent, Component, ReactElement} from 'react'; +import type {MeasureLayoutOnSuccessCallback, NativeMethods, StyleProp, ViewStyle} from 'react-native'; type MeasureLayoutOnFailCallback = () => void; diff --git a/src/components/PlaidLink/index.native.tsx b/src/components/PlaidLink/index.native.tsx index c46a9df2076e..6b0f7845bb99 100644 --- a/src/components/PlaidLink/index.native.tsx +++ b/src/components/PlaidLink/index.native.tsx @@ -1,8 +1,9 @@ import {useEffect} from 'react'; -import {dismissLink, LinkEvent, openLink, usePlaidEmitter} from 'react-native-plaid-link-sdk'; +import type { LinkEvent} from 'react-native-plaid-link-sdk'; +import {dismissLink, openLink, usePlaidEmitter} from 'react-native-plaid-link-sdk'; import Log from '@libs/Log'; import CONST from '@src/CONST'; -import PlaidLinkProps from './types'; +import type PlaidLinkProps from './types'; function PlaidLink({token, onSuccess = () => {}, onExit = () => {}, onEvent}: PlaidLinkProps) { usePlaidEmitter((event: LinkEvent) => { diff --git a/src/components/PlaidLink/index.tsx b/src/components/PlaidLink/index.tsx index 08655458d12e..4e26d0c1ccaa 100644 --- a/src/components/PlaidLink/index.tsx +++ b/src/components/PlaidLink/index.tsx @@ -1,10 +1,11 @@ import React, {useCallback, useEffect, useState} from 'react'; import {ActivityIndicator, View} from 'react-native'; -import {PlaidLinkOnSuccessMetadata, usePlaidLink} from 'react-plaid-link'; +import type {PlaidLinkOnSuccessMetadata} from 'react-plaid-link'; +import { usePlaidLink} from 'react-plaid-link'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import Log from '@libs/Log'; -import PlaidLinkProps from './types'; +import type PlaidLinkProps from './types'; function PlaidLink({token, onSuccess = () => {}, onError = () => {}, onExit = () => {}, onEvent, receivedRedirectURI}: PlaidLinkProps) { const [isPlaidLoaded, setIsPlaidLoaded] = useState(false); diff --git a/src/components/PlaidLink/types.ts b/src/components/PlaidLink/types.ts index 1034eb935f74..48526520c736 100644 --- a/src/components/PlaidLink/types.ts +++ b/src/components/PlaidLink/types.ts @@ -1,5 +1,5 @@ -import {LinkEventMetadata, LinkSuccessMetadata} from 'react-native-plaid-link-sdk'; -import {PlaidLinkOnEventMetadata, PlaidLinkOnSuccessMetadata} from 'react-plaid-link'; +import type {LinkEventMetadata, LinkSuccessMetadata} from 'react-native-plaid-link-sdk'; +import type {PlaidLinkOnEventMetadata, PlaidLinkOnSuccessMetadata} from 'react-plaid-link'; type PlaidLinkProps = { // Plaid Link SDK public token used to initialize the Plaid SDK diff --git a/src/components/Popover/index.native.tsx b/src/components/Popover/index.native.tsx index 3fff04d00d2f..08ed15fd0d30 100644 --- a/src/components/Popover/index.native.tsx +++ b/src/components/Popover/index.native.tsx @@ -1,7 +1,7 @@ import React from 'react'; import Modal from '@components/Modal'; import CONST from '@src/CONST'; -import {PopoverProps} from './types'; +import type {PopoverProps} from './types'; /* * This is a convenience wrapper around the Modal component for a responsive Popover. diff --git a/src/components/Popover/index.tsx b/src/components/Popover/index.tsx index bf79415d4794..762e79fab63c 100644 --- a/src/components/Popover/index.tsx +++ b/src/components/Popover/index.tsx @@ -5,7 +5,7 @@ import {PopoverContext} from '@components/PopoverProvider'; import PopoverWithoutOverlay from '@components/PopoverWithoutOverlay'; import withWindowDimensions from '@components/withWindowDimensions'; import CONST from '@src/CONST'; -import {PopoverWithWindowDimensionsProps} from './types'; +import type {PopoverWithWindowDimensionsProps} from './types'; /* * This is a convenience wrapper around the Modal component for a responsive Popover. diff --git a/src/components/Popover/types.ts b/src/components/Popover/types.ts index 7890ce5555f0..3d1f95822e6a 100644 --- a/src/components/Popover/types.ts +++ b/src/components/Popover/types.ts @@ -1,7 +1,8 @@ import type {ValueOf} from 'type-fest'; -import BaseModalProps, {PopoverAnchorPosition} from '@components/Modal/types'; -import {WindowDimensionsProps} from '@components/withWindowDimensions/types'; -import CONST from '@src/CONST'; +import type {PopoverAnchorPosition} from '@components/Modal/types'; +import type BaseModalProps from '@components/Modal/types'; +import type {WindowDimensionsProps} from '@components/withWindowDimensions/types'; +import type CONST from '@src/CONST'; type AnchorAlignment = { /** The horizontal anchor alignment of the popover */ diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index 2c85b80534ca..57865a4bd037 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -1,5 +1,6 @@ import type {ImageContentFit} from 'expo-image'; -import React, {RefObject, useRef} from 'react'; +import type {RefObject} from 'react'; +import React, { useRef} from 'react'; import {View} from 'react-native'; import type {ModalProps} from 'react-native-modal'; import type {SvgProps} from 'react-native-svg'; diff --git a/src/components/PopoverProvider/index.native.tsx b/src/components/PopoverProvider/index.native.tsx index a87036c61808..b13909945bef 100644 --- a/src/components/PopoverProvider/index.native.tsx +++ b/src/components/PopoverProvider/index.native.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {PopoverContextProps, PopoverContextValue} from './types'; +import type {PopoverContextProps, PopoverContextValue} from './types'; const PopoverContext = React.createContext({ onOpen: () => {}, diff --git a/src/components/PopoverProvider/index.tsx b/src/components/PopoverProvider/index.tsx index 06345ebdbc1c..b50b04289813 100644 --- a/src/components/PopoverProvider/index.tsx +++ b/src/components/PopoverProvider/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {AnchorRef, PopoverContextProps, PopoverContextValue} from './types'; +import type {AnchorRef, PopoverContextProps, PopoverContextValue} from './types'; const PopoverContext = React.createContext({ onOpen: () => {}, diff --git a/src/components/PopoverWithMeasuredContent.tsx b/src/components/PopoverWithMeasuredContent.tsx index 206a33181605..dd83b3f196d3 100644 --- a/src/components/PopoverWithMeasuredContent.tsx +++ b/src/components/PopoverWithMeasuredContent.tsx @@ -1,13 +1,14 @@ import isEqual from 'lodash/isEqual'; import React, {useMemo, useState} from 'react'; -import {LayoutChangeEvent, View} from 'react-native'; +import type {LayoutChangeEvent} from 'react-native'; +import { View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import PopoverWithMeasuredContentUtils from '@libs/PopoverWithMeasuredContentUtils'; import CONST from '@src/CONST'; import type {AnchorPosition} from '@src/styles'; import Popover from './Popover'; -import {PopoverProps} from './Popover/types'; +import type {PopoverProps} from './Popover/types'; import type {WindowDimensionsProps} from './withWindowDimensions/types'; type PopoverWithMeasuredContentProps = Omit & { diff --git a/src/components/PopoverWithoutOverlay/index.tsx b/src/components/PopoverWithoutOverlay/index.tsx index f83949bcbe9d..0479161c4ac4 100644 --- a/src/components/PopoverWithoutOverlay/index.tsx +++ b/src/components/PopoverWithoutOverlay/index.tsx @@ -1,4 +1,5 @@ -import React, {ForwardedRef, forwardRef, useContext, useEffect, useMemo} from 'react'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef, useContext, useEffect, useMemo} from 'react'; import {View} from 'react-native'; import ColorSchemeWrapper from '@components/ColorSchemeWrapper'; import {PopoverContext} from '@components/PopoverProvider'; @@ -7,7 +8,7 @@ import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import * as Modal from '@userActions/Modal'; -import PopoverWithoutOverlayProps from './types'; +import type PopoverWithoutOverlayProps from './types'; function PopoverWithoutOverlay( { diff --git a/src/components/PopoverWithoutOverlay/types.ts b/src/components/PopoverWithoutOverlay/types.ts index 0d70c4a5facb..ff4f73fd4114 100644 --- a/src/components/PopoverWithoutOverlay/types.ts +++ b/src/components/PopoverWithoutOverlay/types.ts @@ -1,6 +1,6 @@ -import {View} from 'react-native'; -import BaseModalProps from '@components/Modal/types'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type {View} from 'react-native'; +import type BaseModalProps from '@components/Modal/types'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type PopoverWithoutOverlayProps = ChildrenProps & Omit & { diff --git a/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx b/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx index 0a9f544bcee1..e9de3aaee228 100644 --- a/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx +++ b/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx @@ -1,6 +1,8 @@ -import React, {ForwardedRef, forwardRef, useCallback, useEffect, useMemo} from 'react'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef, useCallback, useEffect, useMemo} from 'react'; // eslint-disable-next-line no-restricted-imports -import {GestureResponderEvent, Pressable, View} from 'react-native'; +import type {GestureResponderEvent, View} from 'react-native'; +import { Pressable} from 'react-native'; import useSingleExecution from '@hooks/useSingleExecution'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -8,7 +10,8 @@ import Accessibility from '@libs/Accessibility'; import HapticFeedback from '@libs/HapticFeedback'; import KeyboardShortcut from '@libs/KeyboardShortcut'; import CONST from '@src/CONST'; -import PressableProps, {PressableRef} from './types'; +import type {PressableRef} from './types'; +import type PressableProps from './types'; function GenericPressable( { diff --git a/src/components/Pressable/GenericPressable/index.native.tsx b/src/components/Pressable/GenericPressable/index.native.tsx index 968ee6063a95..c17163677cbe 100644 --- a/src/components/Pressable/GenericPressable/index.native.tsx +++ b/src/components/Pressable/GenericPressable/index.native.tsx @@ -1,6 +1,7 @@ import React, {forwardRef} from 'react'; import GenericPressable from './BaseGenericPressable'; -import PressableProps, {PressableRef} from './types'; +import type {PressableRef} from './types'; +import type PressableProps from './types'; function NativeGenericPressable(props: PressableProps, ref: PressableRef) { return ( diff --git a/src/components/Pressable/GenericPressable/index.tsx b/src/components/Pressable/GenericPressable/index.tsx index 51099733e04f..3d6301379155 100644 --- a/src/components/Pressable/GenericPressable/index.tsx +++ b/src/components/Pressable/GenericPressable/index.tsx @@ -1,7 +1,8 @@ import React, {forwardRef} from 'react'; -import {Role} from 'react-native'; +import type {Role} from 'react-native'; import GenericPressable from './BaseGenericPressable'; -import PressableProps, {PressableRef} from './types'; +import type {PressableRef} from './types'; +import type PressableProps from './types'; function WebGenericPressable({focusable = true, ...props}: PressableProps, ref: PressableRef) { const accessible = props.accessible ?? props.accessible === undefined ? true : props.accessible; diff --git a/src/components/Pressable/GenericPressable/types.ts b/src/components/Pressable/GenericPressable/types.ts index cdb9a8624114..dc04b6fcf329 100644 --- a/src/components/Pressable/GenericPressable/types.ts +++ b/src/components/Pressable/GenericPressable/types.ts @@ -1,8 +1,8 @@ -import {ElementRef, ForwardedRef, RefObject} from 'react'; -import {GestureResponderEvent, HostComponent, PressableStateCallbackType, PressableProps as RNPressableProps, StyleProp, View, ViewStyle} from 'react-native'; -import {ValueOf} from 'type-fest'; -import {Shortcut} from '@libs/KeyboardShortcut'; -import CONST from '@src/CONST'; +import type {ElementRef, ForwardedRef, RefObject} from 'react'; +import type {GestureResponderEvent, HostComponent, PressableStateCallbackType, PressableProps as RNPressableProps, StyleProp, View, ViewStyle} from 'react-native'; +import type {ValueOf} from 'type-fest'; +import type {Shortcut} from '@libs/KeyboardShortcut'; +import type CONST from '@src/CONST'; type StylePropWithFunction = StyleProp | ((state: PressableStateCallbackType) => StyleProp); diff --git a/src/components/Pressable/PressableWithDelayToggle.tsx b/src/components/Pressable/PressableWithDelayToggle.tsx index d265be929b0c..ab1fa95efeb5 100644 --- a/src/components/Pressable/PressableWithDelayToggle.tsx +++ b/src/components/Pressable/PressableWithDelayToggle.tsx @@ -1,6 +1,6 @@ /* eslint-disable react-native-a11y/has-valid-accessibility-descriptors */ import React, {forwardRef} from 'react'; -import {StyleProp, TextStyle, ViewStyle} from 'react-native'; +import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import Text from '@components/Text'; @@ -10,8 +10,9 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useThrottledButtonState from '@hooks/useThrottledButtonState'; import getButtonState from '@libs/getButtonState'; import variables from '@styles/variables'; -import IconAsset from '@src/types/utils/IconAsset'; -import PressableProps, {PressableRef} from './GenericPressable/types'; +import type IconAsset from '@src/types/utils/IconAsset'; +import type {PressableRef} from './GenericPressable/types'; +import type PressableProps from './GenericPressable/types'; import PressableWithoutFeedback from './PressableWithoutFeedback'; type PressableWithDelayToggleProps = PressableProps & { diff --git a/src/components/Pressable/PressableWithFeedback.tsx b/src/components/Pressable/PressableWithFeedback.tsx index a4c439c4441c..b717c4890a2d 100644 --- a/src/components/Pressable/PressableWithFeedback.tsx +++ b/src/components/Pressable/PressableWithFeedback.tsx @@ -1,10 +1,11 @@ import React, {forwardRef, useState} from 'react'; -import {StyleProp, ViewStyle} from 'react-native'; -import {AnimatedStyle} from 'react-native-reanimated'; +import type {StyleProp, ViewStyle} from 'react-native'; +import type {AnimatedStyle} from 'react-native-reanimated'; import OpacityView from '@components/OpacityView'; import variables from '@styles/variables'; import GenericPressable from './GenericPressable'; -import PressableProps, {PressableRef} from './GenericPressable/types'; +import type {PressableRef} from './GenericPressable/types'; +import type PressableProps from './GenericPressable/types'; type PressableWithFeedbackProps = PressableProps & { /** Style for the wrapper view */ diff --git a/src/components/Pressable/PressableWithoutFeedback.tsx b/src/components/Pressable/PressableWithoutFeedback.tsx index fd9d695cc2ed..f95050dd649e 100644 --- a/src/components/Pressable/PressableWithoutFeedback.tsx +++ b/src/components/Pressable/PressableWithoutFeedback.tsx @@ -1,6 +1,7 @@ import React from 'react'; import GenericPressable from './GenericPressable'; -import PressableProps, {PressableRef} from './GenericPressable/types'; +import type {PressableRef} from './GenericPressable/types'; +import type PressableProps from './GenericPressable/types'; function PressableWithoutFeedback( {pressStyle, hoverStyle, focusStyle, disabledStyle, screenReaderActiveStyle, shouldUseHapticsOnPress, shouldUseHapticsOnLongPress, ...rest}: PressableProps, diff --git a/src/components/Pressable/PressableWithoutFocus.tsx b/src/components/Pressable/PressableWithoutFocus.tsx index 32cb1708baf0..f887b0ea9b7d 100644 --- a/src/components/Pressable/PressableWithoutFocus.tsx +++ b/src/components/Pressable/PressableWithoutFocus.tsx @@ -1,7 +1,7 @@ import React, {useRef} from 'react'; -import {View} from 'react-native'; +import type {View} from 'react-native'; import GenericPressable from './GenericPressable'; -import PressableProps from './GenericPressable/types'; +import type PressableProps from './GenericPressable/types'; /** * This component prevents the tapped element from capturing focus. diff --git a/src/components/PressableWithSecondaryInteraction/index.native.tsx b/src/components/PressableWithSecondaryInteraction/index.native.tsx index 77dc9452f986..94b7e4580a1e 100644 --- a/src/components/PressableWithSecondaryInteraction/index.native.tsx +++ b/src/components/PressableWithSecondaryInteraction/index.native.tsx @@ -1,9 +1,10 @@ -import React, {forwardRef, ReactNode} from 'react'; -import {GestureResponderEvent, TextProps} from 'react-native'; -import {PressableRef} from '@components/Pressable/GenericPressable/types'; +import type { ReactNode} from 'react'; +import React, {forwardRef} from 'react'; +import type {GestureResponderEvent, TextProps} from 'react-native'; +import type {PressableRef} from '@components/Pressable/GenericPressable/types'; import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; import Text from '@components/Text'; -import PressableWithSecondaryInteractionProps from './types'; +import type PressableWithSecondaryInteractionProps from './types'; /** This is a special Pressable that calls onSecondaryInteraction when LongPressed. */ function PressableWithSecondaryInteraction( diff --git a/src/components/PressableWithSecondaryInteraction/index.tsx b/src/components/PressableWithSecondaryInteraction/index.tsx index 0cb53e40325a..5e2de765f733 100644 --- a/src/components/PressableWithSecondaryInteraction/index.tsx +++ b/src/components/PressableWithSecondaryInteraction/index.tsx @@ -1,11 +1,11 @@ import React, {forwardRef, useEffect, useRef} from 'react'; -import {GestureResponderEvent} from 'react-native'; -import {PressableRef} from '@components/Pressable/GenericPressable/types'; +import type {GestureResponderEvent} from 'react-native'; +import type {PressableRef} from '@components/Pressable/GenericPressable/types'; import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; -import PressableWithSecondaryInteractionProps from './types'; +import type PressableWithSecondaryInteractionProps from './types'; /** This is a special Pressable that calls onSecondaryInteraction when LongPressed, or right-clicked. */ function PressableWithSecondaryInteraction( diff --git a/src/components/PressableWithSecondaryInteraction/types.ts b/src/components/PressableWithSecondaryInteraction/types.ts index bf999e9692b5..aa67d45d66fb 100644 --- a/src/components/PressableWithSecondaryInteraction/types.ts +++ b/src/components/PressableWithSecondaryInteraction/types.ts @@ -1,5 +1,5 @@ import type {GestureResponderEvent} from 'react-native'; -import {PressableWithFeedbackProps} from '@components/Pressable/PressableWithFeedback'; +import type {PressableWithFeedbackProps} from '@components/Pressable/PressableWithFeedback'; import type {ParsableStyle} from '@styles/utils/types'; type PressableWithSecondaryInteractionProps = PressableWithFeedbackProps & { diff --git a/src/components/QRCode.tsx b/src/components/QRCode.tsx index 99a3a1f64118..89c367bab222 100644 --- a/src/components/QRCode.tsx +++ b/src/components/QRCode.tsx @@ -1,5 +1,6 @@ -import React, {Ref} from 'react'; -import {ImageSourcePropType} from 'react-native'; +import type {Ref} from 'react'; +import React from 'react'; +import type {ImageSourcePropType} from 'react-native'; import QRCodeLibrary from 'react-native-qrcode-svg'; import useTheme from '@hooks/useTheme'; import CONST from '@src/CONST'; diff --git a/src/components/RNTextInput.tsx b/src/components/RNTextInput.tsx index 40dfc109ba6b..6b540494a364 100644 --- a/src/components/RNTextInput.tsx +++ b/src/components/RNTextInput.tsx @@ -1,7 +1,10 @@ -import React, {Component, ForwardedRef} from 'react'; +import type {Component, ForwardedRef} from 'react'; +import React from 'react'; // eslint-disable-next-line no-restricted-imports -import {TextInput, TextInputProps} from 'react-native'; -import Animated, {AnimatedProps} from 'react-native-reanimated'; +import type { TextInputProps} from 'react-native'; +import {TextInput} from 'react-native'; +import type {AnimatedProps} from 'react-native-reanimated'; +import Animated from 'react-native-reanimated'; import useTheme from '@hooks/useTheme'; type AnimatedTextInputRef = Component>; diff --git a/src/components/RadioButtonWithLabel.tsx b/src/components/RadioButtonWithLabel.tsx index 4c223262ac50..7368101a704a 100644 --- a/src/components/RadioButtonWithLabel.tsx +++ b/src/components/RadioButtonWithLabel.tsx @@ -1,5 +1,7 @@ -import React, {ComponentType} from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {ComponentType} from 'react'; +import React from 'react'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; import FormHelpMessage from './FormHelpMessage'; import * as Pressables from './Pressable'; diff --git a/src/components/ReportActionItem/MoneyReportView.tsx b/src/components/ReportActionItem/MoneyReportView.tsx index 36daa037fd78..85d408bef0d3 100644 --- a/src/components/ReportActionItem/MoneyReportView.tsx +++ b/src/components/ReportActionItem/MoneyReportView.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {StyleProp, TextStyle, View} from 'react-native'; +import type {StyleProp, TextStyle} from 'react-native'; +import { View} from 'react-native'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import SpacerView from '@components/SpacerView'; diff --git a/src/components/ReportActionItem/RenameAction.tsx b/src/components/ReportActionItem/RenameAction.tsx index ef9317ecac0e..b4b2553d652a 100644 --- a/src/components/ReportActionItem/RenameAction.tsx +++ b/src/components/ReportActionItem/RenameAction.tsx @@ -1,6 +1,7 @@ import React from 'react'; import Text from '@components/Text'; -import withCurrentUserPersonalDetails, {type WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; +import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails'; +import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; diff --git a/src/components/ReportWelcomeText.tsx b/src/components/ReportWelcomeText.tsx index 3fa3439fe86a..e2b1460a51f5 100644 --- a/src/components/ReportWelcomeText.tsx +++ b/src/components/ReportWelcomeText.tsx @@ -1,6 +1,7 @@ import React from 'react'; import {View} from 'react-native'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; diff --git a/src/components/SafeArea/index.ios.tsx b/src/components/SafeArea/index.ios.tsx index 1b2e1881ade3..2ef10a192a17 100644 --- a/src/components/SafeArea/index.ios.tsx +++ b/src/components/SafeArea/index.ios.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {SafeAreaView} from 'react-native-safe-area-context'; import useThemeStyles from '@hooks/useThemeStyles'; -import SafeAreaProps from './types'; +import type SafeAreaProps from './types'; function SafeArea({children}: SafeAreaProps) { const styles = useThemeStyles(); diff --git a/src/components/SafeArea/index.tsx b/src/components/SafeArea/index.tsx index 94090ef48642..5aa44c40e859 100644 --- a/src/components/SafeArea/index.tsx +++ b/src/components/SafeArea/index.tsx @@ -1,3 +1,3 @@ -import SafeAreaProps from './types'; +import type SafeAreaProps from './types'; export default ({children}: SafeAreaProps) => children; diff --git a/src/components/SafeArea/types.ts b/src/components/SafeArea/types.ts index 89faea46ab71..7cf53e13b72d 100644 --- a/src/components/SafeArea/types.ts +++ b/src/components/SafeArea/types.ts @@ -1,4 +1,4 @@ -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type SafeAreaProps = ChildrenProps; diff --git a/src/components/SafeAreaConsumer/index.android.tsx b/src/components/SafeAreaConsumer/index.android.tsx index 4e6c9bbd3528..f1523407805b 100644 --- a/src/components/SafeAreaConsumer/index.android.tsx +++ b/src/components/SafeAreaConsumer/index.android.tsx @@ -3,7 +3,7 @@ import React from 'react'; import {SafeAreaInsetsContext} from 'react-native-safe-area-context'; import useStyleUtils from '@hooks/useStyleUtils'; import StatusBar from '@libs/StatusBar'; -import SafeAreaConsumerProps from './types'; +import type SafeAreaConsumerProps from './types'; /** * This component is a light wrapper around the SafeAreaInsetsContext.Consumer. There are several places where we diff --git a/src/components/SafeAreaConsumer/index.tsx b/src/components/SafeAreaConsumer/index.tsx index c05e836a2348..926ff91258f9 100644 --- a/src/components/SafeAreaConsumer/index.tsx +++ b/src/components/SafeAreaConsumer/index.tsx @@ -2,7 +2,7 @@ import React from 'react'; // eslint-disable-next-line no-restricted-imports import {SafeAreaInsetsContext} from 'react-native-safe-area-context'; import useStyleUtils from '@hooks/useStyleUtils'; -import SafeAreaConsumerProps from './types'; +import type SafeAreaConsumerProps from './types'; /** * This component is a light wrapper around the SafeAreaInsetsContext.Consumer. There are several places where we diff --git a/src/components/SafeAreaConsumer/types.ts b/src/components/SafeAreaConsumer/types.ts index bc81de96a082..432bf3f25ca1 100644 --- a/src/components/SafeAreaConsumer/types.ts +++ b/src/components/SafeAreaConsumer/types.ts @@ -1,5 +1,5 @@ -import {DimensionValue} from 'react-native'; -import {EdgeInsets} from 'react-native-safe-area-context'; +import type {DimensionValue} from 'react-native'; +import type {EdgeInsets} from 'react-native-safe-area-context'; type ChildrenProps = { paddingTop?: DimensionValue; diff --git a/src/components/ScrollViewWithContext.tsx b/src/components/ScrollViewWithContext.tsx index 7c75ae2f71b2..2c1eb2bd1fbb 100644 --- a/src/components/ScrollViewWithContext.tsx +++ b/src/components/ScrollViewWithContext.tsx @@ -1,5 +1,7 @@ -import React, {ForwardedRef, useMemo, useRef, useState} from 'react'; -import {NativeScrollEvent, NativeSyntheticEvent, ScrollView} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React, { useMemo, useRef, useState} from 'react'; +import type {NativeScrollEvent, NativeSyntheticEvent} from 'react-native'; +import { ScrollView} from 'react-native'; const MIN_SMOOTH_SCROLL_EVENT_THROTTLE = 16; diff --git a/src/components/Search.tsx b/src/components/Search.tsx index 10820f44738d..87875d956589 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {GestureResponderEvent, StyleProp, View, ViewStyle} from 'react-native'; +import type {GestureResponderEvent, StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; diff --git a/src/components/SectionList/index.android.tsx b/src/components/SectionList/index.android.tsx index 82477fffc3ee..1aa9b501146c 100644 --- a/src/components/SectionList/index.android.tsx +++ b/src/components/SectionList/index.android.tsx @@ -1,6 +1,6 @@ import React, {forwardRef} from 'react'; import {SectionList as RNSectionList} from 'react-native'; -import ForwardedSectionList from './types'; +import type ForwardedSectionList from './types'; // eslint-disable-next-line react/function-component-definition const SectionListWithRef: ForwardedSectionList = (props, ref) => ( diff --git a/src/components/SectionList/index.tsx b/src/components/SectionList/index.tsx index 1c89b50468dd..4af7ad33705c 100644 --- a/src/components/SectionList/index.tsx +++ b/src/components/SectionList/index.tsx @@ -1,6 +1,6 @@ import React, {forwardRef} from 'react'; import {SectionList as RNSectionList} from 'react-native'; -import ForwardedSectionList from './types'; +import type ForwardedSectionList from './types'; // eslint-disable-next-line react/function-component-definition const SectionList: ForwardedSectionList = (props, ref) => ( diff --git a/src/components/SectionList/types.ts b/src/components/SectionList/types.ts index 093cb8f4e77c..4648172aabfd 100644 --- a/src/components/SectionList/types.ts +++ b/src/components/SectionList/types.ts @@ -1,5 +1,5 @@ -import {ForwardedRef} from 'react'; -import {SectionList, SectionListProps} from 'react-native'; +import type {ForwardedRef} from 'react'; +import type {SectionList, SectionListProps} from 'react-native'; type ForwardedSectionList = { (props: SectionListProps, ref: ForwardedRef): React.ReactNode; diff --git a/src/components/SelectCircle.tsx b/src/components/SelectCircle.tsx index 637c06f4d35f..f21d8d4cdbf1 100644 --- a/src/components/SelectCircle.tsx +++ b/src/components/SelectCircle.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import Icon from './Icon'; diff --git a/src/components/SignInPageForm/index.native.tsx b/src/components/SignInPageForm/index.native.tsx index b39e4d681bbe..0d00c754d45a 100644 --- a/src/components/SignInPageForm/index.native.tsx +++ b/src/components/SignInPageForm/index.native.tsx @@ -1,6 +1,6 @@ import React from 'react'; import FormElement from '@components/FormElement'; -import SignInPageFormProps from './types'; +import type SignInPageFormProps from './types'; function SignInPageForm(props: SignInPageFormProps) { // eslint-disable-next-line react/jsx-props-no-spreading diff --git a/src/components/SignInPageForm/index.tsx b/src/components/SignInPageForm/index.tsx index 20b93e6db1b5..b9f0fe202dd1 100644 --- a/src/components/SignInPageForm/index.tsx +++ b/src/components/SignInPageForm/index.tsx @@ -1,7 +1,7 @@ import React, {useEffect, useRef} from 'react'; -import {View} from 'react-native'; +import type {View} from 'react-native'; import FormElement from '@components/FormElement'; -import SignInPageFormProps from './types'; +import type SignInPageFormProps from './types'; const preventFormDefault = (event: SubmitEvent) => { // When enter is pressed form is submitted to action url (POST /). diff --git a/src/components/SignInPageForm/types.ts b/src/components/SignInPageForm/types.ts index 02d948f917b9..c7f71a3f7151 100644 --- a/src/components/SignInPageForm/types.ts +++ b/src/components/SignInPageForm/types.ts @@ -1,4 +1,4 @@ -import {ViewProps} from 'react-native'; +import type {ViewProps} from 'react-native'; type SignInPageFormProps = ViewProps; diff --git a/src/components/SingleChoiceQuestion.tsx b/src/components/SingleChoiceQuestion.tsx index 5b4ea54e4436..9f869ef969c4 100644 --- a/src/components/SingleChoiceQuestion.tsx +++ b/src/components/SingleChoiceQuestion.tsx @@ -1,9 +1,11 @@ -import React, {ForwardedRef, forwardRef} from 'react'; -import {Text as RNText} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef} from 'react'; +import type {Text as RNText} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; import type {MaybePhraseKey} from '@libs/Localize'; import FormHelpMessage from './FormHelpMessage'; -import RadioButtons, {Choice} from './RadioButtons'; +import type {Choice} from './RadioButtons'; +import RadioButtons from './RadioButtons'; import Text from './Text'; type SingleChoiceQuestionProps = { diff --git a/src/components/SingleOptionSelector.tsx b/src/components/SingleOptionSelector.tsx index bc912aacf41d..9832167e3f6a 100644 --- a/src/components/SingleOptionSelector.tsx +++ b/src/components/SingleOptionSelector.tsx @@ -3,7 +3,7 @@ import {View} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; -import {TranslationPaths} from '@src/languages/types'; +import type {TranslationPaths} from '@src/languages/types'; import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback'; import SelectCircle from './SelectCircle'; import Text from './Text'; diff --git a/src/components/SkeletonViewContentLoader/index.native.tsx b/src/components/SkeletonViewContentLoader/index.native.tsx index 370eb2f669f1..6d275e065bb0 100644 --- a/src/components/SkeletonViewContentLoader/index.native.tsx +++ b/src/components/SkeletonViewContentLoader/index.native.tsx @@ -1,6 +1,6 @@ import React from 'react'; import SkeletonViewContentLoader from 'react-content-loader/native'; -import SkeletonViewContentLoaderProps from './types'; +import type SkeletonViewContentLoaderProps from './types'; function ContentLoader(props: SkeletonViewContentLoaderProps) { // eslint-disable-next-line react/jsx-props-no-spreading diff --git a/src/components/SkeletonViewContentLoader/index.tsx b/src/components/SkeletonViewContentLoader/index.tsx index 105e677ad7c1..ad3858a2d8d4 100644 --- a/src/components/SkeletonViewContentLoader/index.tsx +++ b/src/components/SkeletonViewContentLoader/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import SkeletonViewContentLoader from 'react-content-loader'; -import SkeletonViewContentLoaderProps from './types'; +import type SkeletonViewContentLoaderProps from './types'; function ContentLoader(props: SkeletonViewContentLoaderProps) { // eslint-disable-next-line react/jsx-props-no-spreading diff --git a/src/components/SkeletonViewContentLoader/types.ts b/src/components/SkeletonViewContentLoader/types.ts index 23f0a051e518..5f4089f316dd 100644 --- a/src/components/SkeletonViewContentLoader/types.ts +++ b/src/components/SkeletonViewContentLoader/types.ts @@ -1,5 +1,5 @@ -import {IContentLoaderProps} from 'react-content-loader'; -import {IContentLoaderProps as NativeIContentLoaderProps} from 'react-content-loader/native'; +import type {IContentLoaderProps} from 'react-content-loader'; +import type {IContentLoaderProps as NativeIContentLoaderProps} from 'react-content-loader/native'; type SkeletonViewContentLoaderProps = IContentLoaderProps & NativeIContentLoaderProps; diff --git a/src/components/SpacerView.tsx b/src/components/SpacerView.tsx index 4c54aef61ba2..23c109f7d589 100644 --- a/src/components/SpacerView.tsx +++ b/src/components/SpacerView.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {StyleProp, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; import Animated, {useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; import usePrevious from '@hooks/usePrevious'; import CONST from '@src/CONST'; diff --git a/src/components/SplashScreenHider/index.native.tsx b/src/components/SplashScreenHider/index.native.tsx index 863be2f5910c..b722f189f1c1 100644 --- a/src/components/SplashScreenHider/index.native.tsx +++ b/src/components/SplashScreenHider/index.native.tsx @@ -1,5 +1,6 @@ import {useCallback, useRef} from 'react'; -import {StyleSheet, ViewStyle} from 'react-native'; +import type { ViewStyle} from 'react-native'; +import {StyleSheet} from 'react-native'; import Reanimated, {Easing, runOnJS, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; import Logo from '@assets/images/new-expensify-dark.svg'; import ImageSVG from '@components/ImageSVG'; diff --git a/src/components/SplashScreenHider/types.ts b/src/components/SplashScreenHider/types.ts index ff7b2beb1520..e48bbdcee307 100644 --- a/src/components/SplashScreenHider/types.ts +++ b/src/components/SplashScreenHider/types.ts @@ -1,4 +1,4 @@ -import {ReactNode} from 'react'; +import type {ReactNode} from 'react'; type SplashScreenHiderProps = { /** Splash screen has been hidden */ diff --git a/src/components/SubscriptAvatar.tsx b/src/components/SubscriptAvatar.tsx index 611fbe2cbbc4..cd2562b24351 100644 --- a/src/components/SubscriptAvatar.tsx +++ b/src/components/SubscriptAvatar.tsx @@ -1,12 +1,12 @@ import React, {memo} from 'react'; import {View} from 'react-native'; -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import type {AvatarSource} from '@libs/UserUtils'; import CONST from '@src/CONST'; -import {AvatarType} from '@src/types/onyx/OnyxCommon'; +import type {AvatarType} from '@src/types/onyx/OnyxCommon'; import Avatar from './Avatar'; import UserDetailsTooltip from './UserDetailsTooltip'; diff --git a/src/components/SwipeableView/index.native.tsx b/src/components/SwipeableView/index.native.tsx index 91d851101d4e..67c6695c1a7f 100644 --- a/src/components/SwipeableView/index.native.tsx +++ b/src/components/SwipeableView/index.native.tsx @@ -1,7 +1,7 @@ import React, {useRef} from 'react'; import {PanResponder, View} from 'react-native'; import CONST from '@src/CONST'; -import SwipeableViewProps from './types'; +import type SwipeableViewProps from './types'; function SwipeableView({children, onSwipeDown}: SwipeableViewProps) { const minimumPixelDistance = CONST.COMPOSER_MAX_HEIGHT; diff --git a/src/components/SwipeableView/index.tsx b/src/components/SwipeableView/index.tsx index 335c3e7dcf03..d3881d2efd21 100644 --- a/src/components/SwipeableView/index.tsx +++ b/src/components/SwipeableView/index.tsx @@ -1,4 +1,4 @@ -import SwipeableViewProps from './types'; +import type SwipeableViewProps from './types'; // Swipeable View is available just on Android/iOS for now. export default ({children}: SwipeableViewProps) => children; diff --git a/src/components/SwipeableView/types.ts b/src/components/SwipeableView/types.ts index 560df7ef5a45..738e21bb73ee 100644 --- a/src/components/SwipeableView/types.ts +++ b/src/components/SwipeableView/types.ts @@ -1,4 +1,4 @@ -import {ReactNode} from 'react'; +import type {ReactNode} from 'react'; type SwipeableViewProps = { /** The content to be rendered within the SwipeableView */ diff --git a/src/components/TabSelector/TabIcon.tsx b/src/components/TabSelector/TabIcon.tsx index 3d3850a37061..31833b2fc852 100644 --- a/src/components/TabSelector/TabIcon.tsx +++ b/src/components/TabSelector/TabIcon.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {Animated, StyleSheet, View} from 'react-native'; import Icon from '@components/Icon'; import useTheme from '@hooks/useTheme'; -import IconAsset from '@src/types/utils/IconAsset'; +import type IconAsset from '@src/types/utils/IconAsset'; type TabIconProps = { /** Icon to display on tab */ diff --git a/src/components/TabSelector/TabSelector.tsx b/src/components/TabSelector/TabSelector.tsx index 3809460436e5..1b8b6bc1b22b 100644 --- a/src/components/TabSelector/TabSelector.tsx +++ b/src/components/TabSelector/TabSelector.tsx @@ -1,16 +1,16 @@ -import {MaterialTopTabNavigationHelpers} from '@react-navigation/material-top-tabs/lib/typescript/src/types'; -import {TabNavigationState} from '@react-navigation/native'; +import type {MaterialTopTabNavigationHelpers} from '@react-navigation/material-top-tabs/lib/typescript/src/types'; +import type {TabNavigationState} from '@react-navigation/native'; import React, {useCallback, useEffect, useMemo, useState} from 'react'; import type {Animated} from 'react-native'; import {View} from 'react-native'; import * as Expensicons from '@components/Icon/Expensicons'; -import {LocaleContextProps} from '@components/LocaleContextProvider'; +import type {LocaleContextProps} from '@components/LocaleContextProvider'; import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -import {RootStackParamList} from '@libs/Navigation/types'; +import type {RootStackParamList} from '@libs/Navigation/types'; import CONST from '@src/CONST'; -import IconAsset from '@src/types/utils/IconAsset'; +import type IconAsset from '@src/types/utils/IconAsset'; import TabSelectorItem from './TabSelectorItem'; type TabSelectorProps = { diff --git a/src/components/TabSelector/TabSelectorItem.tsx b/src/components/TabSelector/TabSelectorItem.tsx index a246e1a14b54..d5507c8c83db 100644 --- a/src/components/TabSelector/TabSelectorItem.tsx +++ b/src/components/TabSelector/TabSelectorItem.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {Animated, StyleSheet} from 'react-native'; import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; import useThemeStyles from '@hooks/useThemeStyles'; -import IconAsset from '@src/types/utils/IconAsset'; +import type IconAsset from '@src/types/utils/IconAsset'; import TabIcon from './TabIcon'; import TabLabel from './TabLabel'; diff --git a/src/components/TaskHeaderActionButton.tsx b/src/components/TaskHeaderActionButton.tsx index b1a32b356ae1..96f7e040ae0e 100644 --- a/src/components/TaskHeaderActionButton.tsx +++ b/src/components/TaskHeaderActionButton.tsx @@ -1,13 +1,14 @@ import React from 'react'; import {View} from 'react-native'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as ReportUtils from '@libs/ReportUtils'; import * as Session from '@userActions/Session'; import * as Task from '@userActions/Task'; import ONYXKEYS from '@src/ONYXKEYS'; -import * as OnyxTypes from '@src/types/onyx'; +import type * as OnyxTypes from '@src/types/onyx'; import Button from './Button'; type TaskHeaderActionButtonOnyxProps = { diff --git a/src/components/TestToolMenu.tsx b/src/components/TestToolMenu.tsx index 82b597f77268..74e099af2820 100644 --- a/src/components/TestToolMenu.tsx +++ b/src/components/TestToolMenu.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import useThemeStyles from '@hooks/useThemeStyles'; import * as ApiUtils from '@libs/ApiUtils'; import compose from '@libs/compose'; @@ -8,8 +9,8 @@ import * as Session from '@userActions/Session'; import * as User from '@userActions/User'; import CONFIG from '@src/CONFIG'; import ONYXKEYS from '@src/ONYXKEYS'; -import NetworkOnyx from '@src/types/onyx/Network'; -import UserOnyx from '@src/types/onyx/User'; +import type NetworkOnyx from '@src/types/onyx/Network'; +import type UserOnyx from '@src/types/onyx/User'; import Button from './Button'; import {withNetwork} from './OnyxProvider'; import Switch from './Switch'; diff --git a/src/components/TestToolsModal.tsx b/src/components/TestToolsModal.tsx index 4138df64adc2..574dd80257f7 100644 --- a/src/components/TestToolsModal.tsx +++ b/src/components/TestToolsModal.tsx @@ -1,6 +1,7 @@ import React from 'react'; import {View} from 'react-native'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import useThemeStyles from '@hooks/useThemeStyles'; import toggleTestToolsModal from '@userActions/TestTool'; import CONST from '@src/CONST'; diff --git a/src/components/Text.tsx b/src/components/Text.tsx index 0d201bd253c4..bf464aeb7270 100644 --- a/src/components/Text.tsx +++ b/src/components/Text.tsx @@ -1,10 +1,11 @@ -import React, {ForwardedRef} from 'react'; -import {Text as RNText, TextProps as RNTextProps, StyleSheet} from 'react-native'; -import type {TextStyle} from 'react-native'; +import type {ForwardedRef} from 'react'; +import React from 'react'; +import {Text as RNText, StyleSheet} from 'react-native'; +import type {TextStyle, TextProps as RNTextProps} from 'react-native'; import useTheme from '@hooks/useTheme'; import fontFamily from '@styles/utils/fontFamily'; import variables from '@styles/variables'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type TextProps = RNTextProps & ChildrenProps & { diff --git a/src/components/TextInput/BaseTextInput/index.native.tsx b/src/components/TextInput/BaseTextInput/index.native.tsx index 4f909dcf6e64..7a5fc3a62838 100644 --- a/src/components/TextInput/BaseTextInput/index.native.tsx +++ b/src/components/TextInput/BaseTextInput/index.native.tsx @@ -1,13 +1,14 @@ import Str from 'expensify-common/lib/str'; import React, {forwardRef, useCallback, useEffect, useRef, useState} from 'react'; -import {ActivityIndicator, Animated, StyleSheet, TextInput, View} from 'react-native'; -import type {GestureResponderEvent, LayoutChangeEvent, NativeSyntheticEvent, StyleProp, TextInputFocusEventData, ViewStyle} from 'react-native'; +import {ActivityIndicator, Animated, StyleSheet, View} from 'react-native'; +import type {GestureResponderEvent, LayoutChangeEvent, NativeSyntheticEvent, StyleProp, TextInputFocusEventData, ViewStyle, TextInput} from 'react-native'; import Checkbox from '@components/Checkbox'; import FormHelpMessage from '@components/FormHelpMessage'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback'; -import RNTextInput, {type AnimatedTextInputRef} from '@components/RNTextInput'; +import RNTextInput from '@components/RNTextInput'; +import type {AnimatedTextInputRef} from '@components/RNTextInput'; import SwipeInterceptPanResponder from '@components/SwipeInterceptPanResponder'; import Text from '@components/Text'; import * as styleConst from '@components/TextInput/styleConst'; diff --git a/src/components/TextInput/BaseTextInput/index.tsx b/src/components/TextInput/BaseTextInput/index.tsx index a66df0496a1a..89711cd0859f 100644 --- a/src/components/TextInput/BaseTextInput/index.tsx +++ b/src/components/TextInput/BaseTextInput/index.tsx @@ -1,13 +1,14 @@ import Str from 'expensify-common/lib/str'; import React, {forwardRef, useCallback, useEffect, useMemo, useRef, useState} from 'react'; -import {ActivityIndicator, Animated, StyleSheet, TextInput, View} from 'react-native'; -import type {GestureResponderEvent, LayoutChangeEvent, NativeSyntheticEvent, StyleProp, TextInputFocusEventData, ViewStyle} from 'react-native'; +import {ActivityIndicator, Animated, StyleSheet, View} from 'react-native'; +import type {GestureResponderEvent, LayoutChangeEvent, NativeSyntheticEvent, StyleProp, TextInputFocusEventData, ViewStyle, TextInput} from 'react-native'; import Checkbox from '@components/Checkbox'; import FormHelpMessage from '@components/FormHelpMessage'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback'; -import RNTextInput, {AnimatedTextInputRef} from '@components/RNTextInput'; +import type {AnimatedTextInputRef} from '@components/RNTextInput'; +import RNTextInput from '@components/RNTextInput'; import SwipeInterceptPanResponder from '@components/SwipeInterceptPanResponder'; import Text from '@components/Text'; import * as styleConst from '@components/TextInput/styleConst'; diff --git a/src/components/TextInput/BaseTextInput/types.ts b/src/components/TextInput/BaseTextInput/types.ts index 2b8264af815b..f8376219d80f 100644 --- a/src/components/TextInput/BaseTextInput/types.ts +++ b/src/components/TextInput/BaseTextInput/types.ts @@ -2,7 +2,7 @@ import type {Component, ForwardedRef} from 'react'; import type {GestureResponderEvent, StyleProp, TextInputProps, TextStyle, ViewStyle} from 'react-native'; import type {AnimatedProps} from 'react-native-reanimated'; import type {MaybePhraseKey} from '@libs/Localize'; -import IconAsset from '@src/types/utils/IconAsset'; +import type IconAsset from '@src/types/utils/IconAsset'; type CustomBaseTextInputProps = { /** Input label */ diff --git a/src/components/TextInput/TextInputLabel/index.tsx b/src/components/TextInput/TextInputLabel/index.tsx index 628de2970331..7f1263ac273d 100644 --- a/src/components/TextInput/TextInputLabel/index.tsx +++ b/src/components/TextInput/TextInputLabel/index.tsx @@ -1,5 +1,6 @@ import React, {useEffect, useRef} from 'react'; -import {Animated, Text} from 'react-native'; +import type { Text} from 'react-native'; +import {Animated} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; import type TextInputLabelProps from './types'; diff --git a/src/components/TextInput/TextInputLabel/types.ts b/src/components/TextInput/TextInputLabel/types.ts index 6f85eef18f42..e8ec50ffb0c5 100644 --- a/src/components/TextInput/TextInputLabel/types.ts +++ b/src/components/TextInput/TextInputLabel/types.ts @@ -1,4 +1,4 @@ -import {Animated} from 'react-native'; +import type {Animated} from 'react-native'; type TextInputLabelProps = { /** Label */ diff --git a/src/components/TextLink.tsx b/src/components/TextLink.tsx index 1a67e7bc4c5f..435f56484de7 100644 --- a/src/components/TextLink.tsx +++ b/src/components/TextLink.tsx @@ -1,10 +1,12 @@ -import React, {ForwardedRef, forwardRef, KeyboardEventHandler, MouseEventHandler} from 'react'; -import {GestureResponderEvent, Text as RNText, StyleProp, TextStyle} from 'react-native'; +import type {ForwardedRef, KeyboardEventHandler, MouseEventHandler} from 'react'; +import React, { forwardRef} from 'react'; +import type {GestureResponderEvent, Text as RNText, StyleProp, TextStyle} from 'react-native'; import useEnvironment from '@hooks/useEnvironment'; import useThemeStyles from '@hooks/useThemeStyles'; import * as Link from '@userActions/Link'; import CONST from '@src/CONST'; -import Text, {TextProps} from './Text'; +import type {TextProps} from './Text'; +import Text from './Text'; type LinkProps = { /** Link to open in new tab */ diff --git a/src/components/TextWithEllipsis/index.tsx b/src/components/TextWithEllipsis/index.tsx index fda0d5ab576e..f4fdc5b5a431 100644 --- a/src/components/TextWithEllipsis/index.tsx +++ b/src/components/TextWithEllipsis/index.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {StyleProp, TextStyle, View, ViewStyle} from 'react-native'; +import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import Text from '@components/Text'; import useThemeStyles from '@hooks/useThemeStyles'; diff --git a/src/components/ThemeProvider.tsx b/src/components/ThemeProvider.tsx index 34bc32be9c99..f3d2d9e64ca7 100644 --- a/src/components/ThemeProvider.tsx +++ b/src/components/ThemeProvider.tsx @@ -4,7 +4,7 @@ import React, {useMemo} from 'react'; import useThemePreferenceWithStaticOverride from '@hooks/useThemePreferenceWithStaticOverride'; import themes from '@styles/theme'; import ThemeContext from '@styles/theme/context/ThemeContext'; -import {ThemePreferenceWithoutSystem} from '@styles/theme/types'; +import type {ThemePreferenceWithoutSystem} from '@styles/theme/types'; const propTypes = { /** Rendered child component */ diff --git a/src/components/ThumbnailImage.tsx b/src/components/ThumbnailImage.tsx index 08b269e45f62..d40f840bc141 100644 --- a/src/components/ThumbnailImage.tsx +++ b/src/components/ThumbnailImage.tsx @@ -1,6 +1,7 @@ import lodashClamp from 'lodash/clamp'; import React, {useCallback, useState} from 'react'; -import {Dimensions, StyleProp, View, ViewStyle} from 'react-native'; +import type { StyleProp, ViewStyle} from 'react-native'; +import {Dimensions, View} from 'react-native'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; diff --git a/src/components/TimePicker/setCursorPosition/index.ios.ts b/src/components/TimePicker/setCursorPosition/index.ios.ts index 7e51abc3212e..63edf5f3dce8 100644 --- a/src/components/TimePicker/setCursorPosition/index.ios.ts +++ b/src/components/TimePicker/setCursorPosition/index.ios.ts @@ -1,4 +1,4 @@ -import SetCursorPosition from './types'; +import type SetCursorPosition from './types'; const setCursorPosition: SetCursorPosition = (position, ref, setSelection) => { const selection = { diff --git a/src/components/TimePicker/setCursorPosition/index.ts b/src/components/TimePicker/setCursorPosition/index.ts index 4d114641909f..5bfc8c1bd5da 100644 --- a/src/components/TimePicker/setCursorPosition/index.ts +++ b/src/components/TimePicker/setCursorPosition/index.ts @@ -1,4 +1,4 @@ -import SetCursorPosition from './types'; +import type SetCursorPosition from './types'; const setCursorPosition: SetCursorPosition = (position, ref, setSelection) => { setSelection({ diff --git a/src/components/TimePicker/setCursorPosition/types.ts b/src/components/TimePicker/setCursorPosition/types.ts index f7fd20a59e8e..671bf86bf209 100644 --- a/src/components/TimePicker/setCursorPosition/types.ts +++ b/src/components/TimePicker/setCursorPosition/types.ts @@ -1,5 +1,5 @@ -import {RefObject} from 'react'; -import {TextInput} from 'react-native'; +import type {RefObject} from 'react'; +import type {TextInput} from 'react-native'; type SetCursorPosition = (position: number, ref: RefObject, setSelection: (value: {start: number; end: number}) => void) => void; diff --git a/src/components/Tooltip/BaseTooltip/index.native.tsx b/src/components/Tooltip/BaseTooltip/index.native.tsx index 6d9eb24aaec5..9d4bb1079703 100644 --- a/src/components/Tooltip/BaseTooltip/index.native.tsx +++ b/src/components/Tooltip/BaseTooltip/index.native.tsx @@ -1,5 +1,5 @@ import {forwardRef} from 'react'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; // We can't use the common component for the Tooltip as Web implementation uses DOM specific method // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/src/components/Tooltip/BaseTooltip/index.tsx b/src/components/Tooltip/BaseTooltip/index.tsx index e2a2c46e4546..c284016a593f 100644 --- a/src/components/Tooltip/BaseTooltip/index.tsx +++ b/src/components/Tooltip/BaseTooltip/index.tsx @@ -1,10 +1,11 @@ import {BoundsObserver} from '@react-ng/bounds-observer'; -import React, {ForwardedRef, forwardRef, memo, useCallback, useEffect, useRef, useState} from 'react'; +import type {ForwardedRef} from 'react'; +import React, { forwardRef, memo, useCallback, useEffect, useRef, useState} from 'react'; import {Animated} from 'react-native'; import Hoverable from '@components/Hoverable'; import TooltipRenderedOnPageBody from '@components/Tooltip/TooltipRenderedOnPageBody'; import TooltipSense from '@components/Tooltip/TooltipSense'; -import TooltipProps from '@components/Tooltip/types'; +import type TooltipProps from '@components/Tooltip/types'; import useLocalize from '@hooks/useLocalize'; import usePrevious from '@hooks/usePrevious'; import useWindowDimensions from '@hooks/useWindowDimensions'; diff --git a/src/components/Tooltip/PopoverAnchorTooltip.tsx b/src/components/Tooltip/PopoverAnchorTooltip.tsx index e524c55f6d2f..792977ff7c43 100644 --- a/src/components/Tooltip/PopoverAnchorTooltip.tsx +++ b/src/components/Tooltip/PopoverAnchorTooltip.tsx @@ -1,8 +1,8 @@ -import {BoundsObserver} from '@react-ng/bounds-observer'; +import type {BoundsObserver} from '@react-ng/bounds-observer'; import React, {useContext, useMemo, useRef} from 'react'; import {PopoverContext} from '@components/PopoverProvider'; import BaseTooltip from './BaseTooltip'; -import {TooltipExtendedProps} from './types'; +import type {TooltipExtendedProps} from './types'; function PopoverAnchorTooltip({shouldRender = true, children, ...props}: TooltipExtendedProps) { const {isOpen, popover} = useContext(PopoverContext); diff --git a/src/components/Tooltip/TooltipRenderedOnPageBody.tsx b/src/components/Tooltip/TooltipRenderedOnPageBody.tsx index 4549f48501bf..5ffd8596e6de 100644 --- a/src/components/Tooltip/TooltipRenderedOnPageBody.tsx +++ b/src/components/Tooltip/TooltipRenderedOnPageBody.tsx @@ -6,7 +6,7 @@ import useStyleUtils from '@hooks/useStyleUtils'; import Log from '@libs/Log'; import textRef from '@src/types/utils/textRef'; import viewRef from '@src/types/utils/viewRef'; -import TooltipProps from './types'; +import type TooltipProps from './types'; type TooltipRenderedOnPageBodyProps = { /** Window width */ diff --git a/src/components/Tooltip/index.tsx b/src/components/Tooltip/index.tsx index 6d274b87badb..603698592711 100644 --- a/src/components/Tooltip/index.tsx +++ b/src/components/Tooltip/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import BaseTooltip from './BaseTooltip'; -import {TooltipExtendedProps} from './types'; +import type {TooltipExtendedProps} from './types'; function Tooltip({shouldRender = true, children, ...props}: TooltipExtendedProps) { if (!shouldRender) { diff --git a/src/components/Tooltip/types.ts b/src/components/Tooltip/types.ts index df95c3ea5979..f7ae0737ff7b 100644 --- a/src/components/Tooltip/types.ts +++ b/src/components/Tooltip/types.ts @@ -1,4 +1,4 @@ -import {ReactElement, ReactNode} from 'react'; +import type {ReactElement, ReactNode} from 'react'; type TooltipProps = { /** The text to display in the tooltip. If text is ommitted, only children will be rendered. */ diff --git a/src/components/ValidateCode/ValidateCodeModal.tsx b/src/components/ValidateCode/ValidateCodeModal.tsx index 257912ab623a..715f07070975 100644 --- a/src/components/ValidateCode/ValidateCodeModal.tsx +++ b/src/components/ValidateCode/ValidateCodeModal.tsx @@ -1,6 +1,7 @@ import React, {useCallback} from 'react'; import {View} from 'react-native'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; @@ -12,7 +13,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import variables from '@styles/variables'; import * as Session from '@userActions/Session'; import ONYXKEYS from '@src/ONYXKEYS'; -import {Session as SessionType} from '@src/types/onyx'; +import type {Session as SessionType} from '@src/types/onyx'; type ValidateCodeModalOnyxProps = { /** Session of currently logged in user */ diff --git a/src/components/WalletSection.tsx b/src/components/WalletSection.tsx index 69c4bd259a5d..0c966367be45 100644 --- a/src/components/WalletSection.tsx +++ b/src/components/WalletSection.tsx @@ -1,7 +1,7 @@ import React from 'react'; import useThemeStyles from '@hooks/useThemeStyles'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; -import IconAsset from '@src/types/utils/IconAsset'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; +import type IconAsset from '@src/types/utils/IconAsset'; import Section from './Section'; type WalletSectionProps = ChildrenProps & { diff --git a/src/components/WalletStatementModal/index.native.tsx b/src/components/WalletStatementModal/index.native.tsx index f54d7c68fe95..a287c68504dc 100644 --- a/src/components/WalletStatementModal/index.native.tsx +++ b/src/components/WalletStatementModal/index.native.tsx @@ -1,7 +1,8 @@ import React, {useCallback, useRef} from 'react'; import {withOnyx} from 'react-native-onyx'; -import {WebView, WebViewNavigation} from 'react-native-webview'; -import {ValueOf} from 'type-fest'; +import type { WebViewNavigation} from 'react-native-webview'; +import {WebView} from 'react-native-webview'; +import type {ValueOf} from 'type-fest'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import Navigation from '@libs/Navigation/Navigation'; import * as Report from '@userActions/Report'; diff --git a/src/components/WalletStatementModal/types.ts b/src/components/WalletStatementModal/types.ts index bb926b8250ae..f6989f37f49b 100644 --- a/src/components/WalletStatementModal/types.ts +++ b/src/components/WalletStatementModal/types.ts @@ -1,4 +1,4 @@ -import {OnyxEntry} from 'react-native-onyx/lib/types'; +import type {OnyxEntry} from 'react-native-onyx/lib/types'; import type {Session} from '@src/types/onyx'; type WalletStatementOnyxProps = { diff --git a/src/components/createOnyxContext.tsx b/src/components/createOnyxContext.tsx index f7b2d6cbf297..99f48ea80d5f 100644 --- a/src/components/createOnyxContext.tsx +++ b/src/components/createOnyxContext.tsx @@ -1,9 +1,10 @@ import Str from 'expensify-common/lib/str'; -import React, {ComponentType, createContext, ForwardedRef, forwardRef, ForwardRefExoticComponent, PropsWithoutRef, ReactNode, RefAttributes, useContext} from 'react'; +import type {ComponentType, ForwardedRef, ForwardRefExoticComponent, PropsWithoutRef, ReactNode, RefAttributes} from 'react'; +import React, { createContext, forwardRef, useContext} from 'react'; import {withOnyx} from 'react-native-onyx'; import getComponentDisplayName from '@libs/getComponentDisplayName'; -import {OnyxCollectionKey, OnyxKey, OnyxKeyValue, OnyxValues} from '@src/ONYXKEYS'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type {OnyxCollectionKey, OnyxKey, OnyxKeyValue, OnyxValues} from '@src/ONYXKEYS'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type OnyxKeys = (OnyxKey | OnyxCollectionKey) & keyof OnyxValues; diff --git a/src/components/withCurrentReportID.tsx b/src/components/withCurrentReportID.tsx index 3ce9eeae37b5..b1f84db36257 100644 --- a/src/components/withCurrentReportID.tsx +++ b/src/components/withCurrentReportID.tsx @@ -1,6 +1,7 @@ -import {NavigationState} from '@react-navigation/native'; +import type {NavigationState} from '@react-navigation/native'; import PropTypes from 'prop-types'; -import React, {ComponentType, createContext, ForwardedRef, forwardRef, RefAttributes, useCallback, useMemo, useState} from 'react'; +import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import React, { createContext, forwardRef, useCallback, useMemo, useState} from 'react'; import getComponentDisplayName from '@libs/getComponentDisplayName'; import Navigation from '@libs/Navigation/Navigation'; diff --git a/src/components/withCurrentUserPersonalDetails.tsx b/src/components/withCurrentUserPersonalDetails.tsx index 289e2254952f..d329aa2a5c2d 100644 --- a/src/components/withCurrentUserPersonalDetails.tsx +++ b/src/components/withCurrentUserPersonalDetails.tsx @@ -1,5 +1,7 @@ -import React, {ComponentType, ForwardedRef, RefAttributes, useMemo} from 'react'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import React, { useMemo} from 'react'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import getComponentDisplayName from '@libs/getComponentDisplayName'; import personalDetailsPropType from '@pages/personalDetailsPropType'; import CONST from '@src/CONST'; diff --git a/src/components/withEnvironment.tsx b/src/components/withEnvironment.tsx index 6054b43f97f5..21854c11b5ce 100644 --- a/src/components/withEnvironment.tsx +++ b/src/components/withEnvironment.tsx @@ -1,5 +1,6 @@ -import React, {ComponentType, createContext, ForwardedRef, forwardRef, ReactElement, ReactNode, RefAttributes, useContext, useEffect, useMemo, useState} from 'react'; -import {ValueOf} from 'type-fest'; +import type {ComponentType, ForwardedRef, ReactElement, ReactNode, RefAttributes} from 'react'; +import React, { createContext, forwardRef, useContext, useEffect, useMemo, useState} from 'react'; +import type {ValueOf} from 'type-fest'; import * as Environment from '@libs/Environment/Environment'; import getComponentDisplayName from '@libs/getComponentDisplayName'; import CONST from '@src/CONST'; diff --git a/src/components/withKeyboardState.tsx b/src/components/withKeyboardState.tsx index 0c168a4537f5..958c1fe4f867 100755 --- a/src/components/withKeyboardState.tsx +++ b/src/components/withKeyboardState.tsx @@ -1,8 +1,9 @@ import PropTypes from 'prop-types'; -import React, {ComponentType, createContext, ForwardedRef, forwardRef, ReactElement, RefAttributes, useEffect, useMemo, useState} from 'react'; +import type {ComponentType, ForwardedRef, ReactElement, RefAttributes} from 'react'; +import React, { createContext, forwardRef, useEffect, useMemo, useState} from 'react'; import {Keyboard} from 'react-native'; import getComponentDisplayName from '@libs/getComponentDisplayName'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type KeyboardStateContextValue = { /** Whether the keyboard is open */ diff --git a/src/components/withLocalize.tsx b/src/components/withLocalize.tsx index 040ec509135e..c1b756cde08f 100755 --- a/src/components/withLocalize.tsx +++ b/src/components/withLocalize.tsx @@ -1,7 +1,9 @@ import PropTypes from 'prop-types'; -import React, {ComponentType, ForwardedRef, forwardRef, ReactElement, RefAttributes} from 'react'; +import type {ComponentType, ForwardedRef, ReactElement, RefAttributes} from 'react'; +import React, { forwardRef} from 'react'; import getComponentDisplayName from '@libs/getComponentDisplayName'; -import {LocaleContext, LocaleContextProps} from './LocaleContextProvider'; +import type { LocaleContextProps} from './LocaleContextProvider'; +import {LocaleContext} from './LocaleContextProvider'; const withLocalizePropTypes = { /** Returns translated string for given locale and phrase */ diff --git a/src/components/withNavigation.tsx b/src/components/withNavigation.tsx index 88788edafb79..aae8c157d75a 100644 --- a/src/components/withNavigation.tsx +++ b/src/components/withNavigation.tsx @@ -1,7 +1,9 @@ -import {NavigationProp, useNavigation} from '@react-navigation/native'; -import React, {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import type {NavigationProp} from '@react-navigation/native'; +import { useNavigation} from '@react-navigation/native'; +import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import React from 'react'; import getComponentDisplayName from '@libs/getComponentDisplayName'; -import {RootStackParamList} from '@libs/Navigation/types'; +import type {RootStackParamList} from '@libs/Navigation/types'; type WithNavigationProps = { navigation: NavigationProp; diff --git a/src/components/withNavigationFallback.tsx b/src/components/withNavigationFallback.tsx index aa58b12d4b01..5a8011205a00 100644 --- a/src/components/withNavigationFallback.tsx +++ b/src/components/withNavigationFallback.tsx @@ -1,7 +1,8 @@ import {NavigationContext} from '@react-navigation/core'; -import {NavigationProp} from '@react-navigation/native'; -import {ParamListBase} from '@react-navigation/routers'; -import React, {ComponentType, ForwardedRef, forwardRef, ReactElement, RefAttributes, useContext, useMemo} from 'react'; +import type {NavigationProp} from '@react-navigation/native'; +import type {ParamListBase} from '@react-navigation/routers'; +import type {ComponentType, ForwardedRef, ReactElement, RefAttributes} from 'react'; +import React, { forwardRef, useContext, useMemo} from 'react'; type AddListenerCallback = () => void; diff --git a/src/components/withNavigationFocus.tsx b/src/components/withNavigationFocus.tsx index 8dcd06ecb4c8..90a674a2e56e 100644 --- a/src/components/withNavigationFocus.tsx +++ b/src/components/withNavigationFocus.tsx @@ -1,5 +1,6 @@ import {useIsFocused} from '@react-navigation/native'; -import React, {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import React from 'react'; import getComponentDisplayName from '@libs/getComponentDisplayName'; type WithNavigationFocusProps = { diff --git a/src/components/withStyleUtils.tsx b/src/components/withStyleUtils.tsx index 821587a1ae43..cc45738c5bbf 100644 --- a/src/components/withStyleUtils.tsx +++ b/src/components/withStyleUtils.tsx @@ -1,8 +1,9 @@ import PropTypes from 'prop-types'; -import React, {ComponentType, ForwardedRef, forwardRef, ReactElement, RefAttributes} from 'react'; +import type {ComponentType, ForwardedRef, ReactElement, RefAttributes} from 'react'; +import React, { forwardRef} from 'react'; import useStyleUtils from '@hooks/useStyleUtils'; import getComponentDisplayName from '@libs/getComponentDisplayName'; -import {StyleUtilsType} from '@styles/utils'; +import type {StyleUtilsType} from '@styles/utils'; const withStyleUtilsPropTypes = { StyleUtils: PropTypes.object.isRequired, diff --git a/src/components/withTheme.tsx b/src/components/withTheme.tsx index 93349e8e2ba4..75f3e571282c 100644 --- a/src/components/withTheme.tsx +++ b/src/components/withTheme.tsx @@ -1,8 +1,9 @@ import PropTypes from 'prop-types'; -import React, {ComponentType, ForwardedRef, forwardRef, ReactElement, RefAttributes} from 'react'; +import type {ComponentType, ForwardedRef, ReactElement, RefAttributes} from 'react'; +import React, { forwardRef} from 'react'; import useTheme from '@hooks/useTheme'; import getComponentDisplayName from '@libs/getComponentDisplayName'; -import {type ThemeColors} from '@styles/theme/types'; +import type {ThemeColors} from '@styles/theme/types'; const withThemePropTypes = { theme: PropTypes.object.isRequired, diff --git a/src/components/withThemeStyles.tsx b/src/components/withThemeStyles.tsx index 0ae960bd4351..8b02897eb8d9 100644 --- a/src/components/withThemeStyles.tsx +++ b/src/components/withThemeStyles.tsx @@ -1,8 +1,9 @@ import PropTypes from 'prop-types'; -import React, {ComponentType, ForwardedRef, forwardRef, ReactElement, RefAttributes} from 'react'; +import type {ComponentType, ForwardedRef, ReactElement, RefAttributes} from 'react'; +import React, { forwardRef} from 'react'; import useThemeStyles from '@hooks/useThemeStyles'; import getComponentDisplayName from '@libs/getComponentDisplayName'; -import {type ThemeStyles} from '@styles/index'; +import type {ThemeStyles} from '@styles/index'; const withThemeStylesPropTypes = { themeStyles: PropTypes.object.isRequired, diff --git a/src/components/withToggleVisibilityView.tsx b/src/components/withToggleVisibilityView.tsx index 974ce3b7f855..86513f1bd0dc 100644 --- a/src/components/withToggleVisibilityView.tsx +++ b/src/components/withToggleVisibilityView.tsx @@ -1,6 +1,7 @@ -import React, {ComponentType, ForwardedRef, ReactElement, RefAttributes} from 'react'; +import type {ComponentType, ForwardedRef, ReactElement, RefAttributes} from 'react'; +import React from 'react'; import {View} from 'react-native'; -import {SetOptional} from 'type-fest'; +import type {SetOptional} from 'type-fest'; import useThemeStyles from '@hooks/useThemeStyles'; import getComponentDisplayName from '@libs/getComponentDisplayName'; diff --git a/src/components/withViewportOffsetTop.tsx b/src/components/withViewportOffsetTop.tsx index d6c170b20480..424bedb14870 100644 --- a/src/components/withViewportOffsetTop.tsx +++ b/src/components/withViewportOffsetTop.tsx @@ -1,4 +1,5 @@ -import React, {ComponentType, ForwardedRef, forwardRef, RefAttributes, useEffect, useState} from 'react'; +import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import React, { forwardRef, useEffect, useState} from 'react'; import getComponentDisplayName from '@libs/getComponentDisplayName'; import addViewportResizeListener from '@libs/VisualViewport'; diff --git a/src/components/withWindowDimensions/index.native.tsx b/src/components/withWindowDimensions/index.native.tsx index 8ba385f72e4b..e1300a5584f5 100644 --- a/src/components/withWindowDimensions/index.native.tsx +++ b/src/components/withWindowDimensions/index.native.tsx @@ -1,12 +1,13 @@ import PropTypes from 'prop-types'; -import React, {ComponentType, createContext, ForwardedRef, RefAttributes, useEffect, useMemo, useState} from 'react'; +import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import React, { createContext, useEffect, useMemo, useState} from 'react'; import {Dimensions} from 'react-native'; import useSafeAreaInsets from '@hooks/useSafeAreaInsets'; import getComponentDisplayName from '@libs/getComponentDisplayName'; import getWindowHeightAdjustment from '@libs/getWindowHeightAdjustment'; import variables from '@styles/variables'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; -import {NewDimensions, WindowDimensionsContextData, WindowDimensionsProps} from './types'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; +import type {NewDimensions, WindowDimensionsContextData, WindowDimensionsProps} from './types'; const WindowDimensionsContext = createContext(null); const windowDimensionsPropTypes = { diff --git a/src/components/withWindowDimensions/index.tsx b/src/components/withWindowDimensions/index.tsx index aa9fc2181a36..e761881a1788 100644 --- a/src/components/withWindowDimensions/index.tsx +++ b/src/components/withWindowDimensions/index.tsx @@ -1,13 +1,14 @@ import lodashDebounce from 'lodash/debounce'; import PropTypes from 'prop-types'; -import React, {ComponentType, createContext, ForwardedRef, RefAttributes, useEffect, useMemo, useState} from 'react'; +import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import React, { createContext, useEffect, useMemo, useState} from 'react'; import {Dimensions} from 'react-native'; import useSafeAreaInsets from '@hooks/useSafeAreaInsets'; import getComponentDisplayName from '@libs/getComponentDisplayName'; import getWindowHeightAdjustment from '@libs/getWindowHeightAdjustment'; import variables from '@styles/variables'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; -import {NewDimensions, WindowDimensionsContextData, WindowDimensionsProps} from './types'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; +import type {NewDimensions, WindowDimensionsContextData, WindowDimensionsProps} from './types'; const WindowDimensionsContext = createContext(null); const windowDimensionsPropTypes = { diff --git a/src/components/withWindowDimensions/types.ts b/src/components/withWindowDimensions/types.ts index 514c86616b87..da06bb6a886e 100644 --- a/src/components/withWindowDimensions/types.ts +++ b/src/components/withWindowDimensions/types.ts @@ -1,4 +1,4 @@ -import {ScaledSize} from 'react-native'; +import type {ScaledSize} from 'react-native'; type WindowDimensionsContextData = { windowHeight: number; diff --git a/src/hooks/useActiveElement/index.native.ts b/src/hooks/useActiveElement/index.native.ts index 22e1ed7e0041..8683684f8167 100644 --- a/src/hooks/useActiveElement/index.native.ts +++ b/src/hooks/useActiveElement/index.native.ts @@ -1,4 +1,4 @@ -import UseActiveElement from './types'; +import type UseActiveElement from './types'; /** * Native doesn't have the DOM, so we just return null. diff --git a/src/hooks/useActiveElement/index.ts b/src/hooks/useActiveElement/index.ts index bee0dde6b427..6026b4f5eb80 100644 --- a/src/hooks/useActiveElement/index.ts +++ b/src/hooks/useActiveElement/index.ts @@ -1,5 +1,5 @@ import {useEffect, useState} from 'react'; -import UseActiveElement from './types'; +import type UseActiveElement from './types'; /** * Listens for the focusin and focusout events and sets the DOM activeElement to the state. diff --git a/src/hooks/useAppFocusEvent/index.native.ts b/src/hooks/useAppFocusEvent/index.native.ts index e7df6fb8054b..f2ef1e7f4321 100644 --- a/src/hooks/useAppFocusEvent/index.native.ts +++ b/src/hooks/useAppFocusEvent/index.native.ts @@ -1,6 +1,6 @@ import {useEffect} from 'react'; import {AppState} from 'react-native'; -import {UseAppFocusEvent, UseAppFocusEventCallback} from './types'; +import type {UseAppFocusEvent, UseAppFocusEventCallback} from './types'; const useAppFocusEvent: UseAppFocusEvent = (callback: UseAppFocusEventCallback) => { useEffect(() => { diff --git a/src/hooks/useAppFocusEvent/index.ts b/src/hooks/useAppFocusEvent/index.ts index d4b6772733f8..96038c98bfe6 100644 --- a/src/hooks/useAppFocusEvent/index.ts +++ b/src/hooks/useAppFocusEvent/index.ts @@ -1,5 +1,5 @@ import {useEffect} from 'react'; -import {UseAppFocusEvent, UseAppFocusEventCallback} from './types'; +import type {UseAppFocusEvent, UseAppFocusEventCallback} from './types'; /** * Runs the given callback when the app is focused (eg: after re-opening the app, switching tabs, or focusing the window) diff --git a/src/hooks/useAutoFocusInput.ts b/src/hooks/useAutoFocusInput.ts index ad66a01b157d..96e60489afc9 100644 --- a/src/hooks/useAutoFocusInput.ts +++ b/src/hooks/useAutoFocusInput.ts @@ -1,6 +1,7 @@ import {useFocusEffect} from '@react-navigation/native'; import {useCallback, useContext, useEffect, useRef, useState} from 'react'; -import {InteractionManager, TextInput} from 'react-native'; +import type { TextInput} from 'react-native'; +import {InteractionManager} from 'react-native'; import CONST from '@src/CONST'; import * as Expensify from '@src/Expensify'; diff --git a/src/hooks/useCurrentReportID.tsx b/src/hooks/useCurrentReportID.tsx index 8514a474706b..11ad4caabb88 100644 --- a/src/hooks/useCurrentReportID.tsx +++ b/src/hooks/useCurrentReportID.tsx @@ -1,5 +1,6 @@ import {useContext} from 'react'; -import {CurrentReportIDContext, CurrentReportIDContextValue} from '@components/withCurrentReportID'; +import type { CurrentReportIDContextValue} from '@components/withCurrentReportID'; +import {CurrentReportIDContext} from '@components/withCurrentReportID'; export default function useCurrentReportID(): CurrentReportIDContextValue | null { return useContext(CurrentReportIDContext); diff --git a/src/hooks/useDebounce.ts b/src/hooks/useDebounce.ts index 7fc8332ba6cc..c3d6c22abf86 100644 --- a/src/hooks/useDebounce.ts +++ b/src/hooks/useDebounce.ts @@ -1,4 +1,4 @@ -import {DebouncedFunc, DebounceSettings} from 'lodash'; +import type {DebouncedFunc, DebounceSettings} from 'lodash'; import lodashDebounce from 'lodash/debounce'; import {useCallback, useEffect, useRef} from 'react'; diff --git a/src/hooks/useDefaultDragAndDrop/index.native.ts b/src/hooks/useDefaultDragAndDrop/index.native.ts index 08b2606d984d..e571e9d0d2b7 100644 --- a/src/hooks/useDefaultDragAndDrop/index.native.ts +++ b/src/hooks/useDefaultDragAndDrop/index.native.ts @@ -1,4 +1,4 @@ -import UseDefaultDragAndDrop from './types'; +import type UseDefaultDragAndDrop from './types'; const useDefaultDragAndDrop: UseDefaultDragAndDrop = () => {}; diff --git a/src/hooks/useDefaultDragAndDrop/index.ts b/src/hooks/useDefaultDragAndDrop/index.ts index 033110c143c8..7800e8fe349b 100644 --- a/src/hooks/useDefaultDragAndDrop/index.ts +++ b/src/hooks/useDefaultDragAndDrop/index.ts @@ -1,5 +1,5 @@ import {useEffect} from 'react'; -import UseDefaultDragAndDrop from './types'; +import type UseDefaultDragAndDrop from './types'; const useDefaultDragAndDrop: UseDefaultDragAndDrop = () => { useEffect(() => { diff --git a/src/hooks/useDelayedInputFocus.ts b/src/hooks/useDelayedInputFocus.ts index d062f8a03d25..4942de265340 100644 --- a/src/hooks/useDelayedInputFocus.ts +++ b/src/hooks/useDelayedInputFocus.ts @@ -1,6 +1,7 @@ import {useFocusEffect} from '@react-navigation/native'; -import {MutableRefObject, useCallback, useRef} from 'react'; -import {TextInput} from 'react-native'; +import type {MutableRefObject} from 'react'; +import { useCallback, useRef} from 'react'; +import type {TextInput} from 'react-native'; import CONST from '@src/CONST'; /** diff --git a/src/hooks/useDragAndDrop.ts b/src/hooks/useDragAndDrop.ts index 21f48921c187..8c9054dc0bf1 100644 --- a/src/hooks/useDragAndDrop.ts +++ b/src/hooks/useDragAndDrop.ts @@ -1,6 +1,7 @@ import {useIsFocused} from '@react-navigation/native'; -import React, {useCallback, useContext, useEffect, useState} from 'react'; -import {View} from 'react-native'; +import type React from 'react'; +import {useCallback, useContext, useEffect, useState} from 'react'; +import type {View} from 'react-native'; import {PopoverContext} from '@components/PopoverProvider'; const COPY_DROP_EFFECT = 'copy'; diff --git a/src/hooks/useFlipper/index.native.ts b/src/hooks/useFlipper/index.native.ts index df1aa3bf513b..0591eec50acc 100644 --- a/src/hooks/useFlipper/index.native.ts +++ b/src/hooks/useFlipper/index.native.ts @@ -1,5 +1,5 @@ import {useFlipper as useFlipperRN} from '@react-navigation/devtools'; -import UseFlipper from './types'; +import type UseFlipper from './types'; const useFlipper: UseFlipper = useFlipperRN; diff --git a/src/hooks/useFlipper/index.ts b/src/hooks/useFlipper/index.ts index 26d4c9659ad8..871bff4a7321 100644 --- a/src/hooks/useFlipper/index.ts +++ b/src/hooks/useFlipper/index.ts @@ -1,4 +1,4 @@ -import UseFlipper from './types'; +import type UseFlipper from './types'; const useFlipper: UseFlipper = () => {}; diff --git a/src/hooks/useFlipper/types.ts b/src/hooks/useFlipper/types.ts index a995414e5dd1..e69272fcb92c 100644 --- a/src/hooks/useFlipper/types.ts +++ b/src/hooks/useFlipper/types.ts @@ -1,5 +1,5 @@ -import {NavigationContainerRefWithCurrent} from '@react-navigation/core'; -import {RootStackParamList} from '@libs/Navigation/types'; +import type {NavigationContainerRefWithCurrent} from '@react-navigation/core'; +import type {RootStackParamList} from '@libs/Navigation/types'; type UseFlipper = (ref: NavigationContainerRefWithCurrent) => void; diff --git a/src/hooks/useInitialWindowDimensions/index.ts b/src/hooks/useInitialWindowDimensions/index.ts index e0882e820e9b..f86829f8ac81 100644 --- a/src/hooks/useInitialWindowDimensions/index.ts +++ b/src/hooks/useInitialWindowDimensions/index.ts @@ -1,6 +1,7 @@ // eslint-disable-next-line no-restricted-imports import {useEffect, useState} from 'react'; -import {Dimensions, type ScaledSize} from 'react-native'; +import {Dimensions } from 'react-native'; +import type {ScaledSize} from 'react-native'; type InitialWindowDimensions = { initialWidth: number; diff --git a/src/hooks/useKeyboardShortcut.ts b/src/hooks/useKeyboardShortcut.ts index 461f01a74837..6bf8b2c52bc3 100644 --- a/src/hooks/useKeyboardShortcut.ts +++ b/src/hooks/useKeyboardShortcut.ts @@ -1,6 +1,6 @@ import {useEffect} from 'react'; -import {GestureResponderEvent} from 'react-native'; -import {ValueOf} from 'type-fest'; +import type {GestureResponderEvent} from 'react-native'; +import type {ValueOf} from 'type-fest'; import KeyboardShortcut from '@libs/KeyboardShortcut'; import CONST from '@src/CONST'; diff --git a/src/hooks/useKeyboardState.ts b/src/hooks/useKeyboardState.ts index edcbaa32cc9e..6c312d448af8 100644 --- a/src/hooks/useKeyboardState.ts +++ b/src/hooks/useKeyboardState.ts @@ -1,5 +1,6 @@ import {useContext} from 'react'; -import {KeyboardStateContext, KeyboardStateContextValue} from '@components/withKeyboardState'; +import type { KeyboardStateContextValue} from '@components/withKeyboardState'; +import {KeyboardStateContext} from '@components/withKeyboardState'; /** * Hook for getting current state of keyboard diff --git a/src/hooks/useLocalize.ts b/src/hooks/useLocalize.ts index 2875577ef00f..dd68b9e8df05 100644 --- a/src/hooks/useLocalize.ts +++ b/src/hooks/useLocalize.ts @@ -1,5 +1,6 @@ import {useContext} from 'react'; -import {LocaleContext, LocaleContextProps} from '@components/LocaleContextProvider'; +import type { LocaleContextProps} from '@components/LocaleContextProvider'; +import {LocaleContext} from '@components/LocaleContextProvider'; export default function useLocalize(): LocaleContextProps { return useContext(LocaleContext); diff --git a/src/hooks/useReportScrollManager/index.native.ts b/src/hooks/useReportScrollManager/index.native.ts index 24de5d8da63a..6666a4ebd0f2 100644 --- a/src/hooks/useReportScrollManager/index.native.ts +++ b/src/hooks/useReportScrollManager/index.native.ts @@ -1,6 +1,6 @@ import {useCallback, useContext} from 'react'; import {ActionListContext} from '@pages/home/ReportScreenContext'; -import ReportScrollManagerData from './types'; +import type ReportScrollManagerData from './types'; function useReportScrollManager(): ReportScrollManagerData { const {flatListRef, setScrollPosition} = useContext(ActionListContext); diff --git a/src/hooks/useReportScrollManager/index.ts b/src/hooks/useReportScrollManager/index.ts index 032417ed9fde..8b56cd639d08 100644 --- a/src/hooks/useReportScrollManager/index.ts +++ b/src/hooks/useReportScrollManager/index.ts @@ -1,6 +1,6 @@ import {useCallback, useContext} from 'react'; import {ActionListContext} from '@pages/home/ReportScreenContext'; -import ReportScrollManagerData from './types'; +import type ReportScrollManagerData from './types'; function useReportScrollManager(): ReportScrollManagerData { const {flatListRef} = useContext(ActionListContext); diff --git a/src/hooks/useReportScrollManager/types.ts b/src/hooks/useReportScrollManager/types.ts index a0d7f14f7b84..5182f7269a9c 100644 --- a/src/hooks/useReportScrollManager/types.ts +++ b/src/hooks/useReportScrollManager/types.ts @@ -1,4 +1,4 @@ -import {FlatListRefType} from '@pages/home/ReportScreenContext'; +import type {FlatListRefType} from '@pages/home/ReportScreenContext'; type ReportScrollManagerData = { ref: FlatListRefType; diff --git a/src/hooks/useResponsiveLayout.ts b/src/hooks/useResponsiveLayout.ts index b386fc985604..55b3bd0b4af9 100644 --- a/src/hooks/useResponsiveLayout.ts +++ b/src/hooks/useResponsiveLayout.ts @@ -1,4 +1,5 @@ -import {ParamListBase, RouteProp, useRoute} from '@react-navigation/native'; +import type {ParamListBase, RouteProp} from '@react-navigation/native'; +import { useRoute} from '@react-navigation/native'; import useWindowDimensions from './useWindowDimensions'; type RouteParams = ParamListBase & { diff --git a/src/hooks/useSafeAreaInsets/index.android.ts b/src/hooks/useSafeAreaInsets/index.android.ts index 55a83d425543..6c6af7cc442b 100644 --- a/src/hooks/useSafeAreaInsets/index.android.ts +++ b/src/hooks/useSafeAreaInsets/index.android.ts @@ -1,5 +1,6 @@ // eslint-disable-next-line no-restricted-imports -import {EdgeInsets, useSafeAreaInsets as useSafeAreaInsetsInternal} from 'react-native-safe-area-context'; +import type {EdgeInsets} from 'react-native-safe-area-context'; +import { useSafeAreaInsets as useSafeAreaInsetsInternal} from 'react-native-safe-area-context'; import StatusBar from '@libs/StatusBar'; function useSafeAreaInsets(): EdgeInsets { diff --git a/src/hooks/useScrollContext.ts b/src/hooks/useScrollContext.ts index 711c8326bdff..bdaaf298c1e2 100644 --- a/src/hooks/useScrollContext.ts +++ b/src/hooks/useScrollContext.ts @@ -1,5 +1,6 @@ import {useContext} from 'react'; -import {ScrollContext, ScrollContextValue} from '@components/ScrollViewWithContext'; +import type { ScrollContextValue} from '@components/ScrollViewWithContext'; +import {ScrollContext} from '@components/ScrollViewWithContext'; export default function useScrollContext(): ScrollContextValue { return useContext(ScrollContext); diff --git a/src/hooks/useTabNavigatorFocus/index.ts b/src/hooks/useTabNavigatorFocus/index.ts index 9138cbbdab48..7c721717769e 100644 --- a/src/hooks/useTabNavigatorFocus/index.ts +++ b/src/hooks/useTabNavigatorFocus/index.ts @@ -1,7 +1,7 @@ import {useTabAnimation} from '@react-navigation/material-top-tabs'; import {useIsFocused} from '@react-navigation/native'; import {useEffect, useState} from 'react'; -import {Animated} from 'react-native'; +import type {Animated} from 'react-native'; import DomUtils from '@libs/DomUtils'; type UseTabNavigatorFocusParams = { diff --git a/src/hooks/useTheme.ts b/src/hooks/useTheme.ts index 966e9b499e2f..7ba813145ebb 100644 --- a/src/hooks/useTheme.ts +++ b/src/hooks/useTheme.ts @@ -1,6 +1,6 @@ import {useContext} from 'react'; import ThemeContext from '@styles/theme/context/ThemeContext'; -import {type ThemeColors} from '@styles/theme/types'; +import type {ThemeColors} from '@styles/theme/types'; function useTheme(): ThemeColors { const theme = useContext(ThemeContext); diff --git a/src/hooks/useThemePreference.ts b/src/hooks/useThemePreference.ts index 5d3ec4c3a860..ca585065c4e6 100644 --- a/src/hooks/useThemePreference.ts +++ b/src/hooks/useThemePreference.ts @@ -1,7 +1,7 @@ import {useContext, useEffect, useState} from 'react'; import {useColorScheme} from 'react-native'; import {PreferredThemeContext} from '@components/OnyxProvider'; -import {ThemePreferenceWithoutSystem} from '@styles/theme/types'; +import type {ThemePreferenceWithoutSystem} from '@styles/theme/types'; import CONST from '@src/CONST'; function useThemePreference() { diff --git a/src/hooks/useThemePreferenceWithStaticOverride.ts b/src/hooks/useThemePreferenceWithStaticOverride.ts index 4619da1966ce..96e4db61e24f 100644 --- a/src/hooks/useThemePreferenceWithStaticOverride.ts +++ b/src/hooks/useThemePreferenceWithStaticOverride.ts @@ -1,4 +1,4 @@ -import {ThemePreferenceWithoutSystem} from '@styles/theme/types'; +import type {ThemePreferenceWithoutSystem} from '@styles/theme/types'; import useThemePreference from './useThemePreference'; const useThemePreferenceWithStaticOverride = (staticThemePreference: ThemePreferenceWithoutSystem | undefined) => { diff --git a/src/hooks/useViolations.ts b/src/hooks/useViolations.ts index 3aef5cd9b716..0f43abdff6e2 100644 --- a/src/hooks/useViolations.ts +++ b/src/hooks/useViolations.ts @@ -1,5 +1,5 @@ import {useCallback, useMemo} from 'react'; -import {TransactionViolation, ViolationName} from '@src/types/onyx'; +import type {TransactionViolation, ViolationName} from '@src/types/onyx'; /** * Names of Fields where violations can occur diff --git a/src/hooks/useWindowDimensions/index.native.ts b/src/hooks/useWindowDimensions/index.native.ts index e0268445fe4e..5d556234aeb9 100644 --- a/src/hooks/useWindowDimensions/index.native.ts +++ b/src/hooks/useWindowDimensions/index.native.ts @@ -1,7 +1,7 @@ // eslint-disable-next-line no-restricted-imports import {useWindowDimensions} from 'react-native'; import variables from '@styles/variables'; -import WindowDimensions from './types'; +import type WindowDimensions from './types'; /** * A convenience wrapper around React Native's useWindowDimensions hook that also provides booleans for our breakpoints. diff --git a/src/hooks/useWindowDimensions/index.ts b/src/hooks/useWindowDimensions/index.ts index ab856bcf8e1b..b0a29e9f901b 100644 --- a/src/hooks/useWindowDimensions/index.ts +++ b/src/hooks/useWindowDimensions/index.ts @@ -1,7 +1,7 @@ // eslint-disable-next-line no-restricted-imports import {Dimensions, useWindowDimensions} from 'react-native'; import variables from '@styles/variables'; -import WindowDimensions from './types'; +import type WindowDimensions from './types'; /** * A convenience wrapper around React Native's useWindowDimensions hook that also provides booleans for our breakpoints. diff --git a/src/languages/types.ts b/src/languages/types.ts index 427a5777b2ea..dd2d339858b0 100644 --- a/src/languages/types.ts +++ b/src/languages/types.ts @@ -1,5 +1,5 @@ -import {ReportAction} from '@src/types/onyx'; -import en from './en'; +import type {ReportAction} from '@src/types/onyx'; +import type en from './en'; type AddressLineParams = { lineNumber: number; diff --git a/src/libs/API.ts b/src/libs/API.ts index 91cf6a7db877..d5cfd56cd4af 100644 --- a/src/libs/API.ts +++ b/src/libs/API.ts @@ -1,8 +1,9 @@ -import Onyx, {OnyxUpdate} from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {OnyxUpdate} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; import CONST from '@src/CONST'; -import OnyxRequest from '@src/types/onyx/Request'; -import Response from '@src/types/onyx/Response'; +import type OnyxRequest from '@src/types/onyx/Request'; +import type Response from '@src/types/onyx/Response'; import pkg from '../../package.json'; import Log from './Log'; import * as Middleware from './Middleware'; diff --git a/src/libs/Accessibility/index.ts b/src/libs/Accessibility/index.ts index aa167b1239b2..a803e5cc36f7 100644 --- a/src/libs/Accessibility/index.ts +++ b/src/libs/Accessibility/index.ts @@ -1,5 +1,6 @@ import {useCallback, useEffect, useState} from 'react'; -import {AccessibilityInfo, LayoutChangeEvent} from 'react-native'; +import type { LayoutChangeEvent} from 'react-native'; +import {AccessibilityInfo} from 'react-native'; import moveAccessibilityFocus from './moveAccessibilityFocus'; type HitSlop = {x: number; y: number}; diff --git a/src/libs/Accessibility/moveAccessibilityFocus/index.native.ts b/src/libs/Accessibility/moveAccessibilityFocus/index.native.ts index 2e027c59be39..71c249cf1d10 100644 --- a/src/libs/Accessibility/moveAccessibilityFocus/index.native.ts +++ b/src/libs/Accessibility/moveAccessibilityFocus/index.native.ts @@ -1,5 +1,5 @@ import {AccessibilityInfo} from 'react-native'; -import MoveAccessibilityFocus from './types'; +import type MoveAccessibilityFocus from './types'; const moveAccessibilityFocus: MoveAccessibilityFocus = (ref) => { if (!ref) { diff --git a/src/libs/Accessibility/moveAccessibilityFocus/index.ts b/src/libs/Accessibility/moveAccessibilityFocus/index.ts index b381c1d814c1..cafe1a216db3 100644 --- a/src/libs/Accessibility/moveAccessibilityFocus/index.ts +++ b/src/libs/Accessibility/moveAccessibilityFocus/index.ts @@ -1,4 +1,4 @@ -import MoveAccessibilityFocus from './types'; +import type MoveAccessibilityFocus from './types'; const moveAccessibilityFocus: MoveAccessibilityFocus = (ref) => { if (!ref?.current) { diff --git a/src/libs/Accessibility/moveAccessibilityFocus/types.ts b/src/libs/Accessibility/moveAccessibilityFocus/types.ts index 1344c3f98e3e..6756bdd6f773 100644 --- a/src/libs/Accessibility/moveAccessibilityFocus/types.ts +++ b/src/libs/Accessibility/moveAccessibilityFocus/types.ts @@ -1,5 +1,5 @@ -import {ElementRef, RefObject} from 'react'; -import {HostComponent} from 'react-native'; +import type {ElementRef, RefObject} from 'react'; +import type {HostComponent} from 'react-native'; type MoveAccessibilityFocus = (ref?: ElementRef> & RefObject) => void; diff --git a/src/libs/ActiveClientManager/index.native.ts b/src/libs/ActiveClientManager/index.native.ts index 866992bcc841..7de57a10e5f1 100644 --- a/src/libs/ActiveClientManager/index.native.ts +++ b/src/libs/ActiveClientManager/index.native.ts @@ -2,7 +2,7 @@ * For native devices, there will never be more than one * client running at a time, so this lib is a big no-op */ -import {Init, IsClientTheLeader, IsReady} from './types'; +import type {Init, IsClientTheLeader, IsReady} from './types'; const init: Init = () => {}; diff --git a/src/libs/ActiveClientManager/index.ts b/src/libs/ActiveClientManager/index.ts index 0baeb2becfce..e703ce0458f4 100644 --- a/src/libs/ActiveClientManager/index.ts +++ b/src/libs/ActiveClientManager/index.ts @@ -7,7 +7,7 @@ import Str from 'expensify-common/lib/str'; import Onyx from 'react-native-onyx'; import * as ActiveClients from '@userActions/ActiveClients'; import ONYXKEYS from '@src/ONYXKEYS'; -import {Init, IsClientTheLeader, IsReady} from './types'; +import type {Init, IsClientTheLeader, IsReady} from './types'; const clientID = Str.guid(); const maxClients = 20; diff --git a/src/libs/ApiUtils.ts b/src/libs/ApiUtils.ts index 3d7347136897..67feb18b36fa 100644 --- a/src/libs/ApiUtils.ts +++ b/src/libs/ApiUtils.ts @@ -1,9 +1,9 @@ import Onyx from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import CONFIG from '@src/CONFIG'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {Request} from '@src/types/onyx'; +import type {Request} from '@src/types/onyx'; import proxyConfig from '../../config/proxyConfig'; import * as Environment from './Environment/Environment'; diff --git a/src/libs/AppStateMonitor/index.ts b/src/libs/AppStateMonitor/index.ts index f95fad042b98..cd9deb7797cb 100644 --- a/src/libs/AppStateMonitor/index.ts +++ b/src/libs/AppStateMonitor/index.ts @@ -1,4 +1,5 @@ -import {AppState, AppStateStatus} from 'react-native'; +import type { AppStateStatus} from 'react-native'; +import {AppState} from 'react-native'; import CONST from '@src/CONST'; import shouldReportActivity from './shouldReportActivity'; diff --git a/src/libs/AppStateMonitor/shouldReportActivity/index.native.ts b/src/libs/AppStateMonitor/shouldReportActivity/index.native.ts index 0e5fdb57a597..36d14308eac7 100644 --- a/src/libs/AppStateMonitor/shouldReportActivity/index.native.ts +++ b/src/libs/AppStateMonitor/shouldReportActivity/index.native.ts @@ -1,4 +1,4 @@ -import ShouldReportActivity from './types'; +import type ShouldReportActivity from './types'; const shouldReportActivity: ShouldReportActivity = true; diff --git a/src/libs/AppStateMonitor/shouldReportActivity/index.ts b/src/libs/AppStateMonitor/shouldReportActivity/index.ts index db326345714e..50704e7b0c80 100644 --- a/src/libs/AppStateMonitor/shouldReportActivity/index.ts +++ b/src/libs/AppStateMonitor/shouldReportActivity/index.ts @@ -1,4 +1,4 @@ -import ShouldReportActivity from './types'; +import type ShouldReportActivity from './types'; // We only need to report when the app becomes active on native since web maintains most of it's network functions while // in the "background" and the concept is not quite the same on mobile. We avoid setting this to true for web since diff --git a/src/libs/Authentication.ts b/src/libs/Authentication.ts index 9962fa55b0af..dd1003591701 100644 --- a/src/libs/Authentication.ts +++ b/src/libs/Authentication.ts @@ -1,6 +1,6 @@ import CONFIG from '@src/CONFIG'; import CONST from '@src/CONST'; -import Response from '@src/types/onyx/Response'; +import type Response from '@src/types/onyx/Response'; import updateSessionAuthTokens from './actions/Session/updateSessionAuthTokens'; import redirectToSignIn from './actions/SignInRedirect'; import * as ErrorUtils from './ErrorUtils'; diff --git a/src/libs/BootSplash/index.ts b/src/libs/BootSplash/index.ts index 605e65a21a7b..644403d6abc9 100644 --- a/src/libs/BootSplash/index.ts +++ b/src/libs/BootSplash/index.ts @@ -1,5 +1,5 @@ import Log from '@libs/Log'; -import {VisibilityStatus} from './types'; +import type {VisibilityStatus} from './types'; function resolveAfter(delay: number): Promise { return new Promise((resolve) => setTimeout(resolve, delay)); diff --git a/src/libs/CardUtils.ts b/src/libs/CardUtils.ts index 9b2bd2616e8e..91f860beb761 100644 --- a/src/libs/CardUtils.ts +++ b/src/libs/CardUtils.ts @@ -1,9 +1,10 @@ import lodash from 'lodash'; import Onyx from 'react-native-onyx'; import CONST from '@src/CONST'; -import ONYXKEYS, {OnyxValues} from '@src/ONYXKEYS'; -import * as OnyxTypes from '@src/types/onyx'; -import {Card} from '@src/types/onyx'; +import type {OnyxValues} from '@src/ONYXKEYS'; +import ONYXKEYS from '@src/ONYXKEYS'; +import type * as OnyxTypes from '@src/types/onyx'; +import type {Card} from '@src/types/onyx'; import * as Localize from './Localize'; let allCards: OnyxValues[typeof ONYXKEYS.CARD_LIST] = {}; diff --git a/src/libs/Clipboard/index.native.ts b/src/libs/Clipboard/index.native.ts index f78c5e4ab230..2c345327a106 100644 --- a/src/libs/Clipboard/index.native.ts +++ b/src/libs/Clipboard/index.native.ts @@ -1,5 +1,5 @@ import Clipboard from '@react-native-clipboard/clipboard'; -import {CanSetHtml, SetHtml, SetString} from './types'; +import type {CanSetHtml, SetHtml, SetString} from './types'; /** * Sets a string on the Clipboard object via @react-native-clipboard/clipboard diff --git a/src/libs/Clipboard/index.ts b/src/libs/Clipboard/index.ts index b703b0b4d7f5..512eebce78e2 100644 --- a/src/libs/Clipboard/index.ts +++ b/src/libs/Clipboard/index.ts @@ -1,7 +1,7 @@ import Clipboard from '@react-native-clipboard/clipboard'; import * as Browser from '@libs/Browser'; import CONST from '@src/CONST'; -import {CanSetHtml, SetHtml, SetString} from './types'; +import type {CanSetHtml, SetHtml, SetString} from './types'; type ComposerSelection = { start: number; diff --git a/src/libs/CollectionUtils.ts b/src/libs/CollectionUtils.ts index 3a980906d614..9d0ff5425da2 100644 --- a/src/libs/CollectionUtils.ts +++ b/src/libs/CollectionUtils.ts @@ -1,4 +1,4 @@ -import {OnyxCollectionKey} from '@src/ONYXKEYS'; +import type {OnyxCollectionKey} from '@src/ONYXKEYS'; /** * Return the highest item in a numbered collection diff --git a/src/libs/ComponentUtils/index.native.ts b/src/libs/ComponentUtils/index.native.ts index 096d1449d0e1..5ad39162e1a0 100644 --- a/src/libs/ComponentUtils/index.native.ts +++ b/src/libs/ComponentUtils/index.native.ts @@ -1,4 +1,4 @@ -import {AccessibilityRoleForm, NewPasswordAutocompleteType, PasswordAutocompleteType} from './types'; +import type {AccessibilityRoleForm, NewPasswordAutocompleteType, PasswordAutocompleteType} from './types'; const PASSWORD_AUTOCOMPLETE_TYPE: PasswordAutocompleteType = 'password'; const NEW_PASSWORD_AUTOCOMPLETE_TYPE: NewPasswordAutocompleteType = 'password-new'; diff --git a/src/libs/ComponentUtils/index.ts b/src/libs/ComponentUtils/index.ts index ff8df480aa2c..38abb98594da 100644 --- a/src/libs/ComponentUtils/index.ts +++ b/src/libs/ComponentUtils/index.ts @@ -1,4 +1,4 @@ -import {AccessibilityRoleForm, NewPasswordAutocompleteType, PasswordAutocompleteType} from './types'; +import type {AccessibilityRoleForm, NewPasswordAutocompleteType, PasswordAutocompleteType} from './types'; /** * Web password field needs `current-password` as autocomplete type which is not supported on native diff --git a/src/libs/ComposerUtils/getDraftComment.ts b/src/libs/ComposerUtils/getDraftComment.ts index 97567a42b263..7f11825004a1 100644 --- a/src/libs/ComposerUtils/getDraftComment.ts +++ b/src/libs/ComposerUtils/getDraftComment.ts @@ -1,4 +1,5 @@ -import Onyx, {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; const draftCommentMap: Record> = {}; diff --git a/src/libs/ComposerUtils/getNumberOfLines/index.native.ts b/src/libs/ComposerUtils/getNumberOfLines/index.native.ts index 9a7340b9a035..0cbfb6c7f517 100644 --- a/src/libs/ComposerUtils/getNumberOfLines/index.native.ts +++ b/src/libs/ComposerUtils/getNumberOfLines/index.native.ts @@ -1,4 +1,4 @@ -import GetNumberOfLines from './types'; +import type GetNumberOfLines from './types'; /** * Get the current number of lines in the composer diff --git a/src/libs/ComposerUtils/getNumberOfLines/index.ts b/src/libs/ComposerUtils/getNumberOfLines/index.ts index cf85b45443d5..e80744d41c69 100644 --- a/src/libs/ComposerUtils/getNumberOfLines/index.ts +++ b/src/libs/ComposerUtils/getNumberOfLines/index.ts @@ -1,4 +1,4 @@ -import GetNumberOfLines from './types'; +import type GetNumberOfLines from './types'; /** * Get the current number of lines in the composer diff --git a/src/libs/ComposerUtils/updateIsFullComposerAvailable.ts b/src/libs/ComposerUtils/updateIsFullComposerAvailable.ts index 64c526484760..580908fc3805 100644 --- a/src/libs/ComposerUtils/updateIsFullComposerAvailable.ts +++ b/src/libs/ComposerUtils/updateIsFullComposerAvailable.ts @@ -1,4 +1,4 @@ -import {ComposerProps} from '@components/Composer/types'; +import type {ComposerProps} from '@components/Composer/types'; import CONST from '@src/CONST'; /** diff --git a/src/libs/ComposerUtils/updateNumberOfLines/index.native.ts b/src/libs/ComposerUtils/updateNumberOfLines/index.native.ts index 6f87edaf2475..5a7676d8bfbd 100644 --- a/src/libs/ComposerUtils/updateNumberOfLines/index.native.ts +++ b/src/libs/ComposerUtils/updateNumberOfLines/index.native.ts @@ -1,6 +1,6 @@ import getNumberOfLines from '@libs/ComposerUtils/getNumberOfLines'; import updateIsFullComposerAvailable from '@libs/ComposerUtils/updateIsFullComposerAvailable'; -import UpdateNumberOfLines from './types'; +import type UpdateNumberOfLines from './types'; /** * Check the current scrollHeight of the textarea (minus any padding) and diff --git a/src/libs/ComposerUtils/updateNumberOfLines/index.ts b/src/libs/ComposerUtils/updateNumberOfLines/index.ts index 91a9c9c0f102..3037fb99c8b1 100644 --- a/src/libs/ComposerUtils/updateNumberOfLines/index.ts +++ b/src/libs/ComposerUtils/updateNumberOfLines/index.ts @@ -1,4 +1,4 @@ -import UpdateNumberOfLines from './types'; +import type UpdateNumberOfLines from './types'; const updateNumberOfLines: UpdateNumberOfLines = () => {}; diff --git a/src/libs/ComposerUtils/updateNumberOfLines/types.ts b/src/libs/ComposerUtils/updateNumberOfLines/types.ts index 2fe1465fa194..06daee56a707 100644 --- a/src/libs/ComposerUtils/updateNumberOfLines/types.ts +++ b/src/libs/ComposerUtils/updateNumberOfLines/types.ts @@ -1,6 +1,6 @@ -import {NativeSyntheticEvent, TextInputContentSizeChangeEventData} from 'react-native'; -import {ComposerProps} from '@components/Composer/types'; -import {type ThemeStyles} from '@styles/index'; +import type {NativeSyntheticEvent, TextInputContentSizeChangeEventData} from 'react-native'; +import type {ComposerProps} from '@components/Composer/types'; +import type {ThemeStyles} from '@styles/index'; type UpdateNumberOfLines = (props: ComposerProps, event: NativeSyntheticEvent, styles: ThemeStyles) => void; diff --git a/src/libs/ControlSelection/index.native.ts b/src/libs/ControlSelection/index.native.ts index e9a1e4e9ad5b..b45af6da6441 100644 --- a/src/libs/ControlSelection/index.native.ts +++ b/src/libs/ControlSelection/index.native.ts @@ -1,4 +1,4 @@ -import ControlSelectionModule from './types'; +import type ControlSelectionModule from './types'; function block() {} function unblock() {} diff --git a/src/libs/ControlSelection/index.ts b/src/libs/ControlSelection/index.ts index 44d4530bc4fd..ab11e66bc369 100644 --- a/src/libs/ControlSelection/index.ts +++ b/src/libs/ControlSelection/index.ts @@ -1,5 +1,5 @@ -import CustomRefObject from '@src/types/utils/CustomRefObject'; -import ControlSelectionModule from './types'; +import type CustomRefObject from '@src/types/utils/CustomRefObject'; +import type ControlSelectionModule from './types'; /** * Block selection on the whole app diff --git a/src/libs/ControlSelection/types.ts b/src/libs/ControlSelection/types.ts index d84347fd7ba6..fc0b488577ec 100644 --- a/src/libs/ControlSelection/types.ts +++ b/src/libs/ControlSelection/types.ts @@ -1,4 +1,4 @@ -import CustomRefObject from '@src/types/utils/CustomRefObject'; +import type CustomRefObject from '@src/types/utils/CustomRefObject'; type ControlSelectionModule = { block: () => void; diff --git a/src/libs/CurrencyUtils.ts b/src/libs/CurrencyUtils.ts index b8f5b434cc4a..42387e03c80b 100644 --- a/src/libs/CurrencyUtils.ts +++ b/src/libs/CurrencyUtils.ts @@ -1,6 +1,7 @@ import Onyx from 'react-native-onyx'; import CONST from '@src/CONST'; -import ONYXKEYS, {OnyxValues} from '@src/ONYXKEYS'; +import type {OnyxValues} from '@src/ONYXKEYS'; +import ONYXKEYS from '@src/ONYXKEYS'; import * as Localize from './Localize'; import BaseLocaleListener from './Localize/LocaleListener/BaseLocaleListener'; import * as NumberFormatUtils from './NumberFormatUtils'; diff --git a/src/libs/DateUtils.ts b/src/libs/DateUtils.ts index 4bd717eba6c0..08f61a50b645 100644 --- a/src/libs/DateUtils.ts +++ b/src/libs/DateUtils.ts @@ -27,10 +27,10 @@ import {formatInTimeZone, format as tzFormat, utcToZonedTime, zonedTimeToUtc} fr import {enGB, es} from 'date-fns/locale'; import throttle from 'lodash/throttle'; import Onyx from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {SelectedTimezone, Timezone} from '@src/types/onyx/PersonalDetails'; +import type {SelectedTimezone, Timezone} from '@src/types/onyx/PersonalDetails'; import * as CurrentDate from './actions/CurrentDate'; import * as Localize from './Localize'; import Log from './Log'; diff --git a/src/libs/DeviceCapabilities/canUseTouchScreen/index.native.ts b/src/libs/DeviceCapabilities/canUseTouchScreen/index.native.ts index 60980801e73c..d8d04a8cbeb7 100644 --- a/src/libs/DeviceCapabilities/canUseTouchScreen/index.native.ts +++ b/src/libs/DeviceCapabilities/canUseTouchScreen/index.native.ts @@ -1,4 +1,4 @@ -import CanUseTouchScreen from './types'; +import type CanUseTouchScreen from './types'; const canUseTouchScreen: CanUseTouchScreen = () => true; diff --git a/src/libs/DeviceCapabilities/canUseTouchScreen/index.ts b/src/libs/DeviceCapabilities/canUseTouchScreen/index.ts index 9e21f5a42b5d..34a1fc532e9e 100644 --- a/src/libs/DeviceCapabilities/canUseTouchScreen/index.ts +++ b/src/libs/DeviceCapabilities/canUseTouchScreen/index.ts @@ -1,5 +1,5 @@ -import {Merge} from 'type-fest'; -import CanUseTouchScreen from './types'; +import type {Merge} from 'type-fest'; +import type CanUseTouchScreen from './types'; type ExtendedNavigator = Merge; diff --git a/src/libs/DeviceCapabilities/hasHoverSupport/index.native.ts b/src/libs/DeviceCapabilities/hasHoverSupport/index.native.ts index 097b3b0cbba1..31277f753923 100644 --- a/src/libs/DeviceCapabilities/hasHoverSupport/index.native.ts +++ b/src/libs/DeviceCapabilities/hasHoverSupport/index.native.ts @@ -1,4 +1,4 @@ -import HasHoverSupport from './types'; +import type HasHoverSupport from './types'; /** * Allows us to identify whether the platform is hoverable. diff --git a/src/libs/DeviceCapabilities/hasHoverSupport/index.ts b/src/libs/DeviceCapabilities/hasHoverSupport/index.ts index 1ff0f461db69..4915c7786532 100644 --- a/src/libs/DeviceCapabilities/hasHoverSupport/index.ts +++ b/src/libs/DeviceCapabilities/hasHoverSupport/index.ts @@ -1,4 +1,4 @@ -import HasHoverSupport from './types'; +import type HasHoverSupport from './types'; /** * Allows us to identify whether the platform is hoverable. diff --git a/src/libs/DeviceCapabilities/hasPassiveEventListenerSupport/index.native.ts b/src/libs/DeviceCapabilities/hasPassiveEventListenerSupport/index.native.ts index a5e57675fcf5..f32cff6b365d 100644 --- a/src/libs/DeviceCapabilities/hasPassiveEventListenerSupport/index.native.ts +++ b/src/libs/DeviceCapabilities/hasPassiveEventListenerSupport/index.native.ts @@ -1,4 +1,4 @@ -import HasPassiveEventListenerSupport from './types'; +import type HasPassiveEventListenerSupport from './types'; /** * Allows us to identify whether the browser supports passive event listener. diff --git a/src/libs/DistanceRequestUtils.ts b/src/libs/DistanceRequestUtils.ts index 477bfb4b61f9..790a9b1e37cd 100644 --- a/src/libs/DistanceRequestUtils.ts +++ b/src/libs/DistanceRequestUtils.ts @@ -1,7 +1,8 @@ -import {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; import type {LocaleContextProps} from '@components/LocaleContextProvider'; import CONST from '@src/CONST'; -import Policy, {Unit} from '@src/types/onyx/Policy'; +import type {Unit} from '@src/types/onyx/Policy'; +import type Policy from '@src/types/onyx/Policy'; import * as CurrencyUtils from './CurrencyUtils'; import * as PolicyUtils from './PolicyUtils'; diff --git a/src/libs/DomUtils/index.native.ts b/src/libs/DomUtils/index.native.ts index 0864f1a16ac0..7117f5942f9a 100644 --- a/src/libs/DomUtils/index.native.ts +++ b/src/libs/DomUtils/index.native.ts @@ -1,4 +1,4 @@ -import GetActiveElement from './types'; +import type GetActiveElement from './types'; const getActiveElement: GetActiveElement = () => null; diff --git a/src/libs/DomUtils/index.ts b/src/libs/DomUtils/index.ts index 6a2eed57fbe6..068eb0c9fe7e 100644 --- a/src/libs/DomUtils/index.ts +++ b/src/libs/DomUtils/index.ts @@ -1,4 +1,4 @@ -import GetActiveElement from './types'; +import type GetActiveElement from './types'; const getActiveElement: GetActiveElement = () => document.activeElement; diff --git a/src/libs/E2E/API.mock.ts b/src/libs/E2E/API.mock.ts index 0568de926024..83b7cb218977 100644 --- a/src/libs/E2E/API.mock.ts +++ b/src/libs/E2E/API.mock.ts @@ -1,6 +1,6 @@ import Onyx from 'react-native-onyx'; import Log from '@libs/Log'; -import Response from '@src/types/onyx/Response'; +import type Response from '@src/types/onyx/Response'; // mock functions import mockAuthenticatePusher from './apiMocks/authenticatePusher'; import mockBeginSignin from './apiMocks/beginSignin'; diff --git a/src/libs/E2E/apiMocks/authenticatePusher.ts b/src/libs/E2E/apiMocks/authenticatePusher.ts index 81191ddb8222..28f9ebbbee88 100644 --- a/src/libs/E2E/apiMocks/authenticatePusher.ts +++ b/src/libs/E2E/apiMocks/authenticatePusher.ts @@ -1,4 +1,4 @@ -import Response from '@src/types/onyx/Response'; +import type Response from '@src/types/onyx/Response'; const authenticatePusher = (): Response => ({ auth: 'auth', diff --git a/src/libs/E2E/apiMocks/beginSignin.ts b/src/libs/E2E/apiMocks/beginSignin.ts index c5002f1f3dd8..a578f935c2aa 100644 --- a/src/libs/E2E/apiMocks/beginSignin.ts +++ b/src/libs/E2E/apiMocks/beginSignin.ts @@ -1,5 +1,5 @@ -import {SigninParams} from '@libs/E2E/types'; -import Response from '@src/types/onyx/Response'; +import type {SigninParams} from '@libs/E2E/types'; +import type Response from '@src/types/onyx/Response'; const beginSignin = ({email}: SigninParams): Response => ({ onyxData: [ diff --git a/src/libs/E2E/apiMocks/openApp.ts b/src/libs/E2E/apiMocks/openApp.ts index 42d13716407d..ec714d693666 100644 --- a/src/libs/E2E/apiMocks/openApp.ts +++ b/src/libs/E2E/apiMocks/openApp.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import Response from '@src/types/onyx/Response'; +import type Response from '@src/types/onyx/Response'; const openApp = (): Response => ({ onyxData: [ diff --git a/src/libs/E2E/apiMocks/openReport.ts b/src/libs/E2E/apiMocks/openReport.ts index 51d40dc896d2..49d44605592d 100644 --- a/src/libs/E2E/apiMocks/openReport.ts +++ b/src/libs/E2E/apiMocks/openReport.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import Response from '@src/types/onyx/Response'; +import type Response from '@src/types/onyx/Response'; export default (): Response => ({ onyxData: [ diff --git a/src/libs/E2E/apiMocks/readNewestAction.ts b/src/libs/E2E/apiMocks/readNewestAction.ts index 5db007e64a6f..eb3800a98b81 100644 --- a/src/libs/E2E/apiMocks/readNewestAction.ts +++ b/src/libs/E2E/apiMocks/readNewestAction.ts @@ -1,4 +1,4 @@ -import Response from '@src/types/onyx/Response'; +import type Response from '@src/types/onyx/Response'; export default (): Response => ({ jsonCode: 200, diff --git a/src/libs/E2E/apiMocks/signinUser.ts b/src/libs/E2E/apiMocks/signinUser.ts index a7d841196c48..7063e56f94be 100644 --- a/src/libs/E2E/apiMocks/signinUser.ts +++ b/src/libs/E2E/apiMocks/signinUser.ts @@ -1,5 +1,5 @@ -import {SigninParams} from '@libs/E2E/types'; -import Response from '@src/types/onyx/Response'; +import type {SigninParams} from '@libs/E2E/types'; +import type Response from '@src/types/onyx/Response'; const signinUser = ({email}: SigninParams): Response => ({ onyxData: [ diff --git a/src/libs/E2E/isE2ETestSession.native.ts b/src/libs/E2E/isE2ETestSession.native.ts index 0463d41572cf..249062289e43 100644 --- a/src/libs/E2E/isE2ETestSession.native.ts +++ b/src/libs/E2E/isE2ETestSession.native.ts @@ -1,5 +1,5 @@ import CONFIG from '@src/CONFIG'; -import {IsE2ETestSession} from './types'; +import type {IsE2ETestSession} from './types'; const isE2ETestSession: IsE2ETestSession = () => CONFIG.E2E_TESTING; diff --git a/src/libs/E2E/isE2ETestSession.ts b/src/libs/E2E/isE2ETestSession.ts index 145c4336fddf..cba31689f951 100644 --- a/src/libs/E2E/isE2ETestSession.ts +++ b/src/libs/E2E/isE2ETestSession.ts @@ -1,4 +1,4 @@ -import {IsE2ETestSession} from './types'; +import type {IsE2ETestSession} from './types'; const isE2ETestSession: IsE2ETestSession = () => false; diff --git a/src/libs/E2E/reactNativeLaunchingTest.ts b/src/libs/E2E/reactNativeLaunchingTest.ts index 0533a2ff600b..cbd63270e736 100644 --- a/src/libs/E2E/reactNativeLaunchingTest.ts +++ b/src/libs/E2E/reactNativeLaunchingTest.ts @@ -5,7 +5,7 @@ * By doing this, we avoid bundling any E2E testing code * into the actual release app. */ -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import * as Metrics from '@libs/Metrics'; import Performance from '@libs/Performance'; import E2EConfig from '../../../tests/e2e/config'; diff --git a/src/libs/E2E/tests/appStartTimeTest.e2e.ts b/src/libs/E2E/tests/appStartTimeTest.e2e.ts index 92e2513e0351..6589e594dac6 100644 --- a/src/libs/E2E/tests/appStartTimeTest.e2e.ts +++ b/src/libs/E2E/tests/appStartTimeTest.e2e.ts @@ -1,5 +1,5 @@ import Config from 'react-native-config'; -import {PerformanceEntry} from 'react-native-performance'; +import type {PerformanceEntry} from 'react-native-performance'; import E2ELogin from '@libs/E2E/actions/e2eLogin'; import E2EClient from '@libs/E2E/client'; import Performance from '@libs/Performance'; diff --git a/src/libs/EmojiTrie.ts b/src/libs/EmojiTrie.ts index 0100f279066a..4c441facdd46 100644 --- a/src/libs/EmojiTrie.ts +++ b/src/libs/EmojiTrie.ts @@ -1,6 +1,6 @@ import emojis, {localeEmojis} from '@assets/emojis'; import CONST from '@src/CONST'; -import IconAsset from '@src/types/utils/IconAsset'; +import type IconAsset from '@src/types/utils/IconAsset'; import Timing from './actions/Timing'; import Trie from './Trie'; diff --git a/src/libs/EmojiUtils.ts b/src/libs/EmojiUtils.ts index baff8ea7087f..06bbd5c871ed 100644 --- a/src/libs/EmojiUtils.ts +++ b/src/libs/EmojiUtils.ts @@ -3,13 +3,13 @@ import Str from 'expensify-common/lib/str'; import memoize from 'lodash/memoize'; import Onyx from 'react-native-onyx'; import * as Emojis from '@assets/emojis'; -import {Emoji, HeaderEmoji, PickerEmojis} from '@assets/emojis/types'; +import type {Emoji, HeaderEmoji, PickerEmojis} from '@assets/emojis/types'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {FrequentlyUsedEmoji} from '@src/types/onyx'; -import {ReportActionReaction, UsersReactions} from '@src/types/onyx/ReportActionReactions'; -import IconAsset from '@src/types/utils/IconAsset'; -import {SupportedLanguage} from './EmojiTrie'; +import type {FrequentlyUsedEmoji} from '@src/types/onyx'; +import type {ReportActionReaction, UsersReactions} from '@src/types/onyx/ReportActionReactions'; +import type IconAsset from '@src/types/utils/IconAsset'; +import type {SupportedLanguage} from './EmojiTrie'; type HeaderIndice = {code: string; index: number; icon: IconAsset}; type EmojiSpacer = {code: string; spacer: boolean}; diff --git a/src/libs/Environment/betaChecker/index.android.ts b/src/libs/Environment/betaChecker/index.android.ts index f230120ba0b1..aeb1527457f7 100644 --- a/src/libs/Environment/betaChecker/index.android.ts +++ b/src/libs/Environment/betaChecker/index.android.ts @@ -4,7 +4,7 @@ import * as AppUpdate from '@userActions/AppUpdate'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import pkg from '../../../../package.json'; -import IsBetaBuild from './types'; +import type IsBetaBuild from './types'; let isLastSavedBeta = false; Onyx.connect({ diff --git a/src/libs/Environment/betaChecker/index.ios.ts b/src/libs/Environment/betaChecker/index.ios.ts index 0d901fc4b003..dae79dabfd2b 100644 --- a/src/libs/Environment/betaChecker/index.ios.ts +++ b/src/libs/Environment/betaChecker/index.ios.ts @@ -1,5 +1,5 @@ import {NativeModules} from 'react-native'; -import IsBetaBuild from './types'; +import type IsBetaBuild from './types'; /** * Check to see if the build is staging (TestFlight) or production diff --git a/src/libs/Environment/betaChecker/index.ts b/src/libs/Environment/betaChecker/index.ts index 541a3120ccce..ce1668759c8c 100644 --- a/src/libs/Environment/betaChecker/index.ts +++ b/src/libs/Environment/betaChecker/index.ts @@ -1,4 +1,4 @@ -import IsBetaBuild from './types'; +import type IsBetaBuild from './types'; /** * There's no beta build in non native diff --git a/src/libs/Environment/getEnvironment/index.native.ts b/src/libs/Environment/getEnvironment/index.native.ts index 766f288376b5..fb3f70001aaa 100644 --- a/src/libs/Environment/getEnvironment/index.native.ts +++ b/src/libs/Environment/getEnvironment/index.native.ts @@ -1,7 +1,7 @@ import Config from 'react-native-config'; import betaChecker from '@libs/Environment/betaChecker'; import CONST from '@src/CONST'; -import Environment from './types'; +import type Environment from './types'; let environment: Environment | null = null; diff --git a/src/libs/Environment/getEnvironment/index.ts b/src/libs/Environment/getEnvironment/index.ts index 84f64e91649b..9bcefba880a4 100644 --- a/src/libs/Environment/getEnvironment/index.ts +++ b/src/libs/Environment/getEnvironment/index.ts @@ -1,6 +1,6 @@ import Config from 'react-native-config'; import CONST from '@src/CONST'; -import Environment from './types'; +import type Environment from './types'; function getEnvironment(): Promise { return Promise.resolve((Config?.ENVIRONMENT as Environment) ?? CONST.ENVIRONMENT.DEV); diff --git a/src/libs/Environment/getEnvironment/types.ts b/src/libs/Environment/getEnvironment/types.ts index 9247ed17ffe2..6f8cf505d2f3 100644 --- a/src/libs/Environment/getEnvironment/types.ts +++ b/src/libs/Environment/getEnvironment/types.ts @@ -1,5 +1,5 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; type Environment = ValueOf; diff --git a/src/libs/ErrorUtils.ts b/src/libs/ErrorUtils.ts index 46bdd510f5c4..159a5817189b 100644 --- a/src/libs/ErrorUtils.ts +++ b/src/libs/ErrorUtils.ts @@ -1,7 +1,7 @@ import CONST from '@src/CONST'; -import {TranslationFlatObject, TranslationPaths} from '@src/languages/types'; -import {ErrorFields, Errors} from '@src/types/onyx/OnyxCommon'; -import Response from '@src/types/onyx/Response'; +import type {TranslationFlatObject, TranslationPaths} from '@src/languages/types'; +import type {ErrorFields, Errors} from '@src/types/onyx/OnyxCommon'; +import type Response from '@src/types/onyx/Response'; import DateUtils from './DateUtils'; import * as Localize from './Localize'; diff --git a/src/libs/Firebase/index.native.ts b/src/libs/Firebase/index.native.ts index 107b3f8905b3..bf8551954671 100644 --- a/src/libs/Firebase/index.native.ts +++ b/src/libs/Firebase/index.native.ts @@ -1,7 +1,7 @@ /* eslint-disable no-unused-vars */ import perf from '@react-native-firebase/perf'; import * as Environment from '@libs/Environment/Environment'; -import {StartTrace, StopTrace, TraceMap} from './types'; +import type {StartTrace, StopTrace, TraceMap} from './types'; const traceMap: TraceMap = {}; diff --git a/src/libs/Firebase/index.ts b/src/libs/Firebase/index.ts index 3048cf1d9bd8..8698a841db4a 100644 --- a/src/libs/Firebase/index.ts +++ b/src/libs/Firebase/index.ts @@ -1,4 +1,4 @@ -import {StartTrace, StopTrace} from './types'; +import type {StartTrace, StopTrace} from './types'; /** Web does not use Firebase for performance tracing */ const startTrace: StartTrace = () => {}; diff --git a/src/libs/Firebase/types.ts b/src/libs/Firebase/types.ts index 3822f7072a7f..1a1d4959740a 100644 --- a/src/libs/Firebase/types.ts +++ b/src/libs/Firebase/types.ts @@ -1,4 +1,4 @@ -import {FirebasePerformanceTypes} from '@react-native-firebase/perf'; +import type {FirebasePerformanceTypes} from '@react-native-firebase/perf'; type Trace = { trace: FirebasePerformanceTypes.Trace; diff --git a/src/libs/FormUtils.ts b/src/libs/FormUtils.ts index facaf5bfddf4..5366e149728e 100644 --- a/src/libs/FormUtils.ts +++ b/src/libs/FormUtils.ts @@ -1,4 +1,4 @@ -import {OnyxFormKey} from '@src/ONYXKEYS'; +import type {OnyxFormKey} from '@src/ONYXKEYS'; type ExcludeDraft = T extends `${string}Draft` ? never : T; type OnyxFormKeyWithoutDraft = ExcludeDraft; diff --git a/src/libs/GetPhysicalCardUtils.ts b/src/libs/GetPhysicalCardUtils.ts index 9d77858cb2a9..eebefd7c1d52 100644 --- a/src/libs/GetPhysicalCardUtils.ts +++ b/src/libs/GetPhysicalCardUtils.ts @@ -1,5 +1,5 @@ import ROUTES from '@src/ROUTES'; -import {Login} from '@src/types/onyx'; +import type {Login} from '@src/types/onyx'; import Navigation from './Navigation/Navigation'; import * as PersonalDetailsUtils from './PersonalDetailsUtils'; import * as UserUtils from './UserUtils'; diff --git a/src/libs/GroupChatUtils.ts b/src/libs/GroupChatUtils.ts index 862c50700c0c..ba14bc9c9c3d 100644 --- a/src/libs/GroupChatUtils.ts +++ b/src/libs/GroupChatUtils.ts @@ -1,6 +1,7 @@ -import Onyx, {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; -import {PersonalDetailsList, Report} from '@src/types/onyx'; +import type {PersonalDetailsList, Report} from '@src/types/onyx'; import * as OptionsListUtils from './OptionsListUtils'; import * as ReportUtils from './ReportUtils'; diff --git a/src/libs/HapticFeedback/index.native.ts b/src/libs/HapticFeedback/index.native.ts index 4c3605cc27ef..6d24ece3951c 100644 --- a/src/libs/HapticFeedback/index.native.ts +++ b/src/libs/HapticFeedback/index.native.ts @@ -1,5 +1,5 @@ import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; -import HapticFeedback from './types'; +import type HapticFeedback from './types'; const hapticFeedback: HapticFeedback = { press: () => { diff --git a/src/libs/HapticFeedback/index.ts b/src/libs/HapticFeedback/index.ts index 3dd5b87f573b..7a006b42cab4 100644 --- a/src/libs/HapticFeedback/index.ts +++ b/src/libs/HapticFeedback/index.ts @@ -1,4 +1,4 @@ -import HapticFeedback from './types'; +import type HapticFeedback from './types'; /** * Web does not support Haptic feedback diff --git a/src/libs/HeaderUtils.ts b/src/libs/HeaderUtils.ts index ebf1b1139621..a1822aca00f4 100644 --- a/src/libs/HeaderUtils.ts +++ b/src/libs/HeaderUtils.ts @@ -1,7 +1,7 @@ -import {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; import * as Expensicons from '@components/Icon/Expensicons'; -import OnyxReport from '@src/types/onyx/Report'; -import IconAsset from '@src/types/utils/IconAsset'; +import type OnyxReport from '@src/types/onyx/Report'; +import type IconAsset from '@src/types/utils/IconAsset'; import * as Report from './actions/Report'; import * as Session from './actions/Session'; import * as Localize from './Localize'; diff --git a/src/libs/HttpUtils.ts b/src/libs/HttpUtils.ts index 859c8624833c..e40c8148c923 100644 --- a/src/libs/HttpUtils.ts +++ b/src/libs/HttpUtils.ts @@ -1,9 +1,9 @@ import Onyx from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import alert from '@components/Alert'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {RequestType} from '@src/types/onyx/Request'; +import type {RequestType} from '@src/types/onyx/Request'; import type Response from '@src/types/onyx/Response'; import * as ApiUtils from './ApiUtils'; import HttpsError from './Errors/HttpsError'; diff --git a/src/libs/IOUUtils.ts b/src/libs/IOUUtils.ts index edfb9e3691d0..09cdfd15cbba 100644 --- a/src/libs/IOUUtils.ts +++ b/src/libs/IOUUtils.ts @@ -1,8 +1,8 @@ -import {OnyxEntry} from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {OnyxEntry} from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; -import {Report, Transaction} from '@src/types/onyx'; +import type {Report, Transaction} from '@src/types/onyx'; import * as CurrencyUtils from './CurrencyUtils'; import * as FileUtils from './fileDownload/FileUtils'; import Navigation from './Navigation/Navigation'; diff --git a/src/libs/IntlPolyfill/index.native.ts b/src/libs/IntlPolyfill/index.native.ts index a044b4c52f0d..0819479b50ec 100644 --- a/src/libs/IntlPolyfill/index.native.ts +++ b/src/libs/IntlPolyfill/index.native.ts @@ -1,6 +1,6 @@ import polyfillListFormat from './polyfillListFormat'; import polyfillNumberFormat from './polyfillNumberFormat'; -import IntlPolyfill from './types'; +import type IntlPolyfill from './types'; /** * Polyfill the Intl API, always performed for native devices. diff --git a/src/libs/IntlPolyfill/index.ts b/src/libs/IntlPolyfill/index.ts index bef12ef093e2..42664477409f 100644 --- a/src/libs/IntlPolyfill/index.ts +++ b/src/libs/IntlPolyfill/index.ts @@ -1,5 +1,5 @@ import polyfillNumberFormat from './polyfillNumberFormat'; -import IntlPolyfill from './types'; +import type IntlPolyfill from './types'; /** * Polyfill the Intl API if the ICU version is old. diff --git a/src/libs/KeyboardShortcut/KeyDownPressListener/index.native.ts b/src/libs/KeyboardShortcut/KeyDownPressListener/index.native.ts index 8b460a069f05..e506a97890c0 100644 --- a/src/libs/KeyboardShortcut/KeyDownPressListener/index.native.ts +++ b/src/libs/KeyboardShortcut/KeyDownPressListener/index.native.ts @@ -1,4 +1,4 @@ -import {AddKeyDownPressListener, RemoveKeyDownPressListener} from './types'; +import type {AddKeyDownPressListener, RemoveKeyDownPressListener} from './types'; const addKeyDownPressListener: AddKeyDownPressListener = () => {}; const removeKeyDownPressListener: RemoveKeyDownPressListener = () => {}; diff --git a/src/libs/KeyboardShortcut/bindHandlerToKeydownEvent/index.native.ts b/src/libs/KeyboardShortcut/bindHandlerToKeydownEvent/index.native.ts index 4deabb9aa5ef..bc56df0d67f3 100644 --- a/src/libs/KeyboardShortcut/bindHandlerToKeydownEvent/index.native.ts +++ b/src/libs/KeyboardShortcut/bindHandlerToKeydownEvent/index.native.ts @@ -1,5 +1,5 @@ import getKeyEventModifiers from '@libs/KeyboardShortcut/getKeyEventModifiers'; -import BindHandlerToKeydownEvent from './types'; +import type BindHandlerToKeydownEvent from './types'; /** * Checks if an event for that key is configured and if so, runs it. diff --git a/src/libs/KeyboardShortcut/bindHandlerToKeydownEvent/index.ts b/src/libs/KeyboardShortcut/bindHandlerToKeydownEvent/index.ts index f8e18a11971d..dd0aedcb5dbd 100644 --- a/src/libs/KeyboardShortcut/bindHandlerToKeydownEvent/index.ts +++ b/src/libs/KeyboardShortcut/bindHandlerToKeydownEvent/index.ts @@ -1,6 +1,6 @@ import getKeyEventModifiers from '@libs/KeyboardShortcut/getKeyEventModifiers'; import isEnterWhileComposition from '@libs/KeyboardShortcut/isEnterWhileComposition'; -import BindHandlerToKeydownEvent from './types'; +import type BindHandlerToKeydownEvent from './types'; /** * Checks if an event for that key is configured and if so, runs it. diff --git a/src/libs/KeyboardShortcut/getKeyEventModifiers.ts b/src/libs/KeyboardShortcut/getKeyEventModifiers.ts index f82de725bb50..d6fbf80bc5bf 100644 --- a/src/libs/KeyboardShortcut/getKeyEventModifiers.ts +++ b/src/libs/KeyboardShortcut/getKeyEventModifiers.ts @@ -1,5 +1,5 @@ import * as KeyCommand from 'react-native-key-command'; -import {KeyCommandEvent} from './bindHandlerToKeydownEvent/types'; +import type {KeyCommandEvent} from './bindHandlerToKeydownEvent/types'; const keyModifierControl = KeyCommand?.constants.keyModifierControl ?? 'keyModifierControl'; const keyModifierCommand = KeyCommand?.constants.keyModifierCommand ?? 'keyModifierCommand'; diff --git a/src/libs/KeyboardShortcut/isEnterWhileComposition.ts b/src/libs/KeyboardShortcut/isEnterWhileComposition.ts index a752f8a24811..71ec27f21c13 100644 --- a/src/libs/KeyboardShortcut/isEnterWhileComposition.ts +++ b/src/libs/KeyboardShortcut/isEnterWhileComposition.ts @@ -1,5 +1,5 @@ -import React from 'react'; -import {NativeSyntheticEvent} from 'react-native'; +import type React from 'react'; +import type {NativeSyntheticEvent} from 'react-native'; import * as Browser from '@libs/Browser'; import CONST from '@src/CONST'; diff --git a/src/libs/LocaleDigitUtils.ts b/src/libs/LocaleDigitUtils.ts index 05d9fea5357d..794c7611cb5c 100644 --- a/src/libs/LocaleDigitUtils.ts +++ b/src/libs/LocaleDigitUtils.ts @@ -1,6 +1,6 @@ import _ from 'lodash'; -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; import * as NumberFormatUtils from './NumberFormatUtils'; type Locale = ValueOf; diff --git a/src/libs/Localize/LocaleListener/BaseLocaleListener.ts b/src/libs/Localize/LocaleListener/BaseLocaleListener.ts index c5eba18af422..79422fa82c21 100644 --- a/src/libs/Localize/LocaleListener/BaseLocaleListener.ts +++ b/src/libs/Localize/LocaleListener/BaseLocaleListener.ts @@ -1,7 +1,8 @@ import Onyx from 'react-native-onyx'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import BaseLocale, {LocaleListenerConnect} from './types'; +import type {LocaleListenerConnect} from './types'; +import type BaseLocale from './types'; let preferredLocale: BaseLocale = CONST.LOCALES.DEFAULT; diff --git a/src/libs/Localize/LocaleListener/index.desktop.ts b/src/libs/Localize/LocaleListener/index.desktop.ts index 6974d3ed4879..db5cbb1a51a6 100644 --- a/src/libs/Localize/LocaleListener/index.desktop.ts +++ b/src/libs/Localize/LocaleListener/index.desktop.ts @@ -1,6 +1,6 @@ import ELECTRON_EVENTS from '../../../../desktop/ELECTRON_EVENTS'; import BaseLocaleListener from './BaseLocaleListener'; -import {LocaleListener, LocaleListenerConnect} from './types'; +import type {LocaleListener, LocaleListenerConnect} from './types'; const localeListenerConnect: LocaleListenerConnect = (callbackAfterChange = () => {}) => BaseLocaleListener.connect((val) => { diff --git a/src/libs/Localize/LocaleListener/index.ts b/src/libs/Localize/LocaleListener/index.ts index b0dda5d5fabc..c08eb129934a 100644 --- a/src/libs/Localize/LocaleListener/index.ts +++ b/src/libs/Localize/LocaleListener/index.ts @@ -1,5 +1,5 @@ import BaseLocaleListener from './BaseLocaleListener'; -import {LocaleListener, LocaleListenerConnect} from './types'; +import type {LocaleListener, LocaleListenerConnect} from './types'; const localeListenerConnect: LocaleListenerConnect = BaseLocaleListener.connect; diff --git a/src/libs/Localize/LocaleListener/types.ts b/src/libs/Localize/LocaleListener/types.ts index 4daf90af0483..453e8c7f442a 100644 --- a/src/libs/Localize/LocaleListener/types.ts +++ b/src/libs/Localize/LocaleListener/types.ts @@ -1,5 +1,5 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; type BaseLocale = ValueOf; diff --git a/src/libs/Localize/index.ts b/src/libs/Localize/index.ts index 77c34ebdc576..bc40f93dd13b 100644 --- a/src/libs/Localize/index.ts +++ b/src/libs/Localize/index.ts @@ -1,11 +1,11 @@ import * as RNLocalize from 'react-native-localize'; import Onyx from 'react-native-onyx'; import Log from '@libs/Log'; -import {MessageElementBase, MessageTextElement} from '@libs/MessageElement'; +import type {MessageElementBase, MessageTextElement} from '@libs/MessageElement'; import Config from '@src/CONFIG'; import CONST from '@src/CONST'; import translations from '@src/languages/translations'; -import {TranslationFlatObject, TranslationPaths} from '@src/languages/types'; +import type {TranslationFlatObject, TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import LocaleListener from './LocaleListener'; import BaseLocaleListener from './LocaleListener/BaseLocaleListener'; diff --git a/src/libs/Log.ts b/src/libs/Log.ts index e171e6338ffe..9916cdd23b76 100644 --- a/src/libs/Log.ts +++ b/src/libs/Log.ts @@ -3,7 +3,7 @@ /* eslint-disable rulesdir/no-api-in-views */ import Logger from 'expensify-common/lib/Logger'; -import {Merge} from 'type-fest'; +import type {Merge} from 'type-fest'; import pkg from '../../package.json'; import getPlatform from './getPlatform'; import * as Network from './Network'; diff --git a/src/libs/Metrics/index.native.ts b/src/libs/Metrics/index.native.ts index 373f826e9ca3..a1d008da653b 100644 --- a/src/libs/Metrics/index.native.ts +++ b/src/libs/Metrics/index.native.ts @@ -1,5 +1,5 @@ import CONFIG from '@src/CONFIG'; -import {CanCaptureOnyxMetrics, CanCapturePerformanceMetrics} from './types'; +import type {CanCaptureOnyxMetrics, CanCapturePerformanceMetrics} from './types'; /** * Is capturing performance stats enabled. diff --git a/src/libs/Metrics/index.ts b/src/libs/Metrics/index.ts index 1097826aff24..51248b891d81 100644 --- a/src/libs/Metrics/index.ts +++ b/src/libs/Metrics/index.ts @@ -1,5 +1,5 @@ import CONFIG from '@src/CONFIG'; -import {CanCaptureOnyxMetrics, CanCapturePerformanceMetrics} from './types'; +import type {CanCaptureOnyxMetrics, CanCapturePerformanceMetrics} from './types'; // We don't capture performance metrics on web as there are enough tools available const canCapturePerformanceMetrics: CanCapturePerformanceMetrics = () => false; diff --git a/src/libs/Middleware/HandleUnusedOptimisticID.ts b/src/libs/Middleware/HandleUnusedOptimisticID.ts index abca86522d2b..eb419401d84d 100644 --- a/src/libs/Middleware/HandleUnusedOptimisticID.ts +++ b/src/libs/Middleware/HandleUnusedOptimisticID.ts @@ -1,9 +1,9 @@ import _ from 'lodash'; import deepReplaceKeysAndValues from '@libs/deepReplaceKeysAndValues'; -import {Middleware} from '@libs/Request'; +import type {Middleware} from '@libs/Request'; import * as PersistedRequests from '@userActions/PersistedRequests'; import ONYXKEYS from '@src/ONYXKEYS'; -import Report from '@src/types/onyx/Report'; +import type Report from '@src/types/onyx/Report'; const handleUnusedOptimisticID: Middleware = (requestResponse, request, isFromSequentialQueue) => requestResponse.then((response) => { diff --git a/src/libs/Middleware/Logging.ts b/src/libs/Middleware/Logging.ts index 3ef819298f80..27a904f692ed 100644 --- a/src/libs/Middleware/Logging.ts +++ b/src/libs/Middleware/Logging.ts @@ -1,8 +1,8 @@ import Log from '@libs/Log'; import CONST from '@src/CONST'; -import Request from '@src/types/onyx/Request'; -import Response from '@src/types/onyx/Response'; -import Middleware from './types'; +import type Request from '@src/types/onyx/Request'; +import type Response from '@src/types/onyx/Response'; +import type Middleware from './types'; function logRequestDetails(message: string, request: Request, response?: Response | void) { // Don't log about log or else we'd cause an infinite loop diff --git a/src/libs/Middleware/Reauthentication.ts b/src/libs/Middleware/Reauthentication.ts index f1f71a85b16c..09a01e821cb2 100644 --- a/src/libs/Middleware/Reauthentication.ts +++ b/src/libs/Middleware/Reauthentication.ts @@ -5,7 +5,7 @@ import * as NetworkStore from '@libs/Network/NetworkStore'; import NetworkConnection from '@libs/NetworkConnection'; import * as Request from '@libs/Request'; import CONST from '@src/CONST'; -import Middleware from './types'; +import type Middleware from './types'; // We store a reference to the active authentication request so that we are only ever making one request to authenticate at a time. let isAuthenticating: Promise | null = null; diff --git a/src/libs/Middleware/RecheckConnection.ts b/src/libs/Middleware/RecheckConnection.ts index 1f43b0171800..f3f7d2e7b688 100644 --- a/src/libs/Middleware/RecheckConnection.ts +++ b/src/libs/Middleware/RecheckConnection.ts @@ -1,6 +1,6 @@ import NetworkConnection from '@libs/NetworkConnection'; import CONST from '@src/CONST'; -import Middleware from './types'; +import type Middleware from './types'; /** * @returns cancel timer diff --git a/src/libs/Middleware/SaveResponseInOnyx.ts b/src/libs/Middleware/SaveResponseInOnyx.ts index d73a10d98663..9ed93c4ce393 100644 --- a/src/libs/Middleware/SaveResponseInOnyx.ts +++ b/src/libs/Middleware/SaveResponseInOnyx.ts @@ -2,7 +2,7 @@ import * as MemoryOnlyKeys from '@userActions/MemoryOnlyKeys/MemoryOnlyKeys'; import * as OnyxUpdates from '@userActions/OnyxUpdates'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import Middleware from './types'; +import type Middleware from './types'; // If we're executing any of these requests, we don't need to trigger our OnyxUpdates flow to update the current data even if our current value is out of // date because all these requests are updating the app to the most current state. diff --git a/src/libs/Middleware/types.ts b/src/libs/Middleware/types.ts index c1d199539b15..4cc0a1cc1026 100644 --- a/src/libs/Middleware/types.ts +++ b/src/libs/Middleware/types.ts @@ -1,5 +1,5 @@ -import Request from '@src/types/onyx/Request'; -import Response from '@src/types/onyx/Response'; +import type Request from '@src/types/onyx/Request'; +import type Response from '@src/types/onyx/Response'; type Middleware = (response: Promise, request: Request, isFromSequentialQueue: boolean) => Promise; diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index c3d9b0a85339..600cfb48a1c1 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -2,12 +2,12 @@ import {format} from 'date-fns'; import Onyx from 'react-native-onyx'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {PolicyTags, ReportAction} from '@src/types/onyx'; +import type {PolicyTags, ReportAction} from '@src/types/onyx'; import * as CurrencyUtils from './CurrencyUtils'; import * as Localize from './Localize'; import * as PolicyUtils from './PolicyUtils'; import * as ReportUtils from './ReportUtils'; -import {ExpenseOriginalMessage} from './ReportUtils'; +import type {ExpenseOriginalMessage} from './ReportUtils'; let allPolicyTags: Record = {}; Onyx.connect({ diff --git a/src/libs/MoneyRequestUtils.ts b/src/libs/MoneyRequestUtils.ts index 209a82326f43..ff86070395b3 100644 --- a/src/libs/MoneyRequestUtils.ts +++ b/src/libs/MoneyRequestUtils.ts @@ -1,4 +1,4 @@ -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import CONST from '@src/CONST'; /** diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index fdef49d71eae..3751b9ebd29f 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -1,6 +1,7 @@ import React, {memo, useEffect, useRef} from 'react'; import {View} from 'react-native'; -import Onyx, {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import Onyx, { withOnyx} from 'react-native-onyx'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import KeyboardShortcut from '@libs/KeyboardShortcut'; @@ -29,7 +30,7 @@ import NAVIGATORS from '@src/NAVIGATORS'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; -import * as OnyxTypes from '@src/types/onyx'; +import type * as OnyxTypes from '@src/types/onyx'; import type {SelectedTimezone, Timezone} from '@src/types/onyx/PersonalDetails'; import createCustomStackNavigator from './createCustomStackNavigator'; import defaultScreenOptions from './defaultScreenOptions'; diff --git a/src/libs/Navigation/AppNavigator/ModalNavigatorScreenOptions.ts b/src/libs/Navigation/AppNavigator/ModalNavigatorScreenOptions.ts index 88ef57807010..4d6ef3c6df4a 100644 --- a/src/libs/Navigation/AppNavigator/ModalNavigatorScreenOptions.ts +++ b/src/libs/Navigation/AppNavigator/ModalNavigatorScreenOptions.ts @@ -1,5 +1,6 @@ -import {CardStyleInterpolators, StackNavigationOptions} from '@react-navigation/stack'; -import {ThemeStyles} from '@styles/index'; +import type { StackNavigationOptions} from '@react-navigation/stack'; +import {CardStyleInterpolators} from '@react-navigation/stack'; +import type {ThemeStyles} from '@styles/index'; /** * Modal stack navigator screen options generator function diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index 151a795a7e36..ad8c717f63a1 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -1,5 +1,6 @@ -import {ParamListBase} from '@react-navigation/routers'; -import {CardStyleInterpolators, createStackNavigator, StackNavigationOptions} from '@react-navigation/stack'; +import type {ParamListBase} from '@react-navigation/routers'; +import type { StackNavigationOptions} from '@react-navigation/stack'; +import {CardStyleInterpolators, createStackNavigator} from '@react-navigation/stack'; import React, {useMemo} from 'react'; import useThemeStyles from '@hooks/useThemeStyles'; import type { diff --git a/src/libs/Navigation/AppNavigator/Navigators/LeftModalNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/LeftModalNavigator.tsx index b7385c930e2c..8f5e811ef674 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/LeftModalNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/LeftModalNavigator.tsx @@ -1,4 +1,5 @@ -import {createStackNavigator, StackScreenProps} from '@react-navigation/stack'; +import type { StackScreenProps} from '@react-navigation/stack'; +import {createStackNavigator} from '@react-navigation/stack'; import React, {useMemo} from 'react'; import {View} from 'react-native'; import NoDropZone from '@components/DragAndDrop/NoDropZone'; @@ -6,8 +7,8 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import ModalNavigatorScreenOptions from '@libs/Navigation/AppNavigator/ModalNavigatorScreenOptions'; import * as ModalStackNavigators from '@libs/Navigation/AppNavigator/ModalStackNavigators'; -import {AuthScreensParamList, LeftModalNavigatorParamList} from '@libs/Navigation/types'; -import NAVIGATORS from '@src/NAVIGATORS'; +import type {AuthScreensParamList, LeftModalNavigatorParamList} from '@libs/Navigation/types'; +import type NAVIGATORS from '@src/NAVIGATORS'; import SCREENS from '@src/SCREENS'; import Overlay from './Overlay'; diff --git a/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx index d7c31bcae7d9..d7a4fc121495 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx @@ -1,4 +1,5 @@ -import {createStackNavigator, StackScreenProps} from '@react-navigation/stack'; +import type { StackScreenProps} from '@react-navigation/stack'; +import {createStackNavigator} from '@react-navigation/stack'; import React, {useMemo} from 'react'; import {View} from 'react-native'; import NoDropZone from '@components/DragAndDrop/NoDropZone'; @@ -7,7 +8,7 @@ import useWindowDimensions from '@hooks/useWindowDimensions'; import ModalNavigatorScreenOptions from '@libs/Navigation/AppNavigator/ModalNavigatorScreenOptions'; import * as ModalStackNavigators from '@libs/Navigation/AppNavigator/ModalStackNavigators'; import type {AuthScreensParamList, RightModalNavigatorParamList} from '@navigation/types'; -import NAVIGATORS from '@src/NAVIGATORS'; +import type NAVIGATORS from '@src/NAVIGATORS'; import SCREENS from '@src/SCREENS'; import Overlay from './Overlay'; diff --git a/src/libs/Navigation/AppNavigator/ReportScreenIDSetter.ts b/src/libs/Navigation/AppNavigator/ReportScreenIDSetter.ts index 7c310435f687..49002ce592bd 100644 --- a/src/libs/Navigation/AppNavigator/ReportScreenIDSetter.ts +++ b/src/libs/Navigation/AppNavigator/ReportScreenIDSetter.ts @@ -1,5 +1,6 @@ import {useEffect} from 'react'; -import {OnyxCollection, OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import usePermissions from '@hooks/usePermissions'; import * as ReportUtils from '@libs/ReportUtils'; import * as App from '@userActions/App'; diff --git a/src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx b/src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx index f3295aadb888..fd764cdb5861 100644 --- a/src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx +++ b/src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx @@ -1,8 +1,8 @@ -import {StackScreenProps} from '@react-navigation/stack'; +import type {StackScreenProps} from '@react-navigation/stack'; import React from 'react'; import type {CentralPaneNavigatorParamList} from '@navigation/types'; import ReportScreen from '@pages/home/ReportScreen'; -import SCREENS from '@src/SCREENS'; +import type SCREENS from '@src/SCREENS'; import ReportScreenIDSetter from './ReportScreenIDSetter'; type ReportScreenWrapperProps = StackScreenProps; diff --git a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts index 435ebc00362b..526541b40f54 100644 --- a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts +++ b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts @@ -1,5 +1,6 @@ -import {NavigationState, PartialState, RouterConfigOptions, StackNavigationState, StackRouter} from '@react-navigation/native'; -import {ParamListBase} from '@react-navigation/routers'; +import type {NavigationState, PartialState, RouterConfigOptions, StackNavigationState} from '@react-navigation/native'; +import { StackRouter} from '@react-navigation/native'; +import type {ParamListBase} from '@react-navigation/routers'; import getIsSmallScreenWidth from '@libs/getIsSmallScreenWidth'; import NAVIGATORS from '@src/NAVIGATORS'; import SCREENS from '@src/SCREENS'; diff --git a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/index.native.tsx b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/index.native.tsx index a55c74f3a479..d8e57c1aabf1 100644 --- a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/index.native.tsx +++ b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/index.native.tsx @@ -1,5 +1,7 @@ -import {createNavigatorFactory, ParamListBase, StackActionHelpers, StackNavigationState, useNavigationBuilder} from '@react-navigation/native'; -import {StackNavigationEventMap, StackNavigationOptions, StackView} from '@react-navigation/stack'; +import type { ParamListBase, StackActionHelpers, StackNavigationState} from '@react-navigation/native'; +import {createNavigatorFactory, useNavigationBuilder} from '@react-navigation/native'; +import type {StackNavigationEventMap, StackNavigationOptions} from '@react-navigation/stack'; +import { StackView} from '@react-navigation/stack'; import React, {useRef} from 'react'; import useWindowDimensions from '@hooks/useWindowDimensions'; import CustomRouter from './CustomRouter'; diff --git a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/index.tsx b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/index.tsx index dd2e548064c4..02fe493b78f1 100644 --- a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/index.tsx +++ b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/index.tsx @@ -1,5 +1,7 @@ -import {createNavigatorFactory, ParamListBase, StackActionHelpers, StackNavigationState, useNavigationBuilder} from '@react-navigation/native'; -import {StackNavigationEventMap, StackNavigationOptions, StackView} from '@react-navigation/stack'; +import type { ParamListBase, StackActionHelpers, StackNavigationState} from '@react-navigation/native'; +import {createNavigatorFactory, useNavigationBuilder} from '@react-navigation/native'; +import type {StackNavigationEventMap, StackNavigationOptions} from '@react-navigation/stack'; +import { StackView} from '@react-navigation/stack'; import React, {useMemo, useRef} from 'react'; import useWindowDimensions from '@hooks/useWindowDimensions'; import NAVIGATORS from '@src/NAVIGATORS'; diff --git a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/types.ts b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/types.ts index 707a0ff4498d..09d35e2a1680 100644 --- a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/types.ts +++ b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/types.ts @@ -1,5 +1,5 @@ -import {DefaultNavigatorOptions, ParamListBase, StackNavigationState, StackRouterOptions} from '@react-navigation/native'; -import {StackNavigationEventMap, StackNavigationOptions} from '@react-navigation/stack'; +import type {DefaultNavigatorOptions, ParamListBase, StackNavigationState, StackRouterOptions} from '@react-navigation/native'; +import type {StackNavigationEventMap, StackNavigationOptions} from '@react-navigation/stack'; type ResponsiveStackNavigatorConfig = { isSmallScreenWidth: boolean; diff --git a/src/libs/Navigation/AppNavigator/defaultScreenOptions.ts b/src/libs/Navigation/AppNavigator/defaultScreenOptions.ts index 65a6bd052742..4015c43c679e 100644 --- a/src/libs/Navigation/AppNavigator/defaultScreenOptions.ts +++ b/src/libs/Navigation/AppNavigator/defaultScreenOptions.ts @@ -1,4 +1,4 @@ -import {StackNavigationOptions} from '@react-navigation/stack'; +import type {StackNavigationOptions} from '@react-navigation/stack'; const defaultScreenOptions: StackNavigationOptions = { cardStyle: { diff --git a/src/libs/Navigation/AppNavigator/getRootNavigatorScreenOptions.ts b/src/libs/Navigation/AppNavigator/getRootNavigatorScreenOptions.ts index c80ae9914347..1c0f06283226 100644 --- a/src/libs/Navigation/AppNavigator/getRootNavigatorScreenOptions.ts +++ b/src/libs/Navigation/AppNavigator/getRootNavigatorScreenOptions.ts @@ -1,5 +1,5 @@ -import {StackCardInterpolationProps, StackNavigationOptions} from '@react-navigation/stack'; -import {ThemeStyles} from '@styles/index'; +import type {StackCardInterpolationProps, StackNavigationOptions} from '@react-navigation/stack'; +import type {ThemeStyles} from '@styles/index'; import getNavigationModalCardStyle from '@styles/utils/getNavigationModalCardStyles'; import variables from '@styles/variables'; import CONFIG from '@src/CONFIG'; diff --git a/src/libs/Navigation/FreezeWrapper.tsx b/src/libs/Navigation/FreezeWrapper.tsx index df3f117c9a2e..570553d38017 100644 --- a/src/libs/Navigation/FreezeWrapper.tsx +++ b/src/libs/Navigation/FreezeWrapper.tsx @@ -2,7 +2,7 @@ import {useIsFocused, useNavigation, useRoute} from '@react-navigation/native'; import React, {useEffect, useRef, useState} from 'react'; import {Freeze} from 'react-freeze'; import {InteractionManager} from 'react-native'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type FreezeWrapperProps = ChildrenProps & { /** Prop to disable freeze */ diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index 284e5703635a..509e4cd93d85 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -1,9 +1,11 @@ import {findFocusedRoute} from '@react-navigation/core'; -import {CommonActions, EventArg, getPathFromState, NavigationContainerEventMap, NavigationState, PartialState, StackActions} from '@react-navigation/native'; +import type { EventArg, NavigationContainerEventMap, NavigationState, PartialState} from '@react-navigation/native'; +import {CommonActions, getPathFromState, StackActions} from '@react-navigation/native'; import Log from '@libs/Log'; import CONST from '@src/CONST'; import NAVIGATORS from '@src/NAVIGATORS'; -import ROUTES, {Route} from '@src/ROUTES'; +import type {Route} from '@src/ROUTES'; +import ROUTES from '@src/ROUTES'; import {PROTECTED_SCREENS} from '@src/SCREENS'; import originalDismissModal from './dismissModal'; import originalGetTopmostReportActionId from './getTopmostReportActionID'; @@ -11,7 +13,7 @@ import originalGetTopmostReportId from './getTopmostReportId'; import linkingConfig from './linkingConfig'; import linkTo from './linkTo'; import navigationRef from './navigationRef'; -import {StateOrRoute} from './types'; +import type {StateOrRoute} from './types'; let resolveNavigationIsReadyPromise: () => void; const navigationIsReadyPromise = new Promise((resolve) => { diff --git a/src/libs/Navigation/NavigationRoot.tsx b/src/libs/Navigation/NavigationRoot.tsx index 48523162ba2e..a2abe02d3102 100644 --- a/src/libs/Navigation/NavigationRoot.tsx +++ b/src/libs/Navigation/NavigationRoot.tsx @@ -1,4 +1,5 @@ -import {DefaultTheme, getPathFromState, NavigationContainer, NavigationState} from '@react-navigation/native'; +import type { NavigationState} from '@react-navigation/native'; +import {DefaultTheme, getPathFromState, NavigationContainer} from '@react-navigation/native'; import React, {useEffect, useMemo, useRef} from 'react'; import useCurrentReportID from '@hooks/useCurrentReportID'; import useFlipper from '@hooks/useFlipper'; diff --git a/src/libs/Navigation/OnyxTabNavigator.tsx b/src/libs/Navigation/OnyxTabNavigator.tsx index ef41269045c6..c7bfc7396295 100644 --- a/src/libs/Navigation/OnyxTabNavigator.tsx +++ b/src/libs/Navigation/OnyxTabNavigator.tsx @@ -1,11 +1,12 @@ -import {createMaterialTopTabNavigator, MaterialTopTabNavigationEventMap} from '@react-navigation/material-top-tabs'; -import {EventMapCore, NavigationState, ScreenListeners} from '@react-navigation/native'; +import type { MaterialTopTabNavigationEventMap} from '@react-navigation/material-top-tabs'; +import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs'; +import type {EventMapCore, NavigationState, ScreenListeners} from '@react-navigation/native'; import React from 'react'; import {withOnyx} from 'react-native-onyx'; -import {OnyxEntry} from 'react-native-onyx/lib/types'; +import type {OnyxEntry} from 'react-native-onyx/lib/types'; import Tab from '@userActions/Tab'; import ONYXKEYS from '@src/ONYXKEYS'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type OnyxTabNavigatorOnyxProps = { selectedTab: OnyxEntry; diff --git a/src/libs/Navigation/currentUrl/index.native.ts b/src/libs/Navigation/currentUrl/index.native.ts index 0c12ab8b4883..3f63391ab425 100644 --- a/src/libs/Navigation/currentUrl/index.native.ts +++ b/src/libs/Navigation/currentUrl/index.native.ts @@ -1,4 +1,4 @@ -import GetCurrentUrl from './types'; +import type GetCurrentUrl from './types'; const getCurrentUrl: GetCurrentUrl = () => ''; diff --git a/src/libs/Navigation/currentUrl/index.ts b/src/libs/Navigation/currentUrl/index.ts index f9afc6e15775..ecf3f6f17a9b 100644 --- a/src/libs/Navigation/currentUrl/index.ts +++ b/src/libs/Navigation/currentUrl/index.ts @@ -1,4 +1,4 @@ -import GetCurrentUrl from './types'; +import type GetCurrentUrl from './types'; const getCurrentUrl: GetCurrentUrl = () => window.location.href; diff --git a/src/libs/Navigation/dismissModal.ts b/src/libs/Navigation/dismissModal.ts index 37b4c6d9b9e6..c262def49738 100644 --- a/src/libs/Navigation/dismissModal.ts +++ b/src/libs/Navigation/dismissModal.ts @@ -1,5 +1,6 @@ import {getActionFromState} from '@react-navigation/core'; -import {NavigationContainerRef, StackActions} from '@react-navigation/native'; +import type {NavigationContainerRef} from '@react-navigation/native'; +import { StackActions} from '@react-navigation/native'; import {findLastIndex} from 'lodash'; import Log from '@libs/Log'; import NAVIGATORS from '@src/NAVIGATORS'; @@ -8,7 +9,7 @@ import SCREENS from '@src/SCREENS'; import getStateFromPath from './getStateFromPath'; import getTopmostReportId from './getTopmostReportId'; import linkingConfig from './linkingConfig'; -import {RootStackParamList, StackNavigationAction} from './types'; +import type {RootStackParamList, StackNavigationAction} from './types'; // This function is in a separate file than Navigation.js to avoid cyclic dependency. diff --git a/src/libs/Navigation/getStateFromPath.ts b/src/libs/Navigation/getStateFromPath.ts index 3a53b02fc3c7..f0c272a678e3 100644 --- a/src/libs/Navigation/getStateFromPath.ts +++ b/src/libs/Navigation/getStateFromPath.ts @@ -1,5 +1,6 @@ -import {NavigationState, PartialState, getStateFromPath as RNGetStateFromPath} from '@react-navigation/native'; -import {Route} from '@src/ROUTES'; +import type {NavigationState, PartialState} from '@react-navigation/native'; +import { getStateFromPath as RNGetStateFromPath} from '@react-navigation/native'; +import type {Route} from '@src/ROUTES'; import linkingConfig from './linkingConfig'; /** diff --git a/src/libs/Navigation/getTopmostReportActionID.ts b/src/libs/Navigation/getTopmostReportActionID.ts index 15ab1efef704..f9931343b2eb 100644 --- a/src/libs/Navigation/getTopmostReportActionID.ts +++ b/src/libs/Navigation/getTopmostReportActionID.ts @@ -1,7 +1,7 @@ -import {NavigationState, PartialState} from '@react-navigation/native'; +import type {NavigationState, PartialState} from '@react-navigation/native'; import NAVIGATORS from '@src/NAVIGATORS'; import SCREENS from '@src/SCREENS'; -import {RootStackParamList} from './types'; +import type {RootStackParamList} from './types'; // This function is in a separate file than Navigation.js to avoid cyclic dependency. diff --git a/src/libs/Navigation/getTopmostReportId.ts b/src/libs/Navigation/getTopmostReportId.ts index 3342761e7ccf..2c3b74e9f52f 100644 --- a/src/libs/Navigation/getTopmostReportId.ts +++ b/src/libs/Navigation/getTopmostReportId.ts @@ -1,7 +1,7 @@ -import {NavigationState, PartialState} from '@react-navigation/native'; +import type {NavigationState, PartialState} from '@react-navigation/native'; import NAVIGATORS from '@src/NAVIGATORS'; import SCREENS from '@src/SCREENS'; -import {RootStackParamList} from './types'; +import type {RootStackParamList} from './types'; // This function is in a separate file than Navigation.js to avoid cyclic dependency. diff --git a/src/libs/Navigation/linkTo.ts b/src/libs/Navigation/linkTo.ts index 86558765a6e6..b7746108ac93 100644 --- a/src/libs/Navigation/linkTo.ts +++ b/src/libs/Navigation/linkTo.ts @@ -1,14 +1,14 @@ import {getActionFromState} from '@react-navigation/core'; -import {NavigationAction, NavigationContainerRef, NavigationState, PartialState} from '@react-navigation/native'; -import {Writable} from 'type-fest'; +import type {NavigationAction, NavigationContainerRef, NavigationState, PartialState} from '@react-navigation/native'; +import type {Writable} from 'type-fest'; import CONST from '@src/CONST'; import NAVIGATORS from '@src/NAVIGATORS'; -import {Route} from '@src/ROUTES'; +import type {Route} from '@src/ROUTES'; import dismissModal from './dismissModal'; import getStateFromPath from './getStateFromPath'; import getTopmostReportId from './getTopmostReportId'; import linkingConfig from './linkingConfig'; -import {NavigationRoot, RootStackParamList, StackNavigationAction} from './types'; +import type {NavigationRoot, RootStackParamList, StackNavigationAction} from './types'; type ActionPayloadParams = { screen?: string; diff --git a/src/libs/Navigation/linkingConfig.ts b/src/libs/Navigation/linkingConfig.ts index 5f7ecd10cc8c..3b2350afcc43 100644 --- a/src/libs/Navigation/linkingConfig.ts +++ b/src/libs/Navigation/linkingConfig.ts @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import {LinkingOptions} from '@react-navigation/native'; +import type {LinkingOptions} from '@react-navigation/native'; import CONST from '@src/CONST'; import NAVIGATORS from '@src/NAVIGATORS'; import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; -import {RootStackParamList} from './types'; +import type {RootStackParamList} from './types'; const linkingConfig: LinkingOptions = { prefixes: [ diff --git a/src/libs/Navigation/navigationRef.ts b/src/libs/Navigation/navigationRef.ts index 032d9f9f3d9a..17742e5d0937 100644 --- a/src/libs/Navigation/navigationRef.ts +++ b/src/libs/Navigation/navigationRef.ts @@ -1,5 +1,5 @@ import {createNavigationContainerRef} from '@react-navigation/native'; -import {NavigationRef} from './types'; +import type {NavigationRef} from './types'; const navigationRef: NavigationRef = createNavigationContainerRef(); diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 4823b44b89cb..505bc82180f4 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import {CommonActions, NavigationContainerRefWithCurrent, NavigationHelpers, NavigationState, NavigatorScreenParams, PartialRoute, Route} from '@react-navigation/native'; -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import NAVIGATORS from '@src/NAVIGATORS'; -import SCREENS from '@src/SCREENS'; +import type {CommonActions, NavigationContainerRefWithCurrent, NavigationHelpers, NavigationState, NavigatorScreenParams, PartialRoute, Route} from '@react-navigation/native'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type NAVIGATORS from '@src/NAVIGATORS'; +import type SCREENS from '@src/SCREENS'; type NavigationRef = NavigationContainerRefWithCurrent; diff --git a/src/libs/Network/MainQueue.ts b/src/libs/Network/MainQueue.ts index 3ae0d44680a4..b3d6fbea94ab 100644 --- a/src/libs/Network/MainQueue.ts +++ b/src/libs/Network/MainQueue.ts @@ -1,5 +1,5 @@ import * as Request from '@libs/Request'; -import OnyxRequest from '@src/types/onyx/Request'; +import type OnyxRequest from '@src/types/onyx/Request'; import * as NetworkStore from './NetworkStore'; import * as SequentialQueue from './SequentialQueue'; diff --git a/src/libs/Network/NetworkStore.ts b/src/libs/Network/NetworkStore.ts index 52e4147f1b3c..59a52dfd01c4 100644 --- a/src/libs/Network/NetworkStore.ts +++ b/src/libs/Network/NetworkStore.ts @@ -1,6 +1,6 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; -import Credentials from '@src/types/onyx/Credentials'; +import type Credentials from '@src/types/onyx/Credentials'; let credentials: Credentials | null = null; let authToken: string | null = null; diff --git a/src/libs/Network/SequentialQueue.ts b/src/libs/Network/SequentialQueue.ts index 5da032baaf45..f9a7cd0a996b 100644 --- a/src/libs/Network/SequentialQueue.ts +++ b/src/libs/Network/SequentialQueue.ts @@ -6,7 +6,7 @@ import * as PersistedRequests from '@userActions/PersistedRequests'; import * as QueuedOnyxUpdates from '@userActions/QueuedOnyxUpdates'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import OnyxRequest from '@src/types/onyx/Request'; +import type OnyxRequest from '@src/types/onyx/Request'; import * as NetworkStore from './NetworkStore'; let resolveIsReadyPromise: ((args?: unknown[]) => void) | undefined; diff --git a/src/libs/Network/index.ts b/src/libs/Network/index.ts index 4ccb8df01163..2adb4a2da4c2 100644 --- a/src/libs/Network/index.ts +++ b/src/libs/Network/index.ts @@ -1,7 +1,7 @@ import * as ActiveClientManager from '@libs/ActiveClientManager'; import CONST from '@src/CONST'; -import {Request} from '@src/types/onyx'; -import Response from '@src/types/onyx/Response'; +import type {Request} from '@src/types/onyx'; +import type Response from '@src/types/onyx/Response'; import pkg from '../../../package.json'; import * as MainQueue from './MainQueue'; import * as SequentialQueue from './SequentialQueue'; diff --git a/src/libs/Notification/LocalNotification/BrowserNotifications.ts b/src/libs/Notification/LocalNotification/BrowserNotifications.ts index 6bd6c73982eb..e65bd3d0021f 100644 --- a/src/libs/Notification/LocalNotification/BrowserNotifications.ts +++ b/src/libs/Notification/LocalNotification/BrowserNotifications.ts @@ -1,13 +1,13 @@ // Web and desktop implementation only. Do not import for direct use. Use LocalNotification. import Str from 'expensify-common/lib/str'; -import {ImageSourcePropType} from 'react-native'; +import type {ImageSourcePropType} from 'react-native'; import EXPENSIFY_ICON_URL from '@assets/images/expensify-logo-round-clearspace.png'; import ModifiedExpenseMessage from '@libs/ModifiedExpenseMessage'; import * as ReportUtils from '@libs/ReportUtils'; import * as AppUpdate from '@userActions/AppUpdate'; -import {Report, ReportAction} from '@src/types/onyx'; +import type {Report, ReportAction} from '@src/types/onyx'; import focusApp from './focusApp'; -import {LocalNotificationClickHandler, LocalNotificationData} from './types'; +import type {LocalNotificationClickHandler, LocalNotificationData} from './types'; const notificationCache: Record = {}; diff --git a/src/libs/Notification/LocalNotification/focusApp/index.desktop.ts b/src/libs/Notification/LocalNotification/focusApp/index.desktop.ts index 2b6f01457f44..595bd273c098 100644 --- a/src/libs/Notification/LocalNotification/focusApp/index.desktop.ts +++ b/src/libs/Notification/LocalNotification/focusApp/index.desktop.ts @@ -1,5 +1,5 @@ import ELECTRON_EVENTS from '../../../../../desktop/ELECTRON_EVENTS'; -import FocusApp from './types'; +import type FocusApp from './types'; const focusApp: FocusApp = () => { window.electron.send(ELECTRON_EVENTS.REQUEST_FOCUS_APP); diff --git a/src/libs/Notification/LocalNotification/focusApp/index.ts b/src/libs/Notification/LocalNotification/focusApp/index.ts index 8504fde1bcb2..c5c069f9ddf6 100644 --- a/src/libs/Notification/LocalNotification/focusApp/index.ts +++ b/src/libs/Notification/LocalNotification/focusApp/index.ts @@ -1,4 +1,4 @@ -import FocusApp from './types'; +import type FocusApp from './types'; // On web this is up to the browser that shows the notifications const focusApp: FocusApp = () => {}; diff --git a/src/libs/Notification/LocalNotification/index.desktop.ts b/src/libs/Notification/LocalNotification/index.desktop.ts index e2aa5fcf2830..4baf1abee139 100644 --- a/src/libs/Notification/LocalNotification/index.desktop.ts +++ b/src/libs/Notification/LocalNotification/index.desktop.ts @@ -1,6 +1,6 @@ -import {Report, ReportAction} from '@src/types/onyx'; +import type {Report, ReportAction} from '@src/types/onyx'; import BrowserNotifications from './BrowserNotifications'; -import {LocalNotificationClickHandler, LocalNotificationModule} from './types'; +import type {LocalNotificationClickHandler, LocalNotificationModule} from './types'; function showCommentNotification(report: Report, reportAction: ReportAction, onClick: LocalNotificationClickHandler) { BrowserNotifications.pushReportCommentNotification(report, reportAction, onClick); diff --git a/src/libs/Notification/LocalNotification/index.native.ts b/src/libs/Notification/LocalNotification/index.native.ts index 2b4e54286c06..49868d8515c9 100644 --- a/src/libs/Notification/LocalNotification/index.native.ts +++ b/src/libs/Notification/LocalNotification/index.native.ts @@ -1,4 +1,4 @@ -import {LocalNotificationModule} from './types'; +import type {LocalNotificationModule} from './types'; // Local Notifications are not currently supported on mobile so we'll just no-op here. const LocalNotification: LocalNotificationModule = { diff --git a/src/libs/Notification/LocalNotification/index.ts b/src/libs/Notification/LocalNotification/index.ts index 469e5f9bc08b..2141000d807d 100644 --- a/src/libs/Notification/LocalNotification/index.ts +++ b/src/libs/Notification/LocalNotification/index.ts @@ -1,6 +1,6 @@ -import {Report, ReportAction} from '@src/types/onyx'; +import type {Report, ReportAction} from '@src/types/onyx'; import BrowserNotifications from './BrowserNotifications'; -import {LocalNotificationClickHandler, LocalNotificationModule} from './types'; +import type {LocalNotificationClickHandler, LocalNotificationModule} from './types'; function showCommentNotification(report: Report, reportAction: ReportAction, onClick: LocalNotificationClickHandler) { BrowserNotifications.pushReportCommentNotification(report, reportAction, onClick, true); diff --git a/src/libs/Notification/LocalNotification/types.ts b/src/libs/Notification/LocalNotification/types.ts index d8441fb1f4bb..dc9607743dfb 100644 --- a/src/libs/Notification/LocalNotification/types.ts +++ b/src/libs/Notification/LocalNotification/types.ts @@ -1,5 +1,5 @@ -import ClearReportNotifications from '@libs/Notification/clearReportNotifications/types'; -import {Report, ReportAction} from '@src/types/onyx'; +import type ClearReportNotifications from '@libs/Notification/clearReportNotifications/types'; +import type {Report, ReportAction} from '@src/types/onyx'; type LocalNotificationClickHandler = () => void; diff --git a/src/libs/Notification/PushNotification/ForegroundNotifications/index.android.ts b/src/libs/Notification/PushNotification/ForegroundNotifications/index.android.ts index 5eef0b44a7d1..d7099c4c3d6b 100644 --- a/src/libs/Notification/PushNotification/ForegroundNotifications/index.android.ts +++ b/src/libs/Notification/PushNotification/ForegroundNotifications/index.android.ts @@ -1,6 +1,6 @@ import Airship from '@ua/react-native-airship'; import shouldShowPushNotification from '@libs/Notification/PushNotification/shouldShowPushNotification'; -import ForegroundNotificationsModule from './types'; +import type ForegroundNotificationsModule from './types'; function configureForegroundNotifications() { Airship.push.android.setForegroundDisplayPredicate((pushPayload) => Promise.resolve(shouldShowPushNotification(pushPayload))); diff --git a/src/libs/Notification/PushNotification/ForegroundNotifications/index.ios.ts b/src/libs/Notification/PushNotification/ForegroundNotifications/index.ios.ts index e5e5665d1ea2..e5004ae2bf0b 100644 --- a/src/libs/Notification/PushNotification/ForegroundNotifications/index.ios.ts +++ b/src/libs/Notification/PushNotification/ForegroundNotifications/index.ios.ts @@ -1,6 +1,6 @@ import Airship, {iOS} from '@ua/react-native-airship'; import shouldShowPushNotification from '@libs/Notification/PushNotification/shouldShowPushNotification'; -import ForegroundNotificationsModule from './types'; +import type ForegroundNotificationsModule from './types'; function configureForegroundNotifications() { // Set our default iOS foreground presentation to be loud with a banner diff --git a/src/libs/Notification/PushNotification/ForegroundNotifications/index.ts b/src/libs/Notification/PushNotification/ForegroundNotifications/index.ts index 25baa34099b6..e397c2a570ee 100644 --- a/src/libs/Notification/PushNotification/ForegroundNotifications/index.ts +++ b/src/libs/Notification/PushNotification/ForegroundNotifications/index.ts @@ -1,4 +1,4 @@ -import ForegroundNotificationsModule from './types'; +import type ForegroundNotificationsModule from './types'; /** * Configures notification handling while in the foreground on iOS and Android. This is a no-op on other platforms. diff --git a/src/libs/Notification/PushNotification/NotificationType.ts b/src/libs/Notification/PushNotification/NotificationType.ts index 91eec6895394..d6ec246eddf7 100644 --- a/src/libs/Notification/PushNotification/NotificationType.ts +++ b/src/libs/Notification/PushNotification/NotificationType.ts @@ -1,4 +1,4 @@ -import {OnyxServerUpdate} from '@src/types/onyx/OnyxUpdatesFromServer'; +import type {OnyxServerUpdate} from '@src/types/onyx/OnyxUpdatesFromServer'; const NotificationType = { REPORT_COMMENT: 'reportComment', diff --git a/src/libs/Notification/PushNotification/backgroundRefresh/index.android.ts b/src/libs/Notification/PushNotification/backgroundRefresh/index.android.ts index 2b3c6ebf21b4..ff63f5aefa2b 100644 --- a/src/libs/Notification/PushNotification/backgroundRefresh/index.android.ts +++ b/src/libs/Notification/PushNotification/backgroundRefresh/index.android.ts @@ -4,7 +4,7 @@ import Visibility from '@libs/Visibility'; import * as App from '@userActions/App'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import BackgroundRefresh from './types'; +import type BackgroundRefresh from './types'; function getLastOnyxUpdateID(): Promise { return new Promise((resolve) => { diff --git a/src/libs/Notification/PushNotification/backgroundRefresh/index.ts b/src/libs/Notification/PushNotification/backgroundRefresh/index.ts index c7f47a532d89..54fd14e219a9 100644 --- a/src/libs/Notification/PushNotification/backgroundRefresh/index.ts +++ b/src/libs/Notification/PushNotification/backgroundRefresh/index.ts @@ -1,4 +1,4 @@ -import BackgroundRefresh from './types'; +import type BackgroundRefresh from './types'; /** * Runs our reconnectApp action if the app is in the background. diff --git a/src/libs/Notification/PushNotification/index.native.ts b/src/libs/Notification/PushNotification/index.native.ts index 7b2571eea368..b172c4d4f7ac 100644 --- a/src/libs/Notification/PushNotification/index.native.ts +++ b/src/libs/Notification/PushNotification/index.native.ts @@ -1,11 +1,14 @@ -import Airship, {EventType, PushPayload} from '@ua/react-native-airship'; +import type { PushPayload} from '@ua/react-native-airship'; +import Airship, {EventType} from '@ua/react-native-airship'; import Onyx from 'react-native-onyx'; import Log from '@libs/Log'; import * as PushNotificationActions from '@userActions/PushNotification'; import ONYXKEYS from '@src/ONYXKEYS'; import ForegroundNotifications from './ForegroundNotifications'; -import NotificationType, {NotificationData} from './NotificationType'; -import PushNotificationType, {ClearNotifications, Deregister, Init, OnReceived, OnSelected, Register} from './types'; +import type {NotificationData} from './NotificationType'; +import NotificationType from './NotificationType'; +import type {ClearNotifications, Deregister, Init, OnReceived, OnSelected, Register} from './types'; +import type PushNotificationType from './types'; type NotificationEventActionCallback = (data: NotificationData) => void; diff --git a/src/libs/Notification/PushNotification/index.ts b/src/libs/Notification/PushNotification/index.ts index 1e5499d1fe7d..66f3d91af7c6 100644 --- a/src/libs/Notification/PushNotification/index.ts +++ b/src/libs/Notification/PushNotification/index.ts @@ -1,5 +1,5 @@ import NotificationType from './NotificationType'; -import PushNotificationType from './types'; +import type PushNotificationType from './types'; // Push notifications are only supported on mobile, so we'll just noop here const PushNotification: PushNotificationType = { diff --git a/src/libs/Notification/PushNotification/shouldShowPushNotification.ts b/src/libs/Notification/PushNotification/shouldShowPushNotification.ts index 46f99fcc9271..89aa53b5634a 100644 --- a/src/libs/Notification/PushNotification/shouldShowPushNotification.ts +++ b/src/libs/Notification/PushNotification/shouldShowPushNotification.ts @@ -1,8 +1,8 @@ -import {PushPayload} from '@ua/react-native-airship'; +import type {PushPayload} from '@ua/react-native-airship'; import Log from '@libs/Log'; import * as ReportActionUtils from '@libs/ReportActionsUtils'; import * as Report from '@userActions/Report'; -import {NotificationData} from './NotificationType'; +import type {NotificationData} from './NotificationType'; /** * Returns whether the given Airship notification should be shown depending on the current state of the app diff --git a/src/libs/Notification/PushNotification/types.ts b/src/libs/Notification/PushNotification/types.ts index f72ee1af887a..4399c10b4a95 100644 --- a/src/libs/Notification/PushNotification/types.ts +++ b/src/libs/Notification/PushNotification/types.ts @@ -1,5 +1,6 @@ -import {ValueOf} from 'type-fest'; -import NotificationType, {NotificationDataMap} from './NotificationType'; +import type {ValueOf} from 'type-fest'; +import type {NotificationDataMap} from './NotificationType'; +import type NotificationType from './NotificationType'; type Init = () => void; type Register = (notificationID: string | number) => void; diff --git a/src/libs/Notification/clearReportNotifications/index.android.ts b/src/libs/Notification/clearReportNotifications/index.android.ts index 8f0e8cc2ea69..8c2a44ba29d3 100644 --- a/src/libs/Notification/clearReportNotifications/index.android.ts +++ b/src/libs/Notification/clearReportNotifications/index.android.ts @@ -1,4 +1,4 @@ -import ClearReportNotifications from './types'; +import type ClearReportNotifications from './types'; /** * This is a temporary fix for issues with our Notification Cache not being cleared in Android. diff --git a/src/libs/Notification/clearReportNotifications/index.ios.ts b/src/libs/Notification/clearReportNotifications/index.ios.ts index 74b2c7faa50f..d9a30320a02e 100644 --- a/src/libs/Notification/clearReportNotifications/index.ios.ts +++ b/src/libs/Notification/clearReportNotifications/index.ios.ts @@ -1,8 +1,9 @@ -import Airship, {PushPayload} from '@ua/react-native-airship'; +import type {PushPayload} from '@ua/react-native-airship'; +import Airship from '@ua/react-native-airship'; import Log from '@libs/Log'; -import {NotificationData} from '@libs/Notification/PushNotification/NotificationType'; +import type {NotificationData} from '@libs/Notification/PushNotification/NotificationType'; import CONST from '@src/CONST'; -import ClearReportNotifications from './types'; +import type ClearReportNotifications from './types'; const parseNotificationAndReportIDs = (pushPayload: PushPayload) => { let payload = pushPayload.extras.payload; diff --git a/src/libs/Notification/clearReportNotifications/index.ts b/src/libs/Notification/clearReportNotifications/index.ts index fa8ceac6b05d..a154bf89d764 100644 --- a/src/libs/Notification/clearReportNotifications/index.ts +++ b/src/libs/Notification/clearReportNotifications/index.ts @@ -1,5 +1,5 @@ import LocalNotification from '@libs/Notification/LocalNotification'; -import ClearReportNotifications from './types'; +import type ClearReportNotifications from './types'; const clearReportNotifications: ClearReportNotifications = LocalNotification.clearReportNotifications; export default clearReportNotifications; diff --git a/src/libs/NumberFormatUtils.ts b/src/libs/NumberFormatUtils.ts index b077f0ce0862..bf42e25cbb48 100644 --- a/src/libs/NumberFormatUtils.ts +++ b/src/libs/NumberFormatUtils.ts @@ -1,5 +1,5 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; function format(locale: ValueOf, number: number, options?: Intl.NumberFormatOptions): string { return new Intl.NumberFormat(locale, options).format(number); diff --git a/src/libs/OnyxSelectors/reportWithoutHasDraftSelector.ts b/src/libs/OnyxSelectors/reportWithoutHasDraftSelector.ts index 9fd89cfdf146..1062aa4b45c6 100644 --- a/src/libs/OnyxSelectors/reportWithoutHasDraftSelector.ts +++ b/src/libs/OnyxSelectors/reportWithoutHasDraftSelector.ts @@ -1,4 +1,4 @@ -import {OnyxKeyValue} from '@src/ONYXKEYS'; +import type {OnyxKeyValue} from '@src/ONYXKEYS'; export default function reportWithoutHasDraftSelector(report: OnyxKeyValue<'report_'>) { if (!report) { diff --git a/src/libs/PaymentUtils.ts b/src/libs/PaymentUtils.ts index e41b3295a2c5..dd35d0df5cfb 100644 --- a/src/libs/PaymentUtils.ts +++ b/src/libs/PaymentUtils.ts @@ -1,9 +1,9 @@ import getBankIcon from '@components/Icon/BankIcons'; -import {type ThemeStyles} from '@styles/index'; +import type {ThemeStyles} from '@styles/index'; import CONST from '@src/CONST'; -import BankAccount from '@src/types/onyx/BankAccount'; -import Fund from '@src/types/onyx/Fund'; -import PaymentMethod from '@src/types/onyx/PaymentMethod'; +import type BankAccount from '@src/types/onyx/BankAccount'; +import type Fund from '@src/types/onyx/Fund'; +import type PaymentMethod from '@src/types/onyx/PaymentMethod'; import * as Localize from './Localize'; import BankAccountModel from './models/BankAccount'; diff --git a/src/libs/Performance.tsx b/src/libs/Performance.tsx index 03d701e50075..a2667955326d 100644 --- a/src/libs/Performance.tsx +++ b/src/libs/Performance.tsx @@ -3,8 +3,8 @@ import isObject from 'lodash/isObject'; import lodashTransform from 'lodash/transform'; import React, {forwardRef, Profiler} from 'react'; import {Alert, InteractionManager} from 'react-native'; -import {PerformanceEntry, PerformanceMark, PerformanceMeasure, Performance as RNPerformance} from 'react-native-performance'; -import {PerformanceObserverEntryList} from 'react-native-performance/lib/typescript/performance-observer'; +import type {PerformanceEntry, PerformanceMark, PerformanceMeasure, Performance as RNPerformance} from 'react-native-performance'; +import type {PerformanceObserverEntryList} from 'react-native-performance/lib/typescript/performance-observer'; import CONST from '@src/CONST'; import isE2ETestSession from './E2E/isE2ETestSession'; import getComponentDisplayName from './getComponentDisplayName'; diff --git a/src/libs/Permissions.ts b/src/libs/Permissions.ts index 9cde613ebb5a..85e64651980e 100644 --- a/src/libs/Permissions.ts +++ b/src/libs/Permissions.ts @@ -1,6 +1,6 @@ -import {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; import CONST from '@src/CONST'; -import Beta from '@src/types/onyx/Beta'; +import type Beta from '@src/types/onyx/Beta'; function canUseAllBetas(betas: OnyxEntry): boolean { return !!betas?.includes(CONST.BETAS.ALL); diff --git a/src/libs/PersonalDetailsUtils.ts b/src/libs/PersonalDetailsUtils.ts index 3eb752bac983..2e8705a54ad8 100644 --- a/src/libs/PersonalDetailsUtils.ts +++ b/src/libs/PersonalDetailsUtils.ts @@ -1,8 +1,9 @@ -import Onyx, {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import * as OnyxTypes from '@src/types/onyx'; -import {PersonalDetails, PersonalDetailsList} from '@src/types/onyx'; +import type * as OnyxTypes from '@src/types/onyx'; +import type {PersonalDetails, PersonalDetailsList} from '@src/types/onyx'; import * as LocalePhoneNumber from './LocalePhoneNumber'; import * as Localize from './Localize'; import * as UserUtils from './UserUtils'; diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts index bc7ddb14b53e..57e3dcb94cb5 100644 --- a/src/libs/PolicyUtils.ts +++ b/src/libs/PolicyUtils.ts @@ -1,9 +1,10 @@ import Str from 'expensify-common/lib/str'; -import {OnyxCollection, OnyxEntry} from 'react-native-onyx'; +import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {PersonalDetailsList, Policy, PolicyMembers, PolicyTag, PolicyTags} from '@src/types/onyx'; -import {EmptyObject, isEmptyObject} from '@src/types/utils/EmptyObject'; +import type {PersonalDetailsList, Policy, PolicyMembers, PolicyTag, PolicyTags} from '@src/types/onyx'; +import type {EmptyObject} from '@src/types/utils/EmptyObject'; +import { isEmptyObject} from '@src/types/utils/EmptyObject'; type MemberEmailsToAccountIDs = Record; type UnitRate = {rate: number}; diff --git a/src/libs/Pusher/library/index.native.ts b/src/libs/Pusher/library/index.native.ts index f50834366515..4f11506f10fa 100644 --- a/src/libs/Pusher/library/index.native.ts +++ b/src/libs/Pusher/library/index.native.ts @@ -3,7 +3,7 @@ * @see: https://github.com/pusher/pusher-js */ import PusherImplementation from 'pusher-js/react-native'; -import Pusher from './types'; +import type Pusher from './types'; const PusherNative: Pusher = PusherImplementation; diff --git a/src/libs/Pusher/library/types.ts b/src/libs/Pusher/library/types.ts index cc8c70fccdbb..566fd8a72774 100644 --- a/src/libs/Pusher/library/types.ts +++ b/src/libs/Pusher/library/types.ts @@ -1,5 +1,5 @@ -import PusherClass from 'pusher-js/with-encryption'; -import {LiteralUnion} from 'type-fest'; +import type PusherClass from 'pusher-js/with-encryption'; +import type {LiteralUnion} from 'type-fest'; type Pusher = typeof PusherClass; diff --git a/src/libs/Pusher/pusher.ts b/src/libs/Pusher/pusher.ts index 33219b1dfe73..b6a5390bd501 100644 --- a/src/libs/Pusher/pusher.ts +++ b/src/libs/Pusher/pusher.ts @@ -1,15 +1,15 @@ import isObject from 'lodash/isObject'; -import {Channel, ChannelAuthorizerGenerator, Options} from 'pusher-js/with-encryption'; +import type {Channel, ChannelAuthorizerGenerator, Options} from 'pusher-js/with-encryption'; import Onyx from 'react-native-onyx'; -import {LiteralUnion, ValueOf} from 'type-fest'; +import type {LiteralUnion, ValueOf} from 'type-fest'; import Log from '@libs/Log'; -import CONST from '@src/CONST'; +import type CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {OnyxUpdateEvent, OnyxUpdatesFromServer, ReportUserIsTyping} from '@src/types/onyx'; -import DeepValueOf from '@src/types/utils/DeepValueOf'; +import type {OnyxUpdateEvent, OnyxUpdatesFromServer, ReportUserIsTyping} from '@src/types/onyx'; +import type DeepValueOf from '@src/types/utils/DeepValueOf'; import TYPE from './EventType'; import Pusher from './library'; -import {SocketEventName} from './library/types'; +import type {SocketEventName} from './library/types'; type States = { previous: string; diff --git a/src/libs/PusherConnectionManager.ts b/src/libs/PusherConnectionManager.ts index a0c5673af729..597670d3f5ad 100644 --- a/src/libs/PusherConnectionManager.ts +++ b/src/libs/PusherConnectionManager.ts @@ -1,10 +1,10 @@ -import {ChannelAuthorizationCallback} from 'pusher-js/with-encryption'; +import type {ChannelAuthorizationCallback} from 'pusher-js/with-encryption'; import CONST from '@src/CONST'; import * as Session from './actions/Session'; import Log from './Log'; -import {SocketEventName} from './Pusher/library/types'; +import type {SocketEventName} from './Pusher/library/types'; import * as Pusher from './Pusher/pusher'; -import {EventCallbackError, States} from './Pusher/pusher'; +import type {EventCallbackError, States} from './Pusher/pusher'; function init() { /** diff --git a/src/libs/PusherUtils.ts b/src/libs/PusherUtils.ts index 9f7e21ef9005..1ee75eb9c2f6 100644 --- a/src/libs/PusherUtils.ts +++ b/src/libs/PusherUtils.ts @@ -1,10 +1,10 @@ -import {OnyxUpdate} from 'react-native-onyx'; +import type {OnyxUpdate} from 'react-native-onyx'; import CONFIG from '@src/CONFIG'; import CONST from '@src/CONST'; import Log from './Log'; import NetworkConnection from './NetworkConnection'; import * as Pusher from './Pusher/pusher'; -import {PushJSON} from './Pusher/pusher'; +import type {PushJSON} from './Pusher/pusher'; type Callback = (data: OnyxUpdate[]) => Promise; diff --git a/src/libs/ReceiptUtils.ts b/src/libs/ReceiptUtils.ts index 1151b559746d..734c40271208 100644 --- a/src/libs/ReceiptUtils.ts +++ b/src/libs/ReceiptUtils.ts @@ -1,12 +1,12 @@ import Str from 'expensify-common/lib/str'; -import {ImageSourcePropType} from 'react-native'; +import type {ImageSourcePropType} from 'react-native'; import ReceiptDoc from '@assets/images/receipt-doc.png'; import ReceiptGeneric from '@assets/images/receipt-generic.png'; import ReceiptHTML from '@assets/images/receipt-html.png'; import ReceiptSVG from '@assets/images/receipt-svg.png'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; -import {Transaction} from '@src/types/onyx'; +import type {Transaction} from '@src/types/onyx'; import * as FileUtils from './fileDownload/FileUtils'; type ThumbnailAndImageURI = { diff --git a/src/libs/ReportActionComposeFocusManager.ts b/src/libs/ReportActionComposeFocusManager.ts index 9d4039117989..123d97987e14 100644 --- a/src/libs/ReportActionComposeFocusManager.ts +++ b/src/libs/ReportActionComposeFocusManager.ts @@ -1,5 +1,5 @@ import React from 'react'; -import {TextInput} from 'react-native'; +import type {TextInput} from 'react-native'; import ROUTES from '@src/ROUTES'; import Navigation from './Navigation/Navigation'; diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 34477d7f71ef..6f1425f9b152 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1,20 +1,23 @@ import _ from 'lodash'; import lodashFindLast from 'lodash/findLast'; -import Onyx, {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; +import type {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import OnyxUtils from 'react-native-onyx/lib/utils'; -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {ActionName, ChangeLog} from '@src/types/onyx/OriginalMessage'; -import Report from '@src/types/onyx/Report'; -import ReportAction, {Message, ReportActions} from '@src/types/onyx/ReportAction'; -import {EmptyObject, isEmptyObject} from '@src/types/utils/EmptyObject'; +import type {ActionName, ChangeLog} from '@src/types/onyx/OriginalMessage'; +import type Report from '@src/types/onyx/Report'; +import type {Message, ReportActions} from '@src/types/onyx/ReportAction'; +import type ReportAction from '@src/types/onyx/ReportAction'; +import type {EmptyObject} from '@src/types/utils/EmptyObject'; +import { isEmptyObject} from '@src/types/utils/EmptyObject'; import * as CollectionUtils from './CollectionUtils'; import * as Environment from './Environment/Environment'; import isReportMessageAttachment from './isReportMessageAttachment'; import * as Localize from './Localize'; import Log from './Log'; -import {MessageElementBase, MessageTextElement} from './MessageElement'; +import type {MessageElementBase, MessageTextElement} from './MessageElement'; import * as PersonalDetailsUtils from './PersonalDetailsUtils'; type LastVisibleMessage = { diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 470d9f3392d3..a51220bd1df4 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5,24 +5,26 @@ import lodashEscape from 'lodash/escape'; import lodashFindLastIndex from 'lodash/findLastIndex'; import lodashIntersection from 'lodash/intersection'; import lodashIsEqual from 'lodash/isEqual'; -import Onyx, {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; import * as Expensicons from '@components/Icon/Expensicons'; import * as defaultWorkspaceAvatars from '@components/Icon/WorkspaceDefaultAvatars'; import CONST from '@src/CONST'; -import {ParentNavigationSummaryParams, TranslationPaths} from '@src/languages/types'; +import type {ParentNavigationSummaryParams, TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import {Beta, Login, PersonalDetails, PersonalDetailsList, Policy, Report, ReportAction, ReportMetadata, Session, Transaction} from '@src/types/onyx'; -import {Errors, Icon, PendingAction} from '@src/types/onyx/OnyxCommon'; -import {IOUMessage, OriginalMessageActionName, OriginalMessageCreated} from '@src/types/onyx/OriginalMessage'; -import {Status} from '@src/types/onyx/PersonalDetails'; -import {NotificationPreference} from '@src/types/onyx/Report'; -import {Message, ReportActionBase, ReportActions} from '@src/types/onyx/ReportAction'; -import {Receipt, WaypointCollection} from '@src/types/onyx/Transaction'; -import DeepValueOf from '@src/types/utils/DeepValueOf'; -import {EmptyObject, isEmptyObject, isNotEmptyObject} from '@src/types/utils/EmptyObject'; -import IconAsset from '@src/types/utils/IconAsset'; +import type {Beta, Login, PersonalDetails, PersonalDetailsList, Policy, Report, ReportAction, ReportMetadata, Session, Transaction} from '@src/types/onyx'; +import type {Errors, Icon, PendingAction} from '@src/types/onyx/OnyxCommon'; +import type {IOUMessage, OriginalMessageActionName, OriginalMessageCreated} from '@src/types/onyx/OriginalMessage'; +import type {Status} from '@src/types/onyx/PersonalDetails'; +import type {NotificationPreference} from '@src/types/onyx/Report'; +import type {Message, ReportActionBase, ReportActions} from '@src/types/onyx/ReportAction'; +import type {Receipt, WaypointCollection} from '@src/types/onyx/Transaction'; +import type DeepValueOf from '@src/types/utils/DeepValueOf'; +import type {EmptyObject} from '@src/types/utils/EmptyObject'; +import { isEmptyObject, isNotEmptyObject} from '@src/types/utils/EmptyObject'; +import type IconAsset from '@src/types/utils/IconAsset'; import * as CurrencyUtils from './CurrencyUtils'; import DateUtils from './DateUtils'; import isReportMessageAttachment from './isReportMessageAttachment'; @@ -35,7 +37,7 @@ import Permissions from './Permissions'; import * as PersonalDetailsUtils from './PersonalDetailsUtils'; import * as PolicyUtils from './PolicyUtils'; import * as ReportActionsUtils from './ReportActionsUtils'; -import {LastVisibleMessage} from './ReportActionsUtils'; +import type {LastVisibleMessage} from './ReportActionsUtils'; import * as TransactionUtils from './TransactionUtils'; import * as Url from './Url'; import * as UserUtils from './UserUtils'; diff --git a/src/libs/Request.ts b/src/libs/Request.ts index 18fadca467ad..aa94eccbca2e 100644 --- a/src/libs/Request.ts +++ b/src/libs/Request.ts @@ -1,7 +1,7 @@ -import Request from '@src/types/onyx/Request'; -import Response from '@src/types/onyx/Response'; +import type Request from '@src/types/onyx/Request'; +import type Response from '@src/types/onyx/Response'; import HttpUtils from './HttpUtils'; -import Middleware from './Middleware/types'; +import type Middleware from './Middleware/types'; import enhanceParameters from './Network/enhanceParameters'; import * as NetworkStore from './Network/NetworkStore'; diff --git a/src/libs/SelectionScraper/index.native.ts b/src/libs/SelectionScraper/index.native.ts index 7712906f05e6..aeb9c5ae3ce2 100644 --- a/src/libs/SelectionScraper/index.native.ts +++ b/src/libs/SelectionScraper/index.native.ts @@ -1,4 +1,4 @@ -import GetCurrentSelection from './types'; +import type GetCurrentSelection from './types'; // This is a no-op function for native devices because they wouldn't be able to support Selection API like a website. const getCurrentSelection: GetCurrentSelection = () => ''; diff --git a/src/libs/SelectionScraper/index.ts b/src/libs/SelectionScraper/index.ts index 01b9db4b4a43..ebd06a342a51 100644 --- a/src/libs/SelectionScraper/index.ts +++ b/src/libs/SelectionScraper/index.ts @@ -1,9 +1,10 @@ import render from 'dom-serializer'; -import {DataNode, Element, Node} from 'domhandler'; +import type { Node} from 'domhandler'; +import {DataNode, Element} from 'domhandler'; import Str from 'expensify-common/lib/str'; import {parseDocument} from 'htmlparser2'; import CONST from '@src/CONST'; -import GetCurrentSelection from './types'; +import type GetCurrentSelection from './types'; const markdownElements = ['h1', 'strong', 'em', 'del', 'blockquote', 'q', 'code', 'pre', 'a', 'br', 'li', 'ul', 'ol', 'b', 'i', 's']; const tagAttribute = 'data-testid'; diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index 0a776645a393..db16cf5cb552 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -1,15 +1,17 @@ /* eslint-disable rulesdir/prefer-underscore-method */ import Str from 'expensify-common/lib/str'; -import Onyx, {OnyxCollection} from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {OnyxCollection} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {PersonalDetails} from '@src/types/onyx'; -import Beta from '@src/types/onyx/Beta'; -import * as OnyxCommon from '@src/types/onyx/OnyxCommon'; -import Policy from '@src/types/onyx/Policy'; -import Report from '@src/types/onyx/Report'; -import ReportAction, {ReportActions} from '@src/types/onyx/ReportAction'; +import type {PersonalDetails} from '@src/types/onyx'; +import type Beta from '@src/types/onyx/Beta'; +import type * as OnyxCommon from '@src/types/onyx/OnyxCommon'; +import type Policy from '@src/types/onyx/Policy'; +import type Report from '@src/types/onyx/Report'; +import type {ReportActions} from '@src/types/onyx/ReportAction'; +import type ReportAction from '@src/types/onyx/ReportAction'; import * as CollectionUtils from './CollectionUtils'; import * as LocalePhoneNumber from './LocalePhoneNumber'; import * as Localize from './Localize'; diff --git a/src/libs/StartupTimer/index.native.ts b/src/libs/StartupTimer/index.native.ts index 52ba55076fc1..8aa185d81146 100644 --- a/src/libs/StartupTimer/index.native.ts +++ b/src/libs/StartupTimer/index.native.ts @@ -1,5 +1,5 @@ import {NativeModules} from 'react-native'; -import StartupTimer from './types'; +import type StartupTimer from './types'; /** * Stop the startup trace for the app. diff --git a/src/libs/StartupTimer/index.ts b/src/libs/StartupTimer/index.ts index 1cc656b329f4..85960bcce24b 100644 --- a/src/libs/StartupTimer/index.ts +++ b/src/libs/StartupTimer/index.ts @@ -1,7 +1,7 @@ /** * Web noop as there is no "startup" to time from the native layer. */ -import StartupTimer from './types'; +import type StartupTimer from './types'; const startupTimer: StartupTimer = { stop: () => {}, diff --git a/src/libs/TaskUtils.ts b/src/libs/TaskUtils.ts index 3026e33edc8c..da2727d29942 100644 --- a/src/libs/TaskUtils.ts +++ b/src/libs/TaskUtils.ts @@ -1,8 +1,9 @@ -import Onyx, {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {Report} from '@src/types/onyx'; -import ReportAction from '@src/types/onyx/ReportAction'; +import type {Report} from '@src/types/onyx'; +import type ReportAction from '@src/types/onyx/ReportAction'; import * as CollectionUtils from './CollectionUtils'; import * as Localize from './Localize'; diff --git a/src/libs/TransactionUtils.ts b/src/libs/TransactionUtils.ts index 615bea7ff18d..c34a6753c1d5 100644 --- a/src/libs/TransactionUtils.ts +++ b/src/libs/TransactionUtils.ts @@ -1,12 +1,14 @@ import lodashHas from 'lodash/has'; -import Onyx, {OnyxCollection, OnyxEntry} from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {RecentWaypoint, Report, ReportAction, Transaction} from '@src/types/onyx'; -import PolicyTaxRate, {PolicyTaxRates} from '@src/types/onyx/PolicyTaxRates'; -import {Comment, Receipt, Waypoint, WaypointCollection} from '@src/types/onyx/Transaction'; -import {EmptyObject} from '@src/types/utils/EmptyObject'; +import type {RecentWaypoint, Report, ReportAction, Transaction} from '@src/types/onyx'; +import type {PolicyTaxRates} from '@src/types/onyx/PolicyTaxRates'; +import type PolicyTaxRate from '@src/types/onyx/PolicyTaxRates'; +import type {Comment, Receipt, Waypoint, WaypointCollection} from '@src/types/onyx/Transaction'; +import type {EmptyObject} from '@src/types/utils/EmptyObject'; import {isCorporateCard, isExpensifyCard} from './CardUtils'; import DateUtils from './DateUtils'; import * as NumberUtils from './NumberUtils'; diff --git a/src/libs/Trie/index.ts b/src/libs/Trie/index.ts index c3c5aa4bbf3f..c23c7b814a22 100644 --- a/src/libs/Trie/index.ts +++ b/src/libs/Trie/index.ts @@ -1,4 +1,5 @@ -import TrieNode, {MetaData} from './TrieNode'; +import type {MetaData} from './TrieNode'; +import TrieNode from './TrieNode'; type Word = { name: string; diff --git a/src/libs/UnreadIndicatorUpdater/index.ts b/src/libs/UnreadIndicatorUpdater/index.ts index da45057bc46d..4126f2af4e83 100644 --- a/src/libs/UnreadIndicatorUpdater/index.ts +++ b/src/libs/UnreadIndicatorUpdater/index.ts @@ -1,8 +1,9 @@ -import Onyx, {OnyxCollection} from 'react-native-onyx'; +import type {OnyxCollection} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import * as ReportUtils from '@libs/ReportUtils'; import Navigation, {navigationRef} from '@navigation/Navigation'; import ONYXKEYS from '@src/ONYXKEYS'; -import {Report} from '@src/types/onyx'; +import type {Report} from '@src/types/onyx'; import updateUnread from './updateUnread'; let allReports: OnyxCollection = {}; diff --git a/src/libs/UnreadIndicatorUpdater/updateUnread/index.android.ts b/src/libs/UnreadIndicatorUpdater/updateUnread/index.android.ts index bd7b2cbc4752..2c79573ef906 100644 --- a/src/libs/UnreadIndicatorUpdater/updateUnread/index.android.ts +++ b/src/libs/UnreadIndicatorUpdater/updateUnread/index.android.ts @@ -1,4 +1,4 @@ -import UpdateUnread from './types'; +import type UpdateUnread from './types'; // Android does not yet implement this const updateUnread: UpdateUnread = () => {}; diff --git a/src/libs/UnreadIndicatorUpdater/updateUnread/index.desktop.ts b/src/libs/UnreadIndicatorUpdater/updateUnread/index.desktop.ts index e5d2fca43bf4..5cbba61542b1 100644 --- a/src/libs/UnreadIndicatorUpdater/updateUnread/index.desktop.ts +++ b/src/libs/UnreadIndicatorUpdater/updateUnread/index.desktop.ts @@ -1,5 +1,5 @@ import ELECTRON_EVENTS from '../../../../desktop/ELECTRON_EVENTS'; -import UpdateUnread from './types'; +import type UpdateUnread from './types'; /** * Set the badge on desktop diff --git a/src/libs/UnreadIndicatorUpdater/updateUnread/index.ios.ts b/src/libs/UnreadIndicatorUpdater/updateUnread/index.ios.ts index d6fac7c7771d..fcaa1cf57502 100644 --- a/src/libs/UnreadIndicatorUpdater/updateUnread/index.ios.ts +++ b/src/libs/UnreadIndicatorUpdater/updateUnread/index.ios.ts @@ -1,5 +1,5 @@ import Airship from '@ua/react-native-airship'; -import UpdateUnread from './types'; +import type UpdateUnread from './types'; /** * Set the App Icon badge with the number of diff --git a/src/libs/UnreadIndicatorUpdater/updateUnread/index.ts b/src/libs/UnreadIndicatorUpdater/updateUnread/index.ts index 46015f4e5e03..8e5f7d971903 100644 --- a/src/libs/UnreadIndicatorUpdater/updateUnread/index.ts +++ b/src/libs/UnreadIndicatorUpdater/updateUnread/index.ts @@ -2,7 +2,7 @@ * Web browsers have a tab title and favicon which can be updated to show there are unread comments */ import CONFIG from '@src/CONFIG'; -import UpdateUnread from './types'; +import type UpdateUnread from './types'; let unreadTotalCount = 0; /** diff --git a/src/libs/UserUtils.ts b/src/libs/UserUtils.ts index 15ae6cce2a6d..018bb87cc3a2 100644 --- a/src/libs/UserUtils.ts +++ b/src/libs/UserUtils.ts @@ -1,14 +1,15 @@ import Str from 'expensify-common/lib/str'; import _ from 'lodash'; -import Onyx, {OnyxEntry} from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {OnyxEntry} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; import * as defaultAvatars from '@components/Icon/DefaultAvatars'; import {ConciergeAvatar, FallbackAvatar} from '@components/Icon/Expensicons'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {PersonalDetailsList} from '@src/types/onyx'; -import Login from '@src/types/onyx/Login'; -import IconAsset from '@src/types/utils/IconAsset'; +import type {PersonalDetailsList} from '@src/types/onyx'; +import type Login from '@src/types/onyx/Login'; +import type IconAsset from '@src/types/utils/IconAsset'; import hashCode from './hashCode'; type AvatarRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24; diff --git a/src/libs/ValidationUtils.ts b/src/libs/ValidationUtils.ts index ba977312fcfb..4b973d95d136 100644 --- a/src/libs/ValidationUtils.ts +++ b/src/libs/ValidationUtils.ts @@ -5,8 +5,8 @@ import isDate from 'lodash/isDate'; import isEmpty from 'lodash/isEmpty'; import isObject from 'lodash/isObject'; import CONST from '@src/CONST'; -import {Report} from '@src/types/onyx'; -import * as OnyxCommon from '@src/types/onyx/OnyxCommon'; +import type {Report} from '@src/types/onyx'; +import type * as OnyxCommon from '@src/types/onyx/OnyxCommon'; import * as CardUtils from './CardUtils'; import DateUtils from './DateUtils'; import * as LoginUtils from './LoginUtils'; diff --git a/src/libs/ViolationsUtils.ts b/src/libs/ViolationsUtils.ts index 4cfa259c9e78..748f0ed86b7f 100644 --- a/src/libs/ViolationsUtils.ts +++ b/src/libs/ViolationsUtils.ts @@ -1,7 +1,7 @@ import reject from 'lodash/reject'; import Onyx from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; -import {PolicyCategories, PolicyTags, Transaction, TransactionViolation} from '@src/types/onyx'; +import type {PolicyCategories, PolicyTags, Transaction, TransactionViolation} from '@src/types/onyx'; const ViolationsUtils = { /** diff --git a/src/libs/Visibility/index.desktop.ts b/src/libs/Visibility/index.desktop.ts index bdc8b9a4267a..c01b6001f456 100644 --- a/src/libs/Visibility/index.desktop.ts +++ b/src/libs/Visibility/index.desktop.ts @@ -1,5 +1,5 @@ import ELECTRON_EVENTS from '../../../desktop/ELECTRON_EVENTS'; -import {HasFocus, IsVisible, OnVisibilityChange} from './types'; +import type {HasFocus, IsVisible, OnVisibilityChange} from './types'; /** * Detects whether the app is visible or not. Electron supports document.visibilityState, diff --git a/src/libs/Visibility/index.native.ts b/src/libs/Visibility/index.native.ts index 42bd56531207..bedcce101d61 100644 --- a/src/libs/Visibility/index.native.ts +++ b/src/libs/Visibility/index.native.ts @@ -1,7 +1,7 @@ // Mobile apps do not require this check for visibility as // they do not use the Notification lib. import {AppState} from 'react-native'; -import {HasFocus, IsVisible, OnVisibilityChange} from './types'; +import type {HasFocus, IsVisible, OnVisibilityChange} from './types'; const isVisible: IsVisible = () => AppState.currentState === 'active'; diff --git a/src/libs/Visibility/index.ts b/src/libs/Visibility/index.ts index 4cf18b010a07..e7556fa22eb4 100644 --- a/src/libs/Visibility/index.ts +++ b/src/libs/Visibility/index.ts @@ -1,5 +1,5 @@ import {AppState} from 'react-native'; -import {HasFocus, IsVisible, OnVisibilityChange} from './types'; +import type {HasFocus, IsVisible, OnVisibilityChange} from './types'; /** * Detects whether the app is visible or not. diff --git a/src/libs/VisualViewport/index.native.ts b/src/libs/VisualViewport/index.native.ts index a50b080d9aab..6b6d3338f472 100644 --- a/src/libs/VisualViewport/index.native.ts +++ b/src/libs/VisualViewport/index.native.ts @@ -1,4 +1,4 @@ -import AddViewportResizeListener from './types'; +import type AddViewportResizeListener from './types'; /** * Visual Viewport is not available on native, so return an empty function. diff --git a/src/libs/VisualViewport/index.ts b/src/libs/VisualViewport/index.ts index e24d42f272a4..78a4743c9fa7 100644 --- a/src/libs/VisualViewport/index.ts +++ b/src/libs/VisualViewport/index.ts @@ -1,4 +1,4 @@ -import AddViewportResizeListener from './types'; +import type AddViewportResizeListener from './types'; /** * Add a visual viewport resize listener if available. Return a function to remove the listener. diff --git a/src/libs/__mocks__/Permissions.ts b/src/libs/__mocks__/Permissions.ts index 4f47c0b756b7..759392bde2c6 100644 --- a/src/libs/__mocks__/Permissions.ts +++ b/src/libs/__mocks__/Permissions.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import Beta from '@src/types/onyx/Beta'; +import type Beta from '@src/types/onyx/Beta'; /** * This module is mocked in tests because all the permission methods call canUseAllBetas() and that will diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index ec43d4358134..dc816ebce8cb 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -1,8 +1,10 @@ // Issue - https://github.com/Expensify/App/issues/26719 import Str from 'expensify-common/lib/str'; -import {AppState, AppStateStatus} from 'react-native'; -import Onyx, {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type { AppStateStatus} from 'react-native'; +import {AppState} from 'react-native'; +import type {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; import * as API from '@libs/API'; import * as Browser from '@libs/Browser'; import Log from '@libs/Log'; @@ -13,9 +15,10 @@ import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import * as SessionUtils from '@libs/SessionUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES, {Route} from '@src/ROUTES'; -import * as OnyxTypes from '@src/types/onyx'; -import {SelectedTimezone} from '@src/types/onyx/PersonalDetails'; +import type {Route} from '@src/ROUTES'; +import ROUTES from '@src/ROUTES'; +import type * as OnyxTypes from '@src/types/onyx'; +import type {SelectedTimezone} from '@src/types/onyx/PersonalDetails'; import type {OnyxData} from '@src/types/onyx/Request'; import * as Policy from './Policy'; import * as Session from './Session'; diff --git a/src/libs/actions/Chronos.ts b/src/libs/actions/Chronos.ts index 76308f225fe4..0bb949687e6d 100644 --- a/src/libs/actions/Chronos.ts +++ b/src/libs/actions/Chronos.ts @@ -1,8 +1,9 @@ -import Onyx, {OnyxUpdate} from 'react-native-onyx'; +import type {OnyxUpdate} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import * as API from '@libs/API'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {ChronosOOOEvent} from '@src/types/onyx/OriginalMessage'; +import type {ChronosOOOEvent} from '@src/types/onyx/OriginalMessage'; const removeEvent = (reportID: string, reportActionID: string, eventID: string, events: ChronosOOOEvent[]) => { const optimisticData: OnyxUpdate[] = [ diff --git a/src/libs/actions/Device/generateDeviceID/index.android.ts b/src/libs/actions/Device/generateDeviceID/index.android.ts index 5fadc63ac3ba..d662967a9f76 100644 --- a/src/libs/actions/Device/generateDeviceID/index.android.ts +++ b/src/libs/actions/Device/generateDeviceID/index.android.ts @@ -1,6 +1,6 @@ import Str from 'expensify-common/lib/str'; import DeviceInfo from 'react-native-device-info'; -import GenerateDeviceID from './types'; +import type GenerateDeviceID from './types'; const deviceID = DeviceInfo.getDeviceId(); const uniqueID = Str.guid(deviceID); diff --git a/src/libs/actions/Device/generateDeviceID/index.desktop.ts b/src/libs/actions/Device/generateDeviceID/index.desktop.ts index a5e1acdc40fd..f8af0a7faa81 100644 --- a/src/libs/actions/Device/generateDeviceID/index.desktop.ts +++ b/src/libs/actions/Device/generateDeviceID/index.desktop.ts @@ -1,5 +1,5 @@ import ELECTRON_EVENTS from '../../../../../desktop/ELECTRON_EVENTS'; -import GenerateDeviceID from './types'; +import type GenerateDeviceID from './types'; /** * Get the unique ID of the current device. This should remain the same even if the user uninstalls and reinstalls the app. diff --git a/src/libs/actions/Device/generateDeviceID/index.ios.ts b/src/libs/actions/Device/generateDeviceID/index.ios.ts index 6567ffffb8d3..a63d176a77d1 100644 --- a/src/libs/actions/Device/generateDeviceID/index.ios.ts +++ b/src/libs/actions/Device/generateDeviceID/index.ios.ts @@ -1,5 +1,5 @@ import DeviceInfo from 'react-native-device-info'; -import GenerateDeviceID from './types'; +import type GenerateDeviceID from './types'; const deviceID = DeviceInfo.getDeviceId(); diff --git a/src/libs/actions/Device/generateDeviceID/index.ts b/src/libs/actions/Device/generateDeviceID/index.ts index b7011b7bb2d9..82ea72ba8180 100644 --- a/src/libs/actions/Device/generateDeviceID/index.ts +++ b/src/libs/actions/Device/generateDeviceID/index.ts @@ -1,5 +1,5 @@ import Str from 'expensify-common/lib/str'; -import GenerateDeviceID from './types'; +import type GenerateDeviceID from './types'; const uniqueID = Str.guid(); diff --git a/src/libs/actions/Device/getDeviceInfo/getBaseInfo.ts b/src/libs/actions/Device/getDeviceInfo/getBaseInfo.ts index aa5ef00815d2..28dc7b10c8d0 100644 --- a/src/libs/actions/Device/getDeviceInfo/getBaseInfo.ts +++ b/src/libs/actions/Device/getDeviceInfo/getBaseInfo.ts @@ -1,5 +1,5 @@ import packageConfig from '../../../../../package.json'; -import {GetBaseInfo} from './types'; +import type {GetBaseInfo} from './types'; const getBaseInfo: GetBaseInfo = () => ({ appVersion: packageConfig.version, diff --git a/src/libs/actions/Device/getDeviceInfo/getOSAndName/index.native.ts b/src/libs/actions/Device/getDeviceInfo/getOSAndName/index.native.ts index bfce98b1c65e..16a48348df71 100644 --- a/src/libs/actions/Device/getDeviceInfo/getOSAndName/index.native.ts +++ b/src/libs/actions/Device/getDeviceInfo/getOSAndName/index.native.ts @@ -1,6 +1,6 @@ import Str from 'expensify-common/lib/str'; import RNDeviceInfo from 'react-native-device-info'; -import {GetOSAndName} from './types'; +import type {GetOSAndName} from './types'; const getOSAndName: GetOSAndName = () => { const deviceName = RNDeviceInfo.getDeviceNameSync(); diff --git a/src/libs/actions/Device/getDeviceInfo/index.android.ts b/src/libs/actions/Device/getDeviceInfo/index.android.ts index 6d8e9e497145..8ac243afa0dc 100644 --- a/src/libs/actions/Device/getDeviceInfo/index.android.ts +++ b/src/libs/actions/Device/getDeviceInfo/index.android.ts @@ -1,6 +1,6 @@ import getBaseInfo from './getBaseInfo'; import getOSAndName from './getOSAndName/index'; -import {GetDeviceInfo} from './types'; +import type {GetDeviceInfo} from './types'; const getDeviceInfo: GetDeviceInfo = () => ({ ...getBaseInfo(), diff --git a/src/libs/actions/Device/getDeviceInfo/index.desktop.ts b/src/libs/actions/Device/getDeviceInfo/index.desktop.ts index cb99de08ae93..51afe5805ce9 100644 --- a/src/libs/actions/Device/getDeviceInfo/index.desktop.ts +++ b/src/libs/actions/Device/getDeviceInfo/index.desktop.ts @@ -1,6 +1,6 @@ import getBaseInfo from './getBaseInfo'; import getOSAndName from './getOSAndName/index'; -import {GetDeviceInfo} from './types'; +import type {GetDeviceInfo} from './types'; const getDeviceInfo: GetDeviceInfo = () => ({ ...getBaseInfo(), diff --git a/src/libs/actions/Device/getDeviceInfo/index.ios.ts b/src/libs/actions/Device/getDeviceInfo/index.ios.ts index b91d5236a084..b4974807272a 100644 --- a/src/libs/actions/Device/getDeviceInfo/index.ios.ts +++ b/src/libs/actions/Device/getDeviceInfo/index.ios.ts @@ -1,6 +1,6 @@ import getBaseInfo from './getBaseInfo'; import getOSAndName from './getOSAndName/index'; -import {GetDeviceInfo} from './types'; +import type {GetDeviceInfo} from './types'; const getDeviceInfo: GetDeviceInfo = () => ({ ...getBaseInfo(), diff --git a/src/libs/actions/Device/getDeviceInfo/index.ts b/src/libs/actions/Device/getDeviceInfo/index.ts index b82aafc56cbe..cd4c02646367 100644 --- a/src/libs/actions/Device/getDeviceInfo/index.ts +++ b/src/libs/actions/Device/getDeviceInfo/index.ts @@ -1,6 +1,6 @@ import getBaseInfo from './getBaseInfo'; import getOSAndName from './getOSAndName/index'; -import {GetDeviceInfo} from './types'; +import type {GetDeviceInfo} from './types'; const getDeviceInfo: GetDeviceInfo = () => ({ ...getBaseInfo(), diff --git a/src/libs/actions/Device/getDeviceInfo/types.ts b/src/libs/actions/Device/getDeviceInfo/types.ts index 684ef68f1359..4262a02f84b0 100644 --- a/src/libs/actions/Device/getDeviceInfo/types.ts +++ b/src/libs/actions/Device/getDeviceInfo/types.ts @@ -1,4 +1,4 @@ -import {OSAndName} from './getOSAndName/types'; +import type {OSAndName} from './getOSAndName/types'; type BaseInfo = { appVersion: string; diff --git a/src/libs/actions/EmojiPickerAction.ts b/src/libs/actions/EmojiPickerAction.ts index 0f9dd4b727aa..064c52f9b7ef 100644 --- a/src/libs/actions/EmojiPickerAction.ts +++ b/src/libs/actions/EmojiPickerAction.ts @@ -1,7 +1,7 @@ import React from 'react'; -import {View} from 'react-native'; -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; +import type {View} from 'react-native'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; type AnchorOrigin = { horizontal: ValueOf; diff --git a/src/libs/actions/FormActions.ts b/src/libs/actions/FormActions.ts index 29d9ecda9f73..6b73636e6d82 100644 --- a/src/libs/actions/FormActions.ts +++ b/src/libs/actions/FormActions.ts @@ -1,9 +1,9 @@ import Onyx from 'react-native-onyx'; -import {KeyValueMapping, NullishDeep} from 'react-native-onyx/lib/types'; +import type {KeyValueMapping, NullishDeep} from 'react-native-onyx/lib/types'; import FormUtils from '@libs/FormUtils'; -import {OnyxFormKey} from '@src/ONYXKEYS'; -import {Form} from '@src/types/onyx'; -import * as OnyxCommon from '@src/types/onyx/OnyxCommon'; +import type {OnyxFormKey} from '@src/ONYXKEYS'; +import type {Form} from '@src/types/onyx'; +import type * as OnyxCommon from '@src/types/onyx/OnyxCommon'; type ExcludeDraft = T extends `${string}Draft` ? never : T; type OnyxFormKeyWithoutDraft = ExcludeDraft; diff --git a/src/libs/actions/Link.ts b/src/libs/actions/Link.ts index e6d33fec118d..2fb863467e32 100644 --- a/src/libs/actions/Link.ts +++ b/src/libs/actions/Link.ts @@ -7,7 +7,8 @@ import * as Url from '@libs/Url'; import CONFIG from '@src/CONFIG'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES, {Route} from '@src/ROUTES'; +import type {Route} from '@src/ROUTES'; +import ROUTES from '@src/ROUTES'; let isNetworkOffline = false; Onyx.connect({ diff --git a/src/libs/actions/MapboxToken.ts b/src/libs/actions/MapboxToken.ts index 4596e82a9354..42f8abf352f0 100644 --- a/src/libs/actions/MapboxToken.ts +++ b/src/libs/actions/MapboxToken.ts @@ -1,11 +1,12 @@ import {isAfter} from 'date-fns'; -import {AppState, NativeEventSubscription} from 'react-native'; +import type { NativeEventSubscription} from 'react-native'; +import {AppState} from 'react-native'; import Onyx from 'react-native-onyx'; import * as ActiveClientManager from '@libs/ActiveClientManager'; import * as API from '@libs/API'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {MapboxAccessToken, Network} from '@src/types/onyx'; +import type {MapboxAccessToken, Network} from '@src/types/onyx'; let authToken: string | null; Onyx.connect({ diff --git a/src/libs/actions/OnyxUpdates.ts b/src/libs/actions/OnyxUpdates.ts index bc407625dc6a..e1df544b4548 100644 --- a/src/libs/actions/OnyxUpdates.ts +++ b/src/libs/actions/OnyxUpdates.ts @@ -1,11 +1,12 @@ -import Onyx, {OnyxEntry} from 'react-native-onyx'; -import {Merge} from 'type-fest'; +import type {OnyxEntry} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {Merge} from 'type-fest'; import Log from '@libs/Log'; import PusherUtils from '@libs/PusherUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {OnyxUpdateEvent, OnyxUpdatesFromServer, Request} from '@src/types/onyx'; -import Response from '@src/types/onyx/Response'; +import type {OnyxUpdateEvent, OnyxUpdatesFromServer, Request} from '@src/types/onyx'; +import type Response from '@src/types/onyx/Response'; import * as QueuedOnyxUpdates from './QueuedOnyxUpdates'; // This key needs to be separate from ONYXKEYS.ONYX_UPDATES_FROM_SERVER so that it can be updated without triggering the callback when the server IDs are updated. If that diff --git a/src/libs/actions/PaymentMethods.ts b/src/libs/actions/PaymentMethods.ts index 3547a3053a02..a7ae54f46416 100644 --- a/src/libs/actions/PaymentMethods.ts +++ b/src/libs/actions/PaymentMethods.ts @@ -1,7 +1,8 @@ import {createRef} from 'react'; -import Onyx, {OnyxUpdate} from 'react-native-onyx'; -import {OnyxEntry} from 'react-native-onyx/lib/types'; -import {ValueOf} from 'type-fest'; +import type {OnyxUpdate} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx/lib/types'; +import type {ValueOf} from 'type-fest'; import * as API from '@libs/API'; import * as CardUtils from '@libs/CardUtils'; import Navigation from '@libs/Navigation/Navigation'; @@ -9,8 +10,8 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {BankAccountList, FundList} from '@src/types/onyx'; -import PaymentMethod from '@src/types/onyx/PaymentMethod'; -import {FilterMethodPaymentType} from '@src/types/onyx/WalletTransfer'; +import type PaymentMethod from '@src/types/onyx/PaymentMethod'; +import type {FilterMethodPaymentType} from '@src/types/onyx/WalletTransfer'; type KYCWallRef = { continueAction?: () => void; diff --git a/src/libs/actions/PersistedRequests.ts b/src/libs/actions/PersistedRequests.ts index 22242ed6cbc5..fcc6450c6072 100644 --- a/src/libs/actions/PersistedRequests.ts +++ b/src/libs/actions/PersistedRequests.ts @@ -1,7 +1,7 @@ import isEqual from 'lodash/isEqual'; import Onyx from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; -import {Request} from '@src/types/onyx'; +import type {Request} from '@src/types/onyx'; let persistedRequests: Request[] = []; diff --git a/src/libs/actions/PersonalDetails.ts b/src/libs/actions/PersonalDetails.ts index ff919f312987..20c6d8fef247 100644 --- a/src/libs/actions/PersonalDetails.ts +++ b/src/libs/actions/PersonalDetails.ts @@ -1,7 +1,8 @@ import Str from 'expensify-common/lib/str'; -import Onyx, {OnyxEntry, OnyxUpdate} from 'react-native-onyx'; +import type {OnyxEntry, OnyxUpdate} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import * as API from '@libs/API'; -import {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types'; +import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types'; import * as LocalePhoneNumber from '@libs/LocalePhoneNumber'; import Navigation from '@libs/Navigation/Navigation'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; @@ -9,8 +10,8 @@ import * as UserUtils from '@libs/UserUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import {DateOfBirthForm, PersonalDetails, PersonalDetailsList, PrivatePersonalDetails} from '@src/types/onyx'; -import {SelectedTimezone, Timezone} from '@src/types/onyx/PersonalDetails'; +import type {DateOfBirthForm, PersonalDetails, PersonalDetailsList, PrivatePersonalDetails} from '@src/types/onyx'; +import type {SelectedTimezone, Timezone} from '@src/types/onyx/PersonalDetails'; type FirstAndLastName = { firstName: string; diff --git a/src/libs/actions/PriorityMode.ts b/src/libs/actions/PriorityMode.ts index d528c31d7453..1d38d09e08a1 100644 --- a/src/libs/actions/PriorityMode.ts +++ b/src/libs/actions/PriorityMode.ts @@ -1,10 +1,11 @@ import debounce from 'lodash/debounce'; -import Onyx, {OnyxCollection} from 'react-native-onyx'; +import type {OnyxCollection} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import * as CollectionUtils from '@libs/CollectionUtils'; import Log from '@libs/Log'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {Report} from '@src/types/onyx'; +import type {Report} from '@src/types/onyx'; /** * This actions file is used to automatically switch a user into #focus mode when they exceed a certain number of reports. We do this primarily for performance reasons. diff --git a/src/libs/actions/QueuedOnyxUpdates.ts b/src/libs/actions/QueuedOnyxUpdates.ts index 1707bebd6cb2..83bc6652cb39 100644 --- a/src/libs/actions/QueuedOnyxUpdates.ts +++ b/src/libs/actions/QueuedOnyxUpdates.ts @@ -1,4 +1,5 @@ -import Onyx, {OnyxUpdate} from 'react-native-onyx'; +import type {OnyxUpdate} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; // In this file we manage a queue of Onyx updates while the SequentialQueue is processing. There are functions to get the updates and clear the queue after saving the updates in Onyx. diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index da0bfd9c058b..9b8e68168df7 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3,10 +3,11 @@ import ExpensiMark from 'expensify-common/lib/ExpensiMark'; import Str from 'expensify-common/lib/str'; import isEmpty from 'lodash/isEmpty'; import {DeviceEventEmitter, InteractionManager} from 'react-native'; -import Onyx, {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; -import {NullishDeep} from 'react-native-onyx/lib/types'; -import {PartialDeep, ValueOf} from 'type-fest'; -import {Emoji} from '@assets/emojis/types'; +import type {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {NullishDeep} from 'react-native-onyx/lib/types'; +import type {PartialDeep, ValueOf} from 'type-fest'; +import type {Emoji} from '@assets/emojis/types'; import * as ActiveClientManager from '@libs/ActiveClientManager'; import * as API from '@libs/API'; import * as CollectionUtils from '@libs/CollectionUtils'; @@ -28,12 +29,16 @@ import Visibility from '@libs/Visibility'; import CONFIG from '@src/CONFIG'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES, {Route} from '@src/ROUTES'; -import {PersonalDetails, PersonalDetailsList, ReportActionReactions, ReportUserIsTyping} from '@src/types/onyx'; -import {Decision, OriginalMessageIOU} from '@src/types/onyx/OriginalMessage'; -import Report, {NotificationPreference, WriteCapability} from '@src/types/onyx/Report'; -import ReportAction, {Message, ReportActionBase, ReportActions} from '@src/types/onyx/ReportAction'; -import {EmptyObject, isEmptyObject, isNotEmptyObject} from '@src/types/utils/EmptyObject'; +import type {Route} from '@src/ROUTES'; +import ROUTES from '@src/ROUTES'; +import type {PersonalDetails, PersonalDetailsList, ReportActionReactions, ReportUserIsTyping} from '@src/types/onyx'; +import type {Decision, OriginalMessageIOU} from '@src/types/onyx/OriginalMessage'; +import type {NotificationPreference, WriteCapability} from '@src/types/onyx/Report'; +import type Report from '@src/types/onyx/Report'; +import type {Message, ReportActionBase, ReportActions} from '@src/types/onyx/ReportAction'; +import type ReportAction from '@src/types/onyx/ReportAction'; +import type {EmptyObject} from '@src/types/utils/EmptyObject'; +import { isEmptyObject, isNotEmptyObject} from '@src/types/utils/EmptyObject'; import * as Session from './Session'; import * as Welcome from './Welcome'; diff --git a/src/libs/actions/ReportActions.ts b/src/libs/actions/ReportActions.ts index 7cd72fb4cd49..31f06a5f0372 100644 --- a/src/libs/actions/ReportActions.ts +++ b/src/libs/actions/ReportActions.ts @@ -3,7 +3,7 @@ import * as ReportActionUtils from '@libs/ReportActionsUtils'; import * as ReportUtils from '@libs/ReportUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ReportAction from '@src/types/onyx/ReportAction'; +import type ReportAction from '@src/types/onyx/ReportAction'; import * as Report from './Report'; function clearReportActionErrors(reportID: string, reportAction: ReportAction) { diff --git a/src/libs/actions/Session/clearCache/index.native.ts b/src/libs/actions/Session/clearCache/index.native.ts index ce2e6beafa9f..a89c5f4d4a1e 100644 --- a/src/libs/actions/Session/clearCache/index.native.ts +++ b/src/libs/actions/Session/clearCache/index.native.ts @@ -1,5 +1,5 @@ import {CachesDirectoryPath, unlink} from 'react-native-fs'; -import ClearCache from './types'; +import type ClearCache from './types'; // `unlink` is used to delete the caches directory const clearStorage: ClearCache = () => unlink(CachesDirectoryPath); diff --git a/src/libs/actions/Session/clearCache/index.ts b/src/libs/actions/Session/clearCache/index.ts index 2722d8636a75..6d288c6cbd3b 100644 --- a/src/libs/actions/Session/clearCache/index.ts +++ b/src/libs/actions/Session/clearCache/index.ts @@ -1,4 +1,4 @@ -import ClearCache from './types'; +import type ClearCache from './types'; const clearStorage: ClearCache = () => new Promise((res) => res()); diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index a667e054fb92..67f531bff505 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -1,9 +1,10 @@ import throttle from 'lodash/throttle'; -import {ChannelAuthorizationData} from 'pusher-js/types/src/core/auth/options'; -import {ChannelAuthorizationCallback} from 'pusher-js/with-encryption'; +import type {ChannelAuthorizationData} from 'pusher-js/types/src/core/auth/options'; +import type {ChannelAuthorizationCallback} from 'pusher-js/with-encryption'; import {Linking} from 'react-native'; -import Onyx, {OnyxUpdate} from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; +import type {OnyxUpdate} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; import * as PersistedRequests from '@libs/actions/PersistedRequests'; import * as API from '@libs/API'; import * as Authentication from '@libs/Authentication'; @@ -30,8 +31,8 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; -import Credentials from '@src/types/onyx/Credentials'; -import {AutoAuthState} from '@src/types/onyx/Session'; +import type Credentials from '@src/types/onyx/Credentials'; +import type {AutoAuthState} from '@src/types/onyx/Session'; import clearCache from './clearCache'; let sessionAuthTokenType: string | null = ''; diff --git a/src/libs/actions/SignInRedirect.ts b/src/libs/actions/SignInRedirect.ts index 6c9e7f55d887..ecb09ccd1804 100644 --- a/src/libs/actions/SignInRedirect.ts +++ b/src/libs/actions/SignInRedirect.ts @@ -1,6 +1,7 @@ import Onyx from 'react-native-onyx'; import * as ErrorUtils from '@libs/ErrorUtils'; -import ONYXKEYS, {OnyxKey} from '@src/ONYXKEYS'; +import type {OnyxKey} from '@src/ONYXKEYS'; +import ONYXKEYS from '@src/ONYXKEYS'; let currentIsOffline: boolean | undefined; let currentShouldForceOffline: boolean | undefined; diff --git a/src/libs/actions/Transaction.ts b/src/libs/actions/Transaction.ts index 951851d72eb3..c0702e49bdbf 100644 --- a/src/libs/actions/Transaction.ts +++ b/src/libs/actions/Transaction.ts @@ -7,9 +7,9 @@ import * as CollectionUtils from '@libs/CollectionUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {RecentWaypoint, Transaction} from '@src/types/onyx'; -import {OnyxData} from '@src/types/onyx/Request'; -import {WaypointCollection} from '@src/types/onyx/Transaction'; +import type {RecentWaypoint, Transaction} from '@src/types/onyx'; +import type {OnyxData} from '@src/types/onyx/Request'; +import type {WaypointCollection} from '@src/types/onyx/Transaction'; import * as IOU from './IOU'; let recentWaypoints: RecentWaypoint[] = []; diff --git a/src/libs/actions/TwoFactorAuthActions.ts b/src/libs/actions/TwoFactorAuthActions.ts index 26e402096aa6..c4b74836f9db 100644 --- a/src/libs/actions/TwoFactorAuthActions.ts +++ b/src/libs/actions/TwoFactorAuthActions.ts @@ -1,8 +1,9 @@ import Onyx from 'react-native-onyx'; import Navigation from '@libs/Navigation/Navigation'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES, {Route} from '@src/ROUTES'; -import {TwoFactorAuthStep} from '@src/types/onyx/Account'; +import type {Route} from '@src/ROUTES'; +import ROUTES from '@src/ROUTES'; +import type {TwoFactorAuthStep} from '@src/types/onyx/Account'; /** * Clear 2FA data if the flow is interrupted without finishing diff --git a/src/libs/actions/UserLocation.ts b/src/libs/actions/UserLocation.ts index 4c58f7a83284..699b701904e4 100644 --- a/src/libs/actions/UserLocation.ts +++ b/src/libs/actions/UserLocation.ts @@ -1,6 +1,6 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; -import {UserLocation} from '@src/types/onyx'; +import type {UserLocation} from '@src/types/onyx'; /** * Sets the longitude and latitude of user's current location diff --git a/src/libs/actions/Welcome.ts b/src/libs/actions/Welcome.ts index 02109804efb9..5046449c7389 100644 --- a/src/libs/actions/Welcome.ts +++ b/src/libs/actions/Welcome.ts @@ -1,12 +1,13 @@ -import Onyx, {OnyxCollection} from 'react-native-onyx'; +import type {OnyxCollection} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; -import OnyxPolicy from '@src/types/onyx/Policy'; -import Report from '@src/types/onyx/Report'; +import type OnyxPolicy from '@src/types/onyx/Policy'; +import type Report from '@src/types/onyx/Report'; import * as Policy from './Policy'; let resolveIsReadyPromise: (value?: Promise) => void | undefined; diff --git a/src/libs/asyncOpenURL/index.ts b/src/libs/asyncOpenURL/index.ts index 5307049ee923..8fca6891e9d6 100644 --- a/src/libs/asyncOpenURL/index.ts +++ b/src/libs/asyncOpenURL/index.ts @@ -1,5 +1,5 @@ import {Linking} from 'react-native'; -import AsyncOpenURL from './types'; +import type AsyncOpenURL from './types'; const asyncOpenURL: AsyncOpenURL = (promise, url) => { if (!url) { diff --git a/src/libs/asyncOpenURL/index.website.ts b/src/libs/asyncOpenURL/index.website.ts index d503644c1392..b781c4f605cb 100644 --- a/src/libs/asyncOpenURL/index.website.ts +++ b/src/libs/asyncOpenURL/index.website.ts @@ -1,5 +1,5 @@ import {Linking} from 'react-native'; -import AsyncOpenURL from './types'; +import type AsyncOpenURL from './types'; /** * Prevents Safari from blocking pop-up window when opened within async call. diff --git a/src/libs/calculateAnchorPosition.ts b/src/libs/calculateAnchorPosition.ts index b9d0f553ca4f..66966b7b504c 100644 --- a/src/libs/calculateAnchorPosition.ts +++ b/src/libs/calculateAnchorPosition.ts @@ -1,6 +1,6 @@ /* eslint-disable no-console */ -import {View} from 'react-native'; -import {ValueOf} from 'type-fest'; +import type {View} from 'react-native'; +import type {ValueOf} from 'type-fest'; import CONST from '@src/CONST'; import type {AnchorPosition} from '@src/styles'; diff --git a/src/libs/canFocusInputOnScreenFocus/index.native.ts b/src/libs/canFocusInputOnScreenFocus/index.native.ts index 79d711c49fa6..d8a093573387 100644 --- a/src/libs/canFocusInputOnScreenFocus/index.native.ts +++ b/src/libs/canFocusInputOnScreenFocus/index.native.ts @@ -1,4 +1,4 @@ -import CanFocusInputOnScreenFocus from './types'; +import type CanFocusInputOnScreenFocus from './types'; const canFocusInputOnScreenFocus: CanFocusInputOnScreenFocus = () => false; diff --git a/src/libs/canFocusInputOnScreenFocus/index.ts b/src/libs/canFocusInputOnScreenFocus/index.ts index 57baac02245d..65cebd43cfe0 100644 --- a/src/libs/canFocusInputOnScreenFocus/index.ts +++ b/src/libs/canFocusInputOnScreenFocus/index.ts @@ -1,5 +1,5 @@ import * as DeviceCapabilities from '@libs/DeviceCapabilities'; -import CanFocusInputOnScreenFocus from './types'; +import type CanFocusInputOnScreenFocus from './types'; const canFocusInputOnScreenFocus: CanFocusInputOnScreenFocus = () => !DeviceCapabilities.canUseTouchScreen(); diff --git a/src/libs/convertToLTR/index.android.ts b/src/libs/convertToLTR/index.android.ts index d73fd3de7a21..07f761752307 100644 --- a/src/libs/convertToLTR/index.android.ts +++ b/src/libs/convertToLTR/index.android.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import ConvertToLTR from './types'; +import type ConvertToLTR from './types'; /** * Android only - convert RTL text to a LTR text using Unicode controls. diff --git a/src/libs/convertToLTR/index.ts b/src/libs/convertToLTR/index.ts index 58d8be93836e..5c2df7c39c2c 100644 --- a/src/libs/convertToLTR/index.ts +++ b/src/libs/convertToLTR/index.ts @@ -1,4 +1,4 @@ -import ConvertToLTR from './types'; +import type ConvertToLTR from './types'; const convertToLTR: ConvertToLTR = (text) => text; diff --git a/src/libs/convertToLTRForComposer/index.android.ts b/src/libs/convertToLTRForComposer/index.android.ts index 09e7f2e5cd87..cf288142f464 100644 --- a/src/libs/convertToLTRForComposer/index.android.ts +++ b/src/libs/convertToLTRForComposer/index.android.ts @@ -1,4 +1,4 @@ -import ConvertToLTRForComposer from './types'; +import type ConvertToLTRForComposer from './types'; /** * Android only - Do not convert RTL text to a LTR text for input box using Unicode controls. diff --git a/src/libs/convertToLTRForComposer/index.ts b/src/libs/convertToLTRForComposer/index.ts index dd6ee50d862e..804f5a4cd7e5 100644 --- a/src/libs/convertToLTRForComposer/index.ts +++ b/src/libs/convertToLTRForComposer/index.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import ConvertToLTRForComposer from './types'; +import type ConvertToLTRForComposer from './types'; function hasRTLCharacters(text: string): boolean { // Regular expressions to match RTL character ranges. diff --git a/src/libs/cropOrRotateImage/index.native.ts b/src/libs/cropOrRotateImage/index.native.ts index 08a5ecb04f6b..c3fed59ba4fa 100644 --- a/src/libs/cropOrRotateImage/index.native.ts +++ b/src/libs/cropOrRotateImage/index.native.ts @@ -1,6 +1,6 @@ import RNImageManipulator from '@oguzhnatly/react-native-image-manipulator'; import RNFetchBlob from 'react-native-blob-util'; -import {CropOrRotateImage} from './types'; +import type {CropOrRotateImage} from './types'; /** * Crops and rotates the image on ios/android diff --git a/src/libs/cropOrRotateImage/index.ts b/src/libs/cropOrRotateImage/index.ts index a66ddbb40b00..ea3d51a465ec 100644 --- a/src/libs/cropOrRotateImage/index.ts +++ b/src/libs/cropOrRotateImage/index.ts @@ -1,4 +1,4 @@ -import {CropOptions, CropOrRotateImage, CropOrRotateImageOptions} from './types'; +import type {CropOptions, CropOrRotateImage, CropOrRotateImageOptions} from './types'; type SizeFromAngle = { width: number; diff --git a/src/libs/cropOrRotateImage/types.ts b/src/libs/cropOrRotateImage/types.ts index 188d557a1258..f882e4f9bea2 100644 --- a/src/libs/cropOrRotateImage/types.ts +++ b/src/libs/cropOrRotateImage/types.ts @@ -1,4 +1,4 @@ -import {RNImageManipulatorResult} from '@oguzhnatly/react-native-image-manipulator'; +import type {RNImageManipulatorResult} from '@oguzhnatly/react-native-image-manipulator'; type CropOrRotateImageOptions = { type: string; diff --git a/src/libs/fileDownload/getImageResolution.native.ts b/src/libs/fileDownload/getImageResolution.native.ts index 3bdff78a93ed..645148ef5194 100644 --- a/src/libs/fileDownload/getImageResolution.native.ts +++ b/src/libs/fileDownload/getImageResolution.native.ts @@ -1,4 +1,4 @@ -import {Asset} from 'react-native-image-picker'; +import type {Asset} from 'react-native-image-picker'; import type {GetImageResolution} from './types'; /** diff --git a/src/libs/fileDownload/index.android.ts b/src/libs/fileDownload/index.android.ts index 8496c1cb6cf5..577a42dd14a3 100644 --- a/src/libs/fileDownload/index.android.ts +++ b/src/libs/fileDownload/index.android.ts @@ -1,5 +1,6 @@ import {PermissionsAndroid, Platform} from 'react-native'; -import RNFetchBlob, {FetchBlobResponse} from 'react-native-blob-util'; +import type {FetchBlobResponse} from 'react-native-blob-util'; +import RNFetchBlob from 'react-native-blob-util'; import * as FileUtils from './FileUtils'; import type {FileDownload} from './types'; diff --git a/src/libs/fileDownload/types.ts b/src/libs/fileDownload/types.ts index c7388f2e52a2..bc8ba0807eb1 100644 --- a/src/libs/fileDownload/types.ts +++ b/src/libs/fileDownload/types.ts @@ -1,4 +1,4 @@ -import {Asset} from 'react-native-image-picker'; +import type {Asset} from 'react-native-image-picker'; type FileDownload = (url: string, fileName: string) => Promise; diff --git a/src/libs/focusAndUpdateMultilineInputRange.ts b/src/libs/focusAndUpdateMultilineInputRange.ts index 92da790e383f..2e4a3d23631e 100644 --- a/src/libs/focusAndUpdateMultilineInputRange.ts +++ b/src/libs/focusAndUpdateMultilineInputRange.ts @@ -1,4 +1,4 @@ -import {TextInput} from 'react-native'; +import type {TextInput} from 'react-native'; /** * Focus a multiline text input and place the cursor at the end of the value (if there is a value in the input). diff --git a/src/libs/focusComposerWithDelay.ts b/src/libs/focusComposerWithDelay.ts index 19f1050d24bd..6a2f85f7d311 100644 --- a/src/libs/focusComposerWithDelay.ts +++ b/src/libs/focusComposerWithDelay.ts @@ -1,4 +1,4 @@ -import {TextInput} from 'react-native'; +import type {TextInput} from 'react-native'; import * as EmojiPickerAction from './actions/EmojiPickerAction'; import ComposerFocusManager from './ComposerFocusManager'; diff --git a/src/libs/focusTextInputAfterAnimation/index.android.ts b/src/libs/focusTextInputAfterAnimation/index.android.ts index 5de1f1f4696b..31c748f5daa4 100644 --- a/src/libs/focusTextInputAfterAnimation/index.android.ts +++ b/src/libs/focusTextInputAfterAnimation/index.android.ts @@ -1,4 +1,4 @@ -import FocusTextInputAfterAnimation from './types'; +import type FocusTextInputAfterAnimation from './types'; /** * Initially this file is intended for native ios but use index.native.js filename and affects android. diff --git a/src/libs/focusTextInputAfterAnimation/index.ts b/src/libs/focusTextInputAfterAnimation/index.ts index 1e3211372b41..3f7c6555b5ce 100644 --- a/src/libs/focusTextInputAfterAnimation/index.ts +++ b/src/libs/focusTextInputAfterAnimation/index.ts @@ -1,4 +1,4 @@ -import FocusTextInputAfterAnimation from './types'; +import type FocusTextInputAfterAnimation from './types'; /** * This library is a no-op for all platforms except for Android and iOS and will immediately focus the given input without any delays. diff --git a/src/libs/focusTextInputAfterAnimation/types.ts b/src/libs/focusTextInputAfterAnimation/types.ts index 905ac7db4b7a..a6a14165598b 100644 --- a/src/libs/focusTextInputAfterAnimation/types.ts +++ b/src/libs/focusTextInputAfterAnimation/types.ts @@ -1,4 +1,4 @@ -import {TextInput} from 'react-native'; +import type {TextInput} from 'react-native'; type FocusTextInputAfterAnimation = (inputRef: TextInput | HTMLInputElement, animationLength: number) => void; diff --git a/src/libs/getButtonState.ts b/src/libs/getButtonState.ts index fe593b9f613e..fc0609ace1f6 100644 --- a/src/libs/getButtonState.ts +++ b/src/libs/getButtonState.ts @@ -1,4 +1,4 @@ -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import CONST from '@src/CONST'; /** diff --git a/src/libs/getClickedTargetLocation/index.native.ts b/src/libs/getClickedTargetLocation/index.native.ts index 1755d4e4ac99..a07dd9a8d0da 100644 --- a/src/libs/getClickedTargetLocation/index.native.ts +++ b/src/libs/getClickedTargetLocation/index.native.ts @@ -1,4 +1,4 @@ -import GetClickedTargetLocation from './types'; +import type GetClickedTargetLocation from './types'; /** * We don't need to get the position of the element on native platforms because the popover will be bottom mounted diff --git a/src/libs/getClickedTargetLocation/index.ts b/src/libs/getClickedTargetLocation/index.ts index e218700c3355..f7d12995a2bf 100644 --- a/src/libs/getClickedTargetLocation/index.ts +++ b/src/libs/getClickedTargetLocation/index.ts @@ -1,4 +1,4 @@ -import GetClickedTargetLocation from './types'; +import type GetClickedTargetLocation from './types'; /** * Returns the Bounding Rectangle for the passed native event's target. diff --git a/src/libs/getComponentDisplayName.ts b/src/libs/getComponentDisplayName.ts index 0bf52d543a84..da5eef5212e0 100644 --- a/src/libs/getComponentDisplayName.ts +++ b/src/libs/getComponentDisplayName.ts @@ -1,4 +1,4 @@ -import {ComponentType} from 'react'; +import type {ComponentType} from 'react'; /** Returns the display name of a component */ export default function getComponentDisplayName(component: ComponentType): string { diff --git a/src/libs/getCurrentPosition/index.android.ts b/src/libs/getCurrentPosition/index.android.ts index b29483a5c672..77ecdf236149 100644 --- a/src/libs/getCurrentPosition/index.android.ts +++ b/src/libs/getCurrentPosition/index.android.ts @@ -2,7 +2,8 @@ // If we update our react native version, we need to test this file again import Geolocation from '@react-native-community/geolocation'; import RNAndroidLocationEnabler from 'react-native-android-location-enabler'; -import {GeolocationErrorCode, GetCurrentPosition} from './getCurrentPosition.types'; +import type { GetCurrentPosition} from './getCurrentPosition.types'; +import {GeolocationErrorCode} from './getCurrentPosition.types'; Geolocation.setRNConfiguration({ skipPermissionRequests: false, diff --git a/src/libs/getCurrentPosition/index.ios.ts b/src/libs/getCurrentPosition/index.ios.ts index fb513c4afd16..e64abb0d4329 100644 --- a/src/libs/getCurrentPosition/index.ios.ts +++ b/src/libs/getCurrentPosition/index.ios.ts @@ -1,5 +1,5 @@ import Geolocation from '@react-native-community/geolocation'; -import {GetCurrentPosition} from './getCurrentPosition.types'; +import type {GetCurrentPosition} from './getCurrentPosition.types'; Geolocation.setRNConfiguration({ skipPermissionRequests: false, diff --git a/src/libs/getCurrentPosition/index.ts b/src/libs/getCurrentPosition/index.ts index 11112b0682f8..2bfefe431892 100644 --- a/src/libs/getCurrentPosition/index.ts +++ b/src/libs/getCurrentPosition/index.ts @@ -1,4 +1,5 @@ -import {GeolocationErrorCode, GetCurrentPosition} from './getCurrentPosition.types'; +import type { GetCurrentPosition} from './getCurrentPosition.types'; +import {GeolocationErrorCode} from './getCurrentPosition.types'; const getCurrentPosition: GetCurrentPosition = (success, error, options) => { if (navigator === undefined || !('geolocation' in navigator)) { diff --git a/src/libs/getModalState.ts b/src/libs/getModalState.ts index 47aa0c406b29..8906718d9168 100644 --- a/src/libs/getModalState.ts +++ b/src/libs/getModalState.ts @@ -1,6 +1,7 @@ -import Onyx, {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; -import Modal from '@src/types/onyx/Modal'; +import type Modal from '@src/types/onyx/Modal'; let modalState: OnyxEntry = {}; diff --git a/src/libs/getOperatingSystem/index.native.ts b/src/libs/getOperatingSystem/index.native.ts index f3e856cb14c9..67f27dcfec28 100644 --- a/src/libs/getOperatingSystem/index.native.ts +++ b/src/libs/getOperatingSystem/index.native.ts @@ -1,6 +1,6 @@ import {Platform} from 'react-native'; import CONST from '@src/CONST'; -import GetOperatingSystem from './types'; +import type GetOperatingSystem from './types'; /** * Reads the current operating system for native platforms. diff --git a/src/libs/getOperatingSystem/index.ts b/src/libs/getOperatingSystem/index.ts index 630595d97471..7e59a1f88b98 100644 --- a/src/libs/getOperatingSystem/index.ts +++ b/src/libs/getOperatingSystem/index.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import GetOperatingSystem from './types'; +import type GetOperatingSystem from './types'; /** * Reads the current operating system when running on Web/Mobile-Web/Desktop diff --git a/src/libs/getOperatingSystem/types.ts b/src/libs/getOperatingSystem/types.ts index a4b3046b4cd9..055ba488f760 100644 --- a/src/libs/getOperatingSystem/types.ts +++ b/src/libs/getOperatingSystem/types.ts @@ -1,5 +1,5 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; type OS = ValueOf | null; type GetOperatingSystem = () => OS; diff --git a/src/libs/getPermittedDecimalSeparator/index.ios.ts b/src/libs/getPermittedDecimalSeparator/index.ios.ts index f7c2d1eeaa9f..6ccbf48a5622 100644 --- a/src/libs/getPermittedDecimalSeparator/index.ios.ts +++ b/src/libs/getPermittedDecimalSeparator/index.ios.ts @@ -1,6 +1,6 @@ // On iOS keyboard can only have one symbol at a time (either dot or comma) so we accept both // Details: https://expensify.slack.com/archives/C01GTK53T8Q/p1658936908481629 -import GetPermittedDecimalSeparator from './types'; +import type GetPermittedDecimalSeparator from './types'; const getPermittedDecimalSeparator: GetPermittedDecimalSeparator = () => '.,'; diff --git a/src/libs/getPermittedDecimalSeparator/index.ts b/src/libs/getPermittedDecimalSeparator/index.ts index 120e9e046aff..ae9883729259 100644 --- a/src/libs/getPermittedDecimalSeparator/index.ts +++ b/src/libs/getPermittedDecimalSeparator/index.ts @@ -1,7 +1,7 @@ import getOperatingSystem from '@libs/getOperatingSystem'; import CONST from '@src/CONST'; import getPermittedDecimalSeparatorIOS from './index.ios'; -import GetPermittedDecimalSeparator from './types'; +import type GetPermittedDecimalSeparator from './types'; const getPermittedDecimalSeparator: GetPermittedDecimalSeparator = (localizedSeparator) => { if (getOperatingSystem() === CONST.OS.IOS) { diff --git a/src/libs/getPlaidDesktopMessage/index.desktop.ts b/src/libs/getPlaidDesktopMessage/index.desktop.ts index 93a336af8227..b43d6630d81b 100644 --- a/src/libs/getPlaidDesktopMessage/index.desktop.ts +++ b/src/libs/getPlaidDesktopMessage/index.desktop.ts @@ -1,4 +1,4 @@ -import GetPlaidDesktopMessage from './types'; +import type GetPlaidDesktopMessage from './types'; const getPlaidDesktopMessage: GetPlaidDesktopMessage = () => 'bankAccount.desktopConnection'; diff --git a/src/libs/getPlaidDesktopMessage/index.ts b/src/libs/getPlaidDesktopMessage/index.ts index deccb4df0ac2..ba40c7819222 100644 --- a/src/libs/getPlaidDesktopMessage/index.ts +++ b/src/libs/getPlaidDesktopMessage/index.ts @@ -1,4 +1,4 @@ -import GetPlaidDesktopMessage from './types'; +import type GetPlaidDesktopMessage from './types'; const getPlaidDesktopMessage: GetPlaidDesktopMessage = () => undefined; diff --git a/src/libs/getPlaidLinkTokenParameters/index.android.ts b/src/libs/getPlaidLinkTokenParameters/index.android.ts index c7e2aa8efd1e..f5caa28906c2 100644 --- a/src/libs/getPlaidLinkTokenParameters/index.android.ts +++ b/src/libs/getPlaidLinkTokenParameters/index.android.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import GetPlaidLinkTokenParameters from './types'; +import type GetPlaidLinkTokenParameters from './types'; const getPlaidLinkTokenParameters: GetPlaidLinkTokenParameters = () => ({ androidPackage: CONST.ANDROID_PACKAGE_NAME, diff --git a/src/libs/getPlaidLinkTokenParameters/index.ios.ts b/src/libs/getPlaidLinkTokenParameters/index.ios.ts index 8c69ddc71bb2..b15b7e92813a 100644 --- a/src/libs/getPlaidLinkTokenParameters/index.ios.ts +++ b/src/libs/getPlaidLinkTokenParameters/index.ios.ts @@ -1,5 +1,5 @@ import CONFIG from '@src/CONFIG'; -import GetPlaidLinkTokenParameters from './types'; +import type GetPlaidLinkTokenParameters from './types'; const getPlaidLinkTokenParameters: GetPlaidLinkTokenParameters = () => ({ redirectURI: `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}partners/plaid/oauth_ios`, diff --git a/src/libs/getPlaidLinkTokenParameters/index.ts b/src/libs/getPlaidLinkTokenParameters/index.ts index 570951e3d683..9218c7d37002 100644 --- a/src/libs/getPlaidLinkTokenParameters/index.ts +++ b/src/libs/getPlaidLinkTokenParameters/index.ts @@ -1,6 +1,6 @@ import CONFIG from '@src/CONFIG'; import ROUTES from '@src/ROUTES'; -import GetPlaidLinkTokenParameters from './types'; +import type GetPlaidLinkTokenParameters from './types'; const getPlaidLinkTokenParameters: GetPlaidLinkTokenParameters = () => { const bankAccountRoute = window.location.href.includes('personal') ? ROUTES.BANK_ACCOUNT_PERSONAL : ROUTES.BANK_ACCOUNT; diff --git a/src/libs/getPlaidOAuthReceivedRedirectURI/index.native.ts b/src/libs/getPlaidOAuthReceivedRedirectURI/index.native.ts index c435d1799cb8..49660dd6f077 100644 --- a/src/libs/getPlaidOAuthReceivedRedirectURI/index.native.ts +++ b/src/libs/getPlaidOAuthReceivedRedirectURI/index.native.ts @@ -1,4 +1,4 @@ -import GetPlaidOAuthReceivedRedirectURI from './types'; +import type GetPlaidOAuthReceivedRedirectURI from './types'; const getPlaidOAuthReceivedRedirectURI: GetPlaidOAuthReceivedRedirectURI = () => null; diff --git a/src/libs/getPlaidOAuthReceivedRedirectURI/index.ts b/src/libs/getPlaidOAuthReceivedRedirectURI/index.ts index 8492a2d9c91e..c140d1c3339f 100644 --- a/src/libs/getPlaidOAuthReceivedRedirectURI/index.ts +++ b/src/libs/getPlaidOAuthReceivedRedirectURI/index.ts @@ -1,4 +1,4 @@ -import GetPlaidOAuthReceivedRedirectURI from './types'; +import type GetPlaidOAuthReceivedRedirectURI from './types'; /** * After a user authenticates their bank in the Plaid OAuth flow, Plaid returns us to the redirectURI we diff --git a/src/libs/getPlatform/index.android.ts b/src/libs/getPlatform/index.android.ts index a0f4edb055af..a704f18ad11b 100644 --- a/src/libs/getPlatform/index.android.ts +++ b/src/libs/getPlatform/index.android.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import Platform from './types'; +import type Platform from './types'; export default function getPlatform(): Platform { return CONST.PLATFORM.ANDROID; diff --git a/src/libs/getPlatform/index.desktop.ts b/src/libs/getPlatform/index.desktop.ts index 0b90b5f121bb..4bf042159758 100644 --- a/src/libs/getPlatform/index.desktop.ts +++ b/src/libs/getPlatform/index.desktop.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import Platform from './types'; +import type Platform from './types'; export default function getPlatform(): Platform { return CONST.PLATFORM.DESKTOP; diff --git a/src/libs/getPlatform/index.ios.ts b/src/libs/getPlatform/index.ios.ts index ee35c8b610bc..9b7155b50cad 100644 --- a/src/libs/getPlatform/index.ios.ts +++ b/src/libs/getPlatform/index.ios.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import Platform from './types'; +import type Platform from './types'; export default function getPlatform(): Platform { return CONST.PLATFORM.IOS; diff --git a/src/libs/getPlatform/index.ts b/src/libs/getPlatform/index.ts index ca87e79170f5..5f5b45ac6e7d 100644 --- a/src/libs/getPlatform/index.ts +++ b/src/libs/getPlatform/index.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import Platform from './types'; +import type Platform from './types'; export default function getPlatform(): Platform { return CONST.PLATFORM.WEB; diff --git a/src/libs/getPlatform/types.ts b/src/libs/getPlatform/types.ts index 9c43c696a6f8..1ffc18f311de 100644 --- a/src/libs/getPlatform/types.ts +++ b/src/libs/getPlatform/types.ts @@ -1,5 +1,5 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; type Platform = ValueOf; diff --git a/src/libs/getSecureEntryKeyboardType/index.android.ts b/src/libs/getSecureEntryKeyboardType/index.android.ts index bc50e202381b..6cded09f1d49 100644 --- a/src/libs/getSecureEntryKeyboardType/index.android.ts +++ b/src/libs/getSecureEntryKeyboardType/index.android.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import GetSecureEntryKeyboardType from './types'; +import type GetSecureEntryKeyboardType from './types'; /** * Return visible-password keyboard type when secure text is visible on Android, diff --git a/src/libs/getSecureEntryKeyboardType/index.ts b/src/libs/getSecureEntryKeyboardType/index.ts index 030a88e60e84..1b8f5d9f20ba 100644 --- a/src/libs/getSecureEntryKeyboardType/index.ts +++ b/src/libs/getSecureEntryKeyboardType/index.ts @@ -1,4 +1,4 @@ -import GetSecureEntryKeyboardType from './types'; +import type GetSecureEntryKeyboardType from './types'; /** * Return keyboardType passed as function parameter on Web/Desktop/iOS diff --git a/src/libs/getSecureEntryKeyboardType/types.ts b/src/libs/getSecureEntryKeyboardType/types.ts index 750c84133ea2..3664d27cadec 100644 --- a/src/libs/getSecureEntryKeyboardType/types.ts +++ b/src/libs/getSecureEntryKeyboardType/types.ts @@ -1,4 +1,4 @@ -import {KeyboardTypeOptions} from 'react-native'; +import type {KeyboardTypeOptions} from 'react-native'; type GetSecureEntryKeyboardType = (keyboardType: KeyboardTypeOptions | undefined, secureTextEntry: boolean, passwordHidden: boolean) => KeyboardTypeOptions | undefined; diff --git a/src/libs/getWindowHeightAdjustment/index.android.ts b/src/libs/getWindowHeightAdjustment/index.android.ts index 1a06e663d4e3..6117e7ed4a8e 100644 --- a/src/libs/getWindowHeightAdjustment/index.android.ts +++ b/src/libs/getWindowHeightAdjustment/index.android.ts @@ -1,4 +1,4 @@ -import GetWindowHeightAdjustment from './types'; +import type GetWindowHeightAdjustment from './types'; // On Android the window height does not include the status bar height, so we need to add it manually. const getWindowHeightAdjustment: GetWindowHeightAdjustment = (insets) => insets?.top ?? 0; diff --git a/src/libs/getWindowHeightAdjustment/index.ts b/src/libs/getWindowHeightAdjustment/index.ts index 9a768d00cd4d..c8ca7f8b48df 100644 --- a/src/libs/getWindowHeightAdjustment/index.ts +++ b/src/libs/getWindowHeightAdjustment/index.ts @@ -1,4 +1,4 @@ -import GetWindowHeightAdjustment from './types'; +import type GetWindowHeightAdjustment from './types'; // Some platforms need to adjust the window height. const getWindowHeightAdjustment: GetWindowHeightAdjustment = () => 0; diff --git a/src/libs/getWindowHeightAdjustment/types.ts b/src/libs/getWindowHeightAdjustment/types.ts index ddb6723f6320..07d5c74bff27 100644 --- a/src/libs/getWindowHeightAdjustment/types.ts +++ b/src/libs/getWindowHeightAdjustment/types.ts @@ -1,4 +1,4 @@ -import {EdgeInsets} from 'react-native-safe-area-context'; +import type {EdgeInsets} from 'react-native-safe-area-context'; type GetWindowHeightAdjustment = (insets: EdgeInsets | null) => number; diff --git a/src/libs/isInputAutoFilled.ts b/src/libs/isInputAutoFilled.ts index fbe6240def47..a6dda57f41ec 100644 --- a/src/libs/isInputAutoFilled.ts +++ b/src/libs/isInputAutoFilled.ts @@ -1,4 +1,4 @@ -import {TextInput} from 'react-native'; +import type {TextInput} from 'react-native'; import isSelectorSupported from './isSelectorSupported'; /** diff --git a/src/libs/isReportMessageAttachment.ts b/src/libs/isReportMessageAttachment.ts index 097f46465dc9..df8a589f7bdc 100644 --- a/src/libs/isReportMessageAttachment.ts +++ b/src/libs/isReportMessageAttachment.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import {Message} from '@src/types/onyx/ReportAction'; +import type {Message} from '@src/types/onyx/ReportAction'; /** * Check whether a report action is Attachment or not. diff --git a/src/libs/isSelectorSupported/index.native.ts b/src/libs/isSelectorSupported/index.native.ts index fa846e1410d9..bd14cf3f5d07 100644 --- a/src/libs/isSelectorSupported/index.native.ts +++ b/src/libs/isSelectorSupported/index.native.ts @@ -1,4 +1,4 @@ -import IsSelectorSupported from './types'; +import type IsSelectorSupported from './types'; // Native platforms do not support the selector const isSelectorSupported: IsSelectorSupported = () => false; diff --git a/src/libs/isSelectorSupported/index.ts b/src/libs/isSelectorSupported/index.ts index 4f5f0313243e..7ed05fdc944e 100644 --- a/src/libs/isSelectorSupported/index.ts +++ b/src/libs/isSelectorSupported/index.ts @@ -1,4 +1,4 @@ -import IsSelectorSupported from './types'; +import type IsSelectorSupported from './types'; /** * Check platform supports the selector or not diff --git a/src/libs/localFileDownload/index.android.ts b/src/libs/localFileDownload/index.android.ts index 4de6cbd0e940..b6d8ea13738f 100644 --- a/src/libs/localFileDownload/index.android.ts +++ b/src/libs/localFileDownload/index.android.ts @@ -1,6 +1,6 @@ import RNFetchBlob from 'react-native-blob-util'; import * as FileUtils from '@libs/fileDownload/FileUtils'; -import LocalFileDownload from './types'; +import type LocalFileDownload from './types'; /** * Writes a local file to the app's internal directory with the given fileName diff --git a/src/libs/localFileDownload/index.ios.ts b/src/libs/localFileDownload/index.ios.ts index 5461c6ffc4c4..892ab29d21f5 100644 --- a/src/libs/localFileDownload/index.ios.ts +++ b/src/libs/localFileDownload/index.ios.ts @@ -1,7 +1,7 @@ import {Share} from 'react-native'; import RNFetchBlob from 'react-native-blob-util'; import * as FileUtils from '@libs/fileDownload/FileUtils'; -import LocalFileDownload from './types'; +import type LocalFileDownload from './types'; /** * Writes a local file to the app's internal directory with the given fileName diff --git a/src/libs/localFileDownload/index.ts b/src/libs/localFileDownload/index.ts index 2a70a01f88c0..ba038b8853ad 100644 --- a/src/libs/localFileDownload/index.ts +++ b/src/libs/localFileDownload/index.ts @@ -1,5 +1,5 @@ import * as FileUtils from '@libs/fileDownload/FileUtils'; -import LocalFileDownload from './types'; +import type LocalFileDownload from './types'; /** * Creates a Blob with the given fileName and textContent, then dynamically diff --git a/src/libs/migrations/CheckForPreviousReportActionID.ts b/src/libs/migrations/CheckForPreviousReportActionID.ts index 1f31a3586b0a..d97bd87f0a2a 100644 --- a/src/libs/migrations/CheckForPreviousReportActionID.ts +++ b/src/libs/migrations/CheckForPreviousReportActionID.ts @@ -1,7 +1,8 @@ -import Onyx, {OnyxCollection} from 'react-native-onyx'; +import type {OnyxCollection} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import Log from '@libs/Log'; import ONYXKEYS from '@src/ONYXKEYS'; -import * as OnyxTypes from '@src/types/onyx'; +import type * as OnyxTypes from '@src/types/onyx'; function getReportActionsFromOnyx(): Promise> { return new Promise((resolve) => { diff --git a/src/libs/migrations/KeyReportActionsDraftByReportActionID.ts b/src/libs/migrations/KeyReportActionsDraftByReportActionID.ts index 1abe5a6114bb..dbf2829a6c28 100644 --- a/src/libs/migrations/KeyReportActionsDraftByReportActionID.ts +++ b/src/libs/migrations/KeyReportActionsDraftByReportActionID.ts @@ -1,7 +1,8 @@ -import Onyx, {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import Log from '@libs/Log'; import ONYXKEYS from '@src/ONYXKEYS'; -import {ReportActionsDrafts} from '@src/types/onyx'; +import type {ReportActionsDrafts} from '@src/types/onyx'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; type ReportActionsDraftsKey = `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`; diff --git a/src/libs/migrations/RemoveEmptyReportActionsDrafts.ts b/src/libs/migrations/RemoveEmptyReportActionsDrafts.ts index d8816198e537..48493a82d641 100644 --- a/src/libs/migrations/RemoveEmptyReportActionsDrafts.ts +++ b/src/libs/migrations/RemoveEmptyReportActionsDrafts.ts @@ -1,8 +1,9 @@ import _ from 'lodash'; -import Onyx, {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import Log from '@libs/Log'; import ONYXKEYS from '@src/ONYXKEYS'; -import {ReportActionsDraft, ReportActionsDrafts} from '@src/types/onyx'; +import type {ReportActionsDraft, ReportActionsDrafts} from '@src/types/onyx'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; type ReportActionsDraftsKey = `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`; diff --git a/src/libs/migrations/RenameReceiptFilename.ts b/src/libs/migrations/RenameReceiptFilename.ts index b2c19848aedb..dff2be5c286d 100644 --- a/src/libs/migrations/RenameReceiptFilename.ts +++ b/src/libs/migrations/RenameReceiptFilename.ts @@ -1,8 +1,8 @@ import Onyx from 'react-native-onyx'; -import {NullishDeep, OnyxCollection} from 'react-native-onyx/lib/types'; +import type {NullishDeep, OnyxCollection} from 'react-native-onyx/lib/types'; import Log from '@libs/Log'; import ONYXKEYS from '@src/ONYXKEYS'; -import Transaction from '@src/types/onyx/Transaction'; +import type Transaction from '@src/types/onyx/Transaction'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; type OldTransaction = Transaction & {receiptFilename?: string}; diff --git a/src/libs/migrations/TransactionBackupsToCollection.ts b/src/libs/migrations/TransactionBackupsToCollection.ts index ddaa691b8d47..407bc70e1f38 100644 --- a/src/libs/migrations/TransactionBackupsToCollection.ts +++ b/src/libs/migrations/TransactionBackupsToCollection.ts @@ -1,7 +1,8 @@ -import Onyx, {OnyxCollection} from 'react-native-onyx'; +import type {OnyxCollection} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import Log from '@libs/Log'; import ONYXKEYS from '@src/ONYXKEYS'; -import {Transaction} from '@src/types/onyx'; +import type {Transaction} from '@src/types/onyx'; /** * This migration moves all the transaction backups stored in the transaction collection, ONYXKEYS.COLLECTION.TRANSACTION, to a reserved collection that only diff --git a/src/libs/models/BankAccount.ts b/src/libs/models/BankAccount.ts index 6fd77b161aa9..611d77c99927 100644 --- a/src/libs/models/BankAccount.ts +++ b/src/libs/models/BankAccount.ts @@ -1,7 +1,8 @@ import Str from 'expensify-common/lib/str'; -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import CONST from '@src/CONST'; -import BankAccountJSON, {AdditionalData} from '@src/types/onyx/BankAccount'; +import type {AdditionalData} from '@src/types/onyx/BankAccount'; +import type BankAccountJSON from '@src/types/onyx/BankAccount'; type State = ValueOf; diff --git a/src/libs/onyxSubscribe.ts b/src/libs/onyxSubscribe.ts index 5e3213cdcf95..4572ca35a4f2 100644 --- a/src/libs/onyxSubscribe.ts +++ b/src/libs/onyxSubscribe.ts @@ -1,5 +1,6 @@ -import Onyx, {ConnectOptions} from 'react-native-onyx'; -import {OnyxKey} from '@src/ONYXKEYS'; +import type {ConnectOptions} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {OnyxKey} from '@src/ONYXKEYS'; /** * Connect to onyx data. Same params as Onyx.connect(), but returns a function to unsubscribe. diff --git a/src/libs/setSelection/index.native.ts b/src/libs/setSelection/index.native.ts index e27cd4e58bd7..5bac8be9ae65 100644 --- a/src/libs/setSelection/index.native.ts +++ b/src/libs/setSelection/index.native.ts @@ -1,4 +1,4 @@ -import SetSelection from './types'; +import type SetSelection from './types'; const setSelection: SetSelection = (textInput, start, end) => { if (!textInput) { diff --git a/src/libs/setSelection/index.ts b/src/libs/setSelection/index.ts index 5eee88881924..f518ba4480e8 100644 --- a/src/libs/setSelection/index.ts +++ b/src/libs/setSelection/index.ts @@ -1,4 +1,4 @@ -import SetSelection from './types'; +import type SetSelection from './types'; const setSelection: SetSelection = (textInput, start, end) => { if (!textInput) { diff --git a/src/libs/setSelection/types.ts b/src/libs/setSelection/types.ts index f2717079725f..9e9647c4abe1 100644 --- a/src/libs/setSelection/types.ts +++ b/src/libs/setSelection/types.ts @@ -1,4 +1,4 @@ -import {TextInput} from 'react-native'; +import type {TextInput} from 'react-native'; type SetSelection = (textInput: TextInput | HTMLInputElement, start: number, end: number) => void; diff --git a/src/libs/setShouldShowComposeInputKeyboardAware/index.ts b/src/libs/setShouldShowComposeInputKeyboardAware/index.ts index a6217fcd761b..999df8c16bf1 100644 --- a/src/libs/setShouldShowComposeInputKeyboardAware/index.ts +++ b/src/libs/setShouldShowComposeInputKeyboardAware/index.ts @@ -1,5 +1,5 @@ import * as Composer from '@userActions/Composer'; -import SetShouldShowComposeInputKeyboardAware from './types'; +import type SetShouldShowComposeInputKeyboardAware from './types'; const setShouldShowComposeInputKeyboardAware: SetShouldShowComposeInputKeyboardAware = (shouldShow) => { Composer.setShouldShowComposeInput(shouldShow); diff --git a/src/libs/setShouldShowComposeInputKeyboardAware/setShouldShowComposeInputKeyboardAwareBuilder.ts b/src/libs/setShouldShowComposeInputKeyboardAware/setShouldShowComposeInputKeyboardAwareBuilder.ts index 528b71c45ab8..264ebe4384de 100644 --- a/src/libs/setShouldShowComposeInputKeyboardAware/setShouldShowComposeInputKeyboardAwareBuilder.ts +++ b/src/libs/setShouldShowComposeInputKeyboardAware/setShouldShowComposeInputKeyboardAwareBuilder.ts @@ -1,7 +1,8 @@ -import {EmitterSubscription, Keyboard} from 'react-native'; -import {KeyboardEventName} from 'react-native/Libraries/Components/Keyboard/Keyboard'; +import type {EmitterSubscription} from 'react-native'; +import { Keyboard} from 'react-native'; +import type {KeyboardEventName} from 'react-native/Libraries/Components/Keyboard/Keyboard'; import * as Composer from '@userActions/Composer'; -import SetShouldShowComposeInputKeyboardAware from './types'; +import type SetShouldShowComposeInputKeyboardAware from './types'; let keyboardEventListener: EmitterSubscription | null = null; // On iOS, there is a visible delay in displaying input after the keyboard has been closed with the `keyboardDidHide` event diff --git a/src/libs/shouldDelayFocus/index.android.ts b/src/libs/shouldDelayFocus/index.android.ts index 566628c4df9d..cffa262b5a92 100644 --- a/src/libs/shouldDelayFocus/index.android.ts +++ b/src/libs/shouldDelayFocus/index.android.ts @@ -1,4 +1,4 @@ -import ShouldDelayFocus from './types'; +import type ShouldDelayFocus from './types'; /** When using transitions on Android, we need to delay focusing the text inputs for the keyboard to open. */ const shouldDelayFocus: ShouldDelayFocus = true; diff --git a/src/libs/shouldDelayFocus/index.ts b/src/libs/shouldDelayFocus/index.ts index 0ef7f9b2ccbe..5506eb8a91d2 100644 --- a/src/libs/shouldDelayFocus/index.ts +++ b/src/libs/shouldDelayFocus/index.ts @@ -1,4 +1,4 @@ -import ShouldDelayFocus from './types'; +import type ShouldDelayFocus from './types'; const shouldDelayFocus: ShouldDelayFocus = false; diff --git a/src/libs/shouldRenderOffscreen/index.android.ts b/src/libs/shouldRenderOffscreen/index.android.ts index bf2d9837086f..38cd6ca73ff2 100644 --- a/src/libs/shouldRenderOffscreen/index.android.ts +++ b/src/libs/shouldRenderOffscreen/index.android.ts @@ -1,4 +1,4 @@ -import ShouldRenderOffscreen from './types'; +import type ShouldRenderOffscreen from './types'; // Rendering offscreen on Android allows it to apply opacity to stacked components correctly. const shouldRenderOffscreen: ShouldRenderOffscreen = true; diff --git a/src/libs/shouldRenderOffscreen/index.ts b/src/libs/shouldRenderOffscreen/index.ts index eadcc44814f9..e4a447c38802 100644 --- a/src/libs/shouldRenderOffscreen/index.ts +++ b/src/libs/shouldRenderOffscreen/index.ts @@ -1,4 +1,4 @@ -import ShouldRenderOffscreen from './types'; +import type ShouldRenderOffscreen from './types'; const shouldRenderOffscreen: ShouldRenderOffscreen = false; diff --git a/src/libs/shouldReopenOnfido/index.android.ts b/src/libs/shouldReopenOnfido/index.android.ts index 11f562575b08..6362ce3ded30 100644 --- a/src/libs/shouldReopenOnfido/index.android.ts +++ b/src/libs/shouldReopenOnfido/index.android.ts @@ -1,4 +1,4 @@ -import ShouldReopenOnfido from './types'; +import type ShouldReopenOnfido from './types'; const shouldReopenOnfido: ShouldReopenOnfido = true; diff --git a/src/libs/shouldReopenOnfido/index.ts b/src/libs/shouldReopenOnfido/index.ts index 24322b57df19..8a57c36217ad 100644 --- a/src/libs/shouldReopenOnfido/index.ts +++ b/src/libs/shouldReopenOnfido/index.ts @@ -1,4 +1,4 @@ -import ShouldReopenOnfido from './types'; +import type ShouldReopenOnfido from './types'; const shouldReopenOnfido: ShouldReopenOnfido = false; diff --git a/src/libs/tryResolveUrlFromApiRoot.ts b/src/libs/tryResolveUrlFromApiRoot.ts index 1aa102323a06..7a80228e0a34 100644 --- a/src/libs/tryResolveUrlFromApiRoot.ts +++ b/src/libs/tryResolveUrlFromApiRoot.ts @@ -1,5 +1,5 @@ import Config from '@src/CONFIG'; -import {Request} from '@src/types/onyx'; +import type {Request} from '@src/types/onyx'; import * as ApiUtils from './ApiUtils'; // Absolute URLs (`/` or `//`) should be resolved from API ROOT diff --git a/src/libs/updateMultilineInputRange/index.ios.ts b/src/libs/updateMultilineInputRange/index.ios.ts index cbe271162372..1252079bdaa8 100644 --- a/src/libs/updateMultilineInputRange/index.ios.ts +++ b/src/libs/updateMultilineInputRange/index.ios.ts @@ -1,4 +1,4 @@ -import UpdateMultilineInputRange from './types'; +import type UpdateMultilineInputRange from './types'; /** * Place the cursor at the end of the value (if there is a value in the input). diff --git a/src/libs/updateMultilineInputRange/index.ts b/src/libs/updateMultilineInputRange/index.ts index 062a7a80eeaa..f5d71c5e2038 100644 --- a/src/libs/updateMultilineInputRange/index.ts +++ b/src/libs/updateMultilineInputRange/index.ts @@ -1,5 +1,5 @@ import * as Browser from '@libs/Browser'; -import UpdateMultilineInputRange from './types'; +import type UpdateMultilineInputRange from './types'; /** * Place the cursor at the end of the value (if there is a value in the input). diff --git a/src/libs/updateMultilineInputRange/types.ts b/src/libs/updateMultilineInputRange/types.ts index 95b5a8bce744..d1b134b09a99 100644 --- a/src/libs/updateMultilineInputRange/types.ts +++ b/src/libs/updateMultilineInputRange/types.ts @@ -1,4 +1,4 @@ -import {TextInput} from 'react-native'; +import type {TextInput} from 'react-native'; type UpdateMultilineInputRange = (input: HTMLInputElement | TextInput, shouldAutoFocus?: boolean) => void; diff --git a/src/libs/useNativeDriver/index.native.ts b/src/libs/useNativeDriver/index.native.ts index b7286965f894..93ed069fa807 100644 --- a/src/libs/useNativeDriver/index.native.ts +++ b/src/libs/useNativeDriver/index.native.ts @@ -1,4 +1,4 @@ -import UseNativeDriver from './types'; +import type UseNativeDriver from './types'; const useNativeDriver: UseNativeDriver = true; diff --git a/src/libs/useNativeDriver/index.ts b/src/libs/useNativeDriver/index.ts index 84d34f766e3b..faa9e3597cb9 100644 --- a/src/libs/useNativeDriver/index.ts +++ b/src/libs/useNativeDriver/index.ts @@ -1,4 +1,4 @@ -import UseNativeDriver from './types'; +import type UseNativeDriver from './types'; const useNativeDriver: UseNativeDriver = false; diff --git a/src/libs/willBlurTextInputOnTapOutside/index.native.ts b/src/libs/willBlurTextInputOnTapOutside/index.native.ts index 1cf1bbafe7e6..e411674c4ae5 100644 --- a/src/libs/willBlurTextInputOnTapOutside/index.native.ts +++ b/src/libs/willBlurTextInputOnTapOutside/index.native.ts @@ -1,4 +1,4 @@ -import WillBlurTextInputOnTapOutside from './types'; +import type WillBlurTextInputOnTapOutside from './types'; const willBlurTextInputOnTapOutside: WillBlurTextInputOnTapOutside = () => false; diff --git a/src/libs/willBlurTextInputOnTapOutside/index.ts b/src/libs/willBlurTextInputOnTapOutside/index.ts index 7c88957821b3..987d8a1dfeea 100644 --- a/src/libs/willBlurTextInputOnTapOutside/index.ts +++ b/src/libs/willBlurTextInputOnTapOutside/index.ts @@ -1,4 +1,4 @@ -import WillBlurTextInputOnTapOutside from './types'; +import type WillBlurTextInputOnTapOutside from './types'; const willBlurTextInputOnTapOutside: WillBlurTextInputOnTapOutside = () => true; diff --git a/src/pages/UnlinkLoginPage.tsx b/src/pages/UnlinkLoginPage.tsx index d39f1bce3a47..5f63da70b4ee 100644 --- a/src/pages/UnlinkLoginPage.tsx +++ b/src/pages/UnlinkLoginPage.tsx @@ -1,14 +1,15 @@ -import {StackScreenProps} from '@react-navigation/stack'; +import type {StackScreenProps} from '@react-navigation/stack'; import React, {useEffect} from 'react'; -import {type OnyxEntry, withOnyx} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import usePrevious from '@hooks/usePrevious'; import Navigation from '@libs/Navigation/Navigation'; -import {PublicScreensParamList} from '@navigation/types'; +import type {PublicScreensParamList} from '@navigation/types'; import * as Session from '@userActions/Session'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import SCREENS from '@src/SCREENS'; +import type SCREENS from '@src/SCREENS'; import type {Account} from '@src/types/onyx'; type UnlinkLoginPageOnyxProps = { diff --git a/src/pages/home/ReportScreenContext.ts b/src/pages/home/ReportScreenContext.ts index 49681d46e4be..28ceb77cfd0d 100644 --- a/src/pages/home/ReportScreenContext.ts +++ b/src/pages/home/ReportScreenContext.ts @@ -1,5 +1,6 @@ -import {createContext, RefObject} from 'react'; -import {FlatList, GestureResponderEvent} from 'react-native'; +import type { RefObject} from 'react'; +import {createContext} from 'react'; +import type {FlatList, GestureResponderEvent} from 'react-native'; type ReactionListRef = { showReactionList: (event: GestureResponderEvent | undefined, reactionListAnchor: Element, emojiName: string, reportActionID: string) => void; diff --git a/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts b/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts index 1e1fc700d8e0..317c3846d160 100644 --- a/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts +++ b/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts @@ -1,8 +1,8 @@ import React from 'react'; -import {GestureResponderEvent, Text as RNText} from 'react-native'; -import {OnyxEntry} from 'react-native-onyx'; -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; +import type {GestureResponderEvent, Text as RNText} from 'react-native'; +import type {OnyxEntry} from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; import type {ReportAction} from '@src/types/onyx'; type OnHideCallback = () => void; diff --git a/src/pages/home/report/ReportActionItemBasicMessage.tsx b/src/pages/home/report/ReportActionItemBasicMessage.tsx index 63e6d2424a7c..f0097a6dce26 100644 --- a/src/pages/home/report/ReportActionItemBasicMessage.tsx +++ b/src/pages/home/report/ReportActionItemBasicMessage.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {View} from 'react-native'; import Text from '@components/Text'; import useThemeStyles from '@hooks/useThemeStyles'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type ReportActionItemBasicMessageProps = ChildrenProps & { message: string; diff --git a/src/pages/home/report/ReportActionItemDate.tsx b/src/pages/home/report/ReportActionItemDate.tsx index a8c5c208151a..f7e77023ea64 100644 --- a/src/pages/home/report/ReportActionItemDate.tsx +++ b/src/pages/home/report/ReportActionItemDate.tsx @@ -1,5 +1,5 @@ import React, {memo} from 'react'; -import {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; import {withCurrentDate} from '@components/OnyxProvider'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; diff --git a/src/pages/home/report/ReportActionItemDraft.tsx b/src/pages/home/report/ReportActionItemDraft.tsx index de4458d7b39f..aeef024fc630 100644 --- a/src/pages/home/report/ReportActionItemDraft.tsx +++ b/src/pages/home/report/ReportActionItemDraft.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; function ReportActionItemDraft({children}: ChildrenProps) { const styles = useThemeStyles(); diff --git a/src/pages/home/report/ReportActionItemGrouped.tsx b/src/pages/home/report/ReportActionItemGrouped.tsx index 2dff5b81c6a7..3fb2cea2a8b4 100644 --- a/src/pages/home/report/ReportActionItemGrouped.tsx +++ b/src/pages/home/report/ReportActionItemGrouped.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; type ReportActionItemGroupedProps = ChildrenProps & { /** Styles for the outermost View */ diff --git a/src/pages/home/report/ReportActionItemMessage.tsx b/src/pages/home/report/ReportActionItemMessage.tsx index 89d0aaa1523b..36b677b64718 100644 --- a/src/pages/home/report/ReportActionItemMessage.tsx +++ b/src/pages/home/report/ReportActionItemMessage.tsx @@ -1,5 +1,7 @@ -import React, {ReactElement} from 'react'; -import {StyleProp, Text, View, ViewStyle} from 'react-native'; +import type {ReactElement} from 'react'; +import React from 'react'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { Text, View} from 'react-native'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; diff --git a/src/pages/home/report/ReportActionItemSingle.tsx b/src/pages/home/report/ReportActionItemSingle.tsx index 43b5630b2685..11a221bf9928 100644 --- a/src/pages/home/report/ReportActionItemSingle.tsx +++ b/src/pages/home/report/ReportActionItemSingle.tsx @@ -1,5 +1,6 @@ import React, {useCallback, useMemo} from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import type {StyleProp, ViewStyle} from 'react-native'; +import { View} from 'react-native'; import Avatar from '@components/Avatar'; import MultipleAvatars from '@components/MultipleAvatars'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; @@ -21,8 +22,8 @@ import * as UserUtils from '@libs/UserUtils'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; import type {Report, ReportAction} from '@src/types/onyx'; -import {Icon} from '@src/types/onyx/OnyxCommon'; -import ChildrenProps from '@src/types/utils/ChildrenProps'; +import type {Icon} from '@src/types/onyx/OnyxCommon'; +import type ChildrenProps from '@src/types/utils/ChildrenProps'; import ReportActionItemDate from './ReportActionItemDate'; import ReportActionItemFragment from './ReportActionItemFragment'; diff --git a/src/pages/home/report/withReportAndReportActionOrNotFound.tsx b/src/pages/home/report/withReportAndReportActionOrNotFound.tsx index 709f1af1c28d..c628ff389817 100644 --- a/src/pages/home/report/withReportAndReportActionOrNotFound.tsx +++ b/src/pages/home/report/withReportAndReportActionOrNotFound.tsx @@ -1,10 +1,12 @@ /* eslint-disable rulesdir/no-negated-variables */ -import {RouteProp} from '@react-navigation/native'; -import React, {ComponentType, ForwardedRef, RefAttributes, useCallback, useEffect} from 'react'; -import {OnyxCollection, OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {RouteProp} from '@react-navigation/native'; +import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import React, { useCallback, useEffect} from 'react'; +import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import withWindowDimensions from '@components/withWindowDimensions'; -import {WindowDimensionsProps} from '@components/withWindowDimensions/types'; +import type {WindowDimensionsProps} from '@components/withWindowDimensions/types'; import compose from '@libs/compose'; import getComponentDisplayName from '@libs/getComponentDisplayName'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; @@ -12,7 +14,7 @@ import * as ReportUtils from '@libs/ReportUtils'; import NotFoundPage from '@pages/ErrorPage/NotFoundPage'; import * as Report from '@userActions/Report'; import ONYXKEYS from '@src/ONYXKEYS'; -import * as OnyxTypes from '@src/types/onyx'; +import type * as OnyxTypes from '@src/types/onyx'; import {isEmptyObject, isNotEmptyObject} from '@src/types/utils/EmptyObject'; type OnyxProps = { diff --git a/src/pages/home/report/withReportOrNotFound.tsx b/src/pages/home/report/withReportOrNotFound.tsx index cf2c0d5aca4b..2ae1655c66c0 100644 --- a/src/pages/home/report/withReportOrNotFound.tsx +++ b/src/pages/home/report/withReportOrNotFound.tsx @@ -1,13 +1,15 @@ /* eslint-disable rulesdir/no-negated-variables */ -import {RouteProp} from '@react-navigation/native'; -import React, {ComponentType, ForwardedRef, RefAttributes} from 'react'; -import {OnyxCollection, OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {RouteProp} from '@react-navigation/native'; +import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import React from 'react'; +import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import getComponentDisplayName from '@libs/getComponentDisplayName'; import * as ReportUtils from '@libs/ReportUtils'; import NotFoundPage from '@pages/ErrorPage/NotFoundPage'; import ONYXKEYS from '@src/ONYXKEYS'; -import * as OnyxTypes from '@src/types/onyx'; +import type * as OnyxTypes from '@src/types/onyx'; type OnyxProps = { /** The report currently being looked at */ diff --git a/src/pages/workspace/WorkspacesListRow.tsx b/src/pages/workspace/WorkspacesListRow.tsx index 8bcc23faf550..d6bb3fb05385 100755 --- a/src/pages/workspace/WorkspacesListRow.tsx +++ b/src/pages/workspace/WorkspacesListRow.tsx @@ -1,20 +1,21 @@ import React, {useMemo} from 'react'; import {View} from 'react-native'; -import {ValueOf} from 'type-fest'; +import type {ValueOf} from 'type-fest'; import Avatar from '@components/Avatar'; import Icon from '@components/Icon'; import * as Illustrations from '@components/Icon/Illustrations'; -import {MenuItemProps} from '@components/MenuItem'; +import type {MenuItemProps} from '@components/MenuItem'; import Text from '@components/Text'; import ThreeDotsMenu from '@components/ThreeDotsMenu'; -import withCurrentUserPersonalDetails, {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; +import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; +import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; -import {AvatarSource} from '@libs/UserUtils'; +import type {AvatarSource} from '@libs/UserUtils'; import variables from '@styles/variables'; import CONST from '@src/CONST'; -import IconAsset from '@src/types/utils/IconAsset'; +import type IconAsset from '@src/types/utils/IconAsset'; type WorkspacesListRowProps = WithCurrentUserPersonalDetailsProps & { /** Name of the workspace */ diff --git a/src/pages/workspace/withPolicy.tsx b/src/pages/workspace/withPolicy.tsx index 6c24ff8523bd..b1cd9ce69d62 100644 --- a/src/pages/workspace/withPolicy.tsx +++ b/src/pages/workspace/withPolicy.tsx @@ -1,12 +1,15 @@ -import {RouteProp, useNavigationState} from '@react-navigation/native'; +import type {RouteProp} from '@react-navigation/native'; +import { useNavigationState} from '@react-navigation/native'; import PropTypes from 'prop-types'; -import React, {ComponentType, ForwardedRef, forwardRef, RefAttributes} from 'react'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import React, { forwardRef} from 'react'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import policyMemberPropType from '@pages/policyMemberPropType'; import * as Policy from '@userActions/Policy'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import * as OnyxTypes from '@src/types/onyx'; +import type * as OnyxTypes from '@src/types/onyx'; type PolicyRoute = RouteProp<{params: {policyID: string}}>; diff --git a/src/pages/workspace/withPolicyAndFullscreenLoading.tsx b/src/pages/workspace/withPolicyAndFullscreenLoading.tsx index 3e8bd3bdddb4..19201311c5d7 100644 --- a/src/pages/workspace/withPolicyAndFullscreenLoading.tsx +++ b/src/pages/workspace/withPolicyAndFullscreenLoading.tsx @@ -1,10 +1,13 @@ import isEmpty from 'lodash/isEmpty'; -import React, {ComponentType, ForwardedRef, forwardRef, RefAttributes} from 'react'; -import {OnyxEntry, withOnyx} from 'react-native-onyx'; +import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; +import React, { forwardRef} from 'react'; +import type {OnyxEntry} from 'react-native-onyx'; +import { withOnyx} from 'react-native-onyx'; import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import compose from '@libs/compose'; import ONYXKEYS from '@src/ONYXKEYS'; -import withPolicy, {policyDefaultProps, WithPolicyOnyxProps, WithPolicyProps} from './withPolicy'; +import type { WithPolicyOnyxProps, WithPolicyProps} from './withPolicy'; +import withPolicy, {policyDefaultProps} from './withPolicy'; type WithPolicyAndFullscreenLoadingOnyxProps = { /** Indicated whether the report data is loading */ diff --git a/src/stories/Breadcrumbs.stories.tsx b/src/stories/Breadcrumbs.stories.tsx index 60e1900534f9..38cb5192b105 100644 --- a/src/stories/Breadcrumbs.stories.tsx +++ b/src/stories/Breadcrumbs.stories.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import Breadcrumbs, {BreadcrumbsProps} from '@components/Breadcrumbs'; +import type {BreadcrumbsProps} from '@components/Breadcrumbs'; +import Breadcrumbs from '@components/Breadcrumbs'; import CONST from '@src/CONST'; /** diff --git a/src/stories/Search.stories.tsx b/src/stories/Search.stories.tsx index a501fc2610b0..58c3eb2561a2 100644 --- a/src/stories/Search.stories.tsx +++ b/src/stories/Search.stories.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import Search, {SearchProps} from '@components/Search'; +import type {SearchProps} from '@components/Search'; +import Search from '@components/Search'; /** * We use the Component Story Format for writing stories. Follow the docs here: diff --git a/src/styles/index.ts b/src/styles/index.ts index fb1919b9f5d3..52449b8e9733 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -1,17 +1,18 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import {LineLayerStyleProps} from '@rnmapbox/maps/src/utils/MapboxStyles'; +import type {LineLayerStyleProps} from '@rnmapbox/maps/src/utils/MapboxStyles'; import lodashClamp from 'lodash/clamp'; -import {LineLayer} from 'react-map-gl'; -import {AnimatableNumericValue, Animated, ImageStyle, StyleSheet, TextStyle, ViewStyle} from 'react-native'; -import {CustomAnimation} from 'react-native-animatable'; -import {PickerStyle} from 'react-native-picker-select'; -import {MixedStyleDeclaration, MixedStyleRecord} from 'react-native-render-html'; -import DotLottieAnimation from '@components/LottieAnimations/types'; +import type {LineLayer} from 'react-map-gl'; +import type {AnimatableNumericValue, Animated, ImageStyle, TextStyle, ViewStyle} from 'react-native'; +import { StyleSheet} from 'react-native'; +import type {CustomAnimation} from 'react-native-animatable'; +import type {PickerStyle} from 'react-native-picker-select'; +import type {MixedStyleDeclaration, MixedStyleRecord} from 'react-native-render-html'; +import type DotLottieAnimation from '@components/LottieAnimations/types'; import * as Browser from '@libs/Browser'; import CONST from '@src/CONST'; import {defaultTheme} from './theme'; import colors from './theme/colors'; -import {type ThemeColors} from './theme/types'; +import type {ThemeColors} from './theme/types'; import addOutlineWidth from './utils/addOutlineWidth'; import borders from './utils/borders'; import codeStyles from './utils/codeStyles'; diff --git a/src/styles/theme/colors.ts b/src/styles/theme/colors.ts index 061336d2d114..0312e6613baf 100644 --- a/src/styles/theme/colors.ts +++ b/src/styles/theme/colors.ts @@ -1,4 +1,4 @@ -import {Color} from './types'; +import type {Color} from './types'; /** * DO NOT import colors.js into files. Use the theme switching hooks and HOCs instead. diff --git a/src/styles/theme/context/ThemeContext.ts b/src/styles/theme/context/ThemeContext.ts index 64cd805b3f59..8a1574af0e99 100644 --- a/src/styles/theme/context/ThemeContext.ts +++ b/src/styles/theme/context/ThemeContext.ts @@ -1,5 +1,5 @@ import React from 'react'; -import {type ThemeColors} from '@styles/theme/types'; +import type {ThemeColors} from '@styles/theme/types'; import {defaultTheme} from '..'; const ThemeContext = React.createContext(defaultTheme); diff --git a/src/styles/theme/context/ThemeIllustrationsContext.ts b/src/styles/theme/context/ThemeIllustrationsContext.ts index b70cf6aa5ea2..f762a35b0800 100644 --- a/src/styles/theme/context/ThemeIllustrationsContext.ts +++ b/src/styles/theme/context/ThemeIllustrationsContext.ts @@ -1,6 +1,6 @@ import React from 'react'; import {DefaultIllustrations} from '@styles/theme/illustrations'; -import {IllustrationsType} from '@styles/theme/illustrations/types'; +import type {IllustrationsType} from '@styles/theme/illustrations/types'; const ThemeIllustrationsContext = React.createContext(DefaultIllustrations); diff --git a/src/styles/theme/illustrations/index.ts b/src/styles/theme/illustrations/index.ts index 9526dbcd1023..2686f4205351 100644 --- a/src/styles/theme/illustrations/index.ts +++ b/src/styles/theme/illustrations/index.ts @@ -1,4 +1,4 @@ -import {ThemePreferenceWithoutSystem} from '@styles/theme/types'; +import type {ThemePreferenceWithoutSystem} from '@styles/theme/types'; import CONST from '@src/CONST'; import darkIllustrations from './themes/dark'; import lightIllustrations from './themes/light'; diff --git a/src/styles/theme/illustrations/themes/dark.ts b/src/styles/theme/illustrations/themes/dark.ts index 2a4390ae2520..2920081ac137 100644 --- a/src/styles/theme/illustrations/themes/dark.ts +++ b/src/styles/theme/illustrations/themes/dark.ts @@ -1,7 +1,7 @@ import EmptyStateBackgroundImage from '@assets/images/themeDependent/empty-state_background-fade-dark.png'; import ExampleCheckEN from '@assets/images/themeDependent/example-check-image-dark-en.png'; import ExampleCheckES from '@assets/images/themeDependent/example-check-image-dark-es.png'; -import {IllustrationsType} from '@styles/theme/illustrations/types'; +import type {IllustrationsType} from '@styles/theme/illustrations/types'; const illustrations = { EmptyStateBackgroundImage, diff --git a/src/styles/theme/illustrations/themes/light.ts b/src/styles/theme/illustrations/themes/light.ts index f41114a04efa..6eb9c11851e4 100644 --- a/src/styles/theme/illustrations/themes/light.ts +++ b/src/styles/theme/illustrations/themes/light.ts @@ -1,7 +1,7 @@ import EmptyStateBackgroundImage from '@assets/images/themeDependent/empty-state_background-fade-light.png'; import ExampleCheckEN from '@assets/images/themeDependent/example-check-image-light-en.png'; import ExampleCheckES from '@assets/images/themeDependent/example-check-image-light-es.png'; -import {IllustrationsType} from '@styles/theme/illustrations/types'; +import type {IllustrationsType} from '@styles/theme/illustrations/types'; const illustrations = { EmptyStateBackgroundImage, diff --git a/src/styles/theme/illustrations/types.ts b/src/styles/theme/illustrations/types.ts index bda98dc55fbf..b37ff17965e2 100644 --- a/src/styles/theme/illustrations/types.ts +++ b/src/styles/theme/illustrations/types.ts @@ -1,4 +1,4 @@ -import {ImageSourcePropType} from 'react-native'; +import type {ImageSourcePropType} from 'react-native'; type IllustrationsType = { EmptyStateBackgroundImage: ImageSourcePropType; diff --git a/src/styles/theme/index.ts b/src/styles/theme/index.ts index c8c3a6ec12c1..fcb22dcba2d2 100644 --- a/src/styles/theme/index.ts +++ b/src/styles/theme/index.ts @@ -1,7 +1,7 @@ import CONST from '@src/CONST'; import darkTheme from './themes/dark'; import lightTheme from './themes/light'; -import {type ThemeColors, ThemePreferenceWithoutSystem} from './types'; +import type { ThemePreferenceWithoutSystem,type ThemeColors} from './types'; const themes = { [CONST.THEME.LIGHT]: lightTheme, diff --git a/src/styles/theme/themes/dark.ts b/src/styles/theme/themes/dark.ts index a2954a4fca03..8ac7b0a2359c 100644 --- a/src/styles/theme/themes/dark.ts +++ b/src/styles/theme/themes/dark.ts @@ -1,5 +1,5 @@ import colors from '@styles/theme/colors'; -import {type ThemeColors} from '@styles/theme/types'; +import type {ThemeColors} from '@styles/theme/types'; import CONST from '@src/CONST'; import SCREENS from '@src/SCREENS'; diff --git a/src/styles/theme/themes/light.ts b/src/styles/theme/themes/light.ts index d4819898b83c..663b94aa0fc7 100644 --- a/src/styles/theme/themes/light.ts +++ b/src/styles/theme/themes/light.ts @@ -1,5 +1,5 @@ import colors from '@styles/theme/colors'; -import {type ThemeColors} from '@styles/theme/types'; +import type {ThemeColors} from '@styles/theme/types'; import CONST from '@src/CONST'; import SCREENS from '@src/SCREENS'; diff --git a/src/styles/theme/types.ts b/src/styles/theme/types.ts index b443295b8167..2a1bb79e2efb 100644 --- a/src/styles/theme/types.ts +++ b/src/styles/theme/types.ts @@ -1,5 +1,5 @@ -import CONST from '@src/CONST'; -import {type ColorScheme, type StatusBarStyle} from '..'; +import type CONST from '@src/CONST'; +import type {ColorScheme, StatusBarStyle} from '..'; type Color = string; diff --git a/src/styles/utils/addOutlineWidth/index.native.ts b/src/styles/utils/addOutlineWidth/index.native.ts index d081e2a9af70..9a9942951cd0 100644 --- a/src/styles/utils/addOutlineWidth/index.native.ts +++ b/src/styles/utils/addOutlineWidth/index.native.ts @@ -2,7 +2,7 @@ * Native platforms don't support the "addOutlineWidth" property, so this * function is a no-op */ -import AddOutlineWidth from './types'; +import type AddOutlineWidth from './types'; // eslint-disable-next-line @typescript-eslint/naming-convention const addOutlineWidth: AddOutlineWidth = (_theme, obj) => obj; diff --git a/src/styles/utils/addOutlineWidth/index.ts b/src/styles/utils/addOutlineWidth/index.ts index c1ac1af52a8b..104f3ce90516 100644 --- a/src/styles/utils/addOutlineWidth/index.ts +++ b/src/styles/utils/addOutlineWidth/index.ts @@ -2,7 +2,7 @@ * Web and desktop platforms support the "addOutlineWidth" property, so it * can be added to the object */ -import AddOutlineWidth from './types'; +import type AddOutlineWidth from './types'; /** * Adds the addOutlineWidth property to an object to be used when styling diff --git a/src/styles/utils/addOutlineWidth/types.ts b/src/styles/utils/addOutlineWidth/types.ts index f6b9be63893c..45975b72dc8a 100644 --- a/src/styles/utils/addOutlineWidth/types.ts +++ b/src/styles/utils/addOutlineWidth/types.ts @@ -1,5 +1,5 @@ -import {TextStyle} from 'react-native'; -import {type ThemeColors} from '@styles/theme/types'; +import type {TextStyle} from 'react-native'; +import type {ThemeColors} from '@styles/theme/types'; type AddOutlineWidth = (theme: ThemeColors, obj: TextStyle, val?: number, hasError?: boolean) => TextStyle; diff --git a/src/styles/utils/borders.ts b/src/styles/utils/borders.ts index 9cd02dcd22ae..26fdf6415fc7 100644 --- a/src/styles/utils/borders.ts +++ b/src/styles/utils/borders.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; /** * All styles should be incremented by units of 4. diff --git a/src/styles/utils/cardStyles/index.native.ts b/src/styles/utils/cardStyles/index.native.ts index 94b8758efd05..73ebccfd4ab4 100644 --- a/src/styles/utils/cardStyles/index.native.ts +++ b/src/styles/utils/cardStyles/index.native.ts @@ -1,4 +1,4 @@ -import GetCardStyles from './types'; +import type GetCardStyles from './types'; const getCardStyles: GetCardStyles = () => ({}); diff --git a/src/styles/utils/cardStyles/index.ts b/src/styles/utils/cardStyles/index.ts index 77a00695d20a..3a1f778f36f4 100644 --- a/src/styles/utils/cardStyles/index.ts +++ b/src/styles/utils/cardStyles/index.ts @@ -1,5 +1,5 @@ import positioning from '@styles/utils/positioning'; -import GetCardStyles from './types'; +import type GetCardStyles from './types'; /** * Get card style for cardStyleInterpolator diff --git a/src/styles/utils/cardStyles/types.ts b/src/styles/utils/cardStyles/types.ts index 134b93eae32f..38c761c8bf4f 100644 --- a/src/styles/utils/cardStyles/types.ts +++ b/src/styles/utils/cardStyles/types.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; type GetCardStyles = (screenWidth: number) => ViewStyle; diff --git a/src/styles/utils/codeStyles/index.android.ts b/src/styles/utils/codeStyles/index.android.ts index 1912f0ad7489..0ac77729c83c 100644 --- a/src/styles/utils/codeStyles/index.android.ts +++ b/src/styles/utils/codeStyles/index.android.ts @@ -1,4 +1,4 @@ -import {CodeTextStyles, CodeWordStyles, CodeWordWrapperStyles} from './types'; +import type {CodeTextStyles, CodeWordStyles, CodeWordWrapperStyles} from './types'; const codeWordWrapper: CodeWordWrapperStyles = { height: 20, diff --git a/src/styles/utils/codeStyles/index.ios.ts b/src/styles/utils/codeStyles/index.ios.ts index ec87e3b6427b..05e2b55ec205 100644 --- a/src/styles/utils/codeStyles/index.ios.ts +++ b/src/styles/utils/codeStyles/index.ios.ts @@ -1,4 +1,4 @@ -import {CodeTextStyles, CodeWordStyles, CodeWordWrapperStyles} from './types'; +import type {CodeTextStyles, CodeWordStyles, CodeWordWrapperStyles} from './types'; const codeWordWrapper: CodeWordWrapperStyles = { height: 22, diff --git a/src/styles/utils/codeStyles/index.ts b/src/styles/utils/codeStyles/index.ts index 45f669b0adaa..80a66df95c7c 100644 --- a/src/styles/utils/codeStyles/index.ts +++ b/src/styles/utils/codeStyles/index.ts @@ -1,4 +1,4 @@ -import {CodeTextStyles, CodeWordStyles, CodeWordWrapperStyles} from './types'; +import type {CodeTextStyles, CodeWordStyles, CodeWordWrapperStyles} from './types'; // We do not need these on Web/Desktop as their implementation defer from Native devices so just noop them const codeWordWrapper: CodeWordWrapperStyles = {}; diff --git a/src/styles/utils/codeStyles/types.ts b/src/styles/utils/codeStyles/types.ts index f223d980e67b..245676b0a331 100644 --- a/src/styles/utils/codeStyles/types.ts +++ b/src/styles/utils/codeStyles/types.ts @@ -1,4 +1,4 @@ -import {TextStyle, ViewStyle} from 'react-native'; +import type {TextStyle, ViewStyle} from 'react-native'; type CodeWordWrapperStyles = ViewStyle; type CodeWordStyles = ViewStyle; diff --git a/src/styles/utils/containerComposeStyles/index.native.ts b/src/styles/utils/containerComposeStyles/index.native.ts index 3104b6878b2a..de95087ab93e 100644 --- a/src/styles/utils/containerComposeStyles/index.native.ts +++ b/src/styles/utils/containerComposeStyles/index.native.ts @@ -1,4 +1,4 @@ -import ContainerComposeStyles from './types'; +import type ContainerComposeStyles from './types'; const containerComposeStyles: ContainerComposeStyles = (styles) => [styles.textInputComposeSpacing]; diff --git a/src/styles/utils/containerComposeStyles/index.ts b/src/styles/utils/containerComposeStyles/index.ts index c6161fd2d9df..3f858292afee 100644 --- a/src/styles/utils/containerComposeStyles/index.ts +++ b/src/styles/utils/containerComposeStyles/index.ts @@ -1,4 +1,4 @@ -import ContainerComposeStyles from './types'; +import type ContainerComposeStyles from './types'; // We need to set paddingVertical = 0 on web to avoid displaying a normal pointer on some parts of compose box when not in focus const containerComposeStyles: ContainerComposeStyles = (styles) => [styles.textInputComposeSpacing, {paddingVertical: 0}]; diff --git a/src/styles/utils/containerComposeStyles/types.ts b/src/styles/utils/containerComposeStyles/types.ts index 2b2d23b7f8c1..0b3d598ad042 100644 --- a/src/styles/utils/containerComposeStyles/types.ts +++ b/src/styles/utils/containerComposeStyles/types.ts @@ -1,5 +1,5 @@ -import {ViewStyle} from 'react-native'; -import {type ThemeStyles} from '@styles/index'; +import type {ViewStyle} from 'react-native'; +import type {ThemeStyles} from '@styles/index'; type ContainerComposeStyles = (styles: ThemeStyles) => ViewStyle[]; diff --git a/src/styles/utils/cursor/index.native.ts b/src/styles/utils/cursor/index.native.ts index 67416e750f36..74b9b72bd1d0 100644 --- a/src/styles/utils/cursor/index.native.ts +++ b/src/styles/utils/cursor/index.native.ts @@ -1,4 +1,4 @@ -import CursorStyles from './types'; +import type CursorStyles from './types'; const cursor: CursorStyles = { cursorDefault: {}, diff --git a/src/styles/utils/cursor/index.ts b/src/styles/utils/cursor/index.ts index e3f85107f16a..958e45749ebb 100644 --- a/src/styles/utils/cursor/index.ts +++ b/src/styles/utils/cursor/index.ts @@ -1,4 +1,4 @@ -import CursorStyles from './types'; +import type CursorStyles from './types'; const cursor: CursorStyles = { cursorDefault: { diff --git a/src/styles/utils/cursor/types.ts b/src/styles/utils/cursor/types.ts index e9cfc120b161..7ffac48612fb 100644 --- a/src/styles/utils/cursor/types.ts +++ b/src/styles/utils/cursor/types.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; type CursorStylesKeys = | 'cursorDefault' diff --git a/src/styles/utils/display.ts b/src/styles/utils/display.ts index f14a25d641b1..82b8c87b0980 100644 --- a/src/styles/utils/display.ts +++ b/src/styles/utils/display.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; /** * Display utilities with Bootstrap inspired naming. diff --git a/src/styles/utils/editedLabelStyles/index.native.ts b/src/styles/utils/editedLabelStyles/index.native.ts index 3e43004a8a13..d49857ba28eb 100644 --- a/src/styles/utils/editedLabelStyles/index.native.ts +++ b/src/styles/utils/editedLabelStyles/index.native.ts @@ -1,4 +1,4 @@ -import EditedLabelStyles from './types'; +import type EditedLabelStyles from './types'; const editedLabelStyles: EditedLabelStyles = {}; diff --git a/src/styles/utils/editedLabelStyles/index.ts b/src/styles/utils/editedLabelStyles/index.ts index 427918af1202..9397966a88a5 100644 --- a/src/styles/utils/editedLabelStyles/index.ts +++ b/src/styles/utils/editedLabelStyles/index.ts @@ -1,6 +1,6 @@ import display from '@styles/utils/display'; import flex from '@styles/utils/flex'; -import EditedLabelStyles from './types'; +import type EditedLabelStyles from './types'; const editedLabelStyles: EditedLabelStyles = { ...display.dInlineFlex, diff --git a/src/styles/utils/editedLabelStyles/types.ts b/src/styles/utils/editedLabelStyles/types.ts index 20bcc8c55f15..6f263e2d9e64 100644 --- a/src/styles/utils/editedLabelStyles/types.ts +++ b/src/styles/utils/editedLabelStyles/types.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; type EditedLabelStyles = TextStyle; diff --git a/src/styles/utils/flex.ts b/src/styles/utils/flex.ts index 6c7541a3ef46..38b68bddd38d 100644 --- a/src/styles/utils/flex.ts +++ b/src/styles/utils/flex.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; /** * Flex layout utility styles with Bootstrap inspired naming. diff --git a/src/styles/utils/fontFamily/bold/index.android.ts b/src/styles/utils/fontFamily/bold/index.android.ts index 828b9425e8d4..89f116f18c20 100644 --- a/src/styles/utils/fontFamily/bold/index.android.ts +++ b/src/styles/utils/fontFamily/bold/index.android.ts @@ -1,4 +1,4 @@ -import FontFamilyBoldStyles from './types'; +import type FontFamilyBoldStyles from './types'; const singleBold: FontFamilyBoldStyles = 'ExpensifyNeue-Bold'; const multiBold: FontFamilyBoldStyles = 'ExpensifyNeue-Bold'; diff --git a/src/styles/utils/fontFamily/bold/index.ios.ts b/src/styles/utils/fontFamily/bold/index.ios.ts index 31b7e3d82c05..a5dfea7ecd2e 100644 --- a/src/styles/utils/fontFamily/bold/index.ios.ts +++ b/src/styles/utils/fontFamily/bold/index.ios.ts @@ -1,4 +1,4 @@ -import FontFamilyBoldStyles from './types'; +import type FontFamilyBoldStyles from './types'; const singleBold: FontFamilyBoldStyles = 'ExpensifyNeue-Regular'; const multiBold: FontFamilyBoldStyles = 'ExpensifyNeue-Regular'; diff --git a/src/styles/utils/fontFamily/bold/index.ts b/src/styles/utils/fontFamily/bold/index.ts index c416bff3aadc..d07951acd0f5 100644 --- a/src/styles/utils/fontFamily/bold/index.ts +++ b/src/styles/utils/fontFamily/bold/index.ts @@ -1,4 +1,4 @@ -import FontFamilyBoldStyles from './types'; +import type FontFamilyBoldStyles from './types'; const singleBold: FontFamilyBoldStyles = 'ExpensifyNeue-Regular'; const multiBold: FontFamilyBoldStyles = 'ExpensifyNeue-Regular, Segoe UI Emoji, Noto Color Emoji'; diff --git a/src/styles/utils/fontFamily/bold/types.ts b/src/styles/utils/fontFamily/bold/types.ts index 258b23de94a2..b393618102a5 100644 --- a/src/styles/utils/fontFamily/bold/types.ts +++ b/src/styles/utils/fontFamily/bold/types.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; type FontFamilyBoldStyles = NonNullable; diff --git a/src/styles/utils/fontFamily/multiFontFamily.ts b/src/styles/utils/fontFamily/multiFontFamily.ts index 5bd89e0d4bcb..902b94021b32 100644 --- a/src/styles/utils/fontFamily/multiFontFamily.ts +++ b/src/styles/utils/fontFamily/multiFontFamily.ts @@ -1,7 +1,7 @@ import getOperatingSystem from '@libs/getOperatingSystem'; import CONST from '@src/CONST'; import {multiBold} from './bold'; -import FontFamilyStyles from './types'; +import type FontFamilyStyles from './types'; // In windows and ubuntu, we need some extra system fonts for emojis to work properly // otherwise few of them will appear as black and white diff --git a/src/styles/utils/fontFamily/singleFontFamily.ts b/src/styles/utils/fontFamily/singleFontFamily.ts index 6d5b05a5b0aa..71294c55ffaa 100644 --- a/src/styles/utils/fontFamily/singleFontFamily.ts +++ b/src/styles/utils/fontFamily/singleFontFamily.ts @@ -1,5 +1,5 @@ import {singleBold} from './bold'; -import FontFamilyStyles from './types'; +import type FontFamilyStyles from './types'; const fontFamily: FontFamilyStyles = { EXP_NEUE_ITALIC: 'ExpensifyNeue-Italic', diff --git a/src/styles/utils/fontFamily/types.ts b/src/styles/utils/fontFamily/types.ts index c688f40927be..724f92d4edc7 100644 --- a/src/styles/utils/fontFamily/types.ts +++ b/src/styles/utils/fontFamily/types.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; type FontFamilyKeys = | 'EXP_NEUE_ITALIC' diff --git a/src/styles/utils/fontWeight/bold/index.android.ts b/src/styles/utils/fontWeight/bold/index.android.ts index 3119e0f391cd..f4364eeb1e80 100644 --- a/src/styles/utils/fontWeight/bold/index.android.ts +++ b/src/styles/utils/fontWeight/bold/index.android.ts @@ -1,4 +1,4 @@ -import FontWeightBoldStyles from './types'; +import type FontWeightBoldStyles from './types'; // Android has ExpensifyNeue-Bold, but fontWeight: '700' will result in // an incorrect font displaying on Android diff --git a/src/styles/utils/fontWeight/bold/index.ts b/src/styles/utils/fontWeight/bold/index.ts index 45de49abb35b..ecb6cb5ce2b1 100644 --- a/src/styles/utils/fontWeight/bold/index.ts +++ b/src/styles/utils/fontWeight/bold/index.ts @@ -1,4 +1,4 @@ -import FontWeightBoldStyles from './types'; +import type FontWeightBoldStyles from './types'; // Web only has ExpensifyNeue-Regular so to achieve bold we need to add this fontWeight const bold: FontWeightBoldStyles = '700'; diff --git a/src/styles/utils/fontWeight/bold/types.ts b/src/styles/utils/fontWeight/bold/types.ts index 00e72d0e879c..624deb999a43 100644 --- a/src/styles/utils/fontWeight/bold/types.ts +++ b/src/styles/utils/fontWeight/bold/types.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; type FontWeightBoldStyles = NonNullable; diff --git a/src/styles/utils/generators/ModalStyleUtils.ts b/src/styles/utils/generators/ModalStyleUtils.ts index 67faec504d61..3dfb1e67e038 100644 --- a/src/styles/utils/generators/ModalStyleUtils.ts +++ b/src/styles/utils/generators/ModalStyleUtils.ts @@ -1,10 +1,10 @@ -import {ViewStyle} from 'react-native'; -import {ModalProps} from 'react-native-modal'; -import {ValueOf} from 'type-fest'; -import {ThemeStyles} from '@styles/index'; +import type {ViewStyle} from 'react-native'; +import type {ModalProps} from 'react-native-modal'; +import type {ValueOf} from 'type-fest'; +import type {ThemeStyles} from '@styles/index'; import variables from '@styles/variables'; import CONST from '@src/CONST'; -import StyleUtilGenerator from './types'; +import type StyleUtilGenerator from './types'; function getCenteredModalStyles(styles: ThemeStyles, windowWidth: number, isSmallScreenWidth: boolean, isFullScreenWhenSmall = false): ViewStyle { const modalStyles = styles.centeredModalStyles(isSmallScreenWidth, isFullScreenWhenSmall); diff --git a/src/styles/utils/generators/ReportActionContextMenuStyleUtils.ts b/src/styles/utils/generators/ReportActionContextMenuStyleUtils.ts index 10904fca05cd..e45b5db98b53 100644 --- a/src/styles/utils/generators/ReportActionContextMenuStyleUtils.ts +++ b/src/styles/utils/generators/ReportActionContextMenuStyleUtils.ts @@ -1,8 +1,8 @@ -import {ViewStyle} from 'react-native'; -import {ThemeStyles} from '@styles/index'; -import {type ThemeColors} from '@styles/theme/types'; +import type {ViewStyle} from 'react-native'; +import type {ThemeStyles} from '@styles/index'; +import type {ThemeColors} from '@styles/theme/types'; import variables from '@styles/variables'; -import StyleUtilGenerator from './types'; +import type StyleUtilGenerator from './types'; const getDefaultWrapperStyle = (theme: ThemeColors): ViewStyle => ({ backgroundColor: theme.componentBG, diff --git a/src/styles/utils/generators/TooltipStyleUtils.ts b/src/styles/utils/generators/TooltipStyleUtils.ts index 0e9fda1a3388..86b1a7f90482 100644 --- a/src/styles/utils/generators/TooltipStyleUtils.ts +++ b/src/styles/utils/generators/TooltipStyleUtils.ts @@ -1,10 +1,11 @@ -import {Animated, TextStyle, View, ViewStyle} from 'react-native'; +import type { TextStyle, View, ViewStyle} from 'react-native'; +import {Animated} from 'react-native'; import fontFamily from '@styles/utils/fontFamily'; import positioning from '@styles/utils/positioning'; import roundToNearestMultipleOfFour from '@styles/utils/roundToNearestMultipleOfFour'; import spacing from '@styles/utils/spacing'; import variables from '@styles/variables'; -import StyleUtilGenerator from './types'; +import type StyleUtilGenerator from './types'; /** This defines the proximity with the edge of the window in which tooltips should not be displayed. * If a tooltip is too close to the edge of the screen, we'll shift it towards the center. */ diff --git a/src/styles/utils/generators/types.ts b/src/styles/utils/generators/types.ts index ca6a630d94c5..dd346a3fefc6 100644 --- a/src/styles/utils/generators/types.ts +++ b/src/styles/utils/generators/types.ts @@ -1,5 +1,5 @@ -import {ThemeStyles} from '@styles/index'; -import {ThemeColors} from '@styles/theme/types'; +import type {ThemeStyles} from '@styles/index'; +import type {ThemeColors} from '@styles/theme/types'; type StyleUtilGenerator> = (props: {theme: ThemeColors; styles: ThemeStyles}) => StyleUtil; diff --git a/src/styles/utils/getContextMenuItemStyles/index.native.ts b/src/styles/utils/getContextMenuItemStyles/index.native.ts index c8c1a828a0f3..cb0f55cd8d1d 100644 --- a/src/styles/utils/getContextMenuItemStyles/index.native.ts +++ b/src/styles/utils/getContextMenuItemStyles/index.native.ts @@ -1,4 +1,4 @@ -import GetContextMenuItemStyle from './types'; +import type GetContextMenuItemStyle from './types'; const getContextMenuItemStyles: GetContextMenuItemStyle = (styles) => [styles.popoverMenuItem]; diff --git a/src/styles/utils/getContextMenuItemStyles/index.ts b/src/styles/utils/getContextMenuItemStyles/index.ts index 42635033a244..b8c879c0bfdf 100644 --- a/src/styles/utils/getContextMenuItemStyles/index.ts +++ b/src/styles/utils/getContextMenuItemStyles/index.ts @@ -1,5 +1,5 @@ import variables from '@styles/variables'; -import GetContextMenuItemStyle from './types'; +import type GetContextMenuItemStyle from './types'; const getContextMenuItemStyles: GetContextMenuItemStyle = (styles, windowWidth) => { if (windowWidth && windowWidth > variables.mobileResponsiveWidthBreakpoint) { diff --git a/src/styles/utils/getContextMenuItemStyles/types.ts b/src/styles/utils/getContextMenuItemStyles/types.ts index 06b989becf8a..67668c36fcca 100644 --- a/src/styles/utils/getContextMenuItemStyles/types.ts +++ b/src/styles/utils/getContextMenuItemStyles/types.ts @@ -1,5 +1,5 @@ -import {ViewStyle} from 'react-native'; -import {type ThemeStyles} from '@styles/index'; +import type {ViewStyle} from 'react-native'; +import type {ThemeStyles} from '@styles/index'; type GetContextMenuItemStyle = (styles: ThemeStyles, windowWidth?: number) => ViewStyle[]; diff --git a/src/styles/utils/getNavigationModalCardStyles/index.desktop.ts b/src/styles/utils/getNavigationModalCardStyles/index.desktop.ts index 523f82048a02..c7a469cbd114 100644 --- a/src/styles/utils/getNavigationModalCardStyles/index.desktop.ts +++ b/src/styles/utils/getNavigationModalCardStyles/index.desktop.ts @@ -1,5 +1,5 @@ import positioning from '@styles/utils/positioning'; -import GetNavigationModalCardStyles from './types'; +import type GetNavigationModalCardStyles from './types'; const getNavigationModalCardStyles: GetNavigationModalCardStyles = () => ({ // position: fixed is set instead of position absolute to workaround Safari known issues of updating heights in DOM. diff --git a/src/styles/utils/getNavigationModalCardStyles/index.ts b/src/styles/utils/getNavigationModalCardStyles/index.ts index d3cf49c6c89c..1614690dbbcd 100644 --- a/src/styles/utils/getNavigationModalCardStyles/index.ts +++ b/src/styles/utils/getNavigationModalCardStyles/index.ts @@ -1,4 +1,4 @@ -import GetNavigationModalCardStyles from './types'; +import type GetNavigationModalCardStyles from './types'; const getNavigationModalCardStyles: GetNavigationModalCardStyles = () => ({ height: '100%', diff --git a/src/styles/utils/getNavigationModalCardStyles/index.website.ts b/src/styles/utils/getNavigationModalCardStyles/index.website.ts index 523f82048a02..c7a469cbd114 100644 --- a/src/styles/utils/getNavigationModalCardStyles/index.website.ts +++ b/src/styles/utils/getNavigationModalCardStyles/index.website.ts @@ -1,5 +1,5 @@ import positioning from '@styles/utils/positioning'; -import GetNavigationModalCardStyles from './types'; +import type GetNavigationModalCardStyles from './types'; const getNavigationModalCardStyles: GetNavigationModalCardStyles = () => ({ // position: fixed is set instead of position absolute to workaround Safari known issues of updating heights in DOM. diff --git a/src/styles/utils/getNavigationModalCardStyles/types.ts b/src/styles/utils/getNavigationModalCardStyles/types.ts index e0dba07dc908..77452bd77268 100644 --- a/src/styles/utils/getNavigationModalCardStyles/types.ts +++ b/src/styles/utils/getNavigationModalCardStyles/types.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; type GetNavigationModalCardStyles = () => ViewStyle; diff --git a/src/styles/utils/getPopOverVerticalOffset/index.desktop.ts b/src/styles/utils/getPopOverVerticalOffset/index.desktop.ts index 3caab6057a4b..e9880dda42ab 100644 --- a/src/styles/utils/getPopOverVerticalOffset/index.desktop.ts +++ b/src/styles/utils/getPopOverVerticalOffset/index.desktop.ts @@ -1,5 +1,5 @@ import CONST from '@src/CONST'; -import GetPopOverVerticalOffset from './types'; +import type GetPopOverVerticalOffset from './types'; /** Adds the header padding with vertical offset on desktop */ const getPopOverVerticalOffset: GetPopOverVerticalOffset = (vertical) => ({ diff --git a/src/styles/utils/getPopOverVerticalOffset/index.ts b/src/styles/utils/getPopOverVerticalOffset/index.ts index 854653766cd2..a1b64c4f198f 100644 --- a/src/styles/utils/getPopOverVerticalOffset/index.ts +++ b/src/styles/utils/getPopOverVerticalOffset/index.ts @@ -1,4 +1,4 @@ -import GetPopOverVerticalOffset from './types'; +import type GetPopOverVerticalOffset from './types'; const getPopOverVerticalOffset: GetPopOverVerticalOffset = (vertical: number) => ({vertical}); diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index 4d7af731bae8..d262f19e10cb 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -1,15 +1,17 @@ -import {Animated, DimensionValue, ImageStyle, PressableStateCallbackType, StyleProp, StyleSheet, TextStyle, ViewStyle} from 'react-native'; -import {EdgeInsets} from 'react-native-safe-area-context'; -import {ValueOf} from 'type-fest'; +import type {Animated, DimensionValue, ImageStyle, PressableStateCallbackType, StyleProp, TextStyle, ViewStyle} from 'react-native'; +import { StyleSheet} from 'react-native'; +import type {EdgeInsets} from 'react-native-safe-area-context'; +import type {ValueOf} from 'type-fest'; import * as Browser from '@libs/Browser'; import * as UserUtils from '@libs/UserUtils'; import {defaultTheme} from '@styles/theme'; import colors from '@styles/theme/colors'; -import {ThemeColors} from '@styles/theme/types'; +import type {ThemeColors} from '@styles/theme/types'; import variables from '@styles/variables'; import CONST from '@src/CONST'; -import {Transaction} from '@src/types/onyx'; -import {defaultStyles, type ThemeStyles} from '..'; +import type {Transaction} from '@src/types/onyx'; +import {defaultStyles } from '..'; +import type {ThemeStyles} from '..'; import containerComposeStyles from './containerComposeStyles'; import fontFamily from './fontFamily'; import createModalStyleUtils from './generators/ModalStyleUtils'; @@ -18,7 +20,7 @@ import createTooltipStyleUtils from './generators/TooltipStyleUtils'; import getContextMenuItemStyles from './getContextMenuItemStyles'; import {compactContentContainerStyles} from './optionRowStyles'; import positioning from './positioning'; -import { +import type { AllStyles, AvatarSize, AvatarSizeName, diff --git a/src/styles/utils/italic/index.android.ts b/src/styles/utils/italic/index.android.ts index bbd9deb8cf8d..96b825b1958c 100644 --- a/src/styles/utils/italic/index.android.ts +++ b/src/styles/utils/italic/index.android.ts @@ -1,4 +1,4 @@ -import ItalicStyles from './types'; +import type ItalicStyles from './types'; const italic: ItalicStyles = 'normal'; diff --git a/src/styles/utils/italic/index.ts b/src/styles/utils/italic/index.ts index 02d6c46423f6..7567100a380c 100644 --- a/src/styles/utils/italic/index.ts +++ b/src/styles/utils/italic/index.ts @@ -1,4 +1,4 @@ -import ItalicStyles from './types'; +import type ItalicStyles from './types'; const italic: ItalicStyles = 'italic'; diff --git a/src/styles/utils/italic/types.ts b/src/styles/utils/italic/types.ts index e9feedbdfac5..f8fada7edb0c 100644 --- a/src/styles/utils/italic/types.ts +++ b/src/styles/utils/italic/types.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; type ItalicStyles = NonNullable; diff --git a/src/styles/utils/objectFit.ts b/src/styles/utils/objectFit.ts index 51f0c33b5457..2c748a69e87c 100644 --- a/src/styles/utils/objectFit.ts +++ b/src/styles/utils/objectFit.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; export default { oFCover: { diff --git a/src/styles/utils/optionAlternateTextPlatformStyles/index.ios.ts b/src/styles/utils/optionAlternateTextPlatformStyles/index.ios.ts index 14b024757fb8..160ef8be2f8d 100644 --- a/src/styles/utils/optionAlternateTextPlatformStyles/index.ios.ts +++ b/src/styles/utils/optionAlternateTextPlatformStyles/index.ios.ts @@ -1,4 +1,4 @@ -import OptionAlternateTextPlatformStyles from './types'; +import type OptionAlternateTextPlatformStyles from './types'; const optionAlternateTextPlatformStyles: OptionAlternateTextPlatformStyles = { paddingTop: 1, diff --git a/src/styles/utils/optionAlternateTextPlatformStyles/index.ts b/src/styles/utils/optionAlternateTextPlatformStyles/index.ts index e3232b810e06..00a967b5011e 100644 --- a/src/styles/utils/optionAlternateTextPlatformStyles/index.ts +++ b/src/styles/utils/optionAlternateTextPlatformStyles/index.ts @@ -1,4 +1,4 @@ -import OptionAlternateTextPlatformStyles from './types'; +import type OptionAlternateTextPlatformStyles from './types'; const optionAlternateTextPlatformStyles: OptionAlternateTextPlatformStyles = {}; diff --git a/src/styles/utils/optionAlternateTextPlatformStyles/types.ts b/src/styles/utils/optionAlternateTextPlatformStyles/types.ts index aacdef7e3501..8b37d963b214 100644 --- a/src/styles/utils/optionAlternateTextPlatformStyles/types.ts +++ b/src/styles/utils/optionAlternateTextPlatformStyles/types.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; type OptionAlternateTextPlatformStyles = Pick; diff --git a/src/styles/utils/optionRowStyles/index.native.ts b/src/styles/utils/optionRowStyles/index.native.ts index 334017ba3374..d41e34f23304 100644 --- a/src/styles/utils/optionRowStyles/index.native.ts +++ b/src/styles/utils/optionRowStyles/index.native.ts @@ -1,4 +1,4 @@ -import CompactContentContainerStyles from './types'; +import type CompactContentContainerStyles from './types'; /** * On native platforms, alignItemsBaseline does not work correctly diff --git a/src/styles/utils/optionRowStyles/index.ts b/src/styles/utils/optionRowStyles/index.ts index ce8f542a13ca..b7f40a760cdf 100644 --- a/src/styles/utils/optionRowStyles/index.ts +++ b/src/styles/utils/optionRowStyles/index.ts @@ -1,4 +1,4 @@ -import CompactContentContainerStyles from './types'; +import type CompactContentContainerStyles from './types'; const compactContentContainerStyles: CompactContentContainerStyles = (styles) => styles.alignItemsBaseline; diff --git a/src/styles/utils/optionRowStyles/types.ts b/src/styles/utils/optionRowStyles/types.ts index a31b94e0fc79..5ba49b9a02a2 100644 --- a/src/styles/utils/optionRowStyles/types.ts +++ b/src/styles/utils/optionRowStyles/types.ts @@ -1,5 +1,5 @@ -import {ViewStyle} from 'react-native'; -import {type ThemeStyles} from '@styles/index'; +import type {ViewStyle} from 'react-native'; +import type {ThemeStyles} from '@styles/index'; type CompactContentContainerStyles = (styles: ThemeStyles) => ViewStyle; diff --git a/src/styles/utils/overflow.ts b/src/styles/utils/overflow.ts index 9b4fa010af84..74d1dd96f852 100644 --- a/src/styles/utils/overflow.ts +++ b/src/styles/utils/overflow.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; import overflowAuto from './overflowAuto'; import overscrollBehaviorContain from './overscrollBehaviorContain'; diff --git a/src/styles/utils/overflowAuto/index.native.ts b/src/styles/utils/overflowAuto/index.native.ts index 34ee18db1d0a..7db324a39c8f 100644 --- a/src/styles/utils/overflowAuto/index.native.ts +++ b/src/styles/utils/overflowAuto/index.native.ts @@ -1,4 +1,4 @@ -import OverflowAutoStyles from './types'; +import type OverflowAutoStyles from './types'; // Overflow auto doesn't exist in react-native so we'll default to overflow: visible const overflowAuto: OverflowAutoStyles = { diff --git a/src/styles/utils/overflowAuto/index.ts b/src/styles/utils/overflowAuto/index.ts index 1e7ac8ed8246..670a0b9643eb 100644 --- a/src/styles/utils/overflowAuto/index.ts +++ b/src/styles/utils/overflowAuto/index.ts @@ -1,5 +1,5 @@ -import {ViewStyle} from 'react-native'; -import OverflowAutoStyles from './types'; +import type {ViewStyle} from 'react-native'; +import type OverflowAutoStyles from './types'; /** * Web-only style. diff --git a/src/styles/utils/overflowAuto/types.ts b/src/styles/utils/overflowAuto/types.ts index da7548d49e7b..e91d5ce7d2c3 100644 --- a/src/styles/utils/overflowAuto/types.ts +++ b/src/styles/utils/overflowAuto/types.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; type OverflowAutoStyles = Pick; diff --git a/src/styles/utils/overflowXHidden/index.native.ts b/src/styles/utils/overflowXHidden/index.native.ts index 3a2f61893d94..5455893d452c 100644 --- a/src/styles/utils/overflowXHidden/index.native.ts +++ b/src/styles/utils/overflowXHidden/index.native.ts @@ -1,4 +1,4 @@ -import OverflowXHiddenStyles from './types'; +import type OverflowXHiddenStyles from './types'; const overflowXHidden: OverflowXHiddenStyles = {}; diff --git a/src/styles/utils/overflowXHidden/index.ts b/src/styles/utils/overflowXHidden/index.ts index 6807be275be9..e83e0c824f9a 100644 --- a/src/styles/utils/overflowXHidden/index.ts +++ b/src/styles/utils/overflowXHidden/index.ts @@ -1,4 +1,4 @@ -import OverflowXHiddenStyles from './types'; +import type OverflowXHiddenStyles from './types'; const overflowXHidden: OverflowXHiddenStyles = { overflowX: 'hidden', diff --git a/src/styles/utils/overflowXHidden/types.ts b/src/styles/utils/overflowXHidden/types.ts index 0f13ba552c0c..fb01fc68cb96 100644 --- a/src/styles/utils/overflowXHidden/types.ts +++ b/src/styles/utils/overflowXHidden/types.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; type OverflowXHiddenStyles = Pick; diff --git a/src/styles/utils/overscrollBehaviorContain/index.native.ts b/src/styles/utils/overscrollBehaviorContain/index.native.ts index fd6b2f496912..a48b97807ba0 100644 --- a/src/styles/utils/overscrollBehaviorContain/index.native.ts +++ b/src/styles/utils/overscrollBehaviorContain/index.native.ts @@ -1,4 +1,4 @@ -import OverscrollBehaviorStyles from './types'; +import type OverscrollBehaviorStyles from './types'; const overscrollBehaviorContain: OverscrollBehaviorStyles = {}; diff --git a/src/styles/utils/overscrollBehaviorContain/index.ts b/src/styles/utils/overscrollBehaviorContain/index.ts index 18cbe810d336..86d3882824d8 100644 --- a/src/styles/utils/overscrollBehaviorContain/index.ts +++ b/src/styles/utils/overscrollBehaviorContain/index.ts @@ -1,4 +1,4 @@ -import OverscrollBehaviorStyles from './types'; +import type OverscrollBehaviorStyles from './types'; const overscrollBehaviorContain: OverscrollBehaviorStyles = { overscrollBehavior: 'contain', diff --git a/src/styles/utils/overscrollBehaviorContain/types.ts b/src/styles/utils/overscrollBehaviorContain/types.ts index 1e806eb60642..b608972b892b 100644 --- a/src/styles/utils/overscrollBehaviorContain/types.ts +++ b/src/styles/utils/overscrollBehaviorContain/types.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; type OverscrollBehaviorStyles = Pick; diff --git a/src/styles/utils/pointerEventsAuto/index.native.ts b/src/styles/utils/pointerEventsAuto/index.native.ts index cbefa643d1e0..5b53c54d28f5 100644 --- a/src/styles/utils/pointerEventsAuto/index.native.ts +++ b/src/styles/utils/pointerEventsAuto/index.native.ts @@ -1,4 +1,4 @@ -import PointerEventsAutoStyles from './types'; +import type PointerEventsAutoStyles from './types'; const pointerEventsAuto: PointerEventsAutoStyles = {}; diff --git a/src/styles/utils/pointerEventsAuto/index.ts b/src/styles/utils/pointerEventsAuto/index.ts index 8abda90caafe..f7ba29ef5fbb 100644 --- a/src/styles/utils/pointerEventsAuto/index.ts +++ b/src/styles/utils/pointerEventsAuto/index.ts @@ -1,4 +1,4 @@ -import PointerEventsAutoStyles from './types'; +import type PointerEventsAutoStyles from './types'; const pointerEventsAuto: PointerEventsAutoStyles = { pointerEvents: 'auto', diff --git a/src/styles/utils/pointerEventsAuto/types.ts b/src/styles/utils/pointerEventsAuto/types.ts index 0ecbc851e000..253d892aacf8 100644 --- a/src/styles/utils/pointerEventsAuto/types.ts +++ b/src/styles/utils/pointerEventsAuto/types.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; type PointerEventsAutoStyles = Pick; diff --git a/src/styles/utils/pointerEventsBoxNone/index.native.ts b/src/styles/utils/pointerEventsBoxNone/index.native.ts index 05ad2c07db39..0b59172395a1 100644 --- a/src/styles/utils/pointerEventsBoxNone/index.native.ts +++ b/src/styles/utils/pointerEventsBoxNone/index.native.ts @@ -1,4 +1,4 @@ -import PointerEventsBoxNone from './types'; +import type PointerEventsBoxNone from './types'; const pointerEventsBoxNone: PointerEventsBoxNone = {}; diff --git a/src/styles/utils/pointerEventsBoxNone/index.ts b/src/styles/utils/pointerEventsBoxNone/index.ts index 0e63e2deda09..4aa0972424b2 100644 --- a/src/styles/utils/pointerEventsBoxNone/index.ts +++ b/src/styles/utils/pointerEventsBoxNone/index.ts @@ -1,4 +1,4 @@ -import PointerEventsBoxNone from './types'; +import type PointerEventsBoxNone from './types'; const pointerEventsNone: PointerEventsBoxNone = { pointerEvents: 'box-none', diff --git a/src/styles/utils/pointerEventsBoxNone/types.ts b/src/styles/utils/pointerEventsBoxNone/types.ts index 25e85812f4e0..05c686640b3a 100644 --- a/src/styles/utils/pointerEventsBoxNone/types.ts +++ b/src/styles/utils/pointerEventsBoxNone/types.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; type PointerEventsBoxNone = Pick; diff --git a/src/styles/utils/pointerEventsNone/index.native.ts b/src/styles/utils/pointerEventsNone/index.native.ts index d92936025c94..1503fd9f68f0 100644 --- a/src/styles/utils/pointerEventsNone/index.native.ts +++ b/src/styles/utils/pointerEventsNone/index.native.ts @@ -1,4 +1,4 @@ -import PointerEventsNone from './types'; +import type PointerEventsNone from './types'; const pointerEventsNone: PointerEventsNone = {}; diff --git a/src/styles/utils/pointerEventsNone/index.ts b/src/styles/utils/pointerEventsNone/index.ts index 20dc46412e6d..fe535ad5e54b 100644 --- a/src/styles/utils/pointerEventsNone/index.ts +++ b/src/styles/utils/pointerEventsNone/index.ts @@ -1,4 +1,4 @@ -import PointerEventsNone from './types'; +import type PointerEventsNone from './types'; const pointerEventsNone: PointerEventsNone = { pointerEvents: 'none', diff --git a/src/styles/utils/pointerEventsNone/types.ts b/src/styles/utils/pointerEventsNone/types.ts index 766ac3f94349..34c31873df5b 100644 --- a/src/styles/utils/pointerEventsNone/types.ts +++ b/src/styles/utils/pointerEventsNone/types.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; type PointerEventsNone = Pick; diff --git a/src/styles/utils/positioning.ts b/src/styles/utils/positioning.ts index 26e6198a5827..5e0169990499 100644 --- a/src/styles/utils/positioning.ts +++ b/src/styles/utils/positioning.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; /** * Positioning utilities for absolute-positioned components. diff --git a/src/styles/utils/sizing.ts b/src/styles/utils/sizing.ts index 212d532c1b23..e7273f7b2b18 100644 --- a/src/styles/utils/sizing.ts +++ b/src/styles/utils/sizing.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; /** * Sizing utility styles with Bootstrap inspired naming. diff --git a/src/styles/utils/spacing.ts b/src/styles/utils/spacing.ts index b2597fc64603..27d70529dd8a 100644 --- a/src/styles/utils/spacing.ts +++ b/src/styles/utils/spacing.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; /** * Spacing utility styles with Bootstrap inspired naming. diff --git a/src/styles/utils/textDecorationLine.ts b/src/styles/utils/textDecorationLine.ts index 02e7db41e10a..e5f079150e78 100644 --- a/src/styles/utils/textDecorationLine.ts +++ b/src/styles/utils/textDecorationLine.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; export default { lineThrough: { diff --git a/src/styles/utils/textUnderline/index.native.ts b/src/styles/utils/textUnderline/index.native.ts index b3acbb48d01c..c658b2a3df86 100644 --- a/src/styles/utils/textUnderline/index.native.ts +++ b/src/styles/utils/textUnderline/index.native.ts @@ -1,4 +1,4 @@ -import TextUnderlineStyles from './types'; +import type TextUnderlineStyles from './types'; // following styles are not supported const textUnderline: TextUnderlineStyles = { diff --git a/src/styles/utils/textUnderline/index.ts b/src/styles/utils/textUnderline/index.ts index 2fbf6e0e354c..0dd06f004306 100644 --- a/src/styles/utils/textUnderline/index.ts +++ b/src/styles/utils/textUnderline/index.ts @@ -1,4 +1,4 @@ -import TextUnderlineStyles from './types'; +import type TextUnderlineStyles from './types'; const textUnderline: TextUnderlineStyles = { textUnderlinePositionUnder: { diff --git a/src/styles/utils/textUnderline/types.ts b/src/styles/utils/textUnderline/types.ts index f71d2bfdaa9a..0b103a0fb98e 100644 --- a/src/styles/utils/textUnderline/types.ts +++ b/src/styles/utils/textUnderline/types.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; type TextUnderlineStyles = { textUnderlinePositionUnder: Pick; diff --git a/src/styles/utils/types.ts b/src/styles/utils/types.ts index 40a261beee71..5fe844f0f358 100644 --- a/src/styles/utils/types.ts +++ b/src/styles/utils/types.ts @@ -1,5 +1,5 @@ -import {ImageStyle, PressableStateCallbackType, StyleProp, TextStyle, ViewStyle} from 'react-native'; -import {ValueOf} from 'type-fest'; +import type {ImageStyle, PressableStateCallbackType, StyleProp, TextStyle, ViewStyle} from 'react-native'; +import type {ValueOf} from 'type-fest'; import type colors from '@styles/theme/colors'; import type variables from '@styles/variables'; import type CONST from '@src/CONST'; diff --git a/src/styles/utils/userSelect/index.native.ts b/src/styles/utils/userSelect/index.native.ts index 0d1a34ef2473..05e3c8996f4a 100644 --- a/src/styles/utils/userSelect/index.native.ts +++ b/src/styles/utils/userSelect/index.native.ts @@ -1,4 +1,4 @@ -import UserSelectStyles from './types'; +import type UserSelectStyles from './types'; const userSelect: UserSelectStyles = { userSelectText: { diff --git a/src/styles/utils/userSelect/index.ts b/src/styles/utils/userSelect/index.ts index 6b9f26131b5e..79eec6d3b139 100644 --- a/src/styles/utils/userSelect/index.ts +++ b/src/styles/utils/userSelect/index.ts @@ -1,4 +1,4 @@ -import UserSelectStyles from './types'; +import type UserSelectStyles from './types'; const userSelect: UserSelectStyles = { userSelectText: { diff --git a/src/styles/utils/userSelect/types.ts b/src/styles/utils/userSelect/types.ts index a177bac5a3e7..74a4a7bbde9a 100644 --- a/src/styles/utils/userSelect/types.ts +++ b/src/styles/utils/userSelect/types.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; type UserSelectStyles = Record<'userSelectText' | 'userSelectNone', Pick>; diff --git a/src/styles/utils/visibility/index.native.ts b/src/styles/utils/visibility/index.native.ts index c74719d02184..79ea2f345cf6 100644 --- a/src/styles/utils/visibility/index.native.ts +++ b/src/styles/utils/visibility/index.native.ts @@ -1,4 +1,4 @@ -import VisibilityStyles from './types'; +import type VisibilityStyles from './types'; const visibility: VisibilityStyles = { visible: {}, diff --git a/src/styles/utils/visibility/index.ts b/src/styles/utils/visibility/index.ts index 8e2d3451be43..f0743a481647 100644 --- a/src/styles/utils/visibility/index.ts +++ b/src/styles/utils/visibility/index.ts @@ -1,4 +1,4 @@ -import VisibilityStyles from './types'; +import type VisibilityStyles from './types'; const visibility: VisibilityStyles = { visible: { diff --git a/src/styles/utils/visibility/types.ts b/src/styles/utils/visibility/types.ts index 64bdbdd2cca6..93761babeade 100644 --- a/src/styles/utils/visibility/types.ts +++ b/src/styles/utils/visibility/types.ts @@ -1,4 +1,4 @@ -import {ViewStyle} from 'react-native'; +import type {ViewStyle} from 'react-native'; type VisibilityStyles = Record<'visible' | 'hidden', Pick>; diff --git a/src/styles/utils/whiteSpace/index.native.ts b/src/styles/utils/whiteSpace/index.native.ts index 420bda325c6a..cf02b0e9ff42 100644 --- a/src/styles/utils/whiteSpace/index.native.ts +++ b/src/styles/utils/whiteSpace/index.native.ts @@ -1,4 +1,4 @@ -import WhiteSpaceStyles from './types'; +import type WhiteSpaceStyles from './types'; const whiteSpace: WhiteSpaceStyles = { noWrap: {}, diff --git a/src/styles/utils/whiteSpace/index.ts b/src/styles/utils/whiteSpace/index.ts index dd0ef94d12b0..ad736d233fdb 100644 --- a/src/styles/utils/whiteSpace/index.ts +++ b/src/styles/utils/whiteSpace/index.ts @@ -1,4 +1,4 @@ -import WhiteSpaceStyles from './types'; +import type WhiteSpaceStyles from './types'; const whiteSpace: WhiteSpaceStyles = { noWrap: { diff --git a/src/styles/utils/whiteSpace/types.ts b/src/styles/utils/whiteSpace/types.ts index b10671f04977..5fa98ad506d0 100644 --- a/src/styles/utils/whiteSpace/types.ts +++ b/src/styles/utils/whiteSpace/types.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; type WhiteSpaceStyles = Record<'noWrap' | 'preWrap' | 'pre', Pick>; diff --git a/src/styles/utils/wordBreak/index.native.ts b/src/styles/utils/wordBreak/index.native.ts index c4575c51d3f2..0afdda99d0d9 100644 --- a/src/styles/utils/wordBreak/index.native.ts +++ b/src/styles/utils/wordBreak/index.native.ts @@ -1,4 +1,4 @@ -import WordBreakStyles from './types'; +import type WordBreakStyles from './types'; const wordBreak: WordBreakStyles = { breakWord: {}, diff --git a/src/styles/utils/wordBreak/index.ts b/src/styles/utils/wordBreak/index.ts index 4da23e0f074a..b224fe472181 100644 --- a/src/styles/utils/wordBreak/index.ts +++ b/src/styles/utils/wordBreak/index.ts @@ -1,4 +1,4 @@ -import WordBreakStyles from './types'; +import type WordBreakStyles from './types'; const wordBreak: WordBreakStyles = { breakWord: { diff --git a/src/styles/utils/wordBreak/types.ts b/src/styles/utils/wordBreak/types.ts index 0ed520ae119d..2e81d1aac449 100644 --- a/src/styles/utils/wordBreak/types.ts +++ b/src/styles/utils/wordBreak/types.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; type WordBreakStyles = Record<'breakWord' | 'breakAll', Pick>; diff --git a/src/styles/utils/writingDirection.ts b/src/styles/utils/writingDirection.ts index f3f249796047..e385e8bd9a6d 100644 --- a/src/styles/utils/writingDirection.ts +++ b/src/styles/utils/writingDirection.ts @@ -1,4 +1,4 @@ -import {TextStyle} from 'react-native'; +import type {TextStyle} from 'react-native'; /** * Writing direction utility styles. diff --git a/src/types/modules/pusher.d.ts b/src/types/modules/pusher.d.ts index 9705ec4935c8..676d7a7ee2fc 100644 --- a/src/types/modules/pusher.d.ts +++ b/src/types/modules/pusher.d.ts @@ -1,4 +1,4 @@ -import Pusher from 'pusher-js/types/src/core/pusher'; +import type Pusher from 'pusher-js/types/src/core/pusher'; declare global { // eslint-disable-next-line @typescript-eslint/consistent-type-definitions diff --git a/src/types/modules/react-native-onyx.d.ts b/src/types/modules/react-native-onyx.d.ts index d603b9f93ae8..05302577910b 100644 --- a/src/types/modules/react-native-onyx.d.ts +++ b/src/types/modules/react-native-onyx.d.ts @@ -1,4 +1,4 @@ -import {OnyxCollectionKey, OnyxKey, OnyxValues} from '@src/ONYXKEYS'; +import type {OnyxCollectionKey, OnyxKey, OnyxValues} from '@src/ONYXKEYS'; declare module 'react-native-onyx' { // eslint-disable-next-line @typescript-eslint/consistent-type-definitions diff --git a/src/types/modules/react-native-svg.d.ts b/src/types/modules/react-native-svg.d.ts index 4adc164fa853..0d98870b04b2 100644 --- a/src/types/modules/react-native-svg.d.ts +++ b/src/types/modules/react-native-svg.d.ts @@ -1,4 +1,4 @@ -import {CommonPathProps as BaseCommonPathProps, SvgProps as BaseSvgProps} from 'react-native-svg'; +import type {CommonPathProps as BaseCommonPathProps, SvgProps as BaseSvgProps} from 'react-native-svg'; declare module 'react-native-svg' { // eslint-disable-next-line @typescript-eslint/consistent-type-definitions diff --git a/src/types/modules/react-native.d.ts b/src/types/modules/react-native.d.ts index 25ff1c6c73b8..8175a3631354 100644 --- a/src/types/modules/react-native.d.ts +++ b/src/types/modules/react-native.d.ts @@ -4,9 +4,9 @@ /* eslint-disable @typescript-eslint/consistent-type-definitions */ // eslint-disable-next-line no-restricted-imports -import {CSSProperties, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, PointerEventHandler, UIEventHandler, WheelEventHandler} from 'react'; +import type {CSSProperties, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, PointerEventHandler, UIEventHandler, WheelEventHandler} from 'react'; import 'react-native'; -import {BootSplashModule} from '@libs/BootSplash/types'; +import type {BootSplashModule} from '@libs/BootSplash/types'; declare module 'react-native' { // <------ REACT NATIVE WEB (0.19.0) ------> diff --git a/src/types/modules/react-navigation.d.ts b/src/types/modules/react-navigation.d.ts index 1ac35c937116..f6a47f3cdb9a 100644 --- a/src/types/modules/react-navigation.d.ts +++ b/src/types/modules/react-navigation.d.ts @@ -1,4 +1,4 @@ -import {RootStackParamList} from '@libs/Navigation/types'; +import type {RootStackParamList} from '@libs/Navigation/types'; declare global { namespace ReactNavigation { diff --git a/src/types/modules/react.d.ts b/src/types/modules/react.d.ts index 0608a59b4702..3e2e8fb37aa8 100644 --- a/src/types/modules/react.d.ts +++ b/src/types/modules/react.d.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import type React from 'react'; declare module 'react' { // eslint-disable-next-line @typescript-eslint/ban-types diff --git a/src/types/onyx/Account.ts b/src/types/onyx/Account.ts index 8093642a7111..0ea3e05e8d6a 100644 --- a/src/types/onyx/Account.ts +++ b/src/types/onyx/Account.ts @@ -1,6 +1,6 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import * as OnyxCommon from './OnyxCommon'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type * as OnyxCommon from './OnyxCommon'; type TwoFactorAuthStep = ValueOf | ''; diff --git a/src/types/onyx/AccountData.ts b/src/types/onyx/AccountData.ts index 601e82cde836..88511eec6864 100644 --- a/src/types/onyx/AccountData.ts +++ b/src/types/onyx/AccountData.ts @@ -1,5 +1,5 @@ -import {BankName} from './Bank'; -import * as OnyxCommon from './OnyxCommon'; +import type {BankName} from './Bank'; +import type * as OnyxCommon from './OnyxCommon'; type AdditionalData = { isP2PDebitCard?: boolean; diff --git a/src/types/onyx/Bank.ts b/src/types/onyx/Bank.ts index 533458c88b49..72b5fcda4788 100644 --- a/src/types/onyx/Bank.ts +++ b/src/types/onyx/Bank.ts @@ -1,7 +1,7 @@ -import {ViewStyle} from 'react-native'; -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import IconAsset from '@src/types/utils/IconAsset'; +import type {ViewStyle} from 'react-native'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type IconAsset from '@src/types/utils/IconAsset'; type BankIcon = { icon: IconAsset; diff --git a/src/types/onyx/BankAccount.ts b/src/types/onyx/BankAccount.ts index 8e26faf518cb..b9d541b72f2e 100644 --- a/src/types/onyx/BankAccount.ts +++ b/src/types/onyx/BankAccount.ts @@ -1,6 +1,6 @@ -import CONST from '@src/CONST'; -import AccountData from './AccountData'; -import * as OnyxCommon from './OnyxCommon'; +import type CONST from '@src/CONST'; +import type AccountData from './AccountData'; +import type * as OnyxCommon from './OnyxCommon'; type AdditionalData = { isP2PDebitCard?: boolean; diff --git a/src/types/onyx/Beta.ts b/src/types/onyx/Beta.ts index 9216946499e8..35ed4c804ab8 100644 --- a/src/types/onyx/Beta.ts +++ b/src/types/onyx/Beta.ts @@ -1,5 +1,5 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; type Beta = ValueOf; diff --git a/src/types/onyx/Card.ts b/src/types/onyx/Card.ts index ae4e86212a00..e3b025ff5a2f 100644 --- a/src/types/onyx/Card.ts +++ b/src/types/onyx/Card.ts @@ -1,6 +1,6 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import * as OnyxCommon from './OnyxCommon'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type * as OnyxCommon from './OnyxCommon'; type Card = { cardID: number; diff --git a/src/types/onyx/Form.ts b/src/types/onyx/Form.ts index 7b7d8d76536a..ca8d6574adf5 100644 --- a/src/types/onyx/Form.ts +++ b/src/types/onyx/Form.ts @@ -1,4 +1,4 @@ -import * as OnyxCommon from './OnyxCommon'; +import type * as OnyxCommon from './OnyxCommon'; type Form = { /** Controls the loading state of the form */ diff --git a/src/types/onyx/Fund.ts b/src/types/onyx/Fund.ts index e889a414062e..842a882ff23f 100644 --- a/src/types/onyx/Fund.ts +++ b/src/types/onyx/Fund.ts @@ -1,6 +1,6 @@ -import CONST from '@src/CONST'; -import {BankName} from './Bank'; -import * as OnyxCommon from './OnyxCommon'; +import type CONST from '@src/CONST'; +import type {BankName} from './Bank'; +import type * as OnyxCommon from './OnyxCommon'; type AdditionalData = { isBillingCard?: boolean; diff --git a/src/types/onyx/Locale.ts b/src/types/onyx/Locale.ts index 1a5124684995..89d7636009d7 100644 --- a/src/types/onyx/Locale.ts +++ b/src/types/onyx/Locale.ts @@ -1,5 +1,5 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; type Locale = ValueOf; diff --git a/src/types/onyx/Login.ts b/src/types/onyx/Login.ts index bcf949eb95e6..7a4093d4ab11 100644 --- a/src/types/onyx/Login.ts +++ b/src/types/onyx/Login.ts @@ -1,4 +1,4 @@ -import * as OnyxCommon from './OnyxCommon'; +import type * as OnyxCommon from './OnyxCommon'; type Login = { /** Phone/Email associated with user */ diff --git a/src/types/onyx/OnyxCommon.ts b/src/types/onyx/OnyxCommon.ts index 956e9ff36b24..b26dc167ed44 100644 --- a/src/types/onyx/OnyxCommon.ts +++ b/src/types/onyx/OnyxCommon.ts @@ -1,6 +1,6 @@ -import {ValueOf} from 'type-fest'; -import {AvatarSource} from '@libs/UserUtils'; -import CONST from '@src/CONST'; +import type {ValueOf} from 'type-fest'; +import type {AvatarSource} from '@libs/UserUtils'; +import type CONST from '@src/CONST'; type PendingAction = ValueOf; diff --git a/src/types/onyx/OnyxUpdatesFromServer.ts b/src/types/onyx/OnyxUpdatesFromServer.ts index 843d3ae86e46..b3932bbb7841 100644 --- a/src/types/onyx/OnyxUpdatesFromServer.ts +++ b/src/types/onyx/OnyxUpdatesFromServer.ts @@ -1,6 +1,6 @@ -import {OnyxUpdate} from 'react-native-onyx'; -import Request from './Request'; -import Response from './Response'; +import type {OnyxUpdate} from 'react-native-onyx'; +import type Request from './Request'; +import type Response from './Response'; type OnyxServerUpdate = OnyxUpdate & {shouldNotify?: boolean}; diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 767f724dd571..c4e30157bf6f 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -1,6 +1,6 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import DeepValueOf from '@src/types/utils/DeepValueOf'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type DeepValueOf from '@src/types/utils/DeepValueOf'; type ActionName = DeepValueOf; type OriginalMessageActionName = diff --git a/src/types/onyx/PaymentMethod.ts b/src/types/onyx/PaymentMethod.ts index c9645e01983b..4b3a4c8986fb 100644 --- a/src/types/onyx/PaymentMethod.ts +++ b/src/types/onyx/PaymentMethod.ts @@ -1,7 +1,7 @@ -import {ViewStyle} from 'react-native'; -import IconAsset from '@src/types/utils/IconAsset'; -import BankAccount from './BankAccount'; -import Fund from './Fund'; +import type {ViewStyle} from 'react-native'; +import type IconAsset from '@src/types/utils/IconAsset'; +import type BankAccount from './BankAccount'; +import type Fund from './Fund'; type PaymentMethod = (BankAccount | Fund) & { description: string; diff --git a/src/types/onyx/PersonalBankAccount.ts b/src/types/onyx/PersonalBankAccount.ts index 865f41bebbeb..8eb6d327f13c 100644 --- a/src/types/onyx/PersonalBankAccount.ts +++ b/src/types/onyx/PersonalBankAccount.ts @@ -1,4 +1,4 @@ -import * as OnyxCommon from './OnyxCommon'; +import type * as OnyxCommon from './OnyxCommon'; type PersonalBankAccount = { /** An error message to display to the user */ diff --git a/src/types/onyx/PersonalDetails.ts b/src/types/onyx/PersonalDetails.ts index 03aa7e4ec928..baf3b9d3801a 100644 --- a/src/types/onyx/PersonalDetails.ts +++ b/src/types/onyx/PersonalDetails.ts @@ -1,6 +1,6 @@ -import {AvatarSource} from '@libs/UserUtils'; -import TIMEZONES from '@src/TIMEZONES'; -import * as OnyxCommon from './OnyxCommon'; +import type {AvatarSource} from '@libs/UserUtils'; +import type TIMEZONES from '@src/TIMEZONES'; +import type * as OnyxCommon from './OnyxCommon'; type SelectedTimezone = (typeof TIMEZONES)[number]; diff --git a/src/types/onyx/PlaidData.ts b/src/types/onyx/PlaidData.ts index 28a1cb324bcb..8ec93119cbd8 100644 --- a/src/types/onyx/PlaidData.ts +++ b/src/types/onyx/PlaidData.ts @@ -1,5 +1,5 @@ -import * as OnyxCommon from './OnyxCommon'; -import PlaidBankAccount from './PlaidBankAccount'; +import type * as OnyxCommon from './OnyxCommon'; +import type PlaidBankAccount from './PlaidBankAccount'; type PlaidData = { /** Name of the bank */ diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index 685fcd5e05d5..ff3a5e1dd23c 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -1,6 +1,6 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import * as OnyxCommon from './OnyxCommon'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type * as OnyxCommon from './OnyxCommon'; type Unit = 'mi' | 'km'; diff --git a/src/types/onyx/PolicyMember.ts b/src/types/onyx/PolicyMember.ts index 60836b276ea0..6439888b9144 100644 --- a/src/types/onyx/PolicyMember.ts +++ b/src/types/onyx/PolicyMember.ts @@ -1,4 +1,4 @@ -import * as OnyxCommon from './OnyxCommon'; +import type * as OnyxCommon from './OnyxCommon'; type PolicyMember = { /** Role of the user in the policy */ diff --git a/src/types/onyx/ReimbursementAccount.ts b/src/types/onyx/ReimbursementAccount.ts index 75954983371e..c0ade25e4d79 100644 --- a/src/types/onyx/ReimbursementAccount.ts +++ b/src/types/onyx/ReimbursementAccount.ts @@ -1,6 +1,6 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import * as OnyxCommon from './OnyxCommon'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type * as OnyxCommon from './OnyxCommon'; type BankAccountStep = ValueOf; diff --git a/src/types/onyx/Report.ts b/src/types/onyx/Report.ts index b274025908f5..840bbd1e2e2f 100644 --- a/src/types/onyx/Report.ts +++ b/src/types/onyx/Report.ts @@ -1,7 +1,7 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import * as OnyxCommon from './OnyxCommon'; -import PersonalDetails from './PersonalDetails'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type * as OnyxCommon from './OnyxCommon'; +import type PersonalDetails from './PersonalDetails'; type NotificationPreference = ValueOf; diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts index a881b63fbb95..b727bc40ce93 100644 --- a/src/types/onyx/ReportAction.ts +++ b/src/types/onyx/ReportAction.ts @@ -1,11 +1,12 @@ -import {ValueOf} from 'type-fest'; -import {AvatarSource} from '@libs/UserUtils'; -import CONST from '@src/CONST'; -import {EmptyObject} from '@src/types/utils/EmptyObject'; -import * as OnyxCommon from './OnyxCommon'; -import OriginalMessage, {Decision, Reaction} from './OriginalMessage'; -import {NotificationPreference} from './Report'; -import {Receipt} from './Transaction'; +import type {ValueOf} from 'type-fest'; +import type {AvatarSource} from '@libs/UserUtils'; +import type CONST from '@src/CONST'; +import type {EmptyObject} from '@src/types/utils/EmptyObject'; +import type * as OnyxCommon from './OnyxCommon'; +import type {Decision, Reaction} from './OriginalMessage'; +import type OriginalMessage from './OriginalMessage'; +import type {NotificationPreference} from './Report'; +import type {Receipt} from './Transaction'; type Message = { /** The type of the action item fragment. Used to render a corresponding component */ diff --git a/src/types/onyx/ReportActionReactions.ts b/src/types/onyx/ReportActionReactions.ts index 348a4b1baf62..be117aafc4c5 100644 --- a/src/types/onyx/ReportActionReactions.ts +++ b/src/types/onyx/ReportActionReactions.ts @@ -1,4 +1,4 @@ -import * as OnyxCommon from './OnyxCommon'; +import type * as OnyxCommon from './OnyxCommon'; type UserReaction = { /** ID of user reaction */ diff --git a/src/types/onyx/ReportActionsDrafts.ts b/src/types/onyx/ReportActionsDrafts.ts index ad2782111144..70d16c62a3bc 100644 --- a/src/types/onyx/ReportActionsDrafts.ts +++ b/src/types/onyx/ReportActionsDrafts.ts @@ -1,4 +1,4 @@ -import ReportActionsDraft from './ReportActionsDraft'; +import type ReportActionsDraft from './ReportActionsDraft'; type ReportActionsDrafts = Record; diff --git a/src/types/onyx/Request.ts b/src/types/onyx/Request.ts index 746e7f75b3d5..fa87e1d194c2 100644 --- a/src/types/onyx/Request.ts +++ b/src/types/onyx/Request.ts @@ -1,5 +1,5 @@ -import {OnyxUpdate} from 'react-native-onyx'; -import Response from './Response'; +import type {OnyxUpdate} from 'react-native-onyx'; +import type Response from './Response'; type OnyxData = { successData?: OnyxUpdate[]; diff --git a/src/types/onyx/Response.ts b/src/types/onyx/Response.ts index 66d5dcbdfd5b..b06ec9766842 100644 --- a/src/types/onyx/Response.ts +++ b/src/types/onyx/Response.ts @@ -1,4 +1,4 @@ -import {OnyxUpdate} from 'react-native-onyx'; +import type {OnyxUpdate} from 'react-native-onyx'; type Data = { phpCommandName: string; diff --git a/src/types/onyx/Session.ts b/src/types/onyx/Session.ts index aa4d52075d34..e17bfaf1c2b9 100644 --- a/src/types/onyx/Session.ts +++ b/src/types/onyx/Session.ts @@ -1,6 +1,6 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import * as OnyxCommon from './OnyxCommon'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type * as OnyxCommon from './OnyxCommon'; type AutoAuthState = ValueOf; diff --git a/src/types/onyx/Task.ts b/src/types/onyx/Task.ts index 9d5c83ee4a40..804be21d3e1c 100644 --- a/src/types/onyx/Task.ts +++ b/src/types/onyx/Task.ts @@ -1,4 +1,4 @@ -import Report from './Report'; +import type Report from './Report'; type Task = { /** Title of the Task */ diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts index 53bfc36a4e47..8b7e26280305 100644 --- a/src/types/onyx/Transaction.ts +++ b/src/types/onyx/Transaction.ts @@ -1,7 +1,7 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import * as OnyxCommon from './OnyxCommon'; -import RecentWaypoint from './RecentWaypoint'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type * as OnyxCommon from './OnyxCommon'; +import type RecentWaypoint from './RecentWaypoint'; type Waypoint = { /** The name associated with the address of the waypoint */ diff --git a/src/types/onyx/UserWallet.ts b/src/types/onyx/UserWallet.ts index 501e05a31ad0..1b903792912c 100644 --- a/src/types/onyx/UserWallet.ts +++ b/src/types/onyx/UserWallet.ts @@ -1,6 +1,6 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import * as OnyxCommon from './OnyxCommon'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type * as OnyxCommon from './OnyxCommon'; type WalletLinkedAccountType = 'debitCard' | 'bankAccount'; diff --git a/src/types/onyx/WalletAdditionalDetails.ts b/src/types/onyx/WalletAdditionalDetails.ts index e766ba4cfe50..da890b36bfef 100644 --- a/src/types/onyx/WalletAdditionalDetails.ts +++ b/src/types/onyx/WalletAdditionalDetails.ts @@ -1,4 +1,4 @@ -import * as OnyxCommon from './OnyxCommon'; +import type * as OnyxCommon from './OnyxCommon'; type WalletAdditionalDetails = { /** Questions returned by Idology */ diff --git a/src/types/onyx/WalletOnfido.ts b/src/types/onyx/WalletOnfido.ts index 7a65c0f710ef..bea6db81a87d 100644 --- a/src/types/onyx/WalletOnfido.ts +++ b/src/types/onyx/WalletOnfido.ts @@ -1,4 +1,4 @@ -import * as OnyxCommon from './OnyxCommon'; +import type * as OnyxCommon from './OnyxCommon'; type WalletOnfido = { /** Unique identifier returned from openOnfidoFlow then re-sent to ActivateWallet with Onfido response data */ diff --git a/src/types/onyx/WalletTerms.ts b/src/types/onyx/WalletTerms.ts index 5394f126c33c..b60a880e0aa0 100644 --- a/src/types/onyx/WalletTerms.ts +++ b/src/types/onyx/WalletTerms.ts @@ -1,4 +1,4 @@ -import * as OnyxCommon from './OnyxCommon'; +import type * as OnyxCommon from './OnyxCommon'; type WalletTerms = { /** Any error message to show */ diff --git a/src/types/onyx/WalletTransfer.ts b/src/types/onyx/WalletTransfer.ts index cebea543884b..3151ecb3ad5c 100644 --- a/src/types/onyx/WalletTransfer.ts +++ b/src/types/onyx/WalletTransfer.ts @@ -1,7 +1,7 @@ -import {ValueOf} from 'type-fest'; -import CONST from '@src/CONST'; -import * as OnyxCommon from './OnyxCommon'; -import PaymentMethod from './PaymentMethod'; +import type {ValueOf} from 'type-fest'; +import type CONST from '@src/CONST'; +import type * as OnyxCommon from './OnyxCommon'; +import type PaymentMethod from './PaymentMethod'; type WalletTransfer = { /** Selected accountID for transfer */ diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index efa1ae1fe630..de71202dcc2a 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -1,62 +1,71 @@ -import Account from './Account'; -import AccountData from './AccountData'; -import BankAccount, {BankAccountList} from './BankAccount'; -import Beta from './Beta'; -import BlockedFromConcierge from './BlockedFromConcierge'; -import Card from './Card'; -import Credentials from './Credentials'; -import Currency from './Currency'; -import CustomStatusDraft from './CustomStatusDraft'; -import Download from './Download'; -import Form, {AddDebitCardForm, DateOfBirthForm} from './Form'; -import FrequentlyUsedEmoji from './FrequentlyUsedEmoji'; -import Fund, {FundList} from './Fund'; -import IOU from './IOU'; -import Locale from './Locale'; -import Login, {LoginList} from './Login'; -import MapboxAccessToken from './MapboxAccessToken'; -import Modal from './Modal'; -import Network from './Network'; -import {OnyxUpdateEvent, OnyxUpdatesFromServer} from './OnyxUpdatesFromServer'; -import PersonalBankAccount from './PersonalBankAccount'; -import PersonalDetails, {PersonalDetailsList} from './PersonalDetails'; -import PlaidData from './PlaidData'; -import Policy from './Policy'; -import PolicyCategory, {PolicyCategories} from './PolicyCategory'; -import PolicyMember, {PolicyMembers} from './PolicyMember'; -import PolicyReportField from './PolicyReportField'; -import PolicyTag, {PolicyTags} from './PolicyTag'; -import PrivatePersonalDetails from './PrivatePersonalDetails'; -import RecentlyUsedCategories from './RecentlyUsedCategories'; -import RecentlyUsedReportFields from './RecentlyUsedReportFields'; -import RecentlyUsedTags from './RecentlyUsedTags'; -import RecentWaypoint from './RecentWaypoint'; -import ReimbursementAccount from './ReimbursementAccount'; -import ReimbursementAccountDraft from './ReimbursementAccountDraft'; -import Report from './Report'; -import ReportAction, {ReportActions} from './ReportAction'; -import ReportActionReactions from './ReportActionReactions'; -import ReportActionsDraft from './ReportActionsDraft'; -import ReportActionsDrafts from './ReportActionsDrafts'; -import ReportMetadata from './ReportMetadata'; -import ReportNextStep from './ReportNextStep'; -import ReportUserIsTyping from './ReportUserIsTyping'; -import Request from './Request'; -import Response from './Response'; -import ScreenShareRequest from './ScreenShareRequest'; -import SecurityGroup from './SecurityGroup'; -import Session from './Session'; -import Task from './Task'; -import Transaction from './Transaction'; -import {TransactionViolation, ViolationName} from './TransactionViolation'; -import User from './User'; -import UserLocation from './UserLocation'; -import UserWallet from './UserWallet'; -import WalletAdditionalDetails from './WalletAdditionalDetails'; -import WalletOnfido from './WalletOnfido'; -import WalletStatement from './WalletStatement'; -import WalletTerms from './WalletTerms'; -import WalletTransfer from './WalletTransfer'; +import type Account from './Account'; +import type AccountData from './AccountData'; +import type {BankAccountList} from './BankAccount'; +import type BankAccount from './BankAccount'; +import type Beta from './Beta'; +import type BlockedFromConcierge from './BlockedFromConcierge'; +import type Card from './Card'; +import type Credentials from './Credentials'; +import type Currency from './Currency'; +import type CustomStatusDraft from './CustomStatusDraft'; +import type Download from './Download'; +import type {AddDebitCardForm, DateOfBirthForm} from './Form'; +import type Form from './Form'; +import type FrequentlyUsedEmoji from './FrequentlyUsedEmoji'; +import type {FundList} from './Fund'; +import type Fund from './Fund'; +import type IOU from './IOU'; +import type Locale from './Locale'; +import type {LoginList} from './Login'; +import type Login from './Login'; +import type MapboxAccessToken from './MapboxAccessToken'; +import type Modal from './Modal'; +import type Network from './Network'; +import type {OnyxUpdateEvent, OnyxUpdatesFromServer} from './OnyxUpdatesFromServer'; +import type PersonalBankAccount from './PersonalBankAccount'; +import type {PersonalDetailsList} from './PersonalDetails'; +import type PersonalDetails from './PersonalDetails'; +import type PlaidData from './PlaidData'; +import type Policy from './Policy'; +import type {PolicyCategories} from './PolicyCategory'; +import type PolicyCategory from './PolicyCategory'; +import type {PolicyMembers} from './PolicyMember'; +import type PolicyMember from './PolicyMember'; +import type PolicyReportField from './PolicyReportField'; +import type {PolicyTags} from './PolicyTag'; +import type PolicyTag from './PolicyTag'; +import type PrivatePersonalDetails from './PrivatePersonalDetails'; +import type RecentlyUsedCategories from './RecentlyUsedCategories'; +import type RecentlyUsedReportFields from './RecentlyUsedReportFields'; +import type RecentlyUsedTags from './RecentlyUsedTags'; +import type RecentWaypoint from './RecentWaypoint'; +import type ReimbursementAccount from './ReimbursementAccount'; +import type ReimbursementAccountDraft from './ReimbursementAccountDraft'; +import type Report from './Report'; +import type {ReportActions} from './ReportAction'; +import type ReportAction from './ReportAction'; +import type ReportActionReactions from './ReportActionReactions'; +import type ReportActionsDraft from './ReportActionsDraft'; +import type ReportActionsDrafts from './ReportActionsDrafts'; +import type ReportMetadata from './ReportMetadata'; +import type ReportNextStep from './ReportNextStep'; +import type ReportUserIsTyping from './ReportUserIsTyping'; +import type Request from './Request'; +import type Response from './Response'; +import type ScreenShareRequest from './ScreenShareRequest'; +import type SecurityGroup from './SecurityGroup'; +import type Session from './Session'; +import type Task from './Task'; +import type Transaction from './Transaction'; +import type {TransactionViolation, ViolationName} from './TransactionViolation'; +import type User from './User'; +import type UserLocation from './UserLocation'; +import type UserWallet from './UserWallet'; +import type WalletAdditionalDetails from './WalletAdditionalDetails'; +import type WalletOnfido from './WalletOnfido'; +import type WalletStatement from './WalletStatement'; +import type WalletTerms from './WalletTerms'; +import type WalletTransfer from './WalletTransfer'; export type { Account, diff --git a/src/types/utils/CustomRefObject.ts b/src/types/utils/CustomRefObject.ts index aa726d7a0f86..13bb0f27a42e 100644 --- a/src/types/utils/CustomRefObject.ts +++ b/src/types/utils/CustomRefObject.ts @@ -1,4 +1,4 @@ -import {RefObject} from 'react'; +import type {RefObject} from 'react'; type CustomRefObject = RefObject & {onselectstart: () => boolean}; diff --git a/src/types/utils/EmptyObject.ts b/src/types/utils/EmptyObject.ts index aa8b538499cd..48be674f3c5c 100644 --- a/src/types/utils/EmptyObject.ts +++ b/src/types/utils/EmptyObject.ts @@ -1,4 +1,4 @@ -import Falsy from './Falsy'; +import type Falsy from './Falsy'; type EmptyObject = Record; diff --git a/src/types/utils/IconAsset.ts b/src/types/utils/IconAsset.ts index 45a79b8286ef..f5d193aaa993 100644 --- a/src/types/utils/IconAsset.ts +++ b/src/types/utils/IconAsset.ts @@ -1,5 +1,5 @@ -import {ImageSourcePropType} from 'react-native'; -import {SvgProps} from 'react-native-svg/lib/typescript'; +import type {ImageSourcePropType} from 'react-native'; +import type {SvgProps} from 'react-native-svg/lib/typescript'; type IconAsset = React.FC | ImageSourcePropType; diff --git a/src/types/utils/textRef.ts b/src/types/utils/textRef.ts index df0235f4ac0b..4e80f00b7bc6 100644 --- a/src/types/utils/textRef.ts +++ b/src/types/utils/textRef.ts @@ -1,4 +1,4 @@ -import {Text} from 'react-native'; +import type {Text} from 'react-native'; const textRef = (ref: React.RefObject) => ref as React.RefObject; diff --git a/src/types/utils/viewForwardedRef.ts b/src/types/utils/viewForwardedRef.ts index 3bc18495b153..87b26bfbab40 100644 --- a/src/types/utils/viewForwardedRef.ts +++ b/src/types/utils/viewForwardedRef.ts @@ -1,5 +1,5 @@ -import {ForwardedRef} from 'react'; -import {View} from 'react-native'; +import type {ForwardedRef} from 'react'; +import type {View} from 'react-native'; const viewForwardedRef = (ref: ForwardedRef) => ref as ForwardedRef; diff --git a/src/types/utils/viewRef.ts b/src/types/utils/viewRef.ts index 015d88cc5a8b..1fd9d186ba1f 100644 --- a/src/types/utils/viewRef.ts +++ b/src/types/utils/viewRef.ts @@ -1,4 +1,4 @@ -import {View} from 'react-native'; +import type {View} from 'react-native'; const viewRef = (ref: React.RefObject) => ref as React.RefObject; diff --git a/tests/perf-test/ModifiedExpenseMessage.perf-test.ts b/tests/perf-test/ModifiedExpenseMessage.perf-test.ts index 1997d55d8a05..5aa842155cb5 100644 --- a/tests/perf-test/ModifiedExpenseMessage.perf-test.ts +++ b/tests/perf-test/ModifiedExpenseMessage.perf-test.ts @@ -3,7 +3,7 @@ import Onyx from 'react-native-onyx'; import {measureFunction} from 'reassure'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {Policy, Report} from '@src/types/onyx'; +import type {Policy, Report} from '@src/types/onyx'; import ModifiedExpenseMessage from '../../src/libs/ModifiedExpenseMessage'; import createCollection from '../utils/collections/createCollection'; import createRandomPolicy from '../utils/collections/policies'; diff --git a/tests/perf-test/ReportActionsUtils.perf-test.ts b/tests/perf-test/ReportActionsUtils.perf-test.ts index d4a1b9b58e44..ea3b48bacf47 100644 --- a/tests/perf-test/ReportActionsUtils.perf-test.ts +++ b/tests/perf-test/ReportActionsUtils.perf-test.ts @@ -3,7 +3,8 @@ import {measureFunction} from 'reassure'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ReportAction, {ReportActions} from '@src/types/onyx/ReportAction'; +import type {ReportActions} from '@src/types/onyx/ReportAction'; +import type ReportAction from '@src/types/onyx/ReportAction'; import createCollection from '../utils/collections/createCollection'; import createRandomReportAction from '../utils/collections/reportActions'; import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; diff --git a/tests/perf-test/ReportUtils.perf-test.ts b/tests/perf-test/ReportUtils.perf-test.ts index 928d9a9fbdff..62b911fb0417 100644 --- a/tests/perf-test/ReportUtils.perf-test.ts +++ b/tests/perf-test/ReportUtils.perf-test.ts @@ -3,7 +3,7 @@ import {measureFunction} from 'reassure'; import * as ReportUtils from '@libs/ReportUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {PersonalDetails, Policy, Report, ReportAction} from '@src/types/onyx'; +import type {PersonalDetails, Policy, Report, ReportAction} from '@src/types/onyx'; import createCollection from '../utils/collections/createCollection'; import createPersonalDetails from '../utils/collections/personalDetails'; import createRandomPolicy from '../utils/collections/policies'; diff --git a/tests/perf-test/SidebarUtils.perf-test.ts b/tests/perf-test/SidebarUtils.perf-test.ts index 05143848f8b9..5606863f42e2 100644 --- a/tests/perf-test/SidebarUtils.perf-test.ts +++ b/tests/perf-test/SidebarUtils.perf-test.ts @@ -1,12 +1,13 @@ -import Onyx, {OnyxCollection} from 'react-native-onyx'; +import type {OnyxCollection} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; import {measureFunction} from 'reassure'; import SidebarUtils from '@libs/SidebarUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import {PersonalDetails} from '@src/types/onyx'; -import Policy from '@src/types/onyx/Policy'; -import Report from '@src/types/onyx/Report'; -import ReportAction from '@src/types/onyx/ReportAction'; +import type {PersonalDetails} from '@src/types/onyx'; +import type Policy from '@src/types/onyx/Policy'; +import type Report from '@src/types/onyx/Report'; +import type ReportAction from '@src/types/onyx/ReportAction'; import createCollection from '../utils/collections/createCollection'; import createPersonalDetails from '../utils/collections/personalDetails'; import createRandomPolicy from '../utils/collections/policies'; diff --git a/tests/unit/PersistedRequests.ts b/tests/unit/PersistedRequests.ts index 79153efdc806..b1d05c96f12a 100644 --- a/tests/unit/PersistedRequests.ts +++ b/tests/unit/PersistedRequests.ts @@ -1,5 +1,5 @@ import * as PersistedRequests from '../../src/libs/actions/PersistedRequests'; -import Request from '../../src/types/onyx/Request'; +import type Request from '../../src/types/onyx/Request'; const request: Request = { command: 'OpenReport', diff --git a/tests/utils/collections/reportActions.ts b/tests/utils/collections/reportActions.ts index abc83eb82abe..747cbe5b6a1a 100644 --- a/tests/utils/collections/reportActions.ts +++ b/tests/utils/collections/reportActions.ts @@ -1,6 +1,6 @@ import {rand, randAggregation, randBoolean, randPastDate, randWord} from '@ngneat/falso'; import CONST from '@src/CONST'; -import {ReportAction} from '@src/types/onyx'; +import type {ReportAction} from '@src/types/onyx'; type ActionType = keyof typeof CONST.REPORT.ACTIONS.TYPE; diff --git a/tests/utils/collections/transaction.ts b/tests/utils/collections/transaction.ts index 5f7cd47de990..25b4a77c66dd 100644 --- a/tests/utils/collections/transaction.ts +++ b/tests/utils/collections/transaction.ts @@ -1,6 +1,6 @@ import {rand, randAmount, randBoolean, randPastDate, randWord} from '@ngneat/falso'; import CONST from '@src/CONST'; -import {Transaction} from '@src/types/onyx'; +import type {Transaction} from '@src/types/onyx'; export default function createRandomTransaction(index: number): Transaction { return {