import type { sdk } from "@bsv/wallet-toolbox-mobile/out/src/index.client.js"; import type { TableSettings } from "@bsv/wallet-toolbox-mobile/out/src/storage/schema/tables/TableSettings.js"; import type { Unzipped } from "fflate"; import type { BackupManifest } from "./types"; type RequestSyncChunkArgs = sdk.RequestSyncChunkArgs; type SyncChunk = sdk.SyncChunk; type WalletStorageSyncReader = sdk.WalletStorageSyncReader; /** * FileRestoreReader implements WalletStorageSyncReader to serve sync chunks * from a previously exported backup ZIP file during wallet restore. * * Usage: * 1. Unzip the backup file with fflate.unzip() * 2. Read and parse manifest.json * 3. Create FileRestoreReader with unzipped data and manifest * 4. Call storage.syncFromReader(identityKey, reader) * 5. Reader serves chunks sequentially via getSyncChunk() * * @example * ```typescript * import { unzip } from 'fflate'; * * const zipData = new Uint8Array(await file.arrayBuffer()); * const unzipped = await new Promise((resolve, reject) => { * unzip(zipData, (err, data) => err ? reject(err) : resolve(data)); * }); * * const manifest = JSON.parse( * new TextDecoder().decode(unzipped['manifest.json']) * ); * * const reader = new FileRestoreReader(unzipped, manifest); * await storage.syncFromReader(manifest.identityKey, reader); * ``` */ export declare class FileRestoreReader implements WalletStorageSyncReader { private unzipped; private manifest; private currentChunkIndex; private settings; constructor(unzipped: Unzipped, manifest: BackupManifest); /** * Get the backup manifest. */ getManifest(): BackupManifest; /** * Reset the reader to start from the beginning. * Call this if you need to re-read the backup. */ reset(): void; makeAvailable(): Promise; /** * Returns sync chunks sequentially from the backup. * When all chunks are consumed, returns an empty chunk to signal completion. */ getSyncChunk(args: RequestSyncChunkArgs): Promise; } export {};