Merge pull request #13588 from Snuffleupagus/viewer-component-types

Add a (basic) TypeScript definitions for the viewer components (issue 13267)
This commit is contained in:
Tim van der Meij 2021-06-19 19:02:08 +02:00 committed by GitHub
commit 94ca66f528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1 @@
export * from "pdfjs-dist/types/web/pdf_viewer.component.d.ts";

View File

@ -3,5 +3,5 @@ pre-built library as found in e.g. the `/build`, `/web`, and `/image_decoders`
folders in the root of this repository.
Please note that the "lib" build target exists mostly to enable unit-testing in
Node.js/Travis, and that you'll need to handle e.g. any necessary polyfills
Node.js/GitHub, and that you'll need to handle e.g. any necessary polyfills
and/or Node.js dependencies yourself if using the files in this folder.

1
external/dist/web/pdf_viewer.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export * from "pdfjs-dist/types/web/pdf_viewer.component.d.ts";

View File

@ -1382,7 +1382,10 @@ gulp.task("types", function (done) {
"emitDeclarationOnly",
"moduleResolution node",
].join(" --");
exec(`"node_modules/.bin/tsc" --${args} src/pdf.js`, done);
exec(
`"node_modules/.bin/tsc" --${args} src/pdf.js web/pdf_viewer.component.js`,
done
);
});
function buildLibHelper(bundleDefines, inputStream, outputDir) {
@ -1993,7 +1996,7 @@ function packageBowerJson() {
name: DIST_NAME,
version: VERSION,
main: "build/pdf.js",
types: "types/pdf.d.ts",
types: "types/src/pdf.d.ts",
description: DIST_DESCRIPTION,
keywords: DIST_KEYWORDS,
homepage: DIST_HOMEPAGE,