import type { UserPreferences } from './user-preferences'; export type PersistenceAPI = { /** * Get the initial user preferences synchronously * This function is called on initialization * If not provided, loadUserPreferences will be called instead * @param userPreferences * @returns */ getInitialUserPreferences?: () => UserPreferences | undefined; /** * Loads the user preferences * @returns */ loadUserPreferences: () => Promise; /** * Update a single user preference * @param key * @param value * @returns */ updateUserPreference: (key: K, value: UserPreferences[K]) => Promise>; };