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.

54 lines 2.12 kB
"use strict"; /** * Copyright © 2014-2026 PDF Technologies, Inc. All Rights Reserved. * * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT. * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. * This notice may not be removed from this file. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.CPDFEditManager = void 0; const react_native_1 = require("react-native"); const CPDFEditorHistoryManager_1 = require("../history/CPDFEditorHistoryManager"); const { CPDFViewManager } = react_native_1.NativeModules; class CPDFEditManager { _viewerRef; _historyManager; constructor(viewerRef) { this._viewerRef = viewerRef; this._historyManager = new CPDFEditorHistoryManager_1.CPDFEditorHistoryManager(this._viewerRef); } /** * Gets the history manager associated with this edit manager. * @example * ```typescript * const manager = pdfReaderRef.current._editManager; * const historyManager = manager.historyManager; * await historyManager.canUndo(); * ``` * @returns {CPDFEditorHistoryManager} The history manager instance. */ get historyManager() { return this._historyManager; } /** * Changes the current editing modes. * @example * ```typescript * const manager = pdfReaderRef.current._editManager; * await manager.changeEditType([CPDFEditType.Text, CPDFEditType.Image]); * ``` * @param editTypes An array of `CPDFEditType` values representing the desired editing modes. * @returns */ changeEditType = (editTypes) => { const tag = (0, react_native_1.findNodeHandle)(this._viewerRef); if (tag) { return CPDFViewManager.changeEditType(tag, editTypes); } return Promise.reject(new Error('Unable to find the native view reference')); }; } exports.CPDFEditManager = CPDFEditManager; //# sourceMappingURL=CPDFEditManager.js.map