import * as _react_types_table from '@react-types/table'; import { TableCollection } from '@react-types/table'; import * as _heroui_system from '@heroui/system'; import { HTMLHeroUIProps, PropGetter } from '@heroui/system'; import * as react from 'react'; import { ReactNode, Key } from 'react'; import { SlotsToClasses, TableSlots, TableVariantProps, TableReturnType } from '@heroui/theme'; import { Layout } from '@react-stately/virtualizer'; import { Node, SelectionBehavior, DisabledBehavior } from '@react-types/shared'; import { TableStateProps, TableState } from '@react-stately/table'; import { AriaTableProps } from '@react-aria/table'; import { ReactRef } from '@heroui/react-utils'; import { CheckboxProps } from '@heroui/checkbox'; type TableContentPlacement = "inside" | "outside"; interface Props extends HTMLHeroUIProps<"table"> { /** * Ref to the DOM node. */ ref?: ReactRef; children?: ReactNode; layoutNode?: Layout>; /** * A custom wrapper component for the table. * @default "div" */ BaseComponent?: React.ComponentType; /** * Ref to the container element. */ baseRef?: ReactRef; /** * Where to place the `topContent` component. * @default "inside" */ topContentPlacement?: TableContentPlacement; /** * Provides content to include a component in the top of the table. */ topContent?: ReactNode; /** * Where to place the `bottomContent` component. * @default "inside" */ bottomContentPlacement?: TableContentPlacement; /** * Provides content to include a component in the bottom of the table. */ bottomContent?: ReactNode; /** * Whether the table base container should not be rendered. * @default false */ removeWrapper?: boolean; /** * How multiple selection should behave in the collection. * The selection behavior for the table. If selectionMode is `"none"`, this will be `null`. * otherwise, this will be `toggle` or `replace`. * @default "toggle" */ selectionBehavior?: SelectionBehavior | null; /** * Whether `disabledKeys` applies to all interactions, or only selection. * @default "selection" */ disabledBehavior?: DisabledBehavior; /** * Whether to disable the table and checkbox animations. * @default false */ disableAnimation?: boolean; /** * Whether to disable the keyboard navigation functionality. * @default false */ isKeyboardNavigationDisabled?: boolean; /** * Props to be passed to the checkboxes. */ checkboxesProps?: CheckboxProps; /** * Custom Icon to be displayed in the table header - overrides the default chevron one */ sortIcon?: ReactNode | ((props: any) => ReactNode); /** Handler that is called when a user performs an action on the row. */ onRowAction?: (key: Key) => void; /** Handler that is called when a user performs an action on the cell. */ onCellAction?: (key: Key) => void; /** * Classname or List of classes to change the classNames of the element. * if `className` is passed, it will be added to the base slot. * * @example * ```ts * * ``` */ classNames?: SlotsToClasses; } type UseTableProps = Props & TableStateProps & Omit & TableVariantProps; type ValuesType = { state: TableState; slots: TableReturnType; collection: TableCollection; color: TableVariantProps["color"]; isSelectable: boolean; selectionMode: UseTableProps["selectionMode"]; selectionBehavior: SelectionBehavior | null; checkboxesProps?: CheckboxProps; disabledBehavior: UseTableProps["disabledBehavior"]; disableAnimation?: UseTableProps["disableAnimation"]; isHeaderSticky?: UseTableProps["isHeaderSticky"]; showSelectionCheckboxes: UseTableProps["showSelectionCheckboxes"]; classNames?: SlotsToClasses; onRowAction?: UseTableProps["onRowAction"]; onCellAction?: UseTableProps["onCellAction"]; }; declare function useTable(originalProps: UseTableProps): { BaseComponent: string | react.ComponentType; Component: _heroui_system.As; children: ((string | number | boolean | react.ReactElement> | react.ReactFragment | react.ReactPortal | null) & [react.ReactElement<_react_types_table.TableHeaderProps, string | react.JSXElementConstructor>, react.ReactElement<_react_types_table.TableBodyProps, string | react.JSXElementConstructor>]) | undefined; state: TableState; collection: TableCollection; values: ValuesType; topContent: ReactNode; bottomContent: ReactNode; removeWrapper: boolean; topContentPlacement: TableContentPlacement; bottomContentPlacement: TableContentPlacement; sortIcon: ReactNode | ((props: any) => ReactNode); getBaseProps: PropGetter; getWrapperProps: PropGetter; getTableProps: PropGetter; }; type UseTableReturn = ReturnType; export { type UseTableProps, type UseTableReturn, type ValuesType, useTable };