import React from 'react'; import PropTypes from 'prop-types'; import { HeadCellSortHandler } from '@splunk/react-ui/Table'; import { ComponentProps } from '../utils/types'; /** @public */ type HeadCellSortDir = 'asc' | 'desc' | 'none'; interface TreeGridHeadCellPropsBase { /** Align the text in the label. */ align?: 'left' | 'center' | 'right'; children?: React.ReactNode; /** * Stable id for this column. In TreeGrid, this is required for the hierarchy column and * should also be provided for any column that participates in features that rely on stable * column identity. */ columnId?: string; /** * A React ref which is set to the DOM element when the component mounts and null when it * unmounts. */ elementRef?: React.Ref; /** * A callback invoked when this head cell is clicked. If provided, the head cell is sortable * and renders the appropriate user interface. */ onSort?: HeadCellSortHandler; /** * The current sort direction of this column. */ sortDir?: HeadCellSortDir; /** * The sort key passed to `onSort`, following the same pattern as `Table.HeadCell`. */ sortKey?: string; /** * The width of the column in pixels. */ width?: number | 'auto'; } type TreeGridHeadCellProps = ComponentProps; declare function HeadCell({ align, children, columnId, elementRef, onSort, sortDir, sortKey, width, ...otherProps }: TreeGridHeadCellProps): React.JSX.Element; declare namespace HeadCell { var propTypes: { align: PropTypes.Requireable; children: PropTypes.Requireable; columnId: PropTypes.Requireable; elementRef: PropTypes.Requireable; onSort: PropTypes.Requireable<(...args: any[]) => any>; sortDir: PropTypes.Requireable; sortKey: PropTypes.Requireable; width: PropTypes.Requireable>; }; } export default HeadCell; export type { HeadCellSortDir, HeadCellSortHandler };