pdf-annotator-react
Version:
A React component library for PDF annotation
36 lines (35 loc) • 1.65 kB
TypeScript
import { Annotation, AnnotationMode, AnnotationType, AnnotationRect, Point, AnnotationEventCallbacks } from '../types';
import { CompetenciaInterface } from 'lingapp-revisao-redacao';
interface UseAnnotationsProps extends AnnotationEventCallbacks {
initialAnnotations?: Annotation[];
annotationMode?: AnnotationMode;
currentCategory?: CompetenciaInterface;
highlightColor?: string;
underlineColor?: string;
strikeoutColor?: string;
rectangleColor?: string;
drawingColor?: string;
textColor?: string;
commentColor?: string;
pinColor?: string;
highlightingColor?: string;
customCategories?: CompetenciaInterface[];
thickness?: number;
}
export declare const useAnnotations: ({ initialAnnotations, annotationMode, currentCategory, onAnnotationCreate, onAnnotationUpdate, onAnnotationDelete, onAnnotationSelect, 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 {};