From 3c520d76cf153c54c156d7ca97c80eae9c6f4a62 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 16 Aug 2023 15:11:13 +0200 Subject: [PATCH 1/2] Revert "Temporarily stop running `gulp typestest` in GitHub Actions" This reverts commit d9350c38997b31ee9f0058f438b332997eb53e07. --- gulpfile.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gulpfile.mjs b/gulpfile.mjs index 82a2ae184b9f4..c4041ab1a6d8c 100644 --- a/gulpfile.mjs +++ b/gulpfile.mjs @@ -2475,6 +2475,7 @@ gulp.task( "ci-test", gulp.series( gulp.parallel("lint", "externaltest", "unittestcli"), - "lint-chromium" + "lint-chromium", + "typestest" ) ); From 9019491d3ec2c35720e42473abc68ef413fba0b2 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 16 Aug 2023 15:11:43 +0200 Subject: [PATCH 2/2] [Type-definitions] Hack around the broken `SVGGraphics` import map (issue 16705) Previous attempts at "importing" the `@typedef` caused the JSDoc-generation to fail, however it seems that prepending it with `@ignore` causes JSDoc to completely skip the rest of the line while TypeScript will (seemingly) parse the `@typedef` as usual. While both `gulp jsdoc` and `gulp typestest` pass with this patch, it's unfortunately nothing more than a crude work-around for the actual issue. This way of "fixing" issue 16705 does feel very undesirable, for a number of reasons: - It does nothing to address the underlying issue, i.e. that the Type-generation doesn't understand the import maps, which means that the same problem could resurface somewhere else in the code-base next week/month. - It feels very arbitrary/brittle, since a future update of JSDoc and/or TypeScript could very easily break this hack. - It further increases the maintenance burden for the Type-generation, when the opposite would be desirable here. (Since it's already very difficult to get TypeScript users to *actively* help with maintaining this code.) --- src/display/api.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/display/api.js b/src/display/api.js index 08b34aa467006..8bab6fa0e0bc4 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -13,6 +13,10 @@ * limitations under the License. */ +/** + * @ignore @typedef { import("./svg.js").SVGGraphics } SVGGraphics + */ + /** * @module pdfjsLib */