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:
parent
6e6d94ab8d
commit
e046b811b7
5 changed files with 67 additions and 1 deletions
|
@ -857,4 +857,4 @@ function renderTextLayer(renderParameters) {
|
|||
return task;
|
||||
}
|
||||
|
||||
export { renderTextLayer };
|
||||
export { renderTextLayer, TextLayerRenderTask };
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue