/** * Represents a single grid track. * Can be a simple value like "1fr", "100px", "auto" * or a complex value like "minmax(100px, 1fr)" */ export type GridTrack = { /** The raw CSS value of the track */ value: string; }; /** * Parse a grid-template-columns or grid-template-rows value into an array of tracks. * * Handles: * - Simple values: "1fr", "100px", "auto", "min-content", "max-content" * - Functions: "minmax(100px, 1fr)", "fit-content(200px)" * - Repeat: "repeat(3, 1fr)" -> expands to ["1fr", "1fr", "1fr"] * - Line names: "[header] 1fr [content] 2fr" -> ignores line names, returns ["1fr", "2fr"] * * @param value - The CSS value string for grid-template-columns/rows * @returns Array of track values, or empty array if value is "none" or invalid */ export declare const parseGridTemplateTrackList: (value: string) => GridTrack[]; /** * Serialize an array of tracks back to a CSS value string. * * @param tracks - Array of track values * @returns CSS string like "1fr 100px auto" or "none" if empty */ export declare const serializeGridTemplateTrackList: (tracks: GridTrack[]) => string; /** * Represents a minmax() function with min and max values. */ export type Minmax = { min: string; max: string; }; /** * Parse a minmax() function value into its min and max parts. * Returns undefined if the value is not a valid minmax() function. * * @example * parseMinmax("minmax(100px, 1fr)") // { min: "100px", max: "1fr" } * parseMinmax("1fr") // undefined */ export declare const parseMinmax: (value: string) => Minmax | undefined; /** * Create a minmax() CSS value from min and max parts. * * @example * serializeMinmax({ min: "100px", max: "1fr" }) // "minmax(100px,1fr)" */ export declare const serializeMinmax: (minmax: Minmax) => string; /** * Result of checking if a grid template value is supported by the visual editor. */ export type GridTemplateSupport = { supported: true; } | { supported: false; reason: string; type: "subgrid" | "masonry" | "line-names" | "auto-fill" | "auto-fit"; }; /** * Check if a grid-template-columns or grid-template-rows value can be * represented and edited by the visual grid UI. * * Unsupported values: * - `subgrid` - requires dedicated UI * - `masonry` - experimental, not a track definition * - `repeat(auto-fill, ...)` / `repeat(auto-fit, ...)` - dynamic track count * - Line names like `[header]` - would be silently discarded on edit * * Note: CSS variables are supported - use computedValue which resolves them. * * @param value - The CSS value string for grid-template-columns/rows * @returns Object indicating if supported, with reason and type if not */ export declare const checkGridTemplateSupport: (value: string) => GridTemplateSupport; /** * Describes the mode of a grid axis (columns or rows). * * - "explicit": Regular explicit tracks (e.g., "1fr 2fr 100px") * - "auto-fill": Dynamic tracks via repeat(auto-fill, ...) * - "auto-fit": Dynamic tracks via repeat(auto-fit, ...) * - "auto": Single "auto" keyword - implicit tracks based on children * - "none": No explicit tracks defined * - "subgrid": Subgrid inherits tracks from parent * - "masonry": Experimental masonry layout * - "line-names": Has named grid lines like [header] */ export type GridAxisMode = "explicit" | "auto-fill" | "auto-fit" | "auto" | "none" | "subgrid" | "masonry" | "line-names"; /** * Analyze a grid template value to determine its mode. * * @param value - The CSS value string for grid-template-columns/rows * @returns The axis mode describing the type of grid track definition * * @example * getGridAxisMode("1fr 2fr 100px") // "explicit" * getGridAxisMode("repeat(auto-fill, minmax(200px, 1fr))") // "auto-fill" * getGridAxisMode("none") // "none" * getGridAxisMode("auto") // "auto" * getGridAxisMode("subgrid") // "subgrid" */ export declare const getGridAxisMode: (value: string) => GridAxisMode; /** * Check if a grid axis mode represents a dynamic/implicit grid that * requires DOM probing to determine actual track count. * * @param mode - The grid axis mode * @returns true if the mode requires DOM-based track counting */ export declare const isImplicitGridMode: (mode: GridAxisMode) => boolean; /** * Check if a grid axis mode is editable in the visual grid UI. * * @param mode - The grid axis mode * @returns true if the mode can be edited visually */ export declare const isEditableGridMode: (mode: GridAxisMode) => boolean; /** * Get a display label for a grid axis mode (for the grid generator). * * @param mode - The grid axis mode * @param trackCount - The actual track count (for explicit modes) * @returns Display string like "3", "auto-fit", "none" */ export declare const getGridAxisLabel: (mode: GridAxisMode, trackCount: number) => string;