useColumns.d.ts 1.2 KB

123456789101112131415161718192021
  1. import type { ComputedRef, Ref } from 'vue';
  2. import type { ColumnsType, ColumnType, FixedType, Key, GetRowKey, TriggerEventHandler, RenderExpandIcon } from '../interface';
  3. /**
  4. * Parse `columns` & `children` into `columns`.
  5. */
  6. declare function useColumns<RecordType>({ prefixCls, columns: baseColumns, expandable, expandedKeys, getRowKey, onTriggerExpand, expandIcon, rowExpandable, expandIconColumnIndex, direction, expandRowByClick, expandColumnWidth, expandFixed, }: {
  7. prefixCls?: Ref<string>;
  8. columns?: Ref<ColumnsType<RecordType>>;
  9. expandable: Ref<boolean>;
  10. expandedKeys: Ref<Set<Key>>;
  11. getRowKey: Ref<GetRowKey<RecordType>>;
  12. onTriggerExpand: TriggerEventHandler<RecordType>;
  13. expandIcon?: Ref<RenderExpandIcon<RecordType>>;
  14. rowExpandable?: Ref<(record: RecordType) => boolean>;
  15. expandIconColumnIndex?: Ref<number>;
  16. direction?: Ref<'ltr' | 'rtl'>;
  17. expandRowByClick?: Ref<boolean>;
  18. expandColumnWidth?: Ref<number | string>;
  19. expandFixed?: Ref<FixedType>;
  20. }, transformColumns: Ref<(columns: ColumnsType<RecordType>) => ColumnsType<RecordType>>): [ComputedRef<ColumnsType<RecordType>>, ComputedRef<readonly ColumnType<RecordType>[]>];
  21. export default useColumns;