import type { CheckCardProps } from '@ant-design/pro-card'; import type { ProColumnType, ProTableProps } from '@ant-design/pro-table'; import type { ListProps } from 'antd'; import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel'; import React from 'react'; import type { ItemProps } from './Item'; import 'antd/lib/list/style'; export type AntdListProps = Omit, 'rowKey'>; export type ProListMeta = Pick, 'dataIndex' | 'valueType' | 'render' | 'search' | 'title' | 'valueEnum' | 'editable' | 'fieldProps' | 'formItemProps' | 'renderFormItem'> & { key?: React.Key; }; type ProListMetaAction = ProListMeta & { /** * @example * `cardActionProps = 'actions';`; * * @name 选择映射到 card 上的 props,默认为extra */ cardActionProps?: 'extra' | 'actions'; }; type IfAny = 0 extends 1 & T ? Y : N; type IsAny = IfAny; export type BaseProListMetas = { [key: string]: any; type?: ProListMeta; title?: ProListMeta; subTitle?: ProListMeta; description?: ProListMeta; avatar?: ProListMeta; content?: ProListMeta; actions?: ProListMetaAction; }; export type ProListMetas = BaseProListMetas & { [key in keyof T]?: IsAny extends true ? ProListMetaAction : ProListMeta; }; export type GetComponentProps = (record: RecordType, index: number) => React.HTMLAttributes; export type ProListProps, ValueType = 'text'> = Omit, 'size' | 'footer'> & AntdListProps & { tooltip?: LabelTooltipType | string; metas?: ProListMetas; showActions?: 'hover' | 'always'; showExtra?: 'hover' | 'always'; onRow?: GetComponentProps; onItem?: GetComponentProps; itemCardProps?: CheckCardProps; rowClassName?: string | ((item: RecordType, index: number) => string); itemHeaderRender?: ItemProps['itemHeaderRender']; itemTitleRender?: ItemProps['itemTitleRender']; }; export type Key = React.Key; export type TriggerEventHandler = (record: RecordType) => void; declare function BaseProList, U extends Record = Record>(props: ProListProps): import("react/jsx-runtime").JSX.Element; declare function ProList, U extends Record = Record>(props: ProListProps): import("react/jsx-runtime").JSX.Element; export { BaseProList, ProList }; export default ProList;