import { Table as TanstackTable } from '@tanstack/react-table'; import { ReactElement, RefAttributes } from 'react'; import { DataTablePropsType } from '../type'; /** * DataTable 暴露给 ref 的命令式 handle —— 就是底层 TanStack table 实例 * * 通过 `ref` 即可拿到完整的 TanStack `table` API:`setPageIndex`、`getSelectedRowModel`、 * `resetSorting`、`getState` 等。配合受控状态使用更顺手 */ export type DataTableHandle = TanstackTable; /** * forwardRef 包装,泛型用 cast 保留 —— 否则会被 forwardRef 的签名擦除成 unknown */ declare const DataTable: (props: DataTablePropsType & RefAttributes>) => ReactElement | null; export { DataTable };