Change PDFPrintServiceFactory.createPrintService to take a parameter object

By "modernizing" the method to use a parameter object instead, we avoid having to pass along the needed parameters individually.
This commit is contained in:
Jonas Jenwald 2024-02-13 21:28:02 +01:00
parent 14874e50b7
commit a204f434f3
3 changed files with 19 additions and 55 deletions

View file

@ -114,14 +114,14 @@ function composePage(
}
class FirefoxPrintService {
constructor(
constructor({
pdfDocument,
pagesOverview,
printContainer,
printResolution,
optionalContentConfigPromise = null,
printAnnotationStoragePromise = null
) {
printAnnotationStoragePromise = null,
}) {
this.pdfDocument = pdfDocument;
this.pagesOverview = pagesOverview;
this.printContainer = printContainer;
@ -202,22 +202,8 @@ class PDFPrintServiceFactory {
return shadow(this, "supportsPrinting", "mozPrintCallback" in canvas);
}
static createPrintService(
pdfDocument,
pagesOverview,
printContainer,
printResolution,
optionalContentConfigPromise,
printAnnotationStoragePromise
) {
return new FirefoxPrintService(
pdfDocument,
pagesOverview,
printContainer,
printResolution,
optionalContentConfigPromise,
printAnnotationStoragePromise
);
static createPrintService(params) {
return new FirefoxPrintService(params);
}
}