import * as React from 'react'; /** * Transition navigation (web), modelled on TanStack Router: a navigation keeps * the current screen on display until the destination's code and preloaded * data are ready, instead of mounting the destination and showing its * Suspense fallback. * * Why a wait before navigating and not "just startTransition": React keeps the * old UI during a transition only for Suspense boundaries that are already on * screen. Every pushed scene mounts new boundaries (the scene's own and the * stack's freeze boundary), so a destination that suspends always commits its * fallback — and once a fallback is shown React holds the reveal of the real * content until 300 ms after it (FALLBACK_THROTTLE_MS). Waiting for the screen * to be ready inside an async transition avoids both. * * The wait is capped (`pendingMs`, default 1000 ms like TanStack's * `defaultPendingMs`): after that the destination commits and shows its own * fallback, exactly like before. */ export type NavigationTransition = { start: React.TransitionStartFunction; /** Increases with every navigation that waits; only the latest commits. */ latest: { current: number; }; pendingMs: number; }; export declare const defaultNavigationPendingMs = 1000; export declare const NavigationTransitionContext: React.Context; export declare function NavigationTransitionProvider({ pendingMs, children, }: { pendingMs?: number; children: React.ReactNode; }): React.JSX.Element; /** * True while a navigation is waiting for its destination (web) or rendering * it in a transition. Pass `delayMs` to only report a navigation that takes * longer than that, so a quick switch never flashes an indicator. */ export declare function useNavigationPending(delayMs?: number): boolean; /** Resolves when `promise` settles or after `ms`, whichever comes first. */ export declare function settledWithin(promise: Promise, ms: number): Promise; /** * Runs `commit` (the navigate call) as a transition once `ready` settles, * capped at `transition.pendingMs`; immediately when `ready` is null. Only the * latest call commits: a second navigation while the first still waits wins, * like the last click in a browser. */ export declare function commitWhenReady(transition: NavigationTransition, ready: Promise | null, commit: () => void): void; //# sourceMappingURL=navigationTransition.d.ts.map