1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Fix JSDoc types

This fixes invalid type references (either due to invalid paths for the
import or missing imports) in the JS doc, as well as some missing or
invalid parameter names for @param annotations.
This commit is contained in:
Christophe Coevoet 2023-08-31 12:01:33 +02:00
parent 92f7653cfb
commit f84f2646f4
15 changed files with 38 additions and 13 deletions

View file

@ -16,11 +16,13 @@
/** @typedef {import("../src/display/api").PDFPageProxy} PDFPageProxy */
// eslint-disable-next-line max-len
/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */
// eslint-disable-next-line max-len
/** @typedef {import("../src/display/annotation_storage").AnnotationStorage} AnnotationStorage */
/** @typedef {import("./interfaces").IDownloadManager} IDownloadManager */
/** @typedef {import("./interfaces").IL10n} IL10n */
/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */
// eslint-disable-next-line max-len
/** @typedef {import("./textaccessibility.js").TextAccessibilityManager} TextAccessibilityManager */
/** @typedef {import("./text_accessibility.js").TextAccessibilityManager} TextAccessibilityManager */
import { AnnotationLayer } from "pdfjs-lib";
import { NullL10n } from "./l10n_utils.js";

View file

@ -548,7 +548,7 @@ class PDFPageView {
/**
* Update e.g. the scale and/or rotation of the page.
* @param {PDFPageViewUpdateParameters}
* @param {PDFPageViewUpdateParameters} params
*/
update({
scale = 0,

View file

@ -13,6 +13,10 @@
* limitations under the License.
*/
// eslint-disable-next-line max-len
/** @typedef {import("../src/display/optional_content_config").OptionalContentConfig} OptionalContentConfig */
// eslint-disable-next-line max-len
/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */
/** @typedef {import("./event_utils").EventBus} EventBus */
/** @typedef {import("./interfaces").IL10n} IL10n */
/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */

View file

@ -14,6 +14,7 @@
*/
/** @typedef {import("../src/display/api").PDFDocumentProxy} PDFDocumentProxy */
/** @typedef {import("../src/display/api").PDFPageProxy} PDFPageProxy */
/** @typedef {import("./event_utils").EventBus} EventBus */
/** @typedef {import("./interfaces").IL10n} IL10n */
/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */

View file

@ -23,6 +23,10 @@
/** @typedef {import("./interfaces").IDownloadManager} IDownloadManager */
/** @typedef {import("./interfaces").IL10n} IL10n */
/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */
// eslint-disable-next-line max-len
/** @typedef {import("./pdf_find_controller").PDFFindController} PDFFindController */
// eslint-disable-next-line max-len
/** @typedef {import("./pdf_scripting_manager").PDFScriptingManager} PDFScriptingManager */
import {
AnnotationEditorType,

View file

@ -195,7 +195,7 @@ function watchScroll(viewAreaElement, callback) {
/**
* Helper function to parse query string (e.g. ?param1=value&param2=...).
* @param {string}
* @param {string} query
* @returns {Map}
*/
function parseQueryString(query) {
@ -461,7 +461,7 @@ function backtrackBeforeAllVisibleElements(index, views, top) {
* rendering canvas. Earlier and later refer to index in `views`, not page
* layout.)
*
* @param {GetVisibleElementsParameters}
* @param {GetVisibleElementsParameters} params
* @returns {Object} `{ first, last, views: [{ id, x, y, view, percent }] }`
*/
function getVisibleElements({
@ -791,7 +791,7 @@ function getActiveOrFocusedElement() {
/**
* Converts API PageLayout values to the format used by `BaseViewer`.
* @param {string} mode - The API PageLayout value.
* @param {string} layout - The API PageLayout value.
* @returns {Object}
*/
function apiPageLayoutToViewerModes(layout) {

View file

@ -15,6 +15,8 @@
/** @typedef {import("../src/display/api").PDFPageProxy} PDFPageProxy */
// eslint-disable-next-line max-len
/** @typedef {import("../src/display/annotation_storage").AnnotationStorage} AnnotationStorage */
// eslint-disable-next-line max-len
/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */
/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */