import type { WalletInterface } from '@bsv/sdk';
import type { ConnectWalletResult } from './connectWallet';
export type WalletSessionStatus = 'connected' | 'disconnected';
export type DisconnectReason = 'unauthenticated' | 'unavailable' | 'manual';
export interface WalletSessionOptions {
    /** How often to check auth + identity. Default 4000ms. */
    pollIntervalMs?: number;
}
export interface IdentityChangeEvent {
    previous: string;
    next: string;
}
export interface DisconnectedEvent {
    reason: DisconnectReason;
}
export interface WalletSession {
    readonly wallet: WalletInterface | null;
    readonly identityKey: string | null;
    readonly status: WalletSessionStatus;
    readonly provider: string | null;
    readonly disconnectReason: DisconnectReason | null;
    /** Start the poll loop (idempotent). No-op if already disconnected. */
    start(): void;
    /** Stop polling without clearing session state. */
    stop(): void;
    /** Stop polling, call provider disconnect, clear session, emit disconnected. */
    disconnect(reason?: DisconnectReason): void;
    on(event: 'identityChange', handler: (e: IdentityChangeEvent) => void): () => void;
    on(event: 'disconnected', handler: (e: DisconnectedEvent) => void): () => void;
    on(event: 'status', handler: (status: WalletSessionStatus) => void): () => void;
}
/**
 * Holds a connected BRC-100 wallet and watches for identity / auth changes.
 *
 * Polling is gated on `isAuthenticated` so a locked wallet does not trigger
 * unlock popups via `getPublicKey`. When auth is lost or the substrate fails,
 * the session disconnects and emits `disconnected`.
 */
export declare function createWalletSession(result: Pick<ConnectWalletResult, 'wallet' | 'identityKey' | 'provider' | 'disconnect'>, options?: WalletSessionOptions): WalletSession;
//# sourceMappingURL=walletSession.d.ts.map