import { VirtualTableColumn } from './type'; import { RecordType } from 'yc-pro-components/es/types'; import { Ref } from 'vue'; export interface UseVirtualSelectionOptions { /** 行数据的唯一标识字段名 */ rowKey: () => string; /** 全部表格数据(响应式 getter) */ data: () => RecordType[]; /** 选择变化回调 */ onSelectionChange?: (selection: RecordType[]) => void; /** 单行选择回调 */ onSelect?: (selection: RecordType[], row: RecordType) => void; /** 全选回调 */ onSelectAll?: (selection: RecordType[]) => void; } export interface UseVirtualSelectionReturn { /** 选中行 Key 集合(响应式) */ selectedKeys: Ref>; /** 是否全选 */ isAllSelected: Ref; /** 是否半选 */ isIndeterminate: Ref; /** 获取选中行数据 */ getSelectionRows: () => RecordType[]; /** 清空选择 */ clearSelection: () => void; /** 切换单行选择 */ toggleRowSelection: (row: RecordType, selected?: boolean) => void; /** 切换全选 */ toggleAllSelection: (selected?: boolean) => void; /** CheckBox 列的单元格渲染器 */ selectionCellRenderer: VirtualTableColumn['cellRenderer']; /** CheckBox 列的表头渲染器 */ selectionHeaderRenderer: VirtualTableColumn['headerCellRenderer']; } /** * 虚拟表格选择逻辑 composable */ export declare function useVirtualSelection(options: UseVirtualSelectionOptions): UseVirtualSelectionReturn;