chore(ct): dedupe json object (#22138)

This commit is contained in:
Sander 2023-04-05 22:10:00 +02:00 committed by GitHub
parent 159e71982e
commit 789d8b24c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 19 additions and 55 deletions

View File

@ -14,10 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
type JsonPrimitive = string | number | boolean | null; import type { JsonObject } from '@playwright/test/types/component';
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
export declare function beforeMount<HooksConfig extends JsonObject>( export declare function beforeMount<HooksConfig extends JsonObject>(
callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise<void | JSX.Element> callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise<void | JSX.Element>
): void; ): void;

View File

@ -23,6 +23,7 @@ import type {
PlaywrightWorkerOptions, PlaywrightWorkerOptions,
Locator, Locator,
} from '@playwright/test'; } from '@playwright/test';
import type { JsonObject } from '@playwright/test/types/component';
import type { InlineConfig } from 'vite'; import type { InlineConfig } from 'vite';
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & { export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
@ -34,11 +35,6 @@ export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig
}; };
}; };
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
export interface MountOptions<HooksConfig extends JsonObject> { export interface MountOptions<HooksConfig extends JsonObject> {
hooksConfig?: HooksConfig; hooksConfig?: HooksConfig;
} }

View File

@ -14,10 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
type JsonPrimitive = string | number | boolean | null; import type { JsonObject } from '@playwright/test/types/component';
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
export declare function beforeMount<HooksConfig extends JsonObject>( export declare function beforeMount<HooksConfig extends JsonObject>(
callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise<void | JSX.Element> callback: (params: { hooksConfig?: HooksConfig; App: () => JSX.Element }) => Promise<void | JSX.Element>
): void; ): void;

View File

@ -23,6 +23,7 @@ import type {
PlaywrightWorkerOptions, PlaywrightWorkerOptions,
Locator, Locator,
} from '@playwright/test'; } from '@playwright/test';
import type { JsonObject } from '@playwright/test/types/component';
import type { InlineConfig } from 'vite'; import type { InlineConfig } from 'vite';
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & { export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
@ -34,11 +35,6 @@ export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig
}; };
}; };
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
export interface MountOptions<HooksConfig extends JsonObject> { export interface MountOptions<HooksConfig extends JsonObject> {
hooksConfig?: HooksConfig; hooksConfig?: HooksConfig;
} }

View File

@ -15,11 +15,8 @@
*/ */
import { JSXElement } from "solid-js"; import { JSXElement } from "solid-js";
import type { JsonObject } from '@playwright/test/types/component';
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
export declare function beforeMount<HooksConfig extends JsonObject>( export declare function beforeMount<HooksConfig extends JsonObject>(
callback: (params: { hooksConfig?: HooksConfig, App: () => JSXElement }) => Promise<void | JSXElement> callback: (params: { hooksConfig?: HooksConfig, App: () => JSXElement }) => Promise<void | JSXElement>
): void; ): void;

View File

@ -23,6 +23,7 @@ import type {
PlaywrightWorkerOptions, PlaywrightWorkerOptions,
Locator, Locator,
} from '@playwright/test'; } from '@playwright/test';
import type { JsonObject } from '@playwright/test/types/component';
import type { InlineConfig } from 'vite'; import type { InlineConfig } from 'vite';
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & { export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
@ -34,11 +35,6 @@ export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig
}; };
}; };
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
export interface MountOptions<HooksConfig extends JsonObject> { export interface MountOptions<HooksConfig extends JsonObject> {
hooksConfig?: HooksConfig; hooksConfig?: HooksConfig;
} }

View File

@ -15,11 +15,8 @@
*/ */
import type { SvelteComponent } from 'svelte'; import type { SvelteComponent } from 'svelte';
import type { JsonObject } from '@playwright/test/types/component';
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
export declare function beforeMount<HooksConfig extends JsonObject>( export declare function beforeMount<HooksConfig extends JsonObject>(
callback: (params: { hooksConfig?: HooksConfig }) => Promise<void> callback: (params: { hooksConfig?: HooksConfig }) => Promise<void>
): void; ): void;

View File

@ -23,6 +23,7 @@ import type {
PlaywrightWorkerOptions, PlaywrightWorkerOptions,
Locator, Locator,
} from '@playwright/test'; } from '@playwright/test';
import type { JsonObject } from '@playwright/test/types/component';
import type { InlineConfig } from 'vite'; import type { InlineConfig } from 'vite';
import type { SvelteComponent, ComponentProps } from 'svelte/types/runtime'; import type { SvelteComponent, ComponentProps } from 'svelte/types/runtime';
@ -35,11 +36,6 @@ export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig
}; };
}; };
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
type Slot = string | string[]; type Slot = string | string[];
export interface MountOptions< export interface MountOptions<

View File

@ -15,11 +15,8 @@
*/ */
import type { App, ComponentPublicInstance } from 'vue'; import type { App, ComponentPublicInstance } from 'vue';
import type { JsonObject } from '@playwright/test/types/component';
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
export declare function beforeMount<HooksConfig extends JsonObject>( export declare function beforeMount<HooksConfig extends JsonObject>(
callback: (params: { app: App; hooksConfig?: HooksConfig }) => Promise<void> callback: (params: { app: App; hooksConfig?: HooksConfig }) => Promise<void>
): void; ): void;

View File

@ -23,6 +23,7 @@ import type {
PlaywrightWorkerOptions, PlaywrightWorkerOptions,
Locator, Locator,
} from '@playwright/test'; } from '@playwright/test';
import type { JsonObject } from '@playwright/test/types/component';
import type { InlineConfig } from 'vite'; import type { InlineConfig } from 'vite';
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & { export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
@ -34,11 +35,6 @@ export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig
}; };
}; };
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
type Slot = string | string[]; type Slot = string | string[];
export interface MountOptions< export interface MountOptions<

View File

@ -16,11 +16,7 @@
import { ComponentOptions } from 'vue'; import { ComponentOptions } from 'vue';
import { CombinedVueInstance, Vue, VueConstructor } from 'vue/types/vue'; import { CombinedVueInstance, Vue, VueConstructor } from 'vue/types/vue';
import type { JsonObject } from '@playwright/test/types/component';
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
export declare function beforeMount<HooksConfig extends JsonObject>( export declare function beforeMount<HooksConfig extends JsonObject>(
callback: (params: { callback: (params: {

View File

@ -23,6 +23,7 @@ import type {
PlaywrightWorkerOptions, PlaywrightWorkerOptions,
Locator, Locator,
} from '@playwright/test'; } from '@playwright/test';
import type { JsonObject } from '@playwright/test/types/component';
import type { InlineConfig } from 'vite'; import type { InlineConfig } from 'vite';
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & { export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
@ -34,11 +35,6 @@ export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig
}; };
}; };
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
type JsonObject = { [Key in string]?: JsonValue };
type Slot = string | string[]; type Slot = string | string[];
export interface MountOptions< export interface MountOptions<

View File

@ -14,6 +14,11 @@
* limitations under the License. * limitations under the License.
*/ */
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
type JsonArray = JsonValue[];
export type JsonObject = { [Key in string]?: JsonValue };
export type JsxComponent = { export type JsxComponent = {
kind: 'jsx', kind: 'jsx',
type: string, type: string,