Skip to content

Commit

Permalink
fixed requested changes, added additional missing types, changed `Gra…
Browse files Browse the repository at this point in the history
…bToPan` constructor param for typescript compatibility
  • Loading branch information
ex37 committed Apr 10, 2024
1 parent e850450 commit 25f049f
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions web/annotation_editor_params.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import { AnnotationEditorParamsType } from "pdfjs-lib";
* @property {HTMLInputElement} editorInkColor
* @property {HTMLInputElement} editorInkThickness
* @property {HTMLInputElement} editorInkOpacity
* @property {HTMLElement} editorStampAddImage
* @property {HTMLButtonElement} editorStampAddImage
* @property {HTMLInputElement} editorFreeHighlightThickness
* @property {HTMLElement} editorHighlightShowAll
* @property {HTMLButtonElement} editorHighlightShowAll
*/

class AnnotationEditorParams {
Expand Down
4 changes: 4 additions & 0 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/

/** @typedef {import("./interfaces.js").IL10n} IL10n */
/** @typedef {import("../src/display/api.js").PDFDocumentProxy} PDFDocumentProxy */
/** @typedef {import("../src/display/api.js").PDFDocumentLoadingTask} PDFDocumentLoadingTask */

import {
animationStarted,
Expand Down Expand Up @@ -98,7 +100,9 @@ const PDFViewerApplication = {
settled: false,
},
appConfig: null,
/** @type {PDFDocumentProxy} */
pdfDocument: null,
/** @type {PDFDocumentLoadingTask} */
pdfLoadingTask: null,
printService: null,
/** @type {PDFViewer} */
Expand Down
4 changes: 2 additions & 2 deletions web/external_services.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

/** @typedef {import("./l10n.js").L10n} L10n */
/** @typedef {import("./interfaces.js").IL10n} IL10n */

class BaseExternalServices {
constructor() {
Expand All @@ -31,7 +31,7 @@ class BaseExternalServices {
reportTelemetry(data) {}

/**
* @returns {Promise<L10n>}
* @returns {Promise<IL10n>}
*/
async createL10n() {
throw new Error("Not implemented: createL10n");
Expand Down
2 changes: 1 addition & 1 deletion web/grab_to_pan.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const CSS_CLASS_GRAB = "grab-to-pan-grab";
class GrabToPan {
/**
* Construct a GrabToPan instance for a given HTML element.
* @param {Element} options.element
* @param {{element: Element}}
*/
constructor({ element }) {
this.element = element;
Expand Down
2 changes: 2 additions & 0 deletions web/password_prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @typedef {import("./overlay_manager.js").OverlayManager} OverlayManager */

import { PasswordResponses } from "pdfjs-lib";

/**
Expand Down
2 changes: 1 addition & 1 deletion web/pdf_attachment_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { waitOnEventOrTimeout } from "./event_utils.js";
/**
* @typedef {Object} PDFAttachmentViewerRenderParameters
* @property {Object|null} attachments - A lookup table of attachment objects.
* @property {boolean} keepRenderedCapability
* @property {boolean} [keepRenderedCapability]
*/

class PDFAttachmentViewer extends BaseTreeViewer {
Expand Down
4 changes: 2 additions & 2 deletions web/pdf_layer_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/** @typedef {import("./event_utils.js").EventBus} EventBus */
// eslint-disable-next-line max-len
/** @typedef {import("../src/optional_content_config.js").OptionalContentConfig} OptionalContentConfig */
/** @typedef {import("../src/document.js").PDFDocument} PDFDocument */
/** @typedef {import("../src/display/api.js").PDFDocumentProxy} PDFDocumentProxy */

import { BaseTreeViewer } from "./base_tree_viewer.js";

Expand All @@ -30,7 +30,7 @@ import { BaseTreeViewer } from "./base_tree_viewer.js";
* @typedef {Object} PDFLayerViewerRenderParameters
* @property {OptionalContentConfig|null} optionalContentConfig - An
* {OptionalContentConfig} instance.
* @property {PDFDocument} pdfDocument - A {PDFDocument} instance.
* @property {PDFDocumentProxy} pdfDocument - A {PDFDocument} instance.
*/

class PDFLayerViewer extends BaseTreeViewer {
Expand Down
4 changes: 2 additions & 2 deletions web/pdf_outline_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// eslint-disable-next-line max-len
/** @typedef {import("./download_manager.js").DownloadManager} DownloadManager */
/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */
/** @typedef {import("../src/document.js").PDFDocument} PDFDocument */
/** @typedef {import("../src/display/api.js").PDFDocumentProxy} PDFDocumentProxy */

import { BaseTreeViewer } from "./base_tree_viewer.js";
import { SidebarView } from "./ui_utils.js";
Expand All @@ -33,7 +33,7 @@ import { SidebarView } from "./ui_utils.js";
/**
* @typedef {Object} PDFOutlineViewerRenderParameters
* @property {Array|null} outline - An array of outline objects.
* @property {PDFDocument} pdfDocument - A {PDFDocument} instance.
* @property {PDFDocumentProxy} pdfDocument - A {PDFDocument} instance.
*/

class PDFOutlineViewer extends BaseTreeViewer {
Expand Down
2 changes: 2 additions & 0 deletions web/pdf_print_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* limitations under the License.
*/

/** @typedef {import("./interfaces.js").IPDFPrintServiceFactory} IPDFPrintServiceFactory */

import {
AnnotationMode,
PixelsPerInch,
Expand Down

0 comments on commit 25f049f

Please sign in to comment.