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