import * as firebaseAuthModule from '@react-native-firebase/app/dist/module/internal/web/firebaseAuth'; import type { ActionCodeSettings, MultiFactorError, MultiFactorResolver } from '@react-native-firebase/app/dist/module/internal/web/firebaseAuth'; type UserInfoObject = { providerId: string; uid: string; displayName: string | null; email: string | null; photoURL: string | null; phoneNumber: string | null; }; type MultiFactorInfoObject = { displayName?: string | null; enrollmentTime: string; factorId: string; uid: string; phoneNumber?: string | null; }; type UserMetadataObject = { creationTime: string | null; lastSignInTime: string | null; }; type UserObject = UserInfoObject & { emailVerified: boolean; isAnonymous: boolean; tenantId: string | null; providerData: UserInfoObject[]; metadata: UserMetadataObject; multiFactor: { enrolledFactors: MultiFactorInfoObject[]; }; }; type AuthResultObject = { user: UserObject; additionalUserInfo: { isNewUser: boolean; profile: Record | null; providerId: string | null; username?: string | null; } | null; }; /** * This is a 'NativeModule' for the web platform. * Methods here are identical to the ones found in * the native android/ios modules e.g. `@ReactMethod` annotated * java methods on Android. */ declare const _default: { useUserAccessGroup(): Promise; configureAuthDomain(): Promise; getCustomAuthDomain(): Promise; /** * Create a new auth state listener instance for a given app. * @param {string} appName - The name of the app to get the auth instance for. * @returns {Promise} - Void promise. */ addAuthStateListener(appName: string): Promise | undefined; /** * Remove an auth state listener instance for a given app. * @param {string} appName - The name of the app to get the auth instance for. * @returns {Promise} - Void promise. */ removeAuthStateListener(appName: string): void; /** * Create a new ID token listener instance for a given app. * @param {string} appName - The name of the app to get the auth instance for. * @returns {Promise} - Void promise. */ addIdTokenListener(appName: string): Promise | undefined; /** * Remove an ID token listener instance for a given app. * @param {string} appName - The name of the app to get the auth instance for. * @returns {Promise} - Void promise. */ removeIdTokenListener(appName: string): void; forceRecaptchaFlowForTesting(): Promise; setAutoRetrievedSmsCodeForPhoneNumber(): Promise; setAppVerificationDisabledForTesting(): Promise; /** * Sign out the current user. * @param {string} appName - The name of the app to get the auth instance for. * @returns {Promise} - Void promise. */ signOut(appName: string): Promise; /** * Sign in anonymously. * @param {*} appName - The name of the app to get the auth instance for. * @returns */ signInAnonymously(appName: string): Promise; /** * Sign in with email and password. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} email - The email to sign in with. * @param {string} password - The password to sign in with. * @returns {Promise} - The result of the sign in. */ createUserWithEmailAndPassword(appName: string, email: string, password: string): Promise; /** * Sign in with email and password. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} email - The email to sign in with. * @param {string} password - The password to sign in with. * @returns {Promise} - The result of the sign in. */ signInWithEmailAndPassword(appName: string, email: string, password: string): Promise; /** * Check if a sign in with email link is valid * @param {string} appName - The name of the app to get the auth instance for. * @param {string} emailLink - The email link to sign in with. * @returns {boolean} - Whether the link is a valid sign in with email link. */ isSignInWithEmailLink(appName: string, emailLink: string): boolean; /** * Sign in with email link. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} email - The email to sign in with. * @param {string} emailLink - The email link to sign in with. * @returns {Promise} - The result of the sign in. */ signInWithEmailLink(appName: string, email: string, emailLink: string): Promise; /** * Sign in with a custom token. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} token - The token to sign in with. * @returns {Promise} - The result of the sign in. */ signInWithCustomToken(appName: string, token: string): Promise; /** * Not implemented on web. */ revokeToken(): Promise; /** * Send a password reset email. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} email - The email to send the password reset email to. * @param {ActionCodeSettings} settings - The settings to use for the password reset email. * @returns {Promise} */ sendPasswordResetEmail(appName: string, email: string, settings?: ActionCodeSettings): Promise; /** * Send a sign in link to an email. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} email - The email to send the password reset email to. * @param {ActionCodeSettings} settings - The settings to use for the password reset email. * @returns {Promise} */ sendSignInLinkToEmail(appName: string, email: string, settings: ActionCodeSettings): Promise; /** * Delete the current user. * @param {string} appName - The name of the app to get the auth instance for. * @returns {Promise} */ deleteUser(appName: string): Promise; /** * Reload the current user. * @param {string} appName - The name of the app to get the auth instance for. * @returns {Promise} - The current user object. */ reload(appName: string): Promise; /** * Send a verification email to the current user. * @param {string} appName - The name of the app to get the auth instance for. * @param {ActionCodeSettings} actionCodeSettings - The settings to use for the email verification. * @returns {Promise} - The current user object. */ sendEmailVerification(appName: string, actionCodeSettings?: ActionCodeSettings | null): Promise; /** * Verify the email before updating it. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} email - The email to verify. * @param {ActionCodeSettings} actionCodeSettings - The settings to use for the email verification. * @returns {Promise} - The current user object. */ verifyBeforeUpdateEmail(appName: string, email: string, actionCodeSettings?: ActionCodeSettings | null): Promise; /** * Update the current user's email. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} email - The email to update. * @returns {Promise} - The current user object. */ updateEmail(appName: string, email: string): Promise; /** * Update the current user's password. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} password - The password to update. * @returns {Promise} - The current user object. */ updatePassword(appName: string, password: string): Promise; /** * Update the current user's phone number. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} provider - The provider to update the phone number with. * @param {string} authToken - The auth token to update the phone number with. * @param {string} authSecret - The auth secret to update the phone number with. * @returns {Promise} - The current user object. */ updatePhoneNumber(appName: string, provider: string, authToken: string, authSecret?: string | null): Promise; /** * Update the current user's profile. * @param {string} appName - The name of the app to get the auth instance for. * @param {object} props - The properties to update. * @returns {Promise} - The current user object. */ updateProfile(appName: string, props: { displayName?: string | null; photoURL?: string | null; }): Promise; /** * Sign in with a credential. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} provider - The provider to sign in with. * @param {string} authToken - The auth token to sign in with. * @param {string} authSecret - The auth secret to sign in with. * @returns {Promise} - The result of the sign in. */ signInWithCredential(appName: string, provider: string, authToken: string, authSecret?: string | null, _fullName?: object | null): Promise; signInWithProvider(): Promise; signInWithPhoneNumber(): Promise; /** * Get a multi-factor session. * @param {string} appName - The name of the app to get the auth instance for. * @returns {Promise} - The session ID. */ getSession(appName: string): Promise; verifyPhoneNumberWithMultiFactorInfo(): Promise; verifyPhoneNumberForMultiFactor(): Promise; finalizeMultiFactorEnrollment(): Promise; resolveMultiFactorSignIn(): Promise; resolveTotpSignIn(): Promise; confirmationResultConfirm(): Promise; verifyPhoneNumber(): Promise; /** * Confirm the password reset code. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} code - The code to confirm. * @param {string} newPassword - The new password to set. * @returns {Promise} */ confirmPasswordReset(appName: string, code: string, newPassword: string): Promise; /** * Apply an action code. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} code - The code to apply. * @returns {Promise} - Void promise. */ applyActionCode(appName: string, code: string): Promise; /** * Check an action code. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} code - The code to check. * @returns {Promise} - The result of the check. */ checkActionCode(appName: string, code: string): Promise<{ operation: "EMAIL_SIGNIN" | "PASSWORD_RESET" | "RECOVER_EMAIL" | "REVERT_SECOND_FACTOR_ADDITION" | "VERIFY_AND_CHANGE_EMAIL" | "VERIFY_EMAIL"; data: { email: string | null | undefined; fromEmail: string | null | undefined; }; }>; /** * Link a credential to the current user. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} provider - The provider to link. * @param {string} authToken - The auth token to link. * @param {string} authSecret - The auth secret to link. * @returns {Promise} - The current user object. */ linkWithCredential(appName: string, provider: string, authToken: string, authSecret?: string | null): Promise; linkWithProvider(): Promise; /** * Unlink a provider from the current user. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} providerId - The provider ID to unlink. * @returns {Promise} - The current user object. */ unlink(appName: string, providerId: string): Promise; /** * Reauthenticate with a credential. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} provider - The provider to reauthenticate with. * @param {string} authToken - The auth token to reauthenticate with. * @param {string} authSecret - The auth secret to reauthenticate with. * @returns {Promise} - The current user object. */ reauthenticateWithCredential(appName: string, provider: string, authToken: string, authSecret?: string | null): Promise; reauthenticateWithProvider(): Promise; /** * Get the ID token for the current user. * @param {string} appName - The name of the app to get the auth instance for. * @param {boolean} forceRefresh - Whether to force a token refresh. * @returns {Promise} - The ID token. */ getIdToken(appName: string, forceRefresh: boolean): Promise; /** * Get the ID token result for the current user. * @param {string} appName - The name of the app to get the auth instance for. * @param {boolean} forceRefresh - Whether to force a token refresh. * @returns {Promise} - The ID token result. */ getIdTokenResult(appName: string, forceRefresh: boolean): Promise<{ authTime: string; expirationTime: string; issuedAtTime: string; claims: firebaseAuthModule.ParsedToken; signInProvider: string | null; token: string; } | null>; /** * Get a MultiFactorResolver from the underlying SDK * @param {*} _appName the name of the app to get the auth instance for * @param {*} uid the uid of the TOTP MFA attempt * @param {*} code the code from the user TOTP app * @return TotpMultiFactorAssertion to use for resolving */ assertionForSignIn(_appName: string, uid: string, code: string): firebaseAuthModule.TotpMultiFactorAssertion; /** * Get a MultiFactorResolver from the underlying SDK * @param {*} appName the name of the app to get the auth instance for * @param {*} error the MFA error returned from initial factor login attempt * @return MultiFactorResolver to use for verifying the second factor */ getMultiFactorResolver(appName: string, error: MultiFactorError): MultiFactorResolver | null; /** * generate a TOTP secret * @param {*} _appName - The name of the app to get the auth instance for. * @param {*} session - The MultiFactorSession to associate with the secret * @returns object with secretKey to associate with TotpSecret */ generateTotpSecret(_appName: string, session: string): Promise<{ secretKey: string; }>; /** * unenroll from TOTP * @param {*} appName - The name of the app to get the auth instance for. * @param {*} enrollmentId - The ID to associate with the enrollment * @returns */ unenrollMultiFactor(appName: string, enrollmentId: string): Promise; /** * finalize a TOTP enrollment * @param {*} appName - The name of the app to get the auth instance for. * @param {*} secretKey - The secretKey to associate native TotpSecret * @param {*} verificationCode - The TOTP to verify * @param {*} displayName - The name to associate as a hint * @returns */ finalizeTotpEnrollment(appName: string, secretKey: string, verificationCode: string, displayName?: string | null): Promise; /** * generate a TOTP QR Code URL * @param {*} _appName - The name of the app to get the auth instance for. * @param {*} secretKey - The secretKey to associate with the TotpSecret * @param {*} accountName - The account name to use in auth app * @param {*} issuer - The issuer to use in auth app * @returns QR Code URL */ generateQrCodeUrl(_appName: string, secretKey: string, accountName?: string, issuer?: string): string; /** * open a QR Code URL in an app directly * @param {*} appName - The name of the app to get the auth instance for. * @param {*} qrCodeUrl the URL to open in the app, from generateQrCodeUrl * @throws Error not supported in this environment */ openInOtpApp(): Promise; /** * Fetch the sign in methods for an email. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} email - The email to fetch the sign in methods for. * @returns {Promise} - The sign in methods for the email. */ fetchSignInMethodsForEmail(appName: string, email: string): Promise; /** * Set the language code. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} code - The language code to set. * @returns {void} */ setLanguageCode(appName: string, code: string | null): Promise; /** * Set the tenant ID. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} tenantId - The tenant ID to set. * @returns {void} */ setTenantId(appName: string, tenantId: string | null): Promise; /** * Use the device language. * @param {string} appName - The name of the app to get the auth instance for. * @returns void */ useDeviceLanguage(appName: string): Promise; /** * Verify the provided password reset code. * @returns {string} - The users email address if valid. */ verifyPasswordResetCode(appName: string, code: string): Promise; /** * Connect to the auth emulator. * @param {string} appName - The name of the app to get the auth instance for. * @param {string} host - The host to use for the auth emulator. * @param {number} port - The port to use for the auth emulator. * @returns {void} */ useEmulator(appName: string, host: string, port: number): Promise; APP_LANGUAGE: Record; APP_USER: Record; }; export default _default; //# sourceMappingURL=RNFBAuthModule.d.ts.map