import type { StoryboardEnvironment } from './designImport.js'; /** * One value of a catalog condition axis. * * The environment is what the value means to the browser: boot storage, * permissions, devices, an opaque screen preset. It is merged into the * storyboard baseline, so every capture fingerprint, flow session and * Application run re-resolves under it. An option without an environment is a * pure catalog choice and leaves existing capture identities untouched. */ export interface CatalogConditionAxisOptionDef { value: string; label: string; description?: string; environment?: StoryboardEnvironment; } /** * One independent condition the whole catalog can be seen under. * * A session preset is a single runtime choice; a preview environment control * dresses only the live preview. Products also have flags that cut across both: * a color scheme, an account level, a feature entitlement. Each is its own axis * with stable value ids. Screens say in `conditions` which values they exist * under; a screen that names no axis exists under every value of it. * * Without `defaultValue` an unselected axis constrains nothing, the same way the * legacy "Default" session shows every runtime. With one, the default is the * effective value from the start. */ export interface CatalogConditionAxisDef { id: string; label: string; description?: string; defaultValue?: string; options: readonly CatalogConditionAxisOptionDef[]; } /** Explicit selections only; defaults stay implicit. */ export type CatalogConditionSelections = Readonly>; /** Values, per axis id, a screen exists under. Absent axes mean every value. */ export type ScreenConditionDeclaration = Readonly>; /** The part of `Storage` that keeps condition selections across reloads. */ export interface ConditionSelectionStorage { getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * One editor's declared condition axes, the explicit selections, and the * environment they contribute to the storyboard baseline. * * Explicit selections persist per declaration: a reload shows the catalog under * the conditions the viewer chose, not silently under the defaults again. A * stored value the declaration does not offer is ignored. */ export declare function createConditionAxes(deps: { setStoryboardBaselineEnvironment(environment?: StoryboardEnvironment): void; /** Where selections survive a reload; the browser's local storage by default, `null` for none. */ storage?: ConditionSelectionStorage | null; }): { setConditionAxes: (next: readonly CatalogConditionAxisDef[]) => void; getConditionAxes: () => readonly CatalogConditionAxisDef[]; getConditionAxisValue: (axisId: string) => string | null | undefined; getConditionAxisSelections: () => CatalogConditionSelections; selectConditionAxisValue: (axisId: string, value: string | null) => void; clearConditionAxisSelections: () => void; getConditionAxesEnvironment: () => StoryboardEnvironment | undefined; isInSelectedConditions: (conditions: ScreenConditionDeclaration | undefined) => boolean; conditionDeclarationIssues: (conditions: ScreenConditionDeclaration | undefined) => string[]; subscribeConditionAxes: (listener: () => void) => () => void; getConditionAxesRevision: () => number; }; export type ConditionAxes = ReturnType;