Skip to content

Add a (basic) TypeScript definitions for the viewer components (issue 13267) #13588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions external/dist/legacy/web/pdf_viewer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "pdfjs-dist/types/web/pdf_viewer.component.d.ts";
2 changes: 1 addition & 1 deletion external/dist/lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 1 addition & 0 deletions external/dist/web/pdf_viewer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "pdfjs-dist/types/web/pdf_viewer.component.d.ts";
7 changes: 5 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
Expand Down