import { type BapMasterBackup } from "bitcoin-backup";
import type { WalletUserExtension } from "../components/wallet/types/extended-user.js";
import type { AuthActions, AuthEvent, AuthState, BitcoinAuthConfig, OAuthProvider } from "../lib/types.js";
export declare class AuthManager {
    private config;
    private persistentStorage;
    private sessionStorage;
    private storageKeys;
    private listeners;
    private state;
    constructor(config: BitcoinAuthConfig);
    subscribe(listener: (event: AuthEvent) => void): () => void;
    private emit;
    getState(): AuthState;
    private checkExistingBackup;
    signIn(password: string): Promise<void>;
    signUp(password: string): Promise<void>;
    signOut(): Promise<void>;
    generateBackup(): BapMasterBackup;
    storeGeneratedBackupForSignup(backup: BapMasterBackup): Promise<void>;
    importBackup(file: File): Promise<void>;
    private isBase64String;
    private isValidWif;
    private isValidBackupFormat;
    validatePassword(password: string): Promise<boolean>;
    linkOAuth(provider: OAuthProvider): Promise<void>;
    handleOAuthCallback(provider: OAuthProvider, success: boolean): Promise<void>;
    private decryptBackup;
    private createSession;
    private validateBackupType;
    private createSessionFromBapMaster;
    private createSessionFromOneSat;
    private createSessionFromBapMember;
    private createSessionFromWif;
    private checkWalletCapabilities;
    hasUnencryptedBackupInSession(): Promise<boolean>;
    isSessionBackupImported(): Promise<boolean>;
    hasEncryptedBackupStored(): Promise<boolean>;
    getWalletExtension(): Promise<WalletUserExtension | null>;
    private createError;
    private createBackendError;
    private normalizeError;
    getActions(): AuthActions;
}
export declare function createAuthManager(config: BitcoinAuthConfig): AuthManager;
//# sourceMappingURL=AuthManager.d.ts.map