@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
38 lines • 1.35 kB
TypeScript
/**
* Versioned localStorage utility for Plasma.
*
* All Plasma data is stored under a single `"plasma"` key with the shape:
* ```json
* {
* "storage-version": 1,
* "storage": {
* "table": {
* "my-table": { "columnVisibility": { ... } }
* }
* }
* }
* ```
*/
export declare const STORAGE_KEY = "plasma";
export declare const CURRENT_STORAGE_VERSION = 1;
/**
* Read a value from the versioned Plasma storage at the given path.
*
* @param path - Path segments within `storage`, e.g. `['table', 'my-table', 'columnVisibility']`.
* @returns The stored value, or `null` if it doesn't exist or the storage is corrupted.
*/
export declare const getStorageItem: <T = unknown>(path: string[]) => T | null;
/**
* Write a value to the versioned Plasma storage at the given path.
*
* @param path - Path segments within `storage`, e.g. `['table', 'my-table', 'columnVisibility']`.
* @param value - The value to store (must be JSON-serializable).
*/
export declare const setStorageItem: <T = unknown>(path: string[], value: T) => void;
/**
* Remove a value from the versioned Plasma storage at the given path.
*
* @param path - Path segments within `storage`, e.g. `['table', 'my-table', 'columnVisibility']`.
*/
export declare const removeStorageItem: (path: string[]) => void;
//# sourceMappingURL=local-storage.d.ts.map