import { useState } from 'react';
import { FloatingScrollBarState } from './FloatingScrollBarState';
import { useFloatingScrollBarContext } from './FloatingScrollBarContext';
export function useFloatingScrollBarState() {
    const { viewportRef, scrollableContentRef, scrollElementRef } = useFloatingScrollBarContext();
    const [floatingPosition, setFloatingPosition] = useState();
    const [scrollContentSize, setScrollContentSize] = useState({
        width: 0,
    });
    const [scrollContentPosition, setScrollContentPosition] = useState({
        left: 0,
        width: undefined,
    });
    const [state] = useState(() => new FloatingScrollBarState({
        setFloatingPosition,
        setScrollContentSize,
        setScrollContentPosition,
        viewportRef,
        scrollElementRef,
        scrollableContentRef,
    }));
    return {
        state,
        floatingPosition,
        scrollContentSize,
        scrollContentPosition,
    };
}
//# sourceMappingURL=useFloatingScrollBarState.js.map