|
1 | 1 | import Vue, { VNodeData, ComponentOptions, FunctionalComponentOptions, Component } from 'vue'
|
| 2 | +import { DefaultProps, PropsDefinition } from 'vue/types/options' |
2 | 3 |
|
3 | 4 | /**
|
4 | 5 | * Utility type to declare an extended Vue constructor
|
@@ -79,21 +80,21 @@ export interface Wrapper<V extends Vue | null> extends BaseWrapper {
|
79 | 80 |
|
80 | 81 | get<R extends Vue> (selector: VueClass<R>): Wrapper<R>
|
81 | 82 | get<R extends Vue> (selector: ComponentOptions<R>): Wrapper<R>
|
82 |
| - get (selector: FunctionalComponentOptions): Wrapper<Vue> |
| 83 | + get<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(selector: FunctionalComponentOptions<Props, PropDefs>): Wrapper<Vue> |
83 | 84 | get (selector: string): Wrapper<Vue>
|
84 | 85 | get (selector: RefSelector): Wrapper<Vue>
|
85 | 86 | get (selector: NameSelector): Wrapper<Vue>
|
86 | 87 |
|
87 | 88 | find<R extends Vue> (selector: VueClass<R>): Wrapper<R>
|
88 | 89 | find<R extends Vue> (selector: ComponentOptions<R>): Wrapper<R>
|
89 |
| - find (selector: FunctionalComponentOptions): Wrapper<Vue> |
| 90 | + find<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(selector: FunctionalComponentOptions<Props, PropDefs>): Wrapper<Vue> |
90 | 91 | find (selector: string): Wrapper<Vue>
|
91 | 92 | find (selector: RefSelector): Wrapper<Vue>
|
92 | 93 | find (selector: NameSelector): Wrapper<Vue>
|
93 | 94 |
|
94 | 95 | findAll<R extends Vue> (selector: VueClass<R>): WrapperArray<R>
|
95 | 96 | findAll<R extends Vue> (selector: ComponentOptions<R>): WrapperArray<R>
|
96 |
| - findAll (selector: FunctionalComponentOptions): WrapperArray<Vue> |
| 97 | + findAll<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(selector: FunctionalComponentOptions<Props, PropDefs>): WrapperArray<Vue> |
97 | 98 | findAll (selector: string): WrapperArray<Vue>
|
98 | 99 | findAll (selector: RefSelector): WrapperArray<Vue>
|
99 | 100 | findAll (selector: NameSelector): WrapperArray<Vue>
|
@@ -157,11 +158,11 @@ export declare let config: VueTestUtilsConfigOptions
|
157 | 158 |
|
158 | 159 | export declare function mount<V extends Vue> (component: VueClass<V>, options?: ThisTypedMountOptions<V>): Wrapper<V>
|
159 | 160 | export declare function mount<V extends Vue> (component: ComponentOptions<V>, options?: ThisTypedMountOptions<V>): Wrapper<V>
|
160 |
| -export declare function mount (component: FunctionalComponentOptions, options?: MountOptions<Vue>): Wrapper<Vue> |
| 161 | +export declare function mount<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(component: FunctionalComponentOptions<Props, PropDefs>, options?: MountOptions<Vue>): Wrapper<Vue> |
161 | 162 |
|
162 | 163 | export declare function shallowMount<V extends Vue> (component: VueClass<V>, options?: ThisTypedShallowMountOptions<V>): Wrapper<V>
|
163 | 164 | export declare function shallowMount<V extends Vue> (component: ComponentOptions<V>, options?: ThisTypedShallowMountOptions<V>): Wrapper<V>
|
164 |
| -export declare function shallowMount (component: FunctionalComponentOptions, options?: ShallowMountOptions<Vue>): Wrapper<Vue> |
| 165 | +export declare function shallowMount<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(component: FunctionalComponentOptions<Props, PropDefs>, options?: ShallowMountOptions<Vue>): Wrapper<Vue> |
165 | 166 |
|
166 | 167 | export declare function createWrapper(node: Vue, options?: WrapperOptions): Wrapper<Vue>
|
167 | 168 | export declare function createWrapper(node: HTMLElement, options?: WrapperOptions): Wrapper<null>
|
|
0 commit comments