Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #1426 #1427

Merged
merged 1 commit into from
Feb 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/server-test-utils/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Vue, { VNodeData, ComponentOptions, FunctionalComponentOptions, Component } from 'vue'
import { DefaultProps, PropsDefinition } from 'vue/types/options'

/**
* Utility type to declare an extended Vue constructor
Expand Down Expand Up @@ -50,8 +51,8 @@ export declare let config: VueTestUtilsConfigOptions

export declare function render<V extends Vue> (component: VueClass<V>, options?: ThisTypedMountOptions<V>): Promise<Cheerio>
export declare function render<V extends Vue> (component: ComponentOptions<V>, options?: ThisTypedMountOptions<V>): Promise<Cheerio>
export declare function render (component: FunctionalComponentOptions, options?: MountOptions<Vue>): Promise<Cheerio>
export declare function render<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(component: FunctionalComponentOptions<Props, PropDefs>, options?: MountOptions<Vue>): Promise<Cheerio>

export declare function renderToString<V extends Vue> (component: VueClass<V>, options?: ThisTypedMountOptions<V>): Promise<string>
export declare function renderToString<V extends Vue> (component: ComponentOptions<V>, options?: ThisTypedMountOptions<V>): Promise<string>
export declare function renderToString (component: FunctionalComponentOptions, options?: MountOptions<Vue>): Promise<string>
export declare function renderToString<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(component: FunctionalComponentOptions<Props, PropDefs>, options?: MountOptions<Vue>): Promise<string>
11 changes: 6 additions & 5 deletions packages/test-utils/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Vue, { VNodeData, ComponentOptions, FunctionalComponentOptions, Component } from 'vue'
import { DefaultProps, PropsDefinition } from 'vue/types/options'

/**
* Utility type to declare an extended Vue constructor
Expand Down Expand Up @@ -79,21 +80,21 @@ export interface Wrapper<V extends Vue | null> extends BaseWrapper {

get<R extends Vue> (selector: VueClass<R>): Wrapper<R>
get<R extends Vue> (selector: ComponentOptions<R>): Wrapper<R>
get (selector: FunctionalComponentOptions): Wrapper<Vue>
get<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(selector: FunctionalComponentOptions<Props, PropDefs>): Wrapper<Vue>
get (selector: string): Wrapper<Vue>
get (selector: RefSelector): Wrapper<Vue>
get (selector: NameSelector): Wrapper<Vue>

find<R extends Vue> (selector: VueClass<R>): Wrapper<R>
find<R extends Vue> (selector: ComponentOptions<R>): Wrapper<R>
find (selector: FunctionalComponentOptions): Wrapper<Vue>
find<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(selector: FunctionalComponentOptions<Props, PropDefs>): Wrapper<Vue>
find (selector: string): Wrapper<Vue>
find (selector: RefSelector): Wrapper<Vue>
find (selector: NameSelector): Wrapper<Vue>

findAll<R extends Vue> (selector: VueClass<R>): WrapperArray<R>
findAll<R extends Vue> (selector: ComponentOptions<R>): WrapperArray<R>
findAll (selector: FunctionalComponentOptions): WrapperArray<Vue>
findAll<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(selector: FunctionalComponentOptions<Props, PropDefs>): WrapperArray<Vue>
findAll (selector: string): WrapperArray<Vue>
findAll (selector: RefSelector): WrapperArray<Vue>
findAll (selector: NameSelector): WrapperArray<Vue>
Expand Down Expand Up @@ -157,11 +158,11 @@ export declare let config: VueTestUtilsConfigOptions

export declare function mount<V extends Vue> (component: VueClass<V>, options?: ThisTypedMountOptions<V>): Wrapper<V>
export declare function mount<V extends Vue> (component: ComponentOptions<V>, options?: ThisTypedMountOptions<V>): Wrapper<V>
export declare function mount (component: FunctionalComponentOptions, options?: MountOptions<Vue>): Wrapper<Vue>
export declare function mount<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(component: FunctionalComponentOptions<Props, PropDefs>, options?: MountOptions<Vue>): Wrapper<Vue>

export declare function shallowMount<V extends Vue> (component: VueClass<V>, options?: ThisTypedShallowMountOptions<V>): Wrapper<V>
export declare function shallowMount<V extends Vue> (component: ComponentOptions<V>, options?: ThisTypedShallowMountOptions<V>): Wrapper<V>
export declare function shallowMount (component: FunctionalComponentOptions, options?: ShallowMountOptions<Vue>): Wrapper<Vue>
export declare function shallowMount<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(component: FunctionalComponentOptions<Props, PropDefs>, options?: ShallowMountOptions<Vue>): Wrapper<Vue>

export declare function createWrapper(node: Vue, options?: WrapperOptions): Wrapper<Vue>
export declare function createWrapper(node: HTMLElement, options?: WrapperOptions): Wrapper<null>
Expand Down