Something went wrong. Try again.
Starship Simulator Controls thoriumsim.com
Something went wrong. Try again.
1.1 kB · 40 lines
TypeScript
at develop
1234567891011121314151617181920212223242526272829303132333435363738394041import { engineeringPanelElementConfig } from "@thorium/ecs-components/engineeringPanelElementConfig";import z from "zod";
export const baseCard = z.object({ name: z.string(), icon: z.string().nullish().optional(), component: z.string(), highlight: z.boolean().default(false).optional(), config: z.any().optional(),});export const engineeringPanelsCard = baseCard.extend({ component: z.literal("EngineeringPanels"), config: z .discriminatedUnion("type", [ z.object({ // Used during the flight to reference the panel entity panelId: z.number().optional(), type: z.literal("manual"), elementCount: z.number(), elementNameTemplate: z.string(), randomSeed: z.string().optional().default("thorium"), tags: z.string().array().optional(), }), z.object({ // Used during the flight to reference the panel entity panelId: z.number().optional(), type: z.literal("automatic"), elements: z .intersection( engineeringPanelElementConfig, z.object({ name: z.string(), }), ) .array(), tags: z.string().array().optional(), }), ]) .optional(),});