From 2de7a20a2dd810c3f82face2a4dceda23f49f866 Mon Sep 17 00:00:00 2001 From: Younes Jaaidi Date: Thu, 11 Apr 2024 14:57:47 +0200 Subject: [PATCH] feat(ct-angular): export the right types --- packages/playwright-ct-angular/index.d.ts | 30 +++++++---------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/packages/playwright-ct-angular/index.d.ts b/packages/playwright-ct-angular/index.d.ts index 20435b96a6..c67b1a867e 100644 --- a/packages/playwright-ct-angular/index.d.ts +++ b/packages/playwright-ct-angular/index.d.ts @@ -14,20 +14,12 @@ * limitations under the License. */ -import type { - Locator, - PlaywrightTestArgs, - PlaywrightTestOptions, - PlaywrightWorkerArgs, - PlaywrightWorkerOptions, - TestType, -} from '@playwright/test'; +import type { Locator } from 'playwright/test'; import type { JsonObject } from '@playwright/experimental-ct-core/types/component'; +import type { TestType } from '@playwright/experimental-ct-core'; import type { Provider, Type } from '@angular/core'; -export type { PlaywrightTestConfig } from '@playwright/experimental-ct-core'; - -type ComponentEvents = Record; +export type ComponentEvents = Record; export interface MountOptions { props?: Partial | Record, // TODO: filter props and handle signals @@ -40,8 +32,9 @@ export interface MountTemplateOptions imports?: Type[]; } -interface MountResult extends Locator { +export interface MountResult extends Locator { unmount(): Promise; + update(options: { props?: Partial, on?: Partial, @@ -53,19 +46,14 @@ export interface ComponentFixtures { template: string, options?: MountTemplateOptions ): Promise>; + mount( component: Type, options?: MountOptions ): Promise>; } -export const test: TestType< - PlaywrightTestArgs & PlaywrightTestOptions & ComponentFixtures, - PlaywrightWorkerArgs & PlaywrightWorkerOptions ->; +export const test: TestType; -export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; -export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; -export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig; - -export { expect, devices } from '@playwright/test'; +export { defineConfig, PlaywrightTestConfig } from '@playwright/experimental-ct-core'; +export { expect, devices } from 'playwright/test';