/** * Full wallet synchronization with remote backup server. * * Performs a complete resync: push local → reset sync state → full pull from server. * This is a deliberate user action (not automatic) for recovering from sync issues. */ import type { WalletStorageManager } from "@bsv/wallet-toolbox-mobile/out/src/index.client.js"; import type { sdk as mobileToolboxSdk } from "@bsv/wallet-toolbox-mobile/out/src/index.client.js"; type WalletStorageProvider = mobileToolboxSdk.WalletStorageProvider; export type FullSyncStage = "pushing" | "resetting" | "pulling" | "complete"; export interface FullSyncOptions { /** Local storage manager */ storage: WalletStorageManager; /** Remote backup storage provider (StorageClient) */ remoteStorage: WalletStorageProvider; /** Identity key for the wallet */ identityKey: string; /** Optional progress callback */ onProgress?: (stage: FullSyncStage, message: string) => void; /** Max rough size per chunk in bytes (default: 1MB) */ maxRoughSize?: number; /** Max items per chunk (default: 100) */ maxItems?: number; } export interface FullSyncResult { pushed: { inserts: number; updates: number; }; pulled: { inserts: number; updates: number; }; } /** * Perform a full sync with the remote backup server. * * Steps: * 1. Push all local data to remote backup * 2. Clear local syncMap / reset sync state * 3. Pull ALL data from server (not incremental) * 4. Rebuild complete server→client ID mappings * * @example * ```typescript * const result = await fullSync({ * storage, * remoteStorage: remoteClient, * identityKey: pubKey, * onProgress: (stage, msg) => console.log(`[${stage}] ${msg}`) * }); * console.log(`Pushed: ${result.pushed.inserts}/${result.pushed.updates}`); * console.log(`Pulled: ${result.pulled.inserts}/${result.pulled.updates}`); * ``` */ export declare function fullSync(options: FullSyncOptions): Promise; export {};