useSelection.d.ts 1.1 KB

1234567891011121314151617181920
  1. import type { AnyObject } from '../../_util/type';
  2. import type { ExpandType, GetPopupContainer, GetRowKey, Key, SelectionItem, TableLocale, TableRowSelection, TransformColumns } 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 = AnyObject> {
  8. prefixCls: string;
  9. pageData: RecordType[];
  10. data: RecordType[];
  11. getRowKey: GetRowKey<RecordType>;
  12. getRecordByKey: (key: Key) => RecordType;
  13. expandType: ExpandType;
  14. childrenColumnName: string;
  15. locale: TableLocale;
  16. getPopupContainer?: GetPopupContainer;
  17. }
  18. export type INTERNAL_SELECTION_ITEM = SelectionItem | typeof SELECTION_ALL | typeof SELECTION_INVERT | typeof SELECTION_NONE;
  19. declare const useSelection: <RecordType extends AnyObject = AnyObject>(config: UseSelectionConfig<RecordType>, rowSelection?: TableRowSelection<RecordType>) => readonly [TransformColumns<RecordType>, Set<Key>];
  20. export default useSelection;