import { AuthenticationResultType, CognitoIdentityProviderClient, InitiateAuthResponse } from '@aws-sdk/client-cognito-identity-provider'; export type MfaMethod = 'authenticator' | 'sms'; export type LoggedInMfaMethod = 'SOFTWARE_TOKEN_MFA' | 'SMS_MFA' | 'NO_MFA_ENABLED'; export type MfaSettings = { loggedInWithMfaMethod: LoggedInMfaMethod; authenticator: { enabled: boolean; preferred: boolean; }; sms: { enabled: boolean; preferred: boolean; phoneNumber: string | undefined; isPhoneNumberVerified: boolean; }; }; export declare const DEFAULT_MFA_SETTINGS: MfaSettings; export declare function resolveLoggedInMfaMethod(idToken: string | undefined): LoggedInMfaMethod; export declare function resolveMfaPreferredFlags({ authenticatorEnabled, smsEnabled, preferredMfaSetting, }: { authenticatorEnabled: boolean; smsEnabled: boolean; preferredMfaSetting: string | undefined; }): { authenticatorPreferred: boolean; smsPreferred: boolean; }; export type LoginAttemptMfa = { method: MfaMethod; codeCallback: (code: string) => Promise; resendCodeCallback?: () => Promise; }; export type LoginAttemptResponse = { resetPasswordCallback?: (newPassword: string) => Promise; mfa?: LoginAttemptMfa; }; export default class AWSCognitoClient { clientId: string; cognitoIdentityProviderClient: CognitoIdentityProviderClient; loginDomain: string | void; redirectUri: string | void; logoutUri: string | void; listeners: Array<() => unknown>; constructor({ clientId, region, loginDomain, redirectUri, logoutUri, }: { clientId: string; region: string; redirectUri?: string; logoutUri?: string; loginDomain?: string; }); get EXPIRES_AT(): string; get ACCESS_TOKEN(): string; get ID_TOKEN(): string; get REFRESH_TOKEN(): string; get STATE(): string; get PKCE_CODE_VERIFIER(): string; _executeListeners(): void; _storeAuthenticationResult(authenticationResult: AuthenticationResultType): void; _removeAuthenticationResult(): void; _getAccessToken(): string | undefined; _getIdToken(): string | undefined; _getRefreshToken(): string | undefined; _isSessionValid(): boolean; _refreshSession(): Promise; registerListener(listener: () => unknown): () => void; responseToAuthChallenge(username: string, initiateAuthResponse: InitiateAuthResponse, password?: string): Promise; loginUsernamePassword(username: string, password: string): Promise; loginHostedUI(identityProviderName?: string): Promise; handleAuthentication(): Promise; changePassword(existingPassword: string, newPassword: string): Promise; confirmForgotPassword({ username, code, password, }: { username: string; code: string; password: string; }): Promise; logoutHostedUI(): void; logout(): Promise; getIdToken(): Promise; getAccessToken(): Promise; getMfaSettings(abortSignal?: AbortSignal): Promise; updateUserPhoneNumber(phoneNumber: string): Promise<{ isPhoneNumberVerified: boolean; }>; removeUserPhoneNumber(): Promise; verifyUserPhoneNumber(code: string): Promise; setPreferredMfaMethod(method: MfaMethod): Promise; disableMfaMethod(method: MfaMethod): Promise; setupSmsMfa({ preferred }?: { preferred?: boolean; }): Promise; setupMfaAuthenticatorApp({ preferred }?: { preferred?: boolean; }): Promise<{ secretCode: string | undefined; mfaCodeCallback: (code: string) => Promise; } | undefined>; }