/** * Composable for map navigation (go-to coordinates) and focus search. * MapView registers the implementation on mount; MapSearch and shortcuts use it. */ type GoToCoordsFn = (mapId: number, x: number, y: number, zoom?: number) => void const goToImpl = ref(null) const focusSearchImpl = ref<(() => void) | null>(null) export function useMapNavigate() { function setGoTo(fn: GoToCoordsFn | null) { goToImpl.value = fn } function goToCoords(mapId: number, x: number, y: number, zoom?: number) { goToImpl.value?.(mapId, x, y, zoom) } function setFocusSearch(fn: (() => void) | null) { focusSearchImpl.value = fn } function focusSearch() { focusSearchImpl.value?.() } return { setGoTo, goToCoords, setFocusSearch, focusSearch } }