import React from "react"; import { Blocker, BlockerFunction } from "react-router"; /** * Owns the single React Router blocker for the whole app. * * React Router only honours **one** blocker at a time: `shouldBlockNavigation` * picks the last-registered blocker function and silently ignores every other * one (it only logs a dev warning). Because blockers register in a `useEffect`, * the winner is whichever surface mounted most recently — so an unsaved-changes * guard could be disabled by an unrelated component mounting after it. * * This provider registers the only `useBlocker` in the tree and multiplexes it, * so every surface that needs to guard navigation gets a say regardless of * mount order. Surfaces register through {@link useNavigationBlocker}. */ export declare function NavigationBlockerProvider({ children }: { children: React.ReactNode; }): React.JSX.Element; /** * Guard navigation with `predicate`, sharing the app-wide blocker. * * Returns a {@link Blocker} that is only ever in the `blocked` state when *this* * registration is what blocked the navigation — so several guards can coexist * without each of them popping a dialog. * * Returns an idle blocker when no {@link NavigationBlockerProvider} is mounted * above, rather than competing for React Router's single blocker slot. */ export declare function useNavigationBlocker(predicate: BlockerFunction): Blocker;