import EcomClient from '../index'; import '@firebase/auth'; import { User } from '../db/types'; import { FirebaseOptions } from '@firebase/app-types'; export interface AuthUser { displayName: string | null; email: string | null; emailVerified: boolean; isAnonymous: boolean; uid: string; } export declare class Auth { readonly _ecom: EcomClient; private _firebaseConfig; private _authUser; private _user; constructor(ecom: EcomClient, firebaseConfig: FirebaseOptions); readonly currentUser: AuthUser | null; onAuthStateChanged(callback: any): void; /** * Create a new customer * @param {string} email * @param {string} password * @param {string} firstname * @param {string} lastname * @returns {object|null} * */ createUser(email: string, password: string, firstname: string, lastname: string): Promise; signInAnonymously(): Promise; /** * * @param developerKey secret key */ signInWithDeveloperKey(developerKey: string): Promise; /** * Asynchronously signs in using an email and password. * * Fails with an error if the email address and password do not match. * * Error Codes * * auth/invalid-email * Thrown if the email address is not valid. * * auth/user-disabled * Thrown if the user corresponding to the given email has been disabled. * * auth/user-not-found * Thrown if there is no user corresponding to the given email. * * auth/wrong-password * Thrown if the password is invalid for the given email, or the account * corresponding to the email does not have a password set. * @param email * @param password */ signInWithEmailAndPassword(email: string, password: string): Promise; signOut(): Promise; onAuthStateChange(observer: (value: any) => void): Promise; sendPasswordResetEmail(email: string): Promise; }