From 872b8ddbddbef6f33eaf1331559cc9d1c9400930 Mon Sep 17 00:00:00 2001 From: Sander Date: Mon, 6 Mar 2023 17:58:56 +0100 Subject: [PATCH] chore(ct): vue prop type of JsonObject (#21400) --- packages/playwright-ct-vue/index.d.ts | 18 +++++------------- packages/playwright-ct-vue2/index.d.ts | 18 +++++------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/packages/playwright-ct-vue/index.d.ts b/packages/playwright-ct-vue/index.d.ts index 0309b5e340..f9a937719f 100644 --- a/packages/playwright-ct-vue/index.d.ts +++ b/packages/playwright-ct-vue/index.d.ts @@ -41,19 +41,14 @@ type JsonObject = { [Key in string]?: JsonValue }; type Slot = string | string[]; -export interface MountOptions< -HooksConfig extends JsonObject, -Props extends Record -> { +export interface MountOptions { props?: Props; slots?: Record & { default?: Slot }; on?: Record; hooksConfig?: HooksConfig; } -interface MountResult< - Props extends Record -> extends Locator { +interface MountResult extends Locator { unmount(): Promise; update(options: Omit, 'hooksConfig'>): Promise; } @@ -67,12 +62,9 @@ export interface ComponentFixtures { mount(component: JSX.Element): Promise; mount( component: any, - options?: MountOptions> - ): Promise>>; - mount< - HooksConfig extends JsonObject, - Props extends Record = Record - >( + options?: MountOptions + ): Promise>; + mount( component: any, options: MountOptions & { props: Props } ): Promise>; diff --git a/packages/playwright-ct-vue2/index.d.ts b/packages/playwright-ct-vue2/index.d.ts index 9b4149dcfa..f9a937719f 100644 --- a/packages/playwright-ct-vue2/index.d.ts +++ b/packages/playwright-ct-vue2/index.d.ts @@ -41,19 +41,14 @@ type JsonObject = { [Key in string]?: JsonValue }; type Slot = string | string[]; -export interface MountOptions< - HooksConfig extends JsonObject, - Props extends Record -> { +export interface MountOptions { props?: Props; slots?: Record & { default?: Slot }; on?: Record; hooksConfig?: HooksConfig; } -interface MountResult< - Props extends Record -> extends Locator { +interface MountResult extends Locator { unmount(): Promise; update(options: Omit, 'hooksConfig'>): Promise; } @@ -67,12 +62,9 @@ export interface ComponentFixtures { mount(component: JSX.Element): Promise; mount( component: any, - options?: MountOptions> - ): Promise>>; - mount< - HooksConfig extends JsonObject, - Props extends Record = Record - >( + options?: MountOptions + ): Promise>; + mount( component: any, options: MountOptions & { props: Props } ): Promise>;