@tanstack/offline-transactions
Version:
Offline-first transaction capabilities for TanStack DB
20 lines (19 loc) • 651 B
text/typescript
import { BaseStorageAdapter } from './StorageAdapter.cjs';
export declare class LocalStorageAdapter extends BaseStorageAdapter {
private prefix;
constructor(prefix?: string);
/**
* Probe localStorage availability by attempting a test write.
* This catches private mode and other restrictions that block localStorage.
*/
static probe(): {
available: boolean;
error?: Error;
};
private getKey;
get(key: string): Promise<string | null>;
set(key: string, value: string): Promise<void>;
delete(key: string): Promise<void>;
keys(): Promise<Array<string>>;
clear(): Promise<void>;
}