diff --git a/README.md b/README.md index 3afb609..04c38d0 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,19 @@ 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 plugin is written with the most used JavaScript framework: [VanillaJS](http://vanilla-js.com/). + Features: - Works with Bootstrap 4 -- Works without *dependencies* +- Works without *dependencies* and jQuery - Display file name - Display file names for `multiple` input - Reset your custom file input to its initial state - Handle form reset - Allow custom selectors for input, and form - Allow to drag and drop files +- Built in UMD to be used everywhere - Small, only **2kb** and less if you gzip it ## Table of contents 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": {} + } }