feat(ct): type-safe hook config (#17232)

This commit is contained in:
sand4rt 2022-09-22 06:14:20 +02:00 committed by GitHub
parent cb10ef3c71
commit d85d615846
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 3 deletions

View file

@ -34,8 +34,13 @@ export type PlaywrightTestConfig = Omit<BasePlaywrightTestConfig, 'use'> & {
}
};
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
export interface MountOptions {
hooksConfig?: any;
hooksConfig?: JsonObject;
}
interface MountResult extends Locator {

View file

@ -34,8 +34,13 @@ export type PlaywrightTestConfig = Omit<BasePlaywrightTestConfig, 'use'> & {
}
};
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
export interface MountOptions {
hooksConfig?: any;
hooksConfig?: JsonObject;
}
interface MountResult extends Locator {

View file

@ -34,13 +34,18 @@ export type PlaywrightTestConfig = Omit<BasePlaywrightTestConfig, 'use'> & {
}
};
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
type Slot = string | string[];
export interface MountOptions<Props = Record<string, unknown>> {
props?: Props,
slots?: Record<string, Slot> & { default?: Slot };
on?: Record<string, Function>,
hooksConfig?: any,
hooksConfig?: JsonObject,
}
interface MountResult<Props = Record<string, unknown>> extends Locator {