@tscircuit/props 0.0.239 → 0.0.241

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.js CHANGED
@@ -562,6 +562,7 @@ var distanceHiddenUndefined = z31.custom().transform((a) => {
562
562
  var platedHoleProps = z31.discriminatedUnion("shape", [
563
563
  pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
564
564
  name: z31.string().optional(),
565
+ connectsTo: z31.string().or(z31.array(z31.string())).optional(),
565
566
  shape: z31.literal("circle"),
566
567
  holeDiameter: distance10,
567
568
  outerDiameter: distance10,
@@ -569,6 +570,7 @@ var platedHoleProps = z31.discriminatedUnion("shape", [
569
570
  }),
570
571
  pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
571
572
  name: z31.string().optional(),
573
+ connectsTo: z31.string().or(z31.array(z31.string())).optional(),
572
574
  shape: z31.literal("oval"),
573
575
  outerWidth: distance10,
574
576
  outerHeight: distance10,
@@ -580,6 +582,7 @@ var platedHoleProps = z31.discriminatedUnion("shape", [
580
582
  }),
581
583
  pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
582
584
  name: z31.string().optional(),
585
+ connectsTo: z31.string().or(z31.array(z31.string())).optional(),
583
586
  shape: z31.literal("pill"),
584
587
  outerWidth: distance10,
585
588
  outerHeight: distance10,
@@ -591,6 +594,7 @@ var platedHoleProps = z31.discriminatedUnion("shape", [
591
594
  }),
592
595
  pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
593
596
  name: z31.string().optional(),
597
+ connectsTo: z31.string().or(z31.array(z31.string())).optional(),
594
598
  shape: z31.literal("circular_hole_with_rect_pad"),
595
599
  holeDiameter: distance10,
596
600
  rectPadWidth: distance10,
@@ -601,6 +605,7 @@ var platedHoleProps = z31.discriminatedUnion("shape", [
601
605
  }),
602
606
  pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
603
607
  name: z31.string().optional(),
608
+ connectsTo: z31.string().or(z31.array(z31.string())).optional(),
604
609
  shape: z31.literal("pill_hole_with_rect_pad"),
605
610
  holeShape: z31.literal("pill"),
606
611
  padShape: z31.literal("rect"),
@@ -819,6 +824,7 @@ var cutoutProps = z42.discriminatedUnion("shape", [
819
824
  // lib/components/smtpad.ts
820
825
  import { z as z43 } from "zod";
821
826
  var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
827
+ name: z43.string().optional(),
822
828
  shape: z43.literal("rect"),
823
829
  width: distance12,
824
830
  height: distance12,
@@ -826,6 +832,7 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
826
832
  });
827
833
  expectTypesMatch(true);
828
834
  var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
835
+ name: z43.string().optional(),
829
836
  shape: z43.literal("rotated_rect"),
830
837
  width: distance12,
831
838
  height: distance12,
@@ -834,12 +841,14 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
834
841
  });
835
842
  expectTypesMatch(true);
836
843
  var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
844
+ name: z43.string().optional(),
837
845
  shape: z43.literal("circle"),
838
846
  radius: distance12,
839
847
  portHints: portHints.optional()
840
848
  });
841
849
  expectTypesMatch(true);
842
850
  var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
851
+ name: z43.string().optional(),
843
852
  shape: z43.literal("pill"),
844
853
  width: distance12,
845
854
  height: distance12,
@@ -848,6 +857,7 @@ var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
848
857
  });
849
858
  expectTypesMatch(true);
850
859
  var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
860
+ name: z43.string().optional(),
851
861
  shape: z43.literal("polygon"),
852
862
  points: z43.array(point),
853
863
  portHints: portHints.optional()
@@ -1212,19 +1222,23 @@ var pcbTraceProps = z61.object({
1212
1222
 
1213
1223
  // lib/components/via.ts
1214
1224
  import { distance as distance16, layer_ref as layer_ref5 } from "circuit-json";
1225
+ import { z as z62 } from "zod";
1215
1226
  var viaProps = commonLayoutProps.extend({
1227
+ name: z62.string().optional(),
1216
1228
  fromLayer: layer_ref5,
1217
1229
  toLayer: layer_ref5,
1218
1230
  holeDiameter: distance16,
1219
- outerDiameter: distance16
1231
+ outerDiameter: distance16,
1232
+ connectsTo: z62.string().or(z62.array(z62.string())).optional()
1220
1233
  });
1234
+ expectTypesMatch(true);
1221
1235
 
1222
1236
  // lib/components/testpoint.ts
1223
1237
  import { distance as distance17 } from "circuit-json";
1224
- import { z as z62 } from "zod";
1238
+ import { z as z63 } from "zod";
1225
1239
  var testpointProps = commonComponentProps.extend({
1226
- footprintVariant: z62.enum(["pad", "through_hole"]).optional(),
1227
- padShape: z62.enum(["rect", "circle"]).optional().default("circle"),
1240
+ footprintVariant: z63.enum(["pad", "through_hole"]).optional(),
1241
+ padShape: z63.enum(["rect", "circle"]).optional().default("circle"),
1228
1242
  padDiameter: distance17.optional(),
1229
1243
  holeDiameter: distance17.optional(),
1230
1244
  width: distance17.optional(),
@@ -1236,22 +1250,22 @@ var testpointProps = commonComponentProps.extend({
1236
1250
  expectTypesMatch(true);
1237
1251
 
1238
1252
  // lib/components/breakoutpoint.ts
1239
- import { z as z63 } from "zod";
1253
+ import { z as z64 } from "zod";
1240
1254
  var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
1241
- connection: z63.string()
1255
+ connection: z64.string()
1242
1256
  });
1243
1257
  expectTypesMatch(true);
1244
1258
 
1245
1259
  // lib/components/pcb-keepout.ts
1246
1260
  import { distance as distance18 } from "circuit-json";
1247
- import { z as z64 } from "zod";
1248
- var pcbKeepoutProps = z64.union([
1261
+ import { z as z65 } from "zod";
1262
+ var pcbKeepoutProps = z65.union([
1249
1263
  pcbLayoutProps.omit({ pcbRotation: true }).extend({
1250
- shape: z64.literal("circle"),
1264
+ shape: z65.literal("circle"),
1251
1265
  radius: distance18
1252
1266
  }),
1253
1267
  pcbLayoutProps.extend({
1254
- shape: z64.literal("rect"),
1268
+ shape: z65.literal("rect"),
1255
1269
  width: distance18,
1256
1270
  height: distance18
1257
1271
  })
@@ -1265,11 +1279,11 @@ var powerSourceProps = commonComponentProps.extend({
1265
1279
 
1266
1280
  // lib/components/schematic-box.ts
1267
1281
  import { distance as distance19 } from "circuit-json";
1268
- import { z as z66 } from "zod";
1282
+ import { z as z67 } from "zod";
1269
1283
 
1270
1284
  // lib/common/ninePointAnchor.ts
1271
- import { z as z65 } from "zod";
1272
- var ninePointAnchor = z65.enum([
1285
+ import { z as z66 } from "zod";
1286
+ var ninePointAnchor = z66.enum([
1273
1287
  "top_left",
1274
1288
  "top_center",
1275
1289
  "top_right",
@@ -1282,23 +1296,23 @@ var ninePointAnchor = z65.enum([
1282
1296
  ]);
1283
1297
 
1284
1298
  // lib/components/schematic-box.ts
1285
- var schematicBoxProps = z66.object({
1299
+ var schematicBoxProps = z67.object({
1286
1300
  schX: distance19.optional(),
1287
1301
  schY: distance19.optional(),
1288
1302
  width: distance19.optional(),
1289
1303
  height: distance19.optional(),
1290
- overlay: z66.array(z66.string()).optional(),
1304
+ overlay: z67.array(z67.string()).optional(),
1291
1305
  padding: distance19.optional(),
1292
1306
  paddingLeft: distance19.optional(),
1293
1307
  paddingRight: distance19.optional(),
1294
1308
  paddingTop: distance19.optional(),
1295
1309
  paddingBottom: distance19.optional(),
1296
- title: z66.string().optional(),
1310
+ title: z67.string().optional(),
1297
1311
  titleAlignment: ninePointAnchor.default("top_left"),
1298
- titleColor: z66.string().optional(),
1312
+ titleColor: z67.string().optional(),
1299
1313
  titleFontSize: distance19.optional(),
1300
- titleInside: z66.boolean().default(false),
1301
- strokeStyle: z66.enum(["solid", "dashed"]).default("solid")
1314
+ titleInside: z67.boolean().default(false),
1315
+ strokeStyle: z67.enum(["solid", "dashed"]).default("solid")
1302
1316
  }).refine(
1303
1317
  (elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
1304
1318
  {
@@ -1313,8 +1327,8 @@ var schematicBoxProps = z66.object({
1313
1327
 
1314
1328
  // lib/components/schematic-line.ts
1315
1329
  import { distance as distance20 } from "circuit-json";
1316
- import { z as z67 } from "zod";
1317
- var schematicLineProps = z67.object({
1330
+ import { z as z68 } from "zod";
1331
+ var schematicLineProps = z68.object({
1318
1332
  x1: distance20,
1319
1333
  y1: distance20,
1320
1334
  x2: distance20,
@@ -1323,11 +1337,11 @@ var schematicLineProps = z67.object({
1323
1337
 
1324
1338
  // lib/components/schematic-text.ts
1325
1339
  import { distance as distance21, rotation as rotation4 } from "circuit-json";
1326
- import { z as z69 } from "zod";
1340
+ import { z as z70 } from "zod";
1327
1341
 
1328
1342
  // lib/common/fivePointAnchor.ts
1329
- import { z as z68 } from "zod";
1330
- var fivePointAnchor = z68.enum([
1343
+ import { z as z69 } from "zod";
1344
+ var fivePointAnchor = z69.enum([
1331
1345
  "center",
1332
1346
  "left",
1333
1347
  "right",
@@ -1336,40 +1350,40 @@ var fivePointAnchor = z68.enum([
1336
1350
  ]);
1337
1351
 
1338
1352
  // lib/components/schematic-text.ts
1339
- var schematicTextProps = z69.object({
1353
+ var schematicTextProps = z70.object({
1340
1354
  schX: distance21.optional(),
1341
1355
  schY: distance21.optional(),
1342
- text: z69.string(),
1343
- fontSize: z69.number().default(1),
1344
- anchor: z69.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
1345
- color: z69.string().default("#000000"),
1356
+ text: z70.string(),
1357
+ fontSize: z70.number().default(1),
1358
+ anchor: z70.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
1359
+ color: z70.string().default("#000000"),
1346
1360
  schRotation: rotation4.default(0)
1347
1361
  });
1348
1362
 
1349
1363
  // lib/components/schematic-path.ts
1350
1364
  import { point as point5 } from "circuit-json";
1351
- import { z as z70 } from "zod";
1352
- var schematicPathProps = z70.object({
1353
- points: z70.array(point5),
1354
- isFilled: z70.boolean().optional().default(false),
1355
- fillColor: z70.enum(["red", "blue"]).optional()
1365
+ import { z as z71 } from "zod";
1366
+ var schematicPathProps = z71.object({
1367
+ points: z71.array(point5),
1368
+ isFilled: z71.boolean().optional().default(false),
1369
+ fillColor: z71.enum(["red", "blue"]).optional()
1356
1370
  });
1357
1371
 
1358
1372
  // lib/components/silkscreen-text.ts
1359
1373
  import { length as length5 } from "circuit-json";
1360
- import { z as z71 } from "zod";
1374
+ import { z as z72 } from "zod";
1361
1375
  var silkscreenTextProps = pcbLayoutProps.extend({
1362
- text: z71.string(),
1376
+ text: z72.string(),
1363
1377
  anchorAlignment: ninePointAnchor.default("center"),
1364
- font: z71.enum(["tscircuit2024"]).optional(),
1378
+ font: z72.enum(["tscircuit2024"]).optional(),
1365
1379
  fontSize: length5.optional()
1366
1380
  });
1367
1381
 
1368
1382
  // lib/components/silkscreen-path.ts
1369
1383
  import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
1370
- import { z as z72 } from "zod";
1384
+ import { z as z73 } from "zod";
1371
1385
  var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
1372
- route: z72.array(route_hint_point5),
1386
+ route: z73.array(route_hint_point5),
1373
1387
  strokeWidth: length6.optional()
1374
1388
  });
1375
1389
 
@@ -1385,10 +1399,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
1385
1399
 
1386
1400
  // lib/components/silkscreen-rect.ts
1387
1401
  import { distance as distance23 } from "circuit-json";
1388
- import { z as z73 } from "zod";
1402
+ import { z as z74 } from "zod";
1389
1403
  var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
1390
- filled: z73.boolean().default(true).optional(),
1391
- stroke: z73.enum(["dashed", "solid", "none"]).optional(),
1404
+ filled: z74.boolean().default(true).optional(),
1405
+ stroke: z74.enum(["dashed", "solid", "none"]).optional(),
1392
1406
  strokeWidth: distance23.optional(),
1393
1407
  width: distance23,
1394
1408
  height: distance23
@@ -1396,60 +1410,60 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
1396
1410
 
1397
1411
  // lib/components/silkscreen-circle.ts
1398
1412
  import { distance as distance24 } from "circuit-json";
1399
- import { z as z74 } from "zod";
1413
+ import { z as z75 } from "zod";
1400
1414
  var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
1401
- isFilled: z74.boolean().optional(),
1402
- isOutline: z74.boolean().optional(),
1415
+ isFilled: z75.boolean().optional(),
1416
+ isOutline: z75.boolean().optional(),
1403
1417
  strokeWidth: distance24.optional(),
1404
1418
  radius: distance24
1405
1419
  });
1406
1420
 
1407
1421
  // lib/components/trace-hint.ts
1408
1422
  import { distance as distance25, layer_ref as layer_ref6, route_hint_point as route_hint_point6 } from "circuit-json";
1409
- import { z as z75 } from "zod";
1410
- var routeHintPointProps = z75.object({
1423
+ import { z as z76 } from "zod";
1424
+ var routeHintPointProps = z76.object({
1411
1425
  x: distance25,
1412
1426
  y: distance25,
1413
- via: z75.boolean().optional(),
1427
+ via: z76.boolean().optional(),
1414
1428
  toLayer: layer_ref6.optional()
1415
1429
  });
1416
- var traceHintProps = z75.object({
1417
- for: z75.string().optional().describe(
1430
+ var traceHintProps = z76.object({
1431
+ for: z76.string().optional().describe(
1418
1432
  "Selector for the port you're targeting, not required if you're inside a trace"
1419
1433
  ),
1420
- order: z75.number().optional(),
1434
+ order: z76.number().optional(),
1421
1435
  offset: route_hint_point6.or(routeHintPointProps).optional(),
1422
- offsets: z75.array(route_hint_point6).or(z75.array(routeHintPointProps)).optional(),
1423
- traceWidth: z75.number().optional()
1436
+ offsets: z76.array(route_hint_point6).or(z76.array(routeHintPointProps)).optional(),
1437
+ traceWidth: z76.number().optional()
1424
1438
  });
1425
1439
 
1426
1440
  // lib/components/port.ts
1427
- import { z as z76 } from "zod";
1441
+ import { z as z77 } from "zod";
1428
1442
  var portProps = commonLayoutProps.extend({
1429
- name: z76.string(),
1430
- pinNumber: z76.number().optional(),
1431
- aliases: z76.array(z76.string()).optional(),
1443
+ name: z77.string(),
1444
+ pinNumber: z77.number().optional(),
1445
+ aliases: z77.array(z77.string()).optional(),
1432
1446
  direction
1433
1447
  });
1434
1448
 
1435
1449
  // lib/platformConfig.ts
1436
- import { z as z77 } from "zod";
1437
- var unvalidatedCircuitJson = z77.array(z77.any()).describe("Circuit JSON");
1438
- var pathToCircuitJsonFn = z77.function().args(z77.string()).returns(z77.promise(z77.object({ footprintCircuitJson: z77.array(z77.any()) }))).describe("A function that takes a path and returns Circuit JSON");
1439
- var platformConfig = z77.object({
1450
+ import { z as z78 } from "zod";
1451
+ var unvalidatedCircuitJson = z78.array(z78.any()).describe("Circuit JSON");
1452
+ var pathToCircuitJsonFn = z78.function().args(z78.string()).returns(z78.promise(z78.object({ footprintCircuitJson: z78.array(z78.any()) }))).describe("A function that takes a path and returns Circuit JSON");
1453
+ var platformConfig = z78.object({
1440
1454
  partsEngine: partsEngine.optional(),
1441
1455
  autorouter: autorouterProp.optional(),
1442
- registryApiUrl: z77.string().optional(),
1443
- cloudAutorouterUrl: z77.string().optional(),
1444
- localCacheEngine: z77.any().optional(),
1445
- pcbDisabled: z77.boolean().optional(),
1446
- schematicDisabled: z77.boolean().optional(),
1447
- partsEngineDisabled: z77.boolean().optional(),
1448
- footprintLibraryMap: z77.record(
1449
- z77.string(),
1450
- z77.record(
1451
- z77.string(),
1452
- z77.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
1456
+ registryApiUrl: z78.string().optional(),
1457
+ cloudAutorouterUrl: z78.string().optional(),
1458
+ localCacheEngine: z78.any().optional(),
1459
+ pcbDisabled: z78.boolean().optional(),
1460
+ schematicDisabled: z78.boolean().optional(),
1461
+ partsEngineDisabled: z78.boolean().optional(),
1462
+ footprintLibraryMap: z78.record(
1463
+ z78.string(),
1464
+ z78.record(
1465
+ z78.string(),
1466
+ z78.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
1453
1467
  )
1454
1468
  ).optional()
1455
1469
  });