// ---------------------------------------------------------------------- export type ActionMapType = { [Key in keyof M]: M[Key] extends undefined ? { type: Key; } : { type: Key; payload: M[Key]; }; }; export type AuthUserType = null | Record; export type AuthStateType = { status?: string; loading: boolean; user: AuthUserType; }; // ---------------------------------------------------------------------- type CanRemove = { login?: (email: string, password: string) => Promise; register?: ( email: string, password: string, firstName: string, lastName: string ) => Promise; // loginWithGoogle?: () => Promise; loginWithGithub?: () => Promise; loginWithTwitter?: () => Promise; // confirmRegister?: (email: string, code: string) => Promise; forgotPassword?: (email: string) => Promise; resendCodeRegister?: (email: string) => Promise; newPassword?: (email: string, code: string, password: string) => Promise; }; export type FirebaseContextType = CanRemove & { user: AuthUserType; method: string; loading: boolean; authenticated: boolean; unauthenticated: boolean; logout: () => Promise; loginWithGoogle: () => Promise; loginWithGithub: () => Promise; loginWithTwitter: () => Promise; forgotPassword?: (email: string) => Promise; login: (email: string, password: string) => Promise; register: (email: string, password: string, firstName: string, lastName: string) => Promise; };