Merge pull request #15300 from Snuffleupagus/viewer-export-constants

[GENERIC viewer] Export some viewer constants in the default viewer (issue 15294)
This commit is contained in:
Tim van der Meij 2022-08-13 15:25:29 +02:00 committed by GitHub
commit b040d64a3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View File

@ -24,7 +24,13 @@ import {
PDFLinkService,
SimpleLinkService,
} from "./pdf_link_service.js";
import { parseQueryString, ProgressBar } from "./ui_utils.js";
import {
parseQueryString,
ProgressBar,
RenderingStates,
ScrollMode,
SpreadMode,
} from "./ui_utils.js";
import { PDFSinglePageViewer, PDFViewer } from "./pdf_viewer.js";
import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
import { DownloadManager } from "./download_manager.js";
@ -64,7 +70,10 @@ export {
PDFSinglePageViewer,
PDFViewer,
ProgressBar,
RenderingStates,
ScrollMode,
SimpleLinkService,
SpreadMode,
StructTreeLayerBuilder,
TextLayerBuilder,
XfaLayerBuilder,

View File

@ -13,7 +13,9 @@
* limitations under the License.
*/
import { RenderingStates, ScrollMode, SpreadMode } from "./ui_utils.js";
import { AppOptions } from "./app_options.js";
import { LinkTarget } from "./pdf_link_service.js";
import { PDFViewerApplication } from "./app.js";
/* eslint-disable-next-line no-unused-vars */
@ -23,7 +25,13 @@ const pdfjsVersion =
const pdfjsBuild =
typeof PDFJSDev !== "undefined" ? PDFJSDev.eval("BUNDLE_BUILD") : void 0;
const AppConstants =
typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")
? { LinkTarget, RenderingStates, ScrollMode, SpreadMode }
: null;
window.PDFViewerApplication = PDFViewerApplication;
window.PDFViewerApplicationConstants = AppConstants;
window.PDFViewerApplicationOptions = AppOptions;
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("CHROME")) {
@ -270,4 +278,8 @@ if (
document.addEventListener("DOMContentLoaded", webViewerLoad, true);
}
export { PDFViewerApplication, AppOptions as PDFViewerApplicationOptions };
export {
PDFViewerApplication,
AppConstants as PDFViewerApplicationConstants,
AppOptions as PDFViewerApplicationOptions,
};