import React from 'react'; import { Deprecated } from "../../core"; import { TableCellProps } from '@chakra-ui/react'; import { IHTMLTable, IHTMLTBody, IHTMLTd, IHTMLTh, IHTMLTr } from '../HTMLTable/types'; import { IBox } from "../../core/types"; export interface ITable extends IHTMLTable { } export interface ITableBody extends IHTMLTBody { } export interface ITableColumn extends IHTMLTh { title?: string; } declare type OptionalCallback = (() => void) | false; export interface ITableExpandableRow extends ITableRow { level?: number; } export interface ITableExpandableContent extends ITableExpandableRow { } export interface ITableHeader { children: React.ReactNode; /** @deprecated */ isSelected?: Deprecated; } export interface ITableRowProps { children: React.ReactNode; /** * Callback function to be called when the row is selected */ onSelect?: OptionalCallback; /** * Whether the row is selected initially */ isSelected?: boolean; /** * Callback function to be called when row is expanded */ onExpand?: OptionalCallback; /** * Whether the row is expanded initially */ isExpanded?: boolean; } export interface ITableRow extends Omit, ITableRowProps { setIsExpanded?: React.Dispatch>; setIsSelected?: React.Dispatch>; level?: ITableExpandableRow['level']; /** @deprecated */ isNested?: Deprecated; } export interface ITableCell extends IBox, Pick { children: React.ReactNode; level?: number; } export interface IExpandableCell extends IHTMLTd { isHead?: boolean; showCell?: boolean; showExpand?: boolean; onExpand?: OptionalCallback; isExpanded?: boolean; setIsExpanded?: React.Dispatch>; } export interface ISelectableCell extends Omit { isHead?: boolean; showCell?: boolean; showSelect?: boolean; onSelect?: OptionalCallback; isSelected?: boolean; setIsSelected?: React.Dispatch>; isIndeterminate?: boolean; } export interface ITableComponent extends React.FC { Header: React.FC; Column: React.FC; Body: React.FC; Row: React.FC; Cell: React.FC; ExpandableRow: React.FC; ExpandableContent: React.FC; } export interface ITableProps { /** * Whether all rows are expanded initially */ isExpandedAll?: boolean; /** * Callback function to be called when all rows are expanded (required to show Expand All option) */ onExpandAll?: OptionalCallback; /** * Whether all rows are selected initially */ isSelectedAll?: boolean; /** * Callback function to be called when all rows are selected (required to show Select All option) */ onSelectAll?: OptionalCallback; } export interface ITableContext extends ITableProps { showExpand?: boolean; setShowExpand?: (value: boolean) => void; showSelect?: boolean; setShowSelect?: (value: boolean) => void; isIndeterminateSelectAll?: boolean; setIsIndeterminateSelectAll?: (value: boolean) => void; isIndeterminateExpandAll?: boolean; setIsIndeterminateExpandAll?: (value: boolean) => void; } export declare const TableContext: React.Context; export {};