From d18b9ee472dd6ffdd1544f6cc6a3f3adf45057c5 Mon Sep 17 00:00:00 2001 From: Sebastien Corbin Date: Thu, 27 Apr 2023 17:03:03 +0200 Subject: [PATCH] Update type documentations for #16307 and #16359 --- web/pdf_find_controller.js | 12 ++++++++++++ web/pdf_page_view.js | 14 ++++++++++++++ web/ui_utils.js | 6 ++++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/web/pdf_find_controller.js b/web/pdf_find_controller.js index f5f241407..5a725b85d 100644 --- a/web/pdf_find_controller.js +++ b/web/pdf_find_controller.js @@ -517,6 +517,18 @@ class PDFFindController { }); } + /** + * @typedef {Object} PDFFindControllerScrollMatchIntoViewParams + * @property {HTMLElement} element + * @property {number} selectedLeft + * @property {number} pageIndex + * @property {number} matchIndex + */ + + /** + * Scroll the current match into view. + * @param {PDFFindControllerScrollMatchIntoViewParams} + */ scrollMatchIntoView({ element = null, selectedLeft = 0, diff --git a/web/pdf_page_view.js b/web/pdf_page_view.js index 12c80b4ef..234f71ba8 100644 --- a/web/pdf_page_view.js +++ b/web/pdf_page_view.js @@ -513,6 +513,20 @@ class PDFPageView { } } + /** + * @typedef {Object} PDFPageViewUpdateParameters + * @property {number} [scale] The new scale, if specified. + * @property {number} [rotation] The new rotation, if specified. + * @property {Promise} [optionalContentConfigPromise] + * A promise that is resolved with an {@link OptionalContentConfig} + * instance. The default value is `null`. + * @property {number} [drawingDelay] + */ + + /** + * Update e.g. the scale and/or rotation of the page. + * @param {PDFPageViewUpdateParameters} + */ update({ scale = 0, rotation = null, diff --git a/web/ui_utils.js b/web/ui_utils.js index a5d397b50..b557ee82a 100644 --- a/web/ui_utils.js +++ b/web/ui_utils.js @@ -104,9 +104,11 @@ class OutputScale { /** * Scrolls specified element into view of its parent. - * @param {Object} element - The element to be visible. - * @param {Object} spot - An object with optional top and left properties, + * @param {HTMLElement} element - The element to be visible. + * @param {Object} [spot] - An object with optional top and left properties, * specifying the offset from the top left edge. + * @param {number} [spot.left] + * @param {number} [spot.top] * @param {boolean} [scrollMatches] - When scrolling search results into view, * ignore elements that either: Contains marked content identifiers, * or have the CSS-rule `overflow: hidden;` set. The default value is `false`.