chore(ct): vue prop type of JsonObject (#21400)
This commit is contained in:
parent
86ca7e3949
commit
872b8ddbdd
18
packages/playwright-ct-vue/index.d.ts
vendored
18
packages/playwright-ct-vue/index.d.ts
vendored
|
|
@ -41,19 +41,14 @@ type JsonObject = { [Key in string]?: JsonValue };
|
||||||
|
|
||||||
type Slot = string | string[];
|
type Slot = string | string[];
|
||||||
|
|
||||||
export interface MountOptions<
|
export interface MountOptions<HooksConfig extends JsonObject, Props extends JsonObject> {
|
||||||
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<
|
interface MountResult<Props extends JsonObject> extends Locator {
|
||||||
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>;
|
||||||
}
|
}
|
||||||
|
|
@ -67,12 +62,9 @@ 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, Record<string, unknown>>
|
options?: MountOptions<HooksConfig, JsonObject>
|
||||||
): Promise<MountResult<Record<string, unknown>>>;
|
): Promise<MountResult<JsonObject>>;
|
||||||
mount<
|
mount<HooksConfig extends JsonObject, Props extends JsonObject = JsonObject>(
|
||||||
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>>;
|
||||||
|
|
|
||||||
18
packages/playwright-ct-vue2/index.d.ts
vendored
18
packages/playwright-ct-vue2/index.d.ts
vendored
|
|
@ -41,19 +41,14 @@ type JsonObject = { [Key in string]?: JsonValue };
|
||||||
|
|
||||||
type Slot = string | string[];
|
type Slot = string | string[];
|
||||||
|
|
||||||
export interface MountOptions<
|
export interface MountOptions<HooksConfig extends JsonObject, Props extends JsonObject> {
|
||||||
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<
|
interface MountResult<Props extends JsonObject> extends Locator {
|
||||||
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>;
|
||||||
}
|
}
|
||||||
|
|
@ -67,12 +62,9 @@ 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, Record<string, unknown>>
|
options?: MountOptions<HooksConfig, JsonObject>
|
||||||
): Promise<MountResult<Record<string, unknown>>>;
|
): Promise<MountResult<JsonObject>>;
|
||||||
mount<
|
mount<HooksConfig extends JsonObject, Props extends JsonObject = JsonObject>(
|
||||||
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…
Reference in a new issue