UNPKG

@vegajs/storage

Version:

A flexible and type-safe storage service adapter for TypeScript and JavaScript. Supports various storage mechanisms like localStorage, query strings, and mock storage with both asynchronous and synchronous APIs.

13 lines (12 loc) 540 B
import type { StorageService as IStorageService } from './types'; export declare class StorageService implements IStorageService { #private; constructor(adapter: IStorageService); getItem<Value = unknown>(key: string): Promise<Value | null>; getItemSync<Value = unknown>(key: string): Value | null; setItem<Value = unknown>(key: string, value: Value): Promise<void>; setItemSync<Value = unknown>(key: string, value: Value): void; clearItem(key: string): void; clear(): void; has(key: string): boolean; }