/** * * This file may have been modified by Bytedance Inc. (“Bytedance Inc.'s Modifications”). * All Bytedance Inc.'s Modifications are Copyright (year) Bytedance Inc.. * * This source code is licensed under the Apache license. * See LICENSE file in the project root for license information. * */ import type * as React from 'react'; import type { ColumnType as RcColumnType, RenderedCell as RcRenderedCell, FixedType } from '../../../../@ecom/rc-table/es/interface'; import { GetRowKey, ExpandableConfig } from '../../../../@ecom/rc-table/es/interface'; import type { TooltipProps } from '../../tooltip'; import type { CheckboxProps } from '../../checkbox'; import type { PaginationProps } from '../../pagination'; import type { Breakpoint } from '../../_util/responsiveObserve'; import type { INTERNAL_SELECTION_ITEM } from './hooks/useSelection'; export { GetRowKey, ExpandableConfig }; export declare type Key = React.Key; export declare type RowSelectionType = 'checkbox' | 'radio'; export declare type SelectionItemSelectFn = (currentRowKeys: Key[]) => void; export declare type ExpandType = null | 'row' | 'nest'; export interface TableLocale { filterTitle?: string; filterConfirm?: React.ReactNode; filterReset?: React.ReactNode; filterEmptyText?: React.ReactNode; filterCheckall?: React.ReactNode; filterSearchPlaceholder?: string; emptyText?: React.ReactNode | (() => React.ReactNode); selectAll?: React.ReactNode; selectNone?: React.ReactNode; selectInvert?: React.ReactNode; selectionAll?: React.ReactNode; sortTitle?: string; expand?: string; collapse?: string; triggerDesc?: string; triggerAsc?: string; cancelSort?: string; } export declare type SortOrder = 'descend' | 'ascend' | null; declare const TableActions: ['paginate', 'sort', 'filter']; export declare type TableAction = (typeof TableActions)[number]; export declare type CompareFn = (a: T, b: T, sortOrder?: SortOrder) => number; export interface ColumnFilterItem { text: React.ReactNode; value: string | number | boolean; children?: ColumnFilterItem[]; } export interface ColumnTitleProps { sortOrder?: SortOrder; sortColumn?: ColumnType; sortColumns?: { column: ColumnType; order: SortOrder; }[]; filters?: Record; } export declare type ColumnTitle = | React.ReactNode | ((props: ColumnTitleProps) => React.ReactNode); export declare type FilterValue = (Key | boolean)[]; export declare type FilterKey = Key[] | null; export declare type FilterSearchType = boolean | ((input: string, record: {}) => boolean); export interface FilterConfirmProps { closeDropdown: boolean; } export interface FilterDropdownProps { prefixCls: string; setSelectedKeys: (selectedKeys: React.Key[]) => void; selectedKeys: React.Key[]; confirm: (param?: FilterConfirmProps) => void; clearFilters?: () => void; filters?: ColumnFilterItem[]; visible: boolean; } export interface ColumnType extends Omit, 'title'> { title?: ColumnTitle; sorter?: | boolean | CompareFn | { compare?: CompareFn; multiple?: number; }; sortOrder?: SortOrder; defaultSortOrder?: SortOrder; sortDirections?: SortOrder[]; showSorterTooltip?: boolean | TooltipProps; filtered?: boolean; filters?: ColumnFilterItem[]; filterDropdown?: React.ReactNode | ((props: FilterDropdownProps) => React.ReactNode); filterMultiple?: boolean; filteredValue?: FilterValue | null; defaultFilteredValue?: FilterValue | null; filterIcon?: React.ReactNode | ((filtered: boolean) => React.ReactNode); filterMode?: 'menu' | 'tree'; filterSearch?: FilterSearchType; onFilter?: (value: string | number | boolean, record: RecordType) => boolean; filterDropdownVisible?: boolean; onFilterDropdownVisibleChange?: (visible: boolean) => void; filterResetToDefaultFilteredValue?: boolean; responsive?: Breakpoint[]; } export interface ColumnGroupType extends Omit, 'dataIndex'> { children: ColumnsType; } export declare type ColumnsType = (ColumnGroupType | ColumnType)[]; export interface SelectionItem { key: string; text: React.ReactNode; onSelect?: SelectionItemSelectFn; } export declare type SelectionSelectFn = ( record: T, selected: boolean, selectedRows: T[], nativeEvent: Event ) => void; export declare type RowSelectMethod = 'all' | 'none' | 'invert' | 'single' | 'multiple'; export interface TableRowSelection { preserveSelectedRowKeys?: boolean; type?: RowSelectionType; selectedRowKeys?: Key[]; defaultSelectedRowKeys?: Key[]; onChange?: ( selectedRowKeys: Key[], selectedRows: T[], info: { type: RowSelectMethod; } ) => void; getCheckboxProps?: (record: T) => Partial>; onSelect?: SelectionSelectFn; onSelectMultiple?: (selected: boolean, selectedRows: T[], changeRows: T[]) => void; onSelectAll?: (selected: boolean, selectedRows: T[], changeRows: T[]) => void; onSelectInvert?: (selectedRowKeys: Key[]) => void; onSelectNone?: () => void; selections?: INTERNAL_SELECTION_ITEM[] | boolean; hideSelectAll?: boolean; fixed?: FixedType; columnWidth?: string | number; columnTitle?: string | React.ReactNode; checkStrictly?: boolean; renderCell?: ( value: boolean, record: T, index: number, originNode: React.ReactNode ) => React.ReactNode | RcRenderedCell; } export declare type TransformColumns = (columns: ColumnsType) => ColumnsType; export interface TableCurrentDataSource { currentDataSource: RecordType[]; action: TableAction; } export interface SorterResult { column?: ColumnType; order?: SortOrder; field?: Key | readonly Key[]; columnKey?: Key; } export declare type GetPopupContainer = (triggerNode: HTMLElement) => HTMLElement; declare type TablePaginationPosition = | 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight'; export interface TablePaginationConfig extends PaginationProps { position?: TablePaginationPosition[]; }