f1bbfdc16d
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
27 lines
524 B
JSON
27 lines
524 B
JSON
{
|
|
"compilerOptions": {
|
|
"outDir": "../../build/tmp",
|
|
"sourceMap": true,
|
|
"declaration": false,
|
|
"moduleResolution": "node",
|
|
"emitDecoratorMetadata": true,
|
|
"experimentalDecorators": true,
|
|
"target": "es5",
|
|
"module": "es2015",
|
|
"baseUrl": "./",
|
|
"strict": true,
|
|
"types": [],
|
|
"lib": [
|
|
"es2017",
|
|
"dom"
|
|
],
|
|
"paths": {
|
|
"pdfjs-dist": ["../../build/typestest"],
|
|
"pdfjs-dist/*": ["../../build/typestest/build/*"]
|
|
}
|
|
},
|
|
"files": [
|
|
"main.ts"
|
|
],
|
|
}
|