UNPKG

acud

Version:

acg react 组件库

25 lines (24 loc) • 1.23 kB
import { TransformColumns, ColumnsType, Key, ColumnType, SortOrder, ColumnTitleProps, SorterResult, TableLocale } from '../interface'; import { TooltipProps } from '../../tooltip'; export interface SortState<RecordType> { column: ColumnType<RecordType>; key: Key; sortOrder: SortOrder | null; multiplePriority: number | false; } export declare function getSortData<RecordType>(data: readonly RecordType[], sortStates: Array<SortState<RecordType>>, childrenColumnName: string): RecordType[]; interface SorterConfig<RecordType> { prefixCls: string; mergedColumns: ColumnsType<RecordType>; onSorterChange: (sorterResult: SorterResult<RecordType> | Array<SorterResult<RecordType>>, sortStates: Array<SortState<RecordType>>) => void; sortDirections: SortOrder[]; tableLocale?: TableLocale; showSorterTooltip?: boolean | TooltipProps; } export default function useFilterSorter<RecordType>({ prefixCls, mergedColumns, onSorterChange, sortDirections, tableLocale, showSorterTooltip }: SorterConfig<RecordType>): [ TransformColumns<RecordType>, Array<SortState<RecordType>>, ColumnTitleProps<RecordType>, () => SorterResult<RecordType> | Array<SorterResult<RecordType>> ]; export {};