Skip to content

增加对于typescript的支持 #15

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ module.exports = {
extends: 'eslint:recommended',
// required to lint *.vue files
plugins: [
'html'
'html',
'json'
],
// check if imports actually resolve
'settings': {
Expand Down
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,31 @@
"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",
"babel-preset-stage-2": "^6.13.0",
"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"
}
}
56 changes: 56 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Type definitions for vue-count-to 1.0.13
// Project: https://github.com/PanJiaChen/vue-countTo
// Definitions by: mimimile <https://github.com/mimimile>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4

import Vue, { ComponentOptions } from 'vue'

declare module '*.vue' {
interface ComponentOptions<V extends Vue> {
// 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
}
}