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