UNPKG

@compdfkit_pdf_sdk/react_native

Version:

ComPDFKit for React Native is a comprehensive SDK that allows you to quickly add PDF functionality to Android, iOS, and React Native applications.

47 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CPDFNoteAnnotation = void 0; const CPDFAnnotation_1 = require("./CPDFAnnotation"); /** * @class CPDFNoteAnnotation * @group Annotations * @property { string } [color] The color of the annotation * @property { number } [alpha] The alpha of the annotation */ class CPDFNoteAnnotation extends CPDFAnnotation_1.CPDFAnnotation { color; alpha; constructor(params) { super(params); this.type = 'note'; this.color = params.color ?? '#FF0000'; this.alpha = params.alpha ?? 255; } /** * Update note annotation properties with type safety * @param updates Partial object containing properties to update * @returns this instance for chaining * * @example * noteAnnotation.update({ * title: 'Updated Title', * content: 'Updated content', * color: '#FF0000', * alpha: 200 * }); * await document.updateAnnotation(noteAnnotation); */ update(updates) { Object.assign(this, updates); return this; } toJSON() { return { ...super.toJSON(), color: this.color, alpha: this.alpha, }; } } exports.CPDFNoteAnnotation = CPDFNoteAnnotation; //# sourceMappingURL=CPDFNoteAnnotation.js.map