1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Expose TextLayerRenderTask in the TypeScript definitions (issue 15016, PR 14013 follow-up)

While `TextLayerRenderTask` apparently makes sense in TypeScript environments, given that it's being returned by the `renderTextLayer`-function in the API, we really don't want to extend the *public* API by simply exporting the class directly in `src/pdf.js` since it should never be called/initialized manually.
Hence we follow the same pattern as in PR 14013, and add some very basic unit-tests to ensure that `renderTextLayer` always returns a `TextLayerRenderTask`-instance as expected.
This commit is contained in:
Jonas Jenwald 2022-06-10 09:53:52 +02:00
parent 6e6d94ab8d
commit e046b811b7
5 changed files with 67 additions and 1 deletions

View file

@ -857,4 +857,4 @@ function renderTextLayer(renderParameters) {
return task;
}
export { renderTextLayer };
export { renderTextLayer, TextLayerRenderTask };

View file

@ -19,6 +19,8 @@
/** @typedef {import("./display/api").PDFPageProxy} PDFPageProxy */
/** @typedef {import("./display/api").RenderTask} RenderTask */
/** @typedef {import("./display/display_utils").PageViewport} PageViewport */
// eslint-disable-next-line max-len
/** @typedef {import("./display/text_layer").TextLayerRenderTask} TextLayerRenderTask */
import {
AnnotationEditorType,