import type { Columns, GridDefaults, GridEntry, GridState, Mode, Rows } from "../types"; /** * Generates the `grid-template-columns` CSS string based on the column definitions. * Handles hiding handles for collapsed columns. * * @param groups - The list of columns. * @param handleSize - The size of the resize handle (default: "1rem"). * @returns A CSS string for `grid-template-columns`. */ export declare let getGridTemplateColumns: (groups: Columns, handleSize?: string) => string; /** * Calculates the `grid-column` CSS property for a specific column index. * Accounts for the fact that handles are inserted between columns. * * @param start - The 1-based start index of the column. * @param end - The 1-based end index of the column. * @returns A CSS string for `grid-column` (e.g., "1 / 3"). */ export declare let getGridColumn: (start: number, end: number) => string; /** * Calculates the `grid-column` CSS property for a resize handle. * * @param index - The 0-based index of the handle. * @returns A CSS string for `grid-column`. */ export declare let getGridColumnHandle: (index: number) => string; /** * Generates the `grid-template-rows` CSS string based on the row definitions. * Handles hiding handles for collapsed rows. * * @param groups - The list of rows. * @param handleSize - The size of the resize handle (default: "1rem"). * @returns A CSS string for `grid-template-rows`. */ export declare let getGridTemplateRows: (groups: Rows, handleSize?: string) => string; /** * Calculates the `grid-row` CSS property for a specific row index. * Accounts for the fact that handles are inserted between rows. * * @param start - The 1-based start index of the row. * @param end - The 1-based end index of the row. * @returns A CSS string for `grid-row`. */ export declare let getGridRow: (start: number, end: number) => string; /** * Calculates the `grid-row` CSS property for a resize handle. * * @param index - The 0-based index of the handle. * @returns A CSS string for `grid-row`. */ export declare let getGridRowHandle: (index: number) => string; /** * Retrieves the DOM element for a specific column or row index. * * @param parent - The parent grid element. * @param type - The type of track ("col" or "row"). * @param index - The 1-based index of the track. * @returns The matching Element or null. */ export declare function getElmAtIndex(parent: HTMLElement, type: "col" | "row", index: number): Element | null; /** * Converts a pixel size to a fraction (`fr`) unit based on the parent container's size. * * @param sizePx - The size in pixels. * @param parent - The parent container element. * @param orientation - The orientation of the grid ("vertical" or "horizontal"). * @returns A string representing the size in `fr` units. */ export declare function toPercent(sizePx: number, parent: HTMLElement, orientation: "vertical" | "horizontal"): string; /** * Defines the orientation of the grid. */ export type Orientation = "vertical" | "horizontal"; /** * Calculates the new state of the grid tracks after a resize operation. * Handles constraints (min/max size) and distributes space between adjacent tracks. * * @param type - The type of track being resized ("col" or "row"). * @param entries - The current list of track entries. * @param movement - The amount of movement in pixels. * @param index - The index of the handle being dragged. * @param parent - The parent grid element. * @param orientation - The orientation of the grid. * @returns A new array of `GridEntry` objects with updated sizes. */ export declare function getNextState(type: "col" | "row", entries: Array, movement: number, index: number, parent: HTMLElement, orientation: Orientation): { size: string | number; mode?: Mode | undefined; minSize?: number | undefined; maxSize?: number | undefined; index: number; }[]; /** * Generates the initial state of the grid based on the provided configuration. * * @param config - The grid configuration object. * @returns The initial `GridState` with columns and rows populated. */ export declare function getInitialGridState(config: GridDefaults): GridState;