UNPKG

@blinkk/editor

Version:

Structured content editor with live previews.

28 lines (27 loc) 936 B
/** * Utility for working with different storages. * * Built-in 'in-memory' storage fallback. */ export declare class DataStorage { protected storage?: Storage; clear(): void; get length(): number; get storageObj(): Storage; getItem(key: string): string | null; getItemArray(key: string): Array<any>; getItemBoolean(key: string, defaultValue?: boolean): boolean; getItemRecord(key: string): Record<string, any>; key(index: number): string | null; removeItem(key: string): void; setItem(key: string, value: string): void; setItemArray(key: string, value: Array<any>): void; setItemBoolean(key: string, value: boolean): void; setItemRecord(key: string, value: Record<string, any>): void; } export declare class LocalDataStorage extends DataStorage { get storageObj(): Storage; } export declare class SessionDataStorage extends DataStorage { get storageObj(): Storage; }