import { type AppBrand, type AppDensity, type AppFontSize, type AppTheme } from "./theme-axes.js"; import type { AppLocale, AppTimezone, AppTimeFormat, AppDateFormat } from "./types.js"; declare const DEFAULT_STORAGE_KEY = "godxjp.app"; export type StoredAppPreferences = { locale?: AppLocale; timezone?: AppTimezone; timeFormat?: AppTimeFormat; dateFormat?: AppDateFormat; theme?: AppTheme; /** `null` = explicit opt-out (keep app token); on read, null/invalid → undefined. */ brand?: AppBrand | null; density?: AppDensity; fontSize?: AppFontSize; /** Continuous global size multiplier; `null` defers to the density preset. */ scaling?: number | null; }; /** * The axes a viewer's preferences are made of — the keys of {@link StoredAppPreferences}. * * They do NOT share an owner. `theme`, `density`, `fontSize`, `scaling` and `brand` are the * viewer's, and belong in this browser. `locale`, `timezone`, `timeFormat` and `dateFormat` are * frequently the SERVER's — resolved per request from a cookie, an account row or an Accept-Language * header — and a copy in local storage then wins over the value the server just sent, because * storage is read after the props. That is why `persist` takes a LIST as well as a boolean: one * flag for axes with two different owners forces an all-or-nothing choice, and the consumer that * hits it turns persistence off entirely and loses the viewer's theme with it. */ export declare const APP_PREFERENCE_AXES: readonly ["locale", "timezone", "timeFormat", "dateFormat", "theme", "brand", "density", "fontSize", "scaling"]; export type AppPreferenceAxis = (typeof APP_PREFERENCE_AXES)[number]; /** `true` → every axis, `false` → none, a list → exactly those. */ export declare function resolvePersistedAxes(persist: boolean | readonly AppPreferenceAxis[]): ReadonlySet; /** The subset of `preferences` on the given axes; the rest are dropped, not set to undefined. */ export declare function pickPersistedAxes(preferences: StoredAppPreferences, axes: ReadonlySet): StoredAppPreferences; export declare function readStoredPreferences(storageKey: string): StoredAppPreferences; export declare function writeStoredPreferences(storageKey: string, preferences: StoredAppPreferences): void; export { DEFAULT_STORAGE_KEY };