import { PdfItemType, PdfItemCategory, AnnotationBorderStyle, StampAnnotationColor, PdfActionType, StampType, WidgetType, PdfPageLayoutMode, PdfFitMode } from './enums'; export interface PdfViewerApiOptions { user?: string; viewOnly?: boolean; onlyAuthorCanEdit: boolean; allowPopups: boolean; annotationPermissionCallback?: AnnotationPermissionCallback; } export interface PdfDestination { destinationType: number; pageNumber: number; left: number | null; top: number | null; zoom: number | null; } export interface PdfItemsOnPage { page: number; itemCategory: number; items: PdfItem[]; } export interface ScrollPosition { x: number; y: number; } export interface MaxScrollPosition { x: number; y: number; } export interface Point { x: number; y: number; } export interface PageImage { page: number; imageData: ImageData; } export interface PdfPageSize { width: number; height: number; } export interface PdfPoint { pdfX: number; pdfY: number; page: number; } export interface PdfRect { pdfX: number; pdfY: number; pdfW: number; pdfH: number; page: number; } export interface QuadrilateralOnPage { pageNumber: number; bottomLeft: Point; bottomRight: Point; topRight: Point; topLeft: Point; } export interface TextSelection { quadrilaterals: QuadrilateralOnPage[]; startPoint: PdfPoint; endPoint: PdfPoint; } export interface ScreenPointToPdfPointResult { pdfPoint: PdfPoint; isOnPage: boolean; } export interface Rect { x: number; y: number; w: number; h: number; } export interface PdfItem { id: number; itemCategory: PdfItemCategory; } export interface PdfPositionalItem extends PdfItem { pdfRect: PdfRect; } export interface TextFragment extends PdfPositionalItem { pdfRect: PdfRect; defaultRotation: 0; glyphOffsets: number[]; text: string; } export interface AnnotationPopup extends Annotation { isOpen: boolean; } export interface AnnotationBehaviors { selectable: boolean; editable: boolean; deletable: boolean; movable: boolean; rotatable: boolean; resizable: boolean; aspectRatioChangeable: boolean; canHavePopup: boolean; link: boolean; text: boolean; } export interface Annotation extends PdfPositionalItem { itemType: PdfItemType; modificationDate: Date | null; creationDate: Date | null; border: AnnotationBorder; page: number; content: string | null; subject: string | null; color: string | null; author: string; popup: AnnotationPopup; identifier: string | null; privateData: string | null; sourceTag: string | null; behaviors: AnnotationBehaviors; setLock(isLocked: boolean): void; isLocked(): boolean; isHidden(): boolean; setHidden(hidden: boolean): void; isReadOnly(): boolean; } export interface LinkAnnotation extends PdfPositionalItem { actionType: PdfActionType; destination: PdfDestination | null; uri: string | null; } export interface InkAnnotation extends Annotation { inkList: { x: number; y: number; }[][]; } export interface StampAnnotation extends Annotation { rotation: number; } export interface ShapeAnnotation extends Annotation { fillColor: string; } export interface HighlightAnnotation extends Annotation { markedText: string; quadrilaterals: QuadrilateralOnPage[]; } export interface FreetextAnnotation extends Annotation { rotation: number; fontSize: number; fontName: string; fontColor: string; richText: string | null; border: AnnotationBorder; } export interface WidgetAnnotation extends Annotation { widgetType: WidgetType; widget: any; pdfDocument: any; } export interface StampInfoArgs { stampType: StampType; stampText: string | null; name: string | null; } export interface StampInfo { stampType: StampType; name: string | null; stampText: string | null; aspectRatio: number; } export interface AnnotationBorder { width: number; style: AnnotationBorderStyle; } export interface ItemArgs { category: PdfItemCategory; } export interface AnnotationArgs { itemType: PdfItemType; page: number; pdfRect: PdfRect; color: string | null; author?: string; content?: string; subject?: string; } export interface InkAnnotationArgs extends AnnotationArgs { border: AnnotationBorder; inkList: number[][]; } export interface FreeTextAnnotationArgs extends AnnotationArgs { border: AnnotationBorder; richtext: string | null; fontName: string | null; fontColor: string | null; fontSize: number | null; } export interface TextStampAnnotationArgs extends AnnotationArgs { stampColor?: StampAnnotationColor; stampText: string; stampName?: string | null; } export interface ImageStampAnnotationArgs extends AnnotationArgs { imageId: number; } export interface HighlightAnnotationArgs extends AnnotationArgs { quadrilaterals: QuadrilateralOnPage[]; } export interface ShapeDrawingAnnotationArgs extends AnnotationArgs { border?: AnnotationBorder; fillColor: string | null; } export interface CircleAnnotationArgs extends ShapeDrawingAnnotationArgs { } export interface SquareAnnotationArgs extends ShapeDrawingAnnotationArgs { } export interface OutlineItem extends PdfItem { destination: PdfDestination; hasDescendants: boolean; level: number; title: string; } export interface DeletedItem { id: number; page: number; categoryType: PdfItemCategory; } export interface BoundingBox { left: number; bottom: number; right: number; top: number; } export interface TransformMatrix { a: number; b: number; c: number; d: number; e: number; f: number; } export interface ContentElement extends PdfPositionalItem { bbox: BoundingBox; tm: TransformMatrix; } export interface InputDocument { sourceTag?: string | null; } export interface HttpOptions { headers?: { [key: string]: string; }; mode?: 'cors' | 'no-cors' | 'same-origin'; cache?: 'default' | 'no-cache' | 'reload' | 'force-cache' | 'only-if-cached'; credentials?: 'include' | 'same-origin' | 'omit'; redirect?: 'manual' | 'follow' | 'error'; referrerPolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'; } export interface InputUri extends InputDocument { uri: string; httpOptions?: HttpOptions; } export interface InputFile extends InputDocument { data: Blob | File | Uint8Array; } export interface ViewOptions { initialFitMode?: PdfFitMode; initialPageLayoutMode?: PdfPageLayoutMode; initialPageNumber?: number; initialZoom?: number; } export interface RenderOptions { formFieldHighlightColor?: string; formFieldRequiredHighlightColor?: string; } export declare enum FileType { Pdf = 0, Fdf = 1 } export type AnnotationFilterCallback = (annotation: Annotation) => boolean; export interface SaveOptions { fileType?: FileType; annotationFilter?: AnnotationFilterCallback; } export type AnnotationPermissionCallback = (annotation: Annotation, author?: string) => boolean;