Skip to content

Commit

Permalink
add types definition
Browse files Browse the repository at this point in the history
add typescript as dev dependency and use it to generate type definition
files in dist/ folder.
fix #7
  • Loading branch information
NicolasCARPi committed May 15, 2024
1 parent 73cc3bc commit bd694f7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"main": "dist/dropzone.js",
"module": "dist/dropzone.mjs",
"standalone": "dist/dropzone-min.js",
"types": "dist/dropzone.d.ts",
"browserslist": "defaults, > 0.25%",
"targets": {
"main": {
Expand All @@ -38,7 +39,7 @@
],
"scripts": {
"watch": "parcel watch",
"build": "parcel build && yarn run css",
"build": "parcel build && yarn run css && tsc",
"css": "yarn sass src/:dist/ --style compressed",
"watch-css": "yarn sass src/:dist/ --watch --style compressed",
"test": "karma start test/karma.conf.js",
Expand Down Expand Up @@ -72,6 +73,7 @@
"parcel": "^2.0.0",
"sass": "^1.33.0",
"sinon": "^11.1.2",
"sinon-chai": "^3.5.0"
"sinon-chai": "^3.5.0",
"typescript": "^5.4.5"
}
}
10 changes: 10 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"include": ["src/**/*"],
"compilerOptions": {
"allowJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"declarationMap": true,
"outDir": "dist"
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3871,6 +3871,11 @@ type-is@~1.6.18:
media-typer "0.3.0"
mime-types "~2.1.24"

typescript@^5.4.5:
version "5.4.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611"
integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==

ua-parser-js@^0.7.30:
version "0.7.37"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.37.tgz#e464e66dac2d33a7a1251d7d7a99d6157ec27832"
Expand Down

0 comments on commit bd694f7

Please sign in to comment.