import type { Unsubscribe } from "@wix/sdk-runtime/nanoevents"; import type { Tokens } from "@wix/sdk-types"; export type { Unsubscribe, Tokens }; /** * Optional settings passed when registering a new member. */ export interface RegistrationOptions { /** Contact information for the new member. */ contactInfo: { /** Member's first name. */ firstName: string; /** Member's last name. */ lastName: string; /** URL of the member's profile picture. */ picture: string; /** List of email addresses. */ emails: string[]; /** List of phone numbers. */ phones: string[]; /** The member's preferred language code (for example, `en`, `es`). */ language: string; /** Custom fields to store with the member profile. */ customFields: Record; }; /** Member profile's publicity status: * - `PUBLIC`: Visible to other members. * - `PRIVATE`: Not visible to other members. */ privacyStatus: 'PUBLIC' | 'PRIVATE'; } /** * Result returned after a successful member registration. */ export interface RegistrationResult { /** The member's status after registration. * - 'PENDING': Requires email verification or admin approval. * - 'ACTIVE': The member is logged in. */ status: 'PENDING' | 'ACTIVE'; } export interface AuthenticationApi { register(email: string, password: string, options?: RegistrationOptions): Promise; login(email: string, password: string): Promise; logout(): Promise; applySessionToken(token: string): Promise; loggedIn(): boolean; onLogin(handler: () => void): Unsubscribe; sendPasswordResetEmail(email: string, redirectUri: string): Promise; onLogout(handler: () => void): Unsubscribe; } /** * Error codes when login or registration fails. * * @remarks * - `invalidEmail`: The email address format is invalid. * - `invalidPassword`: The password is incorrect. * - `resetPassword`: The member must reset their password before logging in. * - `missingCaptchaToken`: A CAPTCHA token is required but was not provided. * - `emailAlreadyExists`: An account with this email already exists. * - `invalidCaptchaToken`: The CAPTCHA token is invalid or expired. */ export type AuthenticationErrorCodes = 'invalidEmail' | 'invalidPassword' | 'resetPassword' | 'missingCaptchaToken' | 'emailAlreadyExists' | 'invalidCaptchaToken'; //# sourceMappingURL=types.d.ts.map