chore: fix the values.

This commit is contained in:
BluJ
2023-03-27 13:16:54 -06:00
parent 281b752967
commit 56c775e9a4

View File

@@ -98,8 +98,7 @@ export class Value<A extends ValueSpec> extends IBuilder<A> {
static select< static select<
A extends Description & A extends Description &
Default<string> & { Default<string> & {
values: readonly string[] | string[]; values: Record<string, string>;
valueNames: Record<string, string>;
} }
>(a: A) { >(a: A) {
return new Value({ return new Value({
@@ -130,20 +129,13 @@ export class Value<A extends ValueSpec> extends IBuilder<A> {
static union< static union<
A extends Description & A extends Description &
Default<string> & { Default<string> & {
tag: {
id: B;
name: string; name: string;
description: string | null; description: string | null;
warning: string | null; warning: string | null;
variantNames: { variants: Variants<{ [key: string]: { name: string, spec: InputSpec } }>;
[key: string]: string;
};
};
variants: Variants<{ [key: string]: InputSpec }>;
displayAs: string | null; displayAs: string | null;
uniqueBy: UniqueBy; uniqueBy: UniqueBy;
}, }
B extends string
>(a: A) { >(a: A) {
const { variants: previousVariants, ...rest } = a; const { variants: previousVariants, ...rest } = a;
const variants = previousVariants.build() as BuilderExtract<A["variants"]>; const variants = previousVariants.build() as BuilderExtract<A["variants"]>;