Skip to content

Commit bba226c

Browse files
authored
chore: update types (#25538)
* chore: update types * rename prop
1 parent 8435cdc commit bba226c

File tree

1 file changed

+65
-55
lines changed

1 file changed

+65
-55
lines changed

npm/vue/src/index.ts

Lines changed: 65 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const cleanup = () => {
9292
* `MountOptions` are modifying, including some Cypress specific options like `styles`.
9393
* The return type is different. Instead of VueWrapper, it's Cypress.Chainable<VueWrapper<...>>.
9494
*/
95+
9596
type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps
9697

9798
type ComponentMountingOptions<T> = T extends DefineComponent<
@@ -206,46 +207,47 @@ export function mount<
206207
> &
207208
Record<string, any>
208209
): Cypress.Chainable<{
210+
209211
wrapper: VueWrapper<
210-
InstanceType<
211-
DefineComponent<
212-
PropsOrPropOptions,
213-
RawBindings,
214-
D,
215-
C,
216-
M,
217-
Mixin,
218-
Extends,
219-
E,
220-
EE,
221-
PP,
222-
Props,
223-
Defaults
224-
>
212+
InstanceType<
213+
DefineComponent<
214+
PropsOrPropOptions,
215+
RawBindings,
216+
D,
217+
C,
218+
M,
219+
Mixin,
220+
Extends,
221+
E,
222+
EE,
223+
PP,
224+
Props,
225+
Defaults
225226
>
226227
>
228+
>
227229
component: VueWrapper<
228-
InstanceType<
229-
DefineComponent<
230-
PropsOrPropOptions,
231-
RawBindings,
232-
D,
233-
C,
234-
M,
235-
Mixin,
236-
Extends,
237-
E,
238-
EE,
239-
PP,
240-
Props,
241-
Defaults
242-
>
230+
InstanceType<
231+
DefineComponent<
232+
PropsOrPropOptions,
233+
RawBindings,
234+
D,
235+
C,
236+
M,
237+
Mixin,
238+
Extends,
239+
E,
240+
EE,
241+
PP,
242+
Props,
243+
Defaults
243244
>
244-
>['vm']}
245-
>
245+
>
246+
>['vm']
247+
}>
246248

247249
// component declared by vue-tsc ScriptSetup
248-
export function mount<T extends DefineComponent<any, any, any, any>>(
250+
export function mount<T extends DefineComponent<any, any, any, any, any>>(
249251
component: T,
250252
options?: ComponentMountingOptions<T>
251253
): Cypress.Chainable<{
@@ -278,9 +280,17 @@ export function mount<
278280
>,
279281
options?: MountingOptions<Props & PublicProps, D>
280282
): Cypress.Chainable<{
281-
wrapper: VueWrapper<ComponentPublicInstance<Props, RawBindings, D, C, M, E, VNodeProps & Props>>
282-
component: VueWrapper<ComponentPublicInstance<Props, RawBindings, D, C, M, E, VNodeProps & Props>>['vm']
283-
}> & Record<string, any>
283+
wrapper: VueWrapper<
284+
285+
ComponentPublicInstance<Props, RawBindings, D, C, M, E, VNodeProps & Props>
286+
> &
287+
Record<string, any>
288+
component: VueWrapper<
289+
290+
ComponentPublicInstance<Props, RawBindings, D, C, M, E, VNodeProps & Props>
291+
> &
292+
Record<string, any>['vm']
293+
}>
284294

285295
// Component declared with { props: [] }
286296
export function mount<
@@ -343,27 +353,27 @@ export function mount<
343353
options?: MountingOptions<ExtractPropTypes<PropsOptions> & PublicProps, D>
344354
): Cypress.Chainable<{
345355
wrapper: VueWrapper<
346-
ComponentPublicInstance<
347-
ExtractPropTypes<PropsOptions>,
348-
RawBindings,
349-
D,
350-
C,
351-
M,
352-
E,
353-
VNodeProps & ExtractPropTypes<PropsOptions>
354-
>
356+
ComponentPublicInstance<
357+
ExtractPropTypes<PropsOptions>,
358+
RawBindings,
359+
D,
360+
C,
361+
M,
362+
E,
363+
VNodeProps & ExtractPropTypes<PropsOptions>
355364
>
365+
>
356366
component: VueWrapper<
357-
ComponentPublicInstance<
358-
ExtractPropTypes<PropsOptions>,
359-
RawBindings,
360-
D,
361-
C,
362-
M,
363-
E,
364-
VNodeProps & ExtractPropTypes<PropsOptions>
365-
>
366-
>['vm']
367+
ComponentPublicInstance<
368+
ExtractPropTypes<PropsOptions>,
369+
RawBindings,
370+
D,
371+
C,
372+
M,
373+
E,
374+
VNodeProps & ExtractPropTypes<PropsOptions>
375+
>
376+
>['vm']
367377
}>
368378

369379
/**

0 commit comments

Comments
 (0)