export interface UseZoomReturn { /** * Current zoom level as reported by the web runtime via VIEW_CHANGED. * `null` before the viewer is initialised or if VIEW_CHANGED hasn't fired. */ zoom: number | null; /** * Current map center [lat, lng] as reported by the web runtime. * `null` before the first VIEW_CHANGED event. */ center: [number, number] | null; /** * Pan and zoom the map to the given position. * * @param center - Map center as [latitude, longitude]. * @param zoom - Target zoom level. */ setView: (center: [number, number], zoom: number) => void; } /** * Hook to read the current zoom / pan state and control the map view. * * Zoom and center are kept in sync with the web runtime via VIEW_CHANGED * bridge messages that `EdgePDFViewer` writes back to the context. * * @example * ```tsx * function ZoomDisplay() { * const { zoom, center, setView } = useZoom(); * * return ( * * Zoom: {zoom ?? '…'} *