const PREFIX = "bluebell"; function defineScope(scope: S, keys: K) { const entries = keys.map((key) => { const value = `${PREFIX}:${scope}:${key.toLowerCase().replace(/_/g, "-")}`; return [key, value] as const; }); return Object.fromEntries(entries) as { [P in K[number]]: `${typeof PREFIX}:${S}:${Lowercase}`; }; } export const KEYS = { THEME: defineScope("theme", [ "ACCENT_COLOURS", // map of themeIds to accent colours "PREFERRED_DARK", // preferred dark theme id "PREFERRED_LIGHT", // preferred light theme id "USE_SYSTEM", // whether to use the system theme or not, boolean "THEME_ID", // the currently selected theme id, if USE_SYSTEM is false ]), OAUTH: defineScope("oauth", [ "ACTIVE_DID", // the currently active did, if any "ACCOUNTS", // list of dids that have been authenticated with ]), STATE: defineScope("state", ["ACTIVE_FEED_URI"]), }; export default KEYS;