diff --git a/npm/vue/src/index.ts b/npm/vue/src/index.ts index c94820bf83d6..97317f1ff51b 100644 --- a/npm/vue/src/index.ts +++ b/npm/vue/src/index.ts @@ -92,6 +92,7 @@ const cleanup = () => { * `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< @@ -206,46 +207,47 @@ export function mount< > & Record ): Cypress.Chainable<{ + wrapper: VueWrapper< - InstanceType< - DefineComponent< - PropsOrPropOptions, - RawBindings, - D, - C, - M, - Mixin, - Extends, - E, - EE, - PP, - Props, - Defaults - > + InstanceType< + DefineComponent< + PropsOrPropOptions, + RawBindings, + D, + C, + M, + Mixin, + Extends, + E, + EE, + PP, + Props, + Defaults > > +> component: VueWrapper< - InstanceType< - DefineComponent< - PropsOrPropOptions, - RawBindings, - D, - C, - M, - Mixin, - Extends, - E, - EE, - PP, - Props, - Defaults - > + InstanceType< + DefineComponent< + PropsOrPropOptions, + RawBindings, + D, + C, + M, + Mixin, + Extends, + E, + EE, + PP, + Props, + Defaults > - >['vm']} -> + > +>['vm'] +}> // component declared by vue-tsc ScriptSetup -export function mount>( +export function mount>( component: T, options?: ComponentMountingOptions ): Cypress.Chainable<{ @@ -278,9 +280,17 @@ export function mount< >, options?: MountingOptions ): Cypress.Chainable<{ - wrapper: VueWrapper> - component: VueWrapper>['vm'] -}> & Record + wrapper: VueWrapper< + + ComponentPublicInstance +> & + Record + component: VueWrapper< + + ComponentPublicInstance +> & + Record['vm'] +}> // Component declared with { props: [] } export function mount< @@ -343,27 +353,27 @@ export function mount< options?: MountingOptions & PublicProps, D> ): Cypress.Chainable<{ wrapper: VueWrapper< - ComponentPublicInstance< - ExtractPropTypes, - RawBindings, - D, - C, - M, - E, - VNodeProps & ExtractPropTypes - > + ComponentPublicInstance< + ExtractPropTypes, + RawBindings, + D, + C, + M, + E, + VNodeProps & ExtractPropTypes > +> component: VueWrapper< - ComponentPublicInstance< - ExtractPropTypes, - RawBindings, - D, - C, - M, - E, - VNodeProps & ExtractPropTypes - > - >['vm'] + ComponentPublicInstance< + ExtractPropTypes, + RawBindings, + D, + C, + M, + E, + VNodeProps & ExtractPropTypes + > +>['vm'] }> /**