[api-minor] Remove Outliner from the official API

As far as I can tell `Outliner` is only exposed in the API because we need to access it when running some of the reference-tests, but is otherwise not used.
Hence this seems like something that should be kept *internal* and thus only exposed in TESTING-builds.
This commit is contained in:
Jonas Jenwald 2024-07-16 13:08:26 +02:00
parent f9e3b6bcc4
commit 8a979c2d0e
4 changed files with 8 additions and 7 deletions

View file

@ -80,6 +80,12 @@ const pdfjsVersion =
const pdfjsBuild = const pdfjsBuild =
typeof PDFJSDev !== "undefined" ? PDFJSDev.eval("BUNDLE_BUILD") : void 0; typeof PDFJSDev !== "undefined" ? PDFJSDev.eval("BUNDLE_BUILD") : void 0;
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) {
globalThis.pdfjsTestingUtils = {
Outliner,
};
}
export { export {
AbortException, AbortException,
AnnotationEditorLayer, AnnotationEditorLayer,
@ -109,7 +115,6 @@ export {
noContextMenu, noContextMenu,
normalizeUnicode, normalizeUnicode,
OPS, OPS,
Outliner,
PasswordResponses, PasswordResponses,
PDFDataRangeTransport, PDFDataRangeTransport,
PDFDateString, PDFDateString,

View file

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals pdfjsLib, pdfjsViewer */ /* globals pdfjsLib, pdfjsTestingUtils, pdfjsViewer */
const { const {
AnnotationLayer, AnnotationLayer,
@ -20,12 +20,12 @@ const {
DrawLayer, DrawLayer,
getDocument, getDocument,
GlobalWorkerOptions, GlobalWorkerOptions,
Outliner,
PixelsPerInch, PixelsPerInch,
shadow, shadow,
TextLayer, TextLayer,
XfaLayer, XfaLayer,
} = pdfjsLib; } = pdfjsLib;
const { Outliner } = pdfjsTestingUtils;
const { GenericL10n, parseQueryString, SimpleLinkService } = pdfjsViewer; const { GenericL10n, parseQueryString, SimpleLinkService } = pdfjsViewer;
const WAITING_TIME = 100; // ms const WAITING_TIME = 100; // ms

View file

@ -61,7 +61,6 @@ import { AnnotationLayer } from "../../src/display/annotation_layer.js";
import { ColorPicker } from "../../src/display/editor/color_picker.js"; import { ColorPicker } from "../../src/display/editor/color_picker.js";
import { DrawLayer } from "../../src/display/draw_layer.js"; import { DrawLayer } from "../../src/display/draw_layer.js";
import { GlobalWorkerOptions } from "../../src/display/worker_options.js"; import { GlobalWorkerOptions } from "../../src/display/worker_options.js";
import { Outliner } from "../../src/display/editor/outliner.js";
import { TextLayer } from "../../src/display/text_layer.js"; import { TextLayer } from "../../src/display/text_layer.js";
import { XfaLayer } from "../../src/display/xfa_layer.js"; import { XfaLayer } from "../../src/display/xfa_layer.js";
@ -94,7 +93,6 @@ const expectedAPI = Object.freeze({
noContextMenu, noContextMenu,
normalizeUnicode, normalizeUnicode,
OPS, OPS,
Outliner,
PasswordResponses, PasswordResponses,
PDFDataRangeTransport, PDFDataRangeTransport,
PDFDateString, PDFDateString,

View file

@ -42,7 +42,6 @@ const {
noContextMenu, noContextMenu,
normalizeUnicode, normalizeUnicode,
OPS, OPS,
Outliner,
PasswordResponses, PasswordResponses,
PDFDataRangeTransport, PDFDataRangeTransport,
PDFDateString, PDFDateString,
@ -89,7 +88,6 @@ export {
noContextMenu, noContextMenu,
normalizeUnicode, normalizeUnicode,
OPS, OPS,
Outliner,
PasswordResponses, PasswordResponses,
PDFDataRangeTransport, PDFDataRangeTransport,
PDFDateString, PDFDateString,