@tscircuit/core 0.0.1223 → 0.0.1225
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/dist/index.d.ts +218 -46
- package/dist/index.js +69 -16
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as circuit_json from 'circuit-json';
|
|
2
2
|
import { PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, LayerRef, AnyCircuitElement, Size, PcbTraceRoutePoint, AnySourceComponent, PcbComponent, PcbTrace as PcbTrace$1, PcbVia, SchematicPort, SchematicComponent, RouteHintPoint, CircuitJson } from 'circuit-json';
|
|
3
3
|
import * as _tscircuit_props from '@tscircuit/props';
|
|
4
|
-
import { PlatformConfig, traceProps, netProps, AutorouterProp, subcircuitGroupProps, AutorouterConfig, PcbSx, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, subcircuitProps, subpanelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, resistorProps, constraintProps, autoroutingPhaseProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, fiducialProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicSectionProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
|
|
4
|
+
import { PlatformConfig, traceProps, netProps, AutorouterProp, subcircuitGroupProps, AutorouterConfig, PcbSx, portProps, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, subcircuitProps, subpanelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, resistorProps, constraintProps, autoroutingPhaseProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, fiducialProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicSectionProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
|
|
5
5
|
export { kicadFootprintStrings } from '@tscircuit/props';
|
|
6
6
|
import * as react from 'react';
|
|
7
7
|
import react__default, { ReactElement, DetailedHTMLProps, SVGProps } from 'react';
|
|
@@ -1683,40 +1683,6 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
|
|
|
1683
1683
|
get [Symbol.toStringTag](): string;
|
|
1684
1684
|
}
|
|
1685
1685
|
|
|
1686
|
-
declare const portProps: z.ZodObject<{
|
|
1687
|
-
name: z.ZodOptional<z.ZodString>;
|
|
1688
|
-
pinNumber: z.ZodOptional<z.ZodNumber>;
|
|
1689
|
-
schStemLength: z.ZodOptional<z.ZodNumber>;
|
|
1690
|
-
aliases: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1691
|
-
layer: z.ZodOptional<z.ZodString>;
|
|
1692
|
-
layers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1693
|
-
schX: z.ZodOptional<z.ZodNumber>;
|
|
1694
|
-
schY: z.ZodOptional<z.ZodNumber>;
|
|
1695
|
-
direction: z.ZodOptional<z.ZodEnum<["up", "down", "left", "right"]>>;
|
|
1696
|
-
connectsTo: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
1697
|
-
}, "strip", z.ZodTypeAny, {
|
|
1698
|
-
layer?: string | undefined;
|
|
1699
|
-
layers?: string[] | undefined;
|
|
1700
|
-
name?: string | undefined;
|
|
1701
|
-
pinNumber?: number | undefined;
|
|
1702
|
-
schStemLength?: number | undefined;
|
|
1703
|
-
aliases?: string[] | undefined;
|
|
1704
|
-
schX?: number | undefined;
|
|
1705
|
-
schY?: number | undefined;
|
|
1706
|
-
direction?: "right" | "left" | "up" | "down" | undefined;
|
|
1707
|
-
connectsTo?: string | string[] | undefined;
|
|
1708
|
-
}, {
|
|
1709
|
-
layer?: string | undefined;
|
|
1710
|
-
layers?: string[] | undefined;
|
|
1711
|
-
name?: string | undefined;
|
|
1712
|
-
pinNumber?: number | undefined;
|
|
1713
|
-
schStemLength?: number | undefined;
|
|
1714
|
-
aliases?: string[] | undefined;
|
|
1715
|
-
schX?: number | undefined;
|
|
1716
|
-
schY?: number | undefined;
|
|
1717
|
-
direction?: "right" | "left" | "up" | "down" | undefined;
|
|
1718
|
-
connectsTo?: string | string[] | undefined;
|
|
1719
|
-
}>;
|
|
1720
1686
|
declare class Port extends PrimitiveComponent<typeof portProps> {
|
|
1721
1687
|
source_port_id: string | null;
|
|
1722
1688
|
pcb_port_id: string | null;
|
|
@@ -1731,6 +1697,82 @@ declare class Port extends PrimitiveComponent<typeof portProps> {
|
|
|
1731
1697
|
get config(): {
|
|
1732
1698
|
componentName: string;
|
|
1733
1699
|
zodProps: z.ZodObject<{
|
|
1700
|
+
pcbX: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>]>>;
|
|
1701
|
+
pcbY: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>]>>;
|
|
1702
|
+
pcbLeftEdgeX: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>]>>;
|
|
1703
|
+
pcbRightEdgeX: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>]>>;
|
|
1704
|
+
pcbTopEdgeY: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>]>>;
|
|
1705
|
+
pcbBottomEdgeY: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>]>>;
|
|
1706
|
+
pcbOffsetX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1707
|
+
pcbOffsetY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1708
|
+
pcbRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1709
|
+
pcbPositionAnchor: z.ZodOptional<z.ZodString>;
|
|
1710
|
+
pcbPositionMode: z.ZodOptional<z.ZodEnum<["relative_to_group_anchor", "auto", "relative_to_board_anchor", "relative_to_component_anchor"]>>;
|
|
1711
|
+
shouldBeOnEdgeOfBoard: z.ZodOptional<z.ZodBoolean>;
|
|
1712
|
+
pcbMarginTop: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1713
|
+
pcbMarginRight: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1714
|
+
pcbMarginBottom: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1715
|
+
pcbMarginLeft: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1716
|
+
pcbMarginX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1717
|
+
pcbMarginY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1718
|
+
pcbStyle: z.ZodOptional<z.ZodObject<{
|
|
1719
|
+
silkscreenFontSize: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1720
|
+
viaPadDiameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1721
|
+
viaHoleDiameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1722
|
+
silkscreenTextPosition: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["centered", "outside", "none"]>, z.ZodObject<{
|
|
1723
|
+
offsetX: z.ZodNumber;
|
|
1724
|
+
offsetY: z.ZodNumber;
|
|
1725
|
+
}, "strip", z.ZodTypeAny, {
|
|
1726
|
+
offsetX: number;
|
|
1727
|
+
offsetY: number;
|
|
1728
|
+
}, {
|
|
1729
|
+
offsetX: number;
|
|
1730
|
+
offsetY: number;
|
|
1731
|
+
}>]>>;
|
|
1732
|
+
silkscreenTextVisibility: z.ZodOptional<z.ZodEnum<["hidden", "visible", "inherit"]>>;
|
|
1733
|
+
}, "strip", z.ZodTypeAny, {
|
|
1734
|
+
silkscreenFontSize?: number | undefined;
|
|
1735
|
+
viaPadDiameter?: number | undefined;
|
|
1736
|
+
viaHoleDiameter?: number | undefined;
|
|
1737
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
1738
|
+
offsetX: number;
|
|
1739
|
+
offsetY: number;
|
|
1740
|
+
} | undefined;
|
|
1741
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
1742
|
+
}, {
|
|
1743
|
+
silkscreenFontSize?: string | number | undefined;
|
|
1744
|
+
viaPadDiameter?: string | number | undefined;
|
|
1745
|
+
viaHoleDiameter?: string | number | undefined;
|
|
1746
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
1747
|
+
offsetX: number;
|
|
1748
|
+
offsetY: number;
|
|
1749
|
+
} | undefined;
|
|
1750
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
1751
|
+
}>>;
|
|
1752
|
+
pcbSx: z.ZodOptional<z.ZodType<_tscircuit_props.PcbSx, z.ZodTypeDef, _tscircuit_props.PcbSx>>;
|
|
1753
|
+
schMarginTop: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1754
|
+
schMarginRight: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1755
|
+
schMarginBottom: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1756
|
+
schMarginLeft: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1757
|
+
schMarginX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1758
|
+
schMarginY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1759
|
+
schRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1760
|
+
footprint: z.ZodOptional<z.ZodType<_tscircuit_props.FootprintProp, z.ZodTypeDef, _tscircuit_props.FootprintProp>>;
|
|
1761
|
+
symbol: z.ZodOptional<z.ZodType<_tscircuit_props.SymbolProp, z.ZodTypeDef, _tscircuit_props.SymbolProp>>;
|
|
1762
|
+
schStyle: z.ZodOptional<z.ZodObject<{
|
|
1763
|
+
defaultPassiveSize: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["xs", "sm", "md"]>, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>]>>;
|
|
1764
|
+
defaultCapacitorOrientation: z.ZodOptional<z.ZodEnum<["vertical", "none"]>>;
|
|
1765
|
+
}, "strip", z.ZodTypeAny, {
|
|
1766
|
+
defaultPassiveSize?: number | "xs" | "sm" | "md" | undefined;
|
|
1767
|
+
defaultCapacitorOrientation?: "none" | "vertical" | undefined;
|
|
1768
|
+
}, {
|
|
1769
|
+
defaultPassiveSize?: string | number | undefined;
|
|
1770
|
+
defaultCapacitorOrientation?: "none" | "vertical" | undefined;
|
|
1771
|
+
}>>;
|
|
1772
|
+
relative: z.ZodOptional<z.ZodBoolean>;
|
|
1773
|
+
schRelative: z.ZodOptional<z.ZodBoolean>;
|
|
1774
|
+
pcbRelative: z.ZodOptional<z.ZodBoolean>;
|
|
1775
|
+
} & {
|
|
1734
1776
|
name: z.ZodOptional<z.ZodString>;
|
|
1735
1777
|
pinNumber: z.ZodOptional<z.ZodNumber>;
|
|
1736
1778
|
schStemLength: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1741,28 +1783,154 @@ declare class Port extends PrimitiveComponent<typeof portProps> {
|
|
|
1741
1783
|
schY: z.ZodOptional<z.ZodNumber>;
|
|
1742
1784
|
direction: z.ZodOptional<z.ZodEnum<["up", "down", "left", "right"]>>;
|
|
1743
1785
|
connectsTo: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
1786
|
+
kicadPinMetadata: z.ZodOptional<z.ZodObject<{
|
|
1787
|
+
electricalType: z.ZodOptional<z.ZodEnum<["input", "output", "bidirectional", "tri_state", "passive", "free", "unspecified", "power_in", "power_out", "open_collector", "open_emitter", "no_connect"]>>;
|
|
1788
|
+
graphicStyle: z.ZodOptional<z.ZodEnum<["line", "inverted", "clock", "inverted_clock", "input_low", "clock_low", "output_low", "falling_edge_clock", "nonlogic"]>>;
|
|
1789
|
+
pinLength: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1790
|
+
nameTextSize: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1791
|
+
numberTextSize: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
1792
|
+
}, "strip", z.ZodTypeAny, {
|
|
1793
|
+
electricalType?: "input" | "output" | "bidirectional" | "tri_state" | "passive" | "free" | "unspecified" | "power_in" | "power_out" | "open_collector" | "open_emitter" | "no_connect" | undefined;
|
|
1794
|
+
graphicStyle?: "line" | "inverted" | "clock" | "inverted_clock" | "input_low" | "clock_low" | "output_low" | "falling_edge_clock" | "nonlogic" | undefined;
|
|
1795
|
+
pinLength?: number | undefined;
|
|
1796
|
+
nameTextSize?: number | undefined;
|
|
1797
|
+
numberTextSize?: number | undefined;
|
|
1798
|
+
}, {
|
|
1799
|
+
electricalType?: "input" | "output" | "bidirectional" | "tri_state" | "passive" | "free" | "unspecified" | "power_in" | "power_out" | "open_collector" | "open_emitter" | "no_connect" | undefined;
|
|
1800
|
+
graphicStyle?: "line" | "inverted" | "clock" | "inverted_clock" | "input_low" | "clock_low" | "output_low" | "falling_edge_clock" | "nonlogic" | undefined;
|
|
1801
|
+
pinLength?: string | number | undefined;
|
|
1802
|
+
nameTextSize?: string | number | undefined;
|
|
1803
|
+
numberTextSize?: string | number | undefined;
|
|
1804
|
+
}>>;
|
|
1805
|
+
hasInversionCircle: z.ZodOptional<z.ZodBoolean>;
|
|
1744
1806
|
}, "strip", z.ZodTypeAny, {
|
|
1807
|
+
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
1745
1808
|
layer?: string | undefined;
|
|
1746
|
-
layers?: string[] | undefined;
|
|
1747
1809
|
name?: string | undefined;
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1810
|
+
layers?: string[] | undefined;
|
|
1811
|
+
pcbX?: string | number | undefined;
|
|
1812
|
+
pcbY?: string | number | undefined;
|
|
1813
|
+
pcbLeftEdgeX?: string | number | undefined;
|
|
1814
|
+
pcbRightEdgeX?: string | number | undefined;
|
|
1815
|
+
pcbTopEdgeY?: string | number | undefined;
|
|
1816
|
+
pcbBottomEdgeY?: string | number | undefined;
|
|
1817
|
+
pcbOffsetX?: number | undefined;
|
|
1818
|
+
pcbOffsetY?: number | undefined;
|
|
1819
|
+
pcbRotation?: number | undefined;
|
|
1820
|
+
pcbPositionAnchor?: string | undefined;
|
|
1821
|
+
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
1822
|
+
shouldBeOnEdgeOfBoard?: boolean | undefined;
|
|
1823
|
+
pcbMarginTop?: number | undefined;
|
|
1824
|
+
pcbMarginRight?: number | undefined;
|
|
1825
|
+
pcbMarginBottom?: number | undefined;
|
|
1826
|
+
pcbMarginLeft?: number | undefined;
|
|
1827
|
+
pcbMarginX?: number | undefined;
|
|
1828
|
+
pcbMarginY?: number | undefined;
|
|
1829
|
+
pcbStyle?: {
|
|
1830
|
+
silkscreenFontSize?: number | undefined;
|
|
1831
|
+
viaPadDiameter?: number | undefined;
|
|
1832
|
+
viaHoleDiameter?: number | undefined;
|
|
1833
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
1834
|
+
offsetX: number;
|
|
1835
|
+
offsetY: number;
|
|
1836
|
+
} | undefined;
|
|
1837
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
1838
|
+
} | undefined;
|
|
1839
|
+
pcbSx?: _tscircuit_props.PcbSx | undefined;
|
|
1840
|
+
pcbRelative?: boolean | undefined;
|
|
1841
|
+
relative?: boolean | undefined;
|
|
1842
|
+
schMarginTop?: number | undefined;
|
|
1843
|
+
schMarginRight?: number | undefined;
|
|
1844
|
+
schMarginBottom?: number | undefined;
|
|
1845
|
+
schMarginLeft?: number | undefined;
|
|
1846
|
+
schMarginX?: number | undefined;
|
|
1847
|
+
schMarginY?: number | undefined;
|
|
1751
1848
|
schX?: number | undefined;
|
|
1752
1849
|
schY?: number | undefined;
|
|
1753
|
-
|
|
1850
|
+
schRotation?: number | undefined;
|
|
1851
|
+
footprint?: _tscircuit_props.FootprintProp | undefined;
|
|
1852
|
+
schStyle?: {
|
|
1853
|
+
defaultPassiveSize?: number | "xs" | "sm" | "md" | undefined;
|
|
1854
|
+
defaultCapacitorOrientation?: "none" | "vertical" | undefined;
|
|
1855
|
+
} | undefined;
|
|
1856
|
+
schRelative?: boolean | undefined;
|
|
1857
|
+
direction?: "up" | "down" | "left" | "right" | undefined;
|
|
1754
1858
|
connectsTo?: string | string[] | undefined;
|
|
1755
|
-
}, {
|
|
1756
|
-
layer?: string | undefined;
|
|
1757
|
-
layers?: string[] | undefined;
|
|
1758
|
-
name?: string | undefined;
|
|
1759
1859
|
pinNumber?: number | undefined;
|
|
1760
1860
|
schStemLength?: number | undefined;
|
|
1761
1861
|
aliases?: string[] | undefined;
|
|
1862
|
+
kicadPinMetadata?: {
|
|
1863
|
+
electricalType?: "input" | "output" | "bidirectional" | "tri_state" | "passive" | "free" | "unspecified" | "power_in" | "power_out" | "open_collector" | "open_emitter" | "no_connect" | undefined;
|
|
1864
|
+
graphicStyle?: "line" | "inverted" | "clock" | "inverted_clock" | "input_low" | "clock_low" | "output_low" | "falling_edge_clock" | "nonlogic" | undefined;
|
|
1865
|
+
pinLength?: number | undefined;
|
|
1866
|
+
nameTextSize?: number | undefined;
|
|
1867
|
+
numberTextSize?: number | undefined;
|
|
1868
|
+
} | undefined;
|
|
1869
|
+
hasInversionCircle?: boolean | undefined;
|
|
1870
|
+
}, {
|
|
1871
|
+
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
1872
|
+
layer?: string | undefined;
|
|
1873
|
+
name?: string | undefined;
|
|
1874
|
+
layers?: string[] | undefined;
|
|
1875
|
+
pcbX?: string | number | undefined;
|
|
1876
|
+
pcbY?: string | number | undefined;
|
|
1877
|
+
pcbLeftEdgeX?: string | number | undefined;
|
|
1878
|
+
pcbRightEdgeX?: string | number | undefined;
|
|
1879
|
+
pcbTopEdgeY?: string | number | undefined;
|
|
1880
|
+
pcbBottomEdgeY?: string | number | undefined;
|
|
1881
|
+
pcbOffsetX?: string | number | undefined;
|
|
1882
|
+
pcbOffsetY?: string | number | undefined;
|
|
1883
|
+
pcbRotation?: string | number | undefined;
|
|
1884
|
+
pcbPositionAnchor?: string | undefined;
|
|
1885
|
+
pcbPositionMode?: "relative_to_group_anchor" | "auto" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
1886
|
+
shouldBeOnEdgeOfBoard?: boolean | undefined;
|
|
1887
|
+
pcbMarginTop?: string | number | undefined;
|
|
1888
|
+
pcbMarginRight?: string | number | undefined;
|
|
1889
|
+
pcbMarginBottom?: string | number | undefined;
|
|
1890
|
+
pcbMarginLeft?: string | number | undefined;
|
|
1891
|
+
pcbMarginX?: string | number | undefined;
|
|
1892
|
+
pcbMarginY?: string | number | undefined;
|
|
1893
|
+
pcbStyle?: {
|
|
1894
|
+
silkscreenFontSize?: string | number | undefined;
|
|
1895
|
+
viaPadDiameter?: string | number | undefined;
|
|
1896
|
+
viaHoleDiameter?: string | number | undefined;
|
|
1897
|
+
silkscreenTextPosition?: "centered" | "outside" | "none" | {
|
|
1898
|
+
offsetX: number;
|
|
1899
|
+
offsetY: number;
|
|
1900
|
+
} | undefined;
|
|
1901
|
+
silkscreenTextVisibility?: "hidden" | "visible" | "inherit" | undefined;
|
|
1902
|
+
} | undefined;
|
|
1903
|
+
pcbSx?: _tscircuit_props.PcbSx | undefined;
|
|
1904
|
+
pcbRelative?: boolean | undefined;
|
|
1905
|
+
relative?: boolean | undefined;
|
|
1906
|
+
schMarginTop?: string | number | undefined;
|
|
1907
|
+
schMarginRight?: string | number | undefined;
|
|
1908
|
+
schMarginBottom?: string | number | undefined;
|
|
1909
|
+
schMarginLeft?: string | number | undefined;
|
|
1910
|
+
schMarginX?: string | number | undefined;
|
|
1911
|
+
schMarginY?: string | number | undefined;
|
|
1762
1912
|
schX?: number | undefined;
|
|
1763
1913
|
schY?: number | undefined;
|
|
1764
|
-
|
|
1914
|
+
schRotation?: string | number | undefined;
|
|
1915
|
+
footprint?: _tscircuit_props.FootprintProp | undefined;
|
|
1916
|
+
schStyle?: {
|
|
1917
|
+
defaultPassiveSize?: string | number | undefined;
|
|
1918
|
+
defaultCapacitorOrientation?: "none" | "vertical" | undefined;
|
|
1919
|
+
} | undefined;
|
|
1920
|
+
schRelative?: boolean | undefined;
|
|
1921
|
+
direction?: "up" | "down" | "left" | "right" | undefined;
|
|
1765
1922
|
connectsTo?: string | string[] | undefined;
|
|
1923
|
+
pinNumber?: number | undefined;
|
|
1924
|
+
schStemLength?: number | undefined;
|
|
1925
|
+
aliases?: string[] | undefined;
|
|
1926
|
+
kicadPinMetadata?: {
|
|
1927
|
+
electricalType?: "input" | "output" | "bidirectional" | "tri_state" | "passive" | "free" | "unspecified" | "power_in" | "power_out" | "open_collector" | "open_emitter" | "no_connect" | undefined;
|
|
1928
|
+
graphicStyle?: "line" | "inverted" | "clock" | "inverted_clock" | "input_low" | "clock_low" | "output_low" | "falling_edge_clock" | "nonlogic" | undefined;
|
|
1929
|
+
pinLength?: string | number | undefined;
|
|
1930
|
+
nameTextSize?: string | number | undefined;
|
|
1931
|
+
numberTextSize?: string | number | undefined;
|
|
1932
|
+
} | undefined;
|
|
1933
|
+
hasInversionCircle?: boolean | undefined;
|
|
1766
1934
|
}>;
|
|
1767
1935
|
};
|
|
1768
1936
|
constructor(props: z.input<typeof portProps>, opts?: {
|
|
@@ -2102,6 +2270,8 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
|
|
|
2102
2270
|
componentName: string;
|
|
2103
2271
|
};
|
|
2104
2272
|
initPorts(opts?: Parameters<NormalComponent["initPorts"]>[0]): void;
|
|
2273
|
+
_getSchematicPortArrangementFromPortDirections(): SchematicPortArrangement | null;
|
|
2274
|
+
_getSchematicPortArrangement(): SchematicPortArrangement | null;
|
|
2105
2275
|
private _ensureSchematicBoxPortsFromConnections;
|
|
2106
2276
|
doInitialInitializePortsFromChildren(): void;
|
|
2107
2277
|
updateInitializePortsFromChildren(): void;
|
|
@@ -152458,6 +152628,8 @@ declare const getSimpleRouteJsonFromCircuitJson: ({ db, circuitJson, subcircuit_
|
|
|
152458
152628
|
connMap: ConnectivityMap;
|
|
152459
152629
|
};
|
|
152460
152630
|
|
|
152631
|
+
declare const unrouteCircuitJson: (circuitJson: CircuitJson) => CircuitJson;
|
|
152632
|
+
|
|
152461
152633
|
type RenderEvent = {
|
|
152462
152634
|
type: string;
|
|
152463
152635
|
renderId: string;
|
|
@@ -152714,4 +152886,4 @@ declare module "react/jsx-runtime" {
|
|
|
152714
152886
|
}
|
|
152715
152887
|
}
|
|
152716
152888
|
|
|
152717
|
-
export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, AutoroutingPhase, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Connector, Constraint, CopperPour, CopperText, CourtyardCircle, CourtyardOutline, CourtyardRect, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IIsolatedCircuit, type IRenderable, type IRootCircuit, Inductor, Interconnect, IsolatedCircuit, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, MountedBoard, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicPath, SchematicRect, SchematicRow, SchematicSection, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, Subcircuit, Subpanel, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, renderPhaseIndexMap, resolveStaticFileImport, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
|
152889
|
+
export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, AutoroutingPhase, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Connector, Constraint, CopperPour, CopperText, CourtyardCircle, CourtyardOutline, CourtyardRect, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IIsolatedCircuit, type IRenderable, type IRootCircuit, Inductor, Interconnect, IsolatedCircuit, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, MountedBoard, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicPath, SchematicRect, SchematicRow, SchematicSection, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, Subcircuit, Subpanel, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, renderPhaseIndexMap, resolveStaticFileImport, sel, unrouteCircuitJson, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -8794,7 +8794,7 @@ var SCHEMATIC_COMPONENT_OUTLINE_STROKE_WIDTH = 0.12;
|
|
|
8794
8794
|
// lib/components/primitive-components/Port/Port.ts
|
|
8795
8795
|
import "schematic-symbols";
|
|
8796
8796
|
import { applyToPoint as applyToPoint16, compose as compose4, translate as translate3 } from "transformation-matrix";
|
|
8797
|
-
import
|
|
8797
|
+
import "zod";
|
|
8798
8798
|
|
|
8799
8799
|
// lib/components/primitive-components/Port/getCenterOfPcbPrimitives.ts
|
|
8800
8800
|
var getCenterOfPcbPrimitives = (pcbPrimitives) => {
|
|
@@ -8810,6 +8810,9 @@ var getCenterOfPcbPrimitives = (pcbPrimitives) => {
|
|
|
8810
8810
|
};
|
|
8811
8811
|
};
|
|
8812
8812
|
|
|
8813
|
+
// lib/components/primitive-components/Port/Port.ts
|
|
8814
|
+
import { portProps } from "@tscircuit/props";
|
|
8815
|
+
|
|
8813
8816
|
// lib/components/primitive-components/Port/apply-pin-attributes-to-source-port.ts
|
|
8814
8817
|
var applyPinAttributesToSourcePort = (sourcePortProps, attributes) => {
|
|
8815
8818
|
if (attributes.mustBeConnected !== void 0) {
|
|
@@ -8878,18 +8881,6 @@ var applyPinAttributesToSourcePort = (sourcePortProps, attributes) => {
|
|
|
8878
8881
|
};
|
|
8879
8882
|
|
|
8880
8883
|
// lib/components/primitive-components/Port/Port.ts
|
|
8881
|
-
var portProps = z6.object({
|
|
8882
|
-
name: z6.string().optional(),
|
|
8883
|
-
pinNumber: z6.number().optional(),
|
|
8884
|
-
schStemLength: z6.number().optional(),
|
|
8885
|
-
aliases: z6.array(z6.string()).optional(),
|
|
8886
|
-
layer: z6.string().optional(),
|
|
8887
|
-
layers: z6.array(z6.string()).optional(),
|
|
8888
|
-
schX: z6.number().optional(),
|
|
8889
|
-
schY: z6.number().optional(),
|
|
8890
|
-
direction: z6.enum(["up", "down", "left", "right"]).optional(),
|
|
8891
|
-
connectsTo: z6.union([z6.string(), z6.array(z6.string())]).optional()
|
|
8892
|
-
});
|
|
8893
8884
|
var Port = class extends PrimitiveComponent2 {
|
|
8894
8885
|
source_port_id = null;
|
|
8895
8886
|
pcb_port_id = null;
|
|
@@ -14299,7 +14290,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
14299
14290
|
min_via_hole_diameter: board?.min_via_hole_diameter,
|
|
14300
14291
|
min_via_pad_diameter: board?.min_via_pad_diameter,
|
|
14301
14292
|
minTraceToPadEdgeClearance: minTraceToPadEdgeClearance ?? board?.min_trace_to_pad_edge_clearance,
|
|
14302
|
-
minViaEdgeToPadEdgeClearance: minViaEdgeToPadEdgeClearance ?? board?.
|
|
14293
|
+
minViaEdgeToPadEdgeClearance: minViaEdgeToPadEdgeClearance ?? board?.min_via_edge_to_pad_edge_clearance,
|
|
14303
14294
|
nominalTraceWidth,
|
|
14304
14295
|
outline: board?.outline?.map((point6) => ({ ...point6 }))
|
|
14305
14296
|
},
|
|
@@ -14307,6 +14298,17 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
14307
14298
|
};
|
|
14308
14299
|
};
|
|
14309
14300
|
|
|
14301
|
+
// lib/utils/autorouting/unrouteCircuitJson.ts
|
|
14302
|
+
var unroutedElementTypes = /* @__PURE__ */ new Set([
|
|
14303
|
+
"pcb_trace",
|
|
14304
|
+
"pcb_trace_error"
|
|
14305
|
+
]);
|
|
14306
|
+
var unrouteCircuitJson = (circuitJson) => {
|
|
14307
|
+
return circuitJson.filter(
|
|
14308
|
+
(element) => !unroutedElementTypes.has(element.type)
|
|
14309
|
+
);
|
|
14310
|
+
};
|
|
14311
|
+
|
|
14310
14312
|
// lib/utils/render-events/getPhaseTimingsFromRenderEvents.ts
|
|
14311
14313
|
var getPhaseTimingsFromRenderEvents = (renderEvents) => {
|
|
14312
14314
|
const phaseTimings = {};
|
|
@@ -18781,6 +18783,56 @@ var Group6 = class extends NormalComponent3 {
|
|
|
18781
18783
|
if (hasUnresolvedNamedPins) return;
|
|
18782
18784
|
super.initPorts(opts);
|
|
18783
18785
|
}
|
|
18786
|
+
_getSchematicPortArrangementFromPortDirections() {
|
|
18787
|
+
if (!this._parsedProps?.showAsSchematicBox) return null;
|
|
18788
|
+
const sidePins = {
|
|
18789
|
+
leftSide: [],
|
|
18790
|
+
rightSide: [],
|
|
18791
|
+
topSide: [],
|
|
18792
|
+
bottomSide: []
|
|
18793
|
+
};
|
|
18794
|
+
for (const port of this.children) {
|
|
18795
|
+
if (port.componentName !== "Port") continue;
|
|
18796
|
+
const direction = port._parsedProps.direction;
|
|
18797
|
+
if (!direction) continue;
|
|
18798
|
+
const pin = port._parsedProps.pinNumber ?? port._parsedProps.name ?? void 0;
|
|
18799
|
+
if (pin === void 0) continue;
|
|
18800
|
+
const side = direction === "left" ? "leftSide" : direction === "right" ? "rightSide" : direction === "up" ? "topSide" : "bottomSide";
|
|
18801
|
+
sidePins[side].push(pin);
|
|
18802
|
+
}
|
|
18803
|
+
if (sidePins.leftSide.length === 0 && sidePins.rightSide.length === 0 && sidePins.topSide.length === 0 && sidePins.bottomSide.length === 0) {
|
|
18804
|
+
return null;
|
|
18805
|
+
}
|
|
18806
|
+
const arrangement = {};
|
|
18807
|
+
if (sidePins.leftSide.length > 0) {
|
|
18808
|
+
arrangement.leftSide = {
|
|
18809
|
+
pins: sidePins.leftSide,
|
|
18810
|
+
direction: "top-to-bottom"
|
|
18811
|
+
};
|
|
18812
|
+
}
|
|
18813
|
+
if (sidePins.rightSide.length > 0) {
|
|
18814
|
+
arrangement.rightSide = {
|
|
18815
|
+
pins: sidePins.rightSide,
|
|
18816
|
+
direction: "top-to-bottom"
|
|
18817
|
+
};
|
|
18818
|
+
}
|
|
18819
|
+
if (sidePins.topSide.length > 0) {
|
|
18820
|
+
arrangement.topSide = {
|
|
18821
|
+
pins: sidePins.topSide,
|
|
18822
|
+
direction: "left-to-right"
|
|
18823
|
+
};
|
|
18824
|
+
}
|
|
18825
|
+
if (sidePins.bottomSide.length > 0) {
|
|
18826
|
+
arrangement.bottomSide = {
|
|
18827
|
+
pins: sidePins.bottomSide,
|
|
18828
|
+
direction: "left-to-right"
|
|
18829
|
+
};
|
|
18830
|
+
}
|
|
18831
|
+
return arrangement;
|
|
18832
|
+
}
|
|
18833
|
+
_getSchematicPortArrangement() {
|
|
18834
|
+
return super._getSchematicPortArrangement() ?? this._getSchematicPortArrangementFromPortDirections();
|
|
18835
|
+
}
|
|
18784
18836
|
_ensureSchematicBoxPortsFromConnections() {
|
|
18785
18837
|
if (!this._parsedProps?.showAsSchematicBox) return;
|
|
18786
18838
|
if (!this._parsedProps?.connections) return;
|
|
@@ -20502,7 +20554,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
20502
20554
|
var package_default = {
|
|
20503
20555
|
name: "@tscircuit/core",
|
|
20504
20556
|
type: "module",
|
|
20505
|
-
version: "0.0.
|
|
20557
|
+
version: "0.0.1224",
|
|
20506
20558
|
types: "dist/index.d.ts",
|
|
20507
20559
|
main: "dist/index.js",
|
|
20508
20560
|
module: "dist/index.js",
|
|
@@ -20548,7 +20600,7 @@ var package_default = {
|
|
|
20548
20600
|
"@tscircuit/math-utils": "^0.0.36",
|
|
20549
20601
|
"@tscircuit/miniflex": "^0.0.4",
|
|
20550
20602
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
20551
|
-
"@tscircuit/props": "^0.0.
|
|
20603
|
+
"@tscircuit/props": "^0.0.524",
|
|
20552
20604
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
20553
20605
|
"@tscircuit/schematic-trace-solver": "^0.0.55",
|
|
20554
20606
|
"@tscircuit/solver-utils": "^0.0.3",
|
|
@@ -27102,6 +27154,7 @@ export {
|
|
|
27102
27154
|
renderPhaseIndexMap,
|
|
27103
27155
|
resolveStaticFileImport,
|
|
27104
27156
|
sel,
|
|
27157
|
+
unrouteCircuitJson,
|
|
27105
27158
|
useCapacitor,
|
|
27106
27159
|
useChip,
|
|
27107
27160
|
useDiode,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.1225",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@tscircuit/math-utils": "^0.0.36",
|
|
48
48
|
"@tscircuit/miniflex": "^0.0.4",
|
|
49
49
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
50
|
-
"@tscircuit/props": "^0.0.
|
|
50
|
+
"@tscircuit/props": "^0.0.524",
|
|
51
51
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
52
52
|
"@tscircuit/schematic-trace-solver": "^0.0.55",
|
|
53
53
|
"@tscircuit/solver-utils": "^0.0.3",
|