diff --git a/web/pdf_find_controller.js b/web/pdf_find_controller.js index f5f24140787b21..239706930f04f1 100644 --- a/web/pdf_find_controller.js +++ b/web/pdf_find_controller.js @@ -517,6 +517,14 @@ class PDFFindController { }); } + /** + * Updates scroll so that the match appears into view. + * + * @param {HTMLElement} element + * @param {number} selectedLeft + * @param {number} pageIndex + * @param {number} matchIndex + */ scrollMatchIntoView({ element = null, selectedLeft = 0, diff --git a/web/pdf_page_view.js b/web/pdf_page_view.js index 12c80b4ef6dcbb..4ab07f759d758f 100644 --- a/web/pdf_page_view.js +++ b/web/pdf_page_view.js @@ -513,6 +513,22 @@ 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 page view by eitheir modifiying scale or rotation. + * + * @param {PDFPageViewUpdateParameters} + */ update({ scale = 0, rotation = null, diff --git a/web/ui_utils.js b/web/ui_utils.js index a5d397b50bbdbd..b557ee82a37c17 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`.