mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 12:21:57 +00:00
ugh
This commit is contained in:
@@ -145,6 +145,7 @@ export class Value<A extends ValueSpec> extends IBuilder<A> {
|
|||||||
name: string;
|
name: string;
|
||||||
description: string | null;
|
description: string | null;
|
||||||
warning: string | null;
|
warning: string | null;
|
||||||
|
selectKey: string;
|
||||||
variants: Variants<{ [key: string]: { name: string; spec: InputSpec } }>;
|
variants: Variants<{ [key: string]: { name: string; spec: InputSpec } }>;
|
||||||
nullable: boolean;
|
nullable: boolean;
|
||||||
default: string | null;
|
default: string | null;
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ export interface ValueSpecBoolean extends WithStandalone {
|
|||||||
|
|
||||||
export interface ValueSpecUnion extends WithStandalone {
|
export interface ValueSpecUnion extends WithStandalone {
|
||||||
type: "union";
|
type: "union";
|
||||||
|
selectKey: string;
|
||||||
nullable: boolean;
|
nullable: boolean;
|
||||||
variants: Record<string, { name: string; spec: InputSpec }>;
|
variants: Record<string, { name: string; spec: InputSpec }>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,13 +136,14 @@ export default async function makeFileContent(
|
|||||||
case "union": {
|
case "union": {
|
||||||
const variants = newConst(
|
const variants = newConst(
|
||||||
value.name + "_variants",
|
value.name + "_variants",
|
||||||
convertVariants(value.variants, value["variant-names"] || {})
|
convertVariants(value.variants, value.tag["variant-names"] || {})
|
||||||
);
|
);
|
||||||
|
|
||||||
return `Value.union({
|
return `Value.union({
|
||||||
name: ${JSON.stringify(value.name || null)},
|
name: ${JSON.stringify(value.name || null)},
|
||||||
description: ${JSON.stringify(value.description || null)},
|
description: ${JSON.stringify(value.tag.description || null)},
|
||||||
warning: ${JSON.stringify(value.warning || null)},
|
warning: ${JSON.stringify(value.tag.warning || null)},
|
||||||
|
selectKey: ${JSON.stringify(value.tag.id || null)},
|
||||||
nullable: false,
|
nullable: false,
|
||||||
default: ${JSON.stringify(value.default || null)},
|
default: ${JSON.stringify(value.default || null)},
|
||||||
variants: ${variants},
|
variants: ${variants},
|
||||||
|
|||||||
Reference in New Issue
Block a user