Skip to content

Commit 87d04cf

Browse files
authored
Merge pull request #21 from asulta/ts-definitions
Typescript definition added
2 parents 833dfda + df525d8 commit 87d04cf

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

index.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Vue, {PluginFunction, PluginObject} from "vue";
2+
import {AxiosInstance} from "axios";
3+
4+
declare module "vue/types/vue" {
5+
6+
interface Vue {
7+
axios: AxiosInstance;
8+
$http: AxiosInstance;
9+
}
10+
11+
namespace Vue {
12+
const axios: AxiosInstance;
13+
}
14+
15+
}
16+
17+
declare class VueAxios {
18+
static install: PluginFunction<AxiosInstance>;
19+
}
20+
21+
export = VueAxios

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.0.2",
44
"description": "A small wrapper for integrating axios to Vuejs",
55
"main": "dist/vue-axios.min.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"test": "npm run test"
89
},
@@ -26,12 +27,14 @@
2627
},
2728
"homepage": "https://github.com/imcvampire/vue-axios#readme",
2829
"devDependencies": {
30+
"axios": "^0.17.1",
2931
"babel-core": "^6.18.0",
3032
"babel-preset-es2015": "^6.18.0",
3133
"gulp": "^3.9.1",
3234
"gulp-babel": "^6.1.2",
3335
"gulp-rename": "^1.2.2",
34-
"gulp-uglifyjs": "^0.6.2"
36+
"gulp-uglifyjs": "^0.6.2",
37+
"vue": "^2.5.13"
3538
},
3639
"peerDependencies": {
3740
"vue": ">= 1.0.0"

0 commit comments

Comments
 (0)