import * as React from "react"; import type { Auth } from "../../records/Auth"; import type { Brand } from "../../records/Brand"; import type { LangInfo } from "../../records/LangInfo"; import type { User } from "../../records/User"; import type { AppleAuth } from "../../records/AppleAuth"; import * as api from "./api"; import type { InitialScreen } from "../../records/MagicLogin"; export declare type Modal = { initialScreen?: InitialScreen; origin?: "compass" | "account"; type?: "mmb" | "help" | "refer"; initialEmail?: string; onSignInFulfill?: () => void; onModalClose?: () => void; onContinueAsGuest?: () => void; }; export declare type AuthSignInState = "initial" | "loading" | "resolved"; export declare type HandleAppleLoginResponse = { connectAccount: boolean; }; export declare type Context = { auth: Auth | null; loading: boolean; state: AuthSignInState; modal: Modal | null; appleIdToken: string | null; appleUnconfirmedAuthToken: string | null; setAppleIdToken: (token: string | null) => void; onOpenModal: (modal?: Modal) => void; onCloseModal: () => void; onMyBooking: (input: api.MyBookingInput) => Promise; onRegister: (input: api.RegisterInput) => Promise; onFacebookAuth: () => Promise; onAppleAuth: () => Promise; onGoogleAuth: () => Promise; onSignIn: (email: string, password: string) => Promise; onSignOut: (options?: { invokeCallback?: boolean; }) => void; onSetAuth: (auth: Auth) => void; onGetUserInfoAndLogin: ({ token, shouldUpdateLocale, }: { token: string; shouldUpdateLocale?: boolean; }) => Promise; }; declare const context: React.Context; declare const Provider: React.Provider, AuthConsumer: React.Consumer; declare type Props = { children: React.ReactNode; langInfo: LangInfo; brand: Brand; endpoint?: api.Endpoint; onMyBooking?: (token: string) => void; onSignOut?: () => void; }; declare const AuthProvider: ({ children, langInfo, brand, endpoint, onMyBooking, onSignOut, }: Props) => JSX.Element; declare const useAuth: () => Context; declare const Consumer: React.Consumer; export { Provider, /** * @deprecated * use "useAuth" hook */ Consumer, AuthProvider, AuthConsumer, useAuth, }; export default context; export declare const useIsAuthResolved: () => boolean; export declare const useIsUserLoading: () => boolean; export declare const useUser: () => User | null; export declare const useIsModalOpen: () => boolean; export declare const useIsSignedIn: () => boolean; export declare const useAppleAuth: () => AppleAuth;