import { type DOMAttributes } from "react";
type ResizeProps = {
    /**
     * Whether the column should be resizable by the user.
     *
     * **NB:** This is always disabled when `layout="auto"` on the root component.
     * @default true
     */
    resizable?: boolean;
    /**
     * Whether the column should automatically resize to fit its content. **Runs only once.**
     *
     * `onWidthChange` will be called with the new size. `minWidth` and `maxWidth` will be respected.
     *
     * If you don't need manual resizing support and want most of the columns to resize automatically,
     * consider using `layout="auto"` on the root instead for better performance.
     *
     * **NB:** This can cause a layout shift. Set a good initial width with `width` or `defaultWidth` to mitigate this.
     */
    autoResizeOnce?: boolean;
    /**
     * Minimum width of the column when resizing. Only used when `resizable` or `autoResizeOnce` is enabled.
     * @default 40
     */
    resizeMin?: number;
    /**
     * Maximum width of the column when resizing. Only used when `resizable` or `autoResizeOnce` is enabled.
     */
    resizeMax?: number;
    /**
     * Controlled width of the column. (Does not respect `resizeMin` and `resizeMax`.)
     *
     * Should only be used to fully control column width state. Otherwise, use `default` and let the component handle resizing.
     *
     * **NB:** Percentage as initial width does not work well with resizing.
     */
    value?: number | string;
    /**
     * Initial width of the column. Only used when `value` is not set.
     * (Does not respect `resizeMin` and `resizeMax`.)
     *
     * **NB:** Percentage as initial width does not work well with resizing.
     * @default 140px
     */
    defaultValue?: number | string;
    /**
     * Called when the column width changes.
     * @param width New width in pixels.
     */
    onChange?: (width: number) => void;
};
type TableColumnResizeArgs = ResizeProps & {
    thRef: React.RefObject<HTMLTableCellElement | null>;
    colSpan: number | undefined;
};
type TableColumnResizeResult = {
    width: number | string;
    resizeHandlerProps: {
        onMouseDown: DOMAttributes<HTMLButtonElement>["onMouseDown"];
        onTouchStart: DOMAttributes<HTMLButtonElement>["onTouchStart"];
        onKeyDown: DOMAttributes<HTMLButtonElement>["onKeyDown"];
        onBlur: DOMAttributes<HTMLButtonElement>["onBlur"];
        onDoubleClick: DOMAttributes<HTMLButtonElement>["onDoubleClick"];
        onClick: DOMAttributes<HTMLButtonElement>["onClick"];
    };
    isResizingWithKeyboard: boolean;
    enabled: true;
} | {
    width?: number | string;
    enabled: false;
};
/**
 * TODO:
 * - Auto-width mode is hard now since that might cause layout-shifts on mount. But would be preferable to
 * be able to set "1fr" or similar and have it fill remaining space.
 */
declare function useTableColumnResize({ resizable, autoResizeOnce, resizeMin, resizeMax, value, defaultValue, onChange, thRef, colSpan, }: TableColumnResizeArgs): TableColumnResizeResult;
export { useTableColumnResize };
export type { ResizeProps };
