/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { StorageDriver } from "./StorageDriver.js"; import { SupportedStorageTypes } from "./StringifyTools.js"; /** * Async key-value interface that web-style storage backends must implement. * * Mirrors the subset of the `@react-native-async-storage/async-storage` v3 API that storage drivers actually use. */ export interface WebStorageProvider { getItem(key: string): Promise; setItem(key: string, value: string): Promise; removeItem(key: string): Promise; getAllKeys(): Promise; getMany(keys: string[]): Promise>; setMany(entries: Record): Promise; removeMany(keys: string[]): Promise; clear(): Promise; } /** * {@link StorageDriver} for web-style async key-value stores. * * Shared implementation for any backend that satisfies the {@link WebStorageProvider} interface (e.g. React Native * AsyncStorage v2/v3, browser localStorage wrapper, etc.). */ export declare class WebStorageDriver extends StorageDriver { #private; constructor(storage: WebStorageProvider); get initialized(): boolean; initialize(): void; close(): void; clear(): Promise; getContextBaseKey(contexts: string[]): string; buildStorageKey(contexts: string[], key: string): string; get(contexts: string[], key: string): Promise; set(contexts: string[], key: string, value: SupportedStorageTypes): Promise; set(contexts: string[], values: Record): Promise; delete(contexts: string[], key: string): Promise; keys(contexts: string[]): Promise; values(contexts: string[]): Promise>; contexts(contexts: string[]): Promise; clearAll(contexts: string[]): Promise; } //# sourceMappingURL=WebStorageDriver.d.ts.map