import React, { PureComponent, PointerEvent } from "react"; import "pdfjs-dist/web/pdf_viewer.css"; import "../style/pdf_viewer.css"; import "../style/PdfHighlighter.css"; import { T_Position, T_ScaledPosition, T_Highlight, T_Scaled, T_LTWH, T_EventBus, T_PDFJS_Viewer, T_PDFJS_Document, T_PDFJS_LinkService, T_ViewportHighlightGeneric } from "../types"; declare type State = { ghostHighlight: { position: T_ScaledPosition; content?: { image: string; }; } | undefined | null; isCollapsed: boolean; range: Range | undefined | null; tip: { highlight: T_ViewportHighlightGeneric; callback: (highlight: T_ViewportHighlightGeneric) => React.ReactElement; } | undefined | null; tipPosition: T_Position | null; tipChildren: React.ReactElement | null | undefined; isAreaSelectionInProgress: boolean; scrolledToHighlightId: string; }; declare type Props = { highlightTransform: (highlight: T_ViewportHighlightGeneric, index: number, setTip: (highlight: T_ViewportHighlightGeneric, callback: (highlight: T_ViewportHighlightGeneric) => React.ReactElement) => void, hideTip: () => void, viewportToScaled: (rect: T_LTWH) => T_Scaled, screenshot: (position: T_LTWH) => string, isScrolledTo: boolean) => React.ReactElement; highlights: Array; onScrollChange: () => void; scrollRef: (scrollTo: (highlight: T_Highlight) => void) => void; pdfDocument: T_PDFJS_Document; pdfScaleValue: string; onSelectionFinished: (position: T_ScaledPosition, content: { text?: string; image?: string; }, hideTipAndSelection: () => void, transformSelection: () => void) => React.ReactElement; enableAreaSelection: (event: MouseEvent) => boolean; }; declare class PdfHighlighter extends PureComponent, State> { static defaultProps: { pdfScaleValue: string; }; state: State; eventBus: T_EventBus; linkService: T_PDFJS_LinkService; viewer: T_PDFJS_Viewer | undefined; resizeObserver: ResizeObserver | null; containerNode: HTMLDivElement | undefined | null; unsubscribe: () => void; constructor(props: Props); componentDidMount(): void; attachRef: (ref: HTMLDivElement | undefined | null) => void; componentDidUpdate(prevProps: Props): void; init(): void; componentWillUnmount(): void; findOrCreateHighlightLayer(page: number): Element | null; groupHighlightsByPage(highlights: Array): { [pageNumber: string]: Array; }; showTip(highlight: T_ViewportHighlightGeneric, content: React.ReactElement): void; scaledPositionToViewport({ pageNumber, boundingRect, rects, usePdfCoordinates, }: T_ScaledPosition): T_Position; viewportPositionToScaled({ pageNumber, boundingRect, rects, }: T_Position): T_ScaledPosition; screenshot(position: T_LTWH, pageNumber: number): string; renderHighlights(nextProps?: Props): void; hideTipAndSelection: () => void; setTip(position: T_Position, inner: React.ReactElement): void; renderTip: () => JSX.Element | null; onTextLayerRendered: () => void; scrollTo: (highlight: T_Highlight) => void; onDocumentReady: () => void; onSelectionChange: () => void; onScroll: () => void; onMouseDown: (event: PointerEvent) => void; handleKeyDown: (event: KeyboardEvent) => void; afterSelection: () => void; debouncedAfterSelection: () => void; toggleTextSelection(flag: boolean): void; handleScaleValue: () => void; debouncedScaleValue: () => void; render(): JSX.Element; } export default PdfHighlighter;