From 1ad012003313cfb5cd926c8e512c71dfaeab1436 Mon Sep 17 00:00:00 2001 From: ConjuringCoffee <72548231+ConjuringCoffee@users.noreply.github.com> Date: Wed, 15 Nov 2023 21:34:42 +0100 Subject: [PATCH] Consistently use type alias instead of interface --- src/Component/AppBarMoreMenu.tsx | 2 +- src/Component/CustomScrollView.tsx | 2 +- src/Helper/AmountHelper.ts | 2 +- src/Hooks/useConnectionTest.ts | 2 +- src/Hooks/useEditableBudgetsInProfiles.ts | 2 +- src/Navigation/AppNavigator.tsx | 2 +- src/Navigation/ScreenParameters.ts | 2 +- src/Screens/AmountsScreen/AmountView.tsx | 2 +- src/Screens/AmountsScreen/AmountsScreen.tsx | 2 +- src/Screens/AmountsScreen/CategoryInput.tsx | 2 +- src/Screens/AmountsScreen/SplitPercentInput.tsx | 2 +- src/Screens/AmountsScreen/SubAmountInput.tsx | 2 +- .../CalculationHistoryScreen/HistoryListItem.tsx | 2 +- src/Screens/CalculatorScreen/CalculatorKeyboard.tsx | 2 +- src/Screens/CalculatorScreen/KeyboardButton.tsx | 2 +- src/Screens/CalculatorScreen/KeyboardNumberButton.tsx | 2 +- src/Screens/CategoryScreen/CategoryList.tsx | 2 +- src/Screens/CategoryScreen/CategoryListItem.tsx | 2 +- src/Screens/InitialScreen/AccessTokenListItem.tsx | 2 +- src/Screens/InitialScreen/ProfileListItem.tsx | 2 +- src/Screens/SaveScreen/DataTableCellView.tsx | 2 +- src/Screens/SaveScreen/MemoDataTableCell.tsx | 2 +- src/Screens/SaveScreen/MemoModalPortal.tsx | 2 +- .../SaveScreen/MultiLineTextDataTableCellView.tsx | 2 +- src/Screens/SaveScreen/SaveFAB.tsx | 2 +- src/Screens/SaveScreen/SaveTransactionListSection.tsx | 2 +- src/Screens/SaveScreen/SubTransactionDataTableRow.tsx | 2 +- src/Screens/SaveScreen/SubTransactionsDataTable.tsx | 2 +- .../CategoryComboListItem.tsx | 2 +- .../Settings/AccessTokenScreen/AccessTokenInput.tsx | 2 +- .../Settings/AccessTokenScreen/AccessTokenScreen.tsx | 2 +- .../CategoryCombos/CategoryComboInputView.tsx | 2 +- .../CategoryCombos/ChooseCategoryListItem.tsx | 2 +- .../DisplaySettingsScreen/ThemeModalPortal.tsx | 2 +- .../Settings/Profiles/BudgetInProfileInputSection.tsx | 2 +- .../Settings/Profiles/BudgetSelectModalPortal.tsx | 2 +- .../Settings/Profiles/ChooseBudgetListItem.tsx | 2 +- .../CreateProfilesScreen/CreateProfileScreen.tsx | 2 +- .../Settings/Profiles/ProfileBudgetDetailInput.tsx | 2 +- src/Screens/SplittingScreen/AccountRadioSelection.tsx | 2 +- .../SplittingScreen/PayerBudgetRadioSelection.tsx | 2 +- src/Screens/SplittingScreen/TotalAmountInput.tsx | 2 +- src/YnabApi/BuildSaveTransactions.ts | 4 ++-- src/YnabApi/YnabApiWrapper.ts | 4 ++-- src/redux/features/accessToken/accessTokenSlice.ts | 2 +- .../features/categoryCombos/categoryCombosSlice.ts | 11 ++++------- .../features/displaySettings/displaySettingsSlice.ts | 8 ++++---- src/redux/features/profiles/profilesSlice.ts | 10 ++++------ src/redux/features/ynab/ynabSlice.ts | 6 +++--- src/redux/isOneOf.ts | 2 +- 50 files changed, 63 insertions(+), 68 deletions(-) diff --git a/src/Component/AppBarMoreMenu.tsx b/src/Component/AppBarMoreMenu.tsx index b57c000..bcc3589 100644 --- a/src/Component/AppBarMoreMenu.tsx +++ b/src/Component/AppBarMoreMenu.tsx @@ -2,7 +2,7 @@ import React, { useCallback } from 'react'; import { Platform } from 'react-native'; import { Appbar, Menu, useTheme } from 'react-native-paper'; -interface Props { +type Props = { children: React.ReactNode, visible: boolean, setVisible: (visible: boolean) => void, diff --git a/src/Component/CustomScrollView.tsx b/src/Component/CustomScrollView.tsx index f140112..7aeda87 100644 --- a/src/Component/CustomScrollView.tsx +++ b/src/Component/CustomScrollView.tsx @@ -1,7 +1,7 @@ import React, { ReactNode } from 'react'; import { ScrollView } from 'react-native-gesture-handler'; -interface Props { +type Props = { children: ReactNode } diff --git a/src/Helper/AmountHelper.ts b/src/Helper/AmountHelper.ts index ff55ec2..05d0217 100644 --- a/src/Helper/AmountHelper.ts +++ b/src/Helper/AmountHelper.ts @@ -1,6 +1,6 @@ import { NumberFormatSettings } from '../redux/features/displaySettings/displaySettingsSlice'; -export interface DividedAmount { +export type DividedAmount = { dividedAmount: number remainingAmount: number, } diff --git a/src/Hooks/useConnectionTest.ts b/src/Hooks/useConnectionTest.ts index 903e266..dfd1e5f 100644 --- a/src/Hooks/useConnectionTest.ts +++ b/src/Hooks/useConnectionTest.ts @@ -2,7 +2,7 @@ import { useCallback, useState } from 'react'; import { API } from 'ynab'; import { LoadingStatus } from '../Helper/LoadingStatus'; -export interface ConnectionStatus { +export type ConnectionStatus = { status: LoadingStatus, error?: { id: string, diff --git a/src/Hooks/useEditableBudgetsInProfiles.ts b/src/Hooks/useEditableBudgetsInProfiles.ts index 48bcbe5..7391b4e 100644 --- a/src/Hooks/useEditableBudgetsInProfiles.ts +++ b/src/Hooks/useEditableBudgetsInProfiles.ts @@ -4,7 +4,7 @@ import { addProfile, BudgetInProfile, Profile, ProfileToCreate, selectProfile, u import { useAppDispatch } from './useAppDispatch'; import { useAppSelector } from './useAppSelector'; -export interface EditableBudgetInProfile { +export type EditableBudgetInProfile = { budgetId?: string, name?: string, debtorAccountId?: string, diff --git a/src/Navigation/AppNavigator.tsx b/src/Navigation/AppNavigator.tsx index db12032..0b94d9b 100644 --- a/src/Navigation/AppNavigator.tsx +++ b/src/Navigation/AppNavigator.tsx @@ -22,7 +22,7 @@ import { DevelopmentSettingsScreen } from '../Screens/Settings/DevelopmentSettin import { Appbar, useTheme } from 'react-native-paper'; import { Keyboard } from 'react-native'; -interface Props { +type Props = { initialRouteName: keyof StackParameterList, } diff --git a/src/Navigation/ScreenParameters.ts b/src/Navigation/ScreenParameters.ts index b5ff3fa..b8725bf 100644 --- a/src/Navigation/ScreenParameters.ts +++ b/src/Navigation/ScreenParameters.ts @@ -3,7 +3,7 @@ import * as ynab from 'ynab'; import { StackNavigationProp, StackScreenProps } from '@react-navigation/stack'; import { CategoryCombo } from '../redux/features/categoryCombos/categoryCombosSlice'; -interface BasicData { +type BasicData = { payer: { budgetId: string, accountId: string, diff --git a/src/Screens/AmountsScreen/AmountView.tsx b/src/Screens/AmountsScreen/AmountView.tsx index 4da99db..435a0e6 100644 --- a/src/Screens/AmountsScreen/AmountView.tsx +++ b/src/Screens/AmountsScreen/AmountView.tsx @@ -10,7 +10,7 @@ import { CategoryInput } from './CategoryInput'; import { MyStackNavigationProp, StackParameterList } from '../../Navigation/ScreenParameters'; import { selectCategoryCombos } from '../../redux/features/categoryCombos/categoryCombosSlice'; -interface Props { +type Props = { key: number, index: number, amountText: string, diff --git a/src/Screens/AmountsScreen/AmountsScreen.tsx b/src/Screens/AmountsScreen/AmountsScreen.tsx index 6c6a5c2..40aed0a 100644 --- a/src/Screens/AmountsScreen/AmountsScreen.tsx +++ b/src/Screens/AmountsScreen/AmountsScreen.tsx @@ -19,7 +19,7 @@ import { useNavigationSettings } from '../../Hooks/useNavigationSettings'; type ScreenName = 'Amounts'; -interface UserInterfaceAmountEntry { +type UserInterfaceAmountEntry = { amountText: string, memo: string, payerCategoryId?: string, diff --git a/src/Screens/AmountsScreen/CategoryInput.tsx b/src/Screens/AmountsScreen/CategoryInput.tsx index 31942c0..9f8ae9b 100644 --- a/src/Screens/AmountsScreen/CategoryInput.tsx +++ b/src/Screens/AmountsScreen/CategoryInput.tsx @@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native'; import { ScreenNames } from '../../Navigation/ScreenNames'; import { MyStackNavigationProp, StackParameterList } from '../../Navigation/ScreenParameters'; -interface Props { +type Props = { label: string, text: string, budgetId: string, diff --git a/src/Screens/AmountsScreen/SplitPercentInput.tsx b/src/Screens/AmountsScreen/SplitPercentInput.tsx index ace4eb9..e14163c 100644 --- a/src/Screens/AmountsScreen/SplitPercentInput.tsx +++ b/src/Screens/AmountsScreen/SplitPercentInput.tsx @@ -1,7 +1,7 @@ import React, { useCallback } from 'react'; import { TextInput } from 'react-native-paper'; -interface Props { +type Props = { payerCategoryChosen: boolean, debtorCategoryChosen: boolean, splitPercentToPayer: number | undefined, diff --git a/src/Screens/AmountsScreen/SubAmountInput.tsx b/src/Screens/AmountsScreen/SubAmountInput.tsx index b443be9..06f6fc7 100644 --- a/src/Screens/AmountsScreen/SubAmountInput.tsx +++ b/src/Screens/AmountsScreen/SubAmountInput.tsx @@ -5,7 +5,7 @@ import { MyStackNavigationProp, StackParameterList } from '../../Navigation/Scre import { ScreenNames } from '../../Navigation/ScreenNames'; import { useAmountConversion } from '../../Hooks/useAmountConversion'; -interface Props { +type Props = { value: string, setValue: (newValue: string) => void, navigation: MyStackNavigationProp, diff --git a/src/Screens/CalculationHistoryScreen/HistoryListItem.tsx b/src/Screens/CalculationHistoryScreen/HistoryListItem.tsx index 61428dd..b0ca860 100644 --- a/src/Screens/CalculationHistoryScreen/HistoryListItem.tsx +++ b/src/Screens/CalculationHistoryScreen/HistoryListItem.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react'; import { List } from 'react-native-paper'; -interface Props { +type Props = { calculation: string, selectCalculation: (calculation: string) => void, navigateBack: () => void, diff --git a/src/Screens/CalculatorScreen/CalculatorKeyboard.tsx b/src/Screens/CalculatorScreen/CalculatorKeyboard.tsx index b6521f2..bff69df 100644 --- a/src/Screens/CalculatorScreen/CalculatorKeyboard.tsx +++ b/src/Screens/CalculatorScreen/CalculatorKeyboard.tsx @@ -5,7 +5,7 @@ import { KeyboardNumberButton } from './KeyboardNumberButton'; import { useAppSelector } from '../../Hooks/useAppSelector'; import { selectNumberFormatSettings } from '../../redux/features/displaySettings/displaySettingsSlice'; -interface Props { +type Props = { onDigitPress: (digit: number) => void onDecimalSeparatorPress: () => void onOperatorAddPress: () => void diff --git a/src/Screens/CalculatorScreen/KeyboardButton.tsx b/src/Screens/CalculatorScreen/KeyboardButton.tsx index a3ec96c..59e2fae 100644 --- a/src/Screens/CalculatorScreen/KeyboardButton.tsx +++ b/src/Screens/CalculatorScreen/KeyboardButton.tsx @@ -2,7 +2,7 @@ import { Text } from 'react-native-paper'; import React from 'react'; import { ColorValue, Pressable, StyleSheet } from 'react-native'; -interface Props { +type Props = { value: string, color: ColorValue, onPress: () => void diff --git a/src/Screens/CalculatorScreen/KeyboardNumberButton.tsx b/src/Screens/CalculatorScreen/KeyboardNumberButton.tsx index 0632e0c..fec763b 100644 --- a/src/Screens/CalculatorScreen/KeyboardNumberButton.tsx +++ b/src/Screens/CalculatorScreen/KeyboardNumberButton.tsx @@ -1,7 +1,7 @@ import React, { useCallback } from 'react'; import { KeyboardButton } from './KeyboardButton'; -interface Props { +type Props = { number: number onPress: (number: number) => void } diff --git a/src/Screens/CategoryScreen/CategoryList.tsx b/src/Screens/CategoryScreen/CategoryList.tsx index 04fa8fc..673b00c 100644 --- a/src/Screens/CategoryScreen/CategoryList.tsx +++ b/src/Screens/CategoryScreen/CategoryList.tsx @@ -5,7 +5,7 @@ import { selectCategoryGroups, selectCategories, selectInternalMasterCategoryGro import { useAppSelector } from '../../Hooks/useAppSelector'; import { CategoryListItem } from './CategoryListItem'; -interface Props { +type Props = { categoryNameFilter: string, budgetId: string, onCategorySelect: (categoryId: string) => void, diff --git a/src/Screens/CategoryScreen/CategoryListItem.tsx b/src/Screens/CategoryScreen/CategoryListItem.tsx index 529c245..dc767fd 100644 --- a/src/Screens/CategoryScreen/CategoryListItem.tsx +++ b/src/Screens/CategoryScreen/CategoryListItem.tsx @@ -3,7 +3,7 @@ import { List } from 'react-native-paper'; import { useAppSelector } from '../../Hooks/useAppSelector'; import { selectCategory } from '../../redux/features/ynab/ynabSlice'; -interface Props { +type Props = { budgetId: string, categoryId: string, onCategorySelect: (categoryId: string) => void, diff --git a/src/Screens/InitialScreen/AccessTokenListItem.tsx b/src/Screens/InitialScreen/AccessTokenListItem.tsx index 5b68a5a..d832803 100644 --- a/src/Screens/InitialScreen/AccessTokenListItem.tsx +++ b/src/Screens/InitialScreen/AccessTokenListItem.tsx @@ -5,7 +5,7 @@ import { useAutomaticConnectionTest } from '../../Hooks/useAutomaticConnectionTe import { ScreenNames } from '../../Navigation/ScreenNames'; import { MyStackNavigationProp, StackParameterList } from '../../Navigation/ScreenParameters'; -interface Props { +type Props = { navigation: MyStackNavigationProp, } diff --git a/src/Screens/InitialScreen/ProfileListItem.tsx b/src/Screens/InitialScreen/ProfileListItem.tsx index 918eecd..c02dd88 100644 --- a/src/Screens/InitialScreen/ProfileListItem.tsx +++ b/src/Screens/InitialScreen/ProfileListItem.tsx @@ -5,7 +5,7 @@ import { ScreenNames } from '../../Navigation/ScreenNames'; import { StackParameterList, MyStackNavigationProp } from '../../Navigation/ScreenParameters'; import { selectProfiles } from '../../redux/features/profiles/profilesSlice'; -interface Props { +type Props = { navigation: MyStackNavigationProp, } diff --git a/src/Screens/SaveScreen/DataTableCellView.tsx b/src/Screens/SaveScreen/DataTableCellView.tsx index db22b7f..c462477 100644 --- a/src/Screens/SaveScreen/DataTableCellView.tsx +++ b/src/Screens/SaveScreen/DataTableCellView.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { View, StyleSheet } from 'react-native'; -interface Props { +type Props = { children: React.ReactNode, alignRight?: boolean, } diff --git a/src/Screens/SaveScreen/MemoDataTableCell.tsx b/src/Screens/SaveScreen/MemoDataTableCell.tsx index 079799a..aa8d700 100644 --- a/src/Screens/SaveScreen/MemoDataTableCell.tsx +++ b/src/Screens/SaveScreen/MemoDataTableCell.tsx @@ -2,7 +2,7 @@ import React, { useCallback } from 'react'; import { DataTable, IconButton } from 'react-native-paper'; import { DataTableCellView } from './DataTableCellView'; -interface Props { +type Props = { memo: string | null | undefined, triggerMemoDisplay: (memo: string) => void, } diff --git a/src/Screens/SaveScreen/MemoModalPortal.tsx b/src/Screens/SaveScreen/MemoModalPortal.tsx index cd5992c..962b186 100644 --- a/src/Screens/SaveScreen/MemoModalPortal.tsx +++ b/src/Screens/SaveScreen/MemoModalPortal.tsx @@ -2,7 +2,7 @@ import React, { useMemo } from 'react'; import { StyleSheet } from 'react-native'; import { Portal, Modal, useTheme, Text } from 'react-native-paper'; -interface Props { +type Props = { visible: boolean, toggleVisible: () => void, memo: string, diff --git a/src/Screens/SaveScreen/MultiLineTextDataTableCellView.tsx b/src/Screens/SaveScreen/MultiLineTextDataTableCellView.tsx index 8778cfc..13d8c0c 100644 --- a/src/Screens/SaveScreen/MultiLineTextDataTableCellView.tsx +++ b/src/Screens/SaveScreen/MultiLineTextDataTableCellView.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { DataTableCellView } from './DataTableCellView'; import { Text } from 'react-native-paper'; -interface Props { +type Props = { text: string | undefined, } diff --git a/src/Screens/SaveScreen/SaveFAB.tsx b/src/Screens/SaveScreen/SaveFAB.tsx index 419c456..71040b1 100644 --- a/src/Screens/SaveScreen/SaveFAB.tsx +++ b/src/Screens/SaveScreen/SaveFAB.tsx @@ -3,7 +3,7 @@ import { FAB } from 'react-native-paper'; import { StyleSheet } from 'react-native'; import { LoadingStatus } from '../../Helper/LoadingStatus'; -interface Props { +type Props = { saveStatus: LoadingStatus, save: () => void, } diff --git a/src/Screens/SaveScreen/SaveTransactionListSection.tsx b/src/Screens/SaveScreen/SaveTransactionListSection.tsx index 46354fd..1ea709b 100644 --- a/src/Screens/SaveScreen/SaveTransactionListSection.tsx +++ b/src/Screens/SaveScreen/SaveTransactionListSection.tsx @@ -9,7 +9,7 @@ import { SubTransactionsDataTable } from './SubTransactionsDataTable'; import { MultiLineTextDataTableCellView } from './MultiLineTextDataTableCellView'; import { useAmountConversion } from '../../Hooks/useAmountConversion'; -interface Props { +type Props = { saveTransaction: SaveTransaction, sectionTitle: string, budgetId: string, diff --git a/src/Screens/SaveScreen/SubTransactionDataTableRow.tsx b/src/Screens/SaveScreen/SubTransactionDataTableRow.tsx index 887bde1..651deeb 100644 --- a/src/Screens/SaveScreen/SubTransactionDataTableRow.tsx +++ b/src/Screens/SaveScreen/SubTransactionDataTableRow.tsx @@ -8,7 +8,7 @@ import { useAppSelector } from '../../Hooks/useAppSelector'; import { MemoDataTableCell } from './MemoDataTableCell'; import { MultiLineTextDataTableCellView } from './MultiLineTextDataTableCellView'; -interface Props { +type Props = { budgetId: string, subTransaction: SaveSubTransaction, displayMemoCell: boolean, diff --git a/src/Screens/SaveScreen/SubTransactionsDataTable.tsx b/src/Screens/SaveScreen/SubTransactionsDataTable.tsx index ed87a88..4bc1f93 100644 --- a/src/Screens/SaveScreen/SubTransactionsDataTable.tsx +++ b/src/Screens/SaveScreen/SubTransactionsDataTable.tsx @@ -5,7 +5,7 @@ import { SaveSubTransaction } from 'ynab'; import { MemoModalPortal } from './MemoModalPortal'; import { SubTransactionDataTableRow } from './SubTransactionDataTableRow'; -interface Props { +type Props = { budgetId: string, subTransactions: SaveSubTransaction[], } diff --git a/src/Screens/SelectCategoryComboScreen/CategoryComboListItem.tsx b/src/Screens/SelectCategoryComboScreen/CategoryComboListItem.tsx index ec1f7e4..06e1ccd 100644 --- a/src/Screens/SelectCategoryComboScreen/CategoryComboListItem.tsx +++ b/src/Screens/SelectCategoryComboScreen/CategoryComboListItem.tsx @@ -3,7 +3,7 @@ import { List } from 'react-native-paper'; import { useAppSelector } from '../../Hooks/useAppSelector'; import { selectCategoryCombo } from '../../redux/features/categoryCombos/categoryCombosSlice'; -interface Props { +type Props = { categoryComboId: string, onSelect: (categoryComboId: string) => void, } diff --git a/src/Screens/Settings/AccessTokenScreen/AccessTokenInput.tsx b/src/Screens/Settings/AccessTokenScreen/AccessTokenInput.tsx index 8469349..64ea317 100644 --- a/src/Screens/Settings/AccessTokenScreen/AccessTokenInput.tsx +++ b/src/Screens/Settings/AccessTokenScreen/AccessTokenInput.tsx @@ -4,7 +4,7 @@ import { HelperText, TextInput } from 'react-native-paper'; import { LoadingStatus } from '../../../Helper/LoadingStatus'; import { ConnectionStatus } from './AccessTokenScreen'; -interface Props { +type Props = { token: string, setToken: (token: string) => void, connectionStatus: ConnectionStatus diff --git a/src/Screens/Settings/AccessTokenScreen/AccessTokenScreen.tsx b/src/Screens/Settings/AccessTokenScreen/AccessTokenScreen.tsx index 2208494..63c7a49 100644 --- a/src/Screens/Settings/AccessTokenScreen/AccessTokenScreen.tsx +++ b/src/Screens/Settings/AccessTokenScreen/AccessTokenScreen.tsx @@ -19,7 +19,7 @@ const ICON_SAVE = 'check'; const ICON_CONNECTION_SUCCESS = 'check'; const ICON_CONNECTION_ERROR = 'alert-circle'; -export interface ConnectionStatus { +export type ConnectionStatus = { status: LoadingStatus, error?: { id: string, diff --git a/src/Screens/Settings/CategoryCombos/CategoryComboInputView.tsx b/src/Screens/Settings/CategoryCombos/CategoryComboInputView.tsx index 994846a..bfeec5a 100644 --- a/src/Screens/Settings/CategoryCombos/CategoryComboInputView.tsx +++ b/src/Screens/Settings/CategoryCombos/CategoryComboInputView.tsx @@ -6,7 +6,7 @@ import { selectProfiles } from '../../../redux/features/profiles/profilesSlice'; import { useAppSelector } from '../../../Hooks/useAppSelector'; import { ChooseCategoryListItem } from './ChooseCategoryListItem'; -interface Props { +type Props = { navigation: MyStackNavigationProp, name: string, setName: (name: string) => void, diff --git a/src/Screens/Settings/CategoryCombos/ChooseCategoryListItem.tsx b/src/Screens/Settings/CategoryCombos/ChooseCategoryListItem.tsx index 82767e2..577cf28 100644 --- a/src/Screens/Settings/CategoryCombos/ChooseCategoryListItem.tsx +++ b/src/Screens/Settings/CategoryCombos/ChooseCategoryListItem.tsx @@ -5,7 +5,7 @@ import { MyStackNavigationProp, StackParameterList } from '../../../Navigation/S import { selectBudgetById, selectCategories } from '../../../redux/features/ynab/ynabSlice'; import { useAppSelector } from '../../../Hooks/useAppSelector'; -interface Props { +type Props = { budgetId: string, budgetDisplayName: string | undefined, navigation: MyStackNavigationProp, diff --git a/src/Screens/Settings/DisplaySettingsScreen/ThemeModalPortal.tsx b/src/Screens/Settings/DisplaySettingsScreen/ThemeModalPortal.tsx index 17877de..570a0fc 100644 --- a/src/Screens/Settings/DisplaySettingsScreen/ThemeModalPortal.tsx +++ b/src/Screens/Settings/DisplaySettingsScreen/ThemeModalPortal.tsx @@ -6,7 +6,7 @@ import { useAppSelector } from '../../../Hooks/useAppSelector'; import { StyleSheet } from 'react-native'; import { useAppDispatch } from '../../../Hooks/useAppDispatch'; -interface Props { +type Props = { visible: boolean, toggleVisible: () => void, } diff --git a/src/Screens/Settings/Profiles/BudgetInProfileInputSection.tsx b/src/Screens/Settings/Profiles/BudgetInProfileInputSection.tsx index 21ded99..bb3dbe5 100644 --- a/src/Screens/Settings/Profiles/BudgetInProfileInputSection.tsx +++ b/src/Screens/Settings/Profiles/BudgetInProfileInputSection.tsx @@ -8,7 +8,7 @@ import { ChooseBudgetListItem } from './ChooseBudgetListItem'; import { EditableBudgetInProfile } from './CreateProfilesScreen/CreateProfileScreen'; import { ProfileBudgetDetailInput } from './ProfileBudgetDetailInput'; -interface Props { +type Props = { editableBudgetInProfile: EditableBudgetInProfile, setEditableBudgetInProfile: Updater, } diff --git a/src/Screens/Settings/Profiles/BudgetSelectModalPortal.tsx b/src/Screens/Settings/Profiles/BudgetSelectModalPortal.tsx index 8ce4ac4..5d53b8c 100644 --- a/src/Screens/Settings/Profiles/BudgetSelectModalPortal.tsx +++ b/src/Screens/Settings/Profiles/BudgetSelectModalPortal.tsx @@ -5,7 +5,7 @@ import { selectBudgets } from '../../../redux/features/ynab/ynabSlice'; import { useAppSelector } from '../../../Hooks/useAppSelector'; import { Budget } from '../../../YnabApi/YnabApiWrapper'; -interface Props { +type Props = { visible: boolean, toggleVisible: () => void, selectedBudgetId?: string, diff --git a/src/Screens/Settings/Profiles/ChooseBudgetListItem.tsx b/src/Screens/Settings/Profiles/ChooseBudgetListItem.tsx index 8c49b91..f493643 100644 --- a/src/Screens/Settings/Profiles/ChooseBudgetListItem.tsx +++ b/src/Screens/Settings/Profiles/ChooseBudgetListItem.tsx @@ -4,7 +4,7 @@ import { selectBudgets } from '../../../redux/features/ynab/ynabSlice'; import { useAppSelector } from '../../../Hooks/useAppSelector'; import { BudgetSelectModalPortal } from './BudgetSelectModalPortal'; -interface Props { +type Props = { selectedBudgetId?: string, selectBudgetId: (budgetId: string) => void, } diff --git a/src/Screens/Settings/Profiles/CreateProfilesScreen/CreateProfileScreen.tsx b/src/Screens/Settings/Profiles/CreateProfilesScreen/CreateProfileScreen.tsx index 3b127b7..ad78438 100644 --- a/src/Screens/Settings/Profiles/CreateProfilesScreen/CreateProfileScreen.tsx +++ b/src/Screens/Settings/Profiles/CreateProfilesScreen/CreateProfileScreen.tsx @@ -12,7 +12,7 @@ type ScreenName = 'CreateProfile'; const SCREEN_TITLE = 'Add Profile'; const ICON_SAVE = 'check'; -export interface EditableBudgetInProfile { +export type EditableBudgetInProfile = { budgetId?: string, name?: string, debtorAccountId?: string, diff --git a/src/Screens/Settings/Profiles/ProfileBudgetDetailInput.tsx b/src/Screens/Settings/Profiles/ProfileBudgetDetailInput.tsx index 9053f6b..5ebebd7 100644 --- a/src/Screens/Settings/Profiles/ProfileBudgetDetailInput.tsx +++ b/src/Screens/Settings/Profiles/ProfileBudgetDetailInput.tsx @@ -4,7 +4,7 @@ import { selectActiveAccounts, selectBudgetById } from '../../../redux/features/ import { useAppSelector } from '../../../Hooks/useAppSelector'; import { Account } from '../../../YnabApi/YnabApiWrapper'; -interface Props { +type Props = { budgetId: string, displayName?: string, setDisplayName: (name: string) => void, diff --git a/src/Screens/SplittingScreen/AccountRadioSelection.tsx b/src/Screens/SplittingScreen/AccountRadioSelection.tsx index c4ef110..340c4b9 100644 --- a/src/Screens/SplittingScreen/AccountRadioSelection.tsx +++ b/src/Screens/SplittingScreen/AccountRadioSelection.tsx @@ -3,7 +3,7 @@ import React, { useCallback, useEffect } from 'react'; import { Account } from '../../YnabApi/YnabApiWrapper'; import { Keyboard } from 'react-native'; -interface Props { +type Props = { accounts: Account[], selectedAccountId: string, setSelectedAccountId: (id: string) => void, diff --git a/src/Screens/SplittingScreen/PayerBudgetRadioSelection.tsx b/src/Screens/SplittingScreen/PayerBudgetRadioSelection.tsx index 01f9b96..32a7b1c 100644 --- a/src/Screens/SplittingScreen/PayerBudgetRadioSelection.tsx +++ b/src/Screens/SplittingScreen/PayerBudgetRadioSelection.tsx @@ -5,7 +5,7 @@ import { Keyboard } from 'react-native'; import { useAppSelector } from '../../Hooks/useAppSelector'; import { selectBudgets } from '../../redux/features/ynab/ynabSlice'; -interface Props { +type Props = { profile: Profile, payerBudgetIndex: number, setPayerBudgetIndex: (index: number) => void, diff --git a/src/Screens/SplittingScreen/TotalAmountInput.tsx b/src/Screens/SplittingScreen/TotalAmountInput.tsx index 7d011ce..7f2666d 100644 --- a/src/Screens/SplittingScreen/TotalAmountInput.tsx +++ b/src/Screens/SplittingScreen/TotalAmountInput.tsx @@ -3,7 +3,7 @@ import { StyleSheet } from 'react-native'; import { TextInput } from 'react-native-paper'; import { useAmountConversion } from '../../Hooks/useAmountConversion'; -interface Props { +type Props = { value: string, setValue: (newValue: string) => void, } diff --git a/src/YnabApi/BuildSaveTransactions.ts b/src/YnabApi/BuildSaveTransactions.ts index da12034..3d98f25 100644 --- a/src/YnabApi/BuildSaveTransactions.ts +++ b/src/YnabApi/BuildSaveTransactions.ts @@ -2,12 +2,12 @@ import { convertHumanAmountToApiAmount, divideApiAmount } from '../Helper/Amount import { BasicData } from '../Navigation/ScreenParameters'; import * as ynab from 'ynab'; -interface SaveTransactions { +type SaveTransactions = { payer: ynab.SaveTransaction, debtor: ynab.SaveTransaction } -interface AmountEntry { +type AmountEntry = { amount: number, memo: string, payerCategoryId?: string, diff --git a/src/YnabApi/YnabApiWrapper.ts b/src/YnabApi/YnabApiWrapper.ts index 75e685b..ae0605f 100644 --- a/src/YnabApi/YnabApiWrapper.ts +++ b/src/YnabApi/YnabApiWrapper.ts @@ -1,7 +1,7 @@ import { API, SaveTransaction, TransactionDetail, SaveTransactionWrapper, CategoryGroupWithCategories } from 'ynab'; import { Category } from '../redux/features/ynab/ynabSlice'; -export interface Account { +export type Account = { id: string; name: string; onBudget: boolean; @@ -10,7 +10,7 @@ export interface Account { deleted: boolean; } -export interface Budget { +export type Budget = { id: string; name: string; accounts: Array; diff --git a/src/redux/features/accessToken/accessTokenSlice.ts b/src/redux/features/accessToken/accessTokenSlice.ts index 98c6dd1..d3def4d 100644 --- a/src/redux/features/accessToken/accessTokenSlice.ts +++ b/src/redux/features/accessToken/accessTokenSlice.ts @@ -3,7 +3,7 @@ import { LoadingStatus } from '../../../Helper/LoadingStatus'; import { getItemAsync, setItemAsync, WHEN_UNLOCKED } from 'expo-secure-store'; import { RootState } from '../../store'; -interface AccessTokenState { +type AccessTokenState = { fetchStatus: { status: LoadingStatus error: SerializedError | null diff --git a/src/redux/features/categoryCombos/categoryCombosSlice.ts b/src/redux/features/categoryCombos/categoryCombosSlice.ts index 3d75ad2..90ce639 100644 --- a/src/redux/features/categoryCombos/categoryCombosSlice.ts +++ b/src/redux/features/categoryCombos/categoryCombosSlice.ts @@ -4,22 +4,19 @@ import * as SecureStore from 'expo-secure-store'; import { isOneOf } from '../../isOneOf'; import { LoadingStatus } from '../../../Helper/LoadingStatus'; -interface CategoryInCategoryCombo { +type CategoryInCategoryCombo = { id: string, budgetId: string } -export interface CategoryCombo { +export type CategoryCombo = { id: string, name: string, categories: [CategoryInCategoryCombo, CategoryInCategoryCombo] } -export interface CategoryComboToCreate { - name: string, - categories: [CategoryInCategoryCombo, CategoryInCategoryCombo] -} +export type CategoryComboToCreate = Omit; -interface CategoryCombosState { +type CategoryCombosState = { fetchStatus: { status: LoadingStatus error: SerializedError | null diff --git a/src/redux/features/displaySettings/displaySettingsSlice.ts b/src/redux/features/displaySettings/displaySettingsSlice.ts index 9e747e1..47b8f72 100644 --- a/src/redux/features/displaySettings/displaySettingsSlice.ts +++ b/src/redux/features/displaySettings/displaySettingsSlice.ts @@ -5,22 +5,22 @@ import { getLocales } from 'expo-localization'; import { RootState } from '../../store'; import { ThemeType } from './ThemeType'; -export interface NumberFormatSettings { +export type NumberFormatSettings = { decimalSeparator: string, digitGroupingSeparator: string, } -interface DisplaySettings { +type DisplaySettings = { numberFormat: NumberFormatSettings, themeType: ThemeType, } -interface SavedDisplaySettings { +type SavedDisplaySettings = { numberFormat?: NumberFormatSettings, themeType?: ThemeType, } -interface DisplaySettingsState { +type DisplaySettingsState = { fetchStatus: { status: LoadingStatus error: SerializedError | null diff --git a/src/redux/features/profiles/profilesSlice.ts b/src/redux/features/profiles/profilesSlice.ts index 1f891f3..f94a022 100644 --- a/src/redux/features/profiles/profilesSlice.ts +++ b/src/redux/features/profiles/profilesSlice.ts @@ -4,7 +4,7 @@ import { LoadingStatus } from '../../../Helper/LoadingStatus'; import { isOneOf } from '../../isOneOf'; import { RootState } from '../../store'; -export interface BudgetInProfile { +export type BudgetInProfile = { budgetId: string, name?: string, debtorAccountId: string, @@ -12,16 +12,14 @@ export interface BudgetInProfile { } -export interface Profile { +export type Profile = { id: string, budgets: [BudgetInProfile, BudgetInProfile] } -export interface ProfileToCreate { - budgets: [BudgetInProfile, BudgetInProfile] -} +export type ProfileToCreate = Omit; -interface ProfilesState { +type ProfilesState = { fetchStatus: { status: LoadingStatus error: SerializedError | null diff --git a/src/redux/features/ynab/ynabSlice.ts b/src/redux/features/ynab/ynabSlice.ts index 62e1a6c..8deef7e 100644 --- a/src/redux/features/ynab/ynabSlice.ts +++ b/src/redux/features/ynab/ynabSlice.ts @@ -4,7 +4,7 @@ import { Account, Budget, getBudgetsWithAccountsFromApi } from '../../../YnabApi import { RootState } from '../../store'; import * as ynab from 'ynab'; -export interface CategoryGroup { +export type CategoryGroup = { id: string, name: string, hidden: boolean, @@ -12,14 +12,14 @@ export interface CategoryGroup { categories: string[], } -export interface Category { +export type Category = { id: string; name: string; hidden: boolean; deleted: boolean; } -interface YnabState { +type YnabState = { fetchBudgetsStatus: { status: LoadingStatus error: SerializedError | null diff --git a/src/redux/isOneOf.ts b/src/redux/isOneOf.ts index 52ba268..a994f78 100644 --- a/src/redux/isOneOf.ts +++ b/src/redux/isOneOf.ts @@ -2,7 +2,7 @@ import { Action, AnyAction } from '@reduxjs/toolkit'; -declare interface TypedActionCreator { +type TypedActionCreator = { (...args: any[]): Action; type: Type; }