pdf.js/external/dist
Michael Wu c08b4ea30d Fix Viewer API definitions and include in CI
The Viewer API definitions do not compile because of missing imports and
anonymous objects are typed as `Object`. These issues were not caught
during CI because the test project was not compiling anything from the
Viewer API.

As an example of the first problem:

```
/**
 * @implements MyInterface
 */
export class MyClass {
    ...
}
```

will generate a broken definition that doesn’t import MyInterface:

```
/**
 * @implements MyInterface
 */
export class MyClass implements MyInterface {
    ...
}
```

This can be fixed by adding a typedef jsdoc to specify the import:

```
/** @typedef {import("./otherFile").MyInterface} MyInterface */
```

See https://github.com/jsdoc/jsdoc/issues/1537 and
https://github.com/microsoft/TypeScript/issues/22160 for more details.

As an example of the second problem:

```
/**
 * Gets the size of the specified page, converted from PDF units to inches.
 * @param {Object} An Object containing the properties: {Array} `view`,
 *   {number} `userUnit`, and {number} `rotate`.
 */
function getPageSizeInches({ view, userUnit, rotate }) {
    ...
}
```

generates the broken definition:

```
function getPageSizeInches({ view, userUnit, rotate }: Object) {
    ...
}
```

The jsdoc should specify the type of each nested property:

```
/**
 * Gets the size of the specified page, converted from PDF units to inches.
 * @param {Object} options An object containing the properties: {Array} `view`,
 *   {number} `userUnit`, and {number} `rotate`.
 * @param {number[]} options.view
 * @param {number} options.userUnit
 * @param {number} options.rotate
 */
```
2021-08-25 18:45:46 -04:00
..
legacy Fix Viewer API definitions and include in CI 2021-08-25 18:45:46 -04:00
lib Add a (basic) TypeScript definitions for the viewer components (issue 13267) 2021-06-19 16:24:34 +02:00
web Fix Viewer API definitions and include in CI 2021-08-25 18:45:46 -04:00
CODE_OF_CONDUCT.md Include the code of conduct for pdfjs-dist too 2019-03-30 19:00:57 +01:00
README.md [api-minor] Rename -es5 to -legacy, to reduce confusion over what's actually supported (issue 12976) 2021-02-10 16:01:59 +01:00
webpack.js making webpack aware of the change inside of the worker file and hashing its name on build accordingly 2021-07-08 13:32:58 -03:00

PDF.js

PDF.js is a Portable Document Format (PDF) library that is built with HTML5. Our goal is to create a general-purpose, web standards-based platform for parsing and rendering PDFs.

This is a pre-built version of the PDF.js source code. It is automatically generated by the build scripts.

For usage with older browsers or environments, without support for modern features such as e.g. async/await, ReadableStream, optional chaining, and nullish coalescing; please see the legacy folder.

See https://github.com/mozilla/pdf.js for learning and contributing.