UNPKG

tdesign-react

Version:
32 lines (31 loc) 1.87 kB
import { BaseTableCellParams, CellData, RowClassNameParams, TableColumnClassName, TableRowData, TdBaseTableProps } from './type'; import { ClassName, HTMLElementAttributes } from '../common'; import { AffixProps } from '../affix'; export declare function toString(obj: any): string; export declare function debounce<T = any>(fn: Function, delay?: number): () => 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<TableRowData>, rowKey: string): ClassName; export declare function formatClassNames(classNames: TableColumnClassName<TableRowData> | TableColumnClassName<TableRowData>[], params: CellData<TableRowData> | BaseTableCellParams<TableRowData>): any[]; export declare const INNER_PRE_NAME = "@@inner-"; export declare function getCurrentRowByKey<T extends { colKey?: string; children?: any[]; }>(columns: T[], key: string): T; /** 透传 Affix 组件全部特性 */ export declare function getAffixProps(mainAffixProps: boolean | Partial<AffixProps>, subAffixProps?: Partial<AffixProps>): Partial<AffixProps>; export declare const isLessThanIE11OrNotHaveResizeObserver: () => boolean; /** * IE 11 版本以上或者支持 ResizeObserver API 的浏览器中, * 使用 ResizeObserver API 来监听元素的尺寸变化 * * 注意:建议 callback 使用前经过 useDebounce 包裹 * * @param tableElement - 要监听的表格元素 * @param callback - 尺寸变化时调用的回调函数 */ export declare const resizeObserverElement: (tableElement: HTMLDivElement, callback: () => void) => () => void;