@tscircuit/props 0.0.286 → 0.0.288
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 +19 -1
- package/dist/index.d.ts +496 -1
- package/dist/index.js +110 -84
- package/dist/index.js.map +1 -1
- package/lib/components/group.ts +4 -0
- package/lib/components/voltagesource.ts +48 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -511,6 +511,7 @@ var subcircuitGroupProps = baseGroupProps.extend({
|
|
|
511
511
|
manualEdits: manual_edits_file.optional(),
|
|
512
512
|
schAutoLayoutEnabled: z23.boolean().optional(),
|
|
513
513
|
schTraceAutoLabelEnabled: z23.boolean().optional(),
|
|
514
|
+
schMaxTraceDistance: distance5.optional(),
|
|
514
515
|
routingDisabled: z23.boolean().optional(),
|
|
515
516
|
defaultTraceWidth: length.optional(),
|
|
516
517
|
minTraceWidth: length.optional(),
|
|
@@ -1425,13 +1426,37 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
1425
1426
|
voltage: voltage2
|
|
1426
1427
|
});
|
|
1427
1428
|
|
|
1429
|
+
// lib/components/voltagesource.ts
|
|
1430
|
+
import { frequency as frequency3, rotation as rotation4, voltage as voltage3 } from "circuit-json";
|
|
1431
|
+
import { z as z67 } from "zod";
|
|
1432
|
+
var percentage = z67.union([z67.string(), z67.number()]).transform((val) => {
|
|
1433
|
+
if (typeof val === "string") {
|
|
1434
|
+
if (val.endsWith("%")) {
|
|
1435
|
+
return parseFloat(val.slice(0, -1)) / 100;
|
|
1436
|
+
}
|
|
1437
|
+
return parseFloat(val);
|
|
1438
|
+
}
|
|
1439
|
+
return val;
|
|
1440
|
+
}).pipe(
|
|
1441
|
+
z67.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
1442
|
+
);
|
|
1443
|
+
var voltageSourceProps = commonComponentProps.extend({
|
|
1444
|
+
voltage: voltage3.optional(),
|
|
1445
|
+
frequency: frequency3.optional(),
|
|
1446
|
+
peakToPeakVoltage: voltage3.optional(),
|
|
1447
|
+
waveShape: z67.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
1448
|
+
phase: rotation4.optional(),
|
|
1449
|
+
dutyCycle: percentage.optional()
|
|
1450
|
+
});
|
|
1451
|
+
expectTypesMatch(true);
|
|
1452
|
+
|
|
1428
1453
|
// lib/components/schematic-box.ts
|
|
1429
1454
|
import { distance as distance19 } from "circuit-json";
|
|
1430
|
-
import { z as
|
|
1455
|
+
import { z as z69 } from "zod";
|
|
1431
1456
|
|
|
1432
1457
|
// lib/common/ninePointAnchor.ts
|
|
1433
|
-
import { z as
|
|
1434
|
-
var ninePointAnchor =
|
|
1458
|
+
import { z as z68 } from "zod";
|
|
1459
|
+
var ninePointAnchor = z68.enum([
|
|
1435
1460
|
"top_left",
|
|
1436
1461
|
"top_center",
|
|
1437
1462
|
"top_right",
|
|
@@ -1444,23 +1469,23 @@ var ninePointAnchor = z67.enum([
|
|
|
1444
1469
|
]);
|
|
1445
1470
|
|
|
1446
1471
|
// lib/components/schematic-box.ts
|
|
1447
|
-
var schematicBoxProps =
|
|
1472
|
+
var schematicBoxProps = z69.object({
|
|
1448
1473
|
schX: distance19.optional(),
|
|
1449
1474
|
schY: distance19.optional(),
|
|
1450
1475
|
width: distance19.optional(),
|
|
1451
1476
|
height: distance19.optional(),
|
|
1452
|
-
overlay:
|
|
1477
|
+
overlay: z69.array(z69.string()).optional(),
|
|
1453
1478
|
padding: distance19.optional(),
|
|
1454
1479
|
paddingLeft: distance19.optional(),
|
|
1455
1480
|
paddingRight: distance19.optional(),
|
|
1456
1481
|
paddingTop: distance19.optional(),
|
|
1457
1482
|
paddingBottom: distance19.optional(),
|
|
1458
|
-
title:
|
|
1483
|
+
title: z69.string().optional(),
|
|
1459
1484
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
1460
|
-
titleColor:
|
|
1485
|
+
titleColor: z69.string().optional(),
|
|
1461
1486
|
titleFontSize: distance19.optional(),
|
|
1462
|
-
titleInside:
|
|
1463
|
-
strokeStyle:
|
|
1487
|
+
titleInside: z69.boolean().default(false),
|
|
1488
|
+
strokeStyle: z69.enum(["solid", "dashed"]).default("solid")
|
|
1464
1489
|
}).refine(
|
|
1465
1490
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
1466
1491
|
{
|
|
@@ -1475,8 +1500,8 @@ var schematicBoxProps = z68.object({
|
|
|
1475
1500
|
|
|
1476
1501
|
// lib/components/schematic-line.ts
|
|
1477
1502
|
import { distance as distance20 } from "circuit-json";
|
|
1478
|
-
import { z as
|
|
1479
|
-
var schematicLineProps =
|
|
1503
|
+
import { z as z70 } from "zod";
|
|
1504
|
+
var schematicLineProps = z70.object({
|
|
1480
1505
|
x1: distance20,
|
|
1481
1506
|
y1: distance20,
|
|
1482
1507
|
x2: distance20,
|
|
@@ -1484,12 +1509,12 @@ var schematicLineProps = z69.object({
|
|
|
1484
1509
|
});
|
|
1485
1510
|
|
|
1486
1511
|
// lib/components/schematic-text.ts
|
|
1487
|
-
import { distance as distance21, rotation as
|
|
1488
|
-
import { z as
|
|
1512
|
+
import { distance as distance21, rotation as rotation5 } from "circuit-json";
|
|
1513
|
+
import { z as z72 } from "zod";
|
|
1489
1514
|
|
|
1490
1515
|
// lib/common/fivePointAnchor.ts
|
|
1491
|
-
import { z as
|
|
1492
|
-
var fivePointAnchor =
|
|
1516
|
+
import { z as z71 } from "zod";
|
|
1517
|
+
var fivePointAnchor = z71.enum([
|
|
1493
1518
|
"center",
|
|
1494
1519
|
"left",
|
|
1495
1520
|
"right",
|
|
@@ -1498,32 +1523,32 @@ var fivePointAnchor = z70.enum([
|
|
|
1498
1523
|
]);
|
|
1499
1524
|
|
|
1500
1525
|
// lib/components/schematic-text.ts
|
|
1501
|
-
var schematicTextProps =
|
|
1526
|
+
var schematicTextProps = z72.object({
|
|
1502
1527
|
schX: distance21.optional(),
|
|
1503
1528
|
schY: distance21.optional(),
|
|
1504
|
-
text:
|
|
1505
|
-
fontSize:
|
|
1506
|
-
anchor:
|
|
1507
|
-
color:
|
|
1508
|
-
schRotation:
|
|
1529
|
+
text: z72.string(),
|
|
1530
|
+
fontSize: z72.number().default(1),
|
|
1531
|
+
anchor: z72.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
1532
|
+
color: z72.string().default("#000000"),
|
|
1533
|
+
schRotation: rotation5.default(0)
|
|
1509
1534
|
});
|
|
1510
1535
|
|
|
1511
1536
|
// lib/components/schematic-path.ts
|
|
1512
1537
|
import { point as point5 } from "circuit-json";
|
|
1513
|
-
import { z as
|
|
1514
|
-
var schematicPathProps =
|
|
1515
|
-
points:
|
|
1516
|
-
isFilled:
|
|
1517
|
-
fillColor:
|
|
1538
|
+
import { z as z73 } from "zod";
|
|
1539
|
+
var schematicPathProps = z73.object({
|
|
1540
|
+
points: z73.array(point5),
|
|
1541
|
+
isFilled: z73.boolean().optional().default(false),
|
|
1542
|
+
fillColor: z73.enum(["red", "blue"]).optional()
|
|
1518
1543
|
});
|
|
1519
1544
|
|
|
1520
1545
|
// lib/components/schematic-table.ts
|
|
1521
1546
|
import { distance as distance22 } from "circuit-json";
|
|
1522
|
-
import { z as
|
|
1523
|
-
var schematicTableProps =
|
|
1547
|
+
import { z as z74 } from "zod";
|
|
1548
|
+
var schematicTableProps = z74.object({
|
|
1524
1549
|
schX: distance22.optional(),
|
|
1525
1550
|
schY: distance22.optional(),
|
|
1526
|
-
children:
|
|
1551
|
+
children: z74.any().optional(),
|
|
1527
1552
|
cellPadding: distance22.optional(),
|
|
1528
1553
|
borderWidth: distance22.optional(),
|
|
1529
1554
|
anchor: ninePointAnchor.optional(),
|
|
@@ -1533,44 +1558,44 @@ expectTypesMatch(true);
|
|
|
1533
1558
|
|
|
1534
1559
|
// lib/components/schematic-row.ts
|
|
1535
1560
|
import { distance as distance23 } from "circuit-json";
|
|
1536
|
-
import { z as
|
|
1537
|
-
var schematicRowProps =
|
|
1538
|
-
children:
|
|
1561
|
+
import { z as z75 } from "zod";
|
|
1562
|
+
var schematicRowProps = z75.object({
|
|
1563
|
+
children: z75.any().optional(),
|
|
1539
1564
|
height: distance23.optional()
|
|
1540
1565
|
});
|
|
1541
1566
|
expectTypesMatch(true);
|
|
1542
1567
|
|
|
1543
1568
|
// lib/components/schematic-cell.ts
|
|
1544
1569
|
import { distance as distance24 } from "circuit-json";
|
|
1545
|
-
import { z as
|
|
1546
|
-
var schematicCellProps =
|
|
1547
|
-
children:
|
|
1548
|
-
horizontalAlign:
|
|
1549
|
-
verticalAlign:
|
|
1570
|
+
import { z as z76 } from "zod";
|
|
1571
|
+
var schematicCellProps = z76.object({
|
|
1572
|
+
children: z76.string().optional(),
|
|
1573
|
+
horizontalAlign: z76.enum(["left", "center", "right"]).optional(),
|
|
1574
|
+
verticalAlign: z76.enum(["top", "middle", "bottom"]).optional(),
|
|
1550
1575
|
fontSize: distance24.optional(),
|
|
1551
|
-
rowSpan:
|
|
1552
|
-
colSpan:
|
|
1576
|
+
rowSpan: z76.number().optional(),
|
|
1577
|
+
colSpan: z76.number().optional(),
|
|
1553
1578
|
width: distance24.optional(),
|
|
1554
|
-
text:
|
|
1579
|
+
text: z76.string().optional()
|
|
1555
1580
|
});
|
|
1556
1581
|
expectTypesMatch(true);
|
|
1557
1582
|
|
|
1558
1583
|
// lib/components/silkscreen-text.ts
|
|
1559
1584
|
import { layer_ref as layer_ref6, length as length5 } from "circuit-json";
|
|
1560
|
-
import { z as
|
|
1585
|
+
import { z as z77 } from "zod";
|
|
1561
1586
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
1562
|
-
text:
|
|
1587
|
+
text: z77.string(),
|
|
1563
1588
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
1564
|
-
font:
|
|
1589
|
+
font: z77.enum(["tscircuit2024"]).optional(),
|
|
1565
1590
|
fontSize: length5.optional(),
|
|
1566
|
-
layers:
|
|
1591
|
+
layers: z77.array(layer_ref6).optional()
|
|
1567
1592
|
});
|
|
1568
1593
|
|
|
1569
1594
|
// lib/components/silkscreen-path.ts
|
|
1570
1595
|
import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
1571
|
-
import { z as
|
|
1596
|
+
import { z as z78 } from "zod";
|
|
1572
1597
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1573
|
-
route:
|
|
1598
|
+
route: z78.array(route_hint_point5),
|
|
1574
1599
|
strokeWidth: length6.optional()
|
|
1575
1600
|
});
|
|
1576
1601
|
|
|
@@ -1586,10 +1611,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
|
|
|
1586
1611
|
|
|
1587
1612
|
// lib/components/silkscreen-rect.ts
|
|
1588
1613
|
import { distance as distance26 } from "circuit-json";
|
|
1589
|
-
import { z as
|
|
1614
|
+
import { z as z79 } from "zod";
|
|
1590
1615
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1591
|
-
filled:
|
|
1592
|
-
stroke:
|
|
1616
|
+
filled: z79.boolean().default(true).optional(),
|
|
1617
|
+
stroke: z79.enum(["dashed", "solid", "none"]).optional(),
|
|
1593
1618
|
strokeWidth: distance26.optional(),
|
|
1594
1619
|
width: distance26,
|
|
1595
1620
|
height: distance26
|
|
@@ -1597,64 +1622,64 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1597
1622
|
|
|
1598
1623
|
// lib/components/silkscreen-circle.ts
|
|
1599
1624
|
import { distance as distance27 } from "circuit-json";
|
|
1600
|
-
import { z as
|
|
1625
|
+
import { z as z80 } from "zod";
|
|
1601
1626
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1602
|
-
isFilled:
|
|
1603
|
-
isOutline:
|
|
1627
|
+
isFilled: z80.boolean().optional(),
|
|
1628
|
+
isOutline: z80.boolean().optional(),
|
|
1604
1629
|
strokeWidth: distance27.optional(),
|
|
1605
1630
|
radius: distance27
|
|
1606
1631
|
});
|
|
1607
1632
|
|
|
1608
1633
|
// lib/components/trace-hint.ts
|
|
1609
1634
|
import { distance as distance28, layer_ref as layer_ref7, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
1610
|
-
import { z as
|
|
1611
|
-
var routeHintPointProps =
|
|
1635
|
+
import { z as z81 } from "zod";
|
|
1636
|
+
var routeHintPointProps = z81.object({
|
|
1612
1637
|
x: distance28,
|
|
1613
1638
|
y: distance28,
|
|
1614
|
-
via:
|
|
1639
|
+
via: z81.boolean().optional(),
|
|
1615
1640
|
toLayer: layer_ref7.optional()
|
|
1616
1641
|
});
|
|
1617
|
-
var traceHintProps =
|
|
1618
|
-
for:
|
|
1642
|
+
var traceHintProps = z81.object({
|
|
1643
|
+
for: z81.string().optional().describe(
|
|
1619
1644
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
1620
1645
|
),
|
|
1621
|
-
order:
|
|
1646
|
+
order: z81.number().optional(),
|
|
1622
1647
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
1623
|
-
offsets:
|
|
1624
|
-
traceWidth:
|
|
1648
|
+
offsets: z81.array(route_hint_point6).or(z81.array(routeHintPointProps)).optional(),
|
|
1649
|
+
traceWidth: z81.number().optional()
|
|
1625
1650
|
});
|
|
1626
1651
|
|
|
1627
1652
|
// lib/components/port.ts
|
|
1628
|
-
import { z as
|
|
1653
|
+
import { z as z82 } from "zod";
|
|
1629
1654
|
var portProps = commonLayoutProps.extend({
|
|
1630
|
-
name:
|
|
1631
|
-
pinNumber:
|
|
1632
|
-
aliases:
|
|
1655
|
+
name: z82.string(),
|
|
1656
|
+
pinNumber: z82.number().optional(),
|
|
1657
|
+
aliases: z82.array(z82.string()).optional(),
|
|
1633
1658
|
direction
|
|
1634
1659
|
});
|
|
1635
1660
|
|
|
1636
1661
|
// lib/platformConfig.ts
|
|
1637
|
-
import { z as
|
|
1638
|
-
var unvalidatedCircuitJson =
|
|
1639
|
-
var pathToCircuitJsonFn =
|
|
1640
|
-
var platformConfig =
|
|
1662
|
+
import { z as z83 } from "zod";
|
|
1663
|
+
var unvalidatedCircuitJson = z83.array(z83.any()).describe("Circuit JSON");
|
|
1664
|
+
var pathToCircuitJsonFn = z83.function().args(z83.string()).returns(z83.promise(z83.object({ footprintCircuitJson: z83.array(z83.any()) }))).describe("A function that takes a path and returns Circuit JSON");
|
|
1665
|
+
var platformConfig = z83.object({
|
|
1641
1666
|
partsEngine: partsEngine.optional(),
|
|
1642
1667
|
autorouter: autorouterProp.optional(),
|
|
1643
|
-
registryApiUrl:
|
|
1644
|
-
cloudAutorouterUrl:
|
|
1645
|
-
projectName:
|
|
1646
|
-
version:
|
|
1647
|
-
url:
|
|
1648
|
-
printBoardInformationToSilkscreen:
|
|
1649
|
-
localCacheEngine:
|
|
1650
|
-
pcbDisabled:
|
|
1651
|
-
schematicDisabled:
|
|
1652
|
-
partsEngineDisabled:
|
|
1653
|
-
footprintLibraryMap:
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1668
|
+
registryApiUrl: z83.string().optional(),
|
|
1669
|
+
cloudAutorouterUrl: z83.string().optional(),
|
|
1670
|
+
projectName: z83.string().optional(),
|
|
1671
|
+
version: z83.string().optional(),
|
|
1672
|
+
url: z83.string().optional(),
|
|
1673
|
+
printBoardInformationToSilkscreen: z83.boolean().optional(),
|
|
1674
|
+
localCacheEngine: z83.any().optional(),
|
|
1675
|
+
pcbDisabled: z83.boolean().optional(),
|
|
1676
|
+
schematicDisabled: z83.boolean().optional(),
|
|
1677
|
+
partsEngineDisabled: z83.boolean().optional(),
|
|
1678
|
+
footprintLibraryMap: z83.record(
|
|
1679
|
+
z83.string(),
|
|
1680
|
+
z83.record(
|
|
1681
|
+
z83.string(),
|
|
1682
|
+
z83.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
1658
1683
|
)
|
|
1659
1684
|
).optional()
|
|
1660
1685
|
});
|
|
@@ -1797,6 +1822,7 @@ export {
|
|
|
1797
1822
|
transistorPins,
|
|
1798
1823
|
transistorPinsLabels,
|
|
1799
1824
|
transistorProps,
|
|
1800
|
-
viaProps
|
|
1825
|
+
viaProps,
|
|
1826
|
+
voltageSourceProps
|
|
1801
1827
|
};
|
|
1802
1828
|
//# sourceMappingURL=index.js.map
|