import { type ILogger } from '@dynamic-labs-wallet/core';
/** Predicate matching `retryPromise`'s `shouldRetry` option. */
type ShouldRetry = (error: unknown, attempt: number) => boolean | Promise<boolean>;
/**
 * Owns everything about signed sessions and their single-use replay nonces:
 * resolving a session from an explicit value or the host reverse channel,
 * deciding whether the SDK version requires one, and building the
 * refresh-on-replay-400 retry predicate shared by the backup and recovery
 * flows.
 *
 * Extracted from `DynamicWalletClient` so this logic can be exercised in
 * isolation. The host callback is read lazily (`getCallback`) so it stays in
 * sync with the owning client even if reassigned after construction.
 */
export declare class SignedSessionManager {
    private readonly logger;
    private readonly getCallback;
    private readonly required;
    constructor({ logger, sdkVersion, getCallback, }: {
        logger: ILogger;
        sdkVersion?: string;
        getCallback: () => (() => Promise<string>) | undefined;
    });
    /** True when a reverse channel is configured to mint fresh signed sessions. */
    get canRefresh(): boolean;
    /**
     * Resolves the signed session ID from an explicit value or falls back to the
     * host reverse channel. Throws if neither source provides a value.
     */
    resolve(signedSessionId?: string): Promise<string>;
    /** Whether the configured SDK version requires a signed session ID. */
    isRequired(): boolean;
    private computeIsRequired;
    /**
     * Builds a `retryPromise` `shouldRetry` predicate that refreshes a consumed
     * single-use nonce via the reverse channel on a replay 400 and retries once.
     * The signed session carries a single-use replay nonce: it is valid on its
     * first use, but once consumed (e.g. by a preceding operation) the server
     * rejects with a 400, at which point a fresh session is fetched and the call
     * retried. `alsoRetry` lets callers opt into additional retryable statuses
     * (e.g. 429 / 5xx) on top of the nonce refresh.
     */
    refreshShouldRetry({ onRefreshed, operationName, logContext, alsoRetry, }: {
        onRefreshed: (signedSessionId: string) => void;
        operationName: string;
        logContext?: Record<string, unknown>;
        alsoRetry?: (status: number | undefined) => boolean;
    }): ShouldRetry;
}
export {};
//# sourceMappingURL=signedSession.d.ts.map