diff --git a/.eslintrc.js b/.eslintrc.js index a388ba2..8b7368f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,7 +11,8 @@ module.exports = { extends: 'eslint:recommended', // required to lint *.vue files plugins: [ - 'html' + 'html', + 'json' ], // check if imports actually resolve 'settings': { diff --git a/package.json b/package.json index 090c274..444f0d2 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,12 @@ "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot --content-base='./demo/'", "build": "cross-env NODE_ENV=production webpack --progress --hide-modules" }, + "typings": "types/index.d.ts", "license": "MIT", "homepage": "http://panjiachen.github.io/countTo/demo/", "devDependencies": { "babel-core": "^6.0.0", + "babel-eslint": "7.1.1", "babel-loader": "^6.0.0", "babel-plugin-transform-runtime": "^6.15.0", "babel-preset-es2015": "^6.14.0", @@ -19,18 +21,18 @@ "babel-runtime": "^6.11.6", "cross-env": "^3.0.0", "css-loader": "^0.25.0", - "file-loader": "^0.9.0", - "vue-loader": "^11.1.4", - "vue-template-compiler": "^2.2.1", - "webpack": "^2.2.0", - "webpack-dev-server": "^2.2.0", - "babel-eslint": "7.1.1", "eslint": "3.14.1", + "eslint-config-airbnb-base": "11.0.1", "eslint-friendly-formatter": "2.0.7", + "eslint-import-resolver-webpack": "0.8.1", "eslint-loader": "1.6.1", "eslint-plugin-html": "2.0.0", - "eslint-config-airbnb-base": "11.0.1", - "eslint-import-resolver-webpack": "0.8.1", - "eslint-plugin-import": "2.2.0" + "eslint-plugin-import": "2.2.0", + "file-loader": "^0.9.0", + "vue": "^2.5.16", + "vue-loader": "^11.1.4", + "vue-template-compiler": "^2.2.1", + "webpack": "^2.2.0", + "webpack-dev-server": "^2.2.0" } } diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 0000000..2244bfe --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,56 @@ +// Type definitions for vue-count-to 1.0.13 +// Project: https://github.com/PanJiaChen/vue-countTo +// Definitions by: mimimile +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import Vue, { ComponentOptions } from 'vue' + +declare module '*.vue' { + interface ComponentOptions { + // the value you want to begin at + startVal: number + + // the value you want to arrive at + endVal: number + + // duration in millisecond + duration: number + + // when mounted autoplay + autoplay: boolean + + // the number of decimal places to show + decimals: number + + // the split decimal + decimal: string + + // the separator + separator: string + + // the prefix + prefix: string + + // the suffix + suffix: string + + // is use easing function + useEasing: boolean + + // the easing function + easingFn: Function + + // when mounted will emit mountedCallback + mountedCallback (): void + + // start the countTo + start (): void + + // pause the countTo + pause (): void + + // reset the countTo + reset (): void + } +}