import * as React from 'react'; import { StandardProps } from '../../common'; import { GridAllocation } from '../../utils/gridLayout'; export interface EmptyCellRenderer { (row: number, col: number): JSX.Element; } export interface GridProps extends StandardProps { /** * Sets the number of rows in the grid, otherwise either 1 * (columns not fixed) or dynamic (columns fixed). * A string indicates the height of rows in a dynamic setting. * @default 1 */ rows?: number | string | Array; /** * Sets the number of columns in the grid, otherwise either * 1 (rows not fixed) or dynamic (rows fixed). * A string indicates the width of columns in a dynamic setting. * @default 1 */ columns?: number | string | Array; /** * Optionally sets the spacing between the grid cells. * By default 0, otherwise a single value sets the * spacing between rows and columns, while two values * set the spacing between the rows and columns * respectively. * @default 0 */ spacing?: number | string | [ string, string ]; /** * Sets the grid's children. */ children?: React.ReactNode; /** * By providing the show empty cell property, the grid will automatically * render the empty (i.e., unused) cells and populate them using this * component. * @default false */ showEmptyCells?: JSX.Element | EmptyCellRenderer | boolean; /** * Event fired once the layout has been computed. */ onLayout?(e: GridLayoutEvent): void; /** * Gets the reference to the underlying HTML DOM element. */ innerRef?(instance: HTMLElement | null): void; } export interface GridLayoutEvent { layout: GridLayout; } export interface GridLayout { allocation: Array; cells: Array; rows: Array; columns: Array; } export interface GridState { layout: GridLayout; unused: Array; } /** * The `Grid` component represents a uniform grid, i.e., a grid that does not change its column layout from row to row. */ export declare class Grid extends React.PureComponent { constructor(props: GridProps); UNSAFE_componentWillReceiveProps(nextProps: GridProps): void; render(): JSX.Element; static inner: { readonly StyledGridWrapper: any; readonly ShadowGrid: any; readonly GridLayout: any; }; }