Skip to content

Commit f36aea1

Browse files
KingwlaJean
authored andcommitted
feat(types): extract VueConfiguration type for easy expansion (vuejs#7273) (vuejs#7274)
fix vuejs#7273
1 parent 4febba5 commit f36aea1

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

types/vue.d.ts

+13-11
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ export interface Vue {
6464
export type CombinedVueInstance<Instance extends Vue, Data, Methods, Computed, Props> = Data & Methods & Computed & Props & Instance;
6565
export type ExtendedVue<Instance extends Vue, Data, Methods, Computed, Props> = VueConstructor<CombinedVueInstance<Instance, Data, Methods, Computed, Props> & Vue>;
6666

67+
export interface VueConfiguration {
68+
silent: boolean;
69+
optionMergeStrategies: any;
70+
devtools: boolean;
71+
productionTip: boolean;
72+
performance: boolean;
73+
errorHandler(err: Error, vm: Vue, info: string): void;
74+
warnHandler(msg: string, vm: Vue, trace: string): void;
75+
ignoredElements: (string | RegExp)[];
76+
keyCodes: { [key: string]: number | number[] };
77+
}
78+
6779
export interface VueConstructor<V extends Vue = Vue> {
6880
new <Data = object, Methods = object, Computed = object, PropNames extends string = never>(options?: ThisTypedComponentOptionsWithArrayProps<V, Data, Methods, Computed, PropNames>): CombinedVueInstance<V, Data, Methods, Computed, Record<PropNames, any>>;
6981
// ideally, the return type should just contains Props, not Record<keyof Props, any>. But TS requires Base constructors must all have the same return type.
@@ -106,17 +118,7 @@ export interface VueConstructor<V extends Vue = Vue> {
106118
staticRenderFns: (() => VNode)[];
107119
};
108120

109-
config: {
110-
silent: boolean;
111-
optionMergeStrategies: any;
112-
devtools: boolean;
113-
productionTip: boolean;
114-
performance: boolean;
115-
errorHandler(err: Error, vm: Vue, info: string): void;
116-
warnHandler(msg: string, vm: Vue, trace: string): void;
117-
ignoredElements: (string | RegExp)[];
118-
keyCodes: { [key: string]: number | number[] };
119-
}
121+
config: VueConfiguration;
120122
}
121123

122124
export const Vue: VueConstructor;

0 commit comments

Comments
 (0)