react-pdf-highlighter
Version:
Set of React components for PDF annotation
28 lines (27 loc) • 869 B
TypeScript
import React, { Component } from "react";
import type { T_PDFJS_Document } from "../types";
declare type Props = {
url: string;
beforeLoad: JSX.Element;
errorMessage?: JSX.Element;
children: (pdfDocument: T_PDFJS_Document) => JSX.Element;
onError?: (error: Error) => void;
cMapUrl?: string;
cMapPacked?: boolean;
};
declare type State = {
pdfDocument: T_PDFJS_Document | null;
error: Error | null;
};
export declare class PdfLoader extends Component<Props, State> {
state: State;
documentRef: React.RefObject<HTMLElement>;
componentDidMount(): void;
componentWillUnmount(): void;
componentDidUpdate({ url }: Props): void;
componentDidCatch(error: Error, info?: any): void;
load(): void;
render(): JSX.Element;
renderError(): React.FunctionComponentElement<any> | null;
}
export default PdfLoader;