pdf-annotator-react
Version:
A React component library for PDF annotation
31 lines (30 loc) • 1.41 kB
TypeScript
import React from 'react';
import { Annotation, AnnotationMode, AnnotationType } from '../../types';
export interface BaseAnnotationProps {
annotation: Annotation;
isSelected: boolean;
onClick?: (annotation: Annotation) => void;
scale: number;
}
export declare abstract class BaseAnnotationComponent<P extends BaseAnnotationProps = BaseAnnotationProps> extends React.Component<P> {
handleClick: (e: React.MouseEvent) => void;
getScaledRect(): {
x: number;
y: number;
width: number;
height: number;
pageIndex: number;
};
static supportsAnnotationType(type: AnnotationType): boolean;
static getAnnotationModeForType(type: AnnotationType): AnnotationMode | null;
}
type AnnotationComponentConstructor = (typeof BaseAnnotationComponent) & {
new (props: BaseAnnotationProps): BaseAnnotationComponent;
supportsAnnotationType(type: AnnotationType): boolean;
getAnnotationModeForType(type: AnnotationType): AnnotationMode | null;
};
export declare function registerAnnotationComponent(component: AnnotationComponentConstructor): void;
export declare function getComponentForAnnotationType(type: AnnotationType): AnnotationComponentConstructor | null;
export declare function getAnnotationModeForType(type: AnnotationType): AnnotationMode | null;
export declare function getAllSupportedAnnotationTypes(): AnnotationType[];
export {};