import type { PDFDocumentProxy } from "pdfjs-dist";
import type { EventBus, PDFFindController, PDFViewer } from "pdfjs-dist/web/pdf_viewer.mjs";
import React from "react";
import type { RefObject } from "react";
import type { AnnotationPortalTarget } from "./hooks/usePdfAnnotationPortals.js";
import type { UsePdfViewerSearchResult } from "./hooks/usePdfViewerSearch.js";
import type { OutlineItem, PdfAnnotation, PdfViewerInstanceOptions, SidebarMode } from "./types.js";
/** The shape of the value provided by {@link PdfViewerProvider}. */
export interface PdfViewerContextValue {
	document: PDFDocumentProxy | undefined;
	numPages: number;
	loading: boolean;
	error: Error | undefined;
	containerRef: RefObject<HTMLDivElement>;
	viewerRef: RefObject<HTMLDivElement>;
	currentPage: number;
	scrollToPage: (page: number) => void;
	scale: number;
	setScale: (scale: number) => void;
	autoSize: boolean;
	setAutoSize: (autoSize: boolean) => void;
	zoomIn: () => void;
	zoomOut: () => void;
	toggleAutoSize: () => void;
	rotation: number;
	rotateLeft: () => void;
	rotateRight: () => void;
	sidebarOpen: boolean;
	sidebarMode: SidebarMode;
	setSidebarMode: (mode: SidebarMode) => void;
	toggleSidebar: () => void;
	search: UsePdfViewerSearchResult;
	outlineItems: OutlineItem[];
	download: (filename?: string) => void;
	portalTargets: AnnotationPortalTarget[];
	highlightEnabled: boolean;
	highlightModeActive: boolean;
	toggleHighlightMode: () => void;
	hasFormFields: boolean;
	submitFormData: () => void;
	annotations: PdfAnnotation[];
	annotationsByPage: Record<number, PdfAnnotation[]>;
	onAnnotationClick: ((annotation: PdfAnnotation) => void) | undefined;
	enableDownload: boolean;
	enableFormSave: boolean;
	outlineIcons: Partial<Record<number, React.ComponentType>> | undefined;
	pdfViewerRef: RefObject<PDFViewer | null>;
	eventBusRef: RefObject<EventBus | null>;
	findControllerRef: RefObject<PDFFindController | null>;
}
export interface PdfViewerProviderProps {
	value: PdfViewerContextValue;
	children: React.ReactNode;
}
/** Provides {@link PdfViewerContextValue} to descendant components. */
export declare function PdfViewerProvider({ value, children }: PdfViewerProviderProps): React.ReactElement;
/**
* Returns the nearest {@link PdfViewerContextValue} from a {@link PdfViewerProvider}.
* Throws if called outside a provider.
*/
export declare function usePdfViewerContext(): PdfViewerContextValue;
/**
* Consumer-facing setup hook analogous to react-hook-form's `useForm()`.
* Accepts viewer options and returns a {@link PdfViewerContextValue} suitable
* for passing to {@link PdfViewerProvider}.
*/
export declare function usePdfViewerInstance(options: PdfViewerInstanceOptions): PdfViewerContextValue;
