import { WalletError } from '../../errors/wallet.js'; type OperationOwner = object; type OperationContext = { /** Publishes the latest observable value to every mounted consumer. */ publish: (snapshot: TSnapshot) => void; /** Reports whether the principal and retention window still own this operation. */ isCurrent: () => boolean; }; type PersistentOperationOptions = { owner: OperationOwner; key: string; /** Serializes mutually exclusive mutations that use different operation keys. */ lane?: string; principalIsCurrent: () => boolean; start: (context: OperationContext) => Promise; /** Time a settled result remains available for a remounted consumer. */ settledRetentionMs?: number; /** Stops restartable background work after its last observer leaves. */ orphanRetentionMs?: number; }; export type PersistentOperation = { promise: Promise; isCurrent: () => boolean; getSnapshot: () => TSnapshot | undefined; subscribe: (listener: (snapshot: TSnapshot) => void) => () => void; }; export declare class PersistentOperationLaneBusyError extends WalletError { readonly name = "PersistentOperationLaneBusyError"; constructor(); } /** Returns one client-scoped operation that a remounted page can observe again. */ export declare function getOrCreatePersistentOperation(options: PersistentOperationOptions): PersistentOperation; /** Removes settled work after its result has been consumed so an explicit retry starts fresh work. */ export declare function clearPersistentOperation(owner: OperationOwner, key: string): void; /** Invalidates every operation owned by a provider before its principal changes. */ export declare function invalidatePersistentOperations(owner: OperationOwner): void; /** Reports whether a remounted consumer can attach to an existing operation. */ export declare function hasPersistentOperation(owner: OperationOwner, key: string): boolean; /** Returns an existing operation without creating replacement work. */ export declare function getPersistentOperation(owner: OperationOwner, key: string): PersistentOperation | null; export {};