diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js index 305175404..947e686e8 100644 --- a/src/display/annotation_layer.js +++ b/src/display/annotation_layer.js @@ -19,7 +19,6 @@ /** @typedef {import("../../web/text_accessibility.js").TextAccessibilityManager} TextAccessibilityManager */ // eslint-disable-next-line max-len /** @typedef {import("../../web/interfaces").IDownloadManager} IDownloadManager */ -/** @typedef {import("../../web/interfaces").IPDFLinkService} IPDFLinkService */ // eslint-disable-next-line max-len /** @typedef {import("../src/display/editor/tools.js").AnnotationEditorUIManager} AnnotationEditorUIManager */ // eslint-disable-next-line max-len @@ -57,7 +56,7 @@ const TIMEZONE_OFFSET = new Date().getTimezoneOffset() * 60 * 1000; * @typedef {Object} AnnotationElementParameters * @property {Object} data * @property {HTMLDivElement} layer - * @property {IPDFLinkService} linkService + * @property {PDFLinkService} linkService * @property {IDownloadManager} [downloadManager] * @property {AnnotationStorage} [annotationStorage] * @property {string} [imageResourcesPath] - Path for image resources, mainly @@ -3736,7 +3735,7 @@ class FileAttachmentAnnotationElement extends AnnotationElement { * @property {HTMLDivElement} div * @property {Array} annotations * @property {PDFPageProxy} page - * @property {IPDFLinkService} linkService + * @property {PDFLinkService} linkService * @property {IDownloadManager} [downloadManager] * @property {AnnotationStorage} [annotationStorage] * @property {string} [imageResourcesPath] - Path for image resources, mainly @@ -4018,8 +4017,6 @@ class AnnotationLayer { * Add link annotations to the annotation layer. * * @param {Array} annotations - * @param {IPDFLinkService} linkService - * @memberof AnnotationLayer */ async addLinkAnnotations(annotations) { const elementParams = { diff --git a/src/display/xfa_layer.js b/src/display/xfa_layer.js index 59b0dcac7..6ddf9b58e 100644 --- a/src/display/xfa_layer.js +++ b/src/display/xfa_layer.js @@ -16,7 +16,6 @@ // eslint-disable-next-line max-len /** @typedef {import("./annotation_storage").AnnotationStorage} AnnotationStorage */ /** @typedef {import("./display_utils").PageViewport} PageViewport */ -/** @typedef {import("../../web/interfaces").IPDFLinkService} IPDFLinkService */ import { XfaText } from "./xfa_text.js"; @@ -26,7 +25,7 @@ import { XfaText } from "./xfa_text.js"; * @property {HTMLDivElement} div * @property {Object} xfaHtml * @property {AnnotationStorage} [annotationStorage] - * @property {IPDFLinkService} linkService + * @property {PDFLinkService} linkService * @property {string} [intent] - (default value is 'display'). */ diff --git a/web/annotation_layer_builder.js b/web/annotation_layer_builder.js index 40670a3d0..eef2fca33 100644 --- a/web/annotation_layer_builder.js +++ b/web/annotation_layer_builder.js @@ -19,7 +19,6 @@ // eslint-disable-next-line max-len /** @typedef {import("../src/display/annotation_storage").AnnotationStorage} AnnotationStorage */ /** @typedef {import("./interfaces").IDownloadManager} IDownloadManager */ -/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */ // eslint-disable-next-line max-len /** @typedef {import("./struct_tree_layer_builder.js").StructTreeLayerBuilder} StructTreeLayerBuilder */ // eslint-disable-next-line max-len @@ -43,7 +42,7 @@ import { PresentationModeState } from "./ui_utils.js"; * @property {string} [imageResourcesPath] - Path for image resources, mainly * for annotation icons. Include trailing slash. * @property {boolean} renderForms - * @property {IPDFLinkService} linkService + * @property {PDFLinkService} linkService * @property {IDownloadManager} [downloadManager] * @property {boolean} [enableComment] * @property {boolean} [enableScripting] diff --git a/web/interfaces.js b/web/interfaces.js index 7c926af9c..1e2a13910 100644 --- a/web/interfaces.js +++ b/web/interfaces.js @@ -19,103 +19,6 @@ /** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */ /** @typedef {import("./ui_utils").RenderingStates} RenderingStates */ -/** - * @interface - */ -class IPDFLinkService { - /** - * @type {number} - */ - get pagesCount() {} - - /** - * @type {number} - */ - get page() {} - - /** - * @param {number} value - */ - set page(value) {} - - /** - * @type {number} - */ - get rotation() {} - - /** - * @param {number} value - */ - set rotation(value) {} - - /** - * @type {boolean} - */ - get isInPresentationMode() {} - - /** - * @type {boolean} - */ - get externalLinkEnabled() {} - - /** - * @param {boolean} value - */ - set externalLinkEnabled(value) {} - - /** - * @param {string|Array} dest - The named, or explicit, PDF destination. - */ - async goToDestination(dest) {} - - /** - * @param {number|string} val - The page number, or page label. - */ - goToPage(val) {} - - /** - * Scrolls to a specific location in the PDF document. - * @param {number} pageNumber - The page number to scroll to. - * @param {number} x - The x-coordinate to scroll to in page coordinates. - * @param {number} y - The y-coordinate to scroll to in page coordinates. - */ - goToXY(pageNumber, x, y) {} - - /** - * @param {HTMLAnchorElement} link - * @param {string} url - * @param {boolean} [newWindow] - */ - addLinkAttributes(link, url, newWindow = false) {} - - /** - * @param dest - The PDF destination object. - * @returns {string} The hyperlink to the PDF object. - */ - getDestinationHash(dest) {} - - /** - * @param hash - The PDF parameters/hash. - * @returns {string} The hyperlink to the PDF object. - */ - getAnchorUrl(hash) {} - - /** - * @param {string} hash - */ - setHash(hash) {} - - /** - * @param {string} action - */ - executeNamedAction(action) {} - - /** - * @param {Object} action - */ - executeSetOCGState(action) {} -} - /** * @interface */ @@ -226,10 +129,4 @@ class IPDFPrintServiceFactory { } } -export { - IDownloadManager, - IL10n, - IPDFLinkService, - IPDFPrintServiceFactory, - IRenderableView, -}; +export { IDownloadManager, IL10n, IPDFPrintServiceFactory, IRenderableView }; diff --git a/web/pdf_find_controller.js b/web/pdf_find_controller.js index 64ca3d6a3..03dada3d6 100644 --- a/web/pdf_find_controller.js +++ b/web/pdf_find_controller.js @@ -15,7 +15,6 @@ /** @typedef {import("../src/display/api").PDFDocumentProxy} PDFDocumentProxy */ /** @typedef {import("./event_utils").EventBus} EventBus */ -/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */ import { binarySearchFirstItem, scrollIntoView } from "./ui_utils.js"; import { getCharacterType, getNormalizeWithNFKC } from "./pdf_find_utils.js"; @@ -405,7 +404,7 @@ function getOriginalIndex(diffs, pos, len) { /** * @typedef {Object} PDFFindControllerOptions - * @property {IPDFLinkService} linkService - The navigation/linking service. + * @property {PDFLinkService} linkService - The navigation/linking service. * @property {EventBus} eventBus - The application event bus. * @property {boolean} [updateMatchesCountOnProgress] - True if the matches * count must be updated on progress or only when the last page is reached. diff --git a/web/pdf_history.js b/web/pdf_history.js index bed96f370..f0f7964db 100644 --- a/web/pdf_history.js +++ b/web/pdf_history.js @@ -14,7 +14,6 @@ */ /** @typedef {import("./event_utils").EventBus} EventBus */ -/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */ import { isValidRotation, parseQueryString } from "./ui_utils.js"; import { updateUrlHash } from "pdfjs-lib"; @@ -29,7 +28,7 @@ const UPDATE_VIEWAREA_TIMEOUT = 1000; // milliseconds /** * @typedef {Object} PDFHistoryOptions - * @property {IPDFLinkService} linkService - The navigation/linking service. + * @property {PDFLinkService} linkService - The navigation/linking service. * @property {EventBus} eventBus - The application event bus. */ diff --git a/web/pdf_link_service.js b/web/pdf_link_service.js index 885de2bc8..c57be4873 100644 --- a/web/pdf_link_service.js +++ b/web/pdf_link_service.js @@ -14,7 +14,6 @@ */ /** @typedef {import("./event_utils").EventBus} EventBus */ -/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */ import { isValidExplicitDest } from "pdfjs-lib"; import { parseQueryString } from "./ui_utils.js"; @@ -45,7 +44,6 @@ const LinkTarget = { /** * Performs navigation functions inside PDF, such as opening specified page, * or destination. - * @implements {IPDFLinkService} */ class PDFLinkService { externalLinkEnabled = true; @@ -517,9 +515,6 @@ class PDFLinkService { } } -/** - * @implements {IPDFLinkService} - */ class SimpleLinkService extends PDFLinkService { setDocument(pdfDocument, baseUrl = null) {} } diff --git a/web/pdf_outline_viewer.js b/web/pdf_outline_viewer.js index efb7e5ec1..011e2c8d8 100644 --- a/web/pdf_outline_viewer.js +++ b/web/pdf_outline_viewer.js @@ -16,7 +16,6 @@ /** @typedef {import("./event_utils.js").EventBus} EventBus */ // eslint-disable-next-line max-len /** @typedef {import("./download_manager.js").DownloadManager} DownloadManager */ -/** @typedef {import("./interfaces.js").IPDFLinkService} IPDFLinkService */ // eslint-disable-next-line max-len /** @typedef {import("../src/display/api.js").PDFDocumentProxy} PDFDocumentProxy */ @@ -27,7 +26,7 @@ import { SidebarView } from "./ui_utils.js"; * @typedef {Object} PDFOutlineViewerOptions * @property {HTMLDivElement} container - The viewer element. * @property {EventBus} eventBus - The application event bus. - * @property {IPDFLinkService} linkService - The navigation/linking service. + * @property {PDFLinkService} linkService - The navigation/linking service. * @property {DownloadManager} downloadManager - The download manager. */ diff --git a/web/pdf_thumbnail_view.js b/web/pdf_thumbnail_view.js index c1f72e6ec..b7fbc458e 100644 --- a/web/pdf_thumbnail_view.js +++ b/web/pdf_thumbnail_view.js @@ -18,7 +18,6 @@ // eslint-disable-next-line max-len /** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */ /** @typedef {import("./event_utils").EventBus} EventBus */ -/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */ /** @typedef {import("./interfaces").IRenderableView} IRenderableView */ // eslint-disable-next-line max-len /** @typedef {import("./pdf_rendering_queue").PDFRenderingQueue} PDFRenderingQueue */ @@ -44,7 +43,7 @@ const THUMBNAIL_WIDTH = 126; // px * @property {Promise} [optionalContentConfigPromise] - * A promise that is resolved with an {@link OptionalContentConfig} instance. * The default value is `null`. - * @property {IPDFLinkService} linkService - The navigation/linking service. + * @property {PDFLinkService} linkService - The navigation/linking service. * @property {PDFRenderingQueue} renderingQueue - The rendering queue object. * @property {number} [maxCanvasPixels] - The maximum supported canvas size in * total pixels, i.e. width * height. Use `-1` for no limit, or `0` for diff --git a/web/pdf_thumbnail_viewer.js b/web/pdf_thumbnail_viewer.js index a11636c4c..3a527bcce 100644 --- a/web/pdf_thumbnail_viewer.js +++ b/web/pdf_thumbnail_viewer.js @@ -16,7 +16,6 @@ /** @typedef {import("../src/display/api").PDFDocumentProxy} PDFDocumentProxy */ /** @typedef {import("../src/display/api").PDFPageProxy} PDFPageProxy */ /** @typedef {import("./event_utils").EventBus} EventBus */ -/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */ // eslint-disable-next-line max-len /** @typedef {import("./pdf_rendering_queue").PDFRenderingQueue} PDFRenderingQueue */ @@ -51,7 +50,7 @@ const SPACE_FOR_DRAG_MARKER_WHEN_NO_NEXT_ELEMENT = 15; * @property {HTMLDivElement} container - The container for the thumbnail * elements. * @property {EventBus} eventBus - The application event bus. - * @property {IPDFLinkService} linkService - The navigation/linking service. + * @property {PDFLinkService} linkService - The navigation/linking service. * @property {PDFRenderingQueue} renderingQueue - The rendering queue object. * @property {number} [maxCanvasPixels] - The maximum supported canvas size in * total pixels, i.e. width * height. Use `-1` for no limit, or `0` for diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js index 70943ad47..9f4b2bb14 100644 --- a/web/pdf_viewer.js +++ b/web/pdf_viewer.js @@ -22,7 +22,6 @@ /** @typedef {import("./event_utils").EventBus} EventBus */ /** @typedef {import("./interfaces").IDownloadManager} IDownloadManager */ /** @typedef {import("./interfaces").IL10n} IL10n */ -/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */ // eslint-disable-next-line max-len /** @typedef {import("./pdf_find_controller").PDFFindController} PDFFindController */ // eslint-disable-next-line max-len @@ -90,7 +89,7 @@ function isValidAnnotationEditorMode(mode) { * @property {HTMLDivElement} container - The container for the viewer element. * @property {HTMLDivElement} [viewer] - The viewer element. * @property {EventBus} eventBus - The application event bus. - * @property {IPDFLinkService} [linkService] - The navigation/linking service. + * @property {PDFLinkService} [linkService] - The navigation/linking service. * @property {IDownloadManager} [downloadManager] - The download manager * component. * @property {PDFFindController} [findController] - The find controller diff --git a/web/xfa_layer_builder.js b/web/xfa_layer_builder.js index 95c540b93..9f7a92d87 100644 --- a/web/xfa_layer_builder.js +++ b/web/xfa_layer_builder.js @@ -18,7 +18,6 @@ /** @typedef {import("../src/display/annotation_storage").AnnotationStorage} AnnotationStorage */ // eslint-disable-next-line max-len /** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */ -/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */ import { XfaLayer } from "pdfjs-lib"; @@ -26,7 +25,7 @@ import { XfaLayer } from "pdfjs-lib"; * @typedef {Object} XfaLayerBuilderOptions * @property {PDFPageProxy} pdfPage * @property {AnnotationStorage} [annotationStorage] - * @property {IPDFLinkService} linkService + * @property {PDFLinkService} linkService * @property {Object} [xfaHtml] */