@wizecorp/stratusjs
Version:
Stratus React Framework
42 lines • 1.31 kB
TypeScript
import type { StorageService as IStorageService } from '../types';
/**
* Storage service for client-side data persistence
*/
export declare class LocalStorageService implements IStorageService {
readonly name = "LocalStorageService";
private prefix;
constructor(prefix?: string);
get<T = any>(key: string): T | null;
set<T = any>(key: string, value: T): void;
remove(key: string): void;
clear(): void;
has(key: string): boolean;
private getKey;
}
/**
* Session storage service
*/
export declare class SessionStorageService implements IStorageService {
readonly name = "SessionStorageService";
private prefix;
constructor(prefix?: string);
get<T = any>(key: string): T | null;
set<T = any>(key: string, value: T): void;
remove(key: string): void;
clear(): void;
has(key: string): boolean;
private getKey;
}
/**
* In-memory storage service (for SSR or when storage is not available)
*/
export declare class MemoryStorageService implements IStorageService {
readonly name = "MemoryStorageService";
private storage;
get<T = any>(key: string): T | null;
set<T = any>(key: string, value: T): void;
remove(key: string): void;
clear(): void;
has(key: string): boolean;
}
//# sourceMappingURL=StorageService.d.ts.map