gm-storage
Version:
An ES6 Map wrapper for the synchronous userscript storage API
11 lines (10 loc) • 523 B
TypeScript
import { GMStorageBase, type JSONValue, type Options } from './gm-storage-base.js';
export interface JSONKeyStoreOptions extends Options {
canonical?: boolean;
}
export declare const stringify: <T extends JSONValue = JSONValue>(value: T) => string;
export declare class JSONKeyStore<K extends JSONValue = JSONValue, V extends JSONValue = JSONValue> extends GMStorageBase<K, V> {
protected stringify: (value: K) => string;
constructor(options?: JSONKeyStoreOptions);
protected parse: (value: string) => K;
}