circuit-json 0.0.95 → 0.0.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1375,6 +1375,25 @@ declare const schematic_line: z.ZodObject<{
1375
1375
  type SchematicLineInput = z.input<typeof schematic_line>;
1376
1376
  type SchematicLine = z.infer<typeof schematic_line>;
1377
1377
 
1378
+ interface SchematicTraceEdge {
1379
+ from: {
1380
+ x: number;
1381
+ y: number;
1382
+ };
1383
+ to: {
1384
+ x: number;
1385
+ y: number;
1386
+ };
1387
+ is_crossing?: boolean;
1388
+ from_schematic_port_id?: string;
1389
+ to_schematic_port_id?: string;
1390
+ }
1391
+ interface SchematicTrace {
1392
+ type: "schematic_trace";
1393
+ schematic_trace_id: string;
1394
+ source_trace_id: string;
1395
+ edges: SchematicTraceEdge[];
1396
+ }
1378
1397
  declare const schematic_trace: z.ZodObject<{
1379
1398
  type: z.ZodLiteral<"schematic_trace">;
1380
1399
  schematic_trace_id: z.ZodString;
@@ -1400,6 +1419,7 @@ declare const schematic_trace: z.ZodObject<{
1400
1419
  x: number;
1401
1420
  y: number;
1402
1421
  }>;
1422
+ is_crossing: z.ZodOptional<z.ZodBoolean>;
1403
1423
  from_schematic_port_id: z.ZodOptional<z.ZodString>;
1404
1424
  to_schematic_port_id: z.ZodOptional<z.ZodString>;
1405
1425
  }, "strip", z.ZodTypeAny, {
@@ -1411,6 +1431,7 @@ declare const schematic_trace: z.ZodObject<{
1411
1431
  x: number;
1412
1432
  y: number;
1413
1433
  };
1434
+ is_crossing?: boolean | undefined;
1414
1435
  from_schematic_port_id?: string | undefined;
1415
1436
  to_schematic_port_id?: string | undefined;
1416
1437
  }, {
@@ -1422,6 +1443,7 @@ declare const schematic_trace: z.ZodObject<{
1422
1443
  x: number;
1423
1444
  y: number;
1424
1445
  };
1446
+ is_crossing?: boolean | undefined;
1425
1447
  from_schematic_port_id?: string | undefined;
1426
1448
  to_schematic_port_id?: string | undefined;
1427
1449
  }>, "many">;
@@ -1438,6 +1460,7 @@ declare const schematic_trace: z.ZodObject<{
1438
1460
  x: number;
1439
1461
  y: number;
1440
1462
  };
1463
+ is_crossing?: boolean | undefined;
1441
1464
  from_schematic_port_id?: string | undefined;
1442
1465
  to_schematic_port_id?: string | undefined;
1443
1466
  }[];
@@ -1454,12 +1477,12 @@ declare const schematic_trace: z.ZodObject<{
1454
1477
  x: number;
1455
1478
  y: number;
1456
1479
  };
1480
+ is_crossing?: boolean | undefined;
1457
1481
  from_schematic_port_id?: string | undefined;
1458
1482
  to_schematic_port_id?: string | undefined;
1459
1483
  }[];
1460
1484
  }>;
1461
1485
  type SchematicTraceInput = z.input<typeof schematic_trace>;
1462
- type SchematicTrace = z.infer<typeof schematic_trace>;
1463
1486
 
1464
1487
  declare const schematic_text: z.ZodObject<{
1465
1488
  type: z.ZodLiteral<"schematic_text">;
@@ -6327,6 +6350,7 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
6327
6350
  x: number;
6328
6351
  y: number;
6329
6352
  }>;
6353
+ is_crossing: z.ZodOptional<z.ZodBoolean>;
6330
6354
  from_schematic_port_id: z.ZodOptional<z.ZodString>;
6331
6355
  to_schematic_port_id: z.ZodOptional<z.ZodString>;
6332
6356
  }, "strip", z.ZodTypeAny, {
@@ -6338,6 +6362,7 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
6338
6362
  x: number;
6339
6363
  y: number;
6340
6364
  };
6365
+ is_crossing?: boolean | undefined;
6341
6366
  from_schematic_port_id?: string | undefined;
6342
6367
  to_schematic_port_id?: string | undefined;
6343
6368
  }, {
@@ -6349,6 +6374,7 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
6349
6374
  x: number;
6350
6375
  y: number;
6351
6376
  };
6377
+ is_crossing?: boolean | undefined;
6352
6378
  from_schematic_port_id?: string | undefined;
6353
6379
  to_schematic_port_id?: string | undefined;
6354
6380
  }>, "many">;
@@ -6365,6 +6391,7 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
6365
6391
  x: number;
6366
6392
  y: number;
6367
6393
  };
6394
+ is_crossing?: boolean | undefined;
6368
6395
  from_schematic_port_id?: string | undefined;
6369
6396
  to_schematic_port_id?: string | undefined;
6370
6397
  }[];
@@ -6381,6 +6408,7 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
6381
6408
  x: number;
6382
6409
  y: number;
6383
6410
  };
6411
+ is_crossing?: boolean | undefined;
6384
6412
  from_schematic_port_id?: string | undefined;
6385
6413
  to_schematic_port_id?: string | undefined;
6386
6414
  }[];
@@ -8921,6 +8949,7 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
8921
8949
  x: number;
8922
8950
  y: number;
8923
8951
  }>;
8952
+ is_crossing: z.ZodOptional<z.ZodBoolean>;
8924
8953
  from_schematic_port_id: z.ZodOptional<z.ZodString>;
8925
8954
  to_schematic_port_id: z.ZodOptional<z.ZodString>;
8926
8955
  }, "strip", z.ZodTypeAny, {
@@ -8932,6 +8961,7 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
8932
8961
  x: number;
8933
8962
  y: number;
8934
8963
  };
8964
+ is_crossing?: boolean | undefined;
8935
8965
  from_schematic_port_id?: string | undefined;
8936
8966
  to_schematic_port_id?: string | undefined;
8937
8967
  }, {
@@ -8943,6 +8973,7 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
8943
8973
  x: number;
8944
8974
  y: number;
8945
8975
  };
8976
+ is_crossing?: boolean | undefined;
8946
8977
  from_schematic_port_id?: string | undefined;
8947
8978
  to_schematic_port_id?: string | undefined;
8948
8979
  }>, "many">;
@@ -8959,6 +8990,7 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
8959
8990
  x: number;
8960
8991
  y: number;
8961
8992
  };
8993
+ is_crossing?: boolean | undefined;
8962
8994
  from_schematic_port_id?: string | undefined;
8963
8995
  to_schematic_port_id?: string | undefined;
8964
8996
  }[];
@@ -8975,6 +9007,7 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
8975
9007
  x: number;
8976
9008
  y: number;
8977
9009
  };
9010
+ is_crossing?: boolean | undefined;
8978
9011
  from_schematic_port_id?: string | undefined;
8979
9012
  to_schematic_port_id?: string | undefined;
8980
9013
  }[];
@@ -9312,4 +9345,4 @@ type AnySoupElement = AnyCircuitElement;
9312
9345
  */
9313
9346
  type AnySoupElementInput = AnyCircuitElementInput;
9314
9347
 
9315
- export { type AnyCircuitElement, type AnyCircuitElementInput, type AnySoupElement, type AnySoupElementInput, type AnySourceComponent, type CadComponent, type CadComponentInput, type Distance, type InputPoint, type InputPosition, type InputRotation, type LayerRef, type LayerRefInput, type Length, type PCBBoard, type PCBComponent, type PCBFabricationNotePath, type PCBFabricationNoteText, type PCBHole, type PCBHoleInput, type PCBKeepout, type PCBKeepoutInput, type PCBPlacementError, type PCBPlatedHole, type PCBPlatedHoleInput, type PCBPort, type PCBPortInput, type PCBPortNotMatchedError, type PCBSMTPad, type PCBSMTPadInput, type PCBSilkscreenLine, type PCBSilkscreenText, type PCBSolderPasteInput, type PCBText, type PCBTrace, type PCBTraceError, type PCBTraceHint, type PCBTraceInput, type PCBVia, type PcbBoard, type PcbBoardInput, type PcbCircuitElement, type PcbComponent, type PcbComponentInput, type PcbFabricationNotePath, type PcbFabricationNotePathInput, type PcbFabricationNoteText, type PcbFabricationNoteTextInput, type PcbHole, type PcbHoleCircleOrSquare, type PcbHoleCircleOrSquareInput, type PcbHoleOval, type PcbHoleOvalInput, type PcbPlacementError, type PcbPlacementErrorInput, type PcbPlatedHole, type PcbPlatedHoleCircle, type PcbPlatedHoleInput, type PcbPlatedHoleOval, type PcbPort, type PcbPortInput, type PcbPortNotMatchedError, type PcbPortNotMatchedErrorInput, type PcbRouteHint, type PcbRouteHintInput, type PcbRouteHints, type PcbRouteHintsInput, type PcbSilkscreenCircle, type PcbSilkscreenCircleInput, type PcbSilkscreenLine, type PcbSilkscreenLineInput, type PcbSilkscreenOval, type PcbSilkscreenOvalDeprecated, type PcbSilkscreenOvalInput, type PcbSilkscreenPath, type PcbSilkscreenPathDeprecated, type PcbSilkscreenPathInput, type PcbSilkscreenRect, type PcbSilkscreenRectInput, type PcbSilkscreenRectOld, type PcbSilkscreenText, type PcbSilkscreenTextInput, type PcbSmtPad, type PcbSmtPadCircle, type PcbSmtPadRect, type PcbSolderPaste, type PcbSolderPasteCircle, type PcbSolderPasteRect, type PcbText, type PcbTextInput, type PcbTrace, type PcbTraceError, type PcbTraceErrorInput, type PcbTraceHint, type PcbTraceHintInput, type PcbTraceInput, type PcbTraceRoutePoint, type PcbTraceRoutePointVia, type PcbTraceRoutePointWire, type PcbVia, type PcbViaInput, type Point, type Point3, type Position, type Rotation, type RouteHintPoint, type RouteHintPointInput, type SchematicBox, type SchematicBoxInput, type SchematicComponent, type SchematicComponentInput, type SchematicDebugLine, type SchematicDebugObject, type SchematicDebugObjectInput, type SchematicDebugRect, type SchematicError, type SchematicErrorInput, type SchematicLine, type SchematicLineInput, type SchematicNetLabel, type SchematicNetLabelInput, type SchematicPath, type SchematicPathInput, type SchematicPort, type SchematicPortArrangement, type SchematicPortArrangementBySides, type SchematicPortArrangementBySize, type SchematicPortInput, type SchematicText, type SchematicTextInput, type SchematicTrace, type SchematicTraceInput, type Size, type SourceComponentBase, type SourceGroup, type SourceGroupInput, type SourceLed, type SourceLedInput, type SourceNet, type SourceNetInput, type SourcePort, type SourceSimpleBattery, type SourceSimpleBatteryInput, type SourceSimpleBugInput, type SourceSimpleCapacitor, type SourceSimpleCapacitorInput, type SourceSimpleChip, type SourceSimpleChipInput, type SourceSimpleDiode, type SourceSimpleDiodeInput, type SourceSimpleGround, type SourceSimpleGroundInput, type SourceSimpleInductor, type SourceSimpleInductorInput, type SourceSimplePowerSource, type SourceSimplePowerSourceInput, type SourceSimpleResistor, type SourceSimpleResistorInput, type SourceTrace, type SupplierName, type VisibleLayer, type VisibleLayerRef, all_layers, any_circuit_element, any_soup_element, any_source_component, battery_capacity, cad_component, capacitance, current, distance, getZodPrefixedIdWithDefault, inductance, layer_ref, layer_string, length, pcb_board, pcb_component, pcb_fabrication_note_path, pcb_fabrication_note_text, pcb_hole, pcb_hole_circle_or_square_shape, pcb_hole_oval_shape, pcb_keepout, pcb_placement_error, pcb_plated_hole, pcb_port, pcb_port_not_matched_error, pcb_route_hint, pcb_route_hints, pcb_silkscreen_circle, pcb_silkscreen_line, pcb_silkscreen_oval, pcb_silkscreen_path, pcb_silkscreen_rect, pcb_silkscreen_text, pcb_smtpad, pcb_solder_paste, pcb_text, pcb_trace, pcb_trace_error, pcb_trace_hint, pcb_trace_route_point, pcb_trace_route_point_via, pcb_trace_route_point_wire, pcb_via, point, point3, port_arrangement, position, position3, resistance, rotation, route_hint_point, schematic_box, schematic_component, schematic_component_port_arrangement_by_sides, schematic_component_port_arrangement_by_size, schematic_debug_line, schematic_debug_object, schematic_debug_object_base, schematic_debug_point, schematic_debug_rect, schematic_error, schematic_line, schematic_net_label, schematic_path, schematic_pin_styles, schematic_port, schematic_text, schematic_trace, size, source_component_base, source_group, source_led, source_net, source_port, source_simple_battery, source_simple_bug, source_simple_capacitor, source_simple_chip, source_simple_diode, source_simple_ground, source_simple_inductor, source_simple_power_source, source_simple_resistor, source_trace, supplier_name, time, visible_layer, voltage };
9348
+ export { type AnyCircuitElement, type AnyCircuitElementInput, type AnySoupElement, type AnySoupElementInput, type AnySourceComponent, type CadComponent, type CadComponentInput, type Distance, type InputPoint, type InputPosition, type InputRotation, type LayerRef, type LayerRefInput, type Length, type PCBBoard, type PCBComponent, type PCBFabricationNotePath, type PCBFabricationNoteText, type PCBHole, type PCBHoleInput, type PCBKeepout, type PCBKeepoutInput, type PCBPlacementError, type PCBPlatedHole, type PCBPlatedHoleInput, type PCBPort, type PCBPortInput, type PCBPortNotMatchedError, type PCBSMTPad, type PCBSMTPadInput, type PCBSilkscreenLine, type PCBSilkscreenText, type PCBSolderPasteInput, type PCBText, type PCBTrace, type PCBTraceError, type PCBTraceHint, type PCBTraceInput, type PCBVia, type PcbBoard, type PcbBoardInput, type PcbCircuitElement, type PcbComponent, type PcbComponentInput, type PcbFabricationNotePath, type PcbFabricationNotePathInput, type PcbFabricationNoteText, type PcbFabricationNoteTextInput, type PcbHole, type PcbHoleCircleOrSquare, type PcbHoleCircleOrSquareInput, type PcbHoleOval, type PcbHoleOvalInput, type PcbPlacementError, type PcbPlacementErrorInput, type PcbPlatedHole, type PcbPlatedHoleCircle, type PcbPlatedHoleInput, type PcbPlatedHoleOval, type PcbPort, type PcbPortInput, type PcbPortNotMatchedError, type PcbPortNotMatchedErrorInput, type PcbRouteHint, type PcbRouteHintInput, type PcbRouteHints, type PcbRouteHintsInput, type PcbSilkscreenCircle, type PcbSilkscreenCircleInput, type PcbSilkscreenLine, type PcbSilkscreenLineInput, type PcbSilkscreenOval, type PcbSilkscreenOvalDeprecated, type PcbSilkscreenOvalInput, type PcbSilkscreenPath, type PcbSilkscreenPathDeprecated, type PcbSilkscreenPathInput, type PcbSilkscreenRect, type PcbSilkscreenRectInput, type PcbSilkscreenRectOld, type PcbSilkscreenText, type PcbSilkscreenTextInput, type PcbSmtPad, type PcbSmtPadCircle, type PcbSmtPadRect, type PcbSolderPaste, type PcbSolderPasteCircle, type PcbSolderPasteRect, type PcbText, type PcbTextInput, type PcbTrace, type PcbTraceError, type PcbTraceErrorInput, type PcbTraceHint, type PcbTraceHintInput, type PcbTraceInput, type PcbTraceRoutePoint, type PcbTraceRoutePointVia, type PcbTraceRoutePointWire, type PcbVia, type PcbViaInput, type Point, type Point3, type Position, type Rotation, type RouteHintPoint, type RouteHintPointInput, type SchematicBox, type SchematicBoxInput, type SchematicComponent, type SchematicComponentInput, type SchematicDebugLine, type SchematicDebugObject, type SchematicDebugObjectInput, type SchematicDebugRect, type SchematicError, type SchematicErrorInput, type SchematicLine, type SchematicLineInput, type SchematicNetLabel, type SchematicNetLabelInput, type SchematicPath, type SchematicPathInput, type SchematicPort, type SchematicPortArrangement, type SchematicPortArrangementBySides, type SchematicPortArrangementBySize, type SchematicPortInput, type SchematicText, type SchematicTextInput, type SchematicTrace, type SchematicTraceEdge, type SchematicTraceInput, type Size, type SourceComponentBase, type SourceGroup, type SourceGroupInput, type SourceLed, type SourceLedInput, type SourceNet, type SourceNetInput, type SourcePort, type SourceSimpleBattery, type SourceSimpleBatteryInput, type SourceSimpleBugInput, type SourceSimpleCapacitor, type SourceSimpleCapacitorInput, type SourceSimpleChip, type SourceSimpleChipInput, type SourceSimpleDiode, type SourceSimpleDiodeInput, type SourceSimpleGround, type SourceSimpleGroundInput, type SourceSimpleInductor, type SourceSimpleInductorInput, type SourceSimplePowerSource, type SourceSimplePowerSourceInput, type SourceSimpleResistor, type SourceSimpleResistorInput, type SourceTrace, type SupplierName, type VisibleLayer, type VisibleLayerRef, all_layers, any_circuit_element, any_soup_element, any_source_component, battery_capacity, cad_component, capacitance, current, distance, getZodPrefixedIdWithDefault, inductance, layer_ref, layer_string, length, pcb_board, pcb_component, pcb_fabrication_note_path, pcb_fabrication_note_text, pcb_hole, pcb_hole_circle_or_square_shape, pcb_hole_oval_shape, pcb_keepout, pcb_placement_error, pcb_plated_hole, pcb_port, pcb_port_not_matched_error, pcb_route_hint, pcb_route_hints, pcb_silkscreen_circle, pcb_silkscreen_line, pcb_silkscreen_oval, pcb_silkscreen_path, pcb_silkscreen_rect, pcb_silkscreen_text, pcb_smtpad, pcb_solder_paste, pcb_text, pcb_trace, pcb_trace_error, pcb_trace_hint, pcb_trace_route_point, pcb_trace_route_point_via, pcb_trace_route_point_wire, pcb_via, point, point3, port_arrangement, position, position3, resistance, rotation, route_hint_point, schematic_box, schematic_component, schematic_component_port_arrangement_by_sides, schematic_component_port_arrangement_by_size, schematic_debug_line, schematic_debug_object, schematic_debug_object_base, schematic_debug_point, schematic_debug_rect, schematic_error, schematic_line, schematic_net_label, schematic_path, schematic_pin_styles, schematic_port, schematic_text, schematic_trace, size, source_component_base, source_group, source_led, source_net, source_port, source_simple_battery, source_simple_bug, source_simple_capacitor, source_simple_chip, source_simple_diode, source_simple_ground, source_simple_inductor, source_simple_power_source, source_simple_resistor, source_trace, supplier_name, time, visible_layer, voltage };
package/dist/index.mjs CHANGED
@@ -101,6 +101,13 @@ var unitMappings = {
101
101
  }
102
102
  }
103
103
  };
104
+ var unitMappingAndVariantSuffixes = /* @__PURE__ */ new Set();
105
+ for (const [baseUnit, info] of Object.entries(unitMappings)) {
106
+ unitMappingAndVariantSuffixes.add(baseUnit);
107
+ for (const variant of Object.keys(info.variants)) {
108
+ unitMappingAndVariantSuffixes.add(variant);
109
+ }
110
+ }
104
111
  function getBaseTscircuitUnit(unit) {
105
112
  for (const [baseUnit, info] of Object.entries(unitMappings)) {
106
113
  if (unit in info.variants) {
@@ -115,6 +122,29 @@ function getBaseTscircuitUnit(unit) {
115
122
  conversionFactor: 1
116
123
  };
117
124
  }
125
+ var si_prefix_multiplier = {
126
+ tera: 1e12,
127
+ T: 1e12,
128
+ giga: 1e9,
129
+ G: 1e9,
130
+ mega: 1e6,
131
+ M: 1e6,
132
+ kilo: 1e3,
133
+ k: 1e3,
134
+ deci: 0.1,
135
+ d: 0.1,
136
+ centi: 0.01,
137
+ c: 0.01,
138
+ milli: 1e-3,
139
+ m: 1e-3,
140
+ micro: 1e-6,
141
+ u: 1e-6,
142
+ \u00B5: 1e-6,
143
+ nano: 1e-9,
144
+ n: 1e-9,
145
+ pico: 1e-12,
146
+ p: 1e-12
147
+ };
118
148
  var parseAndConvertSiUnit = (v) => {
119
149
  if (typeof v === "undefined")
120
150
  return { parsedUnit: null, unitOfValue: null, value: null };
@@ -137,17 +167,26 @@ var parseAndConvertSiUnit = (v) => {
137
167
  }
138
168
  };
139
169
  }
140
- const unit_reversed = v.split("").reverse().join("").match(/[^\d\s]+/)?.[0];
170
+ const reversed_input_string = v.toString().split("").reverse().join("");
171
+ const unit_reversed = reversed_input_string.match(/[^\d\s]+/)?.[0];
141
172
  if (!unit_reversed) {
142
173
  throw new Error(`Could not determine unit: "${v}"`);
143
174
  }
144
175
  const unit = unit_reversed.split("").reverse().join("");
145
- const value = v.slice(0, -unit.length);
176
+ const numberPart = v.slice(0, -unit.length);
177
+ if (unit in si_prefix_multiplier && !unitMappingAndVariantSuffixes.has(unit)) {
178
+ const siMultiplier = si_prefix_multiplier[unit];
179
+ return {
180
+ parsedUnit: null,
181
+ unitOfValue: null,
182
+ value: Number.parseFloat(numberPart) * siMultiplier
183
+ };
184
+ }
146
185
  const { baseUnit, conversionFactor } = getBaseTscircuitUnit(unit);
147
186
  return {
148
187
  parsedUnit: unit,
149
188
  unitOfValue: baseUnit,
150
- value: conversionFactor * Number.parseFloat(value)
189
+ value: conversionFactor * Number.parseFloat(numberPart)
151
190
  };
152
191
  };
153
192
 
@@ -474,11 +513,13 @@ var schematic_trace = z27.object({
474
513
  x: z27.number(),
475
514
  y: z27.number()
476
515
  }),
516
+ is_crossing: z27.boolean().optional(),
477
517
  from_schematic_port_id: z27.string().optional(),
478
518
  to_schematic_port_id: z27.string().optional()
479
519
  })
480
520
  )
481
521
  });
522
+ expectTypesMatch(true);
482
523
 
483
524
  // src/schematic/schematic_text.ts
484
525
  import { z as z28 } from "zod";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/convert-si-unit-to-number.ts","../src/units/index.ts","../src/common/point.ts","../src/common/point3.ts","../src/common/size.ts","../src/common/getZodPrefixedIdWithDefault.ts","../src/source/source_simple_capacitor.ts","../src/pcb/properties/supplier_name.ts","../src/source/base/source_component_base.ts","../src/source/source_simple_resistor.ts","../src/source/source_simple_diode.ts","../src/source/source_simple_ground.ts","../src/source/source_simple_bug.ts","../src/source/source_simple_chip.ts","../src/source/source_simple_inductor.ts","../src/source/source_led.ts","../src/source/source_simple_power_source.ts","../src/source/any_source_component.ts","../src/source/source_simple_battery.ts","../src/source/source_port.ts","../src/source/source_trace.ts","../src/source/source_group.ts","../src/source/source_net.ts","../src/schematic/schematic_box.ts","../src/schematic/schematic_path.ts","../src/schematic/schematic_component.ts","../src/utils/expect-types-match.ts","../src/schematic/schematic_line.ts","../src/schematic/schematic_trace.ts","../src/schematic/schematic_text.ts","../src/schematic/schematic_port.ts","../src/schematic/schematic_net_label.ts","../src/schematic/schematic_error.ts","../src/schematic/schematic_debug_object.ts","../src/pcb/properties/layer_ref.ts","../src/pcb/properties/pcb_route_hints.ts","../src/pcb/properties/route_hint_point.ts","../src/pcb/pcb_component.ts","../src/pcb/pcb_hole.ts","../src/pcb/pcb_plated_hole.ts","../src/pcb/pcb_port.ts","../src/pcb/pcb_smtpad.ts","../src/pcb/pcb_solder_paste.ts","../src/pcb/pcb_text.ts","../src/pcb/pcb_trace.ts","../src/pcb/pcb_trace_error.ts","../src/pcb/pcb_port_not_matched_error.ts","../src/pcb/pcb_via.ts","../src/pcb/pcb_board.ts","../src/pcb/pcb_placement_error.ts","../src/pcb/pcb_trace_hint.ts","../src/pcb/pcb_silkscreen_line.ts","../src/pcb/pcb_silkscreen_path.ts","../src/pcb/pcb_silkscreen_text.ts","../src/pcb/pcb_silkscreen_rect.ts","../src/pcb/pcb_silkscreen_circle.ts","../src/pcb/pcb_silkscreen_oval.ts","../src/pcb/pcb_fabrication_note_text.ts","../src/pcb/pcb_fabrication_note_path.ts","../src/pcb/pcb_keepout.ts","../src/cad/cad_component.ts","../src/any_circuit_element.ts"],"sourcesContent":["type UnitInfo = {\n baseUnit: BaseTscircuitUnit\n conversionFactor: number\n}\n\nconst unitMappings: Record<\n string,\n { baseUnit: BaseTscircuitUnit; variants: Record<string, number> }\n> = {\n Hz: {\n baseUnit: \"Hz\",\n variants: {\n MHz: 1e6,\n kHz: 1e3,\n Hz: 1,\n },\n },\n g: {\n baseUnit: \"g\",\n variants: {\n kg: 1e3,\n g: 1,\n },\n },\n Ω: {\n baseUnit: \"Ω\",\n variants: {\n mΩ: 1e-3,\n Ω: 1,\n kΩ: 1e3,\n MΩ: 1e6,\n GΩ: 1e9,\n TΩ: 1e12,\n },\n },\n V: {\n baseUnit: \"V\",\n variants: {\n mV: 1e-3,\n V: 1,\n kV: 1e3,\n MV: 1e6,\n GV: 1e9,\n TV: 1e12,\n },\n },\n A: {\n baseUnit: \"A\",\n variants: {\n µA: 1e-6,\n mA: 1e-3,\n ma: 1e-3,\n A: 1,\n kA: 1e3,\n MA: 1e6,\n },\n },\n F: {\n baseUnit: \"F\",\n variants: {\n pF: 1e-12,\n nF: 1e-9,\n µF: 1e-6,\n uF: 1e-6,\n mF: 1e-3,\n F: 1,\n },\n },\n ml: {\n baseUnit: \"ml\",\n variants: {\n ml: 1,\n mL: 1,\n l: 1e3,\n L: 1e3,\n },\n },\n deg: {\n baseUnit: \"deg\",\n variants: {\n rad: 180 / Math.PI,\n },\n },\n ms: {\n baseUnit: \"ms\",\n variants: {\n s: 1000,\n },\n },\n mm: {\n baseUnit: \"mm\",\n variants: {\n nm: 1e-6,\n µm: 1e-3,\n um: 1e-3,\n mm: 1,\n cm: 10,\n dm: 100,\n m: 1000,\n km: 1e6,\n in: 25.4,\n ft: 304.8,\n IN: 25.4,\n FT: 304.8,\n yd: 914.4,\n mi: 1.609344e6,\n mil: 0.0254,\n },\n },\n}\n\nfunction getBaseTscircuitUnit(unit: string): UnitInfo {\n for (const [baseUnit, info] of Object.entries(unitMappings)) {\n if (unit in info.variants) {\n return {\n baseUnit: info.baseUnit,\n conversionFactor: info.variants[unit]!,\n }\n }\n }\n return {\n baseUnit: unit as BaseTscircuitUnit,\n conversionFactor: 1,\n }\n}\n\nconst si_prefix_multiplier = {\n tera: 1e12,\n T: 1e12,\n giga: 1e9,\n G: 1e9,\n mega: 1e6,\n M: 1e6,\n kilo: 1e3,\n k: 1e3,\n deci: 1e-1,\n d: 1e-1,\n centi: 1e-2,\n c: 1e-2,\n milli: 1e-3,\n m: 1e-3,\n micro: 1e-6,\n u: 1e-6,\n µ: 1e-6,\n nano: 1e-9,\n n: 1e-9,\n pico: 1e-12,\n p: 1e-12,\n}\ntype BaseTscircuitUnit =\n | \"ms\"\n | \"mm\"\n | \"g\"\n | \"deg\"\n | \"Hz\"\n | \"ml\"\n | \"V\"\n | \"A\"\n | \"Ω\"\n | \"F\"\n | \"H\"\n\nexport const parseAndConvertSiUnit = <\n T extends\n | string\n | number\n | undefined\n | { x: string | number; y: string | number },\n>(\n v: T,\n): {\n parsedUnit: string | null\n unitOfValue: BaseTscircuitUnit | null\n value: T extends { x: string | number; y: string | number }\n ? null | { x: number; y: number }\n : null | number\n} => {\n if (typeof v === \"undefined\")\n return { parsedUnit: null, unitOfValue: null, value: null }\n if (typeof v === \"string\" && v.match(/^[\\d\\.]+$/))\n return {\n value: Number.parseFloat(v) as any,\n parsedUnit: null,\n unitOfValue: null,\n }\n if (typeof v === \"number\")\n return { value: v as any, parsedUnit: null, unitOfValue: null }\n if (typeof v === \"object\" && \"x\" in v && \"y\" in v) {\n const { parsedUnit, unitOfValue } = parseAndConvertSiUnit(v.x)\n return {\n parsedUnit: parsedUnit,\n unitOfValue: unitOfValue,\n value: {\n x: parseAndConvertSiUnit(v.x as any).value as number,\n y: parseAndConvertSiUnit(v.y as any).value as number,\n } as any,\n }\n }\n const unit_reversed = v\n .split(\"\")\n .reverse()\n .join(\"\")\n .match(/[^\\d\\s]+/)?.[0]\n if (!unit_reversed) {\n throw new Error(`Could not determine unit: \"${v}\"`)\n }\n const unit = unit_reversed.split(\"\").reverse().join(\"\")\n const value = v.slice(0, -unit.length)\n\n const { baseUnit, conversionFactor } = getBaseTscircuitUnit(unit)\n\n return {\n parsedUnit: unit,\n unitOfValue: baseUnit,\n value: (conversionFactor * Number.parseFloat(value)) as any,\n }\n}\n","import { parseAndConvertSiUnit } from \"src/utils/convert-si-unit-to-number\"\nimport { z } from \"zod\"\n\n// // Currently, removing uncommon SI Prefixes for type simplicity.\n// export type SIPrefix =\n// // | \"y\"\n// // | \"yocto\"\n// // | \"z\"\n// // | \"zepto\"\n// // | \"atto\"\n// // | \"a\"\n// | \"femto\"\n// | \"f\"\n// | \"u\"\n// | \"micro\"\n// // | \"d\"\n// // | \"deci\"\n// | \"c\"\n// | \"centi\"\n// | \"m\"\n// | \"milli\"\n// | \"k\"\n// | \"kilo\"\n// | \"M\"\n// | \"mega\"\n// // | \"G\"\n// // | \"T\"\n// // | \"P\"\n// // | \"E\"\n// // | \"Z\"\n// // | \"Y\"\n\n// export type UnitAbbreviations = {\n// farad: \"F\"\n// ohm: \"Ω\"\n// henry: \"H\"\n// meter: \"m\"\n// volt: \"V\"\n// inch: \"in\"\n// foot: \"ft\"\n// }\n\n// export type Unit = keyof UnitAbbreviations\n// export type NumberWithUnit<T extends Unit> =\n// | `${number}${T | UnitAbbreviations[T]}`\n// | `${number} ${T | UnitAbbreviations[T]}`\n// | `${number}${SIPrefix}${T | UnitAbbreviations[T]}`\n// | `${number} ${SIPrefix}${T | UnitAbbreviations[T]}`\n// export type NumberWithAnyUnit =\n// | `${number}${UnitOrAbbreviation}`\n// | `${number} ${UnitOrAbbreviation}`\n// | `${number}${SIPrefix}${UnitOrAbbreviation}`\n// | `${number} ${SIPrefix}${UnitOrAbbreviation}`\n\n// TODO lots of validation to make sure the unit is valid etc.\nexport const resistance = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\nexport const capacitance = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\nexport const inductance = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\nexport const voltage = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\nexport const length = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n/**\n * Length in meters\n */\nexport type Length = number\nexport type Distance = number\n\nexport const distance = length\n\nexport const current = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\nexport const time = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\n/**\n * Rotation is always converted to degrees\n */\nexport const rotation = z\n .string()\n .or(z.number())\n .transform((arg): number => {\n if (typeof arg === \"number\") return arg\n if (arg.endsWith(\"deg\")) {\n return Number.parseFloat(arg.split(\"deg\")[0]!)\n }\n if (arg.endsWith(\"rad\")) {\n return (Number.parseFloat(arg.split(\"rad\")[0]!) * 180) / Math.PI\n }\n return Number.parseFloat(arg)\n })\n\nexport const battery_capacity = z\n .number()\n .or(z.string().endsWith(\"mAh\"))\n .transform((v) => {\n if (typeof v === \"string\") {\n const valString = v.replace(\"mAh\", \"\")\n const num = Number.parseFloat(valString)\n if (Number.isNaN(num)) {\n throw new Error(\"Invalid capacity\")\n }\n return num\n }\n return v\n })\n .describe(\"Battery capacity in mAh\")\n\nexport type InputRotation = number | string\nexport type Rotation = number\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\n\nexport const point = z.object({\n x: distance,\n y: distance,\n})\n\nexport const position = point\n\nexport type Point = z.infer<typeof point>\nexport type InputPoint = z.input<typeof point>\nexport type InputPosition = z.input<typeof position>\nexport type Position = z.infer<typeof position>\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\n\nexport const point3 = z.object({\n x: distance,\n y: distance,\n z: distance,\n})\n\nexport const position3 = point3\n\nexport type Point3 = z.infer<typeof point3>\n","import { z } from \"zod\"\n\nexport const size = z.object({\n width: z.number(),\n height: z.number(),\n})\n\nexport type Size = z.infer<typeof size>\n","import { z } from \"zod\"\nimport { nanoid } from \"nanoid\"\n\n/**\n * Use this for primary keys for any circuit element\n */\nexport const getZodPrefixedIdWithDefault = (prefix: string) => {\n return z\n .string()\n .optional()\n .default(() => `${prefix}_${nanoid(10)}`)\n}\n","import { z } from \"zod\"\nimport { source_component_base } from \"src/source/base/source_component_base\"\nimport { capacitance } from \"src/units\"\n\nexport const source_simple_capacitor = source_component_base.extend({\n ftype: z.literal(\"simple_capacitor\"),\n capacitance,\n})\n\nexport type SourceSimpleCapacitor = z.infer<typeof source_simple_capacitor>\nexport type SourceSimpleCapacitorInput = z.input<typeof source_simple_capacitor>\n","import { z } from \"zod\"\n\nexport const supplier_name = z.enum([\n \"jlcpcb\",\n \"macrofab\",\n \"pcbway\",\n \"digikey\",\n \"mouser\",\n \"lcsc\",\n])\n\nexport type SupplierName = z.infer<typeof supplier_name>\n","import { supplier_name } from \"src/pcb/properties/supplier_name\"\nimport { z } from \"zod\"\n\nexport const source_component_base = z.object({\n type: z.literal(\"source_component\"),\n ftype: z.string().optional(),\n source_component_id: z.string(),\n name: z.string(),\n manufacturer_part_number: z.string().optional(),\n supplier_part_numbers: z\n .record(supplier_name, z.array(z.string()))\n .optional(),\n display_value: z.string().optional(),\n})\n\nexport type SourceComponentBase = z.infer<typeof source_component_base>\n","import { z } from \"zod\"\nimport { source_component_base } from \"src/source/base/source_component_base\"\nimport { resistance } from \"src/units\"\n\nexport const source_simple_resistor = source_component_base.extend({\n ftype: z.literal(\"simple_resistor\"),\n resistance,\n})\n\nexport type SourceSimpleResistor = z.infer<typeof source_simple_resistor>\nexport type SourceSimpleResistorInput = z.input<typeof source_simple_resistor>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\n\nexport const source_simple_diode = source_component_base.extend({\n ftype: z.literal(\"simple_diode\"),\n})\n\nexport type SourceSimpleDiode = z.infer<typeof source_simple_diode>\nexport type SourceSimpleDiodeInput = z.input<typeof source_simple_diode>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\n\nexport const source_simple_ground = source_component_base.extend({\n ftype: z.literal(\"simple_ground\"),\n})\n\nexport type SourceSimpleGround = z.infer<typeof source_simple_ground>\nexport type SourceSimpleGroundInput = z.input<typeof source_simple_ground>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\n\n/**\n * @deprecated Use source_simple_chip instead. This will be removed in a future version.\n */\nexport const source_simple_bug = source_component_base\n .extend({\n ftype: z.literal(\"simple_bug\"),\n })\n .describe(\"@deprecated\")\n\nexport type source_simple_bug = z.infer<typeof source_simple_bug>\nexport type SourceSimpleBugInput = z.input<typeof source_simple_bug>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\n\nexport const source_simple_chip = source_component_base.extend({\n ftype: z.literal(\"simple_chip\"),\n})\n\nexport type SourceSimpleChip = z.infer<typeof source_simple_chip>\nexport type SourceSimpleChipInput = z.input<typeof source_simple_chip>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\nimport { inductance } from \"../units\"\n\nexport const source_simple_inductor = source_component_base.extend({\n ftype: z.literal(\"simple_inductor\"),\n inductance,\n})\n\nexport type SourceSimpleInductor = z.infer<typeof source_simple_inductor>\nexport type SourceSimpleInductorInput = z.input<typeof source_simple_inductor>\n","import { z } from \"zod\"\nimport { source_simple_diode } from \"./source_simple_diode\"\n\nexport const source_led = source_simple_diode.extend({\n ftype: z.literal(\"led\"),\n})\n\nexport type SourceLed = z.infer<typeof source_led>\nexport type SourceLedInput = z.input<typeof source_led>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\nimport { voltage } from \"../units\"\n\nexport const source_simple_power_source = source_component_base.extend({\n ftype: z.literal(\"simple_power_source\"),\n voltage,\n})\n\nexport type SourceSimplePowerSource = z.infer<typeof source_simple_power_source>\nexport type SourceSimplePowerSourceInput = z.input<\n typeof source_simple_power_source\n>\n","import { z } from \"zod\"\nimport { source_simple_resistor } from \"./source_simple_resistor\"\nimport { source_simple_capacitor } from \"./source_simple_capacitor\"\nimport { source_simple_diode } from \"./source_simple_diode\"\nimport { source_simple_ground } from \"./source_simple_ground\"\nimport { source_simple_bug } from \"./source_simple_bug\"\nimport { source_simple_chip } from \"./source_simple_chip\"\nimport { source_led } from \"./source_led\"\nimport { source_simple_power_source } from \"./source_simple_power_source\"\nimport { source_simple_battery } from \"./source_simple_battery\"\nimport { source_simple_inductor } from \"./source_simple_inductor\"\n\nexport const any_source_component = z.union([\n source_simple_resistor,\n source_simple_capacitor,\n source_simple_diode,\n source_simple_ground,\n source_simple_chip,\n source_simple_bug,\n source_led,\n source_simple_power_source,\n source_simple_battery,\n source_simple_inductor,\n])\n\nexport type AnySourceComponent = z.infer<typeof any_source_component>\n","import { z } from \"zod\"\nimport { source_component_base } from \"src/source/base/source_component_base\"\nimport { battery_capacity } from \"src/units\"\n\nexport const source_simple_battery = source_component_base.extend({\n ftype: z.literal(\"simple_battery\"),\n capacity: battery_capacity,\n})\n\nexport type SourceSimpleBattery = z.infer<typeof source_simple_battery>\nexport type SourceSimpleBatteryInput = z.input<typeof source_simple_battery>\n","import { z } from \"zod\"\n\nexport const source_port = z.object({\n type: z.literal(\"source_port\"),\n pin_number: z.number().optional(),\n port_hints: z.array(z.string()).optional(),\n name: z.string(),\n source_port_id: z.string(),\n source_component_id: z.string(),\n})\n\nexport type SourcePort = z.infer<typeof source_port>\n","import { z } from \"zod\"\n\nexport const source_trace = z.object({\n type: z.literal(\"source_trace\"),\n source_trace_id: z.string(),\n connected_source_port_ids: z.array(z.string()),\n connected_source_net_ids: z.array(z.string()),\n})\n\nexport type SourceTrace = z.infer<typeof source_trace>\n","import { z } from \"zod\"\n\nexport const source_group = z.object({\n type: z.literal(\"source_group\"),\n source_group_id: z.string(),\n name: z.string().optional(),\n})\n\nexport type SourceGroup = z.infer<typeof source_group>\nexport type SourceGroupInput = z.input<typeof source_group>\n","import { z } from \"zod\"\n\nexport const source_net = z.object({\n type: z.literal(\"source_net\"),\n source_net_id: z.string(),\n name: z.string(),\n member_source_group_ids: z.array(z.string()),\n is_power: z.boolean().optional(),\n is_ground: z.boolean().optional(),\n is_digital_signal: z.boolean().optional(),\n is_analog_signal: z.boolean().optional(),\n trace_width: z.number().optional(),\n})\n\nexport type SourceNet = z.infer<typeof source_net>\nexport type SourceNetInput = z.input<typeof source_net>\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\n\nexport const schematic_box = z\n .object({\n type: z.literal(\"schematic_box\"),\n schematic_component_id: z.string(),\n width: distance,\n height: distance,\n x: distance,\n y: distance,\n })\n .describe(\"Draws a box on the schematic\")\n\nexport type SchematicBoxInput = z.input<typeof schematic_box>\nexport type SchematicBox = z.infer<typeof schematic_box>\n","import { z } from \"zod\"\nimport { point } from \"../common/point\"\n\nexport const schematic_path = z.object({\n type: z.literal(\"schematic_path\"),\n schematic_component_id: z.string(),\n fill_color: z.enum([\"red\", \"blue\"]).optional(),\n is_filled: z.boolean().optional(),\n points: z.array(point),\n})\n\nexport type SchematicPathInput = z.input<typeof schematic_path>\nexport type SchematicPath = z.infer<typeof schematic_path>\n","import { z } from \"zod\"\nimport { point, type Point } from \"../common/point\"\nimport { size, type Size } from \"../common/size\"\nimport { length, rotation } from \"../units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const schematic_pin_styles = z.record(\n z.object({\n left_margin: length.optional(),\n right_margin: length.optional(),\n top_margin: length.optional(),\n bottom_margin: length.optional(),\n }),\n)\n\nexport interface SchematicPortArrangementBySize {\n left_size: number\n right_size: number\n top_size?: number\n bottom_size?: number\n}\n\nexport interface SchematicPortArrangementBySides {\n left_side?: { pins: number[]; direction?: \"top-to-bottom\" | \"bottom-to-top\" }\n right_side?: { pins: number[]; direction?: \"top-to-bottom\" | \"bottom-to-top\" }\n top_side?: { pins: number[]; direction?: \"left-to-right\" | \"right-to-left\" }\n bottom_side?: {\n pins: number[]\n direction?: \"left-to-right\" | \"right-to-left\"\n }\n}\n\nexport type SchematicPortArrangement =\n | SchematicPortArrangementBySize\n | SchematicPortArrangementBySides\n\nexport interface SchematicComponent {\n type: \"schematic_component\"\n rotation: number\n size: Size\n center: Point\n source_component_id: string\n schematic_component_id: string\n pin_spacing?: number\n pin_styles?: Record<\n string,\n {\n left_margin?: number\n right_margin?: number\n top_margin?: number\n bottom_margin?: number\n }\n >\n box_width?: number\n symbol_name?: string\n port_arrangement?: SchematicPortArrangement\n port_labels?: Record<string, string>\n symbol_display_value?: string\n}\n\nexport const schematic_component_port_arrangement_by_size = z.object({\n left_size: z.number(),\n right_size: z.number(),\n top_size: z.number().optional(),\n bottom_size: z.number().optional(),\n})\n\nexpectTypesMatch<\n SchematicPortArrangementBySize,\n z.infer<typeof schematic_component_port_arrangement_by_size>\n>(true)\n\nexport const schematic_component_port_arrangement_by_sides = z.object({\n left_side: z\n .object({\n pins: z.array(z.number()),\n direction: z.enum([\"top-to-bottom\", \"bottom-to-top\"]).optional(),\n })\n .optional(),\n right_side: z\n .object({\n pins: z.array(z.number()),\n direction: z.enum([\"top-to-bottom\", \"bottom-to-top\"]).optional(),\n })\n .optional(),\n top_side: z\n .object({\n pins: z.array(z.number()),\n direction: z.enum([\"left-to-right\", \"right-to-left\"]).optional(),\n })\n .optional(),\n bottom_side: z\n .object({\n pins: z.array(z.number()),\n direction: z.enum([\"left-to-right\", \"right-to-left\"]).optional(),\n })\n .optional(),\n})\n\nexpectTypesMatch<\n SchematicPortArrangementBySides,\n z.infer<typeof schematic_component_port_arrangement_by_sides>\n>(true)\n\nexport const port_arrangement = z.union([\n schematic_component_port_arrangement_by_size,\n schematic_component_port_arrangement_by_sides,\n])\n\nexport const schematic_component = z.object({\n type: z.literal(\"schematic_component\"),\n rotation: rotation.default(0),\n size,\n center: point,\n source_component_id: z.string(),\n schematic_component_id: z.string(),\n pin_spacing: length.optional(),\n pin_styles: schematic_pin_styles.optional(),\n box_width: length.optional(),\n symbol_name: z.string().optional(),\n port_arrangement: port_arrangement.optional(),\n port_labels: z.record(z.string()).optional(),\n symbol_display_value: z.string().optional(),\n})\n\nexport type SchematicComponentInput = z.input<typeof schematic_component>\ntype InferredSchematicComponent = z.infer<typeof schematic_component>\n\nexpectTypesMatch<SchematicComponent, InferredSchematicComponent>(true)\n","import type { TypeEqual } from \"ts-expect\"\n\nexport const expectTypesMatch = <const T1, const T2>(\n shouldBe: TypeEqual<T1, T2>,\n): void => {}\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\n\nexport const schematic_line = z.object({\n type: z.literal(\"schematic_line\"),\n schematic_component_id: z.string(),\n x1: distance,\n x2: distance,\n y1: distance,\n y2: distance,\n})\n\nexport type SchematicLineInput = z.input<typeof schematic_line>\nexport type SchematicLine = z.infer<typeof schematic_line>\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\n\nexport const schematic_trace = z.object({\n type: z.literal(\"schematic_trace\"),\n schematic_trace_id: z.string(),\n source_trace_id: z.string(),\n edges: z.array(\n z.object({\n from: z.object({\n x: z.number(),\n y: z.number(),\n }),\n to: z.object({\n x: z.number(),\n y: z.number(),\n }),\n from_schematic_port_id: z.string().optional(),\n to_schematic_port_id: z.string().optional(),\n }),\n ),\n})\n\nexport type SchematicTraceInput = z.input<typeof schematic_trace>\nexport type SchematicTrace = z.infer<typeof schematic_trace>\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\n\nexport const schematic_text = z.object({\n type: z.literal(\"schematic_text\"),\n schematic_component_id: z.string(),\n schematic_text_id: z.string(),\n text: z.string(),\n position: z.object({\n x: distance,\n y: distance,\n }),\n rotation: z.number().default(0),\n anchor: z\n .enum([\"center\", \"left\", \"right\", \"top\", \"bottom\"])\n .default(\"center\"),\n color: z.string().default(\"#000000\"),\n})\n\nexport type SchematicTextInput = z.input<typeof schematic_text>\nexport type SchematicText = z.infer<typeof schematic_text>\n","import { z } from \"zod\"\nimport { point, type Point } from \"../common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport interface SchematicPort {\n type: \"schematic_port\"\n schematic_port_id: string\n source_port_id: string\n schematic_component_id?: string\n center: Point\n facing_direction?: \"up\" | \"down\" | \"left\" | \"right\"\n distance_from_component_edge?: number\n side_of_component?: \"top\" | \"bottom\" | \"left\" | \"right\"\n true_ccw_index?: number\n pin_number?: number\n display_pin_label?: string\n}\n\nexport const schematic_port = z\n .object({\n type: z.literal(\"schematic_port\"),\n schematic_port_id: z.string(),\n source_port_id: z.string(),\n schematic_component_id: z.string().optional(),\n center: point,\n facing_direction: z.enum([\"up\", \"down\", \"left\", \"right\"]).optional(),\n distance_from_component_edge: z.number().optional(),\n side_of_component: z.enum([\"top\", \"bottom\", \"left\", \"right\"]).optional(),\n true_ccw_index: z.number().optional(),\n pin_number: z.number().optional(),\n display_pin_label: z.string().optional(),\n })\n .describe(\"Defines a port on a schematic component\")\n\nexport type SchematicPortInput = z.input<typeof schematic_port>\ntype InferredSchematicPort = z.infer<typeof schematic_port>\n\nexpectTypesMatch<SchematicPort, InferredSchematicPort>(true)\n","import { z } from \"zod\"\nimport { point } from \"../common/point\"\n\nexport const schematic_net_label = z.object({\n type: z.literal(\"schematic_net_label\"),\n source_net_id: z.string(),\n center: point,\n anchor_side: z.enum([\"top\", \"bottom\", \"left\", \"right\"]),\n text: z.string(),\n})\n\nexport type SchematicNetLabelInput = z.input<typeof schematic_net_label>\nexport type SchematicNetLabel = z.infer<typeof schematic_net_label>\n","import { z } from \"zod\"\n\nexport const schematic_error = z\n .object({\n schematic_error_id: z.string(),\n type: z.literal(\"schematic_error\"),\n // eventually each error type should be broken out into a dir of files\n error_type: z.literal(\"schematic_port_not_found\"),\n message: z.string(),\n })\n .describe(\"Defines a schematic error on the schematic\")\n\nexport type SchematicErrorInput = z.input<typeof schematic_error>\nexport type SchematicError = z.infer<typeof schematic_error>\n","import { z } from \"zod\"\nimport { point } from \"../common/point\"\nimport { size } from \"../common/size\"\n\nexport const schematic_debug_object_base = z.object({\n type: z.literal(\"schematic_debug_object\"),\n label: z.string().optional(),\n})\n\nexport const schematic_debug_rect = schematic_debug_object_base.extend({\n shape: z.literal(\"rect\"),\n center: point,\n size: size,\n})\n\nexport const schematic_debug_line = schematic_debug_object_base.extend({\n shape: z.literal(\"line\"),\n start: point,\n end: point,\n})\n\nexport const schematic_debug_point = schematic_debug_object_base.extend({\n shape: z.literal(\"point\"),\n center: point,\n})\n\nexport const schematic_debug_object = z.discriminatedUnion(\"shape\", [\n schematic_debug_rect,\n schematic_debug_line,\n schematic_debug_point,\n])\n\nexport type SchematicDebugObject = z.infer<typeof schematic_debug_object>\nexport type SchematicDebugRect = z.infer<typeof schematic_debug_rect>\nexport type SchematicDebugLine = z.infer<typeof schematic_debug_line>\nexport type SchematicDebugObjectInput = z.input<typeof schematic_debug_object>\n","import { z } from \"zod\"\n\nexport const all_layers = [\n \"top\",\n \"bottom\",\n \"inner1\",\n \"inner2\",\n \"inner3\",\n \"inner4\",\n \"inner5\",\n \"inner6\",\n] as const\n\nexport const layer_string = z.enum(all_layers)\n\nexport const layer_ref = layer_string\n .or(\n z.object({\n name: layer_string,\n }),\n )\n .transform((layer) => {\n if (typeof layer === \"string\") {\n return layer\n }\n return layer.name\n })\n\nexport type LayerRefInput = z.input<typeof layer_ref>\nexport type LayerRef = z.output<typeof layer_ref>\n\nexport const visible_layer = z.enum([\"top\", \"bottom\"])\nexport type VisibleLayerRef = z.infer<typeof visible_layer>\nexport type VisibleLayer = z.infer<typeof visible_layer>\n","import { z } from \"zod\"\nimport { distance } from \"src/units\"\nimport { layer_ref } from \"./layer_ref\"\n\n// x: string | number\n// y: string | number\n// via?: boolean\n// via_to_layer?: string\nexport const pcb_route_hint = z.object({\n x: distance,\n y: distance,\n via: z.boolean().optional(),\n via_to_layer: layer_ref.optional(),\n})\nexport const pcb_route_hints = z.array(pcb_route_hint)\n\nexport type PcbRouteHintInput = z.input<typeof pcb_route_hint>\nexport type PcbRouteHintsInput = z.input<typeof pcb_route_hints>\nexport type PcbRouteHint = z.output<typeof pcb_route_hint>\nexport type PcbRouteHints = z.output<typeof pcb_route_hints>\n","import { z } from \"zod\"\nimport { distance } from \"../../units\"\nimport { layer_ref } from \"./layer_ref\"\n\nexport const route_hint_point = z.object({\n x: distance,\n y: distance,\n via: z.boolean().optional(),\n to_layer: layer_ref.optional(),\n trace_width: distance.optional(),\n})\n\nexport type RouteHintPoint = z.infer<typeof route_hint_point>\nexport type RouteHintPointInput = z.input<typeof route_hint_point>\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { rotation, length, type Rotation, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_component = z\n .object({\n type: z.literal(\"pcb_component\"),\n pcb_component_id: getZodPrefixedIdWithDefault(\"pcb_component\"),\n source_component_id: z.string(),\n center: point,\n layer: layer_ref,\n rotation: rotation,\n width: length,\n height: length,\n })\n .describe(\"Defines a component on the PCB\")\n\nexport type PcbComponentInput = z.input<typeof pcb_component>\ntype InferredPcbComponent = z.infer<typeof pcb_component>\n\n/**\n * Defines a component on the PCB\n */\nexport interface PcbComponent {\n type: \"pcb_component\"\n pcb_component_id: string\n source_component_id: string\n center: Point\n layer: LayerRef\n rotation: Rotation\n width: Length\n height: Length\n}\n\n/**\n * @deprecated use PcbComponent\n */\nexport type PCBComponent = PcbComponent\n\nexpectTypesMatch<PcbComponent, InferredPcbComponent>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { distance, type Distance } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nconst pcb_hole_circle_or_square = z.object({\n type: z.literal(\"pcb_hole\"),\n pcb_hole_id: getZodPrefixedIdWithDefault(\"pcb_hole\"),\n hole_shape: z.enum([\"circle\", \"square\"]),\n hole_diameter: z.number(),\n x: distance,\n y: distance,\n})\n\nexport const pcb_hole_circle_or_square_shape =\n pcb_hole_circle_or_square.describe(\n \"Defines a circular or square hole on the PCB\",\n )\n\nexport type PcbHoleCircleOrSquareInput = z.input<\n typeof pcb_hole_circle_or_square\n>\ntype InferredPcbHoleCircleOrSquare = z.infer<typeof pcb_hole_circle_or_square>\n\n/**\n * Defines a circular or square hole on the PCB\n */\nexport interface PcbHoleCircleOrSquare {\n type: \"pcb_hole\"\n pcb_hole_id: string\n hole_shape: \"circle\" | \"square\"\n hole_diameter: number\n x: Distance\n y: Distance\n}\n\nexpectTypesMatch<PcbHoleCircleOrSquare, InferredPcbHoleCircleOrSquare>(true)\n\nconst pcb_hole_oval = z.object({\n type: z.literal(\"pcb_hole\"),\n pcb_hole_id: getZodPrefixedIdWithDefault(\"pcb_hole\"),\n hole_shape: z.literal(\"oval\"),\n hole_width: z.number(),\n hole_height: z.number(),\n x: distance,\n y: distance,\n})\n\nexport const pcb_hole_oval_shape = pcb_hole_oval.describe(\n \"Defines an oval hole on the PCB\",\n)\n\nexport type PcbHoleOvalInput = z.input<typeof pcb_hole_oval>\ntype InferredPcbHoleOval = z.infer<typeof pcb_hole_oval>\n\n/**\n * Defines an oval hole on the PCB\n */\nexport interface PcbHoleOval {\n type: \"pcb_hole\"\n pcb_hole_id: string\n hole_shape: \"oval\"\n hole_width: number\n hole_height: number\n x: Distance\n y: Distance\n}\n\nexpectTypesMatch<PcbHoleOval, InferredPcbHoleOval>(true)\n\nexport const pcb_hole = pcb_hole_circle_or_square.or(pcb_hole_oval)\n\n/**\n * @deprecated Use PcbHoleCircleOrSquare or PcbHoleOval\n */\nexport type PCBHoleInput = z.input<typeof pcb_hole>\n/**\n * @deprecated Use PcbHoleCircleOrSquare or PcbHoleOval\n */\nexport type PCBHole = z.infer<typeof pcb_hole>\n\nexport type PcbHole = PcbHoleCircleOrSquare | PcbHoleOval\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"src/units\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nconst pcb_plated_hole_circle = z.object({\n type: z.literal(\"pcb_plated_hole\"),\n shape: z.literal(\"circle\"),\n outer_diameter: z.number(),\n hole_diameter: z.number(),\n x: distance,\n y: distance,\n layers: z.array(layer_ref),\n port_hints: z.array(z.string()).optional(),\n pcb_component_id: z.string().optional(),\n pcb_port_id: z.string().optional(),\n pcb_plated_hole_id: getZodPrefixedIdWithDefault(\"pcb_plated_hole\"),\n})\n\n/**\n * Defines a circular plated hole on the PCB\n */\nexport interface PcbPlatedHoleCircle {\n type: \"pcb_plated_hole\"\n shape: \"circle\"\n outer_diameter: number\n hole_diameter: number\n x: Distance\n y: Distance\n layers: LayerRef[]\n port_hints?: string[]\n pcb_component_id?: string\n pcb_port_id?: string\n pcb_plated_hole_id: string\n}\n\nconst pcb_plated_hole_oval = z.object({\n type: z.literal(\"pcb_plated_hole\"),\n shape: z.enum([\"oval\", \"pill\"]),\n outer_width: z.number(),\n outer_height: z.number(),\n hole_width: z.number(),\n hole_height: z.number(),\n x: distance,\n y: distance,\n layers: z.array(layer_ref),\n port_hints: z.array(z.string()).optional(),\n pcb_component_id: z.string().optional(),\n pcb_port_id: z.string().optional(),\n pcb_plated_hole_id: getZodPrefixedIdWithDefault(\"pcb_plated_hole\"),\n})\n\n/**\n * Defines an oval or pill-shaped plated hole on the PCB\n */\nexport interface PcbPlatedHoleOval {\n type: \"pcb_plated_hole\"\n shape: \"oval\" | \"pill\"\n outer_width: number\n outer_height: number\n hole_width: number\n hole_height: number\n x: Distance\n y: Distance\n layers: LayerRef[]\n port_hints?: string[]\n pcb_component_id?: string\n pcb_port_id?: string\n pcb_plated_hole_id: string\n}\n\nexport const pcb_plated_hole = z.union([\n pcb_plated_hole_circle,\n pcb_plated_hole_oval,\n])\nexport type PcbPlatedHole = PcbPlatedHoleCircle | PcbPlatedHoleOval\n\nexpectTypesMatch<PcbPlatedHoleCircle, z.infer<typeof pcb_plated_hole_circle>>(\n true,\n)\nexpectTypesMatch<PcbPlatedHoleOval, z.infer<typeof pcb_plated_hole_oval>>(true)\n\n/**\n * @deprecated use PcbPlatedHole\n */\nexport type PCBPlatedHole = PcbPlatedHole\n\n/**\n * @deprecated use PcbPlatedHoleInput\n */\nexport type PCBPlatedHoleInput = z.input<typeof pcb_plated_hole>\nexport type PcbPlatedHoleInput = z.input<typeof pcb_plated_hole>\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { distance, type Distance } from \"src/units\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_port = z\n .object({\n type: z.literal(\"pcb_port\"),\n pcb_port_id: getZodPrefixedIdWithDefault(\"pcb_port\"),\n source_port_id: z.string(),\n pcb_component_id: z.string(),\n x: distance,\n y: distance,\n layers: z.array(layer_ref),\n })\n .describe(\"Defines a port on the PCB\")\n\nexport type PcbPortInput = z.input<typeof pcb_port>\ntype InferredPcbPort = z.infer<typeof pcb_port>\n\n/**\n * Defines a port on the PCB\n */\nexport interface PcbPort {\n type: \"pcb_port\"\n pcb_port_id: string\n source_port_id: string\n pcb_component_id: string\n x: Distance\n y: Distance\n layers: LayerRef[]\n}\n\n/**\n * @deprecated use PcbPort\n */\nexport type PCBPort = PcbPort\n\n/**\n * @deprecated use PcbPortInput\n */\nexport type PCBPortInput = PcbPortInput\n\nexpectTypesMatch<PcbPort, InferredPcbPort>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"src/units\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nconst pcb_smtpad_circle = z.object({\n type: z.literal(\"pcb_smtpad\"),\n shape: z.literal(\"circle\"),\n pcb_smtpad_id: getZodPrefixedIdWithDefault(\"pcb_smtpad\"),\n x: distance,\n y: distance,\n radius: z.number(),\n layer: layer_ref,\n port_hints: z.array(z.string()).optional(),\n pcb_component_id: z.string().optional(),\n pcb_port_id: z.string().optional(),\n})\n\nconst pcb_smtpad_rect = z.object({\n type: z.literal(\"pcb_smtpad\"),\n shape: z.literal(\"rect\"),\n pcb_smtpad_id: getZodPrefixedIdWithDefault(\"pcb_smtpad\"),\n x: distance,\n y: distance,\n width: z.number(),\n height: z.number(),\n layer: layer_ref,\n port_hints: z.array(z.string()).optional(),\n pcb_component_id: z.string().optional(),\n pcb_port_id: z.string().optional(),\n})\n\nexport const pcb_smtpad = z\n .union([pcb_smtpad_circle, pcb_smtpad_rect])\n .describe(\"Defines an SMT pad on the PCB\")\n\nexport type PCBSMTPadInput = z.input<typeof pcb_smtpad>\ntype PCBSMTPadCircle = z.infer<typeof pcb_smtpad_circle>\ntype PCBSMTPadRect = z.infer<typeof pcb_smtpad_rect>\n\n/**\n * Defines an SMT pad on the PCB\n */\nexport interface PcbSmtPadCircle {\n type: \"pcb_smtpad\"\n shape: \"circle\"\n pcb_smtpad_id: string\n x: Distance\n y: Distance\n radius: number\n layer: LayerRef\n port_hints?: string[]\n pcb_component_id?: string\n pcb_port_id?: string\n}\n\n/**\n * Defines an SMT pad on the PCB\n */\nexport interface PcbSmtPadRect {\n type: \"pcb_smtpad\"\n shape: \"rect\"\n pcb_smtpad_id: string\n x: Distance\n y: Distance\n width: number\n height: number\n layer: LayerRef\n port_hints?: string[]\n pcb_component_id?: string\n pcb_port_id?: string\n}\n\nexport type PcbSmtPad = PcbSmtPadCircle | PcbSmtPadRect\n\n/**\n * @deprecated use PcbSmtPad\n */\nexport type PCBSMTPad = PcbSmtPad\n\nexpectTypesMatch<PcbSmtPadCircle, PCBSMTPadCircle>(true)\nexpectTypesMatch<PcbSmtPadRect, PCBSMTPadRect>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"src/units\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nconst pcb_solder_paste_circle = z.object({\n type: z.literal(\"pcb_solder_paste\"),\n shape: z.literal(\"circle\"),\n pcb_solder_paste_id: getZodPrefixedIdWithDefault(\"pcb_solder_paste\"),\n x: distance,\n y: distance,\n radius: z.number(),\n layer: layer_ref,\n pcb_component_id: z.string().optional(),\n pcb_smtpad_id: z.string().optional(),\n})\n\nconst pcb_solder_paste_rect = z.object({\n type: z.literal(\"pcb_solder_paste\"),\n shape: z.literal(\"rect\"),\n pcb_solder_paste_id: getZodPrefixedIdWithDefault(\"pcb_solder_paste\"),\n x: distance,\n y: distance,\n width: z.number(),\n height: z.number(),\n layer: layer_ref,\n pcb_component_id: z.string().optional(),\n pcb_smtpad_id: z.string().optional(),\n})\n\nexport const pcb_solder_paste = z\n .union([pcb_solder_paste_circle, pcb_solder_paste_rect])\n .describe(\"Defines solderpaste on the PCB\")\n\nexport type PCBSolderPasteInput = z.input<typeof pcb_solder_paste>\ntype InferredPcbSolderPasteCircle = z.infer<typeof pcb_solder_paste_circle>\ntype InferredPcbSolderPasteRect = z.infer<typeof pcb_solder_paste_rect>\n\n/**\n * Defines solderpaste on the PCB\n */\nexport interface PcbSolderPasteCircle {\n type: \"pcb_solder_paste\"\n shape: \"circle\"\n pcb_solder_paste_id: string\n x: Distance\n y: Distance\n radius: number\n layer: LayerRef\n pcb_component_id?: string\n pcb_smtpad_id?: string\n}\n\n/**\n * Defines solderpaste on the PCB\n */\nexport interface PcbSolderPasteRect {\n type: \"pcb_solder_paste\"\n shape: \"rect\"\n pcb_solder_paste_id: string\n x: Distance\n y: Distance\n width: number\n height: number\n layer: LayerRef\n pcb_component_id?: string\n pcb_smtpad_id?: string\n}\n\nexport type PcbSolderPaste = PcbSolderPasteCircle | PcbSolderPasteRect\n\nexpectTypesMatch<PcbSolderPasteCircle, InferredPcbSolderPasteCircle>(true)\nexpectTypesMatch<PcbSolderPasteRect, InferredPcbSolderPasteRect>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_text = z\n .object({\n type: z.literal(\"pcb_text\"),\n pcb_text_id: getZodPrefixedIdWithDefault(\"pcb_text\"),\n text: z.string(),\n center: point,\n layer: layer_ref,\n width: length,\n height: length,\n lines: z.number(),\n align: z.enum([\"bottom-left\"]),\n })\n .describe(\"Defines text on the PCB\")\n\nexport type PcbTextInput = z.input<typeof pcb_text>\ntype InferredPcbText = z.infer<typeof pcb_text>\n\n/**\n * Defines text on the PCB\n */\nexport interface PcbText {\n type: \"pcb_text\"\n pcb_text_id: string\n text: string\n center: Point\n layer: LayerRef\n width: Length\n height: Length\n lines: number\n align: \"bottom-left\"\n}\n\n/**\n * @deprecated use PcbText\n */\nexport type PCBText = PcbText\n\nexpectTypesMatch<PcbText, InferredPcbText>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { distance, type Distance } from \"src/units\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_trace_route_point_wire = z.object({\n route_type: z.literal(\"wire\"),\n x: distance,\n y: distance,\n width: distance,\n start_pcb_port_id: z.string().optional(),\n end_pcb_port_id: z.string().optional(),\n layer: layer_ref,\n})\n\nexport const pcb_trace_route_point_via = z.object({\n route_type: z.literal(\"via\"),\n x: distance,\n y: distance,\n from_layer: z.string(),\n to_layer: z.string(),\n})\n\nexport const pcb_trace_route_point = z.union([\n pcb_trace_route_point_wire,\n pcb_trace_route_point_via,\n])\ntype InferredPcbTraceRoutePoint = z.infer<typeof pcb_trace_route_point>\n\nexport const pcb_trace = z\n .object({\n type: z.literal(\"pcb_trace\"),\n source_trace_id: z.string().optional(),\n pcb_component_id: z.string().optional(),\n pcb_trace_id: getZodPrefixedIdWithDefault(\"pcb_trace\"),\n route_thickness_mode: z\n .enum([\"constant\", \"interpolated\"])\n .default(\"constant\")\n .optional(),\n route_order_index: z.number().optional(),\n should_round_corners: z.boolean().optional(),\n route: z.array(\n z.union([\n z.object({\n route_type: z.literal(\"wire\"),\n x: distance,\n y: distance,\n width: distance,\n start_pcb_port_id: z.string().optional(),\n end_pcb_port_id: z.string().optional(),\n layer: layer_ref,\n }),\n z.object({\n route_type: z.literal(\"via\"),\n x: distance,\n y: distance,\n from_layer: z.string(),\n to_layer: z.string(),\n }),\n ]),\n ),\n })\n .describe(\"Defines a trace on the PCB\")\n\nexport type PcbTraceInput = z.input<typeof pcb_trace>\ntype InferredPcbTrace = z.infer<typeof pcb_trace>\n\nexport interface PcbTraceRoutePointWire {\n route_type: \"wire\"\n x: Distance\n y: Distance\n width: Distance\n start_pcb_port_id?: string\n end_pcb_port_id?: string\n layer: LayerRef\n}\n\nexport interface PcbTraceRoutePointVia {\n route_type: \"via\"\n x: Distance\n y: Distance\n from_layer: string\n to_layer: string\n}\n\nexport type PcbTraceRoutePoint = PcbTraceRoutePointWire | PcbTraceRoutePointVia\n\n/**\n * Defines a trace on the PCB\n */\nexport interface PcbTrace {\n type: \"pcb_trace\"\n source_trace_id?: string\n pcb_component_id?: string\n pcb_trace_id: string\n /**\n * The order that this trace was routed in. This can be used to debug the\n * autorouter and to understand the trace path better\n *\n * The route_order_index should be relative to a subcircuit\n */\n route_order_index?: number\n route_thickness_mode?: \"constant\" | \"interpolated\"\n should_round_corners?: boolean\n route: Array<PcbTraceRoutePoint>\n}\n\n/**\n * @deprecated use PcbTrace\n */\nexport type PCBTrace = PcbTrace\n\n/**\n * @deprecated use PcbTraceInput\n */\nexport type PCBTraceInput = PcbTraceInput\n\nexpectTypesMatch<PcbTraceRoutePoint, InferredPcbTraceRoutePoint>(true)\nexpectTypesMatch<PcbTrace, InferredPcbTrace>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_trace_error = z\n .object({\n type: z.literal(\"pcb_trace_error\"),\n pcb_trace_error_id: getZodPrefixedIdWithDefault(\"pcb_trace_error\"),\n error_type: z.literal(\"pcb_trace_error\"),\n message: z.string(),\n center: point.optional(),\n pcb_trace_id: z.string(),\n source_trace_id: z.string(),\n pcb_component_ids: z.array(z.string()),\n pcb_port_ids: z.array(z.string()),\n })\n .describe(\"Defines a trace error on the PCB\")\n\nexport type PcbTraceErrorInput = z.input<typeof pcb_trace_error>\ntype InferredPcbTraceError = z.infer<typeof pcb_trace_error>\n\n/**\n * Defines a trace error on the PCB\n */\nexport interface PcbTraceError {\n type: \"pcb_trace_error\"\n pcb_trace_error_id: string\n error_type: \"pcb_trace_error\"\n message: string\n center?: Point\n pcb_trace_id: string\n source_trace_id: string\n pcb_component_ids: string[]\n pcb_port_ids: string[]\n}\n\n/**\n * @deprecated use PcbTraceError\n */\nexport type PCBTraceError = PcbTraceError\n\nexpectTypesMatch<PcbTraceError, InferredPcbTraceError>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_port_not_matched_error = z\n .object({\n type: z.literal(\"pcb_port_not_matched_error\"),\n pcb_error_id: getZodPrefixedIdWithDefault(\"pcb_error\"),\n message: z.string(),\n pcb_component_ids: z.array(z.string()),\n })\n .describe(\"Defines a trace error on the PCB where a port is not matched\")\n\nexport type PcbPortNotMatchedErrorInput = z.input<\n typeof pcb_port_not_matched_error\n>\ntype InferredPcbPortNotMatchedError = z.infer<typeof pcb_port_not_matched_error>\n\n/**\n * Defines a trace error on the PCB where a port is not matched\n */\nexport interface PcbPortNotMatchedError {\n type: \"pcb_port_not_matched_error\"\n pcb_error_id: string\n message: string\n pcb_component_ids: string[]\n}\n\n/**\n * @deprecated use PcbPortNotMatchedError\n */\nexport type PCBPortNotMatchedError = PcbPortNotMatchedError\n\nexpectTypesMatch<PcbPortNotMatchedError, InferredPcbPortNotMatchedError>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"src/units\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_via = z\n .object({\n type: z.literal(\"pcb_via\"),\n pcb_via_id: getZodPrefixedIdWithDefault(\"pcb_via\"),\n x: distance,\n y: distance,\n outer_diameter: distance.default(\"0.6mm\"),\n hole_diameter: distance.default(\"0.25mm\"),\n /** @deprecated */\n from_layer: layer_ref.optional(),\n /** @deprecated */\n to_layer: layer_ref.optional(),\n layers: z.array(layer_ref),\n pcb_trace_id: z.string().optional(),\n })\n .describe(\"Defines a via on the PCB\")\n\nexport type PcbViaInput = z.input<typeof pcb_via>\ntype InferredPcbVia = z.infer<typeof pcb_via>\n\n/**\n * Defines a via on the PCB\n */\nexport interface PcbVia {\n type: \"pcb_via\"\n pcb_via_id: string\n x: Distance\n y: Distance\n outer_diameter: Distance\n hole_diameter: Distance\n /** @deprecated */\n from_layer?: LayerRef\n /** @deprecated */\n to_layer?: LayerRef\n layers: LayerRef[]\n pcb_trace_id?: string\n}\n\n/**\n * @deprecated use PcbVia\n */\nexport type PCBVia = PcbVia\n\nexpectTypesMatch<PcbVia, InferredPcbVia>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_board = z\n .object({\n type: z.literal(\"pcb_board\"),\n pcb_board_id: getZodPrefixedIdWithDefault(\"pcb_board\"),\n width: length,\n height: length,\n center: point,\n thickness: length.optional().default(1.4),\n num_layers: z.number().optional().default(4),\n outline: z.array(point).optional(),\n })\n .describe(\"Defines the board outline of the PCB\")\n\n/**\n * Defines the board outline of the PCB\n */\nexport interface PcbBoard {\n type: \"pcb_board\"\n pcb_board_id: string\n width: Length\n height: Length\n thickness: Length\n num_layers: number\n center: Point\n outline?: Point[]\n}\n\nexport type PcbBoardInput = z.input<typeof pcb_board>\ntype InferredPcbBoard = z.infer<typeof pcb_board>\n\n/**\n * @deprecated use PcbBoard\n */\nexport type PCBBoard = PcbBoard\n\nexpectTypesMatch<PcbBoard, InferredPcbBoard>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_placement_error = z\n .object({\n type: z.literal(\"pcb_placement_error\"),\n pcb_placement_error_id: getZodPrefixedIdWithDefault(\"pcb_placement_error\"),\n message: z.string(),\n })\n .describe(\"Defines a placement error on the PCB\")\n\nexport type PcbPlacementErrorInput = z.input<typeof pcb_placement_error>\ntype InferredPcbPlacementError = z.infer<typeof pcb_placement_error>\n\n/**\n * Defines a placement error on the PCB\n */\nexport interface PcbPlacementError {\n type: \"pcb_placement_error\"\n pcb_placement_error_id: string\n message: string\n}\n\n/**\n * @deprecated use PcbPlacementError\n */\nexport type PCBPlacementError = PcbPlacementError\n\nexpectTypesMatch<PcbPlacementError, InferredPcbPlacementError>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { route_hint_point, type RouteHintPoint } from \"src/pcb\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\n/**\n * A hint that can be used during generation of a PCB trace.\n */\nexport interface PcbTraceHint {\n type: \"pcb_trace_hint\"\n pcb_trace_hint_id: string\n pcb_port_id: string\n pcb_component_id: string\n route: RouteHintPoint[]\n}\n\nexport const pcb_trace_hint = z\n .object({\n type: z.literal(\"pcb_trace_hint\"),\n pcb_trace_hint_id: getZodPrefixedIdWithDefault(\"pcb_trace_hint\"),\n pcb_port_id: z.string(),\n pcb_component_id: z.string(),\n route: z.array(route_hint_point),\n })\n .describe(\"A hint that can be used during generation of a PCB trace\")\n\nexport type PcbTraceHintInput = z.input<typeof pcb_trace_hint>\ntype InferredPcbTraceHint = z.infer<typeof pcb_trace_hint>\n\n/**\n * @deprecated use PcbTraceHint\n */\nexport type PCBTraceHint = PcbTraceHint\n\nexpectTypesMatch<PcbTraceHint, InferredPcbTraceHint>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"src/units\"\nimport {\n layer_ref,\n type LayerRef,\n type VisibleLayer,\n visible_layer,\n} from \"src/pcb/properties/layer_ref\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_line = z\n .object({\n type: z.literal(\"pcb_silkscreen_line\"),\n pcb_silkscreen_line_id: getZodPrefixedIdWithDefault(\"pcb_silkscreen_line\"),\n pcb_component_id: z.string(),\n stroke_width: distance.default(\"0.1mm\"),\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n layer: visible_layer,\n })\n .describe(\"Defines a silkscreen line on the PCB\")\n\nexport type PcbSilkscreenLineInput = z.input<typeof pcb_silkscreen_line>\ntype InferredPcbSilkscreenLine = z.infer<typeof pcb_silkscreen_line>\n\n/**\n * Defines a silkscreen line on the PCB\n */\nexport interface PcbSilkscreenLine {\n type: \"pcb_silkscreen_line\"\n pcb_silkscreen_line_id: string\n pcb_component_id: string\n stroke_width: Distance\n x1: Distance\n y1: Distance\n x2: Distance\n y2: Distance\n layer: VisibleLayer\n}\n\n/**\n * @deprecated use PcbSilkscreenLine\n */\nexport type PCBSilkscreenLine = PcbSilkscreenLine\n\nexpectTypesMatch<PcbSilkscreenLine, InferredPcbSilkscreenLine>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport {\n visible_layer,\n type VisibleLayerRef,\n} from \"src/pcb/properties/layer_ref\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_path = z\n .object({\n type: z.literal(\"pcb_silkscreen_path\"),\n pcb_silkscreen_path_id: getZodPrefixedIdWithDefault(\"pcb_silkscreen_path\"),\n pcb_component_id: z.string(),\n layer: visible_layer,\n route: z.array(point),\n stroke_width: length,\n })\n .describe(\"Defines a silkscreen path on the PCB\")\n\nexport type PcbSilkscreenPathInput = z.input<typeof pcb_silkscreen_path>\ntype InferredPcbSilkscreenPath = z.infer<typeof pcb_silkscreen_path>\n\n/**\n * Defines a silkscreen path on the PCB\n */\nexport interface PcbSilkscreenPath {\n type: \"pcb_silkscreen_path\"\n pcb_silkscreen_path_id: string\n pcb_component_id: string\n layer: VisibleLayerRef\n route: Point[]\n stroke_width: Length\n}\n\n/**\n * @deprecated use PcbSilkscreenPath\n */\nexport type PcbSilkscreenPathDeprecated = PcbSilkscreenPath\n\nexpectTypesMatch<PcbSilkscreenPath, InferredPcbSilkscreenPath>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { distance, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_text = z\n .object({\n type: z.literal(\"pcb_silkscreen_text\"),\n pcb_silkscreen_text_id: getZodPrefixedIdWithDefault(\"pcb_silkscreen_text\"),\n font: z.literal(\"tscircuit2024\").default(\"tscircuit2024\"),\n font_size: distance.default(\"0.2mm\"),\n pcb_component_id: z.string(),\n text: z.string(),\n layer: layer_ref,\n is_mirrored: z.boolean().default(false).optional(),\n anchor_position: point.default({ x: 0, y: 0 }),\n anchor_alignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n })\n .describe(\"Defines silkscreen text on the PCB\")\n\nexport type PcbSilkscreenTextInput = z.input<typeof pcb_silkscreen_text>\ntype InferredPcbSilkscreenText = z.infer<typeof pcb_silkscreen_text>\n\n/**\n * Defines silkscreen text on the PCB\n */\nexport interface PcbSilkscreenText {\n type: \"pcb_silkscreen_text\"\n pcb_silkscreen_text_id: string\n font: \"tscircuit2024\"\n font_size: Length\n pcb_component_id: string\n text: string\n layer: LayerRef\n is_mirrored?: boolean\n anchor_position: Point\n anchor_alignment:\n | \"center\"\n | \"top_left\"\n | \"top_right\"\n | \"bottom_left\"\n | \"bottom_right\"\n}\n\n/**\n * @deprecated use PcbSilkscreenText\n */\nexport type PCBSilkscreenText = PcbSilkscreenText\n\nexpectTypesMatch<PcbSilkscreenText, InferredPcbSilkscreenText>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_rect = z\n .object({\n type: z.literal(\"pcb_silkscreen_rect\"),\n pcb_silkscreen_rect_id: getZodPrefixedIdWithDefault(\"pcb_silkscreen_rect\"),\n pcb_component_id: z.string(),\n center: point,\n width: length,\n height: length,\n layer: layer_ref,\n })\n .describe(\"Defines a silkscreen rect on the PCB\")\n\nexport type PcbSilkscreenRectInput = z.input<typeof pcb_silkscreen_rect>\ntype InferredPcbSilkscreenRect = z.infer<typeof pcb_silkscreen_rect>\n\n/**\n * Defines a silkscreen rect on the PCB\n */\nexport interface PcbSilkscreenRect {\n type: \"pcb_silkscreen_rect\"\n pcb_silkscreen_rect_id: string\n pcb_component_id: string\n center: Point\n width: Length\n height: Length\n layer: LayerRef\n}\n\n/**\n * @deprecated use PcbSilkscreenRect\n */\nexport type PcbSilkscreenRectOld = PcbSilkscreenRect\n\nexpectTypesMatch<PcbSilkscreenRect, InferredPcbSilkscreenRect>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport {\n layer_ref,\n visible_layer,\n type LayerRef,\n type VisibleLayer,\n} from \"src/pcb/properties/layer_ref\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_circle = z\n .object({\n type: z.literal(\"pcb_silkscreen_circle\"),\n pcb_silkscreen_circle_id: getZodPrefixedIdWithDefault(\n \"pcb_silkscreen_circle\",\n ),\n pcb_component_id: z.string(),\n center: point,\n radius: length,\n layer: visible_layer,\n })\n .describe(\"Defines a silkscreen circle on the PCB\")\n\nexport type PcbSilkscreenCircleInput = z.input<typeof pcb_silkscreen_circle>\ntype InferredPcbSilkscreenCircle = z.infer<typeof pcb_silkscreen_circle>\n\n/**\n * Defines a silkscreen circle on the PCB\n */\nexport interface PcbSilkscreenCircle {\n type: \"pcb_silkscreen_circle\"\n pcb_silkscreen_circle_id: string\n pcb_component_id: string\n center: Point\n radius: Length\n layer: VisibleLayer\n}\n\nexpectTypesMatch<PcbSilkscreenCircle, InferredPcbSilkscreenCircle>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport {\n layer_ref,\n type LayerRef,\n visible_layer,\n type VisibleLayer,\n} from \"src/pcb/properties/layer_ref\"\nimport { distance, type Distance } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_oval = z\n .object({\n type: z.literal(\"pcb_silkscreen_oval\"),\n pcb_silkscreen_oval_id: getZodPrefixedIdWithDefault(\"pcb_silkscreen_oval\"),\n pcb_component_id: z.string(),\n center: point,\n radius_x: distance,\n radius_y: distance,\n layer: visible_layer,\n })\n .describe(\"Defines a silkscreen oval on the PCB\")\n\nexport type PcbSilkscreenOvalInput = z.input<typeof pcb_silkscreen_oval>\ntype InferredPcbSilkscreenOval = z.infer<typeof pcb_silkscreen_oval>\n\n/**\n * Defines a silkscreen oval on the PCB\n */\nexport interface PcbSilkscreenOval {\n type: \"pcb_silkscreen_oval\"\n pcb_silkscreen_oval_id: string\n pcb_component_id: string\n center: Point\n radius_x: Distance\n radius_y: Distance\n layer: VisibleLayer\n}\n\n/**\n * @deprecated use PcbSilkscreenOval\n */\nexport type PcbSilkscreenOvalDeprecated = PcbSilkscreenOval\n\nexpectTypesMatch<PcbSilkscreenOval, InferredPcbSilkscreenOval>(true)\n","import { z } from \"zod\"\nimport { point, type Point } from \"src/common\"\nimport { distance, type Length } from \"src/units\"\nimport {\n visible_layer,\n type LayerRef,\n type VisibleLayer,\n} from \"src/pcb/properties/layer_ref\"\nimport { getZodPrefixedIdWithDefault } from \"src/common/getZodPrefixedIdWithDefault\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_fabrication_note_text = z\n .object({\n type: z.literal(\"pcb_fabrication_note_text\"),\n pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(\n \"pcb_fabrication_note_text\",\n ),\n font: z.literal(\"tscircuit2024\").default(\"tscircuit2024\"),\n font_size: distance.default(\"1mm\"),\n pcb_component_id: z.string(),\n text: z.string(),\n layer: visible_layer,\n anchor_position: point.default({ x: 0, y: 0 }),\n anchor_alignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n color: z.string().optional(),\n })\n .describe(\n \"Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators\",\n )\n\nexport type PcbFabricationNoteTextInput = z.input<\n typeof pcb_fabrication_note_text\n>\ntype InferredPcbFabricationNoteText = z.infer<typeof pcb_fabrication_note_text>\n\n/**\n * Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators\n */\nexport interface PcbFabricationNoteText {\n type: \"pcb_fabrication_note_text\"\n pcb_fabrication_note_text_id: string\n font: \"tscircuit2024\"\n font_size: Length\n pcb_component_id: string\n text: string\n layer: VisibleLayer\n anchor_position: Point\n anchor_alignment:\n | \"center\"\n | \"top_left\"\n | \"top_right\"\n | \"bottom_left\"\n | \"bottom_right\"\n color?: string\n}\n\n/**\n * @deprecated use PcbFabricationNoteText\n */\nexport type PCBFabricationNoteText = PcbFabricationNoteText\n\nexpectTypesMatch<PcbFabricationNoteText, InferredPcbFabricationNoteText>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport {\n layer_ref,\n visible_layer,\n type LayerRef,\n} from \"src/pcb/properties/layer_ref\"\nimport { point, type Point } from \"src/common\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_fabrication_note_path = z\n .object({\n type: z.literal(\"pcb_fabrication_note_path\"),\n pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(\n \"pcb_fabrication_note_path\",\n ),\n pcb_component_id: z.string(),\n layer: layer_ref,\n route: z.array(point),\n stroke_width: length,\n color: z.string().optional(),\n })\n .describe(\n \"Defines a fabrication path on the PCB for fabricators or assemblers\",\n )\n\nexport type PcbFabricationNotePathInput = z.input<\n typeof pcb_fabrication_note_path\n>\ntype InferredPcbFabricationNotePath = z.infer<typeof pcb_fabrication_note_path>\n\n/**\n * Defines a fabrication path on the PCB for fabricators or assemblers\n */\nexport interface PcbFabricationNotePath {\n type: \"pcb_fabrication_note_path\"\n pcb_fabrication_note_path_id: string\n pcb_component_id: string\n layer: LayerRef\n route: Point[]\n stroke_width: Length\n color?: string\n}\n\n/**\n * @deprecated use PcbFabricationNotePath\n */\nexport type PCBFabricationNotePath = PcbFabricationNotePath\n\nexpectTypesMatch<PcbFabricationNotePath, InferredPcbFabricationNotePath>(true)\n","import { z } from \"zod\"\nimport { point } from \"../common\"\nimport { distance } from \"../units\"\n\nexport const pcb_keepout = z\n .object({\n type: z.literal(\"pcb_keepout\"),\n shape: z.literal(\"rect\"),\n center: point,\n width: distance,\n height: distance,\n pcb_keepout_id: z.string(),\n layers: z.array(z.string()), // Specify layers where the keepout applies\n description: z.string().optional(), // Optional description of the keepout\n })\n .or(\n z.object({\n type: z.literal(\"pcb_keepout\"),\n shape: z.literal(\"circle\"),\n center: point,\n radius: distance,\n pcb_keepout_id: z.string(),\n layers: z.array(z.string()), // Specify layers where the keepout applies\n description: z.string().optional(), // Optional description of the keepout\n }),\n )\n\nexport type PCBKeepoutInput = z.input<typeof pcb_keepout>\nexport type PCBKeepout = z.infer<typeof pcb_keepout>\n","import { z } from \"zod\"\nimport { point3 } from \"../common\"\nimport { rotation, length } from \"../units\"\nimport { layer_ref } from \"src/pcb\"\n\nexport const cad_component = z\n .object({\n type: z.literal(\"cad_component\"),\n cad_component_id: z.string(),\n pcb_component_id: z.string(),\n source_component_id: z.string(),\n position: point3,\n rotation: point3.optional(),\n size: point3.optional(),\n layer: layer_ref.optional(),\n\n // These are all ways to generate/load the 3d model\n footprinter_string: z.string().optional(),\n model_obj_url: z.string().optional(),\n model_stl_url: z.string().optional(),\n model_3mf_url: z.string().optional(),\n model_jscad: z.any().optional(),\n })\n .describe(\"Defines a component on the PCB\")\n\nexport type CadComponentInput = z.input<typeof cad_component>\nexport type CadComponent = z.infer<typeof cad_component>\n","import { z } from \"zod\"\nimport * as pcb from \"./pcb\"\nimport * as sch from \"./schematic\"\nimport * as src from \"./source\"\nimport * as cad from \"./cad\"\n\nexport const any_circuit_element = z.union([\n // TODO source_group\n // TODO source_config\n // TODO pcb_group\n // TODO pcb_config\n // TODO schematic_config\n // TODO schematic_group\n src.source_trace,\n src.source_port,\n src.any_source_component,\n src.source_led,\n src.source_net,\n src.source_group,\n src.source_simple_bug,\n src.source_simple_chip,\n src.source_simple_capacitor,\n src.source_simple_diode,\n src.source_simple_resistor,\n src.source_simple_power_source,\n src.source_simple_battery,\n pcb.pcb_component,\n pcb.pcb_hole,\n pcb.pcb_plated_hole,\n pcb.pcb_keepout,\n pcb.pcb_port,\n pcb.pcb_text,\n pcb.pcb_trace,\n pcb.pcb_via,\n pcb.pcb_smtpad,\n pcb.pcb_solder_paste,\n pcb.pcb_board,\n pcb.pcb_trace_hint,\n pcb.pcb_silkscreen_line,\n pcb.pcb_silkscreen_path,\n pcb.pcb_silkscreen_text,\n pcb.pcb_silkscreen_rect,\n pcb.pcb_silkscreen_circle,\n pcb.pcb_silkscreen_oval,\n pcb.pcb_trace_error,\n pcb.pcb_placement_error,\n pcb.pcb_port_not_matched_error,\n pcb.pcb_fabrication_note_path,\n pcb.pcb_fabrication_note_text,\n sch.schematic_box,\n sch.schematic_text,\n sch.schematic_line,\n sch.schematic_component,\n sch.schematic_port,\n sch.schematic_trace,\n sch.schematic_path,\n sch.schematic_error,\n sch.schematic_net_label,\n sch.schematic_debug_object,\n cad.cad_component,\n])\n\n/**\n * @deprecated use any_circuit_element instead\n */\nexport const any_soup_element = any_circuit_element\n\nexport type AnyCircuitElement = z.infer<typeof any_circuit_element>\nexport type AnyCircuitElementInput = z.input<typeof any_circuit_element>\n/**\n * @deprecated use AnyCircuitElement instead\n */\nexport type AnySoupElement = AnyCircuitElement\n\n/**\n * @deprecated use AnyCircuitElementInput instead\n */\nexport type AnySoupElementInput = AnyCircuitElementInput\n"],"mappings":";AAKA,IAAM,eAGF;AAAA,EACF,IAAI;AAAA,IACF,UAAU;AAAA,IACV,UAAU;AAAA,MACR,KAAK;AAAA,MACL,KAAK;AAAA,MACL,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,GAAG;AAAA,IACD,UAAU;AAAA,IACV,UAAU;AAAA,MACR,IAAI;AAAA,MACJ,GAAG;AAAA,IACL;AAAA,EACF;AAAA,EACA,QAAG;AAAA,IACD,UAAU;AAAA,IACV,UAAU;AAAA,MACR,SAAI;AAAA,MACJ,QAAG;AAAA,MACH,SAAI;AAAA,MACJ,SAAI;AAAA,MACJ,SAAI;AAAA,MACJ,SAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,GAAG;AAAA,IACD,UAAU;AAAA,IACV,UAAU;AAAA,MACR,IAAI;AAAA,MACJ,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,GAAG;AAAA,IACD,UAAU;AAAA,IACV,UAAU;AAAA,MACR,SAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,GAAG;AAAA,IACD,UAAU;AAAA,IACV,UAAU;AAAA,MACR,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,SAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,GAAG;AAAA,IACL;AAAA,EACF;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,UAAU;AAAA,MACR,IAAI;AAAA,MACJ,IAAI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oBA,IAAE,OAAO,EAAE,SAAS;AAAA,EACxC,eAAeA,IAAE,OAAO,EAAE,SAAS;AAAA,EACnC,eAAeA,IAAE,OAAO,EAAE,SAAS;AAAA,EACnC,eAAeA,IAAE,OAAO,EAAE,SAAS;AAAA,EACnC,aAAaA,IAAE,IAAI,EAAE,SAAS;AAChC,CAAC,EACA,SAAS,gCAAgC;;;ACvB5C,SAAS,KAAAC,WAAS;AAMX,IAAM,sBAAsBC,IAAE,MAAM;AAAA,EAOrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACN,CAAC;AAKM,IAAM,mBAAmB;","names":["z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z"]}
1
+ {"version":3,"sources":["../src/utils/convert-si-unit-to-number.ts","../src/units/index.ts","../src/common/point.ts","../src/common/point3.ts","../src/common/size.ts","../src/common/getZodPrefixedIdWithDefault.ts","../src/source/source_simple_capacitor.ts","../src/pcb/properties/supplier_name.ts","../src/source/base/source_component_base.ts","../src/source/source_simple_resistor.ts","../src/source/source_simple_diode.ts","../src/source/source_simple_ground.ts","../src/source/source_simple_bug.ts","../src/source/source_simple_chip.ts","../src/source/source_simple_inductor.ts","../src/source/source_led.ts","../src/source/source_simple_power_source.ts","../src/source/any_source_component.ts","../src/source/source_simple_battery.ts","../src/source/source_port.ts","../src/source/source_trace.ts","../src/source/source_group.ts","../src/source/source_net.ts","../src/schematic/schematic_box.ts","../src/schematic/schematic_path.ts","../src/schematic/schematic_component.ts","../src/utils/expect-types-match.ts","../src/schematic/schematic_line.ts","../src/schematic/schematic_trace.ts","../src/schematic/schematic_text.ts","../src/schematic/schematic_port.ts","../src/schematic/schematic_net_label.ts","../src/schematic/schematic_error.ts","../src/schematic/schematic_debug_object.ts","../src/pcb/properties/layer_ref.ts","../src/pcb/properties/pcb_route_hints.ts","../src/pcb/properties/route_hint_point.ts","../src/pcb/pcb_component.ts","../src/pcb/pcb_hole.ts","../src/pcb/pcb_plated_hole.ts","../src/pcb/pcb_port.ts","../src/pcb/pcb_smtpad.ts","../src/pcb/pcb_solder_paste.ts","../src/pcb/pcb_text.ts","../src/pcb/pcb_trace.ts","../src/pcb/pcb_trace_error.ts","../src/pcb/pcb_port_not_matched_error.ts","../src/pcb/pcb_via.ts","../src/pcb/pcb_board.ts","../src/pcb/pcb_placement_error.ts","../src/pcb/pcb_trace_hint.ts","../src/pcb/pcb_silkscreen_line.ts","../src/pcb/pcb_silkscreen_path.ts","../src/pcb/pcb_silkscreen_text.ts","../src/pcb/pcb_silkscreen_rect.ts","../src/pcb/pcb_silkscreen_circle.ts","../src/pcb/pcb_silkscreen_oval.ts","../src/pcb/pcb_fabrication_note_text.ts","../src/pcb/pcb_fabrication_note_path.ts","../src/pcb/pcb_keepout.ts","../src/cad/cad_component.ts","../src/any_circuit_element.ts"],"sourcesContent":["type UnitInfo = {\n baseUnit: BaseTscircuitUnit\n conversionFactor: number\n}\n\nconst unitMappings: Record<\n string,\n { baseUnit: BaseTscircuitUnit; variants: Record<string, number> }\n> = {\n Hz: {\n baseUnit: \"Hz\",\n variants: {\n MHz: 1e6,\n kHz: 1e3,\n Hz: 1,\n },\n },\n g: {\n baseUnit: \"g\",\n variants: {\n kg: 1e3,\n g: 1,\n },\n },\n Ω: {\n baseUnit: \"Ω\",\n variants: {\n mΩ: 1e-3,\n Ω: 1,\n kΩ: 1e3,\n MΩ: 1e6,\n GΩ: 1e9,\n TΩ: 1e12,\n },\n },\n V: {\n baseUnit: \"V\",\n variants: {\n mV: 1e-3,\n V: 1,\n kV: 1e3,\n MV: 1e6,\n GV: 1e9,\n TV: 1e12,\n },\n },\n A: {\n baseUnit: \"A\",\n variants: {\n µA: 1e-6,\n mA: 1e-3,\n ma: 1e-3,\n A: 1,\n kA: 1e3,\n MA: 1e6,\n },\n },\n F: {\n baseUnit: \"F\",\n variants: {\n pF: 1e-12,\n nF: 1e-9,\n µF: 1e-6,\n uF: 1e-6,\n mF: 1e-3,\n F: 1,\n },\n },\n ml: {\n baseUnit: \"ml\",\n variants: {\n ml: 1,\n mL: 1,\n l: 1e3,\n L: 1e3,\n },\n },\n deg: {\n baseUnit: \"deg\",\n variants: {\n rad: 180 / Math.PI,\n },\n },\n ms: {\n baseUnit: \"ms\",\n variants: {\n s: 1000,\n },\n },\n mm: {\n baseUnit: \"mm\",\n variants: {\n nm: 1e-6,\n µm: 1e-3,\n um: 1e-3,\n mm: 1,\n cm: 10,\n dm: 100,\n m: 1000,\n km: 1e6,\n in: 25.4,\n ft: 304.8,\n IN: 25.4,\n FT: 304.8,\n yd: 914.4,\n mi: 1.609344e6,\n mil: 0.0254,\n },\n },\n}\n\nconst unitMappingAndVariantSuffixes = new Set()\nfor (const [baseUnit, info] of Object.entries(unitMappings)) {\n unitMappingAndVariantSuffixes.add(baseUnit)\n for (const variant of Object.keys(info.variants)) {\n unitMappingAndVariantSuffixes.add(variant)\n }\n}\n\nfunction getBaseTscircuitUnit(unit: string): UnitInfo {\n for (const [baseUnit, info] of Object.entries(unitMappings)) {\n if (unit in info.variants) {\n return {\n baseUnit: info.baseUnit,\n conversionFactor: info.variants[unit]!,\n }\n }\n }\n return {\n baseUnit: unit as BaseTscircuitUnit,\n conversionFactor: 1,\n }\n}\n\nconst si_prefix_multiplier = {\n tera: 1e12,\n T: 1e12,\n giga: 1e9,\n G: 1e9,\n mega: 1e6,\n M: 1e6,\n kilo: 1e3,\n k: 1e3,\n deci: 1e-1,\n d: 1e-1,\n centi: 1e-2,\n c: 1e-2,\n milli: 1e-3,\n m: 1e-3,\n micro: 1e-6,\n u: 1e-6,\n µ: 1e-6,\n nano: 1e-9,\n n: 1e-9,\n pico: 1e-12,\n p: 1e-12,\n}\ntype BaseTscircuitUnit =\n | \"ms\"\n | \"mm\"\n | \"g\"\n | \"deg\"\n | \"Hz\"\n | \"ml\"\n | \"V\"\n | \"A\"\n | \"Ω\"\n | \"F\"\n | \"H\"\n\nexport const parseAndConvertSiUnit = <\n T extends\n | string\n | number\n | undefined\n | { x: string | number; y: string | number },\n>(\n v: T,\n): {\n parsedUnit: string | null\n unitOfValue: BaseTscircuitUnit | null\n value: T extends { x: string | number; y: string | number }\n ? null | { x: number; y: number }\n : null | number\n} => {\n if (typeof v === \"undefined\")\n return { parsedUnit: null, unitOfValue: null, value: null }\n if (typeof v === \"string\" && v.match(/^[\\d\\.]+$/))\n return {\n value: Number.parseFloat(v) as any,\n parsedUnit: null,\n unitOfValue: null,\n }\n if (typeof v === \"number\")\n return { value: v as any, parsedUnit: null, unitOfValue: null }\n if (typeof v === \"object\" && \"x\" in v && \"y\" in v) {\n const { parsedUnit, unitOfValue } = parseAndConvertSiUnit(v.x)\n return {\n parsedUnit: parsedUnit,\n unitOfValue: unitOfValue,\n value: {\n x: parseAndConvertSiUnit(v.x as any).value as number,\n y: parseAndConvertSiUnit(v.y as any).value as number,\n } as any,\n }\n }\n const reversed_input_string = v.toString().split(\"\").reverse().join(\"\")\n const unit_reversed = reversed_input_string.match(/[^\\d\\s]+/)?.[0]\n if (!unit_reversed) {\n throw new Error(`Could not determine unit: \"${v}\"`)\n }\n const unit = unit_reversed.split(\"\").reverse().join(\"\")\n\n const numberPart = v.slice(0, -unit.length)\n if (\n unit in si_prefix_multiplier &&\n !unitMappingAndVariantSuffixes.has(unit)\n ) {\n const siMultiplier =\n si_prefix_multiplier[unit as keyof typeof si_prefix_multiplier]\n return {\n parsedUnit: null,\n unitOfValue: null,\n value: (Number.parseFloat(numberPart) * siMultiplier) as any,\n }\n }\n\n const { baseUnit, conversionFactor } = getBaseTscircuitUnit(unit)\n\n return {\n parsedUnit: unit,\n unitOfValue: baseUnit,\n value: (conversionFactor * Number.parseFloat(numberPart)) as any,\n }\n}\n","import { parseAndConvertSiUnit } from \"src/utils/convert-si-unit-to-number\"\nimport { z } from \"zod\"\n\n// // Currently, removing uncommon SI Prefixes for type simplicity.\n// export type SIPrefix =\n// // | \"y\"\n// // | \"yocto\"\n// // | \"z\"\n// // | \"zepto\"\n// // | \"atto\"\n// // | \"a\"\n// | \"femto\"\n// | \"f\"\n// | \"u\"\n// | \"micro\"\n// // | \"d\"\n// // | \"deci\"\n// | \"c\"\n// | \"centi\"\n// | \"m\"\n// | \"milli\"\n// | \"k\"\n// | \"kilo\"\n// | \"M\"\n// | \"mega\"\n// // | \"G\"\n// // | \"T\"\n// // | \"P\"\n// // | \"E\"\n// // | \"Z\"\n// // | \"Y\"\n\n// export type UnitAbbreviations = {\n// farad: \"F\"\n// ohm: \"Ω\"\n// henry: \"H\"\n// meter: \"m\"\n// volt: \"V\"\n// inch: \"in\"\n// foot: \"ft\"\n// }\n\n// export type Unit = keyof UnitAbbreviations\n// export type NumberWithUnit<T extends Unit> =\n// | `${number}${T | UnitAbbreviations[T]}`\n// | `${number} ${T | UnitAbbreviations[T]}`\n// | `${number}${SIPrefix}${T | UnitAbbreviations[T]}`\n// | `${number} ${SIPrefix}${T | UnitAbbreviations[T]}`\n// export type NumberWithAnyUnit =\n// | `${number}${UnitOrAbbreviation}`\n// | `${number} ${UnitOrAbbreviation}`\n// | `${number}${SIPrefix}${UnitOrAbbreviation}`\n// | `${number} ${SIPrefix}${UnitOrAbbreviation}`\n\n// TODO lots of validation to make sure the unit is valid etc.\nexport const resistance = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\nexport const capacitance = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\nexport const inductance = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\nexport const voltage = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\nexport const length = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n/**\n * Length in meters\n */\nexport type Length = number\nexport type Distance = number\n\nexport const distance = length\n\nexport const current = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\nexport const time = z\n .string()\n .or(z.number())\n .transform((v) => parseAndConvertSiUnit(v).value!)\n\n/**\n * Rotation is always converted to degrees\n */\nexport const rotation = z\n .string()\n .or(z.number())\n .transform((arg): number => {\n if (typeof arg === \"number\") return arg\n if (arg.endsWith(\"deg\")) {\n return Number.parseFloat(arg.split(\"deg\")[0]!)\n }\n if (arg.endsWith(\"rad\")) {\n return (Number.parseFloat(arg.split(\"rad\")[0]!) * 180) / Math.PI\n }\n return Number.parseFloat(arg)\n })\n\nexport const battery_capacity = z\n .number()\n .or(z.string().endsWith(\"mAh\"))\n .transform((v) => {\n if (typeof v === \"string\") {\n const valString = v.replace(\"mAh\", \"\")\n const num = Number.parseFloat(valString)\n if (Number.isNaN(num)) {\n throw new Error(\"Invalid capacity\")\n }\n return num\n }\n return v\n })\n .describe(\"Battery capacity in mAh\")\n\nexport type InputRotation = number | string\nexport type Rotation = number\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\n\nexport const point = z.object({\n x: distance,\n y: distance,\n})\n\nexport const position = point\n\nexport type Point = z.infer<typeof point>\nexport type InputPoint = z.input<typeof point>\nexport type InputPosition = z.input<typeof position>\nexport type Position = z.infer<typeof position>\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\n\nexport const point3 = z.object({\n x: distance,\n y: distance,\n z: distance,\n})\n\nexport const position3 = point3\n\nexport type Point3 = z.infer<typeof point3>\n","import { z } from \"zod\"\n\nexport const size = z.object({\n width: z.number(),\n height: z.number(),\n})\n\nexport type Size = z.infer<typeof size>\n","import { z } from \"zod\"\nimport { nanoid } from \"nanoid\"\n\n/**\n * Use this for primary keys for any circuit element\n */\nexport const getZodPrefixedIdWithDefault = (prefix: string) => {\n return z\n .string()\n .optional()\n .default(() => `${prefix}_${nanoid(10)}`)\n}\n","import { z } from \"zod\"\nimport { source_component_base } from \"src/source/base/source_component_base\"\nimport { capacitance } from \"src/units\"\n\nexport const source_simple_capacitor = source_component_base.extend({\n ftype: z.literal(\"simple_capacitor\"),\n capacitance,\n})\n\nexport type SourceSimpleCapacitor = z.infer<typeof source_simple_capacitor>\nexport type SourceSimpleCapacitorInput = z.input<typeof source_simple_capacitor>\n","import { z } from \"zod\"\n\nexport const supplier_name = z.enum([\n \"jlcpcb\",\n \"macrofab\",\n \"pcbway\",\n \"digikey\",\n \"mouser\",\n \"lcsc\",\n])\n\nexport type SupplierName = z.infer<typeof supplier_name>\n","import { supplier_name } from \"src/pcb/properties/supplier_name\"\nimport { z } from \"zod\"\n\nexport const source_component_base = z.object({\n type: z.literal(\"source_component\"),\n ftype: z.string().optional(),\n source_component_id: z.string(),\n name: z.string(),\n manufacturer_part_number: z.string().optional(),\n supplier_part_numbers: z\n .record(supplier_name, z.array(z.string()))\n .optional(),\n display_value: z.string().optional(),\n})\n\nexport type SourceComponentBase = z.infer<typeof source_component_base>\n","import { z } from \"zod\"\nimport { source_component_base } from \"src/source/base/source_component_base\"\nimport { resistance } from \"src/units\"\n\nexport const source_simple_resistor = source_component_base.extend({\n ftype: z.literal(\"simple_resistor\"),\n resistance,\n})\n\nexport type SourceSimpleResistor = z.infer<typeof source_simple_resistor>\nexport type SourceSimpleResistorInput = z.input<typeof source_simple_resistor>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\n\nexport const source_simple_diode = source_component_base.extend({\n ftype: z.literal(\"simple_diode\"),\n})\n\nexport type SourceSimpleDiode = z.infer<typeof source_simple_diode>\nexport type SourceSimpleDiodeInput = z.input<typeof source_simple_diode>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\n\nexport const source_simple_ground = source_component_base.extend({\n ftype: z.literal(\"simple_ground\"),\n})\n\nexport type SourceSimpleGround = z.infer<typeof source_simple_ground>\nexport type SourceSimpleGroundInput = z.input<typeof source_simple_ground>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\n\n/**\n * @deprecated Use source_simple_chip instead. This will be removed in a future version.\n */\nexport const source_simple_bug = source_component_base\n .extend({\n ftype: z.literal(\"simple_bug\"),\n })\n .describe(\"@deprecated\")\n\nexport type source_simple_bug = z.infer<typeof source_simple_bug>\nexport type SourceSimpleBugInput = z.input<typeof source_simple_bug>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\n\nexport const source_simple_chip = source_component_base.extend({\n ftype: z.literal(\"simple_chip\"),\n})\n\nexport type SourceSimpleChip = z.infer<typeof source_simple_chip>\nexport type SourceSimpleChipInput = z.input<typeof source_simple_chip>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\nimport { inductance } from \"../units\"\n\nexport const source_simple_inductor = source_component_base.extend({\n ftype: z.literal(\"simple_inductor\"),\n inductance,\n})\n\nexport type SourceSimpleInductor = z.infer<typeof source_simple_inductor>\nexport type SourceSimpleInductorInput = z.input<typeof source_simple_inductor>\n","import { z } from \"zod\"\nimport { source_simple_diode } from \"./source_simple_diode\"\n\nexport const source_led = source_simple_diode.extend({\n ftype: z.literal(\"led\"),\n})\n\nexport type SourceLed = z.infer<typeof source_led>\nexport type SourceLedInput = z.input<typeof source_led>\n","import { source_component_base } from \"src/source/base/source_component_base\"\nimport { z } from \"zod\"\nimport { voltage } from \"../units\"\n\nexport const source_simple_power_source = source_component_base.extend({\n ftype: z.literal(\"simple_power_source\"),\n voltage,\n})\n\nexport type SourceSimplePowerSource = z.infer<typeof source_simple_power_source>\nexport type SourceSimplePowerSourceInput = z.input<\n typeof source_simple_power_source\n>\n","import { z } from \"zod\"\nimport { source_simple_resistor } from \"./source_simple_resistor\"\nimport { source_simple_capacitor } from \"./source_simple_capacitor\"\nimport { source_simple_diode } from \"./source_simple_diode\"\nimport { source_simple_ground } from \"./source_simple_ground\"\nimport { source_simple_bug } from \"./source_simple_bug\"\nimport { source_simple_chip } from \"./source_simple_chip\"\nimport { source_led } from \"./source_led\"\nimport { source_simple_power_source } from \"./source_simple_power_source\"\nimport { source_simple_battery } from \"./source_simple_battery\"\nimport { source_simple_inductor } from \"./source_simple_inductor\"\n\nexport const any_source_component = z.union([\n source_simple_resistor,\n source_simple_capacitor,\n source_simple_diode,\n source_simple_ground,\n source_simple_chip,\n source_simple_bug,\n source_led,\n source_simple_power_source,\n source_simple_battery,\n source_simple_inductor,\n])\n\nexport type AnySourceComponent = z.infer<typeof any_source_component>\n","import { z } from \"zod\"\nimport { source_component_base } from \"src/source/base/source_component_base\"\nimport { battery_capacity } from \"src/units\"\n\nexport const source_simple_battery = source_component_base.extend({\n ftype: z.literal(\"simple_battery\"),\n capacity: battery_capacity,\n})\n\nexport type SourceSimpleBattery = z.infer<typeof source_simple_battery>\nexport type SourceSimpleBatteryInput = z.input<typeof source_simple_battery>\n","import { z } from \"zod\"\n\nexport const source_port = z.object({\n type: z.literal(\"source_port\"),\n pin_number: z.number().optional(),\n port_hints: z.array(z.string()).optional(),\n name: z.string(),\n source_port_id: z.string(),\n source_component_id: z.string(),\n})\n\nexport type SourcePort = z.infer<typeof source_port>\n","import { z } from \"zod\"\n\nexport const source_trace = z.object({\n type: z.literal(\"source_trace\"),\n source_trace_id: z.string(),\n connected_source_port_ids: z.array(z.string()),\n connected_source_net_ids: z.array(z.string()),\n})\n\nexport type SourceTrace = z.infer<typeof source_trace>\n","import { z } from \"zod\"\n\nexport const source_group = z.object({\n type: z.literal(\"source_group\"),\n source_group_id: z.string(),\n name: z.string().optional(),\n})\n\nexport type SourceGroup = z.infer<typeof source_group>\nexport type SourceGroupInput = z.input<typeof source_group>\n","import { z } from \"zod\"\n\nexport const source_net = z.object({\n type: z.literal(\"source_net\"),\n source_net_id: z.string(),\n name: z.string(),\n member_source_group_ids: z.array(z.string()),\n is_power: z.boolean().optional(),\n is_ground: z.boolean().optional(),\n is_digital_signal: z.boolean().optional(),\n is_analog_signal: z.boolean().optional(),\n trace_width: z.number().optional(),\n})\n\nexport type SourceNet = z.infer<typeof source_net>\nexport type SourceNetInput = z.input<typeof source_net>\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\n\nexport const schematic_box = z\n .object({\n type: z.literal(\"schematic_box\"),\n schematic_component_id: z.string(),\n width: distance,\n height: distance,\n x: distance,\n y: distance,\n })\n .describe(\"Draws a box on the schematic\")\n\nexport type SchematicBoxInput = z.input<typeof schematic_box>\nexport type SchematicBox = z.infer<typeof schematic_box>\n","import { z } from \"zod\"\nimport { point } from \"../common/point\"\n\nexport const schematic_path = z.object({\n type: z.literal(\"schematic_path\"),\n schematic_component_id: z.string(),\n fill_color: z.enum([\"red\", \"blue\"]).optional(),\n is_filled: z.boolean().optional(),\n points: z.array(point),\n})\n\nexport type SchematicPathInput = z.input<typeof schematic_path>\nexport type SchematicPath = z.infer<typeof schematic_path>\n","import { z } from \"zod\"\nimport { point, type Point } from \"../common/point\"\nimport { size, type Size } from \"../common/size\"\nimport { length, rotation } from \"../units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const schematic_pin_styles = z.record(\n z.object({\n left_margin: length.optional(),\n right_margin: length.optional(),\n top_margin: length.optional(),\n bottom_margin: length.optional(),\n }),\n)\n\nexport interface SchematicPortArrangementBySize {\n left_size: number\n right_size: number\n top_size?: number\n bottom_size?: number\n}\n\nexport interface SchematicPortArrangementBySides {\n left_side?: { pins: number[]; direction?: \"top-to-bottom\" | \"bottom-to-top\" }\n right_side?: { pins: number[]; direction?: \"top-to-bottom\" | \"bottom-to-top\" }\n top_side?: { pins: number[]; direction?: \"left-to-right\" | \"right-to-left\" }\n bottom_side?: {\n pins: number[]\n direction?: \"left-to-right\" | \"right-to-left\"\n }\n}\n\nexport type SchematicPortArrangement =\n | SchematicPortArrangementBySize\n | SchematicPortArrangementBySides\n\nexport interface SchematicComponent {\n type: \"schematic_component\"\n rotation: number\n size: Size\n center: Point\n source_component_id: string\n schematic_component_id: string\n pin_spacing?: number\n pin_styles?: Record<\n string,\n {\n left_margin?: number\n right_margin?: number\n top_margin?: number\n bottom_margin?: number\n }\n >\n box_width?: number\n symbol_name?: string\n port_arrangement?: SchematicPortArrangement\n port_labels?: Record<string, string>\n symbol_display_value?: string\n}\n\nexport const schematic_component_port_arrangement_by_size = z.object({\n left_size: z.number(),\n right_size: z.number(),\n top_size: z.number().optional(),\n bottom_size: z.number().optional(),\n})\n\nexpectTypesMatch<\n SchematicPortArrangementBySize,\n z.infer<typeof schematic_component_port_arrangement_by_size>\n>(true)\n\nexport const schematic_component_port_arrangement_by_sides = z.object({\n left_side: z\n .object({\n pins: z.array(z.number()),\n direction: z.enum([\"top-to-bottom\", \"bottom-to-top\"]).optional(),\n })\n .optional(),\n right_side: z\n .object({\n pins: z.array(z.number()),\n direction: z.enum([\"top-to-bottom\", \"bottom-to-top\"]).optional(),\n })\n .optional(),\n top_side: z\n .object({\n pins: z.array(z.number()),\n direction: z.enum([\"left-to-right\", \"right-to-left\"]).optional(),\n })\n .optional(),\n bottom_side: z\n .object({\n pins: z.array(z.number()),\n direction: z.enum([\"left-to-right\", \"right-to-left\"]).optional(),\n })\n .optional(),\n})\n\nexpectTypesMatch<\n SchematicPortArrangementBySides,\n z.infer<typeof schematic_component_port_arrangement_by_sides>\n>(true)\n\nexport const port_arrangement = z.union([\n schematic_component_port_arrangement_by_size,\n schematic_component_port_arrangement_by_sides,\n])\n\nexport const schematic_component = z.object({\n type: z.literal(\"schematic_component\"),\n rotation: rotation.default(0),\n size,\n center: point,\n source_component_id: z.string(),\n schematic_component_id: z.string(),\n pin_spacing: length.optional(),\n pin_styles: schematic_pin_styles.optional(),\n box_width: length.optional(),\n symbol_name: z.string().optional(),\n port_arrangement: port_arrangement.optional(),\n port_labels: z.record(z.string()).optional(),\n symbol_display_value: z.string().optional(),\n})\n\nexport type SchematicComponentInput = z.input<typeof schematic_component>\ntype InferredSchematicComponent = z.infer<typeof schematic_component>\n\nexpectTypesMatch<SchematicComponent, InferredSchematicComponent>(true)\n","import type { TypeEqual } from \"ts-expect\"\n\nexport const expectTypesMatch = <const T1, const T2>(\n shouldBe: TypeEqual<T1, T2>,\n): void => {}\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\n\nexport const schematic_line = z.object({\n type: z.literal(\"schematic_line\"),\n schematic_component_id: z.string(),\n x1: distance,\n x2: distance,\n y1: distance,\n y2: distance,\n})\n\nexport type SchematicLineInput = z.input<typeof schematic_line>\nexport type SchematicLine = z.infer<typeof schematic_line>\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport interface SchematicTraceEdge {\n from: {\n x: number\n y: number\n }\n to: {\n x: number\n y: number\n }\n is_crossing?: boolean\n from_schematic_port_id?: string\n to_schematic_port_id?: string\n}\n\nexport interface SchematicTrace {\n type: \"schematic_trace\"\n schematic_trace_id: string\n source_trace_id: string\n edges: SchematicTraceEdge[]\n}\n\nexport const schematic_trace = z.object({\n type: z.literal(\"schematic_trace\"),\n schematic_trace_id: z.string(),\n source_trace_id: z.string(),\n edges: z.array(\n z.object({\n from: z.object({\n x: z.number(),\n y: z.number(),\n }),\n to: z.object({\n x: z.number(),\n y: z.number(),\n }),\n is_crossing: z.boolean().optional(),\n from_schematic_port_id: z.string().optional(),\n to_schematic_port_id: z.string().optional(),\n }),\n ),\n})\n\nexport type SchematicTraceInput = z.input<typeof schematic_trace>\ntype InferredSchematicTrace = z.infer<typeof schematic_trace>\n\nexpectTypesMatch<SchematicTraceInput, InferredSchematicTrace>(true)\n","import { z } from \"zod\"\nimport { distance } from \"../units\"\n\nexport const schematic_text = z.object({\n type: z.literal(\"schematic_text\"),\n schematic_component_id: z.string(),\n schematic_text_id: z.string(),\n text: z.string(),\n position: z.object({\n x: distance,\n y: distance,\n }),\n rotation: z.number().default(0),\n anchor: z\n .enum([\"center\", \"left\", \"right\", \"top\", \"bottom\"])\n .default(\"center\"),\n color: z.string().default(\"#000000\"),\n})\n\nexport type SchematicTextInput = z.input<typeof schematic_text>\nexport type SchematicText = z.infer<typeof schematic_text>\n","import { z } from \"zod\"\nimport { point, type Point } from \"../common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport interface SchematicPort {\n type: \"schematic_port\"\n schematic_port_id: string\n source_port_id: string\n schematic_component_id?: string\n center: Point\n facing_direction?: \"up\" | \"down\" | \"left\" | \"right\"\n distance_from_component_edge?: number\n side_of_component?: \"top\" | \"bottom\" | \"left\" | \"right\"\n true_ccw_index?: number\n pin_number?: number\n display_pin_label?: string\n}\n\nexport const schematic_port = z\n .object({\n type: z.literal(\"schematic_port\"),\n schematic_port_id: z.string(),\n source_port_id: z.string(),\n schematic_component_id: z.string().optional(),\n center: point,\n facing_direction: z.enum([\"up\", \"down\", \"left\", \"right\"]).optional(),\n distance_from_component_edge: z.number().optional(),\n side_of_component: z.enum([\"top\", \"bottom\", \"left\", \"right\"]).optional(),\n true_ccw_index: z.number().optional(),\n pin_number: z.number().optional(),\n display_pin_label: z.string().optional(),\n })\n .describe(\"Defines a port on a schematic component\")\n\nexport type SchematicPortInput = z.input<typeof schematic_port>\ntype InferredSchematicPort = z.infer<typeof schematic_port>\n\nexpectTypesMatch<SchematicPort, InferredSchematicPort>(true)\n","import { z } from \"zod\"\nimport { point } from \"../common/point\"\n\nexport const schematic_net_label = z.object({\n type: z.literal(\"schematic_net_label\"),\n source_net_id: z.string(),\n center: point,\n anchor_side: z.enum([\"top\", \"bottom\", \"left\", \"right\"]),\n text: z.string(),\n})\n\nexport type SchematicNetLabelInput = z.input<typeof schematic_net_label>\nexport type SchematicNetLabel = z.infer<typeof schematic_net_label>\n","import { z } from \"zod\"\n\nexport const schematic_error = z\n .object({\n schematic_error_id: z.string(),\n type: z.literal(\"schematic_error\"),\n // eventually each error type should be broken out into a dir of files\n error_type: z.literal(\"schematic_port_not_found\"),\n message: z.string(),\n })\n .describe(\"Defines a schematic error on the schematic\")\n\nexport type SchematicErrorInput = z.input<typeof schematic_error>\nexport type SchematicError = z.infer<typeof schematic_error>\n","import { z } from \"zod\"\nimport { point } from \"../common/point\"\nimport { size } from \"../common/size\"\n\nexport const schematic_debug_object_base = z.object({\n type: z.literal(\"schematic_debug_object\"),\n label: z.string().optional(),\n})\n\nexport const schematic_debug_rect = schematic_debug_object_base.extend({\n shape: z.literal(\"rect\"),\n center: point,\n size: size,\n})\n\nexport const schematic_debug_line = schematic_debug_object_base.extend({\n shape: z.literal(\"line\"),\n start: point,\n end: point,\n})\n\nexport const schematic_debug_point = schematic_debug_object_base.extend({\n shape: z.literal(\"point\"),\n center: point,\n})\n\nexport const schematic_debug_object = z.discriminatedUnion(\"shape\", [\n schematic_debug_rect,\n schematic_debug_line,\n schematic_debug_point,\n])\n\nexport type SchematicDebugObject = z.infer<typeof schematic_debug_object>\nexport type SchematicDebugRect = z.infer<typeof schematic_debug_rect>\nexport type SchematicDebugLine = z.infer<typeof schematic_debug_line>\nexport type SchematicDebugObjectInput = z.input<typeof schematic_debug_object>\n","import { z } from \"zod\"\n\nexport const all_layers = [\n \"top\",\n \"bottom\",\n \"inner1\",\n \"inner2\",\n \"inner3\",\n \"inner4\",\n \"inner5\",\n \"inner6\",\n] as const\n\nexport const layer_string = z.enum(all_layers)\n\nexport const layer_ref = layer_string\n .or(\n z.object({\n name: layer_string,\n }),\n )\n .transform((layer) => {\n if (typeof layer === \"string\") {\n return layer\n }\n return layer.name\n })\n\nexport type LayerRefInput = z.input<typeof layer_ref>\nexport type LayerRef = z.output<typeof layer_ref>\n\nexport const visible_layer = z.enum([\"top\", \"bottom\"])\nexport type VisibleLayerRef = z.infer<typeof visible_layer>\nexport type VisibleLayer = z.infer<typeof visible_layer>\n","import { z } from \"zod\"\nimport { distance } from \"src/units\"\nimport { layer_ref } from \"./layer_ref\"\n\n// x: string | number\n// y: string | number\n// via?: boolean\n// via_to_layer?: string\nexport const pcb_route_hint = z.object({\n x: distance,\n y: distance,\n via: z.boolean().optional(),\n via_to_layer: layer_ref.optional(),\n})\nexport const pcb_route_hints = z.array(pcb_route_hint)\n\nexport type PcbRouteHintInput = z.input<typeof pcb_route_hint>\nexport type PcbRouteHintsInput = z.input<typeof pcb_route_hints>\nexport type PcbRouteHint = z.output<typeof pcb_route_hint>\nexport type PcbRouteHints = z.output<typeof pcb_route_hints>\n","import { z } from \"zod\"\nimport { distance } from \"../../units\"\nimport { layer_ref } from \"./layer_ref\"\n\nexport const route_hint_point = z.object({\n x: distance,\n y: distance,\n via: z.boolean().optional(),\n to_layer: layer_ref.optional(),\n trace_width: distance.optional(),\n})\n\nexport type RouteHintPoint = z.infer<typeof route_hint_point>\nexport type RouteHintPointInput = z.input<typeof route_hint_point>\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { rotation, length, type Rotation, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_component = z\n .object({\n type: z.literal(\"pcb_component\"),\n pcb_component_id: getZodPrefixedIdWithDefault(\"pcb_component\"),\n source_component_id: z.string(),\n center: point,\n layer: layer_ref,\n rotation: rotation,\n width: length,\n height: length,\n })\n .describe(\"Defines a component on the PCB\")\n\nexport type PcbComponentInput = z.input<typeof pcb_component>\ntype InferredPcbComponent = z.infer<typeof pcb_component>\n\n/**\n * Defines a component on the PCB\n */\nexport interface PcbComponent {\n type: \"pcb_component\"\n pcb_component_id: string\n source_component_id: string\n center: Point\n layer: LayerRef\n rotation: Rotation\n width: Length\n height: Length\n}\n\n/**\n * @deprecated use PcbComponent\n */\nexport type PCBComponent = PcbComponent\n\nexpectTypesMatch<PcbComponent, InferredPcbComponent>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { distance, type Distance } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nconst pcb_hole_circle_or_square = z.object({\n type: z.literal(\"pcb_hole\"),\n pcb_hole_id: getZodPrefixedIdWithDefault(\"pcb_hole\"),\n hole_shape: z.enum([\"circle\", \"square\"]),\n hole_diameter: z.number(),\n x: distance,\n y: distance,\n})\n\nexport const pcb_hole_circle_or_square_shape =\n pcb_hole_circle_or_square.describe(\n \"Defines a circular or square hole on the PCB\",\n )\n\nexport type PcbHoleCircleOrSquareInput = z.input<\n typeof pcb_hole_circle_or_square\n>\ntype InferredPcbHoleCircleOrSquare = z.infer<typeof pcb_hole_circle_or_square>\n\n/**\n * Defines a circular or square hole on the PCB\n */\nexport interface PcbHoleCircleOrSquare {\n type: \"pcb_hole\"\n pcb_hole_id: string\n hole_shape: \"circle\" | \"square\"\n hole_diameter: number\n x: Distance\n y: Distance\n}\n\nexpectTypesMatch<PcbHoleCircleOrSquare, InferredPcbHoleCircleOrSquare>(true)\n\nconst pcb_hole_oval = z.object({\n type: z.literal(\"pcb_hole\"),\n pcb_hole_id: getZodPrefixedIdWithDefault(\"pcb_hole\"),\n hole_shape: z.literal(\"oval\"),\n hole_width: z.number(),\n hole_height: z.number(),\n x: distance,\n y: distance,\n})\n\nexport const pcb_hole_oval_shape = pcb_hole_oval.describe(\n \"Defines an oval hole on the PCB\",\n)\n\nexport type PcbHoleOvalInput = z.input<typeof pcb_hole_oval>\ntype InferredPcbHoleOval = z.infer<typeof pcb_hole_oval>\n\n/**\n * Defines an oval hole on the PCB\n */\nexport interface PcbHoleOval {\n type: \"pcb_hole\"\n pcb_hole_id: string\n hole_shape: \"oval\"\n hole_width: number\n hole_height: number\n x: Distance\n y: Distance\n}\n\nexpectTypesMatch<PcbHoleOval, InferredPcbHoleOval>(true)\n\nexport const pcb_hole = pcb_hole_circle_or_square.or(pcb_hole_oval)\n\n/**\n * @deprecated Use PcbHoleCircleOrSquare or PcbHoleOval\n */\nexport type PCBHoleInput = z.input<typeof pcb_hole>\n/**\n * @deprecated Use PcbHoleCircleOrSquare or PcbHoleOval\n */\nexport type PCBHole = z.infer<typeof pcb_hole>\n\nexport type PcbHole = PcbHoleCircleOrSquare | PcbHoleOval\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"src/units\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nconst pcb_plated_hole_circle = z.object({\n type: z.literal(\"pcb_plated_hole\"),\n shape: z.literal(\"circle\"),\n outer_diameter: z.number(),\n hole_diameter: z.number(),\n x: distance,\n y: distance,\n layers: z.array(layer_ref),\n port_hints: z.array(z.string()).optional(),\n pcb_component_id: z.string().optional(),\n pcb_port_id: z.string().optional(),\n pcb_plated_hole_id: getZodPrefixedIdWithDefault(\"pcb_plated_hole\"),\n})\n\n/**\n * Defines a circular plated hole on the PCB\n */\nexport interface PcbPlatedHoleCircle {\n type: \"pcb_plated_hole\"\n shape: \"circle\"\n outer_diameter: number\n hole_diameter: number\n x: Distance\n y: Distance\n layers: LayerRef[]\n port_hints?: string[]\n pcb_component_id?: string\n pcb_port_id?: string\n pcb_plated_hole_id: string\n}\n\nconst pcb_plated_hole_oval = z.object({\n type: z.literal(\"pcb_plated_hole\"),\n shape: z.enum([\"oval\", \"pill\"]),\n outer_width: z.number(),\n outer_height: z.number(),\n hole_width: z.number(),\n hole_height: z.number(),\n x: distance,\n y: distance,\n layers: z.array(layer_ref),\n port_hints: z.array(z.string()).optional(),\n pcb_component_id: z.string().optional(),\n pcb_port_id: z.string().optional(),\n pcb_plated_hole_id: getZodPrefixedIdWithDefault(\"pcb_plated_hole\"),\n})\n\n/**\n * Defines an oval or pill-shaped plated hole on the PCB\n */\nexport interface PcbPlatedHoleOval {\n type: \"pcb_plated_hole\"\n shape: \"oval\" | \"pill\"\n outer_width: number\n outer_height: number\n hole_width: number\n hole_height: number\n x: Distance\n y: Distance\n layers: LayerRef[]\n port_hints?: string[]\n pcb_component_id?: string\n pcb_port_id?: string\n pcb_plated_hole_id: string\n}\n\nexport const pcb_plated_hole = z.union([\n pcb_plated_hole_circle,\n pcb_plated_hole_oval,\n])\nexport type PcbPlatedHole = PcbPlatedHoleCircle | PcbPlatedHoleOval\n\nexpectTypesMatch<PcbPlatedHoleCircle, z.infer<typeof pcb_plated_hole_circle>>(\n true,\n)\nexpectTypesMatch<PcbPlatedHoleOval, z.infer<typeof pcb_plated_hole_oval>>(true)\n\n/**\n * @deprecated use PcbPlatedHole\n */\nexport type PCBPlatedHole = PcbPlatedHole\n\n/**\n * @deprecated use PcbPlatedHoleInput\n */\nexport type PCBPlatedHoleInput = z.input<typeof pcb_plated_hole>\nexport type PcbPlatedHoleInput = z.input<typeof pcb_plated_hole>\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { distance, type Distance } from \"src/units\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_port = z\n .object({\n type: z.literal(\"pcb_port\"),\n pcb_port_id: getZodPrefixedIdWithDefault(\"pcb_port\"),\n source_port_id: z.string(),\n pcb_component_id: z.string(),\n x: distance,\n y: distance,\n layers: z.array(layer_ref),\n })\n .describe(\"Defines a port on the PCB\")\n\nexport type PcbPortInput = z.input<typeof pcb_port>\ntype InferredPcbPort = z.infer<typeof pcb_port>\n\n/**\n * Defines a port on the PCB\n */\nexport interface PcbPort {\n type: \"pcb_port\"\n pcb_port_id: string\n source_port_id: string\n pcb_component_id: string\n x: Distance\n y: Distance\n layers: LayerRef[]\n}\n\n/**\n * @deprecated use PcbPort\n */\nexport type PCBPort = PcbPort\n\n/**\n * @deprecated use PcbPortInput\n */\nexport type PCBPortInput = PcbPortInput\n\nexpectTypesMatch<PcbPort, InferredPcbPort>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"src/units\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nconst pcb_smtpad_circle = z.object({\n type: z.literal(\"pcb_smtpad\"),\n shape: z.literal(\"circle\"),\n pcb_smtpad_id: getZodPrefixedIdWithDefault(\"pcb_smtpad\"),\n x: distance,\n y: distance,\n radius: z.number(),\n layer: layer_ref,\n port_hints: z.array(z.string()).optional(),\n pcb_component_id: z.string().optional(),\n pcb_port_id: z.string().optional(),\n})\n\nconst pcb_smtpad_rect = z.object({\n type: z.literal(\"pcb_smtpad\"),\n shape: z.literal(\"rect\"),\n pcb_smtpad_id: getZodPrefixedIdWithDefault(\"pcb_smtpad\"),\n x: distance,\n y: distance,\n width: z.number(),\n height: z.number(),\n layer: layer_ref,\n port_hints: z.array(z.string()).optional(),\n pcb_component_id: z.string().optional(),\n pcb_port_id: z.string().optional(),\n})\n\nexport const pcb_smtpad = z\n .union([pcb_smtpad_circle, pcb_smtpad_rect])\n .describe(\"Defines an SMT pad on the PCB\")\n\nexport type PCBSMTPadInput = z.input<typeof pcb_smtpad>\ntype PCBSMTPadCircle = z.infer<typeof pcb_smtpad_circle>\ntype PCBSMTPadRect = z.infer<typeof pcb_smtpad_rect>\n\n/**\n * Defines an SMT pad on the PCB\n */\nexport interface PcbSmtPadCircle {\n type: \"pcb_smtpad\"\n shape: \"circle\"\n pcb_smtpad_id: string\n x: Distance\n y: Distance\n radius: number\n layer: LayerRef\n port_hints?: string[]\n pcb_component_id?: string\n pcb_port_id?: string\n}\n\n/**\n * Defines an SMT pad on the PCB\n */\nexport interface PcbSmtPadRect {\n type: \"pcb_smtpad\"\n shape: \"rect\"\n pcb_smtpad_id: string\n x: Distance\n y: Distance\n width: number\n height: number\n layer: LayerRef\n port_hints?: string[]\n pcb_component_id?: string\n pcb_port_id?: string\n}\n\nexport type PcbSmtPad = PcbSmtPadCircle | PcbSmtPadRect\n\n/**\n * @deprecated use PcbSmtPad\n */\nexport type PCBSMTPad = PcbSmtPad\n\nexpectTypesMatch<PcbSmtPadCircle, PCBSMTPadCircle>(true)\nexpectTypesMatch<PcbSmtPadRect, PCBSMTPadRect>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"src/units\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nconst pcb_solder_paste_circle = z.object({\n type: z.literal(\"pcb_solder_paste\"),\n shape: z.literal(\"circle\"),\n pcb_solder_paste_id: getZodPrefixedIdWithDefault(\"pcb_solder_paste\"),\n x: distance,\n y: distance,\n radius: z.number(),\n layer: layer_ref,\n pcb_component_id: z.string().optional(),\n pcb_smtpad_id: z.string().optional(),\n})\n\nconst pcb_solder_paste_rect = z.object({\n type: z.literal(\"pcb_solder_paste\"),\n shape: z.literal(\"rect\"),\n pcb_solder_paste_id: getZodPrefixedIdWithDefault(\"pcb_solder_paste\"),\n x: distance,\n y: distance,\n width: z.number(),\n height: z.number(),\n layer: layer_ref,\n pcb_component_id: z.string().optional(),\n pcb_smtpad_id: z.string().optional(),\n})\n\nexport const pcb_solder_paste = z\n .union([pcb_solder_paste_circle, pcb_solder_paste_rect])\n .describe(\"Defines solderpaste on the PCB\")\n\nexport type PCBSolderPasteInput = z.input<typeof pcb_solder_paste>\ntype InferredPcbSolderPasteCircle = z.infer<typeof pcb_solder_paste_circle>\ntype InferredPcbSolderPasteRect = z.infer<typeof pcb_solder_paste_rect>\n\n/**\n * Defines solderpaste on the PCB\n */\nexport interface PcbSolderPasteCircle {\n type: \"pcb_solder_paste\"\n shape: \"circle\"\n pcb_solder_paste_id: string\n x: Distance\n y: Distance\n radius: number\n layer: LayerRef\n pcb_component_id?: string\n pcb_smtpad_id?: string\n}\n\n/**\n * Defines solderpaste on the PCB\n */\nexport interface PcbSolderPasteRect {\n type: \"pcb_solder_paste\"\n shape: \"rect\"\n pcb_solder_paste_id: string\n x: Distance\n y: Distance\n width: number\n height: number\n layer: LayerRef\n pcb_component_id?: string\n pcb_smtpad_id?: string\n}\n\nexport type PcbSolderPaste = PcbSolderPasteCircle | PcbSolderPasteRect\n\nexpectTypesMatch<PcbSolderPasteCircle, InferredPcbSolderPasteCircle>(true)\nexpectTypesMatch<PcbSolderPasteRect, InferredPcbSolderPasteRect>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_text = z\n .object({\n type: z.literal(\"pcb_text\"),\n pcb_text_id: getZodPrefixedIdWithDefault(\"pcb_text\"),\n text: z.string(),\n center: point,\n layer: layer_ref,\n width: length,\n height: length,\n lines: z.number(),\n align: z.enum([\"bottom-left\"]),\n })\n .describe(\"Defines text on the PCB\")\n\nexport type PcbTextInput = z.input<typeof pcb_text>\ntype InferredPcbText = z.infer<typeof pcb_text>\n\n/**\n * Defines text on the PCB\n */\nexport interface PcbText {\n type: \"pcb_text\"\n pcb_text_id: string\n text: string\n center: Point\n layer: LayerRef\n width: Length\n height: Length\n lines: number\n align: \"bottom-left\"\n}\n\n/**\n * @deprecated use PcbText\n */\nexport type PCBText = PcbText\n\nexpectTypesMatch<PcbText, InferredPcbText>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { distance, type Distance } from \"src/units\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_trace_route_point_wire = z.object({\n route_type: z.literal(\"wire\"),\n x: distance,\n y: distance,\n width: distance,\n start_pcb_port_id: z.string().optional(),\n end_pcb_port_id: z.string().optional(),\n layer: layer_ref,\n})\n\nexport const pcb_trace_route_point_via = z.object({\n route_type: z.literal(\"via\"),\n x: distance,\n y: distance,\n from_layer: z.string(),\n to_layer: z.string(),\n})\n\nexport const pcb_trace_route_point = z.union([\n pcb_trace_route_point_wire,\n pcb_trace_route_point_via,\n])\ntype InferredPcbTraceRoutePoint = z.infer<typeof pcb_trace_route_point>\n\nexport const pcb_trace = z\n .object({\n type: z.literal(\"pcb_trace\"),\n source_trace_id: z.string().optional(),\n pcb_component_id: z.string().optional(),\n pcb_trace_id: getZodPrefixedIdWithDefault(\"pcb_trace\"),\n route_thickness_mode: z\n .enum([\"constant\", \"interpolated\"])\n .default(\"constant\")\n .optional(),\n route_order_index: z.number().optional(),\n should_round_corners: z.boolean().optional(),\n route: z.array(\n z.union([\n z.object({\n route_type: z.literal(\"wire\"),\n x: distance,\n y: distance,\n width: distance,\n start_pcb_port_id: z.string().optional(),\n end_pcb_port_id: z.string().optional(),\n layer: layer_ref,\n }),\n z.object({\n route_type: z.literal(\"via\"),\n x: distance,\n y: distance,\n from_layer: z.string(),\n to_layer: z.string(),\n }),\n ]),\n ),\n })\n .describe(\"Defines a trace on the PCB\")\n\nexport type PcbTraceInput = z.input<typeof pcb_trace>\ntype InferredPcbTrace = z.infer<typeof pcb_trace>\n\nexport interface PcbTraceRoutePointWire {\n route_type: \"wire\"\n x: Distance\n y: Distance\n width: Distance\n start_pcb_port_id?: string\n end_pcb_port_id?: string\n layer: LayerRef\n}\n\nexport interface PcbTraceRoutePointVia {\n route_type: \"via\"\n x: Distance\n y: Distance\n from_layer: string\n to_layer: string\n}\n\nexport type PcbTraceRoutePoint = PcbTraceRoutePointWire | PcbTraceRoutePointVia\n\n/**\n * Defines a trace on the PCB\n */\nexport interface PcbTrace {\n type: \"pcb_trace\"\n source_trace_id?: string\n pcb_component_id?: string\n pcb_trace_id: string\n /**\n * The order that this trace was routed in. This can be used to debug the\n * autorouter and to understand the trace path better\n *\n * The route_order_index should be relative to a subcircuit\n */\n route_order_index?: number\n route_thickness_mode?: \"constant\" | \"interpolated\"\n should_round_corners?: boolean\n route: Array<PcbTraceRoutePoint>\n}\n\n/**\n * @deprecated use PcbTrace\n */\nexport type PCBTrace = PcbTrace\n\n/**\n * @deprecated use PcbTraceInput\n */\nexport type PCBTraceInput = PcbTraceInput\n\nexpectTypesMatch<PcbTraceRoutePoint, InferredPcbTraceRoutePoint>(true)\nexpectTypesMatch<PcbTrace, InferredPcbTrace>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_trace_error = z\n .object({\n type: z.literal(\"pcb_trace_error\"),\n pcb_trace_error_id: getZodPrefixedIdWithDefault(\"pcb_trace_error\"),\n error_type: z.literal(\"pcb_trace_error\"),\n message: z.string(),\n center: point.optional(),\n pcb_trace_id: z.string(),\n source_trace_id: z.string(),\n pcb_component_ids: z.array(z.string()),\n pcb_port_ids: z.array(z.string()),\n })\n .describe(\"Defines a trace error on the PCB\")\n\nexport type PcbTraceErrorInput = z.input<typeof pcb_trace_error>\ntype InferredPcbTraceError = z.infer<typeof pcb_trace_error>\n\n/**\n * Defines a trace error on the PCB\n */\nexport interface PcbTraceError {\n type: \"pcb_trace_error\"\n pcb_trace_error_id: string\n error_type: \"pcb_trace_error\"\n message: string\n center?: Point\n pcb_trace_id: string\n source_trace_id: string\n pcb_component_ids: string[]\n pcb_port_ids: string[]\n}\n\n/**\n * @deprecated use PcbTraceError\n */\nexport type PCBTraceError = PcbTraceError\n\nexpectTypesMatch<PcbTraceError, InferredPcbTraceError>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_port_not_matched_error = z\n .object({\n type: z.literal(\"pcb_port_not_matched_error\"),\n pcb_error_id: getZodPrefixedIdWithDefault(\"pcb_error\"),\n message: z.string(),\n pcb_component_ids: z.array(z.string()),\n })\n .describe(\"Defines a trace error on the PCB where a port is not matched\")\n\nexport type PcbPortNotMatchedErrorInput = z.input<\n typeof pcb_port_not_matched_error\n>\ntype InferredPcbPortNotMatchedError = z.infer<typeof pcb_port_not_matched_error>\n\n/**\n * Defines a trace error on the PCB where a port is not matched\n */\nexport interface PcbPortNotMatchedError {\n type: \"pcb_port_not_matched_error\"\n pcb_error_id: string\n message: string\n pcb_component_ids: string[]\n}\n\n/**\n * @deprecated use PcbPortNotMatchedError\n */\nexport type PCBPortNotMatchedError = PcbPortNotMatchedError\n\nexpectTypesMatch<PcbPortNotMatchedError, InferredPcbPortNotMatchedError>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"src/units\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_via = z\n .object({\n type: z.literal(\"pcb_via\"),\n pcb_via_id: getZodPrefixedIdWithDefault(\"pcb_via\"),\n x: distance,\n y: distance,\n outer_diameter: distance.default(\"0.6mm\"),\n hole_diameter: distance.default(\"0.25mm\"),\n /** @deprecated */\n from_layer: layer_ref.optional(),\n /** @deprecated */\n to_layer: layer_ref.optional(),\n layers: z.array(layer_ref),\n pcb_trace_id: z.string().optional(),\n })\n .describe(\"Defines a via on the PCB\")\n\nexport type PcbViaInput = z.input<typeof pcb_via>\ntype InferredPcbVia = z.infer<typeof pcb_via>\n\n/**\n * Defines a via on the PCB\n */\nexport interface PcbVia {\n type: \"pcb_via\"\n pcb_via_id: string\n x: Distance\n y: Distance\n outer_diameter: Distance\n hole_diameter: Distance\n /** @deprecated */\n from_layer?: LayerRef\n /** @deprecated */\n to_layer?: LayerRef\n layers: LayerRef[]\n pcb_trace_id?: string\n}\n\n/**\n * @deprecated use PcbVia\n */\nexport type PCBVia = PcbVia\n\nexpectTypesMatch<PcbVia, InferredPcbVia>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_board = z\n .object({\n type: z.literal(\"pcb_board\"),\n pcb_board_id: getZodPrefixedIdWithDefault(\"pcb_board\"),\n width: length,\n height: length,\n center: point,\n thickness: length.optional().default(1.4),\n num_layers: z.number().optional().default(4),\n outline: z.array(point).optional(),\n })\n .describe(\"Defines the board outline of the PCB\")\n\n/**\n * Defines the board outline of the PCB\n */\nexport interface PcbBoard {\n type: \"pcb_board\"\n pcb_board_id: string\n width: Length\n height: Length\n thickness: Length\n num_layers: number\n center: Point\n outline?: Point[]\n}\n\nexport type PcbBoardInput = z.input<typeof pcb_board>\ntype InferredPcbBoard = z.infer<typeof pcb_board>\n\n/**\n * @deprecated use PcbBoard\n */\nexport type PCBBoard = PcbBoard\n\nexpectTypesMatch<PcbBoard, InferredPcbBoard>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_placement_error = z\n .object({\n type: z.literal(\"pcb_placement_error\"),\n pcb_placement_error_id: getZodPrefixedIdWithDefault(\"pcb_placement_error\"),\n message: z.string(),\n })\n .describe(\"Defines a placement error on the PCB\")\n\nexport type PcbPlacementErrorInput = z.input<typeof pcb_placement_error>\ntype InferredPcbPlacementError = z.infer<typeof pcb_placement_error>\n\n/**\n * Defines a placement error on the PCB\n */\nexport interface PcbPlacementError {\n type: \"pcb_placement_error\"\n pcb_placement_error_id: string\n message: string\n}\n\n/**\n * @deprecated use PcbPlacementError\n */\nexport type PCBPlacementError = PcbPlacementError\n\nexpectTypesMatch<PcbPlacementError, InferredPcbPlacementError>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { route_hint_point, type RouteHintPoint } from \"src/pcb\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\n/**\n * A hint that can be used during generation of a PCB trace.\n */\nexport interface PcbTraceHint {\n type: \"pcb_trace_hint\"\n pcb_trace_hint_id: string\n pcb_port_id: string\n pcb_component_id: string\n route: RouteHintPoint[]\n}\n\nexport const pcb_trace_hint = z\n .object({\n type: z.literal(\"pcb_trace_hint\"),\n pcb_trace_hint_id: getZodPrefixedIdWithDefault(\"pcb_trace_hint\"),\n pcb_port_id: z.string(),\n pcb_component_id: z.string(),\n route: z.array(route_hint_point),\n })\n .describe(\"A hint that can be used during generation of a PCB trace\")\n\nexport type PcbTraceHintInput = z.input<typeof pcb_trace_hint>\ntype InferredPcbTraceHint = z.infer<typeof pcb_trace_hint>\n\n/**\n * @deprecated use PcbTraceHint\n */\nexport type PCBTraceHint = PcbTraceHint\n\nexpectTypesMatch<PcbTraceHint, InferredPcbTraceHint>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"src/units\"\nimport {\n layer_ref,\n type LayerRef,\n type VisibleLayer,\n visible_layer,\n} from \"src/pcb/properties/layer_ref\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_line = z\n .object({\n type: z.literal(\"pcb_silkscreen_line\"),\n pcb_silkscreen_line_id: getZodPrefixedIdWithDefault(\"pcb_silkscreen_line\"),\n pcb_component_id: z.string(),\n stroke_width: distance.default(\"0.1mm\"),\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n layer: visible_layer,\n })\n .describe(\"Defines a silkscreen line on the PCB\")\n\nexport type PcbSilkscreenLineInput = z.input<typeof pcb_silkscreen_line>\ntype InferredPcbSilkscreenLine = z.infer<typeof pcb_silkscreen_line>\n\n/**\n * Defines a silkscreen line on the PCB\n */\nexport interface PcbSilkscreenLine {\n type: \"pcb_silkscreen_line\"\n pcb_silkscreen_line_id: string\n pcb_component_id: string\n stroke_width: Distance\n x1: Distance\n y1: Distance\n x2: Distance\n y2: Distance\n layer: VisibleLayer\n}\n\n/**\n * @deprecated use PcbSilkscreenLine\n */\nexport type PCBSilkscreenLine = PcbSilkscreenLine\n\nexpectTypesMatch<PcbSilkscreenLine, InferredPcbSilkscreenLine>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport {\n visible_layer,\n type VisibleLayerRef,\n} from \"src/pcb/properties/layer_ref\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_path = z\n .object({\n type: z.literal(\"pcb_silkscreen_path\"),\n pcb_silkscreen_path_id: getZodPrefixedIdWithDefault(\"pcb_silkscreen_path\"),\n pcb_component_id: z.string(),\n layer: visible_layer,\n route: z.array(point),\n stroke_width: length,\n })\n .describe(\"Defines a silkscreen path on the PCB\")\n\nexport type PcbSilkscreenPathInput = z.input<typeof pcb_silkscreen_path>\ntype InferredPcbSilkscreenPath = z.infer<typeof pcb_silkscreen_path>\n\n/**\n * Defines a silkscreen path on the PCB\n */\nexport interface PcbSilkscreenPath {\n type: \"pcb_silkscreen_path\"\n pcb_silkscreen_path_id: string\n pcb_component_id: string\n layer: VisibleLayerRef\n route: Point[]\n stroke_width: Length\n}\n\n/**\n * @deprecated use PcbSilkscreenPath\n */\nexport type PcbSilkscreenPathDeprecated = PcbSilkscreenPath\n\nexpectTypesMatch<PcbSilkscreenPath, InferredPcbSilkscreenPath>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { distance, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_text = z\n .object({\n type: z.literal(\"pcb_silkscreen_text\"),\n pcb_silkscreen_text_id: getZodPrefixedIdWithDefault(\"pcb_silkscreen_text\"),\n font: z.literal(\"tscircuit2024\").default(\"tscircuit2024\"),\n font_size: distance.default(\"0.2mm\"),\n pcb_component_id: z.string(),\n text: z.string(),\n layer: layer_ref,\n is_mirrored: z.boolean().default(false).optional(),\n anchor_position: point.default({ x: 0, y: 0 }),\n anchor_alignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n })\n .describe(\"Defines silkscreen text on the PCB\")\n\nexport type PcbSilkscreenTextInput = z.input<typeof pcb_silkscreen_text>\ntype InferredPcbSilkscreenText = z.infer<typeof pcb_silkscreen_text>\n\n/**\n * Defines silkscreen text on the PCB\n */\nexport interface PcbSilkscreenText {\n type: \"pcb_silkscreen_text\"\n pcb_silkscreen_text_id: string\n font: \"tscircuit2024\"\n font_size: Length\n pcb_component_id: string\n text: string\n layer: LayerRef\n is_mirrored?: boolean\n anchor_position: Point\n anchor_alignment:\n | \"center\"\n | \"top_left\"\n | \"top_right\"\n | \"bottom_left\"\n | \"bottom_right\"\n}\n\n/**\n * @deprecated use PcbSilkscreenText\n */\nexport type PCBSilkscreenText = PcbSilkscreenText\n\nexpectTypesMatch<PcbSilkscreenText, InferredPcbSilkscreenText>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport { layer_ref, type LayerRef } from \"src/pcb/properties/layer_ref\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_rect = z\n .object({\n type: z.literal(\"pcb_silkscreen_rect\"),\n pcb_silkscreen_rect_id: getZodPrefixedIdWithDefault(\"pcb_silkscreen_rect\"),\n pcb_component_id: z.string(),\n center: point,\n width: length,\n height: length,\n layer: layer_ref,\n })\n .describe(\"Defines a silkscreen rect on the PCB\")\n\nexport type PcbSilkscreenRectInput = z.input<typeof pcb_silkscreen_rect>\ntype InferredPcbSilkscreenRect = z.infer<typeof pcb_silkscreen_rect>\n\n/**\n * Defines a silkscreen rect on the PCB\n */\nexport interface PcbSilkscreenRect {\n type: \"pcb_silkscreen_rect\"\n pcb_silkscreen_rect_id: string\n pcb_component_id: string\n center: Point\n width: Length\n height: Length\n layer: LayerRef\n}\n\n/**\n * @deprecated use PcbSilkscreenRect\n */\nexport type PcbSilkscreenRectOld = PcbSilkscreenRect\n\nexpectTypesMatch<PcbSilkscreenRect, InferredPcbSilkscreenRect>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport {\n layer_ref,\n visible_layer,\n type LayerRef,\n type VisibleLayer,\n} from \"src/pcb/properties/layer_ref\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_circle = z\n .object({\n type: z.literal(\"pcb_silkscreen_circle\"),\n pcb_silkscreen_circle_id: getZodPrefixedIdWithDefault(\n \"pcb_silkscreen_circle\",\n ),\n pcb_component_id: z.string(),\n center: point,\n radius: length,\n layer: visible_layer,\n })\n .describe(\"Defines a silkscreen circle on the PCB\")\n\nexport type PcbSilkscreenCircleInput = z.input<typeof pcb_silkscreen_circle>\ntype InferredPcbSilkscreenCircle = z.infer<typeof pcb_silkscreen_circle>\n\n/**\n * Defines a silkscreen circle on the PCB\n */\nexport interface PcbSilkscreenCircle {\n type: \"pcb_silkscreen_circle\"\n pcb_silkscreen_circle_id: string\n pcb_component_id: string\n center: Point\n radius: Length\n layer: VisibleLayer\n}\n\nexpectTypesMatch<PcbSilkscreenCircle, InferredPcbSilkscreenCircle>(true)\n","import { z } from \"zod\"\nimport { point, type Point, getZodPrefixedIdWithDefault } from \"src/common\"\nimport {\n layer_ref,\n type LayerRef,\n visible_layer,\n type VisibleLayer,\n} from \"src/pcb/properties/layer_ref\"\nimport { distance, type Distance } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_silkscreen_oval = z\n .object({\n type: z.literal(\"pcb_silkscreen_oval\"),\n pcb_silkscreen_oval_id: getZodPrefixedIdWithDefault(\"pcb_silkscreen_oval\"),\n pcb_component_id: z.string(),\n center: point,\n radius_x: distance,\n radius_y: distance,\n layer: visible_layer,\n })\n .describe(\"Defines a silkscreen oval on the PCB\")\n\nexport type PcbSilkscreenOvalInput = z.input<typeof pcb_silkscreen_oval>\ntype InferredPcbSilkscreenOval = z.infer<typeof pcb_silkscreen_oval>\n\n/**\n * Defines a silkscreen oval on the PCB\n */\nexport interface PcbSilkscreenOval {\n type: \"pcb_silkscreen_oval\"\n pcb_silkscreen_oval_id: string\n pcb_component_id: string\n center: Point\n radius_x: Distance\n radius_y: Distance\n layer: VisibleLayer\n}\n\n/**\n * @deprecated use PcbSilkscreenOval\n */\nexport type PcbSilkscreenOvalDeprecated = PcbSilkscreenOval\n\nexpectTypesMatch<PcbSilkscreenOval, InferredPcbSilkscreenOval>(true)\n","import { z } from \"zod\"\nimport { point, type Point } from \"src/common\"\nimport { distance, type Length } from \"src/units\"\nimport {\n visible_layer,\n type LayerRef,\n type VisibleLayer,\n} from \"src/pcb/properties/layer_ref\"\nimport { getZodPrefixedIdWithDefault } from \"src/common/getZodPrefixedIdWithDefault\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_fabrication_note_text = z\n .object({\n type: z.literal(\"pcb_fabrication_note_text\"),\n pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(\n \"pcb_fabrication_note_text\",\n ),\n font: z.literal(\"tscircuit2024\").default(\"tscircuit2024\"),\n font_size: distance.default(\"1mm\"),\n pcb_component_id: z.string(),\n text: z.string(),\n layer: visible_layer,\n anchor_position: point.default({ x: 0, y: 0 }),\n anchor_alignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n color: z.string().optional(),\n })\n .describe(\n \"Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators\",\n )\n\nexport type PcbFabricationNoteTextInput = z.input<\n typeof pcb_fabrication_note_text\n>\ntype InferredPcbFabricationNoteText = z.infer<typeof pcb_fabrication_note_text>\n\n/**\n * Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators\n */\nexport interface PcbFabricationNoteText {\n type: \"pcb_fabrication_note_text\"\n pcb_fabrication_note_text_id: string\n font: \"tscircuit2024\"\n font_size: Length\n pcb_component_id: string\n text: string\n layer: VisibleLayer\n anchor_position: Point\n anchor_alignment:\n | \"center\"\n | \"top_left\"\n | \"top_right\"\n | \"bottom_left\"\n | \"bottom_right\"\n color?: string\n}\n\n/**\n * @deprecated use PcbFabricationNoteText\n */\nexport type PCBFabricationNoteText = PcbFabricationNoteText\n\nexpectTypesMatch<PcbFabricationNoteText, InferredPcbFabricationNoteText>(true)\n","import { z } from \"zod\"\nimport { getZodPrefixedIdWithDefault } from \"src/common\"\nimport {\n layer_ref,\n visible_layer,\n type LayerRef,\n} from \"src/pcb/properties/layer_ref\"\nimport { point, type Point } from \"src/common\"\nimport { length, type Length } from \"src/units\"\nimport { expectTypesMatch } from \"src/utils/expect-types-match\"\n\nexport const pcb_fabrication_note_path = z\n .object({\n type: z.literal(\"pcb_fabrication_note_path\"),\n pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(\n \"pcb_fabrication_note_path\",\n ),\n pcb_component_id: z.string(),\n layer: layer_ref,\n route: z.array(point),\n stroke_width: length,\n color: z.string().optional(),\n })\n .describe(\n \"Defines a fabrication path on the PCB for fabricators or assemblers\",\n )\n\nexport type PcbFabricationNotePathInput = z.input<\n typeof pcb_fabrication_note_path\n>\ntype InferredPcbFabricationNotePath = z.infer<typeof pcb_fabrication_note_path>\n\n/**\n * Defines a fabrication path on the PCB for fabricators or assemblers\n */\nexport interface PcbFabricationNotePath {\n type: \"pcb_fabrication_note_path\"\n pcb_fabrication_note_path_id: string\n pcb_component_id: string\n layer: LayerRef\n route: Point[]\n stroke_width: Length\n color?: string\n}\n\n/**\n * @deprecated use PcbFabricationNotePath\n */\nexport type PCBFabricationNotePath = PcbFabricationNotePath\n\nexpectTypesMatch<PcbFabricationNotePath, InferredPcbFabricationNotePath>(true)\n","import { z } from \"zod\"\nimport { point } from \"../common\"\nimport { distance } from \"../units\"\n\nexport const pcb_keepout = z\n .object({\n type: z.literal(\"pcb_keepout\"),\n shape: z.literal(\"rect\"),\n center: point,\n width: distance,\n height: distance,\n pcb_keepout_id: z.string(),\n layers: z.array(z.string()), // Specify layers where the keepout applies\n description: z.string().optional(), // Optional description of the keepout\n })\n .or(\n z.object({\n type: z.literal(\"pcb_keepout\"),\n shape: z.literal(\"circle\"),\n center: point,\n radius: distance,\n pcb_keepout_id: z.string(),\n layers: z.array(z.string()), // Specify layers where the keepout applies\n description: z.string().optional(), // Optional description of the keepout\n }),\n )\n\nexport type PCBKeepoutInput = z.input<typeof pcb_keepout>\nexport type PCBKeepout = z.infer<typeof pcb_keepout>\n","import { z } from \"zod\"\nimport { point3 } from \"../common\"\nimport { rotation, length } from \"../units\"\nimport { layer_ref } from \"src/pcb\"\n\nexport const cad_component = z\n .object({\n type: z.literal(\"cad_component\"),\n cad_component_id: z.string(),\n pcb_component_id: z.string(),\n source_component_id: z.string(),\n position: point3,\n rotation: point3.optional(),\n size: point3.optional(),\n layer: layer_ref.optional(),\n\n // These are all ways to generate/load the 3d model\n footprinter_string: z.string().optional(),\n model_obj_url: z.string().optional(),\n model_stl_url: z.string().optional(),\n model_3mf_url: z.string().optional(),\n model_jscad: z.any().optional(),\n })\n .describe(\"Defines a component on the PCB\")\n\nexport type CadComponentInput = z.input<typeof cad_component>\nexport type CadComponent = z.infer<typeof cad_component>\n","import { z } from \"zod\"\nimport * as pcb from \"./pcb\"\nimport * as sch from \"./schematic\"\nimport * as src from \"./source\"\nimport * as cad from \"./cad\"\n\nexport const any_circuit_element = z.union([\n // TODO source_group\n // TODO source_config\n // TODO pcb_group\n // TODO pcb_config\n // TODO schematic_config\n // TODO schematic_group\n src.source_trace,\n src.source_port,\n src.any_source_component,\n src.source_led,\n src.source_net,\n src.source_group,\n src.source_simple_bug,\n src.source_simple_chip,\n src.source_simple_capacitor,\n src.source_simple_diode,\n src.source_simple_resistor,\n src.source_simple_power_source,\n src.source_simple_battery,\n pcb.pcb_component,\n pcb.pcb_hole,\n pcb.pcb_plated_hole,\n pcb.pcb_keepout,\n pcb.pcb_port,\n pcb.pcb_text,\n pcb.pcb_trace,\n pcb.pcb_via,\n pcb.pcb_smtpad,\n pcb.pcb_solder_paste,\n pcb.pcb_board,\n pcb.pcb_trace_hint,\n pcb.pcb_silkscreen_line,\n pcb.pcb_silkscreen_path,\n pcb.pcb_silkscreen_text,\n pcb.pcb_silkscreen_rect,\n pcb.pcb_silkscreen_circle,\n pcb.pcb_silkscreen_oval,\n pcb.pcb_trace_error,\n pcb.pcb_placement_error,\n pcb.pcb_port_not_matched_error,\n pcb.pcb_fabrication_note_path,\n pcb.pcb_fabrication_note_text,\n sch.schematic_box,\n sch.schematic_text,\n sch.schematic_line,\n sch.schematic_component,\n sch.schematic_port,\n sch.schematic_trace,\n sch.schematic_path,\n sch.schematic_error,\n sch.schematic_net_label,\n sch.schematic_debug_object,\n cad.cad_component,\n])\n\n/**\n * @deprecated use any_circuit_element instead\n */\nexport const any_soup_element = any_circuit_element\n\nexport type AnyCircuitElement = z.infer<typeof any_circuit_element>\nexport type AnyCircuitElementInput = z.input<typeof any_circuit_element>\n/**\n * @deprecated use AnyCircuitElement instead\n */\nexport type AnySoupElement = AnyCircuitElement\n\n/**\n * @deprecated use AnyCircuitElementInput instead\n */\nexport type AnySoupElementInput = AnyCircuitElementInput\n"],"mappings":";AAKA,IAAM,eAGF;AA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AA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACN,CAAC;AAKM,IAAM,mBAAmB;","names":["z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "circuit-json",
3
- "version": "0.0.95",
3
+ "version": "0.0.97",
4
4
  "description": "Definitions for the tscircuit intermediary JSON format",
5
5
  "main": "dist/index.mjs",
6
6
  "files": [