export type UserPreferences = { toolbarDockingInitialPosition?: 'top' | 'none' | null; }; export interface UserPreferencesProvider { /** * get a user preference, Note that this function is a not async function, * meaning that consumers should prefetch the user preference and make it available initially * @param key */ getPreference: (key: K) => UserPreferences[K] | undefined | null; /** * This method fetches the latest user preferences * @returns a promise that resolves with the user preferences, or rejects if error occurs */ loadPreferences: () => Promise; /** * This method updates a user preference * @param key * @param value * @returns a promise that resolves when the preference is updated, or rejects if the update fails */ updatePreference: (key: K, value: UserPreferences[K]) => Promise; }