import React from 'react'; interface UseTableScrollProps { /** * Reference to the table container element. This is the element that contains * the table and whose position will be adjusted. */ tableContainerRef?: React.RefObject; /** * Reference to the scrollable container element. This is the parent element * that has scrolling capabilities. */ scrollContainerRef?: React.RefObject; /** * Array of values that, when changed, will trigger the scroll adjustment. * Include all values that might affect table height or position to ensure * proper scroll adjustment (e.g., filters, sorting, pagination state). */ dependencies?: unknown[]; } /** * A hook that manages scrolling behavior for tables within a scrollable container. * * This hook ensures proper positioning of tables when their content changes, * particularly when using sticky headers, by automatically adjusting the scroll position. * It reads the `--data-table-sticky-header-offset` CSS variable from the table container * to determine the sticky header offset for correct positioning. * * The scroll adjustment is triggered whenever any of the dependencies change, * but is skipped on the first render to prevent unwanted initial scrolling. * @param props - The hook parameters * @returns An object containing the handleTableScroll function that can be called manually */ export declare const useTableScroll: ({ tableContainerRef, scrollContainerRef, dependencies, }: UseTableScrollProps) => { /** * Function to manually trigger the table scroll adjustment. * This can be useful in cases where you need to adjust the scroll * position outside of the dependency changes. */ handleTableScroll: () => void; }; export {};