Refactor how the default viewer handles the worker options, by making use of AppOptions instead of the global PDFJS object

This commit is contained in:
Jonas Jenwald 2018-02-17 15:33:57 +01:00
parent 57165afb08
commit b0956a5d91
2 changed files with 37 additions and 8 deletions

View file

@ -127,6 +127,29 @@ const defaultOptions = {
value: false,
kind: OptionKind.VIEWER,
},
postMessageTransfers: {
/** @type {boolean} */
value: true,
kind: OptionKind.API,
},
verbosity: {
/** @type {number} */
value: 1,
kind: OptionKind.API,
},
workerPort: {
/** @type {Object} */
value: null,
kind: OptionKind.WORKER,
},
workerSrc: {
/** @type {string} */
value: (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION') ?
'../src/worker_loader.js' : '../build/pdf.worker.js'),
kind: OptionKind.WORKER,
},
};
const userOptions = Object.create(null);