import React from 'react'; import PropTypes from 'prop-types'; import { noop } from './utils'; import type { ColumnShape } from './types'; export declare function addUserSelectStyles(doc: Document): void; export declare function removeUserSelectStyles(doc: Document): void; export interface ColumnResizerProps { style?: React.CSSProperties; column?: ColumnShape; onResizeStart?: (column: ColumnShape) => void; onResize?: (column: ColumnShape, width: number) => void; onResizeStop?: (column: ColumnShape) => void; minWidth?: number; className?: string; [key: string]: any; } /** * ColumnResizer for BaseTable */ declare class ColumnResizer extends React.PureComponent { isDragging: boolean; lastX: number | null; width: number; handleRef: HTMLDivElement | null; static defaultProps: { onResizeStart: typeof noop; onResize: typeof noop; onResizeStop: typeof noop; minWidth: number; }; static propTypes: { /** * Custom style for the drag handler */ style: PropTypes.Requireable; /** * The column object to be dragged */ column: PropTypes.Requireable; /** * A callback function when resizing started * The callback is of the shape of `(column) => *` */ onResizeStart: PropTypes.Requireable<(...args: any[]) => any>; /** * A callback function when resizing the column * The callback is of the shape of `(column, width) => *` */ onResize: PropTypes.Requireable<(...args: any[]) => any>; /** * A callback function when resizing stopped * The callback is of the shape of `(column) => *` */ onResizeStop: PropTypes.Requireable<(...args: any[]) => any>; /** * Minimum width of the column could be resized to if the column's `minWidth` is not set */ minWidth: PropTypes.Requireable; }; constructor(props: ColumnResizerProps); componentWillUnmount(): void; render(): React.JSX.Element; _setHandleRef(ref: HTMLDivElement | null): void; _handleClick(e: React.MouseEvent): void; _handleMouseDown(e: React.MouseEvent): void; _handleMouseUp(e: React.MouseEvent): void; _handleTouchStart(e: React.TouchEvent): void; _handleTouchEnd(e: React.TouchEvent): void; _handleDragStart(e: any): void; _handleDragStop(e: any): void; _handleDrag(e: any): void; } export default ColumnResizer;