agentscape
Version:
Agentscape is a library for creating agent-based simulations. It provides a simple API for defining agents and their behavior, and for defining the environment in which the agents interact. Agentscape is designed to be flexible and extensible, allowing
21 lines (20 loc) • 631 B
TypeScript
/**
* A key-value store that persists data using local storage.
*/
export default class LocalStoreContext {
private context;
private contextNamespace;
constructor(contextName: string);
/**
* Set a value in local storage.
* @param key The key to store the value under.
* @param value The value to store.
*/
set(key: string, value: string | number | boolean, valueType: 'string' | 'number' | 'boolean'): void;
get(key: string): string | number | boolean;
remove(key: string): void;
length(): number;
clear(): void;
private rehydrateContext;
private persistContext;
}