diff --git a/README.md b/README.md index 6091c11..bbce67c 100644 --- a/README.md +++ b/README.md @@ -1545,6 +1545,7 @@ export interface ViaProps extends CommonLayoutProps { export interface VoltageProbeProps extends Omit { name?: string; connectsTo: string | string[]; + color?: string; } ``` diff --git a/generated/COMPONENT_TYPES.md b/generated/COMPONENT_TYPES.md index 3b4722c..79f6018 100644 --- a/generated/COMPONENT_TYPES.md +++ b/generated/COMPONENT_TYPES.md @@ -3052,12 +3052,14 @@ export const viaProps = commonLayoutProps.extend({ export interface VoltageProbeProps extends Omit { name?: string connectsTo: string | string[] + color?: string } export const voltageProbeProps = commonComponentProps .omit({ name: true }) .extend({ name: z.string().optional(), connectsTo: z.string().or(z.array(z.string())), + color: z.string().optional(), }) ``` diff --git a/generated/PROPS_OVERVIEW.md b/generated/PROPS_OVERVIEW.md index 12e38f6..455d322 100644 --- a/generated/PROPS_OVERVIEW.md +++ b/generated/PROPS_OVERVIEW.md @@ -1607,6 +1607,7 @@ export interface ViaProps extends CommonLayoutProps { export interface VoltageProbeProps extends Omit { name?: string connectsTo: string | string[] + color?: string } diff --git a/lib/components/voltageprobe.ts b/lib/components/voltageprobe.ts index 2b7de90..6f8a169 100644 --- a/lib/components/voltageprobe.ts +++ b/lib/components/voltageprobe.ts @@ -8,6 +8,7 @@ import { z } from "zod" export interface VoltageProbeProps extends Omit { name?: string connectsTo: string | string[] + color?: string } export const voltageProbeProps = commonComponentProps @@ -15,6 +16,7 @@ export const voltageProbeProps = commonComponentProps .extend({ name: z.string().optional(), connectsTo: z.string().or(z.array(z.string())), + color: z.string().optional(), }) expectTypesMatch>(true) diff --git a/tests/voltageprobe.test.ts b/tests/voltageprobe.test.ts index 400739d..a3be535 100644 --- a/tests/voltageprobe.test.ts +++ b/tests/voltageprobe.test.ts @@ -22,3 +22,13 @@ test("should parse voltageprobe without name", () => { expect(parsed.name).toBeUndefined() expect(parsed.connectsTo).toBe("net.VOUT") }) + +test("should parse voltageprobe with color", () => { + const raw: VoltageProbeProps = { + connectsTo: "C1.pin1", + color: "red", + } + const parsed = voltageProbeProps.parse(raw) + expect(parsed.color).toBe("red") + expect(parsed.connectsTo).toBe("C1.pin1") +})