mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[api-minor] Remove the deprecated renderTextLayer
and updateTextLayer
functions (PR 18104 follow-up)
This commit is contained in:
parent
40b0c848ee
commit
f3d177e3e4
4 changed files with 4 additions and 56 deletions
|
@ -17,7 +17,7 @@
|
|||
/** @typedef {import("./api").TextContent} TextContent */
|
||||
|
||||
import { AbortException, Util, warn } from "../shared/util.js";
|
||||
import { deprecated, setLayerDimensions } from "./display_utils.js";
|
||||
import { setLayerDimensions } from "./display_utils.js";
|
||||
|
||||
/**
|
||||
* @typedef {Object} TextLayerParameters
|
||||
|
@ -557,40 +557,4 @@ class TextLayer {
|
|||
}
|
||||
}
|
||||
|
||||
function renderTextLayer() {
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||
return;
|
||||
}
|
||||
deprecated("`renderTextLayer`, please use `TextLayer` instead.");
|
||||
|
||||
const { textContentSource, container, viewport, ...rest } = arguments[0];
|
||||
const restKeys = Object.keys(rest);
|
||||
if (restKeys.length > 0) {
|
||||
warn("Ignoring `renderTextLayer` parameters: " + restKeys.join(", "));
|
||||
}
|
||||
|
||||
const textLayer = new TextLayer({
|
||||
textContentSource,
|
||||
container,
|
||||
viewport,
|
||||
});
|
||||
|
||||
const { textDivs, textContentItemsStr } = textLayer;
|
||||
const promise = textLayer.render();
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
return {
|
||||
promise,
|
||||
textDivs,
|
||||
textContentItemsStr,
|
||||
};
|
||||
}
|
||||
|
||||
function updateTextLayer() {
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||
return;
|
||||
}
|
||||
deprecated("`updateTextLayer`, please use `TextLayer` instead.");
|
||||
}
|
||||
|
||||
export { renderTextLayer, TextLayer, updateTextLayer };
|
||||
export { TextLayer };
|
||||
|
|
|
@ -63,11 +63,6 @@ import {
|
|||
RenderingCancelledException,
|
||||
setLayerDimensions,
|
||||
} from "./display/display_utils.js";
|
||||
import {
|
||||
renderTextLayer,
|
||||
TextLayer,
|
||||
updateTextLayer,
|
||||
} from "./display/text_layer.js";
|
||||
import { AnnotationEditorLayer } from "./display/editor/annotation_editor_layer.js";
|
||||
import { AnnotationEditorUIManager } from "./display/editor/tools.js";
|
||||
import { AnnotationLayer } from "./display/annotation_layer.js";
|
||||
|
@ -75,6 +70,7 @@ import { ColorPicker } from "./display/editor/color_picker.js";
|
|||
import { DrawLayer } from "./display/draw_layer.js";
|
||||
import { GlobalWorkerOptions } from "./display/worker_options.js";
|
||||
import { Outliner } from "./display/editor/outliner.js";
|
||||
import { TextLayer } from "./display/text_layer.js";
|
||||
import { XfaLayer } from "./display/xfa_layer.js";
|
||||
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
|
@ -121,12 +117,10 @@ export {
|
|||
PermissionFlag,
|
||||
PixelsPerInch,
|
||||
RenderingCancelledException,
|
||||
renderTextLayer,
|
||||
setLayerDimensions,
|
||||
shadow,
|
||||
TextLayer,
|
||||
UnexpectedResponseException,
|
||||
updateTextLayer,
|
||||
Util,
|
||||
VerbosityLevel,
|
||||
version,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue