diff --git a/src/api/error.ts b/src/api/error.ts index b2e9a2c5f..5c9570522 100644 --- a/src/api/error.ts +++ b/src/api/error.ts @@ -65,12 +65,12 @@ export interface ErrorWithResponse { url: string; json: () => Promise<{ status: string; - errors: Array<{ + errors: { errorCode: string; message: string; from: string | null; stack: string | null; - }>; + }[]; }>; }; status?: number; diff --git a/src/api/observations.js b/src/api/observations.js index 943ad13f4..7e19f8ca0 100644 --- a/src/api/observations.js +++ b/src/api/observations.js @@ -66,10 +66,10 @@ const fetchRemoteObservation = async ( }; const fetchRemoteObservations = async ( - uuids: Array, + uuids: string[], params: Object = {}, opts: Object = {}, -): Promise> => { +): Promise => { try { const response = await inatjs.observations.fetch( uuids, diff --git a/src/api/places.js b/src/api/places.js index 7e1b00b0b..4a0036fb7 100644 --- a/src/api/places.js +++ b/src/api/places.js @@ -5,7 +5,7 @@ import inatjs from "inaturalistjs"; import handleError from "./error"; const fetchPlace = async ( - id: number | Array, + id: number | number[], params: Object = {}, opts: Object = {}, ): Promise => { diff --git a/src/api/taxa.js b/src/api/taxa.js index 0c6657a66..c6c20b8ce 100644 --- a/src/api/taxa.js +++ b/src/api/taxa.js @@ -47,7 +47,7 @@ function mapToLocalSchema( taxon ) { } async function fetchTaxon( - id: number | Array, + id: number | number[], params: Object = {}, opts: Object = {}, ): Promise { diff --git a/src/api/users.js b/src/api/users.js index 9897e42e3..f3cd47d99 100644 --- a/src/api/users.js +++ b/src/api/users.js @@ -71,7 +71,7 @@ const fetchRemoteUser = async ( }; const fetchUsers = async ( - ids: Array, + ids: number[], params: Object = {}, opts: Object = {}, ): Promise => { diff --git a/src/components/App.js b/src/components/App.js index 01735168b..0cd21c95c 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -21,7 +21,7 @@ const logger = log.extend( "App" ); type SharedItem = { mimeType: string, - data: string | Array + data: string | string[] }; const handleShare = ( navigation, item: ?SharedItem ) => { diff --git a/src/components/Camera/CameraWithDevice.tsx b/src/components/Camera/CameraWithDevice.tsx index 98d243bd2..927c404d7 100644 --- a/src/components/Camera/CameraWithDevice.tsx +++ b/src/components/Camera/CameraWithDevice.tsx @@ -21,7 +21,7 @@ interface Props { takingPhoto: boolean; // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type takePhotoAndStoreUri: Function; - newPhotoUris: Array; + newPhotoUris: object[]; // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type setNewPhotoUris: Function; takePhotoOptions: object; diff --git a/src/components/Camera/StandardCamera/StandardCamera.js b/src/components/Camera/StandardCamera/StandardCamera.js index 51a39899f..b3ba47bfb 100644 --- a/src/components/Camera/StandardCamera/StandardCamera.js +++ b/src/components/Camera/StandardCamera/StandardCamera.js @@ -53,7 +53,7 @@ type Props = { takingPhoto: boolean, takePhotoAndStoreUri: Function, takePhotoOptions: Object, - newPhotoUris: Array, + newPhotoUris: Object[], setNewPhotoUris: Function }; diff --git a/src/components/Explore/ExploreFlashList.js b/src/components/Explore/ExploreFlashList.js index 5b9de159f..d3fc6cc2c 100644 --- a/src/components/Explore/ExploreFlashList.js +++ b/src/components/Explore/ExploreFlashList.js @@ -11,7 +11,7 @@ import { useTranslation } from "sharedHooks"; type Props = { canFetch?: boolean, contentContainerStyle?: Object, - data: Array, + data: Object[], fetchNextPage: boolean, hideLoadingWheel: boolean, isFetchingNextPage: boolean, diff --git a/src/components/FullPageWebView/FullPageWebView.tsx b/src/components/FullPageWebView/FullPageWebView.tsx index d84f174b9..0dd695f7e 100644 --- a/src/components/FullPageWebView/FullPageWebView.tsx +++ b/src/components/FullPageWebView/FullPageWebView.tsx @@ -57,7 +57,7 @@ type FullPageWebViewParams = { title?: string; loggedIn?: boolean; skipSetSourceInShouldStartLoadWithRequest?: boolean; - clickablePathnames?: Array; + clickablePathnames?: string[]; shouldLoadUrl?: ( url: string ) => boolean; } diff --git a/src/components/MediaViewer/MainMediaDisplay.js b/src/components/MediaViewer/MainMediaDisplay.js index 00ca5c3ef..913c468e5 100644 --- a/src/components/MediaViewer/MainMediaDisplay.js +++ b/src/components/MediaViewer/MainMediaDisplay.js @@ -31,16 +31,16 @@ type Props = { onDeletePhoto?: Function, onClose?: Function, onDeleteSound?: Function, - photos: Array<{ + photos: { id?: number, url: string, localFilePath?: string, attribution?: string, licenseCode?: string - }>, - sounds?: Array<{ + }[], + sounds?: { file_url: string - }>, + }[], selectedMediaIndex: number, setSelectedMediaIndex: Function } diff --git a/src/components/MediaViewer/MediaSelector.js b/src/components/MediaViewer/MediaSelector.js index 7ac3cc458..9295ffddf 100644 --- a/src/components/MediaViewer/MediaSelector.js +++ b/src/components/MediaViewer/MediaSelector.js @@ -13,18 +13,18 @@ import useTranslation from "sharedHooks/useTranslation"; type Props = { isLargeScreen?: boolean, - photos: Array<{ + photos: { id?: number, url: string, localFilePath?: string, attribution?: string, licenseCode?: string - }>, + }[], scrollToIndex: Function, selectedMediaIndex?: number, - sounds?: Array<{ + sounds?: { file_url: string - }>, + }[], } const SMALL_ITEM_CLASS = "rounded-sm w-[42px] h-[42px] mx-[6px] my-[12px]"; diff --git a/src/components/MediaViewer/MediaViewer.js b/src/components/MediaViewer/MediaViewer.js index 6bb26e581..89a5cd03d 100644 --- a/src/components/MediaViewer/MediaViewer.js +++ b/src/components/MediaViewer/MediaViewer.js @@ -30,16 +30,16 @@ type Props = { onClose?: Function, onDeletePhoto?: Function, onDeleteSound?: Function, - photos?: Array<{ + photos?: { id?: number, url: string, localFilePath?: string, attribution?: string, licenseCode?: string - }>, - sounds?: Array<{ + }[], + sounds?: { file_url: string - }>, + }[], uri?: string | null } diff --git a/src/components/MediaViewer/MediaViewerModal.js b/src/components/MediaViewer/MediaViewerModal.js index 1d68b2f73..215a27634 100644 --- a/src/components/MediaViewer/MediaViewerModal.js +++ b/src/components/MediaViewer/MediaViewerModal.js @@ -14,16 +14,16 @@ type Props = { onClose?: Function, onDeletePhoto?: Function, onDeleteSound?: Function, - photos?: Array<{ + photos?: { id?: number, url: string, localFilePath?: string, attribution?: string, licenseCode?: string - }>, - sounds?: Array<{ + }[], + sounds?: { file_url: string - }>, + }[], showModal: boolean, uri?: string | null } diff --git a/src/components/MyObservations/MyObservationsContainer.tsx b/src/components/MyObservations/MyObservationsContainer.tsx index 4af34e7fe..c837252df 100644 --- a/src/components/MyObservations/MyObservationsContainer.tsx +++ b/src/components/MyObservations/MyObservationsContainer.tsx @@ -253,7 +253,7 @@ const MyObservationsContainer = ( ): React.FC => { const [activeTab, setActiveTab] = useState( OBSERVATIONS_TAB ); let numTotalTaxaLocal: number | undefined; - const localObservedSpeciesCount: Array = []; + const localObservedSpeciesCount: SpeciesCount[] = []; if ( !currentUser ) { // Calculate obs and leaf taxa counts from local observations const distinctTaxonObs = realm.objects( "Observation" ) diff --git a/src/components/ObsDetails/ActivityTab/ActivityTab.js b/src/components/ObsDetails/ActivityTab/ActivityTab.js index 27ec3f993..34863e272 100644 --- a/src/components/ObsDetails/ActivityTab/ActivityTab.js +++ b/src/components/ObsDetails/ActivityTab/ActivityTab.js @@ -11,7 +11,7 @@ import ActivityItem from "./ActivityItem"; type Props = { observation:Object, refetchRemoteObservation: Function, - activityItems: Array, + activityItems: Object[], openAgreeWithIdSheet: Function, isConnected: boolean, targetItemID: number, diff --git a/src/components/ObsDetails/DetailsTab/ProjectSection.tsx b/src/components/ObsDetails/DetailsTab/ProjectSection.tsx index a39807311..1623490f2 100644 --- a/src/components/ObsDetails/DetailsTab/ProjectSection.tsx +++ b/src/components/ObsDetails/DetailsTab/ProjectSection.tsx @@ -14,12 +14,12 @@ const sectionClass = "mx-[15px] mb-[20px]"; // TODO: can we get a centralized type/interface for our realm objects, here observation and project interface Props { observation: { - project_observations: Array<{ + project_observations: { project: object; - }>; - non_traditional_projects: Array<{ + }[]; + non_traditional_projects: { project: object; - }>; + }[]; }; } diff --git a/src/components/ObsDetails/ObsDetails.js b/src/components/ObsDetails/ObsDetails.js index 536ffa4d3..05ad9928a 100644 --- a/src/components/ObsDetails/ObsDetails.js +++ b/src/components/ObsDetails/ObsDetails.js @@ -31,7 +31,7 @@ import SuggestIDSheet from "./Sheets/SuggestIDSheet"; const isTablet = DeviceInfo.isTablet(); type Props = { - activityItems: Array, + activityItems: Object[], addingActivityItem: Function, closeAgreeWithIdSheet: Function, belongsToCurrentUser: boolean, @@ -63,7 +63,7 @@ type Props = { showSuggestIdSheet: boolean, subscriptions?: Object, suggestIdSheetDiscardChanges: Function, - tabs: Array, + tabs: Object[], identBodySheetShown?: boolean, onCloseIdentBodySheet?: Function, newIdentification?: null | { diff --git a/src/components/ObsDetails/ObsMedia.js b/src/components/ObsDetails/ObsMedia.js index 0d7b37ec8..e618f43d3 100644 --- a/src/components/ObsDetails/ObsMedia.js +++ b/src/components/ObsDetails/ObsMedia.js @@ -12,16 +12,16 @@ import SoundContainer from "./SoundContainer"; type Props = { loading: boolean, - photos: Array<{ + photos: { id?: number, url: string, localFilePath?: string, attribution?: string, licenseCode?: string - }>, - sounds?: Array<{ + }[], + sounds?: { file_url: string - }>, + }[], tablet: boolean } diff --git a/src/components/ObsDetails/ObsMediaDisplay.js b/src/components/ObsDetails/ObsMediaDisplay.js index 9219ac344..ccddc7047 100644 --- a/src/components/ObsDetails/ObsMediaDisplay.js +++ b/src/components/ObsDetails/ObsMediaDisplay.js @@ -16,8 +16,8 @@ import ObsMedia from "./ObsMedia"; type Props = { loading: boolean, - photos: Array, - sounds: Array, + photos: Object[], + sounds: Object[], tablet: boolean } diff --git a/src/components/ObsDetailsDefaultMode/CommunitySection/CommunitySection.js b/src/components/ObsDetailsDefaultMode/CommunitySection/CommunitySection.js index 8ecbe27c0..7a0003856 100644 --- a/src/components/ObsDetailsDefaultMode/CommunitySection/CommunitySection.js +++ b/src/components/ObsDetailsDefaultMode/CommunitySection/CommunitySection.js @@ -11,7 +11,7 @@ import ActivityItem from "./ActivityItem"; type Props = { observation:Object, refetchRemoteObservation: Function, - activityItems: Array, + activityItems: Object[], openAgreeWithIdSheet: Function, isConnected: boolean, targetItemID: ?number, diff --git a/src/components/ObsDetailsDefaultMode/MoreSection/ProjectButton.tsx b/src/components/ObsDetailsDefaultMode/MoreSection/ProjectButton.tsx index e29d434c7..0455a12b7 100644 --- a/src/components/ObsDetailsDefaultMode/MoreSection/ProjectButton.tsx +++ b/src/components/ObsDetailsDefaultMode/MoreSection/ProjectButton.tsx @@ -6,12 +6,12 @@ import React, { useMemo } from "react"; // TODO: can we get a centralized type/interface for our realm objects, here observation and project interface Props { observation: { - project_observations: Array<{ + project_observations: { project: object; - }>; - non_traditional_projects: Array<{ + }[]; + non_traditional_projects: { project: object; - }>; + }[]; }; } diff --git a/src/components/ObsDetailsDefaultMode/ObsDetailsDefaultMode.tsx b/src/components/ObsDetailsDefaultMode/ObsDetailsDefaultMode.tsx index a28a60820..3f40fa0eb 100644 --- a/src/components/ObsDetailsDefaultMode/ObsDetailsDefaultMode.tsx +++ b/src/components/ObsDetailsDefaultMode/ObsDetailsDefaultMode.tsx @@ -27,7 +27,7 @@ import StatusSection from "./StatusSection/StatusSection"; const cardClassBottom = "rounded-b-2xl border-lightGray border-[2px] pb-3 border-t-0 -mt-0.5 mb-4"; type Props = { - activityItems: Array; + activityItems: object[]; addingActivityItem: boolean; belongsToCurrentUser: boolean; currentUser: RealmUser; diff --git a/src/components/ObsDetailsDefaultMode/ObsMedia.js b/src/components/ObsDetailsDefaultMode/ObsMedia.js index 8310e00f7..39f8c933f 100644 --- a/src/components/ObsDetailsDefaultMode/ObsMedia.js +++ b/src/components/ObsDetailsDefaultMode/ObsMedia.js @@ -11,16 +11,16 @@ import SoundContainer from "./SoundContainer"; type Props = { loading: boolean, - photos: Array<{ + photos: { id?: number, url: string, localFilePath?: string, attribution?: string, licenseCode?: string - }>, - sounds?: Array<{ + }[], + sounds?: { file_url: string - }> + }[] } const ObsMedia = ( { diff --git a/src/components/ObsDetailsDefaultMode/ObsMediaDisplay.js b/src/components/ObsDetailsDefaultMode/ObsMediaDisplay.js index f95c3c5d4..c040be3f5 100644 --- a/src/components/ObsDetailsDefaultMode/ObsMediaDisplay.js +++ b/src/components/ObsDetailsDefaultMode/ObsMediaDisplay.js @@ -16,8 +16,8 @@ import ObsMedia from "./ObsMedia"; type Props = { loading: boolean, - photos: Array, - sounds: Array + photos: Object[], + sounds: Object[] } const ObsMediaDisplay = ( { diff --git a/src/components/ObsEdit/BottomButtonsContainer.tsx b/src/components/ObsEdit/BottomButtonsContainer.tsx index 3fca57bfb..cbd73205d 100644 --- a/src/components/ObsEdit/BottomButtonsContainer.tsx +++ b/src/components/ObsEdit/BottomButtonsContainer.tsx @@ -22,7 +22,7 @@ const { useRealm } = RealmContext; type Props = { passesEvidenceTest: boolean; - observations: Array; + observations: object[]; currentObservation: RealmObservation; currentObservationIndex: number; // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type diff --git a/src/components/ObsEdit/EvidenceList.js b/src/components/ObsEdit/EvidenceList.js index ccb66f843..589d4dca4 100644 --- a/src/components/ObsEdit/EvidenceList.js +++ b/src/components/ObsEdit/EvidenceList.js @@ -27,13 +27,13 @@ const logger = log.extend( "EvidenceList" ); type Props = { handleAddEvidence?: Function, - observationSounds?: Array<{ + observationSounds?: { id?: number, sound: { file_url: string, }, uuid: string - }> + }[] } const EvidenceList = ( { diff --git a/src/components/ObsEdit/EvidenceSection.js b/src/components/ObsEdit/EvidenceSection.js index 2bb0785c8..a12a5a0b5 100644 --- a/src/components/ObsEdit/EvidenceSection.js +++ b/src/components/ObsEdit/EvidenceSection.js @@ -20,18 +20,18 @@ import AddEvidenceSheet from "./Sheets/AddEvidenceSheet"; type Props = { currentObservation: Object, isFetchingLocation: boolean, - locationTextClassNames: Array, + locationTextClassNames: string[], passesEvidenceTest: Function, - observationPhotos: Array, + observationPhotos: Object[], setShowAddEvidenceSheet: Function, showAddEvidenceSheet: boolean, - observationSounds?: Array<{ + observationSounds?: { id?: number, sound: { file_url: string, }, uuid: string - }>, + }[], onLocationPress: ( ) => void, updateObservationKeys: Function } diff --git a/src/components/ObsEdit/MultipleObservationsArrows.js b/src/components/ObsEdit/MultipleObservationsArrows.js index c621b591f..63d103ca5 100644 --- a/src/components/ObsEdit/MultipleObservationsArrows.js +++ b/src/components/ObsEdit/MultipleObservationsArrows.js @@ -10,7 +10,7 @@ import { useTranslation } from "sharedHooks"; type Props = { currentObservationIndex: number, setCurrentObservationIndex: Function, - observations: Array, + observations: Object[], setResetScreen: Function, transitionAnimation: Function, transitionAnimationRef: Object diff --git a/src/components/ObsEdit/ObsEditHeader.js b/src/components/ObsEdit/ObsEditHeader.js index 1c28a1d28..a642e8b7c 100644 --- a/src/components/ObsEdit/ObsEditHeader.js +++ b/src/components/ObsEdit/ObsEditHeader.js @@ -21,7 +21,7 @@ import DiscardObservationSheet from "./Sheets/DiscardObservationSheet"; const { useRealm } = RealmContext; type Props = { - observations: Array, + observations: Object[], currentObservation: Object } diff --git a/src/components/ObsEdit/Sheets/DeleteObservationSheet.js b/src/components/ObsEdit/Sheets/DeleteObservationSheet.js index 645e8eb37..68ede6cc0 100644 --- a/src/components/ObsEdit/Sheets/DeleteObservationSheet.js +++ b/src/components/ObsEdit/Sheets/DeleteObservationSheet.js @@ -15,7 +15,7 @@ const { useRealm } = RealmContext; type Props = { currentObservation: Object, onPressClose: Function, - observations: Array, + observations: Object[], onDelete?: Function, updateObservations: Function } diff --git a/src/components/ObsEdit/Sheets/DiscardObservationSheet.js b/src/components/ObsEdit/Sheets/DiscardObservationSheet.js index 5240ddb41..6b7a4c4a0 100644 --- a/src/components/ObsEdit/Sheets/DiscardObservationSheet.js +++ b/src/components/ObsEdit/Sheets/DiscardObservationSheet.js @@ -15,7 +15,7 @@ const { useRealm } = RealmContext; type Props = { onPressClose: Function, discardObservation: Function, - observations: Array, + observations: Object[], onSave?: Function } diff --git a/src/components/ObservationsFlashList/ObservationsFlashList.js b/src/components/ObservationsFlashList/ObservationsFlashList.js index 179a278e5..d1b7803d9 100644 --- a/src/components/ObservationsFlashList/ObservationsFlashList.js +++ b/src/components/ObservationsFlashList/ObservationsFlashList.js @@ -35,7 +35,7 @@ const AnimatedFlashList = Animated.createAnimatedComponent( CustomFlashList ); type Props = { contentContainerStyle?: Object, - data: Array, + data: Object[], dataCanBeFetched?: boolean, fetchFromLastObservation?: Function, explore: boolean, diff --git a/src/components/PhotoImporter/GroupPhotoImage.js b/src/components/PhotoImporter/GroupPhotoImage.js index 5f049d1c9..908a6a833 100644 --- a/src/components/PhotoImporter/GroupPhotoImage.js +++ b/src/components/PhotoImporter/GroupPhotoImage.js @@ -7,7 +7,7 @@ import React from "react"; type Props = { item: Object, - selectedObservations: Array, + selectedObservations: Object[], selectObservationPhotos: Function, style?: Object } diff --git a/src/components/PhotoImporter/GroupPhotos.js b/src/components/PhotoImporter/GroupPhotos.js index 810daaf85..88e287322 100644 --- a/src/components/PhotoImporter/GroupPhotos.js +++ b/src/components/PhotoImporter/GroupPhotos.js @@ -23,11 +23,11 @@ import GroupPhotoImage from "./GroupPhotoImage"; type Props = { combinePhotos: Function, - groupedPhotos: Array, + groupedPhotos: Object[], isCreatingObservations?: boolean, navBasedOnUserSettings: Function, removePhotos: Function, - selectedObservations: Array, + selectedObservations: Object[], selectObservationPhotos: Function, separatePhotos: Function, totalPhotos: number diff --git a/src/components/PhotoImporter/helpers/groupPhotoHelpers.js b/src/components/PhotoImporter/helpers/groupPhotoHelpers.js index 9ebcdba5a..c4a9eb09f 100644 --- a/src/components/PhotoImporter/helpers/groupPhotoHelpers.js +++ b/src/components/PhotoImporter/helpers/groupPhotoHelpers.js @@ -2,7 +2,7 @@ const sortByTime = array => array.sort( ( a, b ) => b.timestamp - a.timestamp ); -const flattenAndOrderSelectedPhotos = ( selectedObservations: ?Array ): Array => { +const flattenAndOrderSelectedPhotos = ( selectedObservations: ?Object[] ): Object[] => { // combine selected observations into a single array let combinedPhotos = []; selectedObservations?.forEach( obs => { diff --git a/src/components/ProjectList/ProjectList.tsx b/src/components/ProjectList/ProjectList.tsx index 05854eada..4ad7b1409 100644 --- a/src/components/ProjectList/ProjectList.tsx +++ b/src/components/ProjectList/ProjectList.tsx @@ -12,7 +12,7 @@ import { import ProjectListItem from "./ProjectListItem"; interface Props { - projects: Array; + projects: object[]; ListEmptyComponent?: React.JSX.Element; ListFooterComponent?: React.JSX.Element; onEndReached?: ( ) => void; diff --git a/src/components/Settings/LanguageSetting.tsx b/src/components/Settings/LanguageSetting.tsx index 18f6c330d..7353844b8 100644 --- a/src/components/Settings/LanguageSetting.tsx +++ b/src/components/Settings/LanguageSetting.tsx @@ -12,10 +12,10 @@ import changeLanguage from "sharedHelpers/changeLanguage"; import { useTranslation } from "sharedHooks"; import { zustandStorage } from "stores/useStore"; -type LocalesResponse = Array<{ +type LocalesResponse = { locale: string; language_in_locale: string; -}>; +}[]; type Props = { onChange: ( newLocale: string ) => void; diff --git a/src/components/SharedComponents/ButtonBar.tsx b/src/components/SharedComponents/ButtonBar.tsx index 8389e0453..bb13d432c 100644 --- a/src/components/SharedComponents/ButtonBar.tsx +++ b/src/components/SharedComponents/ButtonBar.tsx @@ -23,7 +23,7 @@ interface Props extends PropsWithChildren { containerClass?: string; onLayout?: () => void; sticky?: boolean; - buttonConfiguration?: Array; + buttonConfiguration?: ButtonConfiguration[]; } // Ensure this component is placed outside of scroll views diff --git a/src/components/SharedComponents/Sheets/BottomSheet.tsx b/src/components/SharedComponents/Sheets/BottomSheet.tsx index 0185bd2e0..83d71ace7 100644 --- a/src/components/SharedComponents/Sheets/BottomSheet.tsx +++ b/src/components/SharedComponents/Sheets/BottomSheet.tsx @@ -36,7 +36,7 @@ interface Props { // Callback when the user presses the close button or backdrop, not whenever the sheet // closes onPressClose?: ( ) => void; - snapPoints?: Array; + snapPoints?: string[]; insideModal?: boolean; keyboardShouldPersistTaps?: string; testID?: string; diff --git a/src/components/SharedComponents/UploadStatus/UploadCompleteIcon.tsx b/src/components/SharedComponents/UploadStatus/UploadCompleteIcon.tsx index b2e84b7e4..1a513c74b 100644 --- a/src/components/SharedComponents/UploadStatus/UploadCompleteIcon.tsx +++ b/src/components/SharedComponents/UploadStatus/UploadCompleteIcon.tsx @@ -4,7 +4,7 @@ import { View } from "components/styledComponents"; import React from "react"; type Props = { - iconClasses: Array; + iconClasses: string[]; completeColor: string; } diff --git a/src/components/SharedComponents/UploadStatus/UploadProgressIcon.tsx b/src/components/SharedComponents/UploadStatus/UploadProgressIcon.tsx index b4e628a52..12309f1a7 100644 --- a/src/components/SharedComponents/UploadStatus/UploadProgressIcon.tsx +++ b/src/components/SharedComponents/UploadStatus/UploadProgressIcon.tsx @@ -8,7 +8,7 @@ import { useTranslation } from "sharedHooks"; type Props = { color: string; progress: number; - iconClasses: Array; + iconClasses: string[]; uniqueKey?: string; } diff --git a/src/components/Suggestions/Suggestions.js b/src/components/Suggestions/Suggestions.js index 29ea983e5..5802bdefd 100644 --- a/src/components/Suggestions/Suggestions.js +++ b/src/components/Suggestions/Suggestions.js @@ -27,7 +27,7 @@ type Props = { shouldUseEvidenceLocation: boolean, onPressPhoto: Function, onTaxonChosen: Function, - photoUris: Array, + photoUris: string[], reloadSuggestions: Function, selectedPhotoUri: string, showImproveWithLocationButton: boolean, diff --git a/src/components/Suggestions/SuggestionsFooter.tsx b/src/components/Suggestions/SuggestionsFooter.tsx index 1fc5b4151..8b47d328c 100644 --- a/src/components/Suggestions/SuggestionsFooter.tsx +++ b/src/components/Suggestions/SuggestionsFooter.tsx @@ -40,7 +40,7 @@ type Props = { // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type hideLocationToggleButton: Function; hideSkip?: boolean; - observers: Array; + observers: string[]; shouldUseEvidenceLocation: boolean; // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type toggleLocation: Function; diff --git a/src/components/Suggestions/hooks/useObservers.js b/src/components/Suggestions/hooks/useObservers.js index 5c1bebff2..b3db5d980 100644 --- a/src/components/Suggestions/hooks/useObservers.js +++ b/src/components/Suggestions/hooks/useObservers.js @@ -13,7 +13,7 @@ const params = { }, }; -const useObservers = ( taxonIds: Array ): Array => { +const useObservers = ( taxonIds: number[] ): string[] => { const { data } = useAuthenticatedQuery( ["fetchObservers", taxonIds], ( ) => fetchObservers( { diff --git a/src/components/TaxonDetails/TaxonMedia.js b/src/components/TaxonDetails/TaxonMedia.js index d3eaf0c0e..32c3ed74b 100644 --- a/src/components/TaxonDetails/TaxonMedia.js +++ b/src/components/TaxonDetails/TaxonMedia.js @@ -20,13 +20,13 @@ import Photo from "realmModels/Photo"; type Props = { loading: boolean, onChangeIndex?: Function, - photos: Array<{ + photos: { id?: number, url: string, localFilePath?: string, attribution?: string, licenseCode?: string - }>, + }[], tablet: boolean } diff --git a/src/components/UserList/UserList.tsx b/src/components/UserList/UserList.tsx index c1ade7241..e403073b2 100644 --- a/src/components/UserList/UserList.tsx +++ b/src/components/UserList/UserList.tsx @@ -18,7 +18,7 @@ interface Props { ListFooterComponent?: React.JSX.Element; onEndReached?: ( ) => void; refreshing?: boolean; - users: Array; + users: object[]; onPress?: ( ) => void; accessibilityLabel?: string; keyboardShouldPersistTaps?: string; diff --git a/src/navigation/BottomTabNavigator/CustomTabBar.js b/src/navigation/BottomTabNavigator/CustomTabBar.js index 1d4b5ce2b..5a7392188 100644 --- a/src/navigation/BottomTabNavigator/CustomTabBar.js +++ b/src/navigation/BottomTabNavigator/CustomTabBar.js @@ -16,7 +16,7 @@ const DROP_SHADOW = getShadow( { } ); type Props = { - tabs: Array, + tabs: Object[], }; /* eslint-disable react/jsx-props-no-spreading */ diff --git a/src/providers/ExploreContext.tsx b/src/providers/ExploreContext.tsx index 0f493bf8f..1caae57ea 100644 --- a/src/providers/ExploreContext.tsx +++ b/src/providers/ExploreContext.tsx @@ -161,10 +161,10 @@ interface PLACE { id: number; place_type: number; point_geojson: { - coordinates: Array; + coordinates: number[]; }; bounding_box_geojson?: { - coordinates: Array; + coordinates: number[]; }; type: string; } diff --git a/src/realmModels/types.d.ts b/src/realmModels/types.d.ts index e76f5b83b..ddda77cf5 100644 --- a/src/realmModels/types.d.ts +++ b/src/realmModels/types.d.ts @@ -106,18 +106,18 @@ export interface RealmObservationPojo { _created_at?: Date; _synced_at?: Date; captive_flag: boolean | null; - comments: Array; + comments: RealmComment[]; comments_viewed?: boolean; description: string | null; geoprivacy: string | null; - identifications: Array; + identifications: RealmIdentification[]; identifications_viewed?: boolean; latitude: number | null; license_code: License | null; longitude: number | null; obscured?: boolean; - observationPhotos: Array; - observationSounds: Array; + observationPhotos: RealmObservationPhotoPojo[]; + observationSounds: RealmObservationSoundPojo[]; observed_on?: string; observed_on_string: string | null; observed_time_zone?: string; @@ -139,8 +139,8 @@ export interface RealmObservationPojo { export interface RealmObservation extends RealmObservationPojo { missingBasics: ( ) => boolean; needsSync: ( ) => boolean; - observationPhotos: Array; - observationSounds: Array; + observationPhotos: RealmObservationPhoto[]; + observationSounds: RealmObservationSound[]; unviewed: ( ) => boolean; updateNeedsSync: ( ) => boolean; viewed: ( ) => boolean; diff --git a/src/sharedHelpers/flashListPerformanceTracker.ts b/src/sharedHelpers/flashListPerformanceTracker.ts index f9ca48cab..5d5d86a74 100644 --- a/src/sharedHelpers/flashListPerformanceTracker.ts +++ b/src/sharedHelpers/flashListPerformanceTracker.ts @@ -5,24 +5,24 @@ class FlashListPerformanceTracker { private itemsVisibleDuration: number; - private scrollEvents: Array<{ + private scrollEvents: { startTime: number; endTime: number; duration: number; itemsFetched: number; scrollDistance: number; - }> = []; + }[] = []; private currentScrollEvent: unknown = null; private fetchStartTime: number; - private fetchEvents: Array<{ + private fetchEvents: { startTime: number; endTime: number; duration: number; itemsCount: number; - }> = []; + }[] = []; private persistentMetrics = { lastFetchTime: null as number | null, diff --git a/src/sharedHelpers/parseExif.js b/src/sharedHelpers/parseExif.js index 0838f361e..5d5416791 100644 --- a/src/sharedHelpers/parseExif.js +++ b/src/sharedHelpers/parseExif.js @@ -63,11 +63,11 @@ export const formatExifDateAsString = ( datetime: string ): string => { // Parse the EXIF of all photos - fill out details (lat/lng/date) from all of these, // in case the first photo is missing EXIF -export const readExifFromMultiplePhotos = async ( photoUris: Array ): Promise => { +export const readExifFromMultiplePhotos = async ( photoUris: string[] ): Promise => { const unifiedExif = {}; const responses = await Promise.allSettled( photoUris.map( parseExif ) ); - const allExifPhotos: Array<{ + const allExifPhotos: { latitude: number, longitude: number, positional_accuracy: number, @@ -75,7 +75,7 @@ export const readExifFromMultiplePhotos = async ( photoUris: Array ): Pr // Flow will complain that value is undefined, but the filter call ensures // that it isn't // $FlowIgnore - }> = responses.filter( r => r.value ).map( r => r.value ); + }[] = responses.filter( r => r.value ).map( r => r.value ); allExifPhotos.filter( x => x ).forEach( currentPhotoExif => { diff --git a/src/sharedHooks/useAuthenticatedInfiniteQuery.ts b/src/sharedHooks/useAuthenticatedInfiniteQuery.ts index 715c746a5..6821341dd 100644 --- a/src/sharedHooks/useAuthenticatedInfiniteQuery.ts +++ b/src/sharedHooks/useAuthenticatedInfiniteQuery.ts @@ -8,7 +8,7 @@ import { useCurrentUser } from "sharedHooks"; // Should work like React Query's useInfiniteQuery with our custom reactQueryRetry // and authentication const useAuthenticatedInfiniteQuery = ( - queryKey: Array, + queryKey: string[], // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type queryFunction: Function, queryOptions: object = {}, diff --git a/src/sharedHooks/useInfiniteUserScroll.ts b/src/sharedHooks/useInfiniteUserScroll.ts index eff2625fb..eaffc43d5 100644 --- a/src/sharedHooks/useInfiniteUserScroll.ts +++ b/src/sharedHooks/useInfiniteUserScroll.ts @@ -5,7 +5,7 @@ const useInfiniteUserScroll = ( queryKey: string, // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type apiCall: Function, - ids: Array, + ids: object[], newInputParams: object, options: { enabled: boolean; diff --git a/src/sharedHooks/useQuery.ts b/src/sharedHooks/useQuery.ts index 1b9dbbb16..0ef361f99 100644 --- a/src/sharedHooks/useQuery.ts +++ b/src/sharedHooks/useQuery.ts @@ -4,7 +4,7 @@ import { handleRetryDelay, reactQueryRetry } from "sharedHelpers/logging"; // Should work like React Query's useQuery with our custom reactQueryRetry const useNonAuthenticatedQuery = ( - queryKey: Array, + queryKey: string[], queryFunction: QueryFunction, queryOptions: object = {}, ) => useQuery( { diff --git a/src/stores/createSyncObservationsSlice.ts b/src/stores/createSyncObservationsSlice.ts index f687da545..6ab42bb43 100644 --- a/src/stores/createSyncObservationsSlice.ts +++ b/src/stores/createSyncObservationsSlice.ts @@ -16,7 +16,7 @@ interface SyncObservationsSlice { autoSyncAbortController: AbortController | null; currentDeleteCount: number; deleteError: string | null; - deleteQueue: Array; + deleteQueue: string[]; deletionsCompletedAt: Date | null; initialNumDeletionsInQueue: number; syncingStatus: SyncingStatus; diff --git a/src/stores/createUploadObservationsSlice.ts b/src/stores/createUploadObservationsSlice.ts index 6afbc81f9..0b00b21be 100644 --- a/src/stores/createUploadObservationsSlice.ts +++ b/src/stores/createUploadObservationsSlice.ts @@ -30,8 +30,8 @@ interface UploadObservationsSlice { numUploadsAttempted: number; totalToolbarIncrements: number; totalToolbarProgress: number; - totalUploadProgress: Array; - uploadQueue: Array; + totalUploadProgress: TotalUploadProgress[]; + uploadQueue: string[]; uploadStatus: UploadStatus; } diff --git a/src/uploaders/mediaUploader.ts b/src/uploaders/mediaUploader.ts index afa4ab2d5..1d5cae63c 100644 --- a/src/uploaders/mediaUploader.ts +++ b/src/uploaders/mediaUploader.ts @@ -22,9 +22,9 @@ interface MediaApiResponse { page: number; per_page: number; total_results: number; - results: Array<{ + results: { id: number; - }>; + }[]; } interface MappedObservationPhotoForUpdating { diff --git a/src/uploaders/observationUploader.ts b/src/uploaders/observationUploader.ts index 242ad3d1a..4e2e192ac 100644 --- a/src/uploaders/observationUploader.ts +++ b/src/uploaders/observationUploader.ts @@ -38,10 +38,10 @@ interface ObservationApiResponse { page: number; per_page: number; total_results: number; - results: Array<{ + results: { uuid: string; id: number; - }>; + }[]; } async function validateAndGetToken( ): Promise { diff --git a/src/uploaders/utils/realmSync.ts b/src/uploaders/utils/realmSync.ts index a4caa1ebd..4623e8220 100644 --- a/src/uploaders/utils/realmSync.ts +++ b/src/uploaders/utils/realmSync.ts @@ -84,7 +84,7 @@ const markRecordUploaded = ( recordUUID: string | null, type: string, response: { - results: Array<{id: number}>; + results: {id: number}[]; }, realm: object, options?: {