/** * `useKeewanoNavigation` hook for `@react-navigation/native`. Wires * the host's `NavigationContainer` ref into the SDK so screen * transitions emit SCENE_LOADED / SCENE_UNLOADED events. * * SCENE_* (not WINDOW_*) is the wire-protocol distinction: scenes * are full-screen route transitions, windows are in-screen modals / * popups the host explicitly reports via `Keewano.reportWindowOpen`. * * Usage: * ```tsx * const navigationRef = useNavigationContainerRef(); * useKeewanoNavigation(navigationRef); * return ...; * ``` * * Behaviour: * - On the first observed route, emits SCENE_LOADED(name). * - On every subsequent transition where the route name changes, * emits SCENE_UNLOADED(previous) THEN SCENE_LOADED(current). * - Unchanged-name transitions (route params change but the screen * does not) are a no-op. * - When the ref becomes `null` (NavigationContainer unmounted), * the subscription is removed without emitting SCENE_UNLOADED - * unmount is not a user-visible screen close. * - The cursor lives on the SDK runtime, not in module scope or a * `useRef`. Strict Mode / Fast Refresh remounts of the host * component do NOT emit a duplicate SCENE_LOADED for the same * screen, and `Keewano.shutdown()` resets the cursor so a * subsequent `Keewano.init()` starts clean. * * The hook accepts a structural `NavigationContainerRefLike` shape * so `@react-navigation/native` is not a hard dependency; any object * with the matching `.current` API works. */ import type { NavigationContainerRefLike } from './types/useKeewanoNavigation'; /** * Subscribe to navigation state changes on `ref.current`. The effect * is keyed on the container instance itself, not the ref wrapper, so * a late `ref.current` assignment (initial null mount that fills in * after first render) or a container swap (key-based remount, lazy * NavigationContainer mount) re-runs the subscription cleanly. */ declare function useKeewanoNavigation(ref: NavigationContainerRefLike): void; export type { NavigationContainerLike, NavigationContainerRefLike, NavigationRouteLike, } from './types/useKeewanoNavigation'; export { useKeewanoNavigation };