Skip to content

Commit 96472be

Browse files
committed
types: add types for new features and adjust tests
1 parent 6893499 commit 96472be

File tree

11 files changed

+119
-278
lines changed

11 files changed

+119
-278
lines changed

.circleci/config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
- v1-vue-{{ .Branch }}-{{ checksum "package-lock.json" }}
1616
- v1-vue-{{ .Branch }}-
1717
- v1-vue-
18-
- run:
19-
name: Install Dependencies
20-
command: npm install
18+
- run: npm install
19+
- run: cd packages/vue-server-renderer && npm install
2120
- save_cache:
2221
key: v1-vue-{{ .Branch }}-{{ checksum "package-lock.json" }}
2322
paths:
2423
- node_modules/
24+
- packages/vue-server-renderer/node_modules
2525
- persist_to_workspace:
2626
root: ~/project
2727
paths:
@@ -33,7 +33,7 @@ jobs:
3333
- attach_workspace:
3434
at: ~/project
3535
- run: npm run lint
36-
- run: node_modules/.bin/flow check
36+
- run: npm run flow
3737
- run: npm run test:types
3838

3939
test-cover:

flow/options.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ declare type InternalComponentOptions = {
1212
staticRenderFns?: Array<Function>
1313
};
1414

15+
type InjectKey = string | Symbol;
16+
1517
declare type ComponentOptions = {
1618
// data
1719
data: Object | Function | void;
@@ -45,6 +47,7 @@ declare type ComponentOptions = {
4547
deactivated?: Function;
4648
beforeDestroy?: Function;
4749
destroyed?: Function;
50+
errorCaptured?: () => boolean | void;
4851

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

5558
// context
5659
provide?: { [key: string | Symbol]: any } | () => { [key: string | Symbol]: any };
57-
inject?: { [key: string]: string | Symbol } | Array<string>;
60+
inject?: { [key: string]: InjectKey | { from?: InjectKey, default?: any }} | Array<string>;
5861

5962
// component v-model customization
6063
model?: {

package-lock.json

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
},
5757
"homepage": "https://github.com/vuejs/vue#readme",
5858
"devDependencies": {
59+
"@types/node": "^8.0.33",
60+
"@types/webpack": "^3.0.13",
5961
"babel-core": "^6.25.0",
6062
"babel-eslint": "^7.2.3",
6163
"babel-helper-vue-jsx-merge-props": "^2.0.2",

0 commit comments

Comments
 (0)