@optimizely/js-sdk-event-processor
Version:
Optimizely Full Stack Event Processor
34 lines (33 loc) • 814 B
TypeScript
export interface PendingEventsStore<K> {
get(key: string): K | null;
set(key: string, value: K): void;
remove(key: string): void;
values(): K[];
clear(): void;
replace(newMap: {
[key: string]: K;
}): void;
}
interface StoreEntry {
uuid: string;
timestamp: number;
}
export declare class LocalStorageStore<K extends StoreEntry> implements PendingEventsStore<K> {
protected LS_KEY: string;
protected maxValues: number;
constructor({ key, maxValues }: {
key: string;
maxValues?: number;
});
get(key: string): K | null;
set(key: string, value: K): void;
remove(key: string): void;
values(): K[];
clear(): void;
replace(map: {
[key: string]: K;
}): void;
private clean;
private getMap;
}
export {};