import { StateRepository } from '../core'; /** * Handle fetching and saving user specific data, e.g. settings or other state * data that should persist between sessions * */ export interface UserDataRepository extends StateRepository { /** * Check if user data exists * * @param key name of the key containing the data * @returns true if user data exists */ has(key: string): boolean; /** * Get user data * * @param key name of the key containing the data * @returns the data */ get(key: string): T; /** * Set user data * * @param key name of the key for the data * @param data the data to save, will delete the data if undefined */ set(key: string, data?: T): void; }