/**
 * The real, native-backed handle. Delegates every method on
 * `MapmapNavModule` straight to the native `MapmapNav` module (CONTRACTS.md
 * §2) via `requireNativeModule`, and exposes the same `addListener`/
 * `removeAllListeners` surface `expo-modules-core`'s native modules provide
 * at runtime for the four bridge events.
 *
 * Importing this file requires a native Expo/React Native runtime (it pulls
 * in `expo`, which pulls in `react-native`) — it cannot be imported from
 * Vitest/plain Node. Tests exercise `mock.ts` instead; see mock.test.ts.
 */
import { requireNativeModule } from "expo";

import type { MapmapNavEvents, MapmapNavModule } from "./MapmapNav.types";
import type { MapmapNavEmitterLike } from "./emitter";

/** Native module name per CONTRACTS.md: `MapmapNav`. */
const NATIVE_MODULE_NAME = "MapmapNav";

export type NativeMapmapNavModule = MapmapNavModule & MapmapNavEmitterLike<MapmapNavEvents>;

export const MapmapNav: NativeMapmapNavModule = requireNativeModule<NativeMapmapNavModule>(NATIVE_MODULE_NAME);
