[api-minor] Add a wrapper around the addLinkAttributes-function, in the API, to the PDFLinkService implementations

This patch helps reduce some duplication, given that we now have a few essentially identical `addLinkAttributes` call-sites in the code-base.
To prevent runtime errors in the Annotation/XFA-layer code, we'll warn if a custom/incomplete `PDFLinkService` is being used (limited to GENERIC builds).
This commit is contained in:
Jonas Jenwald 2021-09-30 13:30:55 +02:00
parent bb9c905c5d
commit 8cb6efec2d
9 changed files with 67 additions and 45 deletions

View file

@ -63,6 +63,13 @@ class IPDFLinkService {
*/
goToPage(val) {}
/**
* @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.