Skip to content

Commit

Permalink
feat(core): add typescript definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann-S committed Sep 1, 2018
1 parent b1a5dab commit c8e5a01
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions bs-custom-file-input.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
declare module 'bs-custom-file-input' {
interface bsCustomFileInput {
init(inputSelector?: string, formSelector?: string): void,
destroy(): void,
}

export default bsCustomFileInput;
}
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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 <johann.servoire@gmail.com>",
"homepage": "https://github.com/Johann-S/bs-custom-file-input",
Expand All @@ -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",
Expand All @@ -60,6 +66,5 @@
"shx": "^0.3.2",
"sinon": "^6.1.5",
"standard-version": "^4.4.0"
},
"dependencies": {}
}
}

0 comments on commit c8e5a01

Please sign in to comment.