UNPKG

@perfma/heaven

Version:

An UI Framework base [Ant Design V4](https://ant.design/components/overview-cn/) for React.

46 lines (45 loc) 1.55 kB
import React from 'react'; import { ColumnType, TableProps } from 'antd/lib/table'; import { TableEmptyProps } from './empty/interface'; declare type Diff<T extends keyof any, U extends keyof any> = ({ [P in T]: P; } & { [P in U]: never; } & { [x: string]: never; })[T]; declare type Overwrite<T, U> = Pick<T, Diff<keyof T, keyof U>> & U; export interface ProCellEllipsisType { showTitle?: boolean; line?: number; suffix?: (val: any) => string; onClick?: (val: any, record: any, index: any) => void; useRender?: boolean; } interface ExtColumnType { hidden?: boolean; disableCheckbox?: boolean; ellipsis?: boolean | ProCellEllipsisType; action?: boolean; } interface ProColumnType<RecordType> extends Overwrite<ColumnType<RecordType>, ExtColumnType> { } export interface ProColumnGroupType<RecordType> extends Omit<ProColumnType<RecordType>, 'dataIndex'> { children: ProColumnsType<RecordType>; } export declare type ProColumnsType<RecordType = unknown> = (ProColumnType<RecordType> | ProColumnGroupType<RecordType>)[]; interface ToolbarOptions { columnSetting?: boolean; onColumnSettingChange?: (keys: any[]) => void; } interface ExtTableProps<T extends object = any> { toolbar?: React.ReactNode; extra?: React.ReactNode; options?: ToolbarOptions; empty?: TableEmptyProps; left?: React.ReactNode; columns?: ProColumnsType<T>; } export { TableEmptyProps }; export interface ProTableProps<T extends object = any> extends Overwrite<TableProps<T>, ExtTableProps<T>> { }