import type GridMetrics from './GridMetrics'; import { type VisibleIndex } from './GridMetrics'; import type GridModel from './GridModel'; import type { Selection } from './Selection'; /** * Attributes on the accessibility snapshot that Grid renders into its canvas * fallback content. External tooling locates grid contents through these, so * treat them as a public contract. */ export declare const GRID_A11Y_ATTRIBUTES: { /** On the button that generates a snapshot */ readonly describe: "data-grid-a11y-describe"; /** On the root of a generated snapshot */ readonly snapshot: "data-grid-a11y-snapshot"; /** Visible column index. On column headers and cells */ readonly column: "data-grid-column"; /** Visible row index. On cells */ readonly row: "data-grid-row"; /** Header text. On column headers */ readonly header: "data-grid-header"; /** Bounds as `x,y,width,height`, relative to the top left of the canvas, in CSS pixels */ readonly rect: "data-grid-rect"; }; /** The attribute names used by the accessibility snapshot */ export type GridA11yAttributes = typeof GRID_A11Y_ATTRIBUTES; /** A rectangle relative to the top left of the grid canvas, in CSS pixels */ export type GridA11yRect = { x: number; y: number; width: number; height: number; }; /** A column header in an accessibility snapshot */ export type GridA11yColumnSnapshot = { column: VisibleIndex; text: string; rect: GridA11yRect; }; /** A cell in an accessibility snapshot */ export type GridA11yCellSnapshot = { column: VisibleIndex; text: string; rect: GridA11yRect; }; /** A row of cells in an accessibility snapshot */ export type GridA11yRowSnapshot = { row: VisibleIndex; cells: readonly GridA11yCellSnapshot[]; }; /** * The grid viewport at a point in time. Generated on demand rather than on * every frame, as walking the viewport is far too expensive to do while * scrolling. */ export type GridA11ySnapshot = { /** A sentence describing the grid size, selection, and viewport */ description: string; /** The number of rows in the whole grid, not just the viewport */ rowCount: number; /** The number of columns in the whole grid, not just the viewport */ columnCount: number; columns: readonly GridA11yColumnSnapshot[]; rows: readonly GridA11yRowSnapshot[]; }; /** * Format a rect for the `data-grid-rect` attribute. * @param rect The rect to format * @returns The rect as `x,y,width,height` */ export declare function formatGridA11yRect({ x, y, width, height, }: GridA11yRect): string; /** * Get a brief description of the grid size and selection. * Only reads values the grid already has on hand, so it is cheap enough to * regenerate on every render. * @param model The model being displayed * @param selection The current selection, or `null` when none * @returns A sentence describing the grid */ export declare function getGridA11ySummary(model: GridModel, selection?: Selection | null): string; /** * Get the text and bounds of everything currently in the viewport. * Iterates every visible cell, so only generate it on demand. * @param model The model being displayed * @param metrics Metrics of the last render * @param selection The current selection, or `null` when none * @returns The snapshot to render into the canvas fallback content */ export declare function createGridA11ySnapshot(model: GridModel, metrics: GridMetrics, selection?: Selection | null): GridA11ySnapshot; //# sourceMappingURL=GridA11yUtils.d.ts.map