[api-minor] Re-factor the PDFScriptingManager class to use private fields/methods

- Change (most) fields/methods into private ones, since that's now supported.
 - Tweak the constructor-parameters, and simplify the sandbox initialization w.r.t. the viewer components.
 - Remove some unused function/method parameters.
 - Slightly simplify the "updatefromsandbox"-handler by using local variables and inverting some conditions.
This commit is contained in:
Jonas Jenwald 2023-06-20 12:40:48 +02:00
parent cca299eeb9
commit 547b8276e6
3 changed files with 152 additions and 177 deletions

View file

@ -15,7 +15,7 @@
import { getPdfFilenameFromUrl, loadScript } from "pdfjs-lib";
async function docPropertiesLookup(pdfDocument) {
async function docProperties(pdfDocument) {
const url = "",
baseUrl = url.split("#")[0];
// eslint-disable-next-line prefer-const
@ -65,4 +65,4 @@ class GenericScripting {
}
}
export { docPropertiesLookup, GenericScripting };
export { docProperties, GenericScripting };