/** * Grid3 Cell Helpers * * Utilities for working with Grid 3 cells, including finding button positions * and calculating cell spans in grid layouts. */ import type { AACPage, AACButton } from '../../core/treeStructure'; /** * Cell position with span information */ export interface CellPosition { /** X coordinate (column) */ x: number; /** Y coordinate (row) */ y: number; /** Number of columns the cell spans */ columnSpan: number; /** Number of rows the cell spans */ rowSpan: number; } /** * Find button position with span information * * Searches the page's grid layout for a button and calculates its position * and span (how many columns/rows it occupies). * * @param page - The AAC page containing the button * @param button - The button to locate * @param fallbackIndex - Index to use if button not found in grid * @returns Position and span information for the button * * @example * const position = findButtonPosition(page, button, 0); * console.log(`Button at ${position.x},${position.y} spans ${position.columnSpan}x${position.rowSpan}`); */ export declare function findButtonPosition(page: AACPage, button: AACButton, fallbackIndex: number): CellPosition; /** * Calculate cell position key for Maps and Sets * * Creates a string key from X and Y coordinates for use as a Map key or Set entry. * * @param x - X coordinate * @param y - Y coordinate * @returns String key in format "x,y" * * @example * const key = cellPositionKey(5, 3); * console.log(key); // "5,3" */ export declare function cellPositionKey(x: number, y: number): string; /** * Parse cell position key * * Extracts X and Y coordinates from a position key string. * * @param key - Position key in format "x,y" * @returns Object with x and y properties * * @example * const pos = parseCellPositionKey("5,3"); * console.log(pos); // { x: 5, y: 3 } */ export declare function parseCellPositionKey(key: string): { x: number; y: number; };