import * as React from 'react';
export const useIsoLayoutEffect = typeof window === 'object' && !!window.document ? React.useLayoutEffect : React.useEffect;
export const useBrowserLayoutEffect = typeof window === 'object' && !!window.document ? React.useLayoutEffect : () => { };
export const useSyncStore = (store) => React.useSyncExternalStore(store.subscribe, store.getSnapshot);
const emptySyncStore = {
    getSnapshot: () => undefined,
    subscribe: () => () => { },
};
export const useSyncStoreOpt = (store = emptySyncStore) => React.useSyncExternalStore(store.subscribe, store.getSnapshot);
export const useTimeout = (ms, deps = [ms]) => {
    const [ready, setReady] = React.useState(false);
    React.useEffect(() => {
        if (ready)
            setReady(false);
        const timer = setTimeout(() => {
            setReady(true);
        }, ms);
        return () => {
            clearTimeout(timer);
        };
        // biome-ignore lint: useExhaustiveDependencies: want to control deps manually
    }, deps);
    return ready;
};
//# sourceMappingURL=hooks.js.map