2020-08-19 03:08:58 +00:00
|
|
|
import {StringUnion} from 'app/common/StringUnion';
|
|
|
|
|
|
|
|
export const SortPref = StringUnion("name", "date");
|
|
|
|
export type SortPref = typeof SortPref.type;
|
|
|
|
|
|
|
|
export const ViewPref = StringUnion("list", "icons");
|
|
|
|
export type ViewPref = typeof ViewPref.type;
|
|
|
|
|
|
|
|
|
2020-08-04 15:52:56 +00:00
|
|
|
// A collection of preferences related to a user or org (or combination).
|
|
|
|
export interface Prefs {
|
|
|
|
// TODO replace this with real preferences.
|
|
|
|
placeholder?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type UserPrefs = Prefs;
|
2020-08-19 03:08:58 +00:00
|
|
|
|
|
|
|
export interface UserOrgPrefs extends Prefs {
|
|
|
|
docMenuSort?: SortPref;
|
|
|
|
docMenuView?: ViewPref;
|
2020-09-10 02:48:11 +00:00
|
|
|
|
|
|
|
// List of example docs that the user has seen and dismissed the welcome card for.
|
|
|
|
// The numbers are the `id` from IExampleInfo in app/client/ui/ExampleInfo.
|
|
|
|
// By living in UserOrgPrefs, this applies only to the examples-containing org.
|
|
|
|
seenExamples?: number[];
|
2020-08-19 03:08:58 +00:00
|
|
|
}
|
|
|
|
|
2020-08-04 15:52:56 +00:00
|
|
|
export type OrgPrefs = Prefs;
|