diff --git a/package.json b/package.json index ece0b10cd..b49491abb 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -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", @@ -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" } } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..2cf481c8a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,10 @@ +{ + "include": ["src/**/*"], + "compilerOptions": { + "allowJs": true, + "declaration": true, + "emitDeclarationOnly": true, + "declarationMap": true, + "outDir": "dist" + } +} diff --git a/yarn.lock b/yarn.lock index 7b3dffd30..7bd2226da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"