From 56c775e9a4446a4c7c7b58e90971e71e44a5e72d Mon Sep 17 00:00:00 2001 From: BluJ Date: Mon, 27 Mar 2023 13:16:54 -0600 Subject: [PATCH] chore: fix the values. --- lib/config/builder/value.ts | 42 +++++++++++++++---------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/lib/config/builder/value.ts b/lib/config/builder/value.ts index 6c5c7ca..876aad4 100644 --- a/lib/config/builder/value.ts +++ b/lib/config/builder/value.ts @@ -14,9 +14,9 @@ import { export type DefaultString = | string | { - charset: string | null | undefined; - len: number; - }; + charset: string | null | undefined; + len: number; + }; export type Description = { name: string; description: string | null; @@ -78,9 +78,9 @@ export class Value extends IBuilder { } static string< A extends Description & - NullableDefault & - Nullable & - StringSpec + NullableDefault & + Nullable & + StringSpec >(a: A) { return new Value({ type: "string" as const, @@ -97,10 +97,9 @@ export class Value extends IBuilder { } static select< A extends Description & - Default & { - values: readonly string[] | string[]; - valueNames: Record; - } + Default & { + values: Record; + } >(a: A) { return new Value({ type: "select" as const, @@ -129,21 +128,14 @@ export class Value extends IBuilder { } static union< A extends Description & - Default & { - tag: { - id: B; - name: string; - description: string | null; - warning: string | null; - variantNames: { - [key: string]: string; - }; - }; - variants: Variants<{ [key: string]: InputSpec }>; - displayAs: string | null; - uniqueBy: UniqueBy; - }, - B extends string + Default & { + name: string; + description: string | null; + warning: string | null; + variants: Variants<{ [key: string]: { name: string, spec: InputSpec } }>; + displayAs: string | null; + uniqueBy: UniqueBy; + } >(a: A) { const { variants: previousVariants, ...rest } = a; const variants = previousVariants.build() as BuilderExtract;