diff --git a/src/components/ContainerComponents/ViewContainer/AvailableChallengeDetailsViewContainer.tsx b/src/components/ContainerComponents/ViewContainer/AvailableChallengeDetailsViewContainer.tsx index 185aab9cf09af9509c7f2228afb6ee189d177460..91c1dea63fab190ff3359f4a75e3eaae6a5bb2d8 100644 --- a/src/components/ContainerComponents/ViewContainer/AvailableChallengeDetailsViewContainer.tsx +++ b/src/components/ContainerComponents/ViewContainer/AvailableChallengeDetailsViewContainer.tsx @@ -18,7 +18,7 @@ import { DateTime } from 'luxon' interface AvailableChallengeDetailsViewProps { location: Location - props: any + props: object client: Client t: Function } diff --git a/src/components/ContainerComponents/ViewContainer/FinishedChallengeDetailsViewContainer.tsx b/src/components/ContainerComponents/ViewContainer/FinishedChallengeDetailsViewContainer.tsx index 6b34c83cc892d2df4afa0a03b7613321061948b1..7f01171dd4d9cc477a0ee612e133e5939a90d017 100644 --- a/src/components/ContainerComponents/ViewContainer/FinishedChallengeDetailsViewContainer.tsx +++ b/src/components/ContainerComponents/ViewContainer/FinishedChallengeDetailsViewContainer.tsx @@ -20,7 +20,7 @@ import { ScreenType } from 'enum/screen.enum' interface FinishedChallengeDetailsViewProps { location: any - props: any + props: object client: Client t: Function } @@ -33,7 +33,7 @@ const FinishedChallengeDetailsViewContainer: React.FC<FinishedChallengeDetailsVi const [openEcogestureModal, setOpenEcogestureModal] = useState(false) const [challenge, setChallenge] = useState<UserChallenge | null>(null) const [headerHeight, setHeaderHeight] = useState<number>(0) - const [badgeIcon, setBadgeIcon] = useState<any | null>(null) + const [badgeIcon, setBadgeIcon] = useState<string | undefined>() const { screenType } = useContext(AppContext) async function importRightBadge(id: string, badgeStatus: number) { diff --git a/src/components/ContainerComponents/ViewContainer/LockedChallengeDetailsViewContainer.tsx b/src/components/ContainerComponents/ViewContainer/LockedChallengeDetailsViewContainer.tsx index 36ee470b0237383ca94810b6ee5b4227c7bf15ca..506cd937d18b30896fd6efcd986198fa9a898c46 100644 --- a/src/components/ContainerComponents/ViewContainer/LockedChallengeDetailsViewContainer.tsx +++ b/src/components/ContainerComponents/ViewContainer/LockedChallengeDetailsViewContainer.tsx @@ -15,7 +15,7 @@ import LockedChallengeIcon from 'assets/png/badges/locked-big.png' interface LockedChallengeDetailsViewProps { location: any - props: any + props: object client: Client t: Function } diff --git a/src/components/ContainerComponents/ViewContainer/OngoingChallengeDetailsViewContainer.tsx b/src/components/ContainerComponents/ViewContainer/OngoingChallengeDetailsViewContainer.tsx index 5dccdf94b7fd70d0f3a5c3f31f6b2e86a4436301..e46cad6dc82d386367116f39b52cb3ea5d977ac3 100644 --- a/src/components/ContainerComponents/ViewContainer/OngoingChallengeDetailsViewContainer.tsx +++ b/src/components/ContainerComponents/ViewContainer/OngoingChallengeDetailsViewContainer.tsx @@ -26,7 +26,7 @@ import { ScreenType } from 'enum/screen.enum' interface OngoingChallengeDetailsViewProps { location: any - props: any + props: object client: Client t: Function } diff --git a/src/components/ContentComponents/ChallengeList/ChallengeListItem.tsx b/src/components/ContentComponents/ChallengeList/ChallengeListItem.tsx index a97b85f604236bad84fda49aceea24b4be3076e3..3b617c7a2738733ed4d7fed851330bf75287a8da 100644 --- a/src/components/ContentComponents/ChallengeList/ChallengeListItem.tsx +++ b/src/components/ContentComponents/ChallengeList/ChallengeListItem.tsx @@ -30,7 +30,7 @@ const ChallengeListItem: React.FC<ChallengeListItemProps> = ({ t, challengeState, }: ChallengeListItemProps) => { - const [badgeIcon, setBadgeIcon] = useState<any | null>(null) + const [badgeIcon, setBadgeIcon] = useState<string | undefined>() async function importRightBadge(id: string, badgeStatus: number) { // Les png doivent ĂȘtre au format idchallenge-badgestate.png diff --git a/src/components/ContentComponents/ChallengeModal/ChallengeModal.tsx b/src/components/ContentComponents/ChallengeModal/ChallengeModal.tsx index 13cec17b7b28a4957a181419413da42d2ec7257c..c2dc91be3a8ccc842199f96bbbec45c947b88544 100644 --- a/src/components/ContentComponents/ChallengeModal/ChallengeModal.tsx +++ b/src/components/ContentComponents/ChallengeModal/ChallengeModal.tsx @@ -25,7 +25,7 @@ const ChallengeModal: React.FC<ChallengeModalProps> = ({ handleCloseClick, badgeStatus, }: ChallengeModalProps) => { - const [badgeIcon, setBadgeIcon] = useState<any | null>(null) + const [badgeIcon, setBadgeIcon] = useState<string | null>(null) const { screenType } = useContext(AppContext) async function importRightBadge(id: string, badgeStatus: number) { diff --git a/src/cozy-client.d.ts b/src/cozy-client.d.ts index b7e058c87e899350fca479f64af60d21f6e82e1a..7af0d41b8278cc1c40bb598ec1b901317fc19d08 100644 --- a/src/cozy-client.d.ts +++ b/src/cozy-client.d.ts @@ -30,8 +30,8 @@ export type Client = { save(document: Document): typeof QueryDefinition create( doctype: string, - entry: any, - relationships?: any + entry: object, + relationships?: object ): typeof QueryDefinition collection(doctype: string): function offline: typeof Offline diff --git a/src/services/challengeDataManagerService.ts b/src/services/challengeDataManagerService.ts index 00a32f05a680fb0ac96fcfe03fef4ef3b0cfd381..10740c590f1bbb2fdf04f6b014e960d6946f3555 100644 --- a/src/services/challengeDataManagerService.ts +++ b/src/services/challengeDataManagerService.ts @@ -431,7 +431,7 @@ export default class ChallengeManager implements IChallengeManager { | null = challengeTypesresult.data ? challengeTypesresult.data : null const challengeTypeEntityRelationships: - | any + | object | null = challengeTypesresult.included ? challengeTypesresult.included : null @@ -547,7 +547,7 @@ export default class ChallengeManager implements IChallengeManager { | null = resultUserChallenge.data ? resultUserChallenge.data : null const userChallengeEntityRelationships: - | any + | object | null = resultUserChallenge.included ? resultUserChallenge.included : null @@ -591,7 +591,7 @@ export default class ChallengeManager implements IChallengeManager { | null = resultUserChallenge.data ? resultUserChallenge.data : null const userChallengeEntityRelationships: - | any + | object | null = resultUserChallenge.included ? resultUserChallenge.included : null diff --git a/src/services/challengeDataMapperService.ts b/src/services/challengeDataMapperService.ts index d55871c5f6501f6a1695a18ad8e64f3cdbbd73a2..b8c8ac17115ee771e45dcc40fbaa96643dc47360 100644 --- a/src/services/challengeDataMapperService.ts +++ b/src/services/challengeDataMapperService.ts @@ -62,7 +62,7 @@ export class ChallengeTypeEntity { level: number, duration: Duration, fluidTypes: FluidType[], - relationships: any + relationships: object ) { this._id = _id this.type = type @@ -112,7 +112,7 @@ export default class ChallengeDataMapper { public mapToUserChallenge( userChallengeEntity: UserChallengeEntity, - userChallengeEntityRelationships?: any | null + userChallengeEntityRelationships?: object | null ): UserChallenge { let selectedEcogestures: EcogestureType[] = [] let challengeType: ChallengeType | null = null @@ -153,11 +153,11 @@ export default class ChallengeDataMapper { public mapToChallengeType( challengeEntity: ChallengeTypeEntity, - challengeTypeEntityRelationships?: any | null, + challengeTypeEntityRelationships?: object | null, unlockedEcogestures?: string[] // fluidTypes?: FluidType[] ): ChallengeType { - const completeAvailableEcogestures: any[] = [] + const completeAvailableEcogestures: object[] = [] if (challengeTypeEntityRelationships) { for (const ecogestureType of challengeEntity.relationships @@ -223,8 +223,8 @@ export default class ChallengeDataMapper { public mapToChallengeTypes( challengeEntities: ChallengeTypeEntity[], - challengeTypeEntityRelationships?: any | null, - unlockedEcogestures?: any + challengeTypeEntityRelationships?: object | null, + unlockedEcogestures?: object // fluidTypes?: FluidType[] ): ChallengeType[] { return challengeEntities.map(challengeEntity => diff --git a/src/services/initDataManagerService.ts b/src/services/initDataManagerService.ts index 68dcf4b1bd2f240f8a2b981f7ab397902910da39..969d14ddca64caf153fd7d5ca5c9ab5049f4c705 100644 --- a/src/services/initDataManagerService.ts +++ b/src/services/initDataManagerService.ts @@ -353,7 +353,7 @@ export default class InitDataManager { /* * Call a query with where clause to create the index if not exist */ - public async createIndex(doctype: string): Promise<any> { + public async createIndex(doctype: string): Promise<object> { return await this._client.query( this._client .find(doctype) diff --git a/src/services/jobsService.ts b/src/services/jobsService.ts index 5790c0b05f8b2e916060b690c53e3c05745a2f34..ef5529ac033fa50bfb7089447eb7aa31867d0777 100644 --- a/src/services/jobsService.ts +++ b/src/services/jobsService.ts @@ -1,5 +1,5 @@ import { Client } from 'cozy-client' -import { JOBS_DOCTYPE } from 'doctypes' +import { JOBS_DOCTYPE, Job } from 'doctypes' import KonnectorJobWatcher from 'cozy-harvest-lib/dist/models/konnector/KonnectorJobWatcher' import { ERROR_EVENT, @@ -24,7 +24,7 @@ export class JobService { return await this._client.query(this._client.get(JOBS_DOCTYPE, jobId)) } - watch = async (job: any, callbackResponse: any) => { + watch = async (job: object, callbackResponse: any) => { const konnectorJobWatcher = new KonnectorJobWatcher(this._client, job, { expectedSuccessDelay: 8000, }) diff --git a/src/utils/hash.ts b/src/utils/hash.ts index 8bd0a97296121f4e0e8c3b9aed0d3fd7f555e0f3..89b4eadadd5cdf4f58e44b9c1225bd3e1bd30908 100644 --- a/src/utils/hash.ts +++ b/src/utils/hash.ts @@ -3,6 +3,6 @@ import hash from 'object-hash' /*** * sha1 hex encoding (default) */ -export function hashFile(file: any) { +export function hashFile(file: File) { return hash(file) }