import type { ReactNode } from 'react'; import type { TableProps, ColumnType } from 'antd/lib/table'; import type { AlertRenderType } from './components/Alert'; import type { ProFieldValueType, ProFieldValueObjectType } from '@ant-design/pro-utils'; declare type ProSchemaValueType = ProFieldValueType | ProFieldValueObjectType; export declare type TableRowSelection = TableProps['rowSelection']; export declare type ProSchemaValueEnumType = { /** * @name 演示的文案 */ text: ReactNode; /** * @name 预定的颜色 */ status: string; /** * @name 自定义的颜色 */ color?: string; /** * @name 是否禁用 */ disabled?: boolean; }; export declare type ProSchemaValueEnumObj = Record; /** * @name ValueEnum 的类型 * @description 支持 Map 和 Object */ export declare type ProSchemaValueEnumMap = Map; export declare type ProColumnType = ColumnType & { /** * 是否缩略 */ ellipsis?: boolean; /** * 是否拷贝 */ copyable?: boolean; /** * 选择如何渲染相应的模式 */ valueType?: ((entity: T) => ProSchemaValueType) | ProSchemaValueType; /** * @name 映射值的类型 */ valueEnum?: ProSchemaValueEnumObj | ProSchemaValueEnumMap; }; export declare type ProColumnGroupType = ProColumnType & { children: ProColumns; }; export declare type ProColumns = (ProColumnGroupType | ProColumnType)[]; export declare type ProTableProps = TableProps & { /** * 是否允许伸缩列 */ resizeable?: boolean; columns: ProColumns; /** * @name 选择想配置 */ rowSelection?: TableProps['rowSelection'] | false; /** * @name 自定义 table 的 alert * @description 设置或者返回false 即可关闭 */ tableAlertRender?: AlertRenderType; /** * @name 自定义 table 的 alert 的操作 * @description 设置或者返回false 即可关闭 */ tableAlertOptionRender?: AlertRenderType; }; /** * 转化列的定义 */ export declare type ColumnRenderInterface = { columnProps: ProColumnType; text: any; rowData: T; index: number; }; export {};