import { useSelection } from '../composables/use-selection'; import { useExpand } from '../composables/use-expand'; import type { PickPartial } from 'pagoda-shared'; import type { Ref } from 'vue'; import type { Column } from 'element-plus/es/components/table-v2/src/types'; import type { DefaultRow } from 'element-plus/es/components/table/src/table/defaults'; export interface VirtualTableColumn extends PickPartial, 'width'> { type?: 'selection' | 'index' | 'expand'; selectable?: (row: DefaultRow, index: number) => boolean; label?: string; prop?: string; slot?: string; sortOrders?: ('ascending' | 'descending' | null)[]; children?: VirtualTableColumn[]; } export interface VirtualTableColumnCtx extends VirtualTableColumn { colspan: number; rowspan?: number; level: number; fixedLeft: boolean; fixedRight: boolean; width: number; children?: VirtualTableColumnCtx[]; } export interface TableStore extends ReturnType, ReturnType { tableData: Ref; rowsState: WeakMap; } export type VirtualTableSortable = { property: string; order: 'ascending' | 'descending' | null; column: VirtualTableColumnCtx; }; export type VirtualTableState = { sortable: PickPartial; expandedRows: DefaultRow[]; };