diff --git a/README.md b/README.md index 3afb609..1d63543 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ A little plugin which makes Bootstrap 4 custom file input dynamic with no dependencies. +You can use it on [React](https://stackblitz.com/edit/bs-custom-file-input-react) and Angular too because this plugins is written with the most used JavaScript framework: [VanillaJS](http://vanilla-js.com/) + Features: - Works with Bootstrap 4 diff --git a/bs-custom-file-input.d.ts b/bs-custom-file-input.d.ts new file mode 100644 index 0000000..7f0bd8f --- /dev/null +++ b/bs-custom-file-input.d.ts @@ -0,0 +1,8 @@ +declare module 'bs-custom-file-input' { + interface bsCustomFileInput { + init(inputSelector?: string, formSelector?: string): void, + destroy(): void, + } + + export default bsCustomFileInput; +} diff --git a/package.json b/package.json index 9fed102..3360cea 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.0.2", "description": "A little plugin for Bootstrap 4 custom file input", "main": "dist/bs-custom-file-input.js", + "types": "bs-custom-file-input.d.ts", "bugs": { "url": "https://github.com/Johann-S/bs-custom-file-input/issues" }, @@ -21,12 +22,16 @@ "test": "npm run js-lint && npm run js-test" }, "files": [ - "dist/*.{js,map}" + "dist/*.{js,map}", + "bs-custom-file-input.d.ts" ], "keywords": [ "bootstrap", "bootstrap 4", - "custom file input" + "custom file input", + "vanillajs", + "react", + "angular" ], "author": "Johann-S ", "homepage": "https://github.com/Johann-S/bs-custom-file-input", @@ -35,6 +40,7 @@ "url": "git+https://github.com/Johann-S/bs-custom-file-input.git" }, "license": "MIT", + "dependencies": {}, "devDependencies": { "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", @@ -60,6 +66,5 @@ "shx": "^0.3.2", "sinon": "^6.1.5", "standard-version": "^4.4.0" - }, - "dependencies": {} + } }