Skip to content

Commit

Permalink
[Feature:Developer] Add type declarations for typescript (Submitty#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
DefinitiveAbove authored Feb 8, 2022
1 parent 1e3f84f commit 6c61a03
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
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"
}
}

0 comments on commit 6c61a03

Please sign in to comment.