export type AccountType = | 'patient' | 'provider' | 'company' | 'marketer' | 'staffing_company' | 'admin' | 'guest' export interface Store { prevCalls: string[] accountType: AccountType } export interface AuthAccountParams { phone_number?: string phone?: string password: string } export interface AuthAccountVerificationCodeParams { phone_number?: string phone?: string phone_verification_code?: string } export interface Appointment { id: string patient: { user_id: string tv_uid: string tv_group_id: string languages: { 'en-US': boolean } inviter_code: string document_symptoms_and_conditions: string document_family_symptoms_and_conditions: string document_procedures_and_treatments: string document_immunization_history: string document_social_history: string document_allergies: string document_medications: string document_sexual_history: string document_obstetrical_history: string document_health_kit: string document_samsung_health: string attributes: { first_name: string last_name: string address: string primary_phone_number: string birthday: string email: string } tv_blobs: Array<{ tv_blob_id: string patient: string filename: string created: string }> } provider: { user_id: string email: string cell_phone_number: string primary_phone_number: string first_name: string middle_name: string last_name: string gender: string profile_photo: string education_school: string education_degree: string NPI: string DEA: string brief_introduction: string languages: { 'en-US': boolean } specialties: string[] rating: number } status: AppointmentStatus is_walk_in: boolean purpose: string start_time: string end_time: string document_present_history_illness: string document_provider_note: string document_prescription: string document_absence: string document_legal_absence: string created_at: string updated_at: string specialty: string creator: string customer: string time_slot: string video_session: number } export type Appointments = Appointment[] export type AppointmentStatus = 1 | 2 | 3 | 4 export interface AppointmentFuncArgs { limit?: number order_by?: string status?: number[] filter?: AppointmentsFilterFunc patients?: string[] | string } export type AppointmentsFilterFunc = ( appointment: Appointment, id: string, allAppointments: { [id: string]: Appointment }, ) => boolean export interface AppointmentReqParams { status?: AppointmentStatus limit?: number order_by?: string } export interface AppointmentReview { appointment: string review: string comment: string } export interface Auth { token?: string phone_number?: string jwt_token?: string user_id?: string tv_uid?: string tv_token?: string tv_access_token?: string } export interface AuthOfflineProviderResult { user_id: string user_type: 'Patient' | 'Provider' jwt_token: string } export interface AuthCredentialsResponse { user_id: string jwt_token: string tv_uid: string tv_access_token: string } export interface AxiosInterceptors { requests: { [key: string]: any } responses: { [key: string]: any } } export interface ChasePaymentProfileParams { card_number: string expiration_date: string cvv_code: string | number billing_first_name: string billing_last_name: string billing_address: string billing_city: string billing_state: string billing_zip_code: string | number } export interface ConstructQueryAppointmentsUrlArgs { patients?: string[] providers?: string[] status?: number[] start_time?: string end_time?: string filter?: AppointmentsFilterFunc } export type ConstructURLItem = [string, string[] | string | number] export interface Coupon { code: string amount: number expired_at: string } export interface CreateAppointmentParams { patient: string provider: string specialty: string charge_method: string time_slot: number | string purpose?: string payment_profile_id?: string coupons?: string[] | string card_number?: string | number expiration_date?: string cvv_code?: string | number billing_first_name?: string billing_last_name?: string billing_address?: string billing_city?: string billing_state?: string billing_zip_code?: string | number } export interface CreateAppointmentReturnValue { pagination: Pagination appointments: Appointment[] ids: string[] } export interface CreateAppointmentReviewParams { appointment: string rating: string comment: string } export interface CreatePatientParams { phone_number: string phone_verification_code: string password: string languages?: { 'en-US': boolean 'zh-CN': boolean 'zh-TW': boolean 'es-ES': boolean } first_name: string middle_name?: string last_name: string inviter_code?: string force_delete?: string } export interface CreatePatientMemberParams { first_name: string middle_name?: string last_name: string gender: 'MALE' | 'FEMALE' | 'PNS' birthday: string // Date ISO String relation: string } export interface CreateProviderParams { phone_number: string phone_verification_code: string password: string languages?: { 'en-US': boolean 'zh-CN': boolean 'zh-TW': boolean 'es-ES': boolean } first_name: string middle_name?: string last_name: string specialties: string[] // list of specialty_code email?: string gender: 'MALE' | 'FEMALE' | 'PNS' license_state: string NPI: string } export interface CreatePatientOtherDataArgs { inviter_code?: string languages?: LanguagePrimaryBoolean[] } export interface CreatePatientRequestData { tv_uid: string tv_token: string languages?: LanguagePrimaryBoolean[] inviter_code?: string } export interface CreatePatientBlobBlobInfo { patient: string tv_blob_ids: string filename: string created?: string } export interface CreatePatientMemberArgs { username: string password: string attributes?: object } export interface CreateReferringPatientReturnValue { user_exists: boolean email_sent: boolean referral_id: boolean } export type Env = 'testapi' | 'api' export interface Subscriptions { [eventName: string]: Fn[] } export interface FetchPatientBlobsParams { patient?: string appointment?: string max?: number max_count?: number maxCreatedAt?: string max_created_at?: string } export interface FetchPatientBlobsResult { filename?: string created_at?: string modified_at?: string patient?: string tv_blob_ids?: Array<{ tv_blob_id?: string type?: string }> } export interface FetchPatientsParams { first_name?: string middle_name?: string last_name?: string } export interface FetchPatientsReturnValue { pagination: Pagination patients: { tv_uid: string attributes: { gender?: string first_name?: string primary_phone_number?: string cell_phone_number?: string last_name?: string birthday?: string relation?: string email?: string USER_TYPE?: string USER_SERVER?: string languages: LanguagePrimaryBoolean } } } export interface FetchProvidersParams { limit?: number page?: number order_by?: string name?: string referral_code?: string } export interface FetchProvidersReturnValue { pagination: Pagination providers: { [user_id: string]: Provider } ids: string[] } export interface StaffingCompanyCostDetail { FAMILY_MEDICINE?: number INTERNAL_MEDICINE?: number OBGYN?: number PEDIATRICIAN?: number PSYCHOLOGIST?: number NATURAL_HOLISTIC?: number NATURAL_HERBAL?: number HOMEOPATHIC?: number ALLERGY_IMMUNOLOGY?: number CHIROPRACTIC?: number INFECTIOUS_DISEASE?: number ORTHOPEDIC_SPECIALIST?: number PAIN_MANAGEMENT?: number SPORTS_MEDICINE?: number ACUPUNCTURE?: number PSYCHIATRIST?: number ENDOCRINOLOGY?: number GASTROENTEROLOGY?: number NEUROLOGY?: number CARDIOLOGY?: number PULMONOLOGY?: number EAR_NOSE_THROAT?: number RENAL_NEPHROLOGY?: number EMERGENCY_MEDICINE?: number UROLOGY?: number PODIATRIST?: number VASCULAR?: number DERMATOLOGY?: number HAND_SURGERY?: number NURSE?: number PHYSICIAN_ASSISTANT?: number } export interface StaffingCompaniesParams { email: string company_name: string first_name: string last_name: string street_line_1: string city: string state: string zip_code: string mailing_street_line_1: string mailing_city: string mailing_state: string mailing_zip_code: string } export interface CreateStaffingCompaniesParams extends StaffingCompaniesParams { cost_detail?: StaffingCompanyCostDetail password: string street_line_2?: string mailing_street_line_2?: string primary_phone_number?: string cell_phone_number?: string home_phone_number?: string fax_phone_number?: string is_urgent_care?: string middle_name?: string } export interface CreateStaffingCompaniesReturnValue extends StaffingCompaniesParams { user_id: string is_active: boolean medical_malpractice_insurance: string | null company_contract: string | null note_1: string | null note_2: string | null note_3: string | null note_4: string | null middle_name: string cell_phone_number: string | null primary_phone_number: string | null fax_phone_number: string | null home_phone_number: string | null street_line_2: string | null mailing_street_line_2: string | null cost_detail: StaffingCompanyCostDetail } export interface FetchStaffingCompaniesParams { limit?: number page?: number order_by?: string name?: string referral_code?: string } export interface FetchStaffingCompaniesReturnValue { pagination: Pagination staffingCompanies: { [user_id: string]: StaffingCompany } ids: string[] } export interface FindProvidersParams { specialty: string[] language: string[] time?: string state?: string } export interface FindProviderAvailabilitiesParams { specialty: string[] language: string[] time?: string state?: string } export interface FindProviderResult { time_slot_id: number start: string end: string provider: { user_id?: string email?: string cell_phone_number?: string primary_phone_number?: string first_name?: string middle_name?: string last_name?: string gender?: string profile_photo?: string education_school?: string education_degree?: string NPI?: string DEA?: string brief_introduction?: string languages?: { 'en-US'?: boolean 'zh-CN'?: boolean 'zh-TW'?: boolean 'es-ES'?: boolean } specialties: string[] rating?: string | number | null } } export interface FindProviderAvailabilityResult { user_id?: string email?: string cell_phone_number?: string primary_phone_number?: string first_name?: string middle_name?: string last_name?: string gender?: string profile_photo?: string education_schoo?: string education_degree?: string NPI?: string DEA?: string brief_introduction?: string languages?: { 'en-US'?: boolean 'zh-CN'?: boolean 'zh-TW'?: boolean 'es-ES'?: boolean } specialties: string[] rating: string | number | null time_slots: Timeslot[] } export type LanguageCode = 'en-US' | 'zh-CN' | 'zh-TW' | 'es-ES' export interface LanguageObject { code: string english: string translated: string } export interface LanguagesBasicMap { 'en-US'?: boolean 'zh-CN'?: boolean 'zh-TW'?: boolean 'es-ES'?: boolean } export interface LanguagePrimaryBoolean { code: LanguageCode is_primary: boolean } export type Fn = (...args: any[]) => void export type LoginArguments = [ AccountType, LoginWithEmailCreds | LoginWithUsernameCreds | LoginWithTvUidCreds | string, string? ] export type LoginOptions = | TvBackendLoginCreds | LoginWithEmailCreds | LoginWithUsernameCreds | LoginWithTvUidCreds export interface LoginWithEmailCreds { email: string password: string } export interface LoginWithUsernameCreds { username: string password: string } export interface LoginWithJwtTokensParams { userId?: string user_id?: string token: string } export interface LoginWithTvUidCreds { tv_uid: string tv_token: string } export interface FetchAppointmentsReturnObject { pagination: Pagination ids: string[] appointments: { [key: string]: Appointment } } export interface FetchAppointmentReviewsReturnValue { pagination: Pagination reviews: { [appointment: string]: AppointmentReview } ids: string[] } export interface FetchPharmaciesParams { lat: string lng: string range: number company_name?: string } export interface FetchTvBlobReturnValue { blob: Blob contentType: string fileName: string } export interface GeoGoogleMapsDirections { geocoded_waypoints: Array<{ geocoder_status: string place_id: string types: string[] }> routes: Array<{ bounds: { northeast: GeoGoogleMapsCoords southwest: GeoGoogleMapsCoords } copyrights: string legs: Array<{ distance: { text: string value: number } duration: { text: string value: number } end_address: string end_location: GeoGoogleMapsCoords start_address: string start_location: GeoGoogleMapsCoords steps: Array<{ distance: { text: string value: number } duration: { text: string value: number } end_location: GeoGoogleMapsCoords html_instructions?: string maneuver?: string polyline: { points: string } start_location: GeoGoogleMapsCoords travel_mode: string }> }> }> } export interface GeoGoogleMapsCoords { lat?: number lng?: number } export interface NormalizedAppointments { [id: string]: Appointment } export interface NormalizedData { [key: string]: any ids: string[] } interface Patient { access_key: string account_id: string attributes: { USER_SERVER: string USER_TYPE: string birthday: string email: string first_name: string gender: string languages: { 'en-US': boolean } last_name: string primary_phone_number: string } created_at: string created_by: string created_from: string external_key_hash: string group_ids: [] id: string mfa_enrolled: boolean modified_at: string modified_by: string modified_from: string status: string user_id: string username: string } export interface PatientBlob { tv_blob_id: string filename: string patient: string created?: string } export interface PatientDocumentized { user_id?: string tv_uid?: string tv_group_id?: string languages?: { [code: string]: boolean } inviter_code?: string document_symptoms_and_conditions?: string document_family_symptoms_and_conditions?: string document_procedures_and_treatments?: string document_immunization_history?: string document_social_history?: string document_allergies?: string document_medications?: string document_sexual_history?: string document_obstetrical_history?: string document_health_kit?: string document_samsung_health?: string tv_blobs?: PatientBlob[] } export interface PatientFullBackend { token: string user: PatientDocumentized | null members: { [user_id: string]: PatientDocumentized } } export interface Pagination { object_count: number page_limit: number page_index: number num_pages: number } export interface PaymentProfile { payment_profile_id?: string card_last_digits?: string card_type?: string } export interface Pharmacy { contact_name?: string company?: string address?: string city?: string state?: string zip_code?: string fax?: string geoLocation?: { latitude: string | number longtitude: string | number } } export type PhotoDocumentName = | 'education_document' | 'npi_document' | 'dea_document' | 'license_document' | 'driver_license_document' | 'w9_form_document' | 'profile_photo' export interface PrepareURLConstructParams { [key: string]: string[] | string | number } export interface Provider { user_id?: string tv_uid?: string tv_api_key?: string is_approved?: boolean join_date?: string email?: string gender?: string license_state?: string license_number?: string license_document?: string specialties?: string[] languages?: { 'en-US': boolean } education_degree?: string agreed_consent?: boolean cell_phone_number?: string primary_phone_number?: string fax_phone_number?: string home_phone_number?: string first_name?: string middle_name?: string last_name?: string street_line_1?: string street_line_2?: string city?: string state?: string zip_code?: string referral_code?: string NPI?: string DEA?: string address?: string tel?: string } export type ProviderDocument = | 'license_document' | 'npi_document' | 'dea_document' | 'education_document' | 'resident_certification_document' | 'board_certification_document' | 'driver_license_document' | 'contract_document' | 'w9_form_document' export interface ProviderUpdateDocumentParams { name: string base64: string } export interface SendPrescriptionToPharmacyParams { blob_id: string fax_number: string } export interface StaffingCompany { user_id?: string is_active?: boolean email?: string company_name?: boolean medical_malpractice_insurance?: string company_contract?: string note_1?: string note_2?: string note_3?: string note_4?: string first_name?: string middle_name?: string last_name?: string cell_phone_number?: string primary_phone_number?: string fax_phone_number?: string home_phone_number?: string street_line_1?: string street_line_2?: string city?: string state?: string zip_code?: string mailing_street_line_1?: string mailing_street_line_2?: string mailing_city?: string mailing_state?: string mailing_zip_code?: string cost_detail?: { FAMILY_MEDICINE?: number INTERNAL_MEDICINE?: number OBGYN: number PEDIATRICIAN: number EMERGENCY_MEDICINE: number PSYCHOLOGIST: number NATURAL_HOLISTIC: number NATURAL_HERBAL: number HOMEOPATHIC: number ALLERGY_IMMUNOLOGY: number CHIROPRACTIC: number INFECTIOUS_DISEASE: number ORTHOPEDIC_SPECIALIST: number PAIN_MANAGEMENT: number SPORTS_MEDICINE: number ACUPUNCTURE: number PSYCHIATRIST: number ENDOCRINOLOGY: number GASTROENTEROLOGY: number NEUROLOGY: number CARDIOLOGY: number PULMONOLOGY: number EAR_NOSE_THROAT: number RENAL_NEPHROLOGY: number UROLOGY: number PODIATRIST: number VASCULAR: number DERMATOLOGY: number HAND_SURGERY: number NURSE: number PHYSICIAN_ASSISTANT: number } } export type SpecialtyCode = | 'PLUMONOLOGY' | 'CARDIOLOGY' | 'PULMONOLOGY' | 'EAR_NOSE_THROAT' | 'RENAL_NEPHROLOGY' | 'UROLOGY' | 'PODIATRIST' | 'VASCULAR' | 'DERMATOLOGY' | 'FAMILY_MEDICINE' | 'INTERNAL_MEDICINE' | 'OBGYN' | 'PEDIATRICIAN' | 'EMERGENCY_MEDICINE' | 'PSYCHOLOGIST' | 'NATURAL_HOLISTIC' | 'NATURAL_HERBAL' | 'HOMEOPATHIC' | 'ALLERGY_IMMUNOLOGY' | 'CHIROPRACTIC' | 'INFECTIOUS_DISEASE' | 'ORTHOPEDIC_SPECIALIST' | 'PAIN_MANAGEMENT' | 'SPORTS_MEDICINE' | 'ACUPUNCTURE' | 'PSYCHIATRIST' | 'ENDOCRINOLOGY' | 'GASTROENTEROLOGY' | 'NEUROLOGY' | 'HAND_SURGERY' | 'NURSE' | 'PHYSICIAN_ASSISTANT' export interface SpecialtyObject { code: SpecialtyCode category: string type: string translations: { [locale: string]: string } } export interface Timeslot { id: number start_time: string end_time: string } export interface TvAuth { access_token?: string tv_api_key?: string tv_uid?: string tv_token?: string user_id?: string } export interface TvBackendLoginCreds { tv_uid?: string tv_token?: string } export interface UpdateAppointmentOptions { purpose?: string document_present_history_illness?: string document_provider_note?: string document_prescription?: string document_absence?: string document_legal_absence?: string } export interface UpdatePatientOptions { languages?: LanguagePrimaryBoolean[] profile?: { document_symptoms_and_conditions?: string document_family_symptoms_and_conditions?: string document_procedures_and_treatments?: string document_immunization_history?: string document_allergies?: string document_medications?: string document_sexual_history?: string document_obstetrical_history?: string document_health_kit?: string document_samsung_health?: string } } export interface UpdateProviderOptions { NPI?: string languages?: { [code: string]: boolean } is_primary?: boolean email?: string first_name?: string middle_name?: string last_name?: string street_line_1?: string street_line_2?: string city?: string state?: string zip_code?: string specialties?: string[] license_state?: string license_number?: string education_degree?: string education_document?: string gender?: string code?: string primary_phone_number?: string cell_phone_number?: string referral_code?: string fax_phone_number?: string npi_document?: string DEA?: string dea_document?: string brief_introduction?: string } export type ValidateObjectKeys = ( keys: string[], collection: string[] | object, ) => { keys: string[] validKeys: [] invalidKeys: [] }