pdf-annotator-react
Version:
A React component library for PDF annotation
35 lines (34 loc) • 1.35 kB
TypeScript
import React from 'react';
import { Annotation, AnnotationMode, CategoryItem, CustomCategory } from '../types';
export interface PdfAnnotatorRef {
getAnnotationsJSON: () => string;
selectAnnotationById: (annotationId: string) => boolean;
}
export declare const PdfAnnotator: React.ForwardRefExoticComponent<{
url: string;
annotations?: Annotation[];
scale?: number;
pageNumber?: number;
onDocumentLoadSuccess?: (numPages: number) => void;
onPageChange?: (pageNumber: number) => void;
annotationMode?: AnnotationMode;
onAnnotationModeChange?: (mode: AnnotationMode) => void;
currentCategory?: CategoryItem;
onCategoryChange?: (category: CategoryItem | undefined) => void;
onAnnotationsChange?: (annotations: Annotation[]) => void;
customCategories?: CustomCategory[];
highlightColor?: string;
underlineColor?: string;
strikeoutColor?: string;
rectangleColor?: string;
drawingColor?: string;
textColor?: string;
commentColor?: string;
pinColor?: string;
highlightingColor?: string;
pdfWorkerSrc?: string;
fitToWidth?: boolean;
defaultThickness?: number;
viewOnly?: boolean;
} & import("../types").AnnotationEventCallbacks & React.RefAttributes<PdfAnnotatorRef>>;
export declare const getAnnotationsJSON: (annotations: Annotation[]) => string;