mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(ct): vue revert json object as prop (#22005)
This commit is contained in:
parent
f502c72f2b
commit
bfea952eef
16
packages/playwright-ct-vue/index.d.ts
vendored
16
packages/playwright-ct-vue/index.d.ts
vendored
@ -41,14 +41,17 @@ type JsonObject = { [Key in string]?: JsonValue };
|
|||||||
|
|
||||||
type Slot = string | string[];
|
type Slot = string | string[];
|
||||||
|
|
||||||
export interface MountOptions<HooksConfig extends JsonObject, Props extends JsonObject> {
|
export interface MountOptions<
|
||||||
|
HooksConfig extends JsonObject,
|
||||||
|
Props extends Record<string, unknown>
|
||||||
|
> {
|
||||||
props?: Props;
|
props?: Props;
|
||||||
slots?: Record<string, Slot> & { default?: Slot };
|
slots?: Record<string, Slot> & { default?: Slot };
|
||||||
on?: Record<string, Function>;
|
on?: Record<string, Function>;
|
||||||
hooksConfig?: HooksConfig;
|
hooksConfig?: HooksConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MountResult<Props extends JsonObject> extends Locator {
|
interface MountResult<Props extends Record<string, unknown>> extends Locator {
|
||||||
unmount(): Promise<void>;
|
unmount(): Promise<void>;
|
||||||
update(options: Omit<MountOptions<never, Props>, 'hooksConfig'>): Promise<void>;
|
update(options: Omit<MountOptions<never, Props>, 'hooksConfig'>): Promise<void>;
|
||||||
}
|
}
|
||||||
@ -62,9 +65,12 @@ export interface ComponentFixtures {
|
|||||||
mount(component: JSX.Element): Promise<MountResultJsx>;
|
mount(component: JSX.Element): Promise<MountResultJsx>;
|
||||||
mount<HooksConfig extends JsonObject>(
|
mount<HooksConfig extends JsonObject>(
|
||||||
component: any,
|
component: any,
|
||||||
options?: MountOptions<HooksConfig, JsonObject>
|
options?: MountOptions<HooksConfig, Record<string, unknown>>
|
||||||
): Promise<MountResult<JsonObject>>;
|
): Promise<MountResult<Record<string, unknown>>>;
|
||||||
mount<HooksConfig extends JsonObject, Props extends JsonObject = JsonObject>(
|
mount<
|
||||||
|
HooksConfig extends JsonObject,
|
||||||
|
Props extends Record<string, unknown> = Record<string, unknown>
|
||||||
|
>(
|
||||||
component: any,
|
component: any,
|
||||||
options: MountOptions<HooksConfig, never> & { props: Props }
|
options: MountOptions<HooksConfig, never> & { props: Props }
|
||||||
): Promise<MountResult<Props>>;
|
): Promise<MountResult<Props>>;
|
||||||
|
16
packages/playwright-ct-vue2/index.d.ts
vendored
16
packages/playwright-ct-vue2/index.d.ts
vendored
@ -41,14 +41,17 @@ type JsonObject = { [Key in string]?: JsonValue };
|
|||||||
|
|
||||||
type Slot = string | string[];
|
type Slot = string | string[];
|
||||||
|
|
||||||
export interface MountOptions<HooksConfig extends JsonObject, Props extends JsonObject> {
|
export interface MountOptions<
|
||||||
|
HooksConfig extends JsonObject,
|
||||||
|
Props extends Record<string, unknown>
|
||||||
|
> {
|
||||||
props?: Props;
|
props?: Props;
|
||||||
slots?: Record<string, Slot> & { default?: Slot };
|
slots?: Record<string, Slot> & { default?: Slot };
|
||||||
on?: Record<string, Function>;
|
on?: Record<string, Function>;
|
||||||
hooksConfig?: HooksConfig;
|
hooksConfig?: HooksConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MountResult<Props extends JsonObject> extends Locator {
|
interface MountResult<Props extends Record<string, unknown>> extends Locator {
|
||||||
unmount(): Promise<void>;
|
unmount(): Promise<void>;
|
||||||
update(options: Omit<MountOptions<never, Props>, 'hooksConfig'>): Promise<void>;
|
update(options: Omit<MountOptions<never, Props>, 'hooksConfig'>): Promise<void>;
|
||||||
}
|
}
|
||||||
@ -62,9 +65,12 @@ export interface ComponentFixtures {
|
|||||||
mount(component: JSX.Element): Promise<MountResultJsx>;
|
mount(component: JSX.Element): Promise<MountResultJsx>;
|
||||||
mount<HooksConfig extends JsonObject>(
|
mount<HooksConfig extends JsonObject>(
|
||||||
component: any,
|
component: any,
|
||||||
options?: MountOptions<HooksConfig, JsonObject>
|
options?: MountOptions<HooksConfig, Record<string, unknown>>
|
||||||
): Promise<MountResult<JsonObject>>;
|
): Promise<MountResult<Record<string, unknown>>>;
|
||||||
mount<HooksConfig extends JsonObject, Props extends JsonObject = JsonObject>(
|
mount<
|
||||||
|
HooksConfig extends JsonObject,
|
||||||
|
Props extends Record<string, unknown> = Record<string, unknown>
|
||||||
|
>(
|
||||||
component: any,
|
component: any,
|
||||||
options: MountOptions<HooksConfig, never> & { props: Props }
|
options: MountOptions<HooksConfig, never> & { props: Props }
|
||||||
): Promise<MountResult<Props>>;
|
): Promise<MountResult<Props>>;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user