import { type JSX } from 'react'; import { type StyleProp, type ViewStyle } from 'react-native'; import type { ImageInfo, Marker, MarkerIcon } from '@edgepdf/types'; import type { Source as PMTilesSource } from 'pmtiles'; import type { ZoomControlsPosition } from './bridge-types'; import { handleRangeRequest, pmtilesSourceToReader, type NativeRangeReader } from './range-reader'; export { handleRangeRequest, pmtilesSourceToReader }; export type { NativeRangeReader }; export interface EdgePDFViewerProps { /** Image dimensions and tile parameters for the PDF. */ imageInfo: ImageInfo; /** * PMTiles source object (high-level). When provided, byte range requests * from the web runtime are fulfilled by calling `source.getBytes()` natively. * Takes precedence over `offlineReader`. */ pmtilesSource?: PMTilesSource; /** * Low-level byte-range reader. Use when you need full control over how * PMTiles bytes are fetched (e.g. custom auth, local file access). * Ignored when `pmtilesSource` is provided. */ offlineReader?: NativeRangeReader; /** * Override the key used to identify the PMTilesBridgeSource inside the web * runtime. Defaults to `'native://pmtiles-archive'` which works for native- * side readers. Pass a URL string only when the web runtime should use a * different key for coordinating requests. */ pmtilesKey?: string; /** Initial zoom level passed to the web runtime on init. */ initialZoom?: number; /** Show zoom in/out buttons (default: true) */ showZoomControls?: boolean; /** Position of the zoom controls (default: 'top-right') */ zoomControlsPosition?: ZoomControlsPosition; /** Show current zoom level indicator inside the zoom controls (default: true) */ showZoomLevel?: boolean; /** Allow creating annotations by tapping the map (default: true) */ enableAnnotation?: boolean; /** Show the edit button on marker popups (default: true) */ showEditButton?: boolean; /** Show the delete button on marker popups (default: true) */ showDeleteButton?: boolean; /** * Icon given to markers created by tapping the map. Omit to keep the legacy * PNG pin. Changing it after mount is applied without re-initialising. */ defaultMarkerIcon?: MarkerIcon; style?: StyleProp; testID?: string; /** * Directory the WebView may read via `file://`. Must be a directory URL with * a trailing slash, e.g. `` `file://${RNFS.DocumentDirectoryPath}/` `` — * not bare `file://`. Required on iOS (WKWebView `allowingReadAccessTo`); * also pass on Android when loading local files from disk. * * Set this to the folder that contains any local files the embedded viewer * loads (Documents, Caches, bundle path, etc.). The host app should compute * the path (e.g. via `react-native-fs` or Expo FileSystem) and pass it in. */ allowingReadAccessToURL?: string; /** Fires when the web runtime signals it is ready to receive commands. */ onReady?: () => void; /** Fires when the web runtime reports an unrecoverable error. */ onError?: (error: Error) => void; /** Fires when the user taps the map (not on a marker). */ onMapClick?: (coords: { x: number; y: number; }) => void; /** Fires when the map viewport changes (pan / zoom). */ onViewChange?: (center: [number, number], zoom: number) => void; /** Fires when a new marker is created inside the web runtime. */ onMarkerAdd?: (marker: Marker) => void; /** Fires when an existing marker is clicked. */ onMarkerClick?: (markerId: string) => void; /** Fires when a marker label / data is edited. */ onMarkerUpdate?: (marker: Marker) => void; /** Fires when a marker is deleted. */ onMarkerDelete?: (markerId: string) => void; /** Enable fullscreen functionality (default: false) */ enableFullscreen?: boolean; /** Position of the fullscreen toggle control (default: 'top-right') */ fullscreenControlPosition?: ZoomControlsPosition; } /** * EdgePDFViewer — renders a PDF tile map inside a WebView and wires the * bridge protocol between the web runtime and native React Native code. * * **Must be used inside a `ViewerProvider`.** * * Props use a flat shape (no nested `config` object). Provide either * `pmtilesSource` (high-level) or `offlineReader` (low-level) to service * byte-range requests from the web runtime. * * @example * ```tsx * * console.log('ready')} * /> * * ``` */ export declare function EdgePDFViewer({ imageInfo, pmtilesSource, offlineReader, pmtilesKey, initialZoom, showZoomControls, zoomControlsPosition, showZoomLevel, enableAnnotation, defaultMarkerIcon, showEditButton, showDeleteButton, style, testID, allowingReadAccessToURL, onReady, onError, onMapClick, onViewChange, onMarkerAdd, onMarkerClick, onMarkerUpdate, onMarkerDelete, enableFullscreen, fullscreenControlPosition, }: EdgePDFViewerProps): JSX.Element; //# sourceMappingURL=edge-pdf-viewer.d.ts.map