From 7554a907609d7a900cf3ba12f7a6b068461fbddc Mon Sep 17 00:00:00 2001 From: Peter Makowski Date: Thu, 26 Oct 2023 12:26:26 +0200 Subject: [PATCH] chore: add ts prettify (#5202) - adds a TypeScript Prettify tool that allows for more helpful type annotations --- src/app/base/types.ts | 4 ++++ src/app/store/machine/types/actions.ts | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/base/types.ts b/src/app/base/types.ts index f7d4b86935..5f0f3b369a 100644 --- a/src/app/base/types.ts +++ b/src/app/base/types.ts @@ -7,6 +7,10 @@ import type { Machine } from "app/store/machine/types"; export type TSFixMe = any; // eslint-disable-line @typescript-eslint/no-explicit-any +export type Prettify = { + [K in keyof T]: T[K]; +} & {}; + export type Seconds = number; export type Minutes = number; export type Days = number; diff --git a/src/app/store/machine/types/actions.ts b/src/app/store/machine/types/actions.ts index 5f40846241..3e5d527058 100644 --- a/src/app/store/machine/types/actions.ts +++ b/src/app/store/machine/types/actions.ts @@ -7,6 +7,7 @@ import type { } from "./base"; import type { MachineMeta } from "./enum"; +import type { Prettify } from "app/base/types"; import type { Domain } from "app/store/domain/types"; import type { Fabric } from "app/store/fabric/types"; import type { LicenseKeys } from "app/store/licensekeys/types"; @@ -52,13 +53,14 @@ export type ApplyStorageLayoutParams = { storageLayout: StorageLayout; }; -export type BaseMachineActionParams = +export type BaseMachineActionParams = Prettify< | BaseNodeActionParams | { system_id?: never; filter: FetchFilters; callId?: string; - }; + } +>; export type CloneParams = BaseMachineActionParams & { system_id: Node["system_id"];