import { type NodeSelector } from './nodeSelector.js'; import type { RegistryPropValue } from './registry.js'; import type { NodeModel, PageModel } from './store.js'; export interface ScreenDimensionOption { label: string; props: Readonly>; } export interface ScreenDimensionDef { id: string; label: string; /** Registry adapter that renders every state of this piece. */ component: string; /** Enum axis: an existing registry prop (options come from the registry). */ prop?: string; /** Dictionary axis: named cases mapped onto adapter props. */ options?: readonly ScreenDimensionOption[]; /** * Raw-node matcher: the captured stand-in this dimension adopts. Class * matching uses the css-module prefix (`_bar_`), which survives hash * churn; testId matches `data-testid`. */ match: NodeSelector; /** Product source the branch scanner validates this declaration against. */ sourcePath?: string; } /** Panel controls a single declaration may open. */ export declare const MAX_DIMENSION_MATCHES = 24; export interface ScreenDimensionDiagnostic { severity: 'error' | 'warning'; dimensionId: string; message: string; } /** One discovered branch from the node-side component scanner. */ export interface ComponentBranch { kind: 'conditional' | 'enum'; condition: string; element?: string; renders?: string; values?: readonly string[]; line?: number; } /** * Validates dimension declarations against the registry and the component * branch scans: the adapter and its axis must exist, and every dictionary * option should correspond to a branch discovered in the declared source. */ export declare function validateScreenDimensions(dimensions: readonly ScreenDimensionDef[], context: { registry: Readonly>; }>>; scansBySource?: Readonly>; }): ScreenDimensionDiagnostic[]; export declare function nodeMatchesDimension(node: NodeModel, dimension: ScreenDimensionDef): boolean; /** Every matching node in document order (adopted instances included). */ export declare function findDimensionNodes(page: PageModel, dimension: ScreenDimensionDef): NodeModel[]; /** First matching node (adopted adapter instance or raw captured stand-in). */ export declare function findDimensionNode(page: PageModel, dimension: ScreenDimensionDef): NodeModel | null; /** Props payload for a chosen dimension value. */ export declare function dimensionPropsForValue(dimension: ScreenDimensionDef, value: string): Readonly> | null; /** Current value of a dimension on a node, or null for the captured state. */ export declare function dimensionValueOfNode(dimension: ScreenDimensionDef, node: NodeModel): string | null; /** One editor's declared screen dimensions. */ export declare function createScreenDimensions(): { setScreenDimensions: (dimensions: readonly ScreenDimensionDef[]) => void; getScreenDimensions: () => readonly ScreenDimensionDef[]; }; export type ScreenDimensions = ReturnType;