import type { ReactNode } from 'react'; import { BaseTableCellParams, BaseTableCol, BaseTableColParams, CellData, PrimaryTableCol, RowClassNameParams, TableColumnClassName, TableRowData, TdBaseTableProps, TdPrimaryTableProps } from '../type'; import { ClassName, HTMLElementAttributes, TNode } from '../../common'; import type { EllipsisPopupProps } from '../Ellipsis'; import { SkipSpansValue } from '../hooks/useRowspanAndColspan'; export declare function toString(obj: any): string; export declare function debounce(fn: (this: T, ...args: A) => void, delay?: number): (this: T, ...args: A) => void; export interface FormatRowAttributesParams { row: TableRowData; rowIndex: number; type: 'body' | 'foot'; } export declare function formatRowAttributes(attributes: TdBaseTableProps['rowAttributes'], params: FormatRowAttributesParams): HTMLElementAttributes; export declare function formatRowClassNames(rowClassNames: TdBaseTableProps['rowClassName'], params: RowClassNameParams, rowKey: string): ClassName; export declare function formatClassNames(classNames: TableColumnClassName | TableColumnClassName[], params: CellData): any[]; export declare const INNER_PRE_NAME = "@@inner-"; export declare function getCurrentRowByKey(columns: T[], key: string): T; export interface CellSpanResult { /** 单元格的 rowspan 属性 */ rowspan?: number; /** 单元格的 colspan 属性 */ colspan?: number; /** 是否跳过渲染该单元格 */ skipped: boolean; } /** * 获取单元格合并状态 * @param cellKey 单元格唯一标识 * @param skipSpansMap 合并单元格映射表 * @returns 合并单元格的结果 */ export declare const handleCellSpan: (cellKey: string, skipSpansMap?: Map) => CellSpanResult; /** * 判断单元格是否是最后一行(合并单元格场景移除底部边框) */ export declare const isLastRowInSpan: (rowIndex: number, rowspan?: number, totalDataLength?: number) => boolean; /** * 判断单元格是否是第一列(合并单元格场景移除左边框) * 在合并单元格场景下,所有行的第一列都应该移除左边框 */ export declare const isFirstColumnInSpan: (colIndex: number) => boolean; /** * 是否启用行拖拽 */ export declare const enableRowDrag: (dragSort: TdPrimaryTableProps["dragSort"]) => boolean; export type EllipsisConfig = PrimaryTableCol['ellipsis'] | PrimaryTableCol['ellipsisTitle']; export type EllipsisParams = BaseTableColParams | BaseTableCellParams; export interface ResolvedEllipsis { enabled: boolean; content?: ReactNode | TNode; props?: EllipsisPopupProps; } /** * 解析 `ellipsis` / `ellipsisTitle` 配置,支持 boolean / Object / { props, content } / Function。 */ export declare function resolveEllipsis(value: EllipsisConfig, params: EllipsisParams): ResolvedEllipsis; /** 是否存在列开启了超出省略 */ export declare function hasEllipsisColumn(columns: BaseTableCol[]): boolean; /** * 计算单元格渲染内容。 * 优先级:序号列 > col.cell > col.render > get(row, colKey) > cellEmptyContent */ export declare function renderCell(params: BaseTableCellParams, cellEmptyContent?: TdBaseTableProps['cellEmptyContent']): ReactNode;