import { GridAria, GridProps, GridRowAria, GridRowProps, GridRowGroupAria } from "@react-aria/grid"; import { Key, LayoutDelegate, Rect, RefObject, Size, DOMAttributes, FocusableElement } from "@react-types/shared"; import { TableState, TreeGridState, TableColumnResizeState } from "@react-stately/table"; import { GridNode } from "@react-types/grid"; import { AriaCheckboxProps } from "@react-types/checkbox"; import { ColumnSize } from "@react-types/table"; export interface AriaTableProps extends GridProps { /** The layout object for the table. Computes what content is visible and how to position and style them. */ layoutDelegate?: LayoutDelegate; /** @deprecated - Use layoutDelegate instead. */ layout?: DeprecatedLayout; } interface DeprecatedLayout { getLayoutInfo(key: Key): DeprecatedLayoutInfo; getContentSize(): Size; virtualizer: DeprecatedVirtualizer; } interface DeprecatedLayoutInfo { rect: Rect; } interface DeprecatedVirtualizer { visibleRect: Rect; } /** * Provides the behavior and accessibility implementation for a table component. * A table displays data in rows and columns and enables a user to navigate its contents via directional navigation keys, * and optionally supports row selection and sorting. * @param props - Props for the table. * @param state - State for the table, as returned by `useTableState`. * @param ref - The ref attached to the table element. */ export function useTable(props: AriaTableProps, state: TableState | TreeGridState, ref: RefObject): GridAria; export interface AriaTableColumnHeaderProps { /** An object representing the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader). Contains all the relevant information that makes up the column header. */ node: GridNode; /** Whether the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) is contained in a virtual scroller. */ isVirtualized?: boolean; } export interface TableColumnHeaderAria { /** Props for the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) element. */ columnHeaderProps: DOMAttributes; } /** * Provides the behavior and accessibility implementation for a column header in a table. * @param props - Props for the column header. * @param state - State of the table, as returned by `useTableState`. * @param ref - The ref attached to the column header element. */ export function useTableColumnHeader(props: AriaTableColumnHeaderProps, state: TableState, ref: RefObject): TableColumnHeaderAria; /** * Provides the behavior and accessibility implementation for a row in a table. * @param props - Props for the row. * @param state - State of the table, as returned by `useTableState`. */ export function useTableRow(props: GridRowProps, state: TableState | TreeGridState, ref: RefObject): GridRowAria; export interface TableHeaderRowAria { /** Props for the grid row element. */ rowProps: DOMAttributes; } /** * Provides the behavior and accessibility implementation for a header row in a table. * @param props - Props for the row. * @param state - State of the table, as returned by `useTableState`. */ export function useTableHeaderRow(props: GridRowProps, state: TableState, ref: RefObject): TableHeaderRowAria; export interface AriaTableCellProps { /** An object representing the table cell. Contains all the relevant information that makes up the row header. */ node: GridNode; /** Whether the cell is contained in a virtual scroller. */ isVirtualized?: boolean; /** Whether selection should occur on press up instead of press down. */ shouldSelectOnPressUp?: boolean; /** * Handler that is called when a user performs an action on the cell. * Please use onCellAction at the collection level instead. * @deprecated **/ onAction?: () => void; } export interface TableCellAria { /** Props for the table cell element. */ gridCellProps: DOMAttributes; /** Whether the cell is currently in a pressed state. */ isPressed: boolean; } /** * Provides the behavior and accessibility implementation for a cell in a table. * @param props - Props for the cell. * @param state - State of the table, as returned by `useTableState`. * @param ref - The ref attached to the cell element. */ export function useTableCell(props: AriaTableCellProps, state: TableState, ref: RefObject): TableCellAria; export interface AriaTableSelectionCheckboxProps { /** A unique key for the checkbox. */ key: Key; } export interface TableSelectionCheckboxAria { /** Props for the row selection checkbox element. */ checkboxProps: AriaCheckboxProps; } export interface TableSelectAllCheckboxAria { /** Props for the select all checkbox element. */ checkboxProps: AriaCheckboxProps; } /** * Provides the behavior and accessibility implementation for a selection checkbox in a table. * @param props - Props for the selection checkbox. * @param state - State of the table, as returned by `useTableState`. */ export function useTableSelectionCheckbox(props: AriaTableSelectionCheckboxProps, state: TableState): TableSelectionCheckboxAria; /** * Provides the behavior and accessibility implementation for the select all checkbox in a table. * @param props - Props for the select all checkbox. * @param state - State of the table, as returned by `useTableState`. */ export function useTableSelectAllCheckbox(state: TableState): TableSelectAllCheckboxAria; export interface TableColumnResizeAria { /** Props for the visually hidden input element. */ inputProps: DOMAttributes; /** Props for the resizer element. */ resizerProps: DOMAttributes; /** Whether this column is currently being resized. */ isResizing: boolean; } export interface AriaTableColumnResizeProps { /** An object representing the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader). Contains all the relevant information that makes up the column header. */ column: GridNode; /** Aria label for the hidden input. Gets read when resizing. */ 'aria-label': string; /** * Ref to the trigger if resizing was started from a column header menu. If it's provided, * focus will be returned there when resizing is done. If it isn't provided, it is assumed that the resizer is * visible at all time and keyboard resizing is started via pressing Enter on the resizer and not on focus. * */ triggerRef?: RefObject; /** If resizing is disabled. */ isDisabled?: boolean; /** Called when resizing starts. */ onResizeStart?: (widths: Map) => void; /** Called for every resize event that results in new column sizes. */ onResize?: (widths: Map) => void; /** Called when resizing ends. */ onResizeEnd?: (widths: Map) => void; } /** * Provides the behavior and accessibility implementation for a table column resizer element. * @param props - Props for the resizer. * @param state - State for the table's resizable columns, as returned by `useTableColumnResizeState`. * @param ref - The ref attached to the resizer's visually hidden input element. */ export function useTableColumnResize(props: AriaTableColumnResizeProps, state: TableColumnResizeState, ref: RefObject): TableColumnResizeAria; export function useTableRowGroup(): GridRowGroupAria; export type { GridAria, GridRowAria, GridRowProps } from '@react-aria/grid'; //# sourceMappingURL=types.d.ts.map