1- import Vue , { VNodeData , ComponentOptions , FunctionalComponentOptions , Component } from 'vue'
1+ import Vue , { VNodeData , ComponentOptions , FunctionalComponentOptions , Component , RenderContext } from 'vue'
22import { DefaultProps , PropsDefinition } from 'vue/types/options'
3+ import { ExtendedVue , CombinedVueInstance } from 'vue/types/vue'
34
45/**
56 * Utility type to declare an extended Vue constructor
@@ -161,10 +162,18 @@ interface MountOptions<V extends Vue> extends ComponentOptions<V> {
161162
162163type ThisTypedMountOptions < V extends Vue > = MountOptions < V > & ThisType < V >
163164
165+ interface FunctionalComponentMountOptions < V extends Vue > extends MountOptions < V > {
166+ context ?: Partial < RenderContext >
167+ }
168+
164169type ShallowMountOptions < V extends Vue > = MountOptions < V >
165170
166171type ThisTypedShallowMountOptions < V extends Vue > = ShallowMountOptions < V > & ThisType < V >
167172
173+ interface FunctionalComponentShallowMountOptions < V extends Vue > extends ShallowMountOptions < V > {
174+ context ?: Partial < RenderContext >
175+ }
176+
168177interface VueTestUtilsConfigOptions {
169178 stubs : Record < string , Component | boolean | string >
170179 mocks : Record < string , any >
@@ -179,11 +188,15 @@ export declare let config: VueTestUtilsConfigOptions
179188
180189export declare function mount < V extends Vue > ( component : VueClass < V > , options ?: ThisTypedMountOptions < V > ) : Wrapper < V >
181190export 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 >
183194
184195export declare function shallowMount < V extends Vue > ( component : VueClass < V > , options ?: ThisTypedShallowMountOptions < V > ) : Wrapper < V >
185196export 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 >
186198export 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 >
187200
188201export declare function createWrapper ( node : Vue , options ?: WrapperOptions ) : Wrapper < Vue >
189202export declare function createWrapper ( node : HTMLElement , options ?: WrapperOptions ) : Wrapper < null >
0 commit comments