= T extends new (...args: any) => {
$props: infer P;
} ? NonNullable : T extends (props: infer P, ...args: any) => any ? P : {};
type ComponentSlots = T extends new (...args: any) => {
$slots: infer S;
} ? NonNullable : T extends (props: any, ctx: {
slots: infer S;
attrs: any;
emit: any;
}, ...args: any) => any ? NonNullable : {};
type ShimSlotReturnType = T extends (...args: infer P) => any ? (...args: P) => any : never;
type WithArray = T | T[];
type ComponentData = T extends {
data?(...args: any): infer D;
} ? D : {};
type ComponentMountingOptions$1 = ComponentProps> = Omit>, 'slots'> & {
slots?: {
[K in keyof ComponentSlots]: WithArray[K]> | string | VNode | (new () => any) | {
template: string;
}>;
};
} & Record;
declare function renderToString any) | (new (...args: any) => any) ? T : T extends {
props?: infer Props;
} ? DefineComponent | (infer PropNames)[] ? {
[key in PropNames extends string ? PropNames : string]?: any;
} : Props> : DefineComponent>(originalComponent: T, options?: ComponentMountingOptions$1 & Pick, 'attachTo'>): Promise;
declare function createWrapperError(wrapperType: 'DOMWrapper' | 'VueWrapper'): T;
declare function flushPromises(): Promise;
declare function disableAutoUnmount(): void;
declare function enableAutoUnmount(hook: (callback: () => void) => void): void;
declare const VueTestUtils: {
renderToString: typeof renderToString;
enableAutoUnmount: typeof enableAutoUnmount;
disableAutoUnmount: typeof disableAutoUnmount;
RouterLinkStub: any;
VueWrapper: typeof VueWrapper;
DOMWrapper: typeof DOMWrapper;
BaseWrapper: typeof BaseWrapper;
config: GlobalConfigOptions;
flushPromises: typeof flushPromises;
createWrapperError: typeof createWrapperError;
};
type GlobalMountOptions = Required>['global'];
declare global {
namespace Cypress {
interface Cypress {
vueWrapper: VueWrapper;
vue: ComponentPublicInstance;
}
}
}
type MountingOptions = Omit, 'attachTo'> & {
log?: boolean;
/**
* @deprecated use vue-test-utils `global` instead
*/
extensions?: GlobalMountOptions & {
use?: GlobalMountOptions['plugins'];
mixin?: GlobalMountOptions['mixins'];
};
};
type CyMountOptions = MountingOptions;
/**
* The types for mount have been copied directly from the VTU mount
* https://github.com/vuejs/vue-test-utils-next/blob/master/src/mount.ts.
*
* There isn't a good way to make them generic enough that we can extend them.
*
* In addition, we modify the types slightly.
*
* `MountOptions` are modifying, including some Cypress specific options like `styles`.
* The return type is different. Instead of VueWrapper, it's Cypress.Chainable>.
*/
type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
type ComponentMountingOptions = T extends DefineComponent ? MountingOptions> & Omit> & PublicProps, keyof ExtractDefaultPropTypes>, D> & Record : MountingOptions;
declare function mount(originalComponent: {
new (...args: any[]): V;
__vccOpts: any;
}, options?: MountingOptions & Record): Cypress.Chainable<{
wrapper: VueWrapper>;
component: VueWrapper>['vm'];
}>;
declare function mount(originalComponent: {
new (...args: any[]): V;
__vccOpts: any;
defaultProps?: Record> | string[];
}, options?: MountingOptions & Record): Cypress.Chainable<{
wrapper: VueWrapper>;
component: VueWrapper>['vm'];
}>;
declare function mount(originalComponent: {
new (...args: any[]): V;
registerHooks(keys: string[]): void;
}, options?: MountingOptions & Record): Cypress.Chainable<{
wrapper: VueWrapper>;
component: VueWrapper>['vm'];
}>;
declare function mount(originalComponent: {
new (...args: any[]): V;
props(Props: P): any;
registerHooks(keys: string[]): void;
}, options?: MountingOptions & Record): Cypress.Chainable<{
wrapper: VueWrapper>;
component: VueWrapper>['vm'];
}>;
declare function mount(originalComponent: FunctionalComponent, options?: MountingOptions & Record