/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { MaybePromise } from "../util/Promises.js"; import type { BaseStorageDriver } from "./BaseStorageDriver.js"; /** * Interface for legacy storage drivers that support reading blob data alongside KV data. * Used during cross-type kv→blob migration to extract blobs from old combined drivers. */ export interface LegacyBlobSource { openBlob(contexts: string[], key: string): MaybePromise; } /** * Type-aware storage migrator. Handles KV-to-KV, blob-to-blob, and the legacy KV-to-blob cross-type * migration (extracting blob data from old combined KV+blob drivers). * * It does not modify or remove source data. */ export declare namespace StorageMigration { interface MigrationSkipped { contexts: string[]; key: string; error: string; } interface MigrationResult { success: boolean; migratedCount: number; skippedCount: number; otherTypeKeysSkipped: number; skippedItems: MigrationSkipped[]; } /** * Migrate storage from `source` to `target`. The migration strategy is determined by the * drivers' {@link BaseStorageDriver.storageType storageType}: * * - **kv → kv**: copies KV data via `get`/`set`, skips blob remnants (undefined-value keys) * - **blob → blob**: copies blobs via `openBlob`/`writeBlobFromStream` * - **kv → blob**: cross-type extraction — reads blob data from a legacy KV driver that stored * blobs alongside KV data (e.g. old `FileStorageDriver`). Keys where `get()` returns a value * are skipped (they're KV, not blobs). Keys where `get()` returns `undefined` are treated as * blobs and streamed to the blob target. * - **blob → kv**: not supported — throws */ function migrate(source: BaseStorageDriver, target: BaseStorageDriver): Promise; /** * Export migration result to log */ function resultToLog(result: MigrationResult): string; } //# sourceMappingURL=StorageMigration.d.ts.map