@tscircuit/props 0.0.55 → 0.0.57
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 +234 -88
- package/dist/index.js +99 -74
- package/dist/index.js.map +1 -1
- package/lib/common/layout.ts +15 -6
- package/lib/components/constraint.ts +41 -3
- package/lib/components/smtpad.ts +54 -0
- package/lib/index.ts +1 -15
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -59,6 +59,22 @@ type FootprintSoupElements = {
|
|
|
59
59
|
type Footprint = string | ReactElement | FootprintSoupElements[];
|
|
60
60
|
declare const footprintProp: z.ZodType<Footprint, z.ZodTypeDef, Footprint>;
|
|
61
61
|
|
|
62
|
+
interface PcbLayoutProps {
|
|
63
|
+
pcbX: string | number;
|
|
64
|
+
pcbY: string | number;
|
|
65
|
+
pcbRotation?: string | number;
|
|
66
|
+
layer?: LayerRefInput;
|
|
67
|
+
}
|
|
68
|
+
interface CommonLayoutProps {
|
|
69
|
+
pcbX?: string | number;
|
|
70
|
+
pcbY?: string | number;
|
|
71
|
+
pcbRotation?: string | number;
|
|
72
|
+
schX?: string | number;
|
|
73
|
+
schY?: string | number;
|
|
74
|
+
schRotation?: string | number;
|
|
75
|
+
layer?: LayerRefInput;
|
|
76
|
+
footprint?: Footprint;
|
|
77
|
+
}
|
|
62
78
|
declare const pcbLayoutProps: z.ZodObject<{
|
|
63
79
|
pcbX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
64
80
|
pcbY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
@@ -85,16 +101,6 @@ declare const pcbLayoutProps: z.ZodObject<{
|
|
|
85
101
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
86
102
|
} | undefined;
|
|
87
103
|
}>;
|
|
88
|
-
interface CommonLayoutProps {
|
|
89
|
-
pcbX?: string | number;
|
|
90
|
-
pcbY?: string | number;
|
|
91
|
-
pcbRotation?: string | number;
|
|
92
|
-
schX?: string | number;
|
|
93
|
-
schY?: string | number;
|
|
94
|
-
schRotation?: string | number;
|
|
95
|
-
layer?: LayerRefInput;
|
|
96
|
-
footprint?: Footprint;
|
|
97
|
-
}
|
|
98
104
|
declare const commonLayoutProps: z.ZodObject<{
|
|
99
105
|
pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
100
106
|
pcbY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
@@ -3663,48 +3669,259 @@ type InferredConstrainedLayoutProps = z.input<typeof constrainedLayoutProps>;
|
|
|
3663
3669
|
|
|
3664
3670
|
type PcbXDistConstraint = {
|
|
3665
3671
|
pcb?: true;
|
|
3672
|
+
type?: "xdist";
|
|
3666
3673
|
xdist: Distance;
|
|
3667
3674
|
left: string;
|
|
3668
3675
|
right: string;
|
|
3676
|
+
edgeToEdge?: true;
|
|
3677
|
+
centerToCenter?: true;
|
|
3678
|
+
fromLeftEdge?: true;
|
|
3679
|
+
fromLeftCenter?: true;
|
|
3680
|
+
toRightEdge?: true;
|
|
3681
|
+
toRightCenter?: true;
|
|
3669
3682
|
};
|
|
3670
3683
|
type PcbYDistConstraint = {
|
|
3671
3684
|
pcb?: true;
|
|
3685
|
+
type?: "ydist";
|
|
3672
3686
|
ydist: Distance;
|
|
3673
3687
|
top: string;
|
|
3674
3688
|
bottom: string;
|
|
3689
|
+
edgeToEdge?: true;
|
|
3690
|
+
centerToCenter?: true;
|
|
3691
|
+
fromTopEdge?: true;
|
|
3692
|
+
fromTopCenter?: true;
|
|
3693
|
+
toBottomEdge?: true;
|
|
3694
|
+
toBottomCenter?: true;
|
|
3675
3695
|
};
|
|
3676
3696
|
type ConstraintProps = PcbXDistConstraint | PcbYDistConstraint;
|
|
3677
3697
|
declare const constraintProps: z.ZodUnion<[z.ZodObject<{
|
|
3678
|
-
pcb: z.ZodLiteral<true
|
|
3698
|
+
pcb: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3699
|
+
type: z.ZodOptional<z.ZodLiteral<"xdist">>;
|
|
3679
3700
|
xdist: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3680
3701
|
left: z.ZodString;
|
|
3681
3702
|
right: z.ZodString;
|
|
3703
|
+
edgeToEdge: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3704
|
+
centerToCenter: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3705
|
+
fromLeftEdge: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3706
|
+
fromLeftCenter: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3707
|
+
toRightEdge: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3708
|
+
toRightCenter: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3682
3709
|
}, "strip", z.ZodTypeAny, {
|
|
3683
3710
|
left: string;
|
|
3684
3711
|
right: string;
|
|
3685
|
-
pcb: true;
|
|
3686
3712
|
xdist: number;
|
|
3713
|
+
type?: "xdist" | undefined;
|
|
3714
|
+
pcb?: true | undefined;
|
|
3715
|
+
edgeToEdge?: true | undefined;
|
|
3716
|
+
centerToCenter?: true | undefined;
|
|
3717
|
+
fromLeftEdge?: true | undefined;
|
|
3718
|
+
fromLeftCenter?: true | undefined;
|
|
3719
|
+
toRightEdge?: true | undefined;
|
|
3720
|
+
toRightCenter?: true | undefined;
|
|
3687
3721
|
}, {
|
|
3688
3722
|
left: string;
|
|
3689
3723
|
right: string;
|
|
3690
|
-
pcb: true;
|
|
3691
3724
|
xdist: string | number;
|
|
3725
|
+
type?: "xdist" | undefined;
|
|
3726
|
+
pcb?: true | undefined;
|
|
3727
|
+
edgeToEdge?: true | undefined;
|
|
3728
|
+
centerToCenter?: true | undefined;
|
|
3729
|
+
fromLeftEdge?: true | undefined;
|
|
3730
|
+
fromLeftCenter?: true | undefined;
|
|
3731
|
+
toRightEdge?: true | undefined;
|
|
3732
|
+
toRightCenter?: true | undefined;
|
|
3692
3733
|
}>, z.ZodObject<{
|
|
3693
|
-
pcb: z.ZodLiteral<true
|
|
3734
|
+
pcb: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3735
|
+
type: z.ZodOptional<z.ZodLiteral<"ydist">>;
|
|
3694
3736
|
ydist: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3695
3737
|
top: z.ZodString;
|
|
3696
3738
|
bottom: z.ZodString;
|
|
3739
|
+
edgeToEdge: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3740
|
+
centerToCenter: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3741
|
+
fromTopEdge: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3742
|
+
fromTopCenter: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3743
|
+
toBottomEdge: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3744
|
+
toBottomCenter: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3697
3745
|
}, "strip", z.ZodTypeAny, {
|
|
3698
3746
|
top: string;
|
|
3699
3747
|
bottom: string;
|
|
3700
|
-
pcb: true;
|
|
3701
3748
|
ydist: number;
|
|
3749
|
+
type?: "ydist" | undefined;
|
|
3750
|
+
pcb?: true | undefined;
|
|
3751
|
+
edgeToEdge?: true | undefined;
|
|
3752
|
+
centerToCenter?: true | undefined;
|
|
3753
|
+
fromTopEdge?: true | undefined;
|
|
3754
|
+
fromTopCenter?: true | undefined;
|
|
3755
|
+
toBottomEdge?: true | undefined;
|
|
3756
|
+
toBottomCenter?: true | undefined;
|
|
3702
3757
|
}, {
|
|
3703
3758
|
top: string;
|
|
3704
3759
|
bottom: string;
|
|
3705
|
-
pcb: true;
|
|
3706
3760
|
ydist: string | number;
|
|
3761
|
+
type?: "ydist" | undefined;
|
|
3762
|
+
pcb?: true | undefined;
|
|
3763
|
+
edgeToEdge?: true | undefined;
|
|
3764
|
+
centerToCenter?: true | undefined;
|
|
3765
|
+
fromTopEdge?: true | undefined;
|
|
3766
|
+
fromTopCenter?: true | undefined;
|
|
3767
|
+
toBottomEdge?: true | undefined;
|
|
3768
|
+
toBottomCenter?: true | undefined;
|
|
3769
|
+
}>]>;
|
|
3770
|
+
|
|
3771
|
+
interface RectSmtPadProps extends Omit<PcbLayoutProps, "pcbRotation"> {
|
|
3772
|
+
shape: "rect";
|
|
3773
|
+
width: Distance;
|
|
3774
|
+
height: Distance;
|
|
3775
|
+
portHints?: PortHints;
|
|
3776
|
+
}
|
|
3777
|
+
interface CircleSmtPadProps extends Omit<PcbLayoutProps, "pcbRotation"> {
|
|
3778
|
+
shape: "circle";
|
|
3779
|
+
radius: Distance;
|
|
3780
|
+
portHints?: PortHints;
|
|
3781
|
+
}
|
|
3782
|
+
type SmtPadProps = RectSmtPadProps | CircleSmtPadProps;
|
|
3783
|
+
declare const rectSmtPadProps: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
3784
|
+
pcbX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3785
|
+
pcbY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3786
|
+
pcbRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
3787
|
+
layer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
|
|
3788
|
+
name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
3789
|
+
}, "strip", z.ZodTypeAny, {
|
|
3790
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3791
|
+
}, {
|
|
3792
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3793
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
3794
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3795
|
+
}>>;
|
|
3796
|
+
}, "pcbRotation">, {
|
|
3797
|
+
shape: z.ZodLiteral<"rect">;
|
|
3798
|
+
width: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3799
|
+
height: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3800
|
+
portHints: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
3801
|
+
}>, "strip", z.ZodTypeAny, {
|
|
3802
|
+
pcbX: number;
|
|
3803
|
+
pcbY: number;
|
|
3804
|
+
shape: "rect";
|
|
3805
|
+
width: number;
|
|
3806
|
+
height: number;
|
|
3807
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
3808
|
+
portHints?: (string | number)[] | undefined;
|
|
3809
|
+
}, {
|
|
3810
|
+
pcbX: string | number;
|
|
3811
|
+
pcbY: string | number;
|
|
3812
|
+
shape: "rect";
|
|
3813
|
+
width: string | number;
|
|
3814
|
+
height: string | number;
|
|
3815
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
3816
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3817
|
+
} | undefined;
|
|
3818
|
+
portHints?: (string | number)[] | undefined;
|
|
3819
|
+
}>;
|
|
3820
|
+
declare const circleSmtPadProps: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
3821
|
+
pcbX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3822
|
+
pcbY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3823
|
+
pcbRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
3824
|
+
layer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
|
|
3825
|
+
name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
3826
|
+
}, "strip", z.ZodTypeAny, {
|
|
3827
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3828
|
+
}, {
|
|
3829
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3830
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
3831
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3832
|
+
}>>;
|
|
3833
|
+
}, "pcbRotation">, {
|
|
3834
|
+
shape: z.ZodLiteral<"circle">;
|
|
3835
|
+
radius: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3836
|
+
portHints: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
3837
|
+
}>, "strip", z.ZodTypeAny, {
|
|
3838
|
+
pcbX: number;
|
|
3839
|
+
pcbY: number;
|
|
3840
|
+
shape: "circle";
|
|
3841
|
+
radius: number;
|
|
3842
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
3843
|
+
portHints?: (string | number)[] | undefined;
|
|
3844
|
+
}, {
|
|
3845
|
+
pcbX: string | number;
|
|
3846
|
+
pcbY: string | number;
|
|
3847
|
+
shape: "circle";
|
|
3848
|
+
radius: string | number;
|
|
3849
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
3850
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3851
|
+
} | undefined;
|
|
3852
|
+
portHints?: (string | number)[] | undefined;
|
|
3853
|
+
}>;
|
|
3854
|
+
declare const smtPadProps: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
3855
|
+
pcbX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3856
|
+
pcbY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3857
|
+
pcbRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
3858
|
+
layer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
|
|
3859
|
+
name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
3860
|
+
}, "strip", z.ZodTypeAny, {
|
|
3861
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3862
|
+
}, {
|
|
3863
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3864
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
3865
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3866
|
+
}>>;
|
|
3867
|
+
}, "pcbRotation">, {
|
|
3868
|
+
shape: z.ZodLiteral<"circle">;
|
|
3869
|
+
radius: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3870
|
+
portHints: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
3871
|
+
}>, "strip", z.ZodTypeAny, {
|
|
3872
|
+
pcbX: number;
|
|
3873
|
+
pcbY: number;
|
|
3874
|
+
shape: "circle";
|
|
3875
|
+
radius: number;
|
|
3876
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
3877
|
+
portHints?: (string | number)[] | undefined;
|
|
3878
|
+
}, {
|
|
3879
|
+
pcbX: string | number;
|
|
3880
|
+
pcbY: string | number;
|
|
3881
|
+
shape: "circle";
|
|
3882
|
+
radius: string | number;
|
|
3883
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
3884
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3885
|
+
} | undefined;
|
|
3886
|
+
portHints?: (string | number)[] | undefined;
|
|
3887
|
+
}>, z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
3888
|
+
pcbX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3889
|
+
pcbY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3890
|
+
pcbRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
3891
|
+
layer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
|
|
3892
|
+
name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
3893
|
+
}, "strip", z.ZodTypeAny, {
|
|
3894
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3895
|
+
}, {
|
|
3896
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3897
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
3898
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3899
|
+
}>>;
|
|
3900
|
+
}, "pcbRotation">, {
|
|
3901
|
+
shape: z.ZodLiteral<"rect">;
|
|
3902
|
+
width: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3903
|
+
height: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
3904
|
+
portHints: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
3905
|
+
}>, "strip", z.ZodTypeAny, {
|
|
3906
|
+
pcbX: number;
|
|
3907
|
+
pcbY: number;
|
|
3908
|
+
shape: "rect";
|
|
3909
|
+
width: number;
|
|
3910
|
+
height: number;
|
|
3911
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
3912
|
+
portHints?: (string | number)[] | undefined;
|
|
3913
|
+
}, {
|
|
3914
|
+
pcbX: string | number;
|
|
3915
|
+
pcbY: string | number;
|
|
3916
|
+
shape: "rect";
|
|
3917
|
+
width: string | number;
|
|
3918
|
+
height: string | number;
|
|
3919
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
3920
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3921
|
+
} | undefined;
|
|
3922
|
+
portHints?: (string | number)[] | undefined;
|
|
3707
3923
|
}>]>;
|
|
3924
|
+
type InferredSmtPadProps = z.input<typeof smtPadProps>;
|
|
3708
3925
|
|
|
3709
3926
|
declare const inductorProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
3710
3927
|
pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
@@ -5585,77 +5802,6 @@ declare const traceProps: z.ZodUnion<[z.ZodObject<{
|
|
|
5585
5802
|
}[] | undefined;
|
|
5586
5803
|
}>]>;
|
|
5587
5804
|
type TraceProps = z.input<typeof traceProps>;
|
|
5588
|
-
declare const smtPadProps: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
5589
|
-
pcbX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
5590
|
-
pcbY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
5591
|
-
pcbRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5592
|
-
layer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
|
|
5593
|
-
name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
5594
|
-
}, "strip", z.ZodTypeAny, {
|
|
5595
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5596
|
-
}, {
|
|
5597
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5598
|
-
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
5599
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5600
|
-
}>>;
|
|
5601
|
-
}, "pcbRotation">, {
|
|
5602
|
-
shape: z.ZodLiteral<"circle">;
|
|
5603
|
-
radius: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5604
|
-
portHints: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
5605
|
-
}>, "strip", z.ZodTypeAny, {
|
|
5606
|
-
pcbX: number;
|
|
5607
|
-
pcbY: number;
|
|
5608
|
-
shape: "circle";
|
|
5609
|
-
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
5610
|
-
radius?: number | undefined;
|
|
5611
|
-
portHints?: (string | number)[] | undefined;
|
|
5612
|
-
}, {
|
|
5613
|
-
pcbX: string | number;
|
|
5614
|
-
pcbY: string | number;
|
|
5615
|
-
shape: "circle";
|
|
5616
|
-
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
5617
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5618
|
-
} | undefined;
|
|
5619
|
-
radius?: string | number | undefined;
|
|
5620
|
-
portHints?: (string | number)[] | undefined;
|
|
5621
|
-
}>, z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
5622
|
-
pcbX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
5623
|
-
pcbY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
5624
|
-
pcbRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5625
|
-
layer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
|
|
5626
|
-
name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
5627
|
-
}, "strip", z.ZodTypeAny, {
|
|
5628
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5629
|
-
}, {
|
|
5630
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5631
|
-
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
5632
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5633
|
-
}>>;
|
|
5634
|
-
}, "pcbRotation">, {
|
|
5635
|
-
shape: z.ZodLiteral<"rect">;
|
|
5636
|
-
width: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5637
|
-
height: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5638
|
-
portHints: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
5639
|
-
}>, "strip", z.ZodTypeAny, {
|
|
5640
|
-
pcbX: number;
|
|
5641
|
-
pcbY: number;
|
|
5642
|
-
shape: "rect";
|
|
5643
|
-
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
5644
|
-
portHints?: (string | number)[] | undefined;
|
|
5645
|
-
width?: number | undefined;
|
|
5646
|
-
height?: number | undefined;
|
|
5647
|
-
}, {
|
|
5648
|
-
pcbX: string | number;
|
|
5649
|
-
pcbY: string | number;
|
|
5650
|
-
shape: "rect";
|
|
5651
|
-
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
5652
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5653
|
-
} | undefined;
|
|
5654
|
-
portHints?: (string | number)[] | undefined;
|
|
5655
|
-
width?: string | number | undefined;
|
|
5656
|
-
height?: string | number | undefined;
|
|
5657
|
-
}>]>;
|
|
5658
|
-
type SmtPadProps = z.input<typeof smtPadProps>;
|
|
5659
5805
|
declare const platedHoleProps: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
5660
5806
|
pcbX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
5661
5807
|
pcbY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
@@ -7338,4 +7484,4 @@ declare const fabricationNotePathProps: z.ZodObject<z.objectUtil.extendShape<Omi
|
|
|
7338
7484
|
}>;
|
|
7339
7485
|
type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>;
|
|
7340
7486
|
|
|
7341
|
-
export { type BaseGroupProps, type BoardProps, type CapacitorProps, type ChipProps, type CommonComponentProps, type CommonLayoutProps, type ComponentProps, type ConstrainedLayoutProps, type ConstraintProps, type DiodeProps, type Direction, type DirectionAlongEdge, type FabricationNotePathProps, type FabricationNoteTextProps, type Footprint, type FootprintProps, type FootprintSoupElements, type GroupProps, type HoleProps, type InductorProps, type InferredChipProps, type InferredConstrainedLayoutProps, type JumperProps, type LedProps, type NetAliasProps, type NetProps, type PcbKeepoutProps, type PcbTraceProps, type PcbXDistConstraint, type PcbYDistConstraint, type PinSideDefinition, type PlatedHoleProps, type PortHints, type PortProps, type PowerSourceProps, type ResistorProps, type SchematicBoxProps, type SchematicLineProps, type SchematicPathProps, type SchematicPortArrangement, type SchematicPortArrangementWithPinCounts, type SchematicPortArrangementWithSides, type SchematicPortArrangementWithSizes, type SchematicTextProps, type SilkscreenCircleProps, type SilkscreenLineProps, type SilkscreenPathProps, type SilkscreenRectProps, type SilkscreenTextProps, type SmtPadProps, type SubcircuitGroupProps, type SupplierName, type SupplierProps, type SwitchProps, type TraceHintProps, type TraceProps, type ViaProps, baseGroupProps, boardProps, bugProps, capacitorPins, capacitorProps, chipProps, commonComponentProps, commonLayoutProps, componentProps, constrainedLayoutProps, constraintProps, diodePins, diodeProps, direction, directionAlongEdge, distanceOrMultiplier, explicitPinSideDefinition, fabricationNotePathProps, fabricationNoteTextProps, footprintProp, footprintProps, groupProps, holeProps, inductorPins, inductorProps, jumperProps, ledPins, ledProps, lrPins, lrPolarPins, netAliasProps, netProps, pcbKeepoutProps, pcbLayoutProps, pcbTraceProps, platedHoleProps, point3, portHints, portProps, portRef, powerSourceProps, resistorPins, resistorProps, routeHintPointProps, schematicBoxProps, schematicLineProps, schematicPathProps, schematicPortArrangement, schematicTextProps, silkscreenCircleProps, silkscreenLineProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, subcircuitGroupProps, supplierProps, switchProps, traceHintProps, traceProps, viaProps };
|
|
7487
|
+
export { type BaseGroupProps, type BoardProps, type CapacitorProps, type ChipProps, type CircleSmtPadProps, type CommonComponentProps, type CommonLayoutProps, type ComponentProps, type ConstrainedLayoutProps, type ConstraintProps, type DiodeProps, type Direction, type DirectionAlongEdge, type FabricationNotePathProps, type FabricationNoteTextProps, type Footprint, type FootprintProps, type FootprintSoupElements, type GroupProps, type HoleProps, type InductorProps, type InferredChipProps, type InferredConstrainedLayoutProps, type InferredSmtPadProps, type JumperProps, type LedProps, type NetAliasProps, type NetProps, type PcbKeepoutProps, type PcbLayoutProps, type PcbTraceProps, type PcbXDistConstraint, type PcbYDistConstraint, type PinSideDefinition, type PlatedHoleProps, type PortHints, type PortProps, type PowerSourceProps, type RectSmtPadProps, type ResistorProps, type SchematicBoxProps, type SchematicLineProps, type SchematicPathProps, type SchematicPortArrangement, type SchematicPortArrangementWithPinCounts, type SchematicPortArrangementWithSides, type SchematicPortArrangementWithSizes, type SchematicTextProps, type SilkscreenCircleProps, type SilkscreenLineProps, type SilkscreenPathProps, type SilkscreenRectProps, type SilkscreenTextProps, type SmtPadProps, type SubcircuitGroupProps, type SupplierName, type SupplierProps, type SwitchProps, type TraceHintProps, type TraceProps, type ViaProps, baseGroupProps, boardProps, bugProps, capacitorPins, capacitorProps, chipProps, circleSmtPadProps, commonComponentProps, commonLayoutProps, componentProps, constrainedLayoutProps, constraintProps, diodePins, diodeProps, direction, directionAlongEdge, distanceOrMultiplier, explicitPinSideDefinition, fabricationNotePathProps, fabricationNoteTextProps, footprintProp, footprintProps, groupProps, holeProps, inductorPins, inductorProps, jumperProps, ledPins, ledProps, lrPins, lrPolarPins, netAliasProps, netProps, pcbKeepoutProps, pcbLayoutProps, pcbTraceProps, platedHoleProps, point3, portHints, portProps, portRef, powerSourceProps, rectSmtPadProps, resistorPins, resistorProps, routeHintPointProps, schematicBoxProps, schematicLineProps, schematicPathProps, schematicPortArrangement, schematicTextProps, silkscreenCircleProps, silkscreenLineProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, subcircuitGroupProps, supplierProps, switchProps, traceHintProps, traceProps, viaProps };
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ __export(lib_exports, {
|
|
|
26
26
|
capacitorPins: () => capacitorPins,
|
|
27
27
|
capacitorProps: () => capacitorProps,
|
|
28
28
|
chipProps: () => chipProps,
|
|
29
|
+
circleSmtPadProps: () => circleSmtPadProps,
|
|
29
30
|
commonComponentProps: () => commonComponentProps,
|
|
30
31
|
commonLayoutProps: () => commonLayoutProps,
|
|
31
32
|
componentProps: () => componentProps,
|
|
@@ -61,6 +62,7 @@ __export(lib_exports, {
|
|
|
61
62
|
portProps: () => portProps,
|
|
62
63
|
portRef: () => portRef,
|
|
63
64
|
powerSourceProps: () => powerSourceProps,
|
|
65
|
+
rectSmtPadProps: () => rectSmtPadProps,
|
|
64
66
|
resistorPins: () => resistorPins,
|
|
65
67
|
resistorProps: () => resistorProps,
|
|
66
68
|
routeHintPointProps: () => routeHintPointProps,
|
|
@@ -84,7 +86,7 @@ __export(lib_exports, {
|
|
|
84
86
|
});
|
|
85
87
|
module.exports = __toCommonJS(lib_exports);
|
|
86
88
|
var import_soup11 = require("@tscircuit/soup");
|
|
87
|
-
var
|
|
89
|
+
var import_zod21 = require("zod");
|
|
88
90
|
|
|
89
91
|
// lib/typecheck.ts
|
|
90
92
|
var expectTypesMatch = (shouldBe) => {
|
|
@@ -162,6 +164,7 @@ var pcbLayoutProps = import_zod6.z.object({
|
|
|
162
164
|
pcbRotation: import_soup2.rotation.optional(),
|
|
163
165
|
layer: import_soup2.layer_ref.optional()
|
|
164
166
|
});
|
|
167
|
+
expectTypesMatch(true);
|
|
165
168
|
var commonLayoutProps = import_zod6.z.object({
|
|
166
169
|
pcbX: import_soup2.distance.optional(),
|
|
167
170
|
pcbY: import_soup2.distance.optional(),
|
|
@@ -366,18 +369,51 @@ var import_soup10 = require("@tscircuit/soup");
|
|
|
366
369
|
var import_zod19 = require("zod");
|
|
367
370
|
var constraintProps = import_zod19.z.union([
|
|
368
371
|
import_zod19.z.object({
|
|
369
|
-
pcb: import_zod19.z.literal(true),
|
|
372
|
+
pcb: import_zod19.z.literal(true).optional(),
|
|
373
|
+
type: import_zod19.z.literal("xdist").optional(),
|
|
370
374
|
xdist: import_soup10.distance,
|
|
371
375
|
left: import_zod19.z.string(),
|
|
372
|
-
right: import_zod19.z.string()
|
|
376
|
+
right: import_zod19.z.string(),
|
|
377
|
+
edgeToEdge: import_zod19.z.literal(true).optional(),
|
|
378
|
+
centerToCenter: import_zod19.z.literal(true).optional(),
|
|
379
|
+
fromLeftEdge: import_zod19.z.literal(true).optional(),
|
|
380
|
+
fromLeftCenter: import_zod19.z.literal(true).optional(),
|
|
381
|
+
toRightEdge: import_zod19.z.literal(true).optional(),
|
|
382
|
+
toRightCenter: import_zod19.z.literal(true).optional()
|
|
373
383
|
}),
|
|
374
384
|
import_zod19.z.object({
|
|
375
|
-
pcb: import_zod19.z.literal(true),
|
|
385
|
+
pcb: import_zod19.z.literal(true).optional(),
|
|
386
|
+
type: import_zod19.z.literal("ydist").optional(),
|
|
376
387
|
ydist: import_soup10.distance,
|
|
377
388
|
top: import_zod19.z.string(),
|
|
378
|
-
bottom: import_zod19.z.string()
|
|
389
|
+
bottom: import_zod19.z.string(),
|
|
390
|
+
edgeToEdge: import_zod19.z.literal(true).optional(),
|
|
391
|
+
centerToCenter: import_zod19.z.literal(true).optional(),
|
|
392
|
+
fromTopEdge: import_zod19.z.literal(true).optional(),
|
|
393
|
+
fromTopCenter: import_zod19.z.literal(true).optional(),
|
|
394
|
+
toBottomEdge: import_zod19.z.literal(true).optional(),
|
|
395
|
+
toBottomCenter: import_zod19.z.literal(true).optional()
|
|
379
396
|
})
|
|
380
397
|
]);
|
|
398
|
+
expectTypesMatch(true);
|
|
399
|
+
|
|
400
|
+
// lib/components/smtpad.ts
|
|
401
|
+
var import_zod20 = require("zod");
|
|
402
|
+
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
403
|
+
shape: import_zod20.z.literal("rect"),
|
|
404
|
+
width: import_soup10.distance,
|
|
405
|
+
height: import_soup10.distance,
|
|
406
|
+
portHints: portHints.optional()
|
|
407
|
+
});
|
|
408
|
+
expectTypesMatch(true);
|
|
409
|
+
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
410
|
+
shape: import_zod20.z.literal("circle"),
|
|
411
|
+
radius: import_soup10.distance,
|
|
412
|
+
portHints: portHints.optional()
|
|
413
|
+
});
|
|
414
|
+
expectTypesMatch(true);
|
|
415
|
+
var smtPadProps = import_zod20.z.union([circleSmtPadProps, rectSmtPadProps]);
|
|
416
|
+
expectTypesMatch(true);
|
|
381
417
|
|
|
382
418
|
// lib/index.ts
|
|
383
419
|
var inductorProps = commonComponentProps.extend({
|
|
@@ -387,15 +423,15 @@ var inductorPins = lrPins;
|
|
|
387
423
|
var diodeProps = commonComponentProps.extend({});
|
|
388
424
|
var diodePins = lrPolarPins;
|
|
389
425
|
var ledProps = commonComponentProps.extend({
|
|
390
|
-
color:
|
|
426
|
+
color: import_zod21.z.string().optional()
|
|
391
427
|
});
|
|
392
428
|
var ledPins = lrPolarPins;
|
|
393
429
|
var switchProps = commonComponentProps.extend({
|
|
394
|
-
ftype:
|
|
395
|
-
switchType:
|
|
396
|
-
isNormallyClosed:
|
|
430
|
+
ftype: import_zod21.z.literal("switch"),
|
|
431
|
+
switchType: import_zod21.z.enum(["spst"]).default("spst"),
|
|
432
|
+
isNormallyClosed: import_zod21.z.boolean().default(false)
|
|
397
433
|
});
|
|
398
|
-
var distanceOrMultiplier2 = import_soup11.distance.or(
|
|
434
|
+
var distanceOrMultiplier2 = import_soup11.distance.or(import_zod21.z.enum(["2x", "3x", "4x"]));
|
|
399
435
|
var viaProps = commonLayoutProps.extend({
|
|
400
436
|
fromLayer: import_soup11.layer_ref,
|
|
401
437
|
toLayer: import_soup11.layer_ref,
|
|
@@ -403,50 +439,37 @@ var viaProps = commonLayoutProps.extend({
|
|
|
403
439
|
outerDiameter: import_soup11.distance
|
|
404
440
|
});
|
|
405
441
|
var netAliasProps = commonLayoutProps.extend({
|
|
406
|
-
net:
|
|
442
|
+
net: import_zod21.z.string().optional()
|
|
407
443
|
});
|
|
408
|
-
var portRef =
|
|
409
|
-
|
|
410
|
-
|
|
444
|
+
var portRef = import_zod21.z.union([
|
|
445
|
+
import_zod21.z.string(),
|
|
446
|
+
import_zod21.z.custom(
|
|
411
447
|
(v) => Boolean(v.getPortSelector)
|
|
412
448
|
)
|
|
413
449
|
]);
|
|
414
|
-
var traceProps =
|
|
415
|
-
path:
|
|
450
|
+
var traceProps = import_zod21.z.object({
|
|
451
|
+
path: import_zod21.z.array(portRef),
|
|
416
452
|
thickness: import_soup11.distance.optional(),
|
|
417
|
-
schematicRouteHints:
|
|
418
|
-
pcbRouteHints:
|
|
453
|
+
schematicRouteHints: import_zod21.z.array(import_soup11.point).optional(),
|
|
454
|
+
pcbRouteHints: import_zod21.z.array(import_soup11.route_hint_point).optional()
|
|
419
455
|
}).or(
|
|
420
|
-
|
|
456
|
+
import_zod21.z.object({
|
|
421
457
|
from: portRef,
|
|
422
458
|
to: portRef,
|
|
423
459
|
thickness: import_soup11.distance.optional(),
|
|
424
|
-
schematicRouteHints:
|
|
425
|
-
pcbRouteHints:
|
|
460
|
+
schematicRouteHints: import_zod21.z.array(import_soup11.point).optional(),
|
|
461
|
+
pcbRouteHints: import_zod21.z.array(import_soup11.route_hint_point).optional()
|
|
426
462
|
})
|
|
427
463
|
);
|
|
428
|
-
var
|
|
429
|
-
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
430
|
-
shape: import_zod20.z.literal("circle"),
|
|
431
|
-
radius: import_soup11.distance.optional(),
|
|
432
|
-
portHints: portHints.optional()
|
|
433
|
-
}),
|
|
434
|
-
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
435
|
-
shape: import_zod20.z.literal("rect"),
|
|
436
|
-
width: import_soup11.distance.optional(),
|
|
437
|
-
height: import_soup11.distance.optional(),
|
|
438
|
-
portHints: portHints.optional()
|
|
439
|
-
})
|
|
440
|
-
]);
|
|
441
|
-
var platedHoleProps = import_zod20.z.union([
|
|
464
|
+
var platedHoleProps = import_zod21.z.union([
|
|
442
465
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
443
|
-
shape:
|
|
466
|
+
shape: import_zod21.z.literal("circle"),
|
|
444
467
|
holeDiameter: import_soup11.distance,
|
|
445
468
|
outerDiameter: import_soup11.distance,
|
|
446
469
|
portHints: portHints.optional()
|
|
447
470
|
}),
|
|
448
471
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
449
|
-
shape:
|
|
472
|
+
shape: import_zod21.z.literal("oval"),
|
|
450
473
|
outerWidth: import_soup11.distance,
|
|
451
474
|
outerHeight: import_soup11.distance,
|
|
452
475
|
innerWidth: import_soup11.distance,
|
|
@@ -454,13 +477,13 @@ var platedHoleProps = import_zod20.z.union([
|
|
|
454
477
|
portHints: portHints.optional()
|
|
455
478
|
})
|
|
456
479
|
]);
|
|
457
|
-
var pcbKeepoutProps =
|
|
480
|
+
var pcbKeepoutProps = import_zod21.z.union([
|
|
458
481
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
459
|
-
shape:
|
|
482
|
+
shape: import_zod21.z.literal("circle"),
|
|
460
483
|
radius: import_soup11.distance
|
|
461
484
|
}),
|
|
462
485
|
pcbLayoutProps.extend({
|
|
463
|
-
shape:
|
|
486
|
+
shape: import_zod21.z.literal("rect"),
|
|
464
487
|
width: import_soup11.distance,
|
|
465
488
|
height: import_soup11.distance
|
|
466
489
|
})
|
|
@@ -468,47 +491,47 @@ var pcbKeepoutProps = import_zod20.z.union([
|
|
|
468
491
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
469
492
|
holeDiameter: import_soup11.distance
|
|
470
493
|
});
|
|
471
|
-
var schematicBoxProps =
|
|
494
|
+
var schematicBoxProps = import_zod21.z.object({
|
|
472
495
|
schX: import_soup11.distance,
|
|
473
496
|
schY: import_soup11.distance,
|
|
474
497
|
width: import_soup11.distance,
|
|
475
498
|
height: import_soup11.distance
|
|
476
499
|
});
|
|
477
|
-
var schematicTextProps =
|
|
500
|
+
var schematicTextProps = import_zod21.z.object({
|
|
478
501
|
schX: import_soup11.distance,
|
|
479
502
|
schY: import_soup11.distance,
|
|
480
|
-
text:
|
|
503
|
+
text: import_zod21.z.string()
|
|
481
504
|
});
|
|
482
|
-
var schematicLineProps =
|
|
505
|
+
var schematicLineProps = import_zod21.z.object({
|
|
483
506
|
x1: import_soup11.distance,
|
|
484
507
|
y1: import_soup11.distance,
|
|
485
508
|
x2: import_soup11.distance,
|
|
486
509
|
y2: import_soup11.distance
|
|
487
510
|
});
|
|
488
|
-
var schematicPathProps =
|
|
489
|
-
points:
|
|
490
|
-
isFilled:
|
|
491
|
-
fillColor:
|
|
511
|
+
var schematicPathProps = import_zod21.z.object({
|
|
512
|
+
points: import_zod21.z.array(import_soup11.point),
|
|
513
|
+
isFilled: import_zod21.z.boolean().optional().default(false),
|
|
514
|
+
fillColor: import_zod21.z.enum(["red", "blue"]).optional()
|
|
492
515
|
});
|
|
493
|
-
var footprintProps =
|
|
516
|
+
var footprintProps = import_zod21.z.object({});
|
|
494
517
|
var componentProps = commonComponentProps;
|
|
495
518
|
var powerSourceProps = commonComponentProps.extend({
|
|
496
519
|
voltage: import_soup11.voltage
|
|
497
520
|
});
|
|
498
521
|
var portProps = commonLayoutProps.extend({
|
|
499
|
-
name:
|
|
500
|
-
pinNumber:
|
|
501
|
-
aliases:
|
|
522
|
+
name: import_zod21.z.string(),
|
|
523
|
+
pinNumber: import_zod21.z.number().optional(),
|
|
524
|
+
aliases: import_zod21.z.array(import_zod21.z.string()).optional(),
|
|
502
525
|
direction
|
|
503
526
|
});
|
|
504
527
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
505
|
-
text:
|
|
506
|
-
anchorAlignment:
|
|
507
|
-
font:
|
|
528
|
+
text: import_zod21.z.string(),
|
|
529
|
+
anchorAlignment: import_zod21.z.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
530
|
+
font: import_zod21.z.enum(["tscircuit2024"]).optional(),
|
|
508
531
|
fontSize: import_soup11.length.optional()
|
|
509
532
|
});
|
|
510
533
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
511
|
-
route:
|
|
534
|
+
route: import_zod21.z.array(import_soup11.route_hint_point),
|
|
512
535
|
strokeWidth: import_soup11.length.optional()
|
|
513
536
|
});
|
|
514
537
|
var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
@@ -519,46 +542,46 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
|
|
|
519
542
|
y2: import_soup11.distance
|
|
520
543
|
});
|
|
521
544
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
522
|
-
isFilled:
|
|
523
|
-
isOutline:
|
|
545
|
+
isFilled: import_zod21.z.boolean().optional(),
|
|
546
|
+
isOutline: import_zod21.z.boolean().optional(),
|
|
524
547
|
strokeWidth: import_soup11.distance.optional(),
|
|
525
548
|
width: import_soup11.distance,
|
|
526
549
|
height: import_soup11.distance
|
|
527
550
|
});
|
|
528
551
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
529
|
-
isFilled:
|
|
530
|
-
isOutline:
|
|
552
|
+
isFilled: import_zod21.z.boolean().optional(),
|
|
553
|
+
isOutline: import_zod21.z.boolean().optional(),
|
|
531
554
|
strokeWidth: import_soup11.distance.optional(),
|
|
532
555
|
radius: import_soup11.distance
|
|
533
556
|
});
|
|
534
|
-
var routeHintPointProps =
|
|
557
|
+
var routeHintPointProps = import_zod21.z.object({
|
|
535
558
|
x: import_soup11.distance,
|
|
536
559
|
y: import_soup11.distance,
|
|
537
|
-
via:
|
|
560
|
+
via: import_zod21.z.boolean().optional(),
|
|
538
561
|
toLayer: import_soup11.layer_ref.optional()
|
|
539
562
|
});
|
|
540
|
-
var traceHintProps =
|
|
541
|
-
for:
|
|
563
|
+
var traceHintProps = import_zod21.z.object({
|
|
564
|
+
for: import_zod21.z.string().optional().describe(
|
|
542
565
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
543
566
|
),
|
|
544
|
-
order:
|
|
567
|
+
order: import_zod21.z.number().optional(),
|
|
545
568
|
offset: import_soup11.route_hint_point.or(routeHintPointProps).optional(),
|
|
546
|
-
offsets:
|
|
547
|
-
traceWidth:
|
|
569
|
+
offsets: import_zod21.z.array(import_soup11.route_hint_point).or(import_zod21.z.array(routeHintPointProps)).optional(),
|
|
570
|
+
traceWidth: import_zod21.z.number().optional()
|
|
548
571
|
});
|
|
549
|
-
var pcbTraceProps =
|
|
550
|
-
layer:
|
|
572
|
+
var pcbTraceProps = import_zod21.z.object({
|
|
573
|
+
layer: import_zod21.z.string().optional(),
|
|
551
574
|
thickness: import_soup11.distance.optional(),
|
|
552
|
-
route:
|
|
575
|
+
route: import_zod21.z.array(import_soup11.route_hint_point)
|
|
553
576
|
});
|
|
554
577
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
555
|
-
text:
|
|
556
|
-
anchorAlignment:
|
|
557
|
-
font:
|
|
578
|
+
text: import_zod21.z.string(),
|
|
579
|
+
anchorAlignment: import_zod21.z.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
580
|
+
font: import_zod21.z.enum(["tscircuit2024"]).optional(),
|
|
558
581
|
fontSize: import_soup11.length.optional()
|
|
559
582
|
});
|
|
560
583
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
561
|
-
route:
|
|
584
|
+
route: import_zod21.z.array(import_soup11.route_hint_point),
|
|
562
585
|
strokeWidth: import_soup11.length.optional()
|
|
563
586
|
});
|
|
564
587
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -569,6 +592,7 @@ var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcb
|
|
|
569
592
|
capacitorPins,
|
|
570
593
|
capacitorProps,
|
|
571
594
|
chipProps,
|
|
595
|
+
circleSmtPadProps,
|
|
572
596
|
commonComponentProps,
|
|
573
597
|
commonLayoutProps,
|
|
574
598
|
componentProps,
|
|
@@ -604,6 +628,7 @@ var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcb
|
|
|
604
628
|
portProps,
|
|
605
629
|
portRef,
|
|
606
630
|
powerSourceProps,
|
|
631
|
+
rectSmtPadProps,
|
|
607
632
|
resistorPins,
|
|
608
633
|
resistorProps,
|
|
609
634
|
routeHintPointProps,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/index.ts","../lib/typecheck.ts","../lib/common/direction.ts","../lib/common/portHints.ts","../lib/common/layout.ts","../lib/common/point3.ts","../lib/common/cadModel.ts","../lib/common/footprintProp.ts","../lib/common/schematicPinDefinitions.ts","../lib/components/board.ts","../lib/common/point.ts","../lib/components/chip.ts","../lib/common/schematicPinStyle.ts","../lib/components/jumper.ts","../lib/components/resistor.ts","../lib/components/capacitor.ts","../lib/components/group.ts","../lib/components/net.ts","../lib/components/constrainedlayout.ts","../lib/common/distance.ts","../lib/components/constraint.ts"],"sourcesContent":["/**\n * THINKING ABOUT ADDING SOMETHING TO THIS FILE?\n *\n * THINK AGAIN!\n *\n * This file is TOO BIG! Create files using the pattern in the surrounding\n * directories, then export from this file.\n */\nimport type { LayoutBuilder } from \"@tscircuit/layout\"\nimport {\n type AnySoupElementInput,\n capacitance,\n distance,\n inductance,\n layer_ref,\n length,\n type PCBPlatedHoleInput,\n type PCBSMTPadInput,\n point,\n resistance,\n rotation,\n route_hint_point,\n supplier_name,\n voltage,\n} from \"@tscircuit/soup\"\nimport type { ReactElement } from \"react\"\nimport { z } from \"zod\"\nimport { direction } from \"./common/direction\"\nimport { portHints } from \"./common/portHints\"\nimport {\n commonComponentProps,\n commonLayoutProps,\n lrPins,\n lrPolarPins,\n pcbLayoutProps,\n} from \"./common/layout\"\nimport { explicitPinSideDefinition } from \"./common/schematicPinDefinitions\"\n\nexport * from \"./common/direction\"\nexport * from \"./common/portHints\"\nexport * from \"./common/layout\"\nexport * from \"./common/point3\"\nexport * from \"./common/portHints\"\nexport * from \"./common/footprintProp\"\nexport * from \"./common/schematicPinDefinitions\"\n\nexport * from \"./components/board\"\nexport * from \"./components/chip\"\nexport * from \"./components/jumper\"\n\nexport * from \"./components/resistor\"\nexport * from \"./components/capacitor\"\nexport * from \"./components/group\"\nexport * from \"./components/net\"\nexport * from \"./components/constrainedlayout\"\nexport * from \"./components/constraint\"\n\nexport const inductorProps = commonComponentProps.extend({\n inductance,\n})\nexport const inductorPins = lrPins\nexport type InductorProps = z.input<typeof inductorProps>\n\nexport const diodeProps = commonComponentProps.extend({})\nexport const diodePins = lrPolarPins\nexport type DiodeProps = z.input<typeof diodeProps>\n\nexport const ledProps = commonComponentProps.extend({\n color: z.string().optional(),\n})\nexport const ledPins = lrPolarPins\nexport type LedProps = z.input<typeof ledProps>\n\nexport const switchProps = commonComponentProps.extend({\n ftype: z.literal(\"switch\"),\n switchType: z.enum([\"spst\"]).default(\"spst\"),\n isNormallyClosed: z.boolean().default(false),\n})\nexport type SwitchProps = z.input<typeof switchProps>\n\nexport const distanceOrMultiplier = distance.or(z.enum([\"2x\", \"3x\", \"4x\"]))\n\nexport const viaProps = commonLayoutProps.extend({\n fromLayer: layer_ref,\n toLayer: layer_ref,\n holeDiameter: distance,\n outerDiameter: distance,\n})\nexport type ViaProps = z.input<typeof viaProps>\n\nexport const netAliasProps = commonLayoutProps.extend({\n net: z.string().optional(),\n})\nexport type NetAliasProps = z.input<typeof netAliasProps>\n\nexport const portRef = z.union([\n z.string(),\n z.custom<{ getPortSelector: () => string }>((v) =>\n Boolean(v.getPortSelector),\n ),\n])\n\nexport const traceProps = z\n .object({\n path: z.array(portRef),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n })\n .or(\n z.object({\n from: portRef,\n to: portRef,\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n }),\n )\nexport type TraceProps = z.input<typeof traceProps>\n\nexport const smtPadProps = z.union([\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"circle\"),\n radius: distance.optional(),\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"rect\"),\n width: distance.optional(),\n height: distance.optional(),\n portHints: portHints.optional(),\n }),\n])\nexport type SmtPadProps = z.input<typeof smtPadProps>\n\nexport const platedHoleProps = z.union([\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n shape: z.literal(\"circle\"),\n holeDiameter: distance,\n outerDiameter: distance,\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n shape: z.literal(\"oval\"),\n outerWidth: distance,\n outerHeight: distance,\n innerWidth: distance,\n innerHeight: distance,\n portHints: portHints.optional(),\n }),\n])\nexport type PlatedHoleProps = z.input<typeof platedHoleProps>\n\nexport const pcbKeepoutProps = z.union([\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"circle\"),\n radius: distance,\n }),\n pcbLayoutProps.extend({\n shape: z.literal(\"rect\"),\n width: distance,\n height: distance,\n }),\n])\nexport type PcbKeepoutProps = z.input<typeof pcbKeepoutProps>\n\nexport const holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({\n holeDiameter: distance,\n})\nexport type HoleProps = z.input<typeof holeProps>\n\nexport const schematicBoxProps = z.object({\n schX: distance,\n schY: distance,\n width: distance,\n height: distance,\n})\nexport type SchematicBoxProps = z.input<typeof schematicBoxProps>\n\nexport const schematicTextProps = z.object({\n schX: distance,\n schY: distance,\n text: z.string(),\n})\nexport type SchematicTextProps = z.input<typeof schematicTextProps>\n\nexport const schematicLineProps = z.object({\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n})\nexport type SchematicLineProps = z.input<typeof schematicLineProps>\n\nexport const schematicPathProps = z.object({\n points: z.array(point),\n isFilled: z.boolean().optional().default(false),\n fillColor: z.enum([\"red\", \"blue\"]).optional(),\n})\nexport type SchematicPathProps = z.input<typeof schematicPathProps>\n\nexport const footprintProps = z.object({})\nexport type FootprintProps = z.input<typeof footprintProps>\n\nexport const componentProps = commonComponentProps\nexport type ComponentProps = z.input<typeof componentProps>\n\nexport const powerSourceProps = commonComponentProps.extend({\n voltage,\n})\nexport type PowerSourceProps = z.input<typeof powerSourceProps>\n\nexport const portProps = commonLayoutProps.extend({\n name: z.string(),\n pinNumber: z.number().optional(),\n aliases: z.array(z.string()).optional(),\n direction: direction,\n})\nexport type PortProps = z.input<typeof portProps>\n\nexport const silkscreenTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n})\nexport type SilkscreenTextProps = z.input<typeof silkscreenTextProps>\n\nexport const silkscreenPathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type SilkscreenPathProps = z.input<typeof silkscreenPathProps>\n\nexport const silkscreenLineProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n strokeWidth: distance,\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n })\nexport type SilkscreenLineProps = z.input<typeof silkscreenLineProps>\n\nexport const silkscreenRectProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n width: distance,\n height: distance,\n })\nexport type SilkscreenRectProps = z.input<typeof silkscreenRectProps>\n\nexport const silkscreenCircleProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n radius: distance,\n })\nexport type SilkscreenCircleProps = z.input<typeof silkscreenCircleProps>\n\nexport const routeHintPointProps = z.object({\n x: distance,\n y: distance,\n via: z.boolean().optional(),\n toLayer: layer_ref.optional(),\n})\n\nexport const traceHintProps = z.object({\n for: z\n .string()\n .optional()\n .describe(\n \"Selector for the port you're targeting, not required if you're inside a trace\",\n ),\n order: z.number().optional(),\n offset: route_hint_point.or(routeHintPointProps).optional(),\n offsets: z\n .array(route_hint_point)\n .or(z.array(routeHintPointProps))\n .optional(),\n traceWidth: z.number().optional(),\n})\n\nexport type TraceHintProps = z.input<typeof traceHintProps>\n\nexport const pcbTraceProps = z.object({\n layer: z.string().optional(),\n thickness: distance.optional(),\n route: z.array(route_hint_point),\n})\nexport type PcbTraceProps = z.input<typeof pcbTraceProps>\n\nexport const fabricationNoteTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n})\nexport type FabricationNoteTextProps = z.input<typeof fabricationNoteTextProps>\n\nexport const fabricationNotePathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>\n","import type { TypeEqual } from \"ts-expect\"\n\nexport const expectTypesMatch = <const T1, const T2>(\n shouldBe: TypeEqual<T1, T2>,\n): void => {}\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nexport const direction = z.enum([\"up\", \"down\", \"left\", \"right\"])\nexport type Direction = \"up\" | \"down\" | \"left\" | \"right\"\n\nexport type DirectionAlongEdge =\n | \"top-to-bottom\"\n | \"left-to-right\"\n | \"bottom-to-top\"\n | \"right-to-left\"\n\nexport const directionAlongEdge = z.enum([\n \"top-to-bottom\",\n \"left-to-right\",\n \"bottom-to-top\",\n \"right-to-left\",\n])\n\nexpectTypesMatch<Direction, z.infer<typeof direction>>(true)\nexpectTypesMatch<DirectionAlongEdge, z.infer<typeof directionAlongEdge>>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const portHints = z.array(z.string().or(z.number()))\nexport type PortHints = (string | number)[]\n\nexpectTypesMatch<PortHints, z.infer<typeof portHints>>(true)\n","import { z } from \"zod\"\nimport {\n type AnySoupElementInput,\n distance,\n layer_ref,\n type LayerRef,\n type LayerRefInput,\n rotation,\n supplier_name,\n} from \"@tscircuit/soup\"\nimport { point3 } from \"./point3\"\nimport {\n cadModelJscad,\n cadModelObj,\n cadModelProp,\n cadModelStl,\n type CadModelJscad,\n type CadModelObj,\n type CadModelProp,\n type CadModelStl,\n} from \"./cadModel\"\nimport { footprintProp, type Footprint } from \"./footprintProp\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const pcbLayoutProps = z.object({\n pcbX: distance,\n pcbY: distance,\n pcbRotation: rotation.optional(),\n layer: layer_ref.optional(),\n})\n\nexport interface CommonLayoutProps {\n pcbX?: string | number\n pcbY?: string | number\n pcbRotation?: string | number\n\n schX?: string | number\n schY?: string | number\n schRotation?: string | number\n\n layer?: LayerRefInput\n footprint?: Footprint\n}\n\nexport const commonLayoutProps = z.object({\n pcbX: distance.optional(),\n pcbY: distance.optional(),\n pcbRotation: rotation.optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n layer: layer_ref.optional(),\n footprint: footprintProp.optional(),\n})\n\ntype InferredCommonLayoutProps = z.input<typeof commonLayoutProps>\nexpectTypesMatch<CommonLayoutProps, InferredCommonLayoutProps>(true)\n\nexport type SupplierName =\n | \"jlcpcb\"\n | \"macrofab\"\n | \"pcbway\"\n | \"digikey\"\n | \"mouser\"\n | \"lcsc\"\nexport interface SupplierProps {\n supplierPartNumbers?: { [k in SupplierName]?: string[] }\n}\nexport const supplierProps = z.object({\n supplierPartNumbers: z.record(supplier_name, z.array(z.string())).optional(),\n})\n\nexpectTypesMatch<SupplierProps, z.input<typeof supplierProps>>(true)\n\nexport interface CommonComponentProps extends CommonLayoutProps {\n name: string\n supplierPartNumbers?: SupplierProps[\"supplierPartNumbers\"]\n cadModel?: CadModelProp\n children?: any\n symbolName?: string\n}\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n name: z.string(),\n cadModel: cadModelProp.optional(),\n children: z.any().optional(),\n symbolName: z.string().optional(),\n })\n\ntype InferredCommonComponentProps = z.input<typeof commonComponentProps>\nexpectTypesMatch<CommonComponentProps, InferredCommonComponentProps>(true)\n\nexport const lrPins = [\"pin1\", \"left\", \"pin2\", \"right\"] as const\nexport const lrPolarPins = [\n \"pin1\",\n \"left\",\n \"anode\",\n \"pos\",\n \"pin2\",\n \"right\",\n \"cathode\",\n \"neg\",\n] as const\n\nexport const distanceOrMultiplier = distance.or(z.enum([\"2x\", \"3x\", \"4x\"]))\n","import { distance } from \"@tscircuit/soup\"\nimport { z } from \"zod\"\n\nexport const point3 = z.object({\n x: distance,\n y: distance,\n z: distance,\n})\n","import { z } from \"zod\"\nimport { point3 } from \"./point3\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const rotationPoint3 = z.object({\n x: z.union([z.number(), z.string()]),\n y: z.union([z.number(), z.string()]),\n z: z.union([z.number(), z.string()]),\n})\n\nexport interface CadModelBase {\n rotationOffset?:\n | number\n | { x: number | string; y: number | string; z: number | string }\n positionOffset?: {\n x: number | string\n y: number | string\n z: number | string\n }\n size?: { x: number | string; y: number | string; z: number | string }\n}\n\nexport const cadModelBase = z.object({\n rotationOffset: z.number().or(rotationPoint3).optional(),\n positionOffset: point3.optional(),\n size: point3.optional(),\n})\n\nexpectTypesMatch<CadModelBase, z.input<typeof cadModelBase>>(true)\n\nexport interface CadModelStl extends CadModelBase {\n stlUrl: string\n}\nexport const cadModelStl = cadModelBase.extend({\n stlUrl: z.string(),\n})\n\nexport interface CadModelObj extends CadModelBase {\n objUrl: string\n mtlUrl?: string\n}\nexport const cadModelObj = cadModelBase.extend({\n objUrl: z.string(),\n mtlUrl: z.string().optional(),\n})\n\nexport interface CadModelJscad extends CadModelBase {\n jscad: Record<string, any>\n}\nexport const cadModelJscad = cadModelBase.extend({\n jscad: z.record(z.any()),\n})\n\nexport type CadModelProp = string | CadModelStl | CadModelObj | CadModelJscad\n\nexport const cadModelProp = z.union([\n z.string(),\n cadModelStl,\n cadModelObj,\n cadModelJscad,\n])\n\ntype InferredCadModelProp = z.input<typeof cadModelProp>\nexpectTypesMatch<CadModelProp, InferredCadModelProp>(true)\n","import type { LayerRef } from \"@tscircuit/soup\"\nimport type { ReactElement } from \"react\"\nimport { z } from \"zod\"\n\n/**\n * This is an abbreviated definition of the soup elements that you can find here:\n * https://docs.tscircuit.com/api-reference/advanced/soup#pcb-smtpad\n */\nexport type FootprintSoupElements = {\n type: \"pcb_smtpad\" | \"pcb_plated_hole\"\n x: string | number\n y: string | number\n layer?: LayerRef\n holeDiameter?: string | number\n outerDiameter?: string | number\n shape?: \"circle\" | \"rect\"\n width?: string | number\n height?: string | number\n portHints?: string[]\n}\n\nexport type Footprint = string | ReactElement | FootprintSoupElements[]\nexport const footprintProp = z.custom<Footprint>((v) => true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\n/**\n * @deprecated Use SchematicPortArrangementWithPinCounts instead.\n */\nexport interface SchematicPortArrangementWithSizes {\n leftSize?: number\n topSize?: number\n rightSize?: number\n bottomSize?: number\n}\n\n/**\n * Specifies the number of pins on each side of the schematic box component.\n */\nexport interface SchematicPortArrangementWithPinCounts {\n leftPinCount?: number\n topPinCount?: number\n rightPinCount?: number\n bottomPinCount?: number\n}\n\nexport interface PinSideDefinition {\n pins: number[]\n direction:\n | \"top-to-bottom\"\n | \"left-to-right\"\n | \"bottom-to-top\"\n | \"right-to-left\"\n}\n\nexport interface SchematicPortArrangementWithSides {\n leftSide?: PinSideDefinition\n topSide?: PinSideDefinition\n rightSide?: PinSideDefinition\n bottomSide?: PinSideDefinition\n}\n\nexport type SchematicPortArrangement =\n | SchematicPortArrangementWithSizes\n | SchematicPortArrangementWithSides\n | SchematicPortArrangementWithPinCounts\n\nexport const explicitPinSideDefinition = z.object({\n pins: z.array(z.number()),\n direction: z.union([\n z.literal(\"top-to-bottom\"),\n z.literal(\"left-to-right\"),\n z.literal(\"bottom-to-top\"),\n z.literal(\"right-to-left\"),\n ]),\n})\n\nexport const schematicPortArrangement = z\n .object({\n leftSize: z.number().optional().describe(\"@deprecated, use leftPinCount\"),\n topSize: z.number().optional().describe(\"@deprecated, use topPinCount\"),\n rightSize: z.number().optional().describe(\"@deprecated, use rightPinCount\"),\n bottomSize: z\n .number()\n .optional()\n .describe(\"@deprecated, use bottomPinCount\"),\n })\n .or(\n z.object({\n leftPinCount: z.number().optional(),\n rightPinCount: z.number().optional(),\n topPinCount: z.number().optional(),\n bottomPinCount: z.number().optional(),\n }),\n )\n .or(\n z.object({\n leftSide: explicitPinSideDefinition.optional(),\n rightSide: explicitPinSideDefinition.optional(),\n topSide: explicitPinSideDefinition.optional(),\n bottomSide: explicitPinSideDefinition.optional(),\n }),\n )\n\nexpectTypesMatch<\n SchematicPortArrangement,\n z.input<typeof schematicPortArrangement>\n>(true)\n","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport { point, type Point } from \"lib/common/point\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface BoardProps {\n width?: number | string\n height?: number | string\n outline?: Point[]\n pcbX?: number | string\n pcbY?: number | string\n layout?: any\n routingDisabled?: boolean\n children?: any\n}\n\nexport const boardProps = z.object({\n width: distance.optional(),\n height: distance.optional(),\n outline: z.array(point).optional(),\n pcbX: distance.optional().default(0),\n pcbY: distance.optional().default(0),\n layout: z.any().optional(),\n routingDisabled: z.boolean().optional(),\n children: z.any(),\n})\n\nexpectTypesMatch<BoardProps, z.input<typeof boardProps>>(true)\n","import { distance } from \"@tscircuit/soup\"\nimport { z } from \"zod\"\n\nexport const point = z.object({\n x: distance,\n y: distance,\n})\n\nexport type Point = { x: number | string; y: number | string }\n","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport {\n commonComponentProps,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicPortArrangement,\n type SchematicPortArrangement,\n} from \"lib/common/schematicPinDefinitions\"\nimport {\n schematicPinStyle,\n type SchematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport type { Distance } from \"lib/common/distance\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface ChipProps extends CommonComponentProps {\n manufacturerPartNumber?: string\n pinLabels?: Record<number | string, string>\n schPortArrangement?: SchematicPortArrangement\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: Distance\n schWidth?: Distance\n schHeight?: Distance\n}\n\nexport const chipProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z.record(z.number().or(z.string()), z.string()).optional(),\n schPortArrangement: schematicPortArrangement.optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n})\n\n/**\n * @deprecated Use ChipProps instead.\n */\nexport const bugProps = chipProps\nexport type InferredChipProps = z.input<typeof chipProps>\n\nexpectTypesMatch<InferredChipProps, ChipProps>(true)\n","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport type SchematicPinStyle = Record<\n string,\n {\n leftMargin?: number | string\n rightMargin?: number | string\n topMargin?: number | string\n bottomMargin?: number | string\n }\n>\n\nexport const schematicPinStyle = z.record(\n z.object({\n leftMargin: distance.optional(),\n rightMargin: distance.optional(),\n topMargin: distance.optional(),\n bottomMargin: distance.optional(),\n }),\n)\n\nexpectTypesMatch<SchematicPinStyle, z.input<typeof schematicPinStyle>>(true)\n","import { z } from \"zod\"\nimport {\n commonComponentProps,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicPinStyle,\n type SchematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { distance } from \"@tscircuit/soup\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport {\n schematicPortArrangement,\n type SchematicPortArrangement,\n} from \"lib/common/schematicPinDefinitions\"\n\nexport interface JumperProps extends CommonComponentProps {\n manufacturerPartNumber?: string\n pinLabels?: Record<number | string, string>\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: number | string\n schWidth?: number | string\n schHeight?: number | string\n schDirection?: \"left\" | \"right\"\n schPortArrangement?: SchematicPortArrangement\n}\n\nexport const jumperProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z.record(z.number().or(z.string()), z.string()).optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n schDirection: z.enum([\"left\", \"right\"]).optional(),\n schPortArrangement: schematicPortArrangement.optional(),\n})\n\ntype InferredJumperProps = z.input<typeof jumperProps>\nexpectTypesMatch<JumperProps, InferredJumperProps>(true)\n","import { z } from \"zod\"\nimport { resistance } from \"@tscircuit/soup\"\nimport {\n commonComponentProps,\n lrPins,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface ResistorProps extends CommonComponentProps {\n resistance: number | string\n pullupFor?: string\n pullupTo?: string\n pulldownFor?: string\n pulldownTo?: string\n}\n\nexport const resistorProps = commonComponentProps.extend({\n resistance,\n\n pullupFor: z.string().optional(),\n pullupTo: z.string().optional(),\n\n pulldownFor: z.string().optional(),\n pulldownTo: z.string().optional(),\n})\nexport const resistorPins = lrPins\n\ntype InferredResistorProps = z.input<typeof resistorProps>\nexpectTypesMatch<ResistorProps, InferredResistorProps>(true)\n","import { z } from \"zod\"\nimport { capacitance } from \"@tscircuit/soup\"\nimport {\n commonComponentProps,\n lrPins,\n lrPolarPins,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface CapacitorProps extends CommonComponentProps {\n capacitance: number | string\n\n decouplingFor?: string\n decouplingTo?: string\n\n bypassFor?: string\n bypassTo?: string\n}\n\nexport const capacitorProps = commonComponentProps.extend({\n capacitance,\n\n decouplingFor: z.string().optional(),\n decouplingTo: z.string().optional(),\n\n bypassFor: z.string().optional(),\n bypassTo: z.string().optional(),\n})\nexport const capacitorPins = lrPolarPins\n\nexpectTypesMatch<CapacitorProps, z.input<typeof capacitorProps>>(true)\n","import { z } from \"zod\"\nimport { commonLayoutProps, type CommonLayoutProps } from \"lib/common/layout\"\nimport type { LayoutBuilder } from \"@tscircuit/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface BaseGroupProps extends CommonLayoutProps {\n name?: string\n children?: any\n}\n\nexport interface SubcircuitGroupProps extends BaseGroupProps {\n subcircuit: true\n layout?: LayoutBuilder\n routingDisabled?: boolean\n}\n\nexport type GroupProps = SubcircuitGroupProps | BaseGroupProps\n\nexport const baseGroupProps = commonLayoutProps.extend({\n name: z.string().optional(),\n children: z.any().optional(),\n})\n\nexport const subcircuitGroupProps = baseGroupProps.extend({\n subcircuit: z.literal(true),\n layout: z.custom<LayoutBuilder>((v) => true).optional(),\n routingDisabled: z.boolean().optional(),\n})\n\nexport const groupProps = z.union([baseGroupProps, subcircuitGroupProps])\n\ntype InferredBaseGroupProps = z.input<typeof baseGroupProps>\ntype InferredSubcircuitGroupProps = z.input<typeof subcircuitGroupProps>\n\nexpectTypesMatch<BaseGroupProps, InferredBaseGroupProps>(true)\nexpectTypesMatch<SubcircuitGroupProps, InferredSubcircuitGroupProps>(true)\n\ntype InferredGroupProps = z.input<typeof groupProps>\nexpectTypesMatch<GroupProps, InferredGroupProps>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface NetProps {\n name: string\n}\n\nexport const netProps = z.object({\n name: z.string(),\n})\n\ntype InferredNetProps = z.input<typeof netProps>\nexpectTypesMatch<NetProps, InferredNetProps>(true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface ConstrainedLayoutProps {\n name?: string\n pcbOnly?: boolean\n schOnly?: boolean\n}\n\nexport const constrainedLayoutProps = z.object({\n name: z.string().optional(),\n pcbOnly: z.boolean().optional(),\n schOnly: z.boolean().optional(),\n})\n\nexport type InferredConstrainedLayoutProps = z.input<\n typeof constrainedLayoutProps\n>\n\nexpectTypesMatch<InferredConstrainedLayoutProps, ConstrainedLayoutProps>(true)\n","import { z } from \"zod\"\n\nexport type Distance = number | string\n\nexport { distance } from \"@tscircuit/soup\"\n","import type { Distance } from \"lib/common/distance\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { distance } from \"lib/common/distance\"\nimport { z } from \"zod\"\n\nexport type PcbXDistConstraint = {\n pcb?: true\n xdist: Distance\n left: string\n right: string\n}\n\nexport type PcbYDistConstraint = {\n pcb?: true\n ydist: Distance\n top: string\n bottom: string\n}\n\nexport type ConstraintProps = PcbXDistConstraint | PcbYDistConstraint\n\nexport const constraintProps = z.union([\n z.object({\n pcb: z.literal(true),\n xdist: distance,\n left: z.string(),\n right: z.string(),\n }),\n z.object({\n pcb: z.literal(true),\n ydist: distance,\n top: z.string(),\n bottom: z.string(),\n }),\n])\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,IAAAC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AAE,OAAO,EAAE,SAAS;AAClC,CAAC;AAIM,IAAM,gBAAgB,eAAE,OAAO;AAAA,EACpC,OAAO,eAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,WAAW,uBAAS,SAAS;AAAA,EAC7B,OAAO,eAAE,MAAM,8BAAgB;AACjC,CAAC;AAGM,IAAM,2BAA2B,eAAe,OAAO;AAAA,EAC5D,MAAM,eAAE,OAAO;AAAA,EACf,iBAAiB,eACd,KAAK,CAAC,UAAU,YAAY,aAAa,eAAe,cAAc,CAAC,EACvE,QAAQ,QAAQ;AAAA,EACnB,MAAM,eAAE,KAAK,CAAC,eAAe,CAAC,EAAE,SAAS;AAAA,EACzC,UAAU,qBAAO,SAAS;AAC5B,CAAC;AAGM,IAAM,2BAA2B,eACrC,KAAK,EAAE,MAAM,MAAM,MAAM,MAAM,aAAa,KAAK,CAAC,EAClD,OAAO;AAAA,EACN,OAAO,eAAE,MAAM,8BAAgB;AAAA,EAC/B,aAAa,qBAAO,SAAS;AAC/B,CAAC;","names":["distanceOrMultiplier","import_soup","import_zod","import_zod","import_zod","import_soup","import_zod","import_zod","import_zod","import_zod","import_zod","import_soup","import_soup","import_zod","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","import_zod","import_zod","import_zod","import_zod","import_soup","import_zod","distanceOrMultiplier"]}
|
|
1
|
+
{"version":3,"sources":["../lib/index.ts","../lib/typecheck.ts","../lib/common/direction.ts","../lib/common/portHints.ts","../lib/common/layout.ts","../lib/common/point3.ts","../lib/common/cadModel.ts","../lib/common/footprintProp.ts","../lib/common/schematicPinDefinitions.ts","../lib/components/board.ts","../lib/common/point.ts","../lib/components/chip.ts","../lib/common/schematicPinStyle.ts","../lib/components/jumper.ts","../lib/components/resistor.ts","../lib/components/capacitor.ts","../lib/components/group.ts","../lib/components/net.ts","../lib/components/constrainedlayout.ts","../lib/common/distance.ts","../lib/components/constraint.ts","../lib/components/smtpad.ts"],"sourcesContent":["/**\n * THINKING ABOUT ADDING SOMETHING TO THIS FILE?\n *\n * THINK AGAIN!\n *\n * This file is TOO BIG! Create files using the pattern in the surrounding\n * directories, then export from this file.\n */\nimport type { LayoutBuilder } from \"@tscircuit/layout\"\nimport {\n type AnySoupElementInput,\n capacitance,\n distance,\n inductance,\n layer_ref,\n length,\n type PCBPlatedHoleInput,\n type PCBSMTPadInput,\n point,\n resistance,\n rotation,\n route_hint_point,\n supplier_name,\n voltage,\n} from \"@tscircuit/soup\"\nimport type { ReactElement } from \"react\"\nimport { z } from \"zod\"\nimport { direction } from \"./common/direction\"\nimport { portHints } from \"./common/portHints\"\nimport {\n commonComponentProps,\n commonLayoutProps,\n lrPins,\n lrPolarPins,\n pcbLayoutProps,\n} from \"./common/layout\"\nimport { explicitPinSideDefinition } from \"./common/schematicPinDefinitions\"\n\nexport * from \"./common/direction\"\nexport * from \"./common/portHints\"\nexport * from \"./common/layout\"\nexport * from \"./common/point3\"\nexport * from \"./common/portHints\"\nexport * from \"./common/footprintProp\"\nexport * from \"./common/schematicPinDefinitions\"\n\nexport * from \"./components/board\"\nexport * from \"./components/chip\"\nexport * from \"./components/jumper\"\n\nexport * from \"./components/resistor\"\nexport * from \"./components/capacitor\"\nexport * from \"./components/group\"\nexport * from \"./components/net\"\nexport * from \"./components/constrainedlayout\"\nexport * from \"./components/constraint\"\nexport * from \"./components/smtpad\"\n\nexport const inductorProps = commonComponentProps.extend({\n inductance,\n})\nexport const inductorPins = lrPins\nexport type InductorProps = z.input<typeof inductorProps>\n\nexport const diodeProps = commonComponentProps.extend({})\nexport const diodePins = lrPolarPins\nexport type DiodeProps = z.input<typeof diodeProps>\n\nexport const ledProps = commonComponentProps.extend({\n color: z.string().optional(),\n})\nexport const ledPins = lrPolarPins\nexport type LedProps = z.input<typeof ledProps>\n\nexport const switchProps = commonComponentProps.extend({\n ftype: z.literal(\"switch\"),\n switchType: z.enum([\"spst\"]).default(\"spst\"),\n isNormallyClosed: z.boolean().default(false),\n})\nexport type SwitchProps = z.input<typeof switchProps>\n\nexport const distanceOrMultiplier = distance.or(z.enum([\"2x\", \"3x\", \"4x\"]))\n\nexport const viaProps = commonLayoutProps.extend({\n fromLayer: layer_ref,\n toLayer: layer_ref,\n holeDiameter: distance,\n outerDiameter: distance,\n})\nexport type ViaProps = z.input<typeof viaProps>\n\nexport const netAliasProps = commonLayoutProps.extend({\n net: z.string().optional(),\n})\nexport type NetAliasProps = z.input<typeof netAliasProps>\n\nexport const portRef = z.union([\n z.string(),\n z.custom<{ getPortSelector: () => string }>((v) =>\n Boolean(v.getPortSelector),\n ),\n])\n\nexport const traceProps = z\n .object({\n path: z.array(portRef),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n })\n .or(\n z.object({\n from: portRef,\n to: portRef,\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n }),\n )\nexport type TraceProps = z.input<typeof traceProps>\n\nexport const platedHoleProps = z.union([\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n shape: z.literal(\"circle\"),\n holeDiameter: distance,\n outerDiameter: distance,\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n shape: z.literal(\"oval\"),\n outerWidth: distance,\n outerHeight: distance,\n innerWidth: distance,\n innerHeight: distance,\n portHints: portHints.optional(),\n }),\n])\nexport type PlatedHoleProps = z.input<typeof platedHoleProps>\n\nexport const pcbKeepoutProps = z.union([\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"circle\"),\n radius: distance,\n }),\n pcbLayoutProps.extend({\n shape: z.literal(\"rect\"),\n width: distance,\n height: distance,\n }),\n])\nexport type PcbKeepoutProps = z.input<typeof pcbKeepoutProps>\n\nexport const holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({\n holeDiameter: distance,\n})\nexport type HoleProps = z.input<typeof holeProps>\n\nexport const schematicBoxProps = z.object({\n schX: distance,\n schY: distance,\n width: distance,\n height: distance,\n})\nexport type SchematicBoxProps = z.input<typeof schematicBoxProps>\n\nexport const schematicTextProps = z.object({\n schX: distance,\n schY: distance,\n text: z.string(),\n})\nexport type SchematicTextProps = z.input<typeof schematicTextProps>\n\nexport const schematicLineProps = z.object({\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n})\nexport type SchematicLineProps = z.input<typeof schematicLineProps>\n\nexport const schematicPathProps = z.object({\n points: z.array(point),\n isFilled: z.boolean().optional().default(false),\n fillColor: z.enum([\"red\", \"blue\"]).optional(),\n})\nexport type SchematicPathProps = z.input<typeof schematicPathProps>\n\nexport const footprintProps = z.object({})\nexport type FootprintProps = z.input<typeof footprintProps>\n\nexport const componentProps = commonComponentProps\nexport type ComponentProps = z.input<typeof componentProps>\n\nexport const powerSourceProps = commonComponentProps.extend({\n voltage,\n})\nexport type PowerSourceProps = z.input<typeof powerSourceProps>\n\nexport const portProps = commonLayoutProps.extend({\n name: z.string(),\n pinNumber: z.number().optional(),\n aliases: z.array(z.string()).optional(),\n direction: direction,\n})\nexport type PortProps = z.input<typeof portProps>\n\nexport const silkscreenTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n})\nexport type SilkscreenTextProps = z.input<typeof silkscreenTextProps>\n\nexport const silkscreenPathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type SilkscreenPathProps = z.input<typeof silkscreenPathProps>\n\nexport const silkscreenLineProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n strokeWidth: distance,\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n })\nexport type SilkscreenLineProps = z.input<typeof silkscreenLineProps>\n\nexport const silkscreenRectProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n width: distance,\n height: distance,\n })\nexport type SilkscreenRectProps = z.input<typeof silkscreenRectProps>\n\nexport const silkscreenCircleProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n radius: distance,\n })\nexport type SilkscreenCircleProps = z.input<typeof silkscreenCircleProps>\n\nexport const routeHintPointProps = z.object({\n x: distance,\n y: distance,\n via: z.boolean().optional(),\n toLayer: layer_ref.optional(),\n})\n\nexport const traceHintProps = z.object({\n for: z\n .string()\n .optional()\n .describe(\n \"Selector for the port you're targeting, not required if you're inside a trace\",\n ),\n order: z.number().optional(),\n offset: route_hint_point.or(routeHintPointProps).optional(),\n offsets: z\n .array(route_hint_point)\n .or(z.array(routeHintPointProps))\n .optional(),\n traceWidth: z.number().optional(),\n})\n\nexport type TraceHintProps = z.input<typeof traceHintProps>\n\nexport const pcbTraceProps = z.object({\n layer: z.string().optional(),\n thickness: distance.optional(),\n route: z.array(route_hint_point),\n})\nexport type PcbTraceProps = z.input<typeof pcbTraceProps>\n\nexport const fabricationNoteTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n})\nexport type FabricationNoteTextProps = z.input<typeof fabricationNoteTextProps>\n\nexport const fabricationNotePathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>\n","import type { TypeEqual } from \"ts-expect\"\n\nexport const expectTypesMatch = <const T1, const T2>(\n shouldBe: TypeEqual<T1, T2>,\n): void => {}\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nexport const direction = z.enum([\"up\", \"down\", \"left\", \"right\"])\nexport type Direction = \"up\" | \"down\" | \"left\" | \"right\"\n\nexport type DirectionAlongEdge =\n | \"top-to-bottom\"\n | \"left-to-right\"\n | \"bottom-to-top\"\n | \"right-to-left\"\n\nexport const directionAlongEdge = z.enum([\n \"top-to-bottom\",\n \"left-to-right\",\n \"bottom-to-top\",\n \"right-to-left\",\n])\n\nexpectTypesMatch<Direction, z.infer<typeof direction>>(true)\nexpectTypesMatch<DirectionAlongEdge, z.infer<typeof directionAlongEdge>>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const portHints = z.array(z.string().or(z.number()))\nexport type PortHints = (string | number)[]\n\nexpectTypesMatch<PortHints, z.infer<typeof portHints>>(true)\n","import { z } from \"zod\"\nimport {\n type AnySoupElementInput,\n distance,\n layer_ref,\n type LayerRef,\n type LayerRefInput,\n rotation,\n supplier_name,\n} from \"@tscircuit/soup\"\nimport { point3 } from \"./point3\"\nimport {\n cadModelJscad,\n cadModelObj,\n cadModelProp,\n cadModelStl,\n type CadModelJscad,\n type CadModelObj,\n type CadModelProp,\n type CadModelStl,\n} from \"./cadModel\"\nimport { footprintProp, type Footprint } from \"./footprintProp\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface PcbLayoutProps {\n pcbX: string | number\n pcbY: string | number\n pcbRotation?: string | number\n layer?: LayerRefInput\n}\n\nexport interface CommonLayoutProps {\n pcbX?: string | number\n pcbY?: string | number\n pcbRotation?: string | number\n\n schX?: string | number\n schY?: string | number\n schRotation?: string | number\n\n layer?: LayerRefInput\n footprint?: Footprint\n}\n\nexport const pcbLayoutProps = z.object({\n pcbX: distance,\n pcbY: distance,\n pcbRotation: rotation.optional(),\n layer: layer_ref.optional(),\n})\ntype InferredPcbLayoutProps = z.input<typeof pcbLayoutProps>\nexpectTypesMatch<PcbLayoutProps, InferredPcbLayoutProps>(true)\n\nexport const commonLayoutProps = z.object({\n pcbX: distance.optional(),\n pcbY: distance.optional(),\n pcbRotation: rotation.optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n layer: layer_ref.optional(),\n footprint: footprintProp.optional(),\n})\n\ntype InferredCommonLayoutProps = z.input<typeof commonLayoutProps>\nexpectTypesMatch<CommonLayoutProps, InferredCommonLayoutProps>(true)\n\nexport type SupplierName =\n | \"jlcpcb\"\n | \"macrofab\"\n | \"pcbway\"\n | \"digikey\"\n | \"mouser\"\n | \"lcsc\"\nexport interface SupplierProps {\n supplierPartNumbers?: { [k in SupplierName]?: string[] }\n}\nexport const supplierProps = z.object({\n supplierPartNumbers: z.record(supplier_name, z.array(z.string())).optional(),\n})\n\nexpectTypesMatch<SupplierProps, z.input<typeof supplierProps>>(true)\n\nexport interface CommonComponentProps extends CommonLayoutProps {\n name: string\n supplierPartNumbers?: SupplierProps[\"supplierPartNumbers\"]\n cadModel?: CadModelProp\n children?: any\n symbolName?: string\n}\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n name: z.string(),\n cadModel: cadModelProp.optional(),\n children: z.any().optional(),\n symbolName: z.string().optional(),\n })\n\ntype InferredCommonComponentProps = z.input<typeof commonComponentProps>\nexpectTypesMatch<CommonComponentProps, InferredCommonComponentProps>(true)\n\nexport const lrPins = [\"pin1\", \"left\", \"pin2\", \"right\"] as const\nexport const lrPolarPins = [\n \"pin1\",\n \"left\",\n \"anode\",\n \"pos\",\n \"pin2\",\n \"right\",\n \"cathode\",\n \"neg\",\n] as const\n\nexport const distanceOrMultiplier = distance.or(z.enum([\"2x\", \"3x\", \"4x\"]))\n","import { distance } from \"@tscircuit/soup\"\nimport { z } from \"zod\"\n\nexport const point3 = z.object({\n x: distance,\n y: distance,\n z: distance,\n})\n","import { z } from \"zod\"\nimport { point3 } from \"./point3\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const rotationPoint3 = z.object({\n x: z.union([z.number(), z.string()]),\n y: z.union([z.number(), z.string()]),\n z: z.union([z.number(), z.string()]),\n})\n\nexport interface CadModelBase {\n rotationOffset?:\n | number\n | { x: number | string; y: number | string; z: number | string }\n positionOffset?: {\n x: number | string\n y: number | string\n z: number | string\n }\n size?: { x: number | string; y: number | string; z: number | string }\n}\n\nexport const cadModelBase = z.object({\n rotationOffset: z.number().or(rotationPoint3).optional(),\n positionOffset: point3.optional(),\n size: point3.optional(),\n})\n\nexpectTypesMatch<CadModelBase, z.input<typeof cadModelBase>>(true)\n\nexport interface CadModelStl extends CadModelBase {\n stlUrl: string\n}\nexport const cadModelStl = cadModelBase.extend({\n stlUrl: z.string(),\n})\n\nexport interface CadModelObj extends CadModelBase {\n objUrl: string\n mtlUrl?: string\n}\nexport const cadModelObj = cadModelBase.extend({\n objUrl: z.string(),\n mtlUrl: z.string().optional(),\n})\n\nexport interface CadModelJscad extends CadModelBase {\n jscad: Record<string, any>\n}\nexport const cadModelJscad = cadModelBase.extend({\n jscad: z.record(z.any()),\n})\n\nexport type CadModelProp = string | CadModelStl | CadModelObj | CadModelJscad\n\nexport const cadModelProp = z.union([\n z.string(),\n cadModelStl,\n cadModelObj,\n cadModelJscad,\n])\n\ntype InferredCadModelProp = z.input<typeof cadModelProp>\nexpectTypesMatch<CadModelProp, InferredCadModelProp>(true)\n","import type { LayerRef } from \"@tscircuit/soup\"\nimport type { ReactElement } from \"react\"\nimport { z } from \"zod\"\n\n/**\n * This is an abbreviated definition of the soup elements that you can find here:\n * https://docs.tscircuit.com/api-reference/advanced/soup#pcb-smtpad\n */\nexport type FootprintSoupElements = {\n type: \"pcb_smtpad\" | \"pcb_plated_hole\"\n x: string | number\n y: string | number\n layer?: LayerRef\n holeDiameter?: string | number\n outerDiameter?: string | number\n shape?: \"circle\" | \"rect\"\n width?: string | number\n height?: string | number\n portHints?: string[]\n}\n\nexport type Footprint = string | ReactElement | FootprintSoupElements[]\nexport const footprintProp = z.custom<Footprint>((v) => true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\n/**\n * @deprecated Use SchematicPortArrangementWithPinCounts instead.\n */\nexport interface SchematicPortArrangementWithSizes {\n leftSize?: number\n topSize?: number\n rightSize?: number\n bottomSize?: number\n}\n\n/**\n * Specifies the number of pins on each side of the schematic box component.\n */\nexport interface SchematicPortArrangementWithPinCounts {\n leftPinCount?: number\n topPinCount?: number\n rightPinCount?: number\n bottomPinCount?: number\n}\n\nexport interface PinSideDefinition {\n pins: number[]\n direction:\n | \"top-to-bottom\"\n | \"left-to-right\"\n | \"bottom-to-top\"\n | \"right-to-left\"\n}\n\nexport interface SchematicPortArrangementWithSides {\n leftSide?: PinSideDefinition\n topSide?: PinSideDefinition\n rightSide?: PinSideDefinition\n bottomSide?: PinSideDefinition\n}\n\nexport type SchematicPortArrangement =\n | SchematicPortArrangementWithSizes\n | SchematicPortArrangementWithSides\n | SchematicPortArrangementWithPinCounts\n\nexport const explicitPinSideDefinition = z.object({\n pins: z.array(z.number()),\n direction: z.union([\n z.literal(\"top-to-bottom\"),\n z.literal(\"left-to-right\"),\n z.literal(\"bottom-to-top\"),\n z.literal(\"right-to-left\"),\n ]),\n})\n\nexport const schematicPortArrangement = z\n .object({\n leftSize: z.number().optional().describe(\"@deprecated, use leftPinCount\"),\n topSize: z.number().optional().describe(\"@deprecated, use topPinCount\"),\n rightSize: z.number().optional().describe(\"@deprecated, use rightPinCount\"),\n bottomSize: z\n .number()\n .optional()\n .describe(\"@deprecated, use bottomPinCount\"),\n })\n .or(\n z.object({\n leftPinCount: z.number().optional(),\n rightPinCount: z.number().optional(),\n topPinCount: z.number().optional(),\n bottomPinCount: z.number().optional(),\n }),\n )\n .or(\n z.object({\n leftSide: explicitPinSideDefinition.optional(),\n rightSide: explicitPinSideDefinition.optional(),\n topSide: explicitPinSideDefinition.optional(),\n bottomSide: explicitPinSideDefinition.optional(),\n }),\n )\n\nexpectTypesMatch<\n SchematicPortArrangement,\n z.input<typeof schematicPortArrangement>\n>(true)\n","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport { point, type Point } from \"lib/common/point\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface BoardProps {\n width?: number | string\n height?: number | string\n outline?: Point[]\n pcbX?: number | string\n pcbY?: number | string\n layout?: any\n routingDisabled?: boolean\n children?: any\n}\n\nexport const boardProps = z.object({\n width: distance.optional(),\n height: distance.optional(),\n outline: z.array(point).optional(),\n pcbX: distance.optional().default(0),\n pcbY: distance.optional().default(0),\n layout: z.any().optional(),\n routingDisabled: z.boolean().optional(),\n children: z.any(),\n})\n\nexpectTypesMatch<BoardProps, z.input<typeof boardProps>>(true)\n","import { distance } from \"@tscircuit/soup\"\nimport { z } from \"zod\"\n\nexport const point = z.object({\n x: distance,\n y: distance,\n})\n\nexport type Point = { x: number | string; y: number | string }\n","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport {\n commonComponentProps,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicPortArrangement,\n type SchematicPortArrangement,\n} from \"lib/common/schematicPinDefinitions\"\nimport {\n schematicPinStyle,\n type SchematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport type { Distance } from \"lib/common/distance\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface ChipProps extends CommonComponentProps {\n manufacturerPartNumber?: string\n pinLabels?: Record<number | string, string>\n schPortArrangement?: SchematicPortArrangement\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: Distance\n schWidth?: Distance\n schHeight?: Distance\n}\n\nexport const chipProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z.record(z.number().or(z.string()), z.string()).optional(),\n schPortArrangement: schematicPortArrangement.optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n})\n\n/**\n * @deprecated Use ChipProps instead.\n */\nexport const bugProps = chipProps\nexport type InferredChipProps = z.input<typeof chipProps>\n\nexpectTypesMatch<InferredChipProps, ChipProps>(true)\n","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport type SchematicPinStyle = Record<\n string,\n {\n leftMargin?: number | string\n rightMargin?: number | string\n topMargin?: number | string\n bottomMargin?: number | string\n }\n>\n\nexport const schematicPinStyle = z.record(\n z.object({\n leftMargin: distance.optional(),\n rightMargin: distance.optional(),\n topMargin: distance.optional(),\n bottomMargin: distance.optional(),\n }),\n)\n\nexpectTypesMatch<SchematicPinStyle, z.input<typeof schematicPinStyle>>(true)\n","import { z } from \"zod\"\nimport {\n commonComponentProps,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicPinStyle,\n type SchematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { distance } from \"@tscircuit/soup\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport {\n schematicPortArrangement,\n type SchematicPortArrangement,\n} from \"lib/common/schematicPinDefinitions\"\n\nexport interface JumperProps extends CommonComponentProps {\n manufacturerPartNumber?: string\n pinLabels?: Record<number | string, string>\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: number | string\n schWidth?: number | string\n schHeight?: number | string\n schDirection?: \"left\" | \"right\"\n schPortArrangement?: SchematicPortArrangement\n}\n\nexport const jumperProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z.record(z.number().or(z.string()), z.string()).optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n schDirection: z.enum([\"left\", \"right\"]).optional(),\n schPortArrangement: schematicPortArrangement.optional(),\n})\n\ntype InferredJumperProps = z.input<typeof jumperProps>\nexpectTypesMatch<JumperProps, InferredJumperProps>(true)\n","import { z } from \"zod\"\nimport { resistance } from \"@tscircuit/soup\"\nimport {\n commonComponentProps,\n lrPins,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface ResistorProps extends CommonComponentProps {\n resistance: number | string\n pullupFor?: string\n pullupTo?: string\n pulldownFor?: string\n pulldownTo?: string\n}\n\nexport const resistorProps = commonComponentProps.extend({\n resistance,\n\n pullupFor: z.string().optional(),\n pullupTo: z.string().optional(),\n\n pulldownFor: z.string().optional(),\n pulldownTo: z.string().optional(),\n})\nexport const resistorPins = lrPins\n\ntype InferredResistorProps = z.input<typeof resistorProps>\nexpectTypesMatch<ResistorProps, InferredResistorProps>(true)\n","import { z } from \"zod\"\nimport { capacitance } from \"@tscircuit/soup\"\nimport {\n commonComponentProps,\n lrPins,\n lrPolarPins,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface CapacitorProps extends CommonComponentProps {\n capacitance: number | string\n\n decouplingFor?: string\n decouplingTo?: string\n\n bypassFor?: string\n bypassTo?: string\n}\n\nexport const capacitorProps = commonComponentProps.extend({\n capacitance,\n\n decouplingFor: z.string().optional(),\n decouplingTo: z.string().optional(),\n\n bypassFor: z.string().optional(),\n bypassTo: z.string().optional(),\n})\nexport const capacitorPins = lrPolarPins\n\nexpectTypesMatch<CapacitorProps, z.input<typeof capacitorProps>>(true)\n","import { z } from \"zod\"\nimport { commonLayoutProps, type CommonLayoutProps } from \"lib/common/layout\"\nimport type { LayoutBuilder } from \"@tscircuit/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface BaseGroupProps extends CommonLayoutProps {\n name?: string\n children?: any\n}\n\nexport interface SubcircuitGroupProps extends BaseGroupProps {\n subcircuit: true\n layout?: LayoutBuilder\n routingDisabled?: boolean\n}\n\nexport type GroupProps = SubcircuitGroupProps | BaseGroupProps\n\nexport const baseGroupProps = commonLayoutProps.extend({\n name: z.string().optional(),\n children: z.any().optional(),\n})\n\nexport const subcircuitGroupProps = baseGroupProps.extend({\n subcircuit: z.literal(true),\n layout: z.custom<LayoutBuilder>((v) => true).optional(),\n routingDisabled: z.boolean().optional(),\n})\n\nexport const groupProps = z.union([baseGroupProps, subcircuitGroupProps])\n\ntype InferredBaseGroupProps = z.input<typeof baseGroupProps>\ntype InferredSubcircuitGroupProps = z.input<typeof subcircuitGroupProps>\n\nexpectTypesMatch<BaseGroupProps, InferredBaseGroupProps>(true)\nexpectTypesMatch<SubcircuitGroupProps, InferredSubcircuitGroupProps>(true)\n\ntype InferredGroupProps = z.input<typeof groupProps>\nexpectTypesMatch<GroupProps, InferredGroupProps>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface NetProps {\n name: string\n}\n\nexport const netProps = z.object({\n name: z.string(),\n})\n\ntype InferredNetProps = z.input<typeof netProps>\nexpectTypesMatch<NetProps, InferredNetProps>(true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface ConstrainedLayoutProps {\n name?: string\n pcbOnly?: boolean\n schOnly?: boolean\n}\n\nexport const constrainedLayoutProps = z.object({\n name: z.string().optional(),\n pcbOnly: z.boolean().optional(),\n schOnly: z.boolean().optional(),\n})\n\nexport type InferredConstrainedLayoutProps = z.input<\n typeof constrainedLayoutProps\n>\n\nexpectTypesMatch<InferredConstrainedLayoutProps, ConstrainedLayoutProps>(true)\n","import { z } from \"zod\"\n\nexport type Distance = number | string\n\nexport { distance } from \"@tscircuit/soup\"\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport type { Distance } from \"lib/common/distance\"\nimport { distance } from \"lib/common/distance\"\nimport { z } from \"zod\"\n\nexport type PcbXDistConstraint = {\n pcb?: true\n type?: \"xdist\"\n xdist: Distance\n left: string\n right: string\n\n edgeToEdge?: true\n centerToCenter?: true\n\n fromLeftEdge?: true\n fromLeftCenter?: true\n toRightEdge?: true\n toRightCenter?: true\n}\n\nexport type PcbYDistConstraint = {\n pcb?: true\n type?: \"ydist\"\n ydist: Distance\n top: string\n bottom: string\n\n edgeToEdge?: true\n centerToCenter?: true\n\n fromTopEdge?: true\n fromTopCenter?: true\n toBottomEdge?: true\n toBottomCenter?: true\n}\n\nexport type ConstraintProps = PcbXDistConstraint | PcbYDistConstraint\n\nexport const constraintProps = z.union([\n z.object({\n pcb: z.literal(true).optional(),\n type: z.literal(\"xdist\").optional(),\n xdist: distance,\n left: z.string(),\n right: z.string(),\n\n edgeToEdge: z.literal(true).optional(),\n centerToCenter: z.literal(true).optional(),\n\n fromLeftEdge: z.literal(true).optional(),\n fromLeftCenter: z.literal(true).optional(),\n toRightEdge: z.literal(true).optional(),\n toRightCenter: z.literal(true).optional(),\n }),\n z.object({\n pcb: z.literal(true).optional(),\n type: z.literal(\"ydist\").optional(),\n ydist: distance,\n top: z.string(),\n bottom: z.string(),\n\n edgeToEdge: z.literal(true).optional(),\n centerToCenter: z.literal(true).optional(),\n\n fromTopEdge: z.literal(true).optional(),\n fromTopCenter: z.literal(true).optional(),\n toBottomEdge: z.literal(true).optional(),\n toBottomCenter: z.literal(true).optional(),\n }),\n])\n\nexpectTypesMatch<ConstraintProps, z.input<typeof constraintProps>>(true)\n","import {\n pcbLayoutProps,\n type CommonLayoutProps,\n type PcbLayoutProps,\n} from \"lib/common/layout\"\nimport { z } from \"zod\"\nimport { distance, type Distance } from \"lib/common/distance\"\nimport { portHints, type PortHints } from \"lib/common/portHints\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface RectSmtPadProps extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n shape: \"rect\"\n width: Distance\n height: Distance\n portHints?: PortHints\n}\n\nexport interface CircleSmtPadProps extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n shape: \"circle\"\n radius: Distance\n portHints?: PortHints\n}\n\nexport type SmtPadProps = RectSmtPadProps | CircleSmtPadProps\n\n// ----------------------------------------------------------------------------\n// Zod\n// ----------------------------------------------------------------------------\n\nexport const rectSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n shape: z.literal(\"rect\"),\n width: distance,\n height: distance,\n portHints: portHints.optional(),\n })\ntype InferredRectSmtPadProps = z.input<typeof rectSmtPadProps>\nexpectTypesMatch<InferredRectSmtPadProps, RectSmtPadProps>(true)\n\nexport const circleSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n shape: z.literal(\"circle\"),\n radius: distance,\n portHints: portHints.optional(),\n })\ntype InferredCircleSmtPadProps = z.input<typeof circleSmtPadProps>\nexpectTypesMatch<InferredCircleSmtPadProps, CircleSmtPadProps>(true)\n\nexport const smtPadProps = z.union([circleSmtPadProps, rectSmtPadProps])\n\nexport type InferredSmtPadProps = z.input<typeof smtPadProps>\nexpectTypesMatch<InferredSmtPadProps, SmtPadProps>(true)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,IAAAC,gBAeO;AAEP,IAAAC,eAAkB;;;ACxBX,IAAM,mBAAmB,CAC9B,aACS;AAAC;;;ACHZ,iBAAkB;AACX,IAAM,YAAY,aAAE,KAAK,CAAC,MAAM,QAAQ,QAAQ,OAAO,CAAC;AASxD,IAAM,qBAAqB,aAAE,KAAK;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,iBAAuD,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plier","import_soup","import_zod","import_zod","import_zod","import_soup","import_zod","import_zod","import_zod","import_zod","import_zod","import_soup","import_soup","import_zod","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","import_zod","import_zod","import_zod","import_zod","import_soup","import_zod","import_zod","distanceOrMultiplier"]}
|
package/lib/common/layout.ts
CHANGED
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
import { footprintProp, type Footprint } from "./footprintProp"
|
|
23
23
|
import { expectTypesMatch } from "lib/typecheck"
|
|
24
24
|
|
|
25
|
-
export
|
|
26
|
-
pcbX:
|
|
27
|
-
pcbY:
|
|
28
|
-
pcbRotation
|
|
29
|
-
layer
|
|
30
|
-
}
|
|
25
|
+
export interface PcbLayoutProps {
|
|
26
|
+
pcbX: string | number
|
|
27
|
+
pcbY: string | number
|
|
28
|
+
pcbRotation?: string | number
|
|
29
|
+
layer?: LayerRefInput
|
|
30
|
+
}
|
|
31
31
|
|
|
32
32
|
export interface CommonLayoutProps {
|
|
33
33
|
pcbX?: string | number
|
|
@@ -42,6 +42,15 @@ export interface CommonLayoutProps {
|
|
|
42
42
|
footprint?: Footprint
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
export const pcbLayoutProps = z.object({
|
|
46
|
+
pcbX: distance,
|
|
47
|
+
pcbY: distance,
|
|
48
|
+
pcbRotation: rotation.optional(),
|
|
49
|
+
layer: layer_ref.optional(),
|
|
50
|
+
})
|
|
51
|
+
type InferredPcbLayoutProps = z.input<typeof pcbLayoutProps>
|
|
52
|
+
expectTypesMatch<PcbLayoutProps, InferredPcbLayoutProps>(true)
|
|
53
|
+
|
|
45
54
|
export const commonLayoutProps = z.object({
|
|
46
55
|
pcbX: distance.optional(),
|
|
47
56
|
pcbY: distance.optional(),
|
|
@@ -1,35 +1,73 @@
|
|
|
1
|
-
import type { Distance } from "lib/common/distance"
|
|
2
1
|
import { expectTypesMatch } from "lib/typecheck"
|
|
2
|
+
import type { Distance } from "lib/common/distance"
|
|
3
3
|
import { distance } from "lib/common/distance"
|
|
4
4
|
import { z } from "zod"
|
|
5
5
|
|
|
6
6
|
export type PcbXDistConstraint = {
|
|
7
7
|
pcb?: true
|
|
8
|
+
type?: "xdist"
|
|
8
9
|
xdist: Distance
|
|
9
10
|
left: string
|
|
10
11
|
right: string
|
|
12
|
+
|
|
13
|
+
edgeToEdge?: true
|
|
14
|
+
centerToCenter?: true
|
|
15
|
+
|
|
16
|
+
fromLeftEdge?: true
|
|
17
|
+
fromLeftCenter?: true
|
|
18
|
+
toRightEdge?: true
|
|
19
|
+
toRightCenter?: true
|
|
11
20
|
}
|
|
12
21
|
|
|
13
22
|
export type PcbYDistConstraint = {
|
|
14
23
|
pcb?: true
|
|
24
|
+
type?: "ydist"
|
|
15
25
|
ydist: Distance
|
|
16
26
|
top: string
|
|
17
27
|
bottom: string
|
|
28
|
+
|
|
29
|
+
edgeToEdge?: true
|
|
30
|
+
centerToCenter?: true
|
|
31
|
+
|
|
32
|
+
fromTopEdge?: true
|
|
33
|
+
fromTopCenter?: true
|
|
34
|
+
toBottomEdge?: true
|
|
35
|
+
toBottomCenter?: true
|
|
18
36
|
}
|
|
19
37
|
|
|
20
38
|
export type ConstraintProps = PcbXDistConstraint | PcbYDistConstraint
|
|
21
39
|
|
|
22
40
|
export const constraintProps = z.union([
|
|
23
41
|
z.object({
|
|
24
|
-
pcb: z.literal(true),
|
|
42
|
+
pcb: z.literal(true).optional(),
|
|
43
|
+
type: z.literal("xdist").optional(),
|
|
25
44
|
xdist: distance,
|
|
26
45
|
left: z.string(),
|
|
27
46
|
right: z.string(),
|
|
47
|
+
|
|
48
|
+
edgeToEdge: z.literal(true).optional(),
|
|
49
|
+
centerToCenter: z.literal(true).optional(),
|
|
50
|
+
|
|
51
|
+
fromLeftEdge: z.literal(true).optional(),
|
|
52
|
+
fromLeftCenter: z.literal(true).optional(),
|
|
53
|
+
toRightEdge: z.literal(true).optional(),
|
|
54
|
+
toRightCenter: z.literal(true).optional(),
|
|
28
55
|
}),
|
|
29
56
|
z.object({
|
|
30
|
-
pcb: z.literal(true),
|
|
57
|
+
pcb: z.literal(true).optional(),
|
|
58
|
+
type: z.literal("ydist").optional(),
|
|
31
59
|
ydist: distance,
|
|
32
60
|
top: z.string(),
|
|
33
61
|
bottom: z.string(),
|
|
62
|
+
|
|
63
|
+
edgeToEdge: z.literal(true).optional(),
|
|
64
|
+
centerToCenter: z.literal(true).optional(),
|
|
65
|
+
|
|
66
|
+
fromTopEdge: z.literal(true).optional(),
|
|
67
|
+
fromTopCenter: z.literal(true).optional(),
|
|
68
|
+
toBottomEdge: z.literal(true).optional(),
|
|
69
|
+
toBottomCenter: z.literal(true).optional(),
|
|
34
70
|
}),
|
|
35
71
|
])
|
|
72
|
+
|
|
73
|
+
expectTypesMatch<ConstraintProps, z.input<typeof constraintProps>>(true)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pcbLayoutProps,
|
|
3
|
+
type CommonLayoutProps,
|
|
4
|
+
type PcbLayoutProps,
|
|
5
|
+
} from "lib/common/layout"
|
|
6
|
+
import { z } from "zod"
|
|
7
|
+
import { distance, type Distance } from "lib/common/distance"
|
|
8
|
+
import { portHints, type PortHints } from "lib/common/portHints"
|
|
9
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
10
|
+
|
|
11
|
+
export interface RectSmtPadProps extends Omit<PcbLayoutProps, "pcbRotation"> {
|
|
12
|
+
shape: "rect"
|
|
13
|
+
width: Distance
|
|
14
|
+
height: Distance
|
|
15
|
+
portHints?: PortHints
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface CircleSmtPadProps extends Omit<PcbLayoutProps, "pcbRotation"> {
|
|
19
|
+
shape: "circle"
|
|
20
|
+
radius: Distance
|
|
21
|
+
portHints?: PortHints
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type SmtPadProps = RectSmtPadProps | CircleSmtPadProps
|
|
25
|
+
|
|
26
|
+
// ----------------------------------------------------------------------------
|
|
27
|
+
// Zod
|
|
28
|
+
// ----------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
export const rectSmtPadProps = pcbLayoutProps
|
|
31
|
+
.omit({ pcbRotation: true })
|
|
32
|
+
.extend({
|
|
33
|
+
shape: z.literal("rect"),
|
|
34
|
+
width: distance,
|
|
35
|
+
height: distance,
|
|
36
|
+
portHints: portHints.optional(),
|
|
37
|
+
})
|
|
38
|
+
type InferredRectSmtPadProps = z.input<typeof rectSmtPadProps>
|
|
39
|
+
expectTypesMatch<InferredRectSmtPadProps, RectSmtPadProps>(true)
|
|
40
|
+
|
|
41
|
+
export const circleSmtPadProps = pcbLayoutProps
|
|
42
|
+
.omit({ pcbRotation: true })
|
|
43
|
+
.extend({
|
|
44
|
+
shape: z.literal("circle"),
|
|
45
|
+
radius: distance,
|
|
46
|
+
portHints: portHints.optional(),
|
|
47
|
+
})
|
|
48
|
+
type InferredCircleSmtPadProps = z.input<typeof circleSmtPadProps>
|
|
49
|
+
expectTypesMatch<InferredCircleSmtPadProps, CircleSmtPadProps>(true)
|
|
50
|
+
|
|
51
|
+
export const smtPadProps = z.union([circleSmtPadProps, rectSmtPadProps])
|
|
52
|
+
|
|
53
|
+
export type InferredSmtPadProps = z.input<typeof smtPadProps>
|
|
54
|
+
expectTypesMatch<InferredSmtPadProps, SmtPadProps>(true)
|
package/lib/index.ts
CHANGED
|
@@ -54,6 +54,7 @@ export * from "./components/group"
|
|
|
54
54
|
export * from "./components/net"
|
|
55
55
|
export * from "./components/constrainedlayout"
|
|
56
56
|
export * from "./components/constraint"
|
|
57
|
+
export * from "./components/smtpad"
|
|
57
58
|
|
|
58
59
|
export const inductorProps = commonComponentProps.extend({
|
|
59
60
|
inductance,
|
|
@@ -118,21 +119,6 @@ export const traceProps = z
|
|
|
118
119
|
)
|
|
119
120
|
export type TraceProps = z.input<typeof traceProps>
|
|
120
121
|
|
|
121
|
-
export const smtPadProps = z.union([
|
|
122
|
-
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
123
|
-
shape: z.literal("circle"),
|
|
124
|
-
radius: distance.optional(),
|
|
125
|
-
portHints: portHints.optional(),
|
|
126
|
-
}),
|
|
127
|
-
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
128
|
-
shape: z.literal("rect"),
|
|
129
|
-
width: distance.optional(),
|
|
130
|
-
height: distance.optional(),
|
|
131
|
-
portHints: portHints.optional(),
|
|
132
|
-
}),
|
|
133
|
-
])
|
|
134
|
-
export type SmtPadProps = z.input<typeof smtPadProps>
|
|
135
|
-
|
|
136
122
|
export const platedHoleProps = z.union([
|
|
137
123
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
138
124
|
shape: z.literal("circle"),
|