Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): add typescript definition #29

Merged
merged 1 commit into from
Sep 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": {}
}
}