import type { Openfort } from '@openfort/openfort-js'; import { WalletNotConnectedError } from '../../errors/wallet.js'; declare class EmbeddedSignerOperationInvalidatedError extends WalletNotConnectedError { } declare class EmbeddedSignerOperationTimeoutError extends WalletNotConnectedError { } /** Identifies the bounded-wait failure so callers can offer a retry. */ export declare function isEmbeddedSignerOperationTimeoutError(error: unknown): error is EmbeddedSignerOperationTimeoutError; export type EmbeddedSignerOperationContext = { /** Throws when the wallet session that reserved the operation is no longer current. */ assertCurrent: () => void; }; /** Captures the current wallet session so async preparation cannot cross an auth boundary unnoticed. */ export declare function captureEmbeddedSignerSession(client: Openfort): EmbeddedSignerOperationContext; /** Reserves client-wide ownership of the next embedded-wallet state publication. */ export declare function reserveEmbeddedSignerPublication(client: Openfort): () => boolean; /** Identifies queue invalidation without conflating it with other wallet connection failures. */ export declare function isEmbeddedSignerOperationInvalidationError(error: unknown): error is EmbeddedSignerOperationInvalidatedError; /** * Prevents signer operations reserved in the current session from starting. * * Deliberately leaves the publication generation alone. The publication token * gates the caller's own `onError` as well as state writes, so retiring it here * would swallow the invalidation error the operation still owes whoever started * it. Keeping a stale success out of a later session is the state layer's job, * not the queue's. */ export declare function invalidateEmbeddedSignerOperations(client: Openfort): void; /** * Keeps signer work reserved during a credential transition behind a barrier, * then invalidates that work before the barrier opens. */ export declare function holdEmbeddedSignerOperationsDuringAuthTransition(client: Openfort, transition: Promise): void; /** * Serializes operations that read or replace one Openfort client's embedded signer. * * React hooks can be mounted more than once, so the queue is keyed by the client * rather than stored in one hook instance. The queue is intentionally non-reentrant: * an atomic operation that already holds it uses the raw provider from the client, * while public serialized providers acquire the queue for their own requests. */ export declare function runEmbeddedSignerOperation(client: Openfort, operation: (context: EmbeddedSignerOperationContext) => Promise): Promise; export {};