diff --git a/src/source/index.ts b/src/source/index.ts index f2d82fd..5012030 100644 --- a/src/source/index.ts +++ b/src/source/index.ts @@ -9,6 +9,7 @@ export * from "./any_source_component" export * from "./source_port" export * from "./source_trace" export * from "./base/source_component_base" +export * from "./pin_attributes" export * from "./source_group" export * from "./source_net" export * from "./source_simple_battery" diff --git a/src/source/pin_attributes.ts b/src/source/pin_attributes.ts new file mode 100644 index 0000000..6132dad --- /dev/null +++ b/src/source/pin_attributes.ts @@ -0,0 +1,15 @@ +import { z } from "zod" +import { expectTypesMatch } from "src/utils/expect-types-match" + +export const pin_attributes = z.object({ + rats_nest_color: z.string().optional(), +}) + +export type PinAttributesInput = z.input +type InferredPinAttributes = z.infer + +export interface PinAttributes { + rats_nest_color?: string +} + +expectTypesMatch(true) diff --git a/src/source/source_net.ts b/src/source/source_net.ts index 2c88757..814f003 100644 --- a/src/source/source_net.ts +++ b/src/source/source_net.ts @@ -14,6 +14,7 @@ export const source_net = z.object({ trace_width: z.number().optional(), subcircuit_id: z.string().optional(), subcircuit_connectivity_map_key: z.string().optional(), + rats_nest_color: z.string().optional(), }) export type SourceNetInput = z.input @@ -32,6 +33,7 @@ export interface SourceNet { trace_width?: number subcircuit_id?: string subcircuit_connectivity_map_key?: string + rats_nest_color?: string } expectTypesMatch(true) diff --git a/src/source/source_port.ts b/src/source/source_port.ts index 7f7b51e..662708a 100644 --- a/src/source/source_port.ts +++ b/src/source/source_port.ts @@ -1,5 +1,6 @@ import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { pin_attributes, type PinAttributes } from "./pin_attributes" export const source_port = z.object({ type: z.literal("source_port"), @@ -10,6 +11,7 @@ export const source_port = z.object({ source_component_id: z.string(), subcircuit_id: z.string().optional(), subcircuit_connectivity_map_key: z.string().optional(), + pin_attributes: pin_attributes.optional(), }) export type SourcePortInput = z.input @@ -27,6 +29,7 @@ export interface SourcePort { source_component_id: string subcircuit_id?: string subcircuit_connectivity_map_key?: string + pin_attributes?: PinAttributes } expectTypesMatch(true)