useSelection.d.ts 1.1 KB

1234567891011121314151617181920
  1. import type { Ref } from 'vue';
  2. import type { TableRowSelection, Key, GetRowKey, TableLocale, SelectionItem, TransformColumns, ExpandType, GetPopupContainer } from '../interface';
  3. export declare const SELECTION_COLUMN: {};
  4. export declare const SELECTION_ALL: "SELECT_ALL";
  5. export declare const SELECTION_INVERT: "SELECT_INVERT";
  6. export declare const SELECTION_NONE: "SELECT_NONE";
  7. interface UseSelectionConfig<RecordType> {
  8. prefixCls: Ref<string>;
  9. pageData: Ref<RecordType[]>;
  10. data: Ref<RecordType[]>;
  11. getRowKey: Ref<GetRowKey<RecordType>>;
  12. getRecordByKey: (key: Key) => RecordType;
  13. expandType: Ref<ExpandType>;
  14. childrenColumnName: Ref<string>;
  15. locale: Ref<TableLocale>;
  16. getPopupContainer?: Ref<GetPopupContainer>;
  17. }
  18. export declare type INTERNAL_SELECTION_ITEM = SelectionItem | typeof SELECTION_ALL | typeof SELECTION_INVERT | typeof SELECTION_NONE;
  19. export default function useSelection<RecordType>(rowSelectionRef: Ref<TableRowSelection<RecordType> | undefined>, configRef: UseSelectionConfig<RecordType>): [TransformColumns<RecordType>, Ref<Set<Key>>];
  20. export {};