@tscircuit/props 0.0.341 → 0.0.343
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/README.md +13 -1
- package/dist/index.d.ts +64 -2
- package/dist/index.js +201 -184
- package/dist/index.js.map +1 -1
- package/lib/components/analogsimulation.ts +16 -0
- package/lib/components/board.ts +36 -0
- package/lib/index.ts +1 -0
- package/lib/platformConfig.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -627,12 +627,19 @@ expectTypesMatch(true);
|
|
|
627
627
|
expectTypesMatch(true);
|
|
628
628
|
|
|
629
629
|
// lib/components/board.ts
|
|
630
|
+
var boardColor = z28.custom((value) => typeof value === "string");
|
|
630
631
|
var boardProps = subcircuitGroupProps.extend({
|
|
631
632
|
material: z28.enum(["fr4", "fr1"]).default("fr4"),
|
|
632
633
|
layers: z28.union([z28.literal(2), z28.literal(4)]).default(2),
|
|
633
634
|
borderRadius: distance.optional(),
|
|
634
635
|
boardAnchorPosition: point.optional(),
|
|
635
|
-
boardAnchorAlignment: ninePointAnchor.optional()
|
|
636
|
+
boardAnchorAlignment: ninePointAnchor.optional(),
|
|
637
|
+
solderMaskColor: boardColor.optional(),
|
|
638
|
+
topSolderMaskColor: boardColor.optional(),
|
|
639
|
+
bottomSolderMaskColor: boardColor.optional(),
|
|
640
|
+
silkscreenColor: boardColor.optional(),
|
|
641
|
+
topSilkscreenColor: boardColor.optional(),
|
|
642
|
+
bottomSilkscreenColor: boardColor.optional()
|
|
636
643
|
});
|
|
637
644
|
expectTypesMatch(true);
|
|
638
645
|
|
|
@@ -1270,8 +1277,17 @@ expectTypesMatch(true);
|
|
|
1270
1277
|
var subcircuitProps = subcircuitGroupProps;
|
|
1271
1278
|
expectTypesMatch(true);
|
|
1272
1279
|
|
|
1273
|
-
// lib/components/
|
|
1280
|
+
// lib/components/analogsimulation.ts
|
|
1274
1281
|
import { z as z58 } from "zod";
|
|
1282
|
+
var analogSimulationProps = z58.object({
|
|
1283
|
+
simulationType: z58.literal("spice_transient_analysis").default("spice_transient_analysis")
|
|
1284
|
+
});
|
|
1285
|
+
expectTypesMatch(
|
|
1286
|
+
true
|
|
1287
|
+
);
|
|
1288
|
+
|
|
1289
|
+
// lib/components/transistor.ts
|
|
1290
|
+
import { z as z59 } from "zod";
|
|
1275
1291
|
var transistorPinsLabels = [
|
|
1276
1292
|
"pin1",
|
|
1277
1293
|
"pin2",
|
|
@@ -1284,7 +1300,7 @@ var transistorPinsLabels = [
|
|
|
1284
1300
|
"drain"
|
|
1285
1301
|
];
|
|
1286
1302
|
var transistorProps = commonComponentProps.extend({
|
|
1287
|
-
type:
|
|
1303
|
+
type: z59.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
1288
1304
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
1289
1305
|
});
|
|
1290
1306
|
var transistorPins = [
|
|
@@ -1298,10 +1314,10 @@ var transistorPins = [
|
|
|
1298
1314
|
expectTypesMatch(true);
|
|
1299
1315
|
|
|
1300
1316
|
// lib/components/mosfet.ts
|
|
1301
|
-
import { z as
|
|
1317
|
+
import { z as z60 } from "zod";
|
|
1302
1318
|
var mosfetProps = commonComponentProps.extend({
|
|
1303
|
-
channelType:
|
|
1304
|
-
mosfetMode:
|
|
1319
|
+
channelType: z60.enum(["n", "p"]),
|
|
1320
|
+
mosfetMode: z60.enum(["enhancement", "depletion"])
|
|
1305
1321
|
});
|
|
1306
1322
|
var mosfetPins = [
|
|
1307
1323
|
"pin1",
|
|
@@ -1315,19 +1331,19 @@ expectTypesMatch(true);
|
|
|
1315
1331
|
|
|
1316
1332
|
// lib/components/inductor.ts
|
|
1317
1333
|
import { inductance } from "circuit-json";
|
|
1318
|
-
import { z as
|
|
1334
|
+
import { z as z61 } from "zod";
|
|
1319
1335
|
var inductorPins = lrPins;
|
|
1320
1336
|
var inductorProps = commonComponentProps.extend({
|
|
1321
1337
|
inductance,
|
|
1322
|
-
maxCurrentRating:
|
|
1338
|
+
maxCurrentRating: z61.union([z61.string(), z61.number()]).optional(),
|
|
1323
1339
|
schOrientation: schematicOrientation.optional(),
|
|
1324
1340
|
connections: createConnectionsProp(inductorPins).optional()
|
|
1325
1341
|
});
|
|
1326
1342
|
expectTypesMatch(true);
|
|
1327
1343
|
|
|
1328
1344
|
// lib/components/diode.ts
|
|
1329
|
-
import { z as
|
|
1330
|
-
var diodeConnectionKeys =
|
|
1345
|
+
import { z as z62 } from "zod";
|
|
1346
|
+
var diodeConnectionKeys = z62.enum([
|
|
1331
1347
|
"anode",
|
|
1332
1348
|
"cathode",
|
|
1333
1349
|
"pin1",
|
|
@@ -1335,9 +1351,9 @@ var diodeConnectionKeys = z61.enum([
|
|
|
1335
1351
|
"pos",
|
|
1336
1352
|
"neg"
|
|
1337
1353
|
]);
|
|
1338
|
-
var connectionTarget3 =
|
|
1339
|
-
var connectionsProp2 =
|
|
1340
|
-
var diodeVariant =
|
|
1354
|
+
var connectionTarget3 = z62.string().or(z62.array(z62.string()).readonly()).or(z62.array(z62.string()));
|
|
1355
|
+
var connectionsProp2 = z62.record(diodeConnectionKeys, connectionTarget3);
|
|
1356
|
+
var diodeVariant = z62.enum([
|
|
1341
1357
|
"standard",
|
|
1342
1358
|
"schottky",
|
|
1343
1359
|
"zener",
|
|
@@ -1348,12 +1364,12 @@ var diodeVariant = z61.enum([
|
|
|
1348
1364
|
var diodeProps = commonComponentProps.extend({
|
|
1349
1365
|
connections: connectionsProp2.optional(),
|
|
1350
1366
|
variant: diodeVariant.optional().default("standard"),
|
|
1351
|
-
standard:
|
|
1352
|
-
schottky:
|
|
1353
|
-
zener:
|
|
1354
|
-
avalanche:
|
|
1355
|
-
photo:
|
|
1356
|
-
tvs:
|
|
1367
|
+
standard: z62.boolean().optional(),
|
|
1368
|
+
schottky: z62.boolean().optional(),
|
|
1369
|
+
zener: z62.boolean().optional(),
|
|
1370
|
+
avalanche: z62.boolean().optional(),
|
|
1371
|
+
photo: z62.boolean().optional(),
|
|
1372
|
+
tvs: z62.boolean().optional(),
|
|
1357
1373
|
schOrientation: schematicOrientation.optional()
|
|
1358
1374
|
}).superRefine((data, ctx) => {
|
|
1359
1375
|
const enabledFlags = [
|
|
@@ -1366,11 +1382,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
1366
1382
|
].filter(Boolean).length;
|
|
1367
1383
|
if (enabledFlags > 1) {
|
|
1368
1384
|
ctx.addIssue({
|
|
1369
|
-
code:
|
|
1385
|
+
code: z62.ZodIssueCode.custom,
|
|
1370
1386
|
message: "Exactly one diode variant must be enabled",
|
|
1371
1387
|
path: []
|
|
1372
1388
|
});
|
|
1373
|
-
return
|
|
1389
|
+
return z62.INVALID;
|
|
1374
1390
|
}
|
|
1375
1391
|
}).transform((data) => {
|
|
1376
1392
|
const result = {
|
|
@@ -1417,26 +1433,26 @@ var diodePins = lrPolarPins;
|
|
|
1417
1433
|
expectTypesMatch(true);
|
|
1418
1434
|
|
|
1419
1435
|
// lib/components/led.ts
|
|
1420
|
-
import { z as
|
|
1436
|
+
import { z as z63 } from "zod";
|
|
1421
1437
|
var ledProps = commonComponentProps.extend({
|
|
1422
|
-
color:
|
|
1423
|
-
wavelength:
|
|
1424
|
-
schDisplayValue:
|
|
1438
|
+
color: z63.string().optional(),
|
|
1439
|
+
wavelength: z63.string().optional(),
|
|
1440
|
+
schDisplayValue: z63.string().optional(),
|
|
1425
1441
|
schOrientation: schematicOrientation.optional(),
|
|
1426
1442
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
1427
|
-
laser:
|
|
1443
|
+
laser: z63.boolean().optional()
|
|
1428
1444
|
});
|
|
1429
1445
|
var ledPins = lrPolarPins;
|
|
1430
1446
|
|
|
1431
1447
|
// lib/components/switch.ts
|
|
1432
|
-
import { z as
|
|
1448
|
+
import { z as z64 } from "zod";
|
|
1433
1449
|
var switchProps = commonComponentProps.extend({
|
|
1434
|
-
type:
|
|
1435
|
-
isNormallyClosed:
|
|
1436
|
-
spst:
|
|
1437
|
-
spdt:
|
|
1438
|
-
dpst:
|
|
1439
|
-
dpdt:
|
|
1450
|
+
type: z64.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
1451
|
+
isNormallyClosed: z64.boolean().optional().default(false),
|
|
1452
|
+
spst: z64.boolean().optional(),
|
|
1453
|
+
spdt: z64.boolean().optional(),
|
|
1454
|
+
dpst: z64.boolean().optional(),
|
|
1455
|
+
dpdt: z64.boolean().optional()
|
|
1440
1456
|
}).transform((props) => {
|
|
1441
1457
|
const updatedProps = { ...props };
|
|
1442
1458
|
if (updatedProps.dpdt) {
|
|
@@ -1468,52 +1484,52 @@ expectTypesMatch(true);
|
|
|
1468
1484
|
|
|
1469
1485
|
// lib/components/fabrication-note-text.ts
|
|
1470
1486
|
import { length as length3 } from "circuit-json";
|
|
1471
|
-
import { z as
|
|
1487
|
+
import { z as z65 } from "zod";
|
|
1472
1488
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
1473
|
-
text:
|
|
1474
|
-
anchorAlignment:
|
|
1475
|
-
font:
|
|
1489
|
+
text: z65.string(),
|
|
1490
|
+
anchorAlignment: z65.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1491
|
+
font: z65.enum(["tscircuit2024"]).optional(),
|
|
1476
1492
|
fontSize: length3.optional(),
|
|
1477
|
-
color:
|
|
1493
|
+
color: z65.string().optional()
|
|
1478
1494
|
});
|
|
1479
1495
|
|
|
1480
1496
|
// lib/components/fabrication-note-path.ts
|
|
1481
1497
|
import { length as length4, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
1482
|
-
import { z as
|
|
1498
|
+
import { z as z66 } from "zod";
|
|
1483
1499
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1484
|
-
route:
|
|
1500
|
+
route: z66.array(route_hint_point3),
|
|
1485
1501
|
strokeWidth: length4.optional(),
|
|
1486
|
-
color:
|
|
1502
|
+
color: z66.string().optional()
|
|
1487
1503
|
});
|
|
1488
1504
|
|
|
1489
1505
|
// lib/components/pcb-trace.ts
|
|
1490
1506
|
import { distance as distance15, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
1491
|
-
import { z as
|
|
1492
|
-
var pcbTraceProps =
|
|
1493
|
-
layer:
|
|
1507
|
+
import { z as z67 } from "zod";
|
|
1508
|
+
var pcbTraceProps = z67.object({
|
|
1509
|
+
layer: z67.string().optional(),
|
|
1494
1510
|
thickness: distance15.optional(),
|
|
1495
|
-
route:
|
|
1511
|
+
route: z67.array(route_hint_point4)
|
|
1496
1512
|
});
|
|
1497
1513
|
|
|
1498
1514
|
// lib/components/via.ts
|
|
1499
1515
|
import { distance as distance16, layer_ref as layer_ref5 } from "circuit-json";
|
|
1500
|
-
import { z as
|
|
1516
|
+
import { z as z68 } from "zod";
|
|
1501
1517
|
var viaProps = commonLayoutProps.extend({
|
|
1502
|
-
name:
|
|
1518
|
+
name: z68.string().optional(),
|
|
1503
1519
|
fromLayer: layer_ref5,
|
|
1504
1520
|
toLayer: layer_ref5,
|
|
1505
1521
|
holeDiameter: distance16,
|
|
1506
1522
|
outerDiameter: distance16,
|
|
1507
|
-
connectsTo:
|
|
1523
|
+
connectsTo: z68.string().or(z68.array(z68.string())).optional()
|
|
1508
1524
|
});
|
|
1509
1525
|
expectTypesMatch(true);
|
|
1510
1526
|
|
|
1511
1527
|
// lib/components/testpoint.ts
|
|
1512
1528
|
import { distance as distance17 } from "circuit-json";
|
|
1513
|
-
import { z as
|
|
1529
|
+
import { z as z69 } from "zod";
|
|
1514
1530
|
var testpointProps = commonComponentProps.extend({
|
|
1515
|
-
footprintVariant:
|
|
1516
|
-
padShape:
|
|
1531
|
+
footprintVariant: z69.enum(["pad", "through_hole"]).optional(),
|
|
1532
|
+
padShape: z69.enum(["rect", "circle"]).optional().default("circle"),
|
|
1517
1533
|
padDiameter: distance17.optional(),
|
|
1518
1534
|
holeDiameter: distance17.optional(),
|
|
1519
1535
|
width: distance17.optional(),
|
|
@@ -1525,34 +1541,34 @@ var testpointProps = commonComponentProps.extend({
|
|
|
1525
1541
|
expectTypesMatch(true);
|
|
1526
1542
|
|
|
1527
1543
|
// lib/components/breakoutpoint.ts
|
|
1528
|
-
import { z as
|
|
1544
|
+
import { z as z70 } from "zod";
|
|
1529
1545
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1530
|
-
connection:
|
|
1546
|
+
connection: z70.string()
|
|
1531
1547
|
});
|
|
1532
1548
|
expectTypesMatch(true);
|
|
1533
1549
|
|
|
1534
1550
|
// lib/components/pcb-keepout.ts
|
|
1535
1551
|
import { distance as distance18 } from "circuit-json";
|
|
1536
|
-
import { z as
|
|
1537
|
-
var pcbKeepoutProps =
|
|
1552
|
+
import { z as z71 } from "zod";
|
|
1553
|
+
var pcbKeepoutProps = z71.union([
|
|
1538
1554
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1539
|
-
shape:
|
|
1555
|
+
shape: z71.literal("circle"),
|
|
1540
1556
|
radius: distance18
|
|
1541
1557
|
}),
|
|
1542
1558
|
pcbLayoutProps.extend({
|
|
1543
|
-
shape:
|
|
1559
|
+
shape: z71.literal("rect"),
|
|
1544
1560
|
width: distance18,
|
|
1545
1561
|
height: distance18
|
|
1546
1562
|
})
|
|
1547
1563
|
]);
|
|
1548
1564
|
|
|
1549
1565
|
// lib/components/copper-pour.ts
|
|
1550
|
-
import { z as
|
|
1566
|
+
import { z as z72 } from "zod";
|
|
1551
1567
|
import { layer_ref as layer_ref6 } from "circuit-json";
|
|
1552
|
-
var copperPourProps =
|
|
1553
|
-
name:
|
|
1568
|
+
var copperPourProps = z72.object({
|
|
1569
|
+
name: z72.string().optional(),
|
|
1554
1570
|
layer: layer_ref6,
|
|
1555
|
-
connectsTo:
|
|
1571
|
+
connectsTo: z72.string(),
|
|
1556
1572
|
padMargin: distance.optional(),
|
|
1557
1573
|
traceMargin: distance.optional()
|
|
1558
1574
|
});
|
|
@@ -1560,26 +1576,26 @@ expectTypesMatch(true);
|
|
|
1560
1576
|
|
|
1561
1577
|
// lib/components/cadassembly.ts
|
|
1562
1578
|
import { layer_ref as layer_ref7 } from "circuit-json";
|
|
1563
|
-
import { z as
|
|
1564
|
-
var cadassemblyProps =
|
|
1579
|
+
import { z as z73 } from "zod";
|
|
1580
|
+
var cadassemblyProps = z73.object({
|
|
1565
1581
|
originalLayer: layer_ref7.default("top").optional(),
|
|
1566
|
-
children:
|
|
1582
|
+
children: z73.any().optional()
|
|
1567
1583
|
});
|
|
1568
1584
|
expectTypesMatch(true);
|
|
1569
1585
|
|
|
1570
1586
|
// lib/components/cadmodel.ts
|
|
1571
|
-
import { z as
|
|
1572
|
-
var pcbPosition =
|
|
1587
|
+
import { z as z74 } from "zod";
|
|
1588
|
+
var pcbPosition = z74.object({
|
|
1573
1589
|
pcbX: distance.optional(),
|
|
1574
1590
|
pcbY: distance.optional(),
|
|
1575
1591
|
pcbZ: distance.optional()
|
|
1576
1592
|
});
|
|
1577
1593
|
var cadModelBaseWithUrl = cadModelBase.extend({
|
|
1578
|
-
modelUrl:
|
|
1594
|
+
modelUrl: z74.string()
|
|
1579
1595
|
});
|
|
1580
1596
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
1581
1597
|
expectTypesMatch(true);
|
|
1582
|
-
var cadmodelProps =
|
|
1598
|
+
var cadmodelProps = z74.union([z74.null(), z74.string(), cadModelObject]);
|
|
1583
1599
|
|
|
1584
1600
|
// lib/components/power-source.ts
|
|
1585
1601
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -1589,9 +1605,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
1589
1605
|
|
|
1590
1606
|
// lib/components/voltagesource.ts
|
|
1591
1607
|
import { frequency as frequency3, rotation as rotation4, voltage as voltage4 } from "circuit-json";
|
|
1592
|
-
import { z as
|
|
1608
|
+
import { z as z75 } from "zod";
|
|
1593
1609
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
1594
|
-
var percentage =
|
|
1610
|
+
var percentage = z75.union([z75.string(), z75.number()]).transform((val) => {
|
|
1595
1611
|
if (typeof val === "string") {
|
|
1596
1612
|
if (val.endsWith("%")) {
|
|
1597
1613
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -1600,13 +1616,13 @@ var percentage = z74.union([z74.string(), z74.number()]).transform((val) => {
|
|
|
1600
1616
|
}
|
|
1601
1617
|
return val;
|
|
1602
1618
|
}).pipe(
|
|
1603
|
-
|
|
1619
|
+
z75.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
1604
1620
|
);
|
|
1605
1621
|
var voltageSourceProps = commonComponentProps.extend({
|
|
1606
1622
|
voltage: voltage4.optional(),
|
|
1607
1623
|
frequency: frequency3.optional(),
|
|
1608
1624
|
peakToPeakVoltage: voltage4.optional(),
|
|
1609
|
-
waveShape:
|
|
1625
|
+
waveShape: z75.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
1610
1626
|
phase: rotation4.optional(),
|
|
1611
1627
|
dutyCycle: percentage.optional(),
|
|
1612
1628
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -1616,38 +1632,38 @@ expectTypesMatch(true);
|
|
|
1616
1632
|
|
|
1617
1633
|
// lib/components/schematic-arc.ts
|
|
1618
1634
|
import { distance as distance19, point as point5, rotation as rotation5 } from "circuit-json";
|
|
1619
|
-
import { z as
|
|
1620
|
-
var schematicArcProps =
|
|
1635
|
+
import { z as z76 } from "zod";
|
|
1636
|
+
var schematicArcProps = z76.object({
|
|
1621
1637
|
center: point5,
|
|
1622
1638
|
radius: distance19,
|
|
1623
1639
|
startAngleDegrees: rotation5,
|
|
1624
1640
|
endAngleDegrees: rotation5,
|
|
1625
|
-
direction:
|
|
1641
|
+
direction: z76.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
1626
1642
|
strokeWidth: distance19.optional(),
|
|
1627
|
-
color:
|
|
1628
|
-
isDashed:
|
|
1643
|
+
color: z76.string().optional().default("#000000"),
|
|
1644
|
+
isDashed: z76.boolean().optional().default(false)
|
|
1629
1645
|
});
|
|
1630
1646
|
|
|
1631
1647
|
// lib/components/schematic-box.ts
|
|
1632
1648
|
import { distance as distance20 } from "circuit-json";
|
|
1633
|
-
import { z as
|
|
1634
|
-
var schematicBoxProps =
|
|
1649
|
+
import { z as z77 } from "zod";
|
|
1650
|
+
var schematicBoxProps = z77.object({
|
|
1635
1651
|
schX: distance20.optional(),
|
|
1636
1652
|
schY: distance20.optional(),
|
|
1637
1653
|
width: distance20.optional(),
|
|
1638
1654
|
height: distance20.optional(),
|
|
1639
|
-
overlay:
|
|
1655
|
+
overlay: z77.array(z77.string()).optional(),
|
|
1640
1656
|
padding: distance20.optional(),
|
|
1641
1657
|
paddingLeft: distance20.optional(),
|
|
1642
1658
|
paddingRight: distance20.optional(),
|
|
1643
1659
|
paddingTop: distance20.optional(),
|
|
1644
1660
|
paddingBottom: distance20.optional(),
|
|
1645
|
-
title:
|
|
1661
|
+
title: z77.string().optional(),
|
|
1646
1662
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
1647
|
-
titleColor:
|
|
1663
|
+
titleColor: z77.string().optional(),
|
|
1648
1664
|
titleFontSize: distance20.optional(),
|
|
1649
|
-
titleInside:
|
|
1650
|
-
strokeStyle:
|
|
1665
|
+
titleInside: z77.boolean().default(false),
|
|
1666
|
+
strokeStyle: z77.enum(["solid", "dashed"]).default("solid")
|
|
1651
1667
|
}).refine(
|
|
1652
1668
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
1653
1669
|
{
|
|
@@ -1662,52 +1678,52 @@ var schematicBoxProps = z76.object({
|
|
|
1662
1678
|
|
|
1663
1679
|
// lib/components/schematic-circle.ts
|
|
1664
1680
|
import { distance as distance21, point as point6 } from "circuit-json";
|
|
1665
|
-
import { z as
|
|
1666
|
-
var schematicCircleProps =
|
|
1681
|
+
import { z as z78 } from "zod";
|
|
1682
|
+
var schematicCircleProps = z78.object({
|
|
1667
1683
|
center: point6,
|
|
1668
1684
|
radius: distance21,
|
|
1669
1685
|
strokeWidth: distance21.optional(),
|
|
1670
|
-
color:
|
|
1671
|
-
isFilled:
|
|
1672
|
-
fillColor:
|
|
1673
|
-
isDashed:
|
|
1686
|
+
color: z78.string().optional().default("#000000"),
|
|
1687
|
+
isFilled: z78.boolean().optional().default(false),
|
|
1688
|
+
fillColor: z78.string().optional(),
|
|
1689
|
+
isDashed: z78.boolean().optional().default(false)
|
|
1674
1690
|
});
|
|
1675
1691
|
|
|
1676
1692
|
// lib/components/schematic-rect.ts
|
|
1677
1693
|
import { distance as distance22, point as point7, rotation as rotation6 } from "circuit-json";
|
|
1678
|
-
import { z as
|
|
1679
|
-
var schematicRectProps =
|
|
1694
|
+
import { z as z79 } from "zod";
|
|
1695
|
+
var schematicRectProps = z79.object({
|
|
1680
1696
|
center: point7,
|
|
1681
1697
|
width: distance22,
|
|
1682
1698
|
height: distance22,
|
|
1683
1699
|
rotation: rotation6.default(0),
|
|
1684
1700
|
strokeWidth: distance22.optional(),
|
|
1685
|
-
color:
|
|
1686
|
-
isFilled:
|
|
1687
|
-
fillColor:
|
|
1688
|
-
isDashed:
|
|
1701
|
+
color: z79.string().optional().default("#000000"),
|
|
1702
|
+
isFilled: z79.boolean().optional().default(false),
|
|
1703
|
+
fillColor: z79.string().optional(),
|
|
1704
|
+
isDashed: z79.boolean().optional().default(false)
|
|
1689
1705
|
});
|
|
1690
1706
|
|
|
1691
1707
|
// lib/components/schematic-line.ts
|
|
1692
1708
|
import { distance as distance23 } from "circuit-json";
|
|
1693
|
-
import { z as
|
|
1694
|
-
var schematicLineProps =
|
|
1709
|
+
import { z as z80 } from "zod";
|
|
1710
|
+
var schematicLineProps = z80.object({
|
|
1695
1711
|
x1: distance23,
|
|
1696
1712
|
y1: distance23,
|
|
1697
1713
|
x2: distance23,
|
|
1698
1714
|
y2: distance23,
|
|
1699
1715
|
strokeWidth: distance23.optional(),
|
|
1700
|
-
color:
|
|
1701
|
-
isDashed:
|
|
1716
|
+
color: z80.string().optional().default("#000000"),
|
|
1717
|
+
isDashed: z80.boolean().optional().default(false)
|
|
1702
1718
|
});
|
|
1703
1719
|
|
|
1704
1720
|
// lib/components/schematic-text.ts
|
|
1705
1721
|
import { distance as distance24, rotation as rotation7 } from "circuit-json";
|
|
1706
|
-
import { z as
|
|
1722
|
+
import { z as z82 } from "zod";
|
|
1707
1723
|
|
|
1708
1724
|
// lib/common/fivePointAnchor.ts
|
|
1709
|
-
import { z as
|
|
1710
|
-
var fivePointAnchor =
|
|
1725
|
+
import { z as z81 } from "zod";
|
|
1726
|
+
var fivePointAnchor = z81.enum([
|
|
1711
1727
|
"center",
|
|
1712
1728
|
"left",
|
|
1713
1729
|
"right",
|
|
@@ -1716,32 +1732,32 @@ var fivePointAnchor = z80.enum([
|
|
|
1716
1732
|
]);
|
|
1717
1733
|
|
|
1718
1734
|
// lib/components/schematic-text.ts
|
|
1719
|
-
var schematicTextProps =
|
|
1735
|
+
var schematicTextProps = z82.object({
|
|
1720
1736
|
schX: distance24.optional(),
|
|
1721
1737
|
schY: distance24.optional(),
|
|
1722
|
-
text:
|
|
1723
|
-
fontSize:
|
|
1724
|
-
anchor:
|
|
1725
|
-
color:
|
|
1738
|
+
text: z82.string(),
|
|
1739
|
+
fontSize: z82.number().default(1),
|
|
1740
|
+
anchor: z82.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
1741
|
+
color: z82.string().default("#000000"),
|
|
1726
1742
|
schRotation: rotation7.default(0)
|
|
1727
1743
|
});
|
|
1728
1744
|
|
|
1729
1745
|
// lib/components/schematic-path.ts
|
|
1730
1746
|
import { point as point8 } from "circuit-json";
|
|
1731
|
-
import { z as
|
|
1732
|
-
var schematicPathProps =
|
|
1733
|
-
points:
|
|
1734
|
-
isFilled:
|
|
1735
|
-
fillColor:
|
|
1747
|
+
import { z as z83 } from "zod";
|
|
1748
|
+
var schematicPathProps = z83.object({
|
|
1749
|
+
points: z83.array(point8),
|
|
1750
|
+
isFilled: z83.boolean().optional().default(false),
|
|
1751
|
+
fillColor: z83.enum(["red", "blue"]).optional()
|
|
1736
1752
|
});
|
|
1737
1753
|
|
|
1738
1754
|
// lib/components/schematic-table.ts
|
|
1739
1755
|
import { distance as distance25 } from "circuit-json";
|
|
1740
|
-
import { z as
|
|
1741
|
-
var schematicTableProps =
|
|
1756
|
+
import { z as z84 } from "zod";
|
|
1757
|
+
var schematicTableProps = z84.object({
|
|
1742
1758
|
schX: distance25.optional(),
|
|
1743
1759
|
schY: distance25.optional(),
|
|
1744
|
-
children:
|
|
1760
|
+
children: z84.any().optional(),
|
|
1745
1761
|
cellPadding: distance25.optional(),
|
|
1746
1762
|
borderWidth: distance25.optional(),
|
|
1747
1763
|
anchor: ninePointAnchor.optional(),
|
|
@@ -1751,53 +1767,53 @@ expectTypesMatch(true);
|
|
|
1751
1767
|
|
|
1752
1768
|
// lib/components/schematic-row.ts
|
|
1753
1769
|
import { distance as distance26 } from "circuit-json";
|
|
1754
|
-
import { z as
|
|
1755
|
-
var schematicRowProps =
|
|
1756
|
-
children:
|
|
1770
|
+
import { z as z85 } from "zod";
|
|
1771
|
+
var schematicRowProps = z85.object({
|
|
1772
|
+
children: z85.any().optional(),
|
|
1757
1773
|
height: distance26.optional()
|
|
1758
1774
|
});
|
|
1759
1775
|
expectTypesMatch(true);
|
|
1760
1776
|
|
|
1761
1777
|
// lib/components/schematic-cell.ts
|
|
1762
1778
|
import { distance as distance27 } from "circuit-json";
|
|
1763
|
-
import { z as
|
|
1764
|
-
var schematicCellProps =
|
|
1765
|
-
children:
|
|
1766
|
-
horizontalAlign:
|
|
1767
|
-
verticalAlign:
|
|
1779
|
+
import { z as z86 } from "zod";
|
|
1780
|
+
var schematicCellProps = z86.object({
|
|
1781
|
+
children: z86.string().optional(),
|
|
1782
|
+
horizontalAlign: z86.enum(["left", "center", "right"]).optional(),
|
|
1783
|
+
verticalAlign: z86.enum(["top", "middle", "bottom"]).optional(),
|
|
1768
1784
|
fontSize: distance27.optional(),
|
|
1769
|
-
rowSpan:
|
|
1770
|
-
colSpan:
|
|
1785
|
+
rowSpan: z86.number().optional(),
|
|
1786
|
+
colSpan: z86.number().optional(),
|
|
1771
1787
|
width: distance27.optional(),
|
|
1772
|
-
text:
|
|
1788
|
+
text: z86.string().optional()
|
|
1773
1789
|
});
|
|
1774
1790
|
expectTypesMatch(true);
|
|
1775
1791
|
|
|
1776
1792
|
// lib/components/silkscreen-text.ts
|
|
1777
1793
|
import { layer_ref as layer_ref8, length as length5 } from "circuit-json";
|
|
1778
|
-
import { z as
|
|
1794
|
+
import { z as z87 } from "zod";
|
|
1779
1795
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
1780
|
-
text:
|
|
1796
|
+
text: z87.string(),
|
|
1781
1797
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
1782
|
-
font:
|
|
1798
|
+
font: z87.enum(["tscircuit2024"]).optional(),
|
|
1783
1799
|
fontSize: length5.optional(),
|
|
1784
1800
|
/**
|
|
1785
1801
|
* If true, text will knock out underlying silkscreen
|
|
1786
1802
|
*/
|
|
1787
|
-
isKnockout:
|
|
1803
|
+
isKnockout: z87.boolean().optional(),
|
|
1788
1804
|
knockoutPadding: length5.optional(),
|
|
1789
1805
|
knockoutPaddingLeft: length5.optional(),
|
|
1790
1806
|
knockoutPaddingRight: length5.optional(),
|
|
1791
1807
|
knockoutPaddingTop: length5.optional(),
|
|
1792
1808
|
knockoutPaddingBottom: length5.optional(),
|
|
1793
|
-
layers:
|
|
1809
|
+
layers: z87.array(layer_ref8).optional()
|
|
1794
1810
|
});
|
|
1795
1811
|
|
|
1796
1812
|
// lib/components/silkscreen-path.ts
|
|
1797
1813
|
import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
1798
|
-
import { z as
|
|
1814
|
+
import { z as z88 } from "zod";
|
|
1799
1815
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1800
|
-
route:
|
|
1816
|
+
route: z88.array(route_hint_point5),
|
|
1801
1817
|
strokeWidth: length6.optional()
|
|
1802
1818
|
});
|
|
1803
1819
|
|
|
@@ -1813,10 +1829,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
|
|
|
1813
1829
|
|
|
1814
1830
|
// lib/components/silkscreen-rect.ts
|
|
1815
1831
|
import { distance as distance29 } from "circuit-json";
|
|
1816
|
-
import { z as
|
|
1832
|
+
import { z as z89 } from "zod";
|
|
1817
1833
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1818
|
-
filled:
|
|
1819
|
-
stroke:
|
|
1834
|
+
filled: z89.boolean().default(true).optional(),
|
|
1835
|
+
stroke: z89.enum(["dashed", "solid", "none"]).optional(),
|
|
1820
1836
|
strokeWidth: distance29.optional(),
|
|
1821
1837
|
width: distance29,
|
|
1822
1838
|
height: distance29
|
|
@@ -1824,91 +1840,91 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1824
1840
|
|
|
1825
1841
|
// lib/components/silkscreen-circle.ts
|
|
1826
1842
|
import { distance as distance30 } from "circuit-json";
|
|
1827
|
-
import { z as
|
|
1843
|
+
import { z as z90 } from "zod";
|
|
1828
1844
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1829
|
-
isFilled:
|
|
1830
|
-
isOutline:
|
|
1845
|
+
isFilled: z90.boolean().optional(),
|
|
1846
|
+
isOutline: z90.boolean().optional(),
|
|
1831
1847
|
strokeWidth: distance30.optional(),
|
|
1832
1848
|
radius: distance30
|
|
1833
1849
|
});
|
|
1834
1850
|
|
|
1835
1851
|
// lib/components/trace-hint.ts
|
|
1836
1852
|
import { distance as distance31, layer_ref as layer_ref9, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
1837
|
-
import { z as
|
|
1838
|
-
var routeHintPointProps =
|
|
1853
|
+
import { z as z91 } from "zod";
|
|
1854
|
+
var routeHintPointProps = z91.object({
|
|
1839
1855
|
x: distance31,
|
|
1840
1856
|
y: distance31,
|
|
1841
|
-
via:
|
|
1857
|
+
via: z91.boolean().optional(),
|
|
1842
1858
|
toLayer: layer_ref9.optional()
|
|
1843
1859
|
});
|
|
1844
|
-
var traceHintProps =
|
|
1845
|
-
for:
|
|
1860
|
+
var traceHintProps = z91.object({
|
|
1861
|
+
for: z91.string().optional().describe(
|
|
1846
1862
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
1847
1863
|
),
|
|
1848
|
-
order:
|
|
1864
|
+
order: z91.number().optional(),
|
|
1849
1865
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
1850
|
-
offsets:
|
|
1851
|
-
traceWidth:
|
|
1866
|
+
offsets: z91.array(route_hint_point6).or(z91.array(routeHintPointProps)).optional(),
|
|
1867
|
+
traceWidth: z91.number().optional()
|
|
1852
1868
|
});
|
|
1853
1869
|
|
|
1854
1870
|
// lib/components/port.ts
|
|
1855
|
-
import { z as
|
|
1871
|
+
import { z as z92 } from "zod";
|
|
1856
1872
|
var portProps = commonLayoutProps.extend({
|
|
1857
|
-
name:
|
|
1858
|
-
pinNumber:
|
|
1859
|
-
aliases:
|
|
1873
|
+
name: z92.string(),
|
|
1874
|
+
pinNumber: z92.number().optional(),
|
|
1875
|
+
aliases: z92.array(z92.string()).optional(),
|
|
1860
1876
|
direction,
|
|
1861
|
-
connectsTo:
|
|
1877
|
+
connectsTo: z92.string().or(z92.array(z92.string())).optional()
|
|
1862
1878
|
});
|
|
1863
1879
|
|
|
1864
1880
|
// lib/platformConfig.ts
|
|
1865
|
-
import { z as
|
|
1866
|
-
var unvalidatedCircuitJson =
|
|
1867
|
-
var footprintLibraryResult =
|
|
1868
|
-
footprintCircuitJson:
|
|
1881
|
+
import { z as z93 } from "zod";
|
|
1882
|
+
var unvalidatedCircuitJson = z93.array(z93.any()).describe("Circuit JSON");
|
|
1883
|
+
var footprintLibraryResult = z93.object({
|
|
1884
|
+
footprintCircuitJson: z93.array(z93.any()),
|
|
1869
1885
|
cadModel: cadModelProp.optional()
|
|
1870
1886
|
});
|
|
1871
|
-
var pathToCircuitJsonFn =
|
|
1872
|
-
var footprintFileParserEntry =
|
|
1873
|
-
loadFromUrl:
|
|
1887
|
+
var pathToCircuitJsonFn = z93.function().args(z93.string()).returns(z93.promise(footprintLibraryResult)).describe("A function that takes a path and returns Circuit JSON");
|
|
1888
|
+
var footprintFileParserEntry = z93.object({
|
|
1889
|
+
loadFromUrl: z93.function().args(z93.string()).returns(z93.promise(footprintLibraryResult)).describe(
|
|
1874
1890
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
1875
1891
|
)
|
|
1876
1892
|
});
|
|
1877
|
-
var spiceEngineSimulationResult =
|
|
1878
|
-
engineVersionString:
|
|
1893
|
+
var spiceEngineSimulationResult = z93.object({
|
|
1894
|
+
engineVersionString: z93.string().optional(),
|
|
1879
1895
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
1880
1896
|
});
|
|
1881
|
-
var spiceEngineZod =
|
|
1882
|
-
simulate:
|
|
1897
|
+
var spiceEngineZod = z93.object({
|
|
1898
|
+
simulate: z93.function().args(z93.string()).returns(z93.promise(spiceEngineSimulationResult)).describe(
|
|
1883
1899
|
"A function that takes a SPICE string and returns a simulation result"
|
|
1884
1900
|
)
|
|
1885
1901
|
});
|
|
1886
|
-
var platformConfig =
|
|
1902
|
+
var platformConfig = z93.object({
|
|
1887
1903
|
partsEngine: partsEngine.optional(),
|
|
1888
1904
|
autorouter: autorouterProp.optional(),
|
|
1889
|
-
registryApiUrl:
|
|
1890
|
-
cloudAutorouterUrl:
|
|
1891
|
-
projectName:
|
|
1892
|
-
projectBaseUrl:
|
|
1893
|
-
version:
|
|
1894
|
-
url:
|
|
1895
|
-
printBoardInformationToSilkscreen:
|
|
1896
|
-
localCacheEngine:
|
|
1897
|
-
pcbDisabled:
|
|
1898
|
-
schematicDisabled:
|
|
1899
|
-
partsEngineDisabled:
|
|
1900
|
-
|
|
1901
|
-
footprintLibraryMap:
|
|
1902
|
-
|
|
1903
|
-
|
|
1905
|
+
registryApiUrl: z93.string().optional(),
|
|
1906
|
+
cloudAutorouterUrl: z93.string().optional(),
|
|
1907
|
+
projectName: z93.string().optional(),
|
|
1908
|
+
projectBaseUrl: z93.string().optional(),
|
|
1909
|
+
version: z93.string().optional(),
|
|
1910
|
+
url: z93.string().optional(),
|
|
1911
|
+
printBoardInformationToSilkscreen: z93.boolean().optional(),
|
|
1912
|
+
localCacheEngine: z93.any().optional(),
|
|
1913
|
+
pcbDisabled: z93.boolean().optional(),
|
|
1914
|
+
schematicDisabled: z93.boolean().optional(),
|
|
1915
|
+
partsEngineDisabled: z93.boolean().optional(),
|
|
1916
|
+
spiceEngineMap: z93.record(z93.string(), spiceEngineZod).optional(),
|
|
1917
|
+
footprintLibraryMap: z93.record(
|
|
1918
|
+
z93.string(),
|
|
1919
|
+
z93.union([
|
|
1904
1920
|
pathToCircuitJsonFn,
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1921
|
+
z93.record(
|
|
1922
|
+
z93.string(),
|
|
1923
|
+
z93.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
1908
1924
|
)
|
|
1909
1925
|
])
|
|
1910
1926
|
).optional(),
|
|
1911
|
-
footprintFileParserMap:
|
|
1927
|
+
footprintFileParserMap: z93.record(z93.string(), footprintFileParserEntry).optional()
|
|
1912
1928
|
});
|
|
1913
1929
|
expectTypesMatch(true);
|
|
1914
1930
|
|
|
@@ -1924,6 +1940,7 @@ var projectConfig = platformConfigObject.pick({
|
|
|
1924
1940
|
});
|
|
1925
1941
|
expectTypesMatch(true);
|
|
1926
1942
|
export {
|
|
1943
|
+
analogSimulationProps,
|
|
1927
1944
|
autorouterConfig,
|
|
1928
1945
|
autorouterProp,
|
|
1929
1946
|
baseGroupProps,
|