import { useContext } from 'react';
import '../init';
import { windowIsAvailable } from '../utils';
import { PreviewManagerContext } from '../components/Preview/Contexts';
/**
 * @example const { createPreview } = usePreviewManager();
 * @returns PreviewManagerContext
 */
const usePreviewManager = () => {
    const context = windowIsAvailable
        ? window.cosmos.previewManagerContext ?? PreviewManagerContext
        : PreviewManagerContext;
    return useContext(context);
};
export default usePreviewManager;
//# sourceMappingURL=usePreviewManager.js.map