import type { Openfort, RecoveryParams } from '@openfort/openfort-js'; /** Outcome of asking the signer to hold an account. */ export type EnsureEmbeddedSignerResult = /** The signer already held the account; nothing was recovered. */ 'already-held' /** The account was recovered into the signer. */ | 'recovered' /** Recovery needs a credential the caller has to collect first (a password). */ | 'needs-credential'; type EnsureEmbeddedSignerParameters = { client: Openfort; /** Embedded account that must end up held by the signer. */ accountId: string; /** * Produces the credential for this account, or `null` when the caller cannot * supply one yet. Invoked only when a recovery is actually going to run, so a * redundant request costs no encryption session and no WebAuthn ceremony. */ buildRecoveryParams: () => Promise; /** * Rejects work reserved by a wallet session that is no longer current. Called * after every await that precedes the recovery, so a target that changed while * the credential was being built cannot recover an account the user moved off. */ assertCurrent: () => void; }; /** * Brings the embedded signer to the point where it holds `accountId`. * * This is the only place that calls `embeddedWallet.recover()`, and * `recoveryOwner.test.ts` holds it to that. Recovery is requested from three * places on a single login — the provider's auto-recovery effect, the modal's * recover page through `setActive`, and the post-authentication connect path. * Each declares the account it wants held and this decides whether a recovery * is needed, so asking for an account the signer already holds is a no-op * rather than a second credential prompt. Every call derives its own * credential, which on a passkey account is a WebAuthn ceremony the user has to * answer. * * Callers must already hold the embedded-signer operation queue: this reads and * replaces the signer, and the queue is what keeps that ordered against other * signer work. Because that queue is strictly serial, two requests for the same * account cannot overlap — the second runs after the first has settled and sees * the account already held. * * @param parameters - Client, target account, and how to build its credential. * @returns Whether the account was already held, recovered, or still needs a credential. */ export declare function ensureEmbeddedSignerHolds(parameters: EnsureEmbeddedSignerParameters): Promise; export {};