@tscircuit/props 0.0.437 → 0.0.439
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 +32 -0
- package/dist/index.d.ts +6110 -3826
- package/dist/index.js +319 -269
- package/dist/index.js.map +1 -1
- package/lib/components/currentsource.ts +58 -0
- package/lib/components/group.ts +4 -0
- package/lib/components/opamp.ts +42 -0
- package/lib/index.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -585,6 +585,7 @@ var autorouterConfig = z30.object({
|
|
|
585
585
|
"auto",
|
|
586
586
|
"auto_local",
|
|
587
587
|
"auto_cloud",
|
|
588
|
+
"tscircuit_beta",
|
|
588
589
|
"freerouting",
|
|
589
590
|
"laser_prefab",
|
|
590
591
|
"sequential-trace",
|
|
@@ -599,6 +600,7 @@ var autorouterPreset = z30.union([
|
|
|
599
600
|
z30.literal("auto"),
|
|
600
601
|
z30.literal("auto_local"),
|
|
601
602
|
z30.literal("auto_cloud"),
|
|
603
|
+
z30.literal("tscircuit_beta"),
|
|
602
604
|
z30.literal("freerouting"),
|
|
603
605
|
z30.literal("laser_prefab"),
|
|
604
606
|
// Prefabricated PCB with laser copper ablation
|
|
@@ -1574,21 +1576,36 @@ var mosfetPins = [
|
|
|
1574
1576
|
];
|
|
1575
1577
|
expectTypesMatch(true);
|
|
1576
1578
|
|
|
1579
|
+
// lib/components/opamp.ts
|
|
1580
|
+
import "zod";
|
|
1581
|
+
var opampPinLabels = [
|
|
1582
|
+
"inverting_input",
|
|
1583
|
+
"non_inverting_input",
|
|
1584
|
+
"output",
|
|
1585
|
+
"positive_supply",
|
|
1586
|
+
"negative_supply"
|
|
1587
|
+
];
|
|
1588
|
+
var opampProps = commonComponentProps.extend({
|
|
1589
|
+
connections: createConnectionsProp(opampPinLabels).optional()
|
|
1590
|
+
});
|
|
1591
|
+
var opampPins = opampPinLabels;
|
|
1592
|
+
expectTypesMatch(true);
|
|
1593
|
+
|
|
1577
1594
|
// lib/components/inductor.ts
|
|
1578
1595
|
import { inductance } from "circuit-json";
|
|
1579
|
-
import { z as
|
|
1596
|
+
import { z as z69 } from "zod";
|
|
1580
1597
|
var inductorPins = lrPins;
|
|
1581
1598
|
var inductorProps = commonComponentProps.extend({
|
|
1582
1599
|
inductance,
|
|
1583
|
-
maxCurrentRating:
|
|
1600
|
+
maxCurrentRating: z69.union([z69.string(), z69.number()]).optional(),
|
|
1584
1601
|
schOrientation: schematicOrientation.optional(),
|
|
1585
1602
|
connections: createConnectionsProp(inductorPins).optional()
|
|
1586
1603
|
});
|
|
1587
1604
|
expectTypesMatch(true);
|
|
1588
1605
|
|
|
1589
1606
|
// lib/components/diode.ts
|
|
1590
|
-
import { z as
|
|
1591
|
-
var diodeConnectionKeys =
|
|
1607
|
+
import { z as z70 } from "zod";
|
|
1608
|
+
var diodeConnectionKeys = z70.enum([
|
|
1592
1609
|
"anode",
|
|
1593
1610
|
"cathode",
|
|
1594
1611
|
"pin1",
|
|
@@ -1596,9 +1613,9 @@ var diodeConnectionKeys = z69.enum([
|
|
|
1596
1613
|
"pos",
|
|
1597
1614
|
"neg"
|
|
1598
1615
|
]);
|
|
1599
|
-
var connectionTarget3 =
|
|
1600
|
-
var connectionsProp2 =
|
|
1601
|
-
var diodeVariant =
|
|
1616
|
+
var connectionTarget3 = z70.string().or(z70.array(z70.string()).readonly()).or(z70.array(z70.string()));
|
|
1617
|
+
var connectionsProp2 = z70.record(diodeConnectionKeys, connectionTarget3);
|
|
1618
|
+
var diodeVariant = z70.enum([
|
|
1602
1619
|
"standard",
|
|
1603
1620
|
"schottky",
|
|
1604
1621
|
"zener",
|
|
@@ -1609,12 +1626,12 @@ var diodeVariant = z69.enum([
|
|
|
1609
1626
|
var diodeProps = commonComponentProps.extend({
|
|
1610
1627
|
connections: connectionsProp2.optional(),
|
|
1611
1628
|
variant: diodeVariant.optional().default("standard"),
|
|
1612
|
-
standard:
|
|
1613
|
-
schottky:
|
|
1614
|
-
zener:
|
|
1615
|
-
avalanche:
|
|
1616
|
-
photo:
|
|
1617
|
-
tvs:
|
|
1629
|
+
standard: z70.boolean().optional(),
|
|
1630
|
+
schottky: z70.boolean().optional(),
|
|
1631
|
+
zener: z70.boolean().optional(),
|
|
1632
|
+
avalanche: z70.boolean().optional(),
|
|
1633
|
+
photo: z70.boolean().optional(),
|
|
1634
|
+
tvs: z70.boolean().optional(),
|
|
1618
1635
|
schOrientation: schematicOrientation.optional()
|
|
1619
1636
|
}).superRefine((data, ctx) => {
|
|
1620
1637
|
const enabledFlags = [
|
|
@@ -1627,11 +1644,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
1627
1644
|
].filter(Boolean).length;
|
|
1628
1645
|
if (enabledFlags > 1) {
|
|
1629
1646
|
ctx.addIssue({
|
|
1630
|
-
code:
|
|
1647
|
+
code: z70.ZodIssueCode.custom,
|
|
1631
1648
|
message: "Exactly one diode variant must be enabled",
|
|
1632
1649
|
path: []
|
|
1633
1650
|
});
|
|
1634
|
-
return
|
|
1651
|
+
return z70.INVALID;
|
|
1635
1652
|
}
|
|
1636
1653
|
}).transform((data) => {
|
|
1637
1654
|
const result = {
|
|
@@ -1678,33 +1695,33 @@ var diodePins = lrPolarPins;
|
|
|
1678
1695
|
expectTypesMatch(true);
|
|
1679
1696
|
|
|
1680
1697
|
// lib/components/led.ts
|
|
1681
|
-
import { z as
|
|
1698
|
+
import { z as z71 } from "zod";
|
|
1682
1699
|
var ledProps = commonComponentProps.extend({
|
|
1683
|
-
color:
|
|
1684
|
-
wavelength:
|
|
1685
|
-
schDisplayValue:
|
|
1700
|
+
color: z71.string().optional(),
|
|
1701
|
+
wavelength: z71.string().optional(),
|
|
1702
|
+
schDisplayValue: z71.string().optional(),
|
|
1686
1703
|
schOrientation: schematicOrientation.optional(),
|
|
1687
1704
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
1688
|
-
laser:
|
|
1705
|
+
laser: z71.boolean().optional()
|
|
1689
1706
|
});
|
|
1690
1707
|
var ledPins = lrPolarPins;
|
|
1691
1708
|
|
|
1692
1709
|
// lib/components/switch.ts
|
|
1693
1710
|
import { ms as ms2, frequency as frequency3 } from "circuit-json";
|
|
1694
|
-
import { z as
|
|
1711
|
+
import { z as z72 } from "zod";
|
|
1695
1712
|
var switchProps = commonComponentProps.extend({
|
|
1696
|
-
type:
|
|
1697
|
-
isNormallyClosed:
|
|
1698
|
-
spst:
|
|
1699
|
-
spdt:
|
|
1700
|
-
dpst:
|
|
1701
|
-
dpdt:
|
|
1713
|
+
type: z72.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
1714
|
+
isNormallyClosed: z72.boolean().optional().default(false),
|
|
1715
|
+
spst: z72.boolean().optional(),
|
|
1716
|
+
spdt: z72.boolean().optional(),
|
|
1717
|
+
dpst: z72.boolean().optional(),
|
|
1718
|
+
dpdt: z72.boolean().optional(),
|
|
1702
1719
|
simSwitchFrequency: frequency3.optional(),
|
|
1703
1720
|
simCloseAt: ms2.optional(),
|
|
1704
1721
|
simOpenAt: ms2.optional(),
|
|
1705
|
-
simStartClosed:
|
|
1706
|
-
simStartOpen:
|
|
1707
|
-
connections:
|
|
1722
|
+
simStartClosed: z72.boolean().optional(),
|
|
1723
|
+
simStartOpen: z72.boolean().optional(),
|
|
1724
|
+
connections: z72.custom().pipe(z72.record(z72.string(), connectionTarget)).optional()
|
|
1708
1725
|
}).transform((props) => {
|
|
1709
1726
|
const updatedProps = { ...props };
|
|
1710
1727
|
if (updatedProps.dpdt) {
|
|
@@ -1736,33 +1753,33 @@ expectTypesMatch(true);
|
|
|
1736
1753
|
|
|
1737
1754
|
// lib/components/fabrication-note-text.ts
|
|
1738
1755
|
import { length as length3 } from "circuit-json";
|
|
1739
|
-
import { z as
|
|
1756
|
+
import { z as z73 } from "zod";
|
|
1740
1757
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
1741
|
-
text:
|
|
1742
|
-
anchorAlignment:
|
|
1743
|
-
font:
|
|
1758
|
+
text: z73.string(),
|
|
1759
|
+
anchorAlignment: z73.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1760
|
+
font: z73.enum(["tscircuit2024"]).optional(),
|
|
1744
1761
|
fontSize: length3.optional(),
|
|
1745
|
-
color:
|
|
1762
|
+
color: z73.string().optional()
|
|
1746
1763
|
});
|
|
1747
1764
|
expectTypesMatch(true);
|
|
1748
1765
|
|
|
1749
1766
|
// lib/components/fabrication-note-rect.ts
|
|
1750
1767
|
import { distance as distance18 } from "circuit-json";
|
|
1751
|
-
import { z as
|
|
1768
|
+
import { z as z74 } from "zod";
|
|
1752
1769
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1753
1770
|
width: distance18,
|
|
1754
1771
|
height: distance18,
|
|
1755
1772
|
strokeWidth: distance18.optional(),
|
|
1756
|
-
isFilled:
|
|
1757
|
-
hasStroke:
|
|
1758
|
-
isStrokeDashed:
|
|
1759
|
-
color:
|
|
1773
|
+
isFilled: z74.boolean().optional(),
|
|
1774
|
+
hasStroke: z74.boolean().optional(),
|
|
1775
|
+
isStrokeDashed: z74.boolean().optional(),
|
|
1776
|
+
color: z74.string().optional(),
|
|
1760
1777
|
cornerRadius: distance18.optional()
|
|
1761
1778
|
});
|
|
1762
1779
|
|
|
1763
1780
|
// lib/components/fabrication-note-path.ts
|
|
1764
1781
|
import { length as length4, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
1765
|
-
import { z as
|
|
1782
|
+
import { z as z75 } from "zod";
|
|
1766
1783
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
1767
1784
|
pcbLeftEdgeX: true,
|
|
1768
1785
|
pcbRightEdgeX: true,
|
|
@@ -1774,15 +1791,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
1774
1791
|
pcbOffsetY: true,
|
|
1775
1792
|
pcbRotation: true
|
|
1776
1793
|
}).extend({
|
|
1777
|
-
route:
|
|
1794
|
+
route: z75.array(route_hint_point3),
|
|
1778
1795
|
strokeWidth: length4.optional(),
|
|
1779
|
-
color:
|
|
1796
|
+
color: z75.string().optional()
|
|
1780
1797
|
});
|
|
1781
1798
|
|
|
1782
1799
|
// lib/components/fabrication-note-dimension.ts
|
|
1783
1800
|
import { distance as distance19, length as length5 } from "circuit-json";
|
|
1784
|
-
import { z as
|
|
1785
|
-
var dimensionTarget =
|
|
1801
|
+
import { z as z76 } from "zod";
|
|
1802
|
+
var dimensionTarget = z76.union([z76.string(), point]);
|
|
1786
1803
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
1787
1804
|
pcbLeftEdgeX: true,
|
|
1788
1805
|
pcbRightEdgeX: true,
|
|
@@ -1796,53 +1813,53 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
1796
1813
|
}).extend({
|
|
1797
1814
|
from: dimensionTarget,
|
|
1798
1815
|
to: dimensionTarget,
|
|
1799
|
-
text:
|
|
1816
|
+
text: z76.string().optional(),
|
|
1800
1817
|
offset: distance19.optional(),
|
|
1801
|
-
font:
|
|
1818
|
+
font: z76.enum(["tscircuit2024"]).optional(),
|
|
1802
1819
|
fontSize: length5.optional(),
|
|
1803
|
-
color:
|
|
1820
|
+
color: z76.string().optional(),
|
|
1804
1821
|
arrowSize: distance19.optional(),
|
|
1805
|
-
units:
|
|
1806
|
-
outerEdgeToEdge:
|
|
1807
|
-
centerToCenter:
|
|
1808
|
-
innerEdgeToEdge:
|
|
1822
|
+
units: z76.enum(["in", "mm"]).optional(),
|
|
1823
|
+
outerEdgeToEdge: z76.literal(true).optional(),
|
|
1824
|
+
centerToCenter: z76.literal(true).optional(),
|
|
1825
|
+
innerEdgeToEdge: z76.literal(true).optional()
|
|
1809
1826
|
});
|
|
1810
1827
|
expectTypesMatch(true);
|
|
1811
1828
|
|
|
1812
1829
|
// lib/components/pcb-trace.ts
|
|
1813
1830
|
import { distance as distance20, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
1814
|
-
import { z as
|
|
1815
|
-
var pcbTraceProps =
|
|
1816
|
-
layer:
|
|
1831
|
+
import { z as z77 } from "zod";
|
|
1832
|
+
var pcbTraceProps = z77.object({
|
|
1833
|
+
layer: z77.string().optional(),
|
|
1817
1834
|
thickness: distance20.optional(),
|
|
1818
|
-
route:
|
|
1835
|
+
route: z77.array(route_hint_point4)
|
|
1819
1836
|
});
|
|
1820
1837
|
|
|
1821
1838
|
// lib/components/via.ts
|
|
1822
1839
|
import { distance as distance21, layer_ref as layer_ref5 } from "circuit-json";
|
|
1823
|
-
import { z as
|
|
1840
|
+
import { z as z78 } from "zod";
|
|
1824
1841
|
var viaProps = commonLayoutProps.extend({
|
|
1825
|
-
name:
|
|
1842
|
+
name: z78.string().optional(),
|
|
1826
1843
|
fromLayer: layer_ref5,
|
|
1827
1844
|
toLayer: layer_ref5,
|
|
1828
1845
|
holeDiameter: distance21.optional(),
|
|
1829
1846
|
outerDiameter: distance21.optional(),
|
|
1830
|
-
connectsTo:
|
|
1831
|
-
netIsAssignable:
|
|
1847
|
+
connectsTo: z78.string().or(z78.array(z78.string())).optional(),
|
|
1848
|
+
netIsAssignable: z78.boolean().optional()
|
|
1832
1849
|
});
|
|
1833
1850
|
expectTypesMatch(true);
|
|
1834
1851
|
|
|
1835
1852
|
// lib/components/testpoint.ts
|
|
1836
1853
|
import { distance as distance22 } from "circuit-json";
|
|
1837
|
-
import { z as
|
|
1854
|
+
import { z as z79 } from "zod";
|
|
1838
1855
|
var testpointPins = ["pin1"];
|
|
1839
|
-
var testpointConnectionsProp =
|
|
1856
|
+
var testpointConnectionsProp = z79.object({
|
|
1840
1857
|
pin1: connectionTarget
|
|
1841
1858
|
}).strict();
|
|
1842
1859
|
var testpointProps = commonComponentProps.extend({
|
|
1843
1860
|
connections: testpointConnectionsProp.optional(),
|
|
1844
|
-
footprintVariant:
|
|
1845
|
-
padShape:
|
|
1861
|
+
footprintVariant: z79.enum(["pad", "through_hole"]).optional(),
|
|
1862
|
+
padShape: z79.enum(["rect", "circle"]).optional().default("circle"),
|
|
1846
1863
|
padDiameter: distance22.optional(),
|
|
1847
1864
|
holeDiameter: distance22.optional(),
|
|
1848
1865
|
width: distance22.optional(),
|
|
@@ -1854,22 +1871,22 @@ var testpointProps = commonComponentProps.extend({
|
|
|
1854
1871
|
expectTypesMatch(true);
|
|
1855
1872
|
|
|
1856
1873
|
// lib/components/breakoutpoint.ts
|
|
1857
|
-
import { z as
|
|
1874
|
+
import { z as z80 } from "zod";
|
|
1858
1875
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1859
|
-
connection:
|
|
1876
|
+
connection: z80.string()
|
|
1860
1877
|
});
|
|
1861
1878
|
expectTypesMatch(true);
|
|
1862
1879
|
|
|
1863
1880
|
// lib/components/pcb-keepout.ts
|
|
1864
1881
|
import { distance as distance23 } from "circuit-json";
|
|
1865
|
-
import { z as
|
|
1866
|
-
var pcbKeepoutProps =
|
|
1882
|
+
import { z as z81 } from "zod";
|
|
1883
|
+
var pcbKeepoutProps = z81.union([
|
|
1867
1884
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1868
|
-
shape:
|
|
1885
|
+
shape: z81.literal("circle"),
|
|
1869
1886
|
radius: distance23
|
|
1870
1887
|
}),
|
|
1871
1888
|
pcbLayoutProps.extend({
|
|
1872
|
-
shape:
|
|
1889
|
+
shape: z81.literal("rect"),
|
|
1873
1890
|
width: distance23,
|
|
1874
1891
|
height: distance23
|
|
1875
1892
|
})
|
|
@@ -1877,20 +1894,20 @@ var pcbKeepoutProps = z80.union([
|
|
|
1877
1894
|
|
|
1878
1895
|
// lib/components/courtyard-rect.ts
|
|
1879
1896
|
import { distance as distance24 } from "circuit-json";
|
|
1880
|
-
import { z as
|
|
1897
|
+
import { z as z82 } from "zod";
|
|
1881
1898
|
var courtyardRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1882
1899
|
width: distance24,
|
|
1883
1900
|
height: distance24,
|
|
1884
1901
|
strokeWidth: distance24.optional(),
|
|
1885
|
-
isFilled:
|
|
1886
|
-
hasStroke:
|
|
1887
|
-
isStrokeDashed:
|
|
1888
|
-
color:
|
|
1902
|
+
isFilled: z82.boolean().optional(),
|
|
1903
|
+
hasStroke: z82.boolean().optional(),
|
|
1904
|
+
isStrokeDashed: z82.boolean().optional(),
|
|
1905
|
+
color: z82.string().optional()
|
|
1889
1906
|
});
|
|
1890
1907
|
|
|
1891
1908
|
// lib/components/courtyard-outline.ts
|
|
1892
1909
|
import { length as length6 } from "circuit-json";
|
|
1893
|
-
import { z as
|
|
1910
|
+
import { z as z83 } from "zod";
|
|
1894
1911
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
1895
1912
|
pcbLeftEdgeX: true,
|
|
1896
1913
|
pcbRightEdgeX: true,
|
|
@@ -1902,41 +1919,41 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
1902
1919
|
pcbOffsetY: true,
|
|
1903
1920
|
pcbRotation: true
|
|
1904
1921
|
}).extend({
|
|
1905
|
-
outline:
|
|
1922
|
+
outline: z83.array(point),
|
|
1906
1923
|
strokeWidth: length6.optional(),
|
|
1907
|
-
isClosed:
|
|
1908
|
-
isStrokeDashed:
|
|
1909
|
-
color:
|
|
1924
|
+
isClosed: z83.boolean().optional(),
|
|
1925
|
+
isStrokeDashed: z83.boolean().optional(),
|
|
1926
|
+
color: z83.string().optional()
|
|
1910
1927
|
});
|
|
1911
1928
|
|
|
1912
1929
|
// lib/components/copper-pour.ts
|
|
1913
|
-
import { z as
|
|
1930
|
+
import { z as z84 } from "zod";
|
|
1914
1931
|
import { layer_ref as layer_ref6 } from "circuit-json";
|
|
1915
|
-
var copperPourProps =
|
|
1916
|
-
name:
|
|
1932
|
+
var copperPourProps = z84.object({
|
|
1933
|
+
name: z84.string().optional(),
|
|
1917
1934
|
layer: layer_ref6,
|
|
1918
|
-
connectsTo:
|
|
1935
|
+
connectsTo: z84.string(),
|
|
1919
1936
|
padMargin: distance.optional(),
|
|
1920
1937
|
traceMargin: distance.optional(),
|
|
1921
1938
|
clearance: distance.optional(),
|
|
1922
1939
|
boardEdgeMargin: distance.optional(),
|
|
1923
1940
|
cutoutMargin: distance.optional(),
|
|
1924
|
-
coveredWithSolderMask:
|
|
1941
|
+
coveredWithSolderMask: z84.boolean().optional().default(true)
|
|
1925
1942
|
});
|
|
1926
1943
|
expectTypesMatch(true);
|
|
1927
1944
|
|
|
1928
1945
|
// lib/components/cadassembly.ts
|
|
1929
1946
|
import { layer_ref as layer_ref7 } from "circuit-json";
|
|
1930
|
-
import { z as
|
|
1931
|
-
var cadassemblyProps =
|
|
1947
|
+
import { z as z85 } from "zod";
|
|
1948
|
+
var cadassemblyProps = z85.object({
|
|
1932
1949
|
originalLayer: layer_ref7.default("top").optional(),
|
|
1933
|
-
children:
|
|
1950
|
+
children: z85.any().optional()
|
|
1934
1951
|
});
|
|
1935
1952
|
expectTypesMatch(true);
|
|
1936
1953
|
|
|
1937
1954
|
// lib/components/cadmodel.ts
|
|
1938
|
-
import { z as
|
|
1939
|
-
var pcbPosition =
|
|
1955
|
+
import { z as z86 } from "zod";
|
|
1956
|
+
var pcbPosition = z86.object({
|
|
1940
1957
|
pcbX: pcbCoordinate.optional(),
|
|
1941
1958
|
pcbY: pcbCoordinate.optional(),
|
|
1942
1959
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -1948,12 +1965,12 @@ var pcbPosition = z85.object({
|
|
|
1948
1965
|
pcbZ: distance.optional()
|
|
1949
1966
|
});
|
|
1950
1967
|
var cadModelBaseWithUrl = cadModelBase.extend({
|
|
1951
|
-
modelUrl:
|
|
1952
|
-
stepUrl:
|
|
1968
|
+
modelUrl: z86.string(),
|
|
1969
|
+
stepUrl: z86.string().optional()
|
|
1953
1970
|
});
|
|
1954
1971
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
1955
1972
|
expectTypesMatch(true);
|
|
1956
|
-
var cadmodelProps =
|
|
1973
|
+
var cadmodelProps = z86.union([z86.null(), z86.string(), cadModelObject]);
|
|
1957
1974
|
|
|
1958
1975
|
// lib/components/power-source.ts
|
|
1959
1976
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -1963,9 +1980,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
1963
1980
|
|
|
1964
1981
|
// lib/components/voltagesource.ts
|
|
1965
1982
|
import { frequency as frequency4, rotation as rotation4, voltage as voltage4 } from "circuit-json";
|
|
1966
|
-
import { z as
|
|
1983
|
+
import { z as z87 } from "zod";
|
|
1967
1984
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
1968
|
-
var percentage =
|
|
1985
|
+
var percentage = z87.union([z87.string(), z87.number()]).transform((val) => {
|
|
1969
1986
|
if (typeof val === "string") {
|
|
1970
1987
|
if (val.endsWith("%")) {
|
|
1971
1988
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -1974,13 +1991,13 @@ var percentage = z86.union([z86.string(), z86.number()]).transform((val) => {
|
|
|
1974
1991
|
}
|
|
1975
1992
|
return val;
|
|
1976
1993
|
}).pipe(
|
|
1977
|
-
|
|
1994
|
+
z87.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
1978
1995
|
);
|
|
1979
1996
|
var voltageSourceProps = commonComponentProps.extend({
|
|
1980
1997
|
voltage: voltage4.optional(),
|
|
1981
1998
|
frequency: frequency4.optional(),
|
|
1982
1999
|
peakToPeakVoltage: voltage4.optional(),
|
|
1983
|
-
waveShape:
|
|
2000
|
+
waveShape: z87.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
1984
2001
|
phase: rotation4.optional(),
|
|
1985
2002
|
dutyCycle: percentage.optional(),
|
|
1986
2003
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -1988,58 +2005,85 @@ var voltageSourceProps = commonComponentProps.extend({
|
|
|
1988
2005
|
var voltageSourcePins = lrPolarPins;
|
|
1989
2006
|
expectTypesMatch(true);
|
|
1990
2007
|
|
|
2008
|
+
// lib/components/currentsource.ts
|
|
2009
|
+
import { frequency as frequency5, rotation as rotation5, current } from "circuit-json";
|
|
2010
|
+
import { z as z88 } from "zod";
|
|
2011
|
+
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
2012
|
+
var percentage2 = z88.union([z88.string(), z88.number()]).transform((val) => {
|
|
2013
|
+
if (typeof val === "string") {
|
|
2014
|
+
if (val.endsWith("%")) {
|
|
2015
|
+
return parseFloat(val.slice(0, -1)) / 100;
|
|
2016
|
+
}
|
|
2017
|
+
return parseFloat(val);
|
|
2018
|
+
}
|
|
2019
|
+
return val;
|
|
2020
|
+
}).pipe(
|
|
2021
|
+
z88.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2022
|
+
);
|
|
2023
|
+
var currentSourceProps = commonComponentProps.extend({
|
|
2024
|
+
current: current.optional(),
|
|
2025
|
+
frequency: frequency5.optional(),
|
|
2026
|
+
peakToPeakCurrent: current.optional(),
|
|
2027
|
+
waveShape: z88.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
2028
|
+
phase: rotation5.optional(),
|
|
2029
|
+
dutyCycle: percentage2.optional(),
|
|
2030
|
+
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
2031
|
+
});
|
|
2032
|
+
var currentSourcePins = lrPolarPins;
|
|
2033
|
+
expectTypesMatch(true);
|
|
2034
|
+
|
|
1991
2035
|
// lib/components/voltageprobe.ts
|
|
1992
|
-
import { z as
|
|
2036
|
+
import { z as z89 } from "zod";
|
|
1993
2037
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
1994
|
-
name:
|
|
1995
|
-
connectsTo:
|
|
1996
|
-
referenceTo:
|
|
1997
|
-
color:
|
|
2038
|
+
name: z89.string().optional(),
|
|
2039
|
+
connectsTo: z89.string(),
|
|
2040
|
+
referenceTo: z89.string().optional(),
|
|
2041
|
+
color: z89.string().optional()
|
|
1998
2042
|
});
|
|
1999
2043
|
expectTypesMatch(true);
|
|
2000
2044
|
|
|
2001
2045
|
// lib/components/schematic-arc.ts
|
|
2002
|
-
import { distance as distance25, point as point5, rotation as
|
|
2003
|
-
import { z as
|
|
2004
|
-
var schematicArcProps =
|
|
2046
|
+
import { distance as distance25, point as point5, rotation as rotation6 } from "circuit-json";
|
|
2047
|
+
import { z as z90 } from "zod";
|
|
2048
|
+
var schematicArcProps = z90.object({
|
|
2005
2049
|
center: point5,
|
|
2006
2050
|
radius: distance25,
|
|
2007
|
-
startAngleDegrees:
|
|
2008
|
-
endAngleDegrees:
|
|
2009
|
-
direction:
|
|
2051
|
+
startAngleDegrees: rotation6,
|
|
2052
|
+
endAngleDegrees: rotation6,
|
|
2053
|
+
direction: z90.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
2010
2054
|
strokeWidth: distance25.optional(),
|
|
2011
|
-
color:
|
|
2012
|
-
isDashed:
|
|
2055
|
+
color: z90.string().optional(),
|
|
2056
|
+
isDashed: z90.boolean().optional().default(false)
|
|
2013
2057
|
});
|
|
2014
2058
|
expectTypesMatch(true);
|
|
2015
2059
|
|
|
2016
2060
|
// lib/components/toolingrail.ts
|
|
2017
|
-
import { z as
|
|
2018
|
-
var toolingrailProps =
|
|
2019
|
-
children:
|
|
2061
|
+
import { z as z91 } from "zod";
|
|
2062
|
+
var toolingrailProps = z91.object({
|
|
2063
|
+
children: z91.any().optional()
|
|
2020
2064
|
});
|
|
2021
2065
|
expectTypesMatch(true);
|
|
2022
2066
|
|
|
2023
2067
|
// lib/components/schematic-box.ts
|
|
2024
2068
|
import { distance as distance26 } from "circuit-json";
|
|
2025
|
-
import { z as
|
|
2026
|
-
var schematicBoxProps =
|
|
2069
|
+
import { z as z92 } from "zod";
|
|
2070
|
+
var schematicBoxProps = z92.object({
|
|
2027
2071
|
schX: distance26.optional(),
|
|
2028
2072
|
schY: distance26.optional(),
|
|
2029
2073
|
width: distance26.optional(),
|
|
2030
2074
|
height: distance26.optional(),
|
|
2031
|
-
overlay:
|
|
2075
|
+
overlay: z92.array(z92.string()).optional(),
|
|
2032
2076
|
padding: distance26.optional(),
|
|
2033
2077
|
paddingLeft: distance26.optional(),
|
|
2034
2078
|
paddingRight: distance26.optional(),
|
|
2035
2079
|
paddingTop: distance26.optional(),
|
|
2036
2080
|
paddingBottom: distance26.optional(),
|
|
2037
|
-
title:
|
|
2081
|
+
title: z92.string().optional(),
|
|
2038
2082
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
2039
|
-
titleColor:
|
|
2083
|
+
titleColor: z92.string().optional(),
|
|
2040
2084
|
titleFontSize: distance26.optional(),
|
|
2041
|
-
titleInside:
|
|
2042
|
-
strokeStyle:
|
|
2085
|
+
titleInside: z92.boolean().default(false),
|
|
2086
|
+
strokeStyle: z92.enum(["solid", "dashed"]).default("solid")
|
|
2043
2087
|
}).refine(
|
|
2044
2088
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
2045
2089
|
{
|
|
@@ -2055,59 +2099,59 @@ expectTypesMatch(true);
|
|
|
2055
2099
|
|
|
2056
2100
|
// lib/components/schematic-circle.ts
|
|
2057
2101
|
import { distance as distance27, point as point6 } from "circuit-json";
|
|
2058
|
-
import { z as
|
|
2059
|
-
var schematicCircleProps =
|
|
2102
|
+
import { z as z93 } from "zod";
|
|
2103
|
+
var schematicCircleProps = z93.object({
|
|
2060
2104
|
center: point6,
|
|
2061
2105
|
radius: distance27,
|
|
2062
2106
|
strokeWidth: distance27.optional(),
|
|
2063
|
-
color:
|
|
2064
|
-
isFilled:
|
|
2065
|
-
fillColor:
|
|
2066
|
-
isDashed:
|
|
2107
|
+
color: z93.string().optional(),
|
|
2108
|
+
isFilled: z93.boolean().optional().default(false),
|
|
2109
|
+
fillColor: z93.string().optional(),
|
|
2110
|
+
isDashed: z93.boolean().optional().default(false)
|
|
2067
2111
|
});
|
|
2068
2112
|
expectTypesMatch(
|
|
2069
2113
|
true
|
|
2070
2114
|
);
|
|
2071
2115
|
|
|
2072
2116
|
// lib/components/schematic-rect.ts
|
|
2073
|
-
import { distance as distance28, rotation as
|
|
2074
|
-
import { z as
|
|
2075
|
-
var schematicRectProps =
|
|
2117
|
+
import { distance as distance28, rotation as rotation7 } from "circuit-json";
|
|
2118
|
+
import { z as z94 } from "zod";
|
|
2119
|
+
var schematicRectProps = z94.object({
|
|
2076
2120
|
schX: distance28.optional(),
|
|
2077
2121
|
schY: distance28.optional(),
|
|
2078
2122
|
width: distance28,
|
|
2079
2123
|
height: distance28,
|
|
2080
|
-
rotation:
|
|
2124
|
+
rotation: rotation7.default(0),
|
|
2081
2125
|
strokeWidth: distance28.optional(),
|
|
2082
|
-
color:
|
|
2083
|
-
isFilled:
|
|
2084
|
-
fillColor:
|
|
2085
|
-
isDashed:
|
|
2126
|
+
color: z94.string().optional(),
|
|
2127
|
+
isFilled: z94.boolean().optional().default(false),
|
|
2128
|
+
fillColor: z94.string().optional(),
|
|
2129
|
+
isDashed: z94.boolean().optional().default(false),
|
|
2086
2130
|
cornerRadius: distance28.optional()
|
|
2087
2131
|
});
|
|
2088
2132
|
expectTypesMatch(true);
|
|
2089
2133
|
|
|
2090
2134
|
// lib/components/schematic-line.ts
|
|
2091
2135
|
import { distance as distance29 } from "circuit-json";
|
|
2092
|
-
import { z as
|
|
2093
|
-
var schematicLineProps =
|
|
2136
|
+
import { z as z95 } from "zod";
|
|
2137
|
+
var schematicLineProps = z95.object({
|
|
2094
2138
|
x1: distance29,
|
|
2095
2139
|
y1: distance29,
|
|
2096
2140
|
x2: distance29,
|
|
2097
2141
|
y2: distance29,
|
|
2098
2142
|
strokeWidth: distance29.optional(),
|
|
2099
|
-
color:
|
|
2100
|
-
isDashed:
|
|
2143
|
+
color: z95.string().optional(),
|
|
2144
|
+
isDashed: z95.boolean().optional().default(false)
|
|
2101
2145
|
});
|
|
2102
2146
|
expectTypesMatch(true);
|
|
2103
2147
|
|
|
2104
2148
|
// lib/components/schematic-text.ts
|
|
2105
|
-
import { distance as distance30, rotation as
|
|
2106
|
-
import { z as
|
|
2149
|
+
import { distance as distance30, rotation as rotation8 } from "circuit-json";
|
|
2150
|
+
import { z as z97 } from "zod";
|
|
2107
2151
|
|
|
2108
2152
|
// lib/common/fivePointAnchor.ts
|
|
2109
|
-
import { z as
|
|
2110
|
-
var fivePointAnchor =
|
|
2153
|
+
import { z as z96 } from "zod";
|
|
2154
|
+
var fivePointAnchor = z96.enum([
|
|
2111
2155
|
"center",
|
|
2112
2156
|
"left",
|
|
2113
2157
|
"right",
|
|
@@ -2116,34 +2160,34 @@ var fivePointAnchor = z94.enum([
|
|
|
2116
2160
|
]);
|
|
2117
2161
|
|
|
2118
2162
|
// lib/components/schematic-text.ts
|
|
2119
|
-
var schematicTextProps =
|
|
2163
|
+
var schematicTextProps = z97.object({
|
|
2120
2164
|
schX: distance30.optional(),
|
|
2121
2165
|
schY: distance30.optional(),
|
|
2122
|
-
text:
|
|
2123
|
-
fontSize:
|
|
2124
|
-
anchor:
|
|
2125
|
-
color:
|
|
2126
|
-
schRotation:
|
|
2166
|
+
text: z97.string(),
|
|
2167
|
+
fontSize: z97.number().default(1),
|
|
2168
|
+
anchor: z97.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
2169
|
+
color: z97.string().default("#000000"),
|
|
2170
|
+
schRotation: rotation8.default(0)
|
|
2127
2171
|
});
|
|
2128
2172
|
expectTypesMatch(true);
|
|
2129
2173
|
|
|
2130
2174
|
// lib/components/schematic-path.ts
|
|
2131
2175
|
import { point as point8 } from "circuit-json";
|
|
2132
|
-
import { z as
|
|
2133
|
-
var schematicPathProps =
|
|
2134
|
-
points:
|
|
2135
|
-
isFilled:
|
|
2136
|
-
fillColor:
|
|
2176
|
+
import { z as z98 } from "zod";
|
|
2177
|
+
var schematicPathProps = z98.object({
|
|
2178
|
+
points: z98.array(point8),
|
|
2179
|
+
isFilled: z98.boolean().optional().default(false),
|
|
2180
|
+
fillColor: z98.enum(["red", "blue"]).optional()
|
|
2137
2181
|
});
|
|
2138
2182
|
expectTypesMatch(true);
|
|
2139
2183
|
|
|
2140
2184
|
// lib/components/schematic-table.ts
|
|
2141
2185
|
import { distance as distance31 } from "circuit-json";
|
|
2142
|
-
import { z as
|
|
2143
|
-
var schematicTableProps =
|
|
2186
|
+
import { z as z99 } from "zod";
|
|
2187
|
+
var schematicTableProps = z99.object({
|
|
2144
2188
|
schX: distance31.optional(),
|
|
2145
2189
|
schY: distance31.optional(),
|
|
2146
|
-
children:
|
|
2190
|
+
children: z99.any().optional(),
|
|
2147
2191
|
cellPadding: distance31.optional(),
|
|
2148
2192
|
borderWidth: distance31.optional(),
|
|
2149
2193
|
anchor: ninePointAnchor.optional(),
|
|
@@ -2153,64 +2197,64 @@ expectTypesMatch(true);
|
|
|
2153
2197
|
|
|
2154
2198
|
// lib/components/schematic-row.ts
|
|
2155
2199
|
import { distance as distance32 } from "circuit-json";
|
|
2156
|
-
import { z as
|
|
2157
|
-
var schematicRowProps =
|
|
2158
|
-
children:
|
|
2200
|
+
import { z as z100 } from "zod";
|
|
2201
|
+
var schematicRowProps = z100.object({
|
|
2202
|
+
children: z100.any().optional(),
|
|
2159
2203
|
height: distance32.optional()
|
|
2160
2204
|
});
|
|
2161
2205
|
expectTypesMatch(true);
|
|
2162
2206
|
|
|
2163
2207
|
// lib/components/schematic-cell.ts
|
|
2164
2208
|
import { distance as distance33 } from "circuit-json";
|
|
2165
|
-
import { z as
|
|
2166
|
-
var schematicCellProps =
|
|
2167
|
-
children:
|
|
2168
|
-
horizontalAlign:
|
|
2169
|
-
verticalAlign:
|
|
2209
|
+
import { z as z101 } from "zod";
|
|
2210
|
+
var schematicCellProps = z101.object({
|
|
2211
|
+
children: z101.string().optional(),
|
|
2212
|
+
horizontalAlign: z101.enum(["left", "center", "right"]).optional(),
|
|
2213
|
+
verticalAlign: z101.enum(["top", "middle", "bottom"]).optional(),
|
|
2170
2214
|
fontSize: distance33.optional(),
|
|
2171
|
-
rowSpan:
|
|
2172
|
-
colSpan:
|
|
2215
|
+
rowSpan: z101.number().optional(),
|
|
2216
|
+
colSpan: z101.number().optional(),
|
|
2173
2217
|
width: distance33.optional(),
|
|
2174
|
-
text:
|
|
2218
|
+
text: z101.string().optional()
|
|
2175
2219
|
});
|
|
2176
2220
|
expectTypesMatch(true);
|
|
2177
2221
|
|
|
2178
2222
|
// lib/components/copper-text.ts
|
|
2179
2223
|
import { layer_ref as layer_ref8, length as length7 } from "circuit-json";
|
|
2180
|
-
import { z as
|
|
2224
|
+
import { z as z102 } from "zod";
|
|
2181
2225
|
var copperTextProps = pcbLayoutProps.extend({
|
|
2182
|
-
text:
|
|
2226
|
+
text: z102.string(),
|
|
2183
2227
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2184
|
-
font:
|
|
2228
|
+
font: z102.enum(["tscircuit2024"]).optional(),
|
|
2185
2229
|
fontSize: length7.optional(),
|
|
2186
|
-
layers:
|
|
2187
|
-
knockout:
|
|
2188
|
-
mirrored:
|
|
2230
|
+
layers: z102.array(layer_ref8).optional(),
|
|
2231
|
+
knockout: z102.boolean().optional(),
|
|
2232
|
+
mirrored: z102.boolean().optional()
|
|
2189
2233
|
});
|
|
2190
2234
|
|
|
2191
2235
|
// lib/components/silkscreen-text.ts
|
|
2192
2236
|
import { layer_ref as layer_ref9, length as length8 } from "circuit-json";
|
|
2193
|
-
import { z as
|
|
2237
|
+
import { z as z103 } from "zod";
|
|
2194
2238
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
2195
|
-
text:
|
|
2239
|
+
text: z103.string(),
|
|
2196
2240
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2197
|
-
font:
|
|
2241
|
+
font: z103.enum(["tscircuit2024"]).optional(),
|
|
2198
2242
|
fontSize: length8.optional(),
|
|
2199
2243
|
/**
|
|
2200
2244
|
* If true, text will knock out underlying silkscreen
|
|
2201
2245
|
*/
|
|
2202
|
-
isKnockout:
|
|
2246
|
+
isKnockout: z103.boolean().optional(),
|
|
2203
2247
|
knockoutPadding: length8.optional(),
|
|
2204
2248
|
knockoutPaddingLeft: length8.optional(),
|
|
2205
2249
|
knockoutPaddingRight: length8.optional(),
|
|
2206
2250
|
knockoutPaddingTop: length8.optional(),
|
|
2207
2251
|
knockoutPaddingBottom: length8.optional(),
|
|
2208
|
-
layers:
|
|
2252
|
+
layers: z103.array(layer_ref9).optional()
|
|
2209
2253
|
});
|
|
2210
2254
|
|
|
2211
2255
|
// lib/components/silkscreen-path.ts
|
|
2212
2256
|
import { length as length9, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
2213
|
-
import { z as
|
|
2257
|
+
import { z as z104 } from "zod";
|
|
2214
2258
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
2215
2259
|
pcbLeftEdgeX: true,
|
|
2216
2260
|
pcbRightEdgeX: true,
|
|
@@ -2222,7 +2266,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
2222
2266
|
pcbOffsetY: true,
|
|
2223
2267
|
pcbRotation: true
|
|
2224
2268
|
}).extend({
|
|
2225
|
-
route:
|
|
2269
|
+
route: z104.array(route_hint_point5),
|
|
2226
2270
|
strokeWidth: length9.optional()
|
|
2227
2271
|
});
|
|
2228
2272
|
|
|
@@ -2244,10 +2288,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
2244
2288
|
|
|
2245
2289
|
// lib/components/silkscreen-rect.ts
|
|
2246
2290
|
import { distance as distance35 } from "circuit-json";
|
|
2247
|
-
import { z as
|
|
2291
|
+
import { z as z105 } from "zod";
|
|
2248
2292
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2249
|
-
filled:
|
|
2250
|
-
stroke:
|
|
2293
|
+
filled: z105.boolean().default(true).optional(),
|
|
2294
|
+
stroke: z105.enum(["dashed", "solid", "none"]).optional(),
|
|
2251
2295
|
strokeWidth: distance35.optional(),
|
|
2252
2296
|
width: distance35,
|
|
2253
2297
|
height: distance35,
|
|
@@ -2256,66 +2300,66 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
2256
2300
|
|
|
2257
2301
|
// lib/components/silkscreen-circle.ts
|
|
2258
2302
|
import { distance as distance36 } from "circuit-json";
|
|
2259
|
-
import { z as
|
|
2303
|
+
import { z as z106 } from "zod";
|
|
2260
2304
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2261
|
-
isFilled:
|
|
2262
|
-
isOutline:
|
|
2305
|
+
isFilled: z106.boolean().optional(),
|
|
2306
|
+
isOutline: z106.boolean().optional(),
|
|
2263
2307
|
strokeWidth: distance36.optional(),
|
|
2264
2308
|
radius: distance36
|
|
2265
2309
|
});
|
|
2266
2310
|
|
|
2267
2311
|
// lib/components/trace-hint.ts
|
|
2268
2312
|
import { distance as distance37, layer_ref as layer_ref10, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
2269
|
-
import { z as
|
|
2270
|
-
var routeHintPointProps =
|
|
2313
|
+
import { z as z107 } from "zod";
|
|
2314
|
+
var routeHintPointProps = z107.object({
|
|
2271
2315
|
x: distance37,
|
|
2272
2316
|
y: distance37,
|
|
2273
|
-
via:
|
|
2317
|
+
via: z107.boolean().optional(),
|
|
2274
2318
|
toLayer: layer_ref10.optional()
|
|
2275
2319
|
});
|
|
2276
|
-
var traceHintProps =
|
|
2277
|
-
for:
|
|
2320
|
+
var traceHintProps = z107.object({
|
|
2321
|
+
for: z107.string().optional().describe(
|
|
2278
2322
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
2279
2323
|
),
|
|
2280
|
-
order:
|
|
2324
|
+
order: z107.number().optional(),
|
|
2281
2325
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
2282
|
-
offsets:
|
|
2283
|
-
traceWidth:
|
|
2326
|
+
offsets: z107.array(route_hint_point6).or(z107.array(routeHintPointProps)).optional(),
|
|
2327
|
+
traceWidth: z107.number().optional()
|
|
2284
2328
|
});
|
|
2285
2329
|
|
|
2286
2330
|
// lib/components/port.ts
|
|
2287
|
-
import { z as
|
|
2331
|
+
import { z as z108 } from "zod";
|
|
2288
2332
|
var portProps = commonLayoutProps.extend({
|
|
2289
|
-
name:
|
|
2290
|
-
pinNumber:
|
|
2291
|
-
aliases:
|
|
2333
|
+
name: z108.string(),
|
|
2334
|
+
pinNumber: z108.number().optional(),
|
|
2335
|
+
aliases: z108.array(z108.string()).optional(),
|
|
2292
2336
|
direction,
|
|
2293
|
-
connectsTo:
|
|
2337
|
+
connectsTo: z108.string().or(z108.array(z108.string())).optional()
|
|
2294
2338
|
});
|
|
2295
2339
|
|
|
2296
2340
|
// lib/components/pcb-note-text.ts
|
|
2297
2341
|
import { length as length10 } from "circuit-json";
|
|
2298
|
-
import { z as
|
|
2342
|
+
import { z as z109 } from "zod";
|
|
2299
2343
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
2300
|
-
text:
|
|
2301
|
-
anchorAlignment:
|
|
2302
|
-
font:
|
|
2344
|
+
text: z109.string(),
|
|
2345
|
+
anchorAlignment: z109.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2346
|
+
font: z109.enum(["tscircuit2024"]).optional(),
|
|
2303
2347
|
fontSize: length10.optional(),
|
|
2304
|
-
color:
|
|
2348
|
+
color: z109.string().optional()
|
|
2305
2349
|
});
|
|
2306
2350
|
expectTypesMatch(true);
|
|
2307
2351
|
|
|
2308
2352
|
// lib/components/pcb-note-rect.ts
|
|
2309
2353
|
import { distance as distance38 } from "circuit-json";
|
|
2310
|
-
import { z as
|
|
2354
|
+
import { z as z110 } from "zod";
|
|
2311
2355
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2312
2356
|
width: distance38,
|
|
2313
2357
|
height: distance38,
|
|
2314
2358
|
strokeWidth: distance38.optional(),
|
|
2315
|
-
isFilled:
|
|
2316
|
-
hasStroke:
|
|
2317
|
-
isStrokeDashed:
|
|
2318
|
-
color:
|
|
2359
|
+
isFilled: z110.boolean().optional(),
|
|
2360
|
+
hasStroke: z110.boolean().optional(),
|
|
2361
|
+
isStrokeDashed: z110.boolean().optional(),
|
|
2362
|
+
color: z110.string().optional(),
|
|
2319
2363
|
cornerRadius: distance38.optional()
|
|
2320
2364
|
});
|
|
2321
2365
|
expectTypesMatch(true);
|
|
@@ -2325,7 +2369,7 @@ import {
|
|
|
2325
2369
|
length as length11,
|
|
2326
2370
|
route_hint_point as route_hint_point7
|
|
2327
2371
|
} from "circuit-json";
|
|
2328
|
-
import { z as
|
|
2372
|
+
import { z as z111 } from "zod";
|
|
2329
2373
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
2330
2374
|
pcbLeftEdgeX: true,
|
|
2331
2375
|
pcbRightEdgeX: true,
|
|
@@ -2337,15 +2381,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
2337
2381
|
pcbOffsetY: true,
|
|
2338
2382
|
pcbRotation: true
|
|
2339
2383
|
}).extend({
|
|
2340
|
-
route:
|
|
2384
|
+
route: z111.array(route_hint_point7),
|
|
2341
2385
|
strokeWidth: length11.optional(),
|
|
2342
|
-
color:
|
|
2386
|
+
color: z111.string().optional()
|
|
2343
2387
|
});
|
|
2344
2388
|
expectTypesMatch(true);
|
|
2345
2389
|
|
|
2346
2390
|
// lib/components/pcb-note-line.ts
|
|
2347
2391
|
import { distance as distance39 } from "circuit-json";
|
|
2348
|
-
import { z as
|
|
2392
|
+
import { z as z112 } from "zod";
|
|
2349
2393
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
2350
2394
|
pcbLeftEdgeX: true,
|
|
2351
2395
|
pcbRightEdgeX: true,
|
|
@@ -2362,15 +2406,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
2362
2406
|
x2: distance39,
|
|
2363
2407
|
y2: distance39,
|
|
2364
2408
|
strokeWidth: distance39.optional(),
|
|
2365
|
-
color:
|
|
2366
|
-
isDashed:
|
|
2409
|
+
color: z112.string().optional(),
|
|
2410
|
+
isDashed: z112.boolean().optional()
|
|
2367
2411
|
});
|
|
2368
2412
|
expectTypesMatch(true);
|
|
2369
2413
|
|
|
2370
2414
|
// lib/components/pcb-note-dimension.ts
|
|
2371
2415
|
import { distance as distance40, length as length12 } from "circuit-json";
|
|
2372
|
-
import { z as
|
|
2373
|
-
var dimensionTarget2 =
|
|
2416
|
+
import { z as z113 } from "zod";
|
|
2417
|
+
var dimensionTarget2 = z113.union([z113.string(), point]);
|
|
2374
2418
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
2375
2419
|
pcbLeftEdgeX: true,
|
|
2376
2420
|
pcbRightEdgeX: true,
|
|
@@ -2384,93 +2428,93 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
2384
2428
|
}).extend({
|
|
2385
2429
|
from: dimensionTarget2,
|
|
2386
2430
|
to: dimensionTarget2,
|
|
2387
|
-
text:
|
|
2431
|
+
text: z113.string().optional(),
|
|
2388
2432
|
offset: distance40.optional(),
|
|
2389
|
-
font:
|
|
2433
|
+
font: z113.enum(["tscircuit2024"]).optional(),
|
|
2390
2434
|
fontSize: length12.optional(),
|
|
2391
|
-
color:
|
|
2435
|
+
color: z113.string().optional(),
|
|
2392
2436
|
arrowSize: distance40.optional(),
|
|
2393
|
-
units:
|
|
2394
|
-
outerEdgeToEdge:
|
|
2395
|
-
centerToCenter:
|
|
2396
|
-
innerEdgeToEdge:
|
|
2437
|
+
units: z113.enum(["in", "mm"]).optional(),
|
|
2438
|
+
outerEdgeToEdge: z113.literal(true).optional(),
|
|
2439
|
+
centerToCenter: z113.literal(true).optional(),
|
|
2440
|
+
innerEdgeToEdge: z113.literal(true).optional()
|
|
2397
2441
|
});
|
|
2398
2442
|
expectTypesMatch(
|
|
2399
2443
|
true
|
|
2400
2444
|
);
|
|
2401
2445
|
|
|
2402
2446
|
// lib/platformConfig.ts
|
|
2403
|
-
import { z as
|
|
2404
|
-
var unvalidatedCircuitJson =
|
|
2405
|
-
var footprintLibraryResult =
|
|
2406
|
-
footprintCircuitJson:
|
|
2447
|
+
import { z as z114 } from "zod";
|
|
2448
|
+
var unvalidatedCircuitJson = z114.array(z114.any()).describe("Circuit JSON");
|
|
2449
|
+
var footprintLibraryResult = z114.object({
|
|
2450
|
+
footprintCircuitJson: z114.array(z114.any()),
|
|
2407
2451
|
cadModel: cadModelProp.optional()
|
|
2408
2452
|
});
|
|
2409
|
-
var pathToCircuitJsonFn =
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
).returns(
|
|
2453
|
+
var pathToCircuitJsonFn = z114.function().args(z114.string()).returns(z114.promise(footprintLibraryResult)).or(
|
|
2454
|
+
z114.function().args(
|
|
2455
|
+
z114.string(),
|
|
2456
|
+
z114.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
2457
|
+
).returns(z114.promise(footprintLibraryResult))
|
|
2414
2458
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
2415
|
-
var footprintFileParserEntry =
|
|
2416
|
-
loadFromUrl:
|
|
2459
|
+
var footprintFileParserEntry = z114.object({
|
|
2460
|
+
loadFromUrl: z114.function().args(z114.string()).returns(z114.promise(footprintLibraryResult)).describe(
|
|
2417
2461
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
2418
2462
|
)
|
|
2419
2463
|
});
|
|
2420
|
-
var spiceEngineSimulationResult =
|
|
2421
|
-
engineVersionString:
|
|
2464
|
+
var spiceEngineSimulationResult = z114.object({
|
|
2465
|
+
engineVersionString: z114.string().optional(),
|
|
2422
2466
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
2423
2467
|
});
|
|
2424
|
-
var spiceEngineZod =
|
|
2425
|
-
simulate:
|
|
2468
|
+
var spiceEngineZod = z114.object({
|
|
2469
|
+
simulate: z114.function().args(z114.string()).returns(z114.promise(spiceEngineSimulationResult)).describe(
|
|
2426
2470
|
"A function that takes a SPICE string and returns a simulation result"
|
|
2427
2471
|
)
|
|
2428
2472
|
});
|
|
2429
|
-
var defaultSpiceEngine =
|
|
2473
|
+
var defaultSpiceEngine = z114.custom(
|
|
2430
2474
|
(value) => typeof value === "string"
|
|
2431
2475
|
);
|
|
2432
|
-
var autorouterInstance =
|
|
2433
|
-
run:
|
|
2434
|
-
getOutputSimpleRouteJson:
|
|
2476
|
+
var autorouterInstance = z114.object({
|
|
2477
|
+
run: z114.function().args().returns(z114.promise(z114.unknown())).describe("Run the autorouter"),
|
|
2478
|
+
getOutputSimpleRouteJson: z114.function().args().returns(z114.promise(z114.any())).describe("Get the resulting SimpleRouteJson")
|
|
2435
2479
|
});
|
|
2436
|
-
var autorouterDefinition =
|
|
2437
|
-
createAutorouter:
|
|
2480
|
+
var autorouterDefinition = z114.object({
|
|
2481
|
+
createAutorouter: z114.function().args(z114.any(), z114.any().optional()).returns(z114.union([autorouterInstance, z114.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
2438
2482
|
});
|
|
2439
|
-
var platformConfig =
|
|
2483
|
+
var platformConfig = z114.object({
|
|
2440
2484
|
partsEngine: partsEngine.optional(),
|
|
2441
2485
|
autorouter: autorouterProp.optional(),
|
|
2442
|
-
autorouterMap:
|
|
2443
|
-
registryApiUrl:
|
|
2444
|
-
cloudAutorouterUrl:
|
|
2445
|
-
projectName:
|
|
2446
|
-
projectBaseUrl:
|
|
2447
|
-
version:
|
|
2448
|
-
url:
|
|
2449
|
-
printBoardInformationToSilkscreen:
|
|
2450
|
-
includeBoardFiles:
|
|
2486
|
+
autorouterMap: z114.record(z114.string(), autorouterDefinition).optional(),
|
|
2487
|
+
registryApiUrl: z114.string().optional(),
|
|
2488
|
+
cloudAutorouterUrl: z114.string().optional(),
|
|
2489
|
+
projectName: z114.string().optional(),
|
|
2490
|
+
projectBaseUrl: z114.string().optional(),
|
|
2491
|
+
version: z114.string().optional(),
|
|
2492
|
+
url: z114.string().optional(),
|
|
2493
|
+
printBoardInformationToSilkscreen: z114.boolean().optional(),
|
|
2494
|
+
includeBoardFiles: z114.array(z114.string()).describe(
|
|
2451
2495
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
2452
2496
|
).optional(),
|
|
2453
|
-
snapshotsDir:
|
|
2497
|
+
snapshotsDir: z114.string().describe(
|
|
2454
2498
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
2455
2499
|
).optional(),
|
|
2456
2500
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
2457
|
-
localCacheEngine:
|
|
2458
|
-
pcbDisabled:
|
|
2459
|
-
schematicDisabled:
|
|
2460
|
-
partsEngineDisabled:
|
|
2461
|
-
spiceEngineMap:
|
|
2462
|
-
footprintLibraryMap:
|
|
2463
|
-
|
|
2464
|
-
|
|
2501
|
+
localCacheEngine: z114.any().optional(),
|
|
2502
|
+
pcbDisabled: z114.boolean().optional(),
|
|
2503
|
+
schematicDisabled: z114.boolean().optional(),
|
|
2504
|
+
partsEngineDisabled: z114.boolean().optional(),
|
|
2505
|
+
spiceEngineMap: z114.record(z114.string(), spiceEngineZod).optional(),
|
|
2506
|
+
footprintLibraryMap: z114.record(
|
|
2507
|
+
z114.string(),
|
|
2508
|
+
z114.union([
|
|
2465
2509
|
pathToCircuitJsonFn,
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2510
|
+
z114.record(
|
|
2511
|
+
z114.string(),
|
|
2512
|
+
z114.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
2469
2513
|
)
|
|
2470
2514
|
])
|
|
2471
2515
|
).optional(),
|
|
2472
|
-
footprintFileParserMap:
|
|
2473
|
-
resolveProjectStaticFileImportUrl:
|
|
2516
|
+
footprintFileParserMap: z114.record(z114.string(), footprintFileParserEntry).optional(),
|
|
2517
|
+
resolveProjectStaticFileImportUrl: z114.function().args(z114.string()).returns(z114.promise(z114.string())).describe(
|
|
2474
2518
|
"A function that returns a string URL for static files for the project"
|
|
2475
2519
|
).optional()
|
|
2476
2520
|
});
|
|
@@ -2535,6 +2579,9 @@ export {
|
|
|
2535
2579
|
courtyardRectProps,
|
|
2536
2580
|
crystalPins,
|
|
2537
2581
|
crystalProps,
|
|
2582
|
+
currentSourcePinLabels,
|
|
2583
|
+
currentSourcePins,
|
|
2584
|
+
currentSourceProps,
|
|
2538
2585
|
cutoutProps,
|
|
2539
2586
|
diodePins,
|
|
2540
2587
|
diodeProps,
|
|
@@ -2580,6 +2627,9 @@ export {
|
|
|
2580
2627
|
netLabelProps,
|
|
2581
2628
|
netProps,
|
|
2582
2629
|
ninePointAnchor,
|
|
2630
|
+
opampPinLabels,
|
|
2631
|
+
opampPins,
|
|
2632
|
+
opampProps,
|
|
2583
2633
|
panelProps,
|
|
2584
2634
|
partsEngine,
|
|
2585
2635
|
pcbKeepoutProps,
|