Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add types for typescript
  • Loading branch information
DefinitiveAbove committed Feb 7, 2022
commit cf2ec6b11b177b0b1968f86d9b3e78bbc562bb50
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ shared/pdf_viewer.css
shared/pdf_viewer.js
shared/pdf_viewer.js.map
shared/cmaps/
types/
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
"version": "2.4.0",
"description": "Annotation layer for pdf.js",
"main": "index.js",
"types": "types",
"scripts": {
"test": "karma start --single-run",
"start": "./scripts/web",
"lint": "./node_modules/.bin/eslint .",
"startindocker": "./scripts/web-docker",
"build": "webpack && MINIFY=1 webpack",
"codecov": "codecov",
"prepublishOnly": "npm run build"
"prepublishOnly": "npm run build && npm run types",
"types": "tsc"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -58,6 +60,7 @@
"sinon": "^9.0.2",
"sinon-chai": "^3.3.0",
"terser-webpack-plugin": "^4.2.3",
"typescript": "^4.5.5",
"webpack": "^4.34.0",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^3.7.2"
Expand All @@ -69,6 +72,7 @@
"dist",
"src",
"index.js",
"types",
"LICENSE.md",
"README.md",
"webpack.config.js"
Expand Down
10 changes: 10 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"include": ["src/**/*.js", "index.js"],
"compilerOptions": {
"allowJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"declarationMap": true,
"outDir": "types"
}
}