1 |
|
2 |
|
3 | import {
|
4 | no,
|
5 | noop,
|
6 | identity
|
7 | } from 'shared/util'
|
8 |
|
9 | import { LIFECYCLE_HOOKS } from 'shared/constants'
|
10 |
|
11 | export type Config = {
|
12 |
|
13 | optionMergeStrategies: { [key: string]: Function };
|
14 | silent: boolean;
|
15 | productionTip: boolean;
|
16 | performance: boolean;
|
17 | devtools: boolean;
|
18 | errorHandler: ?(err: Error, vm: Component, info: string) => void;
|
19 | warnHandler: ?(msg: string, vm: Component, trace: string) => void;
|
20 | ignoredElements: Array<string | RegExp>;
|
21 | keyCodes: { [key: string]: number | Array<number> };
|
22 |
|
23 |
|
24 | isReservedTag: (x?: string) => boolean;
|
25 | isReservedAttr: (x?: string) => boolean;
|
26 | parsePlatformTagName: (x: string) => string;
|
27 | isUnknownElement: (x?: string) => boolean;
|
28 | getTagNamespace: (x?: string) => string | void;
|
29 | mustUseProp: (tag: string, type: ?string, name: string) => boolean;
|
30 |
|
31 |
|
32 | async: boolean;
|
33 |
|
34 |
|
35 | _lifecycleHooks: Array<string>;
|
36 | };
|
37 |
|
38 | export default ({
|
39 | |
40 |
|
41 |
|
42 |
|
43 | optionMergeStrategies: Object.create(null),
|
44 |
|
45 | |
46 |
|
47 |
|
48 | silent: false,
|
49 |
|
50 | |
51 |
|
52 |
|
53 | productionTip: process.env.NODE_ENV !== 'production',
|
54 |
|
55 | |
56 |
|
57 |
|
58 | devtools: process.env.NODE_ENV !== 'production',
|
59 |
|
60 | |
61 |
|
62 |
|
63 | performance: false,
|
64 |
|
65 | |
66 |
|
67 |
|
68 | errorHandler: null,
|
69 |
|
70 | |
71 |
|
72 |
|
73 | warnHandler: null,
|
74 |
|
75 | |
76 |
|
77 |
|
78 | ignoredElements: [],
|
79 |
|
80 | |
81 |
|
82 |
|
83 |
|
84 | keyCodes: Object.create(null),
|
85 |
|
86 | |
87 |
|
88 |
|
89 |
|
90 | isReservedTag: no,
|
91 |
|
92 | |
93 |
|
94 |
|
95 |
|
96 | isReservedAttr: no,
|
97 |
|
98 | |
99 |
|
100 |
|
101 |
|
102 | isUnknownElement: no,
|
103 |
|
104 | |
105 |
|
106 |
|
107 | getTagNamespace: noop,
|
108 |
|
109 | |
110 |
|
111 |
|
112 | parsePlatformTagName: identity,
|
113 |
|
114 | |
115 |
|
116 |
|
117 |
|
118 | mustUseProp: no,
|
119 |
|
120 | |
121 |
|
122 |
|
123 |
|
124 | async: true,
|
125 |
|
126 | |
127 |
|
128 |
|
129 | _lifecycleHooks: LIFECYCLE_HOOKS
|
130 | }: Config)
|