useColumns.d.ts 827 B

123456789101112131415
  1. import * as React from 'react';
  2. import { SortOrder, TableColumn } from '../types';
  3. type ColumnsHook<T> = {
  4. tableColumns: TableColumn<T>[];
  5. draggingColumnId: string;
  6. handleDragStart: (e: React.DragEvent<HTMLDivElement>) => void;
  7. handleDragEnter: (e: React.DragEvent<HTMLDivElement>) => void;
  8. handleDragOver: (e: React.DragEvent<HTMLDivElement>) => void;
  9. handleDragLeave: (e: React.DragEvent<HTMLDivElement>) => void;
  10. handleDragEnd: (e: React.DragEvent<HTMLDivElement>) => void;
  11. defaultSortDirection: SortOrder;
  12. defaultSortColumn: TableColumn<T>;
  13. };
  14. declare function useColumns<T>(columns: TableColumn<T>[], onColumnOrderChange: (nextOrder: TableColumn<T>[]) => void, defaultSortFieldId: string | number | null | undefined, defaultSortAsc: boolean): ColumnsHook<T>;
  15. export default useColumns;