Skip to content

Commit f6fd8e9

Browse files
committed
Use typedef to define the type of GlobalWorkerOptions.
1 parent 00a8b42 commit f6fd8e9

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/display/worker_options.js

+12-11
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,25 @@
1313
* limitations under the License.
1414
*/
1515

16-
const GlobalWorkerOptions = Object.create(null);
17-
1816
/**
19-
* Defines global port for worker process. Overrides the `workerSrc` option.
20-
* @var {Object}
17+
* @typedef {Object} GlobalWorkerOptionsType
18+
* @property {Worker | null} workerPort - Defines global port for worker
19+
* process. Overrides the `workerSrc` option.
20+
* @property {string} workerSrc - A string containing the path and filename
21+
* of the worker file.
22+
*
23+
* NOTE: The `workerSrc` option should always be set, in order to prevent any
24+
* issues when using the PDF.js library.
2125
*/
26+
27+
/** @type {GlobalWorkerOptionsType} */
28+
const GlobalWorkerOptions = Object.create(null);
29+
2230
GlobalWorkerOptions.workerPort =
2331
GlobalWorkerOptions.workerPort === undefined
2432
? null
2533
: GlobalWorkerOptions.workerPort;
2634

27-
/**
28-
* A string containing the path and filename of the worker file.
29-
*
30-
* NOTE: The `workerSrc` option should always be set, in order to prevent any
31-
* issues when using the PDF.js library.
32-
* @var {string}
33-
*/
3435
GlobalWorkerOptions.workerSrc =
3536
GlobalWorkerOptions.workerSrc === undefined
3637
? ""

0 commit comments

Comments
 (0)