diff --git a/packages/playwright-ct-react/hooks.d.ts b/packages/playwright-ct-react/hooks.d.ts index bd84d3bcfe..31cbda4c23 100644 --- a/packages/playwright-ct-react/hooks.d.ts +++ b/packages/playwright-ct-react/hooks.d.ts @@ -19,8 +19,8 @@ type JsonValue = JsonPrimitive | JsonObject | JsonArray; type JsonArray = JsonValue[]; type JsonObject = { [Key in string]?: JsonValue }; export declare function beforeMount( - callback: (params: { hooksConfig: HooksConfig; App: () => JSX.Element }) => Promise + callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise ): void; export declare function afterMount( - callback: (params: { hooksConfig: HooksConfig }) => Promise + callback: (params: { hooksConfig?: HooksConfig }) => Promise ): void; diff --git a/packages/playwright-ct-react17/hooks.d.ts b/packages/playwright-ct-react17/hooks.d.ts index bd84d3bcfe..31cbda4c23 100644 --- a/packages/playwright-ct-react17/hooks.d.ts +++ b/packages/playwright-ct-react17/hooks.d.ts @@ -19,8 +19,8 @@ type JsonValue = JsonPrimitive | JsonObject | JsonArray; type JsonArray = JsonValue[]; type JsonObject = { [Key in string]?: JsonValue }; export declare function beforeMount( - callback: (params: { hooksConfig: HooksConfig; App: () => JSX.Element }) => Promise + callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise ): void; export declare function afterMount( - callback: (params: { hooksConfig: HooksConfig }) => Promise + callback: (params: { hooksConfig?: HooksConfig }) => Promise ): void; diff --git a/packages/playwright-ct-solid/hooks.d.ts b/packages/playwright-ct-solid/hooks.d.ts index e4aea76041..048978cd53 100644 --- a/packages/playwright-ct-solid/hooks.d.ts +++ b/packages/playwright-ct-solid/hooks.d.ts @@ -21,8 +21,8 @@ type JsonValue = JsonPrimitive | JsonObject | JsonArray; type JsonArray = JsonValue[]; type JsonObject = { [Key in string]?: JsonValue }; export declare function beforeMount( - callback: (params: { hooksConfig: HooksConfig, App: () => JSXElement }) => Promise + callback: (params: { hooksConfig?: HooksConfig, App: () => JSXElement }) => Promise ): void; export declare function afterMount( - callback: (params: { hooksConfig: HooksConfig }) => Promise + callback: (params: { hooksConfig?: HooksConfig }) => Promise ): void; diff --git a/packages/playwright-ct-svelte/hooks.d.ts b/packages/playwright-ct-svelte/hooks.d.ts index 8c0fa0933f..1c2107325b 100644 --- a/packages/playwright-ct-svelte/hooks.d.ts +++ b/packages/playwright-ct-svelte/hooks.d.ts @@ -21,11 +21,11 @@ type JsonValue = JsonPrimitive | JsonObject | JsonArray; type JsonArray = JsonValue[]; type JsonObject = { [Key in string]?: JsonValue }; export declare function beforeMount( - callback: (params: { hooksConfig: HooksConfig }) => Promise + callback: (params: { hooksConfig?: HooksConfig }) => Promise ): void; export declare function afterMount( callback: (params: { - hooksConfig: HooksConfig; + hooksConfig?: HooksConfig; svelteComponent: SvelteComponent; }) => Promise ): void; diff --git a/packages/playwright-ct-vue/hooks.d.ts b/packages/playwright-ct-vue/hooks.d.ts index 6e2c3e1715..3503b0fa37 100644 --- a/packages/playwright-ct-vue/hooks.d.ts +++ b/packages/playwright-ct-vue/hooks.d.ts @@ -21,12 +21,12 @@ type JsonValue = JsonPrimitive | JsonObject | JsonArray; type JsonArray = JsonValue[]; type JsonObject = { [Key in string]?: JsonValue }; export declare function beforeMount( - callback: (params: { app: App; hooksConfig: HooksConfig }) => Promise + callback: (params: { app: App; hooksConfig?: HooksConfig }) => Promise ): void; export declare function afterMount( callback: (params: { app: App; - hooksConfig: HooksConfig; + hooksConfig?: HooksConfig; instance: ComponentPublicInstance; }) => Promise ): void; diff --git a/packages/playwright-ct-vue2/hooks.d.ts b/packages/playwright-ct-vue2/hooks.d.ts index a8482a6c8c..7c422f0595 100644 --- a/packages/playwright-ct-vue2/hooks.d.ts +++ b/packages/playwright-ct-vue2/hooks.d.ts @@ -24,13 +24,13 @@ type JsonObject = { [Key in string]?: JsonValue }; export declare function beforeMount( callback: (params: { - hooksConfig: HooksConfig, + hooksConfig?: HooksConfig, Vue: VueConstructor, }) => Promise & Record> ): void; export declare function afterMount( callback: (params: { - hooksConfig: HooksConfig; + hooksConfig?: HooksConfig; instance: CombinedVueInstance< Vue, object, diff --git a/packages/playwright-test/types/component.d.ts b/packages/playwright-test/types/component.d.ts index 41ce974c94..88c33fb669 100644 --- a/packages/playwright-test/types/component.d.ts +++ b/packages/playwright-test/types/component.d.ts @@ -38,10 +38,10 @@ export type Component = JsxComponent | ObjectComponent | number | string | Array declare global { interface Window { - playwrightMount(component: Component, rootElement: Element, hooksConfig: any): Promise; + playwrightMount(component: Component, rootElement: Element, hooksConfig?: any): Promise; playwrightUnmount(rootElement: Element): Promise; playwrightUpdate(rootElement: Element, component: Component): Promise; - __pw_hooks_before_mount?: ((params: { hooksConfig: HooksConfig; } & any) => Promise)[]; - __pw_hooks_after_mount?: ((params: { hooksConfig: HooksConfig; } & any) => Promise)[]; + __pw_hooks_before_mount?: ((params: { hooksConfig?: HooksConfig; } & any) => Promise)[]; + __pw_hooks_after_mount?: ((params: { hooksConfig?: HooksConfig; } & any) => Promise)[]; } }