Skip to content

Commit

Permalink
types: add types for new features and adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 6, 2017
1 parent 6893499 commit 96472be
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 278 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
- v1-vue-{{ .Branch }}-{{ checksum "package-lock.json" }}
- v1-vue-{{ .Branch }}-
- v1-vue-
- run:
name: Install Dependencies
command: npm install
- run: npm install
- run: cd packages/vue-server-renderer && npm install
- save_cache:
key: v1-vue-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
- node_modules/
- packages/vue-server-renderer/node_modules
- persist_to_workspace:
root: ~/project
paths:
Expand All @@ -33,7 +33,7 @@ jobs:
- attach_workspace:
at: ~/project
- run: npm run lint
- run: node_modules/.bin/flow check
- run: npm run flow
- run: npm run test:types

test-cover:
Expand Down
5 changes: 4 additions & 1 deletion flow/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ declare type InternalComponentOptions = {
staticRenderFns?: Array<Function>
};

type InjectKey = string | Symbol;

declare type ComponentOptions = {
// data
data: Object | Function | void;
Expand Down Expand Up @@ -45,6 +47,7 @@ declare type ComponentOptions = {
deactivated?: Function;
beforeDestroy?: Function;
destroyed?: Function;
errorCaptured?: () => boolean | void;

// assets
directives?: { [key: string]: Object };
Expand All @@ -54,7 +57,7 @@ declare type ComponentOptions = {

// context
provide?: { [key: string | Symbol]: any } | () => { [key: string | Symbol]: any };
inject?: { [key: string]: string | Symbol } | Array<string>;
inject?: { [key: string]: InjectKey | { from?: InjectKey, default?: any }} | Array<string>;

// component v-model customization
model?: {
Expand Down
38 changes: 38 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
},
"homepage": "https://github.com/vuejs/vue#readme",
"devDependencies": {
"@types/node": "^8.0.33",
"@types/webpack": "^3.0.13",
"babel-core": "^6.25.0",
"babel-eslint": "^7.2.3",
"babel-helper-vue-jsx-merge-props": "^2.0.2",
Expand Down
Loading

0 comments on commit 96472be

Please sign in to comment.