import { AxiosError, AxiosPromise } from 'axios'; /** make one property in an interface optional @thanks https://stackoverflow.com/a/61108377/7455960 */ export type Optional = Pick, K> & Omit; export type IterablePromise = AxiosPromise; export type IterablePromiseRejection = AxiosError; export type IterableErrorStatus = 'Success' | 'BadApiKey' | 'BadParams' | 'BadJsonBody' | 'QueueEmailError' | 'GenericError' | 'InvalidEmailAddressError' | 'DatabaseError' | 'EmailAlreadyExists' | 'Forbidden' | 'JwtUserIdentifiersMismatched' | 'InvalidJwtPayload'; export type IterablePlatform = 'iOS' | 'Android' | 'Web'; export interface IterableResponse { code: IterableErrorStatus; msg: string; params?: null | Record; } export interface ErrorHandler { (error: any): void; }