Fix types to make "gulp typestest" succeeding

This commit is contained in:
calixteman 2026-02-08 22:12:31 +01:00
parent 63110e34a7
commit 45c7805daf
No known key found for this signature in database
GPG Key ID: 0C5442631EE0691F
13 changed files with 25 additions and 5 deletions

View File

@ -28,4 +28,4 @@ jobs:
run: npm ci
- name: Run types tests
run: npx gulp types
run: npx gulp typestest

View File

@ -23,6 +23,10 @@
/** @typedef {import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder} StructTreeLayerBuilder */
// eslint-disable-next-line max-len
/** @typedef {import("../../web/comment_manager.js").CommentManager} CommentManager */
// eslint-disable-next-line max-len
/** @typedef {import("../../web/pdf_link_service.js").PDFLinkService} PDFLinkService */
// eslint-disable-next-line max-len
/** @typedef {import("../../web/base_download_manager.js").BaseDownloadManager} BaseDownloadManager */
import {
AnnotationBorderStyleType,

View File

@ -22,7 +22,8 @@
/** @typedef {import("../annotation_layer.js").AnnotationLayer} AnnotationLayer */
/** @typedef {import("../draw_layer.js").DrawLayer} DrawLayer */
// eslint-disable-next-line max-len
/** @typedef {import("../src/display/struct_tree_layer_builder.js").StructTreeLayerBuilder} StructTreeLayerBuilder */
/** @typedef {import("../../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder} StructTreeLayerBuilder */
/** @typedef {import("../../../web/l10n.js").L10n} L10n */
import {
AnnotationEditorPrefix,

View File

@ -16,6 +16,8 @@
// eslint-disable-next-line max-len
/** @typedef {import("./annotation_storage").AnnotationStorage} AnnotationStorage */
/** @typedef {import("./display_utils").PageViewport} PageViewport */
// eslint-disable-next-line max-len
/** @typedef {import("../../web/pdf_link_service.js").PDFLinkService} PDFLinkService */
import { XfaText } from "./xfa_text.js";

View File

@ -25,6 +25,9 @@
// eslint-disable-next-line max-len
/** @typedef {import("../src/display/editor/tools.js").AnnotationEditorUIManager} AnnotationEditorUIManager */
/** @typedef {import("./comment_manager.js").CommentManager} CommentManager */
/** @typedef {import("./pdf_link_service.js").PDFLinkService} PDFLinkService */
// eslint-disable-next-line max-len
/** @typedef {import("./base_download_manager.js").BaseDownloadManager} BaseDownloadManager */
import {
AnnotationLayer,

View File

@ -15,6 +15,7 @@
/** @typedef {import("../src/display/api").PDFDocumentProxy} PDFDocumentProxy */
/** @typedef {import("./event_utils").EventBus} EventBus */
/** @typedef {import("./pdf_link_service.js").PDFLinkService} PDFLinkService */
import { binarySearchFirstItem, scrollIntoView } from "./ui_utils.js";
import { getCharacterType, getNormalizeWithNFKC } from "./pdf_find_utils.js";

View File

@ -14,6 +14,7 @@
*/
/** @typedef {import("./event_utils").EventBus} EventBus */
/** @typedef {import("./pdf_link_service.js").PDFLinkService} PDFLinkService */
import { isValidRotation, parseQueryString } from "./ui_utils.js";
import { updateUrlHash } from "pdfjs-lib";

View File

@ -21,6 +21,7 @@
// eslint-disable-next-line max-len
/** @typedef {import("./pdf_rendering_queue").PDFRenderingQueue} PDFRenderingQueue */
/** @typedef {import("./comment_manager.js").CommentManager} CommentManager */
/** @typedef {import("./l10n.js").L10n} L10n */
import {
AbortException,

View File

@ -16,6 +16,7 @@
/** @typedef {import("./pdf_viewer").PDFViewer} PDFViewer */
// eslint-disable-next-line max-len
/** @typedef {import("./pdf_thumbnail_viewer").PDFThumbnailViewer} PDFThumbnailViewer */
/** @typedef {import("./renderable_view").RenderableView} RenderableView */
import { RenderingCancelledException } from "pdfjs-lib";
import { RenderingStates } from "./renderable_view.js";

View File

@ -18,6 +18,7 @@
/** @typedef {import("./event_utils").EventBus} EventBus */
// eslint-disable-next-line max-len
/** @typedef {import("./pdf_rendering_queue").PDFRenderingQueue} PDFRenderingQueue */
/** @typedef {import("./pdf_link_service.js").PDFLinkService} PDFLinkService */
import {
binarySearchFirstItem,

View File

@ -24,6 +24,10 @@
/** @typedef {import("./pdf_find_controller").PDFFindController} PDFFindController */
// eslint-disable-next-line max-len
/** @typedef {import("./pdf_scripting_manager").PDFScriptingManager} PDFScriptingManager */
/** @typedef {import("./pdf_link_service.js").PDFLinkService} PDFLinkService */
// eslint-disable-next-line max-len
/** @typedef {import("./base_download_manager.js").BaseDownloadManager} BaseDownloadManager */
/** @typedef {import("./l10n.js").L10n} L10n */
import {
AnnotationEditorType,

View File

@ -28,7 +28,7 @@ class RenderableView {
renderingId = "";
/**
* @type {RenderTask | null}
* @type {import("../src/display/api").RenderTask | null}
*/
renderTask = null;
@ -47,14 +47,14 @@ class RenderableView {
}
/**
* @type {RenderingStates}
* @type {number}
*/
get renderingState() {
throw new Error("Abstract getter `renderingState` accessed");
}
/**
* @param {RenderingStates}
* @param {number} state
*/
set renderingState(state) {
throw new Error("Abstract setter `renderingState` accessed");

View File

@ -18,6 +18,7 @@
/** @typedef {import("../src/display/annotation_storage").AnnotationStorage} AnnotationStorage */
// eslint-disable-next-line max-len
/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */
/** @typedef {import("./pdf_link_service.js").PDFLinkService} PDFLinkService */
import { XfaLayer } from "pdfjs-lib";