pdf-annotator-react
Version:
A React component library for PDF annotation
35 lines (34 loc) • 1.73 kB
TypeScript
import { Annotation, AnnotationMode, AnnotationType, AnnotationRect, Point, AnnotationEventCallbacks, CategoryItem } from '../types';
interface UseAnnotationsProps extends AnnotationEventCallbacks {
initialAnnotations?: Annotation[];
annotationMode?: AnnotationMode;
currentCategory?: CategoryItem;
highlightColor?: string;
underlineColor?: string;
strikeoutColor?: string;
rectangleColor?: string;
drawingColor?: string;
textColor?: string;
commentColor?: string;
pinColor?: string;
highlightingColor?: string;
customCategories?: CategoryItem[];
thickness?: number;
}
export declare const useAnnotations: ({ initialAnnotations, annotationMode, currentCategory, onAnnotationCreate, onAnnotationUpdate, onAnnotationDelete, onAnnotationSelect, highlightColor, underlineColor, strikeoutColor, rectangleColor, drawingColor, textColor, commentColor, pinColor, highlightingColor, customCategories, thickness, }: UseAnnotationsProps) => {
annotations: Annotation[];
selectedAnnotation: Annotation | null;
currentMode: AnnotationMode;
drawingPoints: Point[];
isDrawing: boolean;
startPoint: Point | null;
handlePointerDown: (point: Point, pageIndex: number) => void;
handlePointerMove: (point: Point, pageIndex: number) => void;
handlePointerUp: (point: Point, pageIndex: number) => void;
createAnnotation: (type: AnnotationType, rect: AnnotationRect, content?: string, points?: Point[]) => Annotation;
updateAnnotation: (id: string, updates: Partial<Annotation>) => void;
deleteAnnotation: (id: string) => void;
selectAnnotation: (annotation: Annotation | null) => void;
setMode: (mode: AnnotationMode) => void;
};
export {};