import { AnnotationBase } from "./AnnotationBase"; import { type AnnotationBaseProperties } from "./AnnotationBase"; import { type Color } from "../../Types"; import { type PopupAnnotation, type PopupAnnotationProperties } from "./PopupAnnotation"; import { type PdfDateTime } from "../../Types"; /** * Specifies the possible relationships between related annotations. * R - The current annotation is a reply to a referenced annotation. * Group - The current annotation and a referenced annotation is a single group. */ export type AnnotationReferenceType = "R" | "Group"; /** * The common properties for markup annotations that are used primarily to mark up PDF documents. * @see {@link MarkupAnnotation} */ export type MarkupAnnotationProperties = AnnotationBaseProperties & { /** * The text label to be displayed in the title bar of the annotation's pop-up window * when open and active. By convention, this entry identifies the user who added the annotation. */ userName?: string; /** * The text representing a short description of the subject being addressed by the annotation. */ subject?: string; /** * The opacity value to be used in painting the annotation. * This value applies to all visible elements of the annotation in its closed state * (including its background and border) but not to the pop-up window that appears when the annotation is opened. * Not specified means 1 (means 100% opacity) */ opacity?: number; /** * The annotation color, it used as color of popup window, lines color etc. */ color?: Color; /** * The date and time when the annotation was created. */ creationDate?: PdfDateTime; /** * The text to be displayed in the pop-up window when the annotation is opened. * This text can be formatted using HTML tags, see PDF specification for details. */ richText?: string; /** * The annotation referenced by this annotation. */ reference?: { /** * The annotation referenced by this annotation. */ target: MarkupAnnotation; /** * The relationship (reference type) between this annotation and the annotation specified by the 'target' property. * The referenced annotation should be on the same page with the current annotation. * Not specified means "Reply". */ type?: AnnotationReferenceType; }; /** * The {@link PopupAnnotation} or {@link PopupAnnotationProperties} object for entering or editing text * associated with this annotation. * Setting this property changes the {@link PopupAnnotation#parent} property. * A separate {@link PopupAnnotation} allows defining additional properties of * the popup window: color, position etc. */ popup?: PopupAnnotation | PopupAnnotationProperties; }; /** *The abstract base class for annotations that are used primarily to mark up PDF documents. */ export declare abstract class MarkupAnnotation extends AnnotationBase { /** * Gets or sets the text label to be displayed in the title bar of the annotation's pop-up window * when open and active. By convention, this entry identifies the user who added the annotation. */ get userName(): string | null; /** * Gets or sets the text label to be displayed in the title bar of the annotation's pop-up window * when open and active. By convention, this entry identifies the user who added the annotation. */ set userName(value: string | null); /** * Gets or sets the text representing a short description of the subject being addressed by the annotation. */ get subject(): string | null; /** * Gets or sets the text representing a short description of the subject being addressed by the annotation. */ set subject(value: string | null); /** * Gets or sets the opacity value to be used in painting the annotation. * This value applies to all visible elements of the annotation in its closed state * (including its background and border) but not to the pop-up window that appears when the annotation is opened. */ get opacity(): number; /** * Gets or sets the opacity value to be used in painting the annotation. * This value applies to all visible elements of the annotation in its closed state * (including its background and border) but not to the pop-up window that appears when the annotation is opened. */ set opacity(value: number); /** * Gets or sets the annotation color, * it used as color of popup window, lines color etc. */ get color(): Color; /** * Gets or sets the annotation color, * it used as color of popup window, lines color etc. */ set color(value: Color); /** * Gets or sets the text to be displayed in the pop-up window when the annotation is opened. * This text can be formatted using HTML tags, see PDF specification for details. */ get richText(): string; /** * Gets or sets the text to be displayed in the pop-up window when the annotation is opened. * This text can be formatted using HTML tags, see PDF specification for details. */ set richText(value: string | null); /** * Gets or sets the date and time when the annotation was created. */ get creationDate(): PdfDateTime | null; /** * Gets or sets the date and time when the annotation was created. */ set creationDate(value: PdfDateTime | null); /** * Gets or sets the annotation referenced by this annotation. */ get referenceAnnotation(): MarkupAnnotation | null; /** * Gets or sets the annotation referenced by this annotation. */ set referenceAnnotation(value: MarkupAnnotation | null); /** * Gets or sets the relationship (reference type) between this annotation and the annotation specified by the 'referenceAnnotation' property. * The referenced annotation should be on the same page with the current annotation. * The valid values: "R" (reply), "Group" */ get referenceType(): string; /** * Gets or sets the relationship (reference type) between this annotation and the annotation specified by the 'referenceAnnotation' property. * The referenced annotation should be on the same page with the current annotation. * The valid values: "R" (reply), "Group" */ set referenceType(value: AnnotationReferenceType); /** * Gets or sets the {@link PopupAnnotation} annotation for entering or editing text associated with this annotation. * Setting this property changes the {@link PopupAnnotation#parent} property. * A separate {@link PopupAnnotation} allows defining additional properties of * the popup window: color, position etc. */ get popup(): PopupAnnotation | null; /** * Gets or sets the {@link PopupAnnotation} annotation for entering or editing text associated with this annotation. * Setting this property changes the {@link PopupAnnotation#parent} property. * A separate {@link PopupAnnotation} allows defining additional properties of * the popup window: color, position etc. */ set popup(value: PopupAnnotation | null); }