1
- import Vue , { VNodeData , ComponentOptions , FunctionalComponentOptions , Component } from 'vue'
1
+ import Vue , { VNodeData , ComponentOptions , FunctionalComponentOptions , Component , RenderContext } from 'vue'
2
2
import { DefaultProps , PropsDefinition } from 'vue/types/options'
3
+ import { ExtendedVue , CombinedVueInstance } from 'vue/types/vue'
3
4
4
5
/**
5
6
* Utility type to declare an extended Vue constructor
@@ -161,10 +162,18 @@ interface MountOptions<V extends Vue> extends ComponentOptions<V> {
161
162
162
163
type ThisTypedMountOptions < V extends Vue > = MountOptions < V > & ThisType < V >
163
164
165
+ interface FunctionalComponentMountOptions < V extends Vue > extends MountOptions < V > {
166
+ context ?: Partial < RenderContext >
167
+ }
168
+
164
169
type ShallowMountOptions < V extends Vue > = MountOptions < V >
165
170
166
171
type ThisTypedShallowMountOptions < V extends Vue > = ShallowMountOptions < V > & ThisType < V >
167
172
173
+ interface FunctionalComponentShallowMountOptions < V extends Vue > extends ShallowMountOptions < V > {
174
+ context ?: Partial < RenderContext >
175
+ }
176
+
168
177
interface VueTestUtilsConfigOptions {
169
178
stubs : Record < string , Component | boolean | string >
170
179
mocks : Record < string , any >
@@ -179,11 +188,15 @@ export declare let config: VueTestUtilsConfigOptions
179
188
180
189
export declare function mount < V extends Vue > ( component : VueClass < V > , options ?: ThisTypedMountOptions < V > ) : Wrapper < V >
181
190
export declare function mount < V extends Vue > ( component : ComponentOptions < V > , options ?: ThisTypedMountOptions < V > ) : Wrapper < V >
182
- export declare function mount < Props = DefaultProps , PropDefs = PropsDefinition < Props > > ( component : FunctionalComponentOptions < Props , PropDefs > , options ?: MountOptions < Vue > ) : Wrapper < Vue >
191
+ export declare function mount < V extends Vue , Data , Methods , Computed , Props > ( component : ExtendedVue < V , Data , Methods , Computed , Props > , options ?: ThisTypedMountOptions < V > ) : Wrapper < CombinedVueInstance < V , Data , Methods , Computed , Props > & Vue >
192
+ export declare function mount < Props = DefaultProps , PropDefs = PropsDefinition < Props > > ( component : FunctionalComponentOptions < Props , PropDefs > , options ?: MountOptions < Vue > ) : Wrapper < Vue >
193
+ export declare function mount < V extends Vue , Props = DefaultProps > ( component : ExtendedVue < V , { } , { } , { } , Props > , options ?: FunctionalComponentMountOptions < V > ) : Wrapper < CombinedVueInstance < V , { } , { } , { } , Props > & Vue >
183
194
184
195
export declare function shallowMount < V extends Vue > ( component : VueClass < V > , options ?: ThisTypedShallowMountOptions < V > ) : Wrapper < V >
185
196
export declare function shallowMount < V extends Vue > ( component : ComponentOptions < V > , options ?: ThisTypedShallowMountOptions < V > ) : Wrapper < V >
197
+ export declare function shallowMount < V extends Vue , Data , Methods , Computed , Props > ( component : ExtendedVue < V , Data , Methods , Computed , Props > , options ?: ThisTypedShallowMountOptions < V > ) : Wrapper < CombinedVueInstance < V , Data , Methods , Computed , Props > & Vue >
186
198
export declare function shallowMount < Props = DefaultProps , PropDefs = PropsDefinition < Props > > ( component : FunctionalComponentOptions < Props , PropDefs > , options ?: ShallowMountOptions < Vue > ) : Wrapper < Vue >
199
+ export declare function shallowMount < V extends Vue , Props = DefaultProps > ( component : ExtendedVue < V , { } , { } , { } , Props > , options ?: FunctionalComponentShallowMountOptions < V > ) : Wrapper < CombinedVueInstance < V , { } , { } , { } , Props > & Vue >
187
200
188
201
export declare function createWrapper ( node : Vue , options ?: WrapperOptions ) : Wrapper < Vue >
189
202
export declare function createWrapper ( node : HTMLElement , options ?: WrapperOptions ) : Wrapper < null >
0 commit comments