Add typescript definitions

This PR adds typescript definitions from the JSDoc already present.
It adds a new gulp-target 'types' that calls 'tsc', the typescript
compiler, to create the definitions.

To use the definitions, users can simply do the following:

```
import {getDocument, GlobalWorkerOptions} from "pdfjs-dist";
import pdfjsWorker from "pdfjs-dist/build/pdf.worker.entry";
GlobalWorkerOptions.workerSrc = pdfjsWorker;

const pdf = await getDocument("file:///some.pdf").promise;
```

Co-authored-by: @oBusk
Co-authored-by: @tamuratak
This commit is contained in:
Linus Gasser 2020-07-22 22:38:04 +02:00 committed by Linus Gasser
parent 6537e64cb8
commit f1bbfdc16d
12 changed files with 344 additions and 139 deletions

View file

@ -430,6 +430,9 @@ var CanvasExtraState = (function CanvasExtraStateClosure() {
return CanvasExtraState;
})();
/**
* @type {any}
*/
var CanvasGraphics = (function CanvasGraphicsClosure() {
// Defines the time the executeOperatorList is going to be executing
// before it stops and shedules a continue of execution.