import { AnnotationBase, StampAnnotation } from "../Annotations/AnnotationTypes"; import { DataStorage } from "../DataStorage/DataStorage"; import { FontFormat } from "../Models/ViewerTypes"; import { SharedRef } from "./SharedRef"; export declare function generateUid(caller?: string): string; export declare function updateInitialRectPosition(annotation: AnnotationBase, newXY?: number[]): void; export declare function resetStampAspectRatio(imageData: Uint8Array, viewer: any, pageIndex: number, originalNode: StampAnnotation, imageDpi?: number, select?: boolean): Promise<{ pageIndex: number; annotation: AnnotationBase; } | null>; export declare function isTypedArray(arr: any): boolean; /** * Merge everything from sourceObj to destinationObj, returns destinationObj. * Note, by default, non-empty primitive values are NOT preserved in the destination object. * @param destinationObj Destination object * @param sourceVal Source object * @param preserveNonEmpty Set to true if you don't want to replace non-empty primitive values. */ export declare function mergeObject(destinationObj: any, sourceVal: any, preserveNonEmpty?: boolean, copyUndefined?: boolean): any; export declare function cloneObject(obj: any): any; export declare function getTransformMatrix(viewBox: number[], rotation: number, scaleX: number, scaleY: number, ignoreRotate?: boolean): number[]; export declare function adjustCoordinates(realViewBox: number[], point: number[], rotation: number, inverse?: boolean, fromBottomLeft?: boolean, scale?: number): number[]; /** * Applies the transform to the rectangle and finds the minimum axially * aligned bounding box. * @param r * @param m */ export declare function getAxialAlignedBoundingBox(r: any, m: any): number[]; /** * Apply matrix transform. * @param p x, y point * @param m transform matrix */ export declare function applyTransform(p: number[], m: number[]): number[]; /** * Apply inverse matrix transformation. * @param p x, y point * @param m transform matrix */ export declare function applyInverseTransform(p: number[], m: number[]): number[]; export declare function inverseTransform(m: number[]): number[]; /** * Converts PDF point to the viewport coordinates. For examples, useful for * converting PDF location into canvas pixel coordinates. * @param {number} x - The x-coordinate. * @param {number} y - The y-coordinate. * @return {Array} Array containing `x` and `y` properties of the * point in the viewport coordinate space. *
See {@link convertToPdfPoint} */ export declare function convertToViewportPoint(x: number, y: number, transform: number[]): number[]; /** * Converts viewport coordinates to the PDF location. For examples, useful * for converting canvas pixel location into PDF one. * @param {number} x - The x-coordinate. * @param {number} y - The y-coordinate. * @return {Array} Array containing `x` and `y` properties of the * point in the PDF coordinate space. *
See {@link convertToViewportPoint} */ export declare function convertToPdfPoint(x: number, y: number, transform: number[]): number[]; /** * Change bounds origin. * @param bounds * @param viewBox * @param destOrigin */ export declare function changeRectangleOrigin(bounds: number[], viewBox: number[], destOrigin?: 'TopLeft' | 'BottomLeft', normalize?: boolean): number[]; export declare function changeOriginToBottom(top: number, view: number[]): number; export declare function changeOriginToTop(bottom: number, view: number[]): number; /** * Convert a PDF date string to a JavaScript `Date` object. * * The PDF date string format is described in section 7.9.4 of the official * PDF 32000-1:2008 specification. However, in the PDF 1.7 reference (sixth * edition) Adobe describes the same format including a trailing apostrophe. * This syntax in incorrect, but Adobe Acrobat creates PDF files that contain * them. We ignore all apostrophes as they are not necessary for date parsing. * * Moreover, Adobe Acrobat doesn't handle changing the date to universal time * and doesn't use the user's time zone (effectively ignoring the HH' and mm' * parts of the date string). * * @param {string} input * @return {Date|null} */ export declare function pdfDateStringToDate(input?: string | Date): Date | null; /** * Convert various input types to a PDF date string in UTC. * * The PDF date string format is described in section 7.9.4 of the official * PDF 32000-1:2008 specification. The output will follow the PDF date string * format in UTC, without any local time zone information. * * @param {Date | string | any | number} input - The date input, which can be a JavaScript Date object, a date string, a Moment object, or a timestamp (number). * @return {string | null} - The formatted PDF date string in UTC, or null if the input is invalid. */ export declare function dateToPdfDateString(input: Date | string | any | number | undefined): string | null; export declare function formatRelativeDate(date: Date | null, i18n: any, dateFormat?: string): string; export declare function copyStringToClipboard(result: string): void; /** * Formats a date or time based on the provided format string. * * @param date - The date or time value to format. * @param {string} date_time_format - A string indicating the style used to format a date or time. * Examples: "dd-mm-yyyy", "d-m-yy", "mm/dd/yyyy", etc. * @returns {string} The formatted date or time string. */ export declare function formatDateTime(date: Date, date_time_format?: string): string; export declare function humanReadableFileSize(size: number, in17n: any): string; export declare function getDefaultUserName(): string; export declare function getActiveUserName(options?: any): string; export declare function setActiveUserName(userName: string, setBy: 'annotation_editor' | 'user'): void; export declare function attachHeadJs(src: string, id?: string, ownerDoc?: ShadowRoot | Document): Promise; export declare function stripHtmlTags(s: any): string; /** * cleanseRichText: Removes outer XML tags and dangerous elements from rich text. * * This function takes a string of rich text, typically extracted from an XML document, * and cleanses it by removing the outer XML tags and any dangerous elements present. * Dangerous elements include