@tscircuit/props 0.0.704 → 0.0.706
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -2
- package/dist/index.d.ts +415 -26
- package/dist/index.js +567 -461
- package/dist/index.js.map +1 -1
- package/lib/common/ibis.ts +60 -0
- package/lib/components/analogdigitalstimulus.ts +60 -0
- package/lib/components/analogeyediagram.ts +47 -0
- package/lib/components/analogsimulation.ts +5 -5
- package/lib/components/analogtransientsimulation.ts +11 -0
- package/lib/components/ibismodel.ts +13 -0
- package/lib/index.ts +4 -0
- package/lib/platformConfig.ts +23 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18638,9 +18638,7 @@ expectTypesMatch(true);
|
|
|
18638
18638
|
// lib/components/analogsimulation.ts
|
|
18639
18639
|
import { ms } from "circuit-json";
|
|
18640
18640
|
import { z as z101 } from "zod";
|
|
18641
|
-
var spiceEngine = z101.custom(
|
|
18642
|
-
(value) => typeof value === "string"
|
|
18643
|
-
);
|
|
18641
|
+
var spiceEngine = z101.custom((value) => typeof value === "string");
|
|
18644
18642
|
var spiceOptions = z101.object({
|
|
18645
18643
|
method: z101.enum(["trap", "gear"]).optional(),
|
|
18646
18644
|
reltol: z101.union([z101.number(), z101.string()]).optional(),
|
|
@@ -18670,20 +18668,63 @@ expectTypesMatch(
|
|
|
18670
18668
|
|
|
18671
18669
|
// lib/components/analogtransientsimulation.ts
|
|
18672
18670
|
import { ms as ms2 } from "circuit-json";
|
|
18671
|
+
import { z as z103 } from "zod";
|
|
18672
|
+
|
|
18673
|
+
// lib/common/ibis.ts
|
|
18674
|
+
import { asset } from "circuit-json";
|
|
18673
18675
|
import { z as z102 } from "zod";
|
|
18676
|
+
var ibisPinRunState = z102.discriminatedUnion("isOutput", [
|
|
18677
|
+
z102.object({ isOutput: z102.literal(false) }).strict(),
|
|
18678
|
+
z102.object({ isOutput: z102.literal(true), isOutputEnabled: z102.boolean() }).strict()
|
|
18679
|
+
]);
|
|
18680
|
+
var ibisPinReferences = z102.object({
|
|
18681
|
+
pullup: z102.string().min(1).optional(),
|
|
18682
|
+
pulldown: z102.string().min(1).optional(),
|
|
18683
|
+
powerClamp: z102.string().min(1).optional(),
|
|
18684
|
+
groundClamp: z102.string().min(1).optional(),
|
|
18685
|
+
external: z102.string().min(1).optional()
|
|
18686
|
+
}).strict();
|
|
18687
|
+
var ibisAssetPath = z102.string().min(1).regex(/^(?!\s|[a-z][a-z\d+.-]*:|[/\\])[^\\\u0000-\u001f\u007f]+$/i);
|
|
18688
|
+
var ibisModelAsset = asset.extend({
|
|
18689
|
+
project_relative_path: ibisAssetPath,
|
|
18690
|
+
url: z102.string().url().regex(/^https?:\/\//i).or(ibisAssetPath)
|
|
18691
|
+
});
|
|
18692
|
+
var ibisModelDefinition = z102.object({
|
|
18693
|
+
ibisModelAsset,
|
|
18694
|
+
ibisComponentName: z102.string().min(1),
|
|
18695
|
+
ibisPinNameToPortLabel: z102.record(z102.string().min(1), z102.string().min(1)).refine((pins) => Object.keys(pins).length > 0),
|
|
18696
|
+
ibisPinNameToModelName: z102.record(z102.string().min(1), z102.string().min(1)).optional(),
|
|
18697
|
+
ibisPinNameToReferencePortLabels: z102.record(z102.string().min(1), ibisPinReferences).optional(),
|
|
18698
|
+
modelValueCorner: z102.union([
|
|
18699
|
+
z102.literal("typical"),
|
|
18700
|
+
z102.literal("minimum"),
|
|
18701
|
+
z102.literal("maximum")
|
|
18702
|
+
]),
|
|
18703
|
+
includePackageParasitics: z102.boolean()
|
|
18704
|
+
});
|
|
18705
|
+
|
|
18706
|
+
// lib/components/analogtransientsimulation.ts
|
|
18674
18707
|
var positiveMilliseconds = ms2.refine(
|
|
18675
18708
|
(milliseconds) => milliseconds > 0,
|
|
18676
18709
|
"Time must be positive"
|
|
18677
18710
|
);
|
|
18678
|
-
var analogTransientSimulationProps =
|
|
18711
|
+
var analogTransientSimulationProps = z103.object({
|
|
18679
18712
|
...analogAnalysisSimulationBaseProps,
|
|
18680
18713
|
duration: positiveMilliseconds.default("10ms"),
|
|
18681
18714
|
startTime: ms2.default("0ms"),
|
|
18682
|
-
timePerStep: positiveMilliseconds.default("0.01ms")
|
|
18715
|
+
timePerStep: positiveMilliseconds.default("0.01ms"),
|
|
18716
|
+
ibisPinStates: z103.record(z103.string().min(1), ibisPinRunState).optional()
|
|
18683
18717
|
}).superRefine((simulation, context) => {
|
|
18718
|
+
if (simulation.ibisPinStates && simulation.spiceEngine !== "pcb_spice") {
|
|
18719
|
+
context.addIssue({
|
|
18720
|
+
code: z103.ZodIssueCode.custom,
|
|
18721
|
+
path: ["ibisPinStates"],
|
|
18722
|
+
message: "IBIS pin states require spiceEngine=pcb_spice"
|
|
18723
|
+
});
|
|
18724
|
+
}
|
|
18684
18725
|
if (simulation.startTime < 0 || simulation.startTime > simulation.duration) {
|
|
18685
18726
|
context.addIssue({
|
|
18686
|
-
code:
|
|
18727
|
+
code: z103.ZodIssueCode.custom,
|
|
18687
18728
|
path: ["startTime"],
|
|
18688
18729
|
message: "startTime must be between zero and duration"
|
|
18689
18730
|
});
|
|
@@ -18691,20 +18732,77 @@ var analogTransientSimulationProps = z102.object({
|
|
|
18691
18732
|
});
|
|
18692
18733
|
expectTypesMatch(true);
|
|
18693
18734
|
|
|
18735
|
+
// lib/components/ibismodel.ts
|
|
18736
|
+
import { z as z104 } from "zod";
|
|
18737
|
+
var ibisModelProps = ibisModelDefinition.extend({ componentRef: z104.string().min(1) }).strict();
|
|
18738
|
+
expectTypesMatch(true);
|
|
18739
|
+
|
|
18740
|
+
// lib/components/analogdigitalstimulus.ts
|
|
18741
|
+
import { ms as ms3 } from "circuit-json";
|
|
18742
|
+
import { z as z105 } from "zod";
|
|
18743
|
+
var MAX_TRANSMITTED_BITS = 65536;
|
|
18744
|
+
var analogDigitalStimulusProps = z105.object({
|
|
18745
|
+
name: z105.string().min(1),
|
|
18746
|
+
simulationRef: z105.string().min(1),
|
|
18747
|
+
sourcePinRef: z105.string().min(1),
|
|
18748
|
+
bitDuration: ms3.refine(
|
|
18749
|
+
(milliseconds) => Number.isFinite(milliseconds) && milliseconds > 0
|
|
18750
|
+
),
|
|
18751
|
+
startTime: ms3.refine(
|
|
18752
|
+
(milliseconds) => Number.isFinite(milliseconds) && milliseconds >= 0
|
|
18753
|
+
),
|
|
18754
|
+
initialState: z105.union([z105.literal(0), z105.literal(1)]),
|
|
18755
|
+
inverted: z105.boolean().default(false),
|
|
18756
|
+
transmittedData: z105.object({
|
|
18757
|
+
transmissionType: z105.literal("bits"),
|
|
18758
|
+
bits: z105.union([
|
|
18759
|
+
z105.string().regex(/^[01]+$/).max(MAX_TRANSMITTED_BITS),
|
|
18760
|
+
z105.array(z105.union([z105.literal(0), z105.literal(1)])).nonempty().max(MAX_TRANSMITTED_BITS)
|
|
18761
|
+
]),
|
|
18762
|
+
repeat: z105.boolean()
|
|
18763
|
+
}).strict()
|
|
18764
|
+
}).strict();
|
|
18765
|
+
expectTypesMatch(true);
|
|
18766
|
+
|
|
18767
|
+
// lib/components/analogeyediagram.ts
|
|
18768
|
+
import { ms as ms4 } from "circuit-json";
|
|
18769
|
+
import { z as z106 } from "zod";
|
|
18770
|
+
var finiteMilliseconds = ms4.refine(Number.isFinite);
|
|
18771
|
+
var analogEyeDiagramProps = z106.object({
|
|
18772
|
+
name: z106.string().min(1),
|
|
18773
|
+
simulationRef: z106.string().min(1),
|
|
18774
|
+
probeRef: z106.string().min(1),
|
|
18775
|
+
unitInterval: finiteMilliseconds.refine((milliseconds) => milliseconds > 0),
|
|
18776
|
+
timeOrigin: finiteMilliseconds,
|
|
18777
|
+
startTime: finiteMilliseconds.refine((milliseconds) => milliseconds >= 0).optional(),
|
|
18778
|
+
endTime: finiteMilliseconds.refine((milliseconds) => milliseconds > 0).optional()
|
|
18779
|
+
}).strict().superRefine((eye, context) => {
|
|
18780
|
+
if (eye.startTime !== void 0 && eye.endTime !== void 0 && eye.startTime >= eye.endTime) {
|
|
18781
|
+
context.addIssue({
|
|
18782
|
+
code: z106.ZodIssueCode.custom,
|
|
18783
|
+
path: ["endTime"],
|
|
18784
|
+
message: "Eye gate end must follow its start"
|
|
18785
|
+
});
|
|
18786
|
+
}
|
|
18787
|
+
});
|
|
18788
|
+
expectTypesMatch(
|
|
18789
|
+
true
|
|
18790
|
+
);
|
|
18791
|
+
|
|
18694
18792
|
// lib/components/analogdcoperatingpointsimulation.ts
|
|
18695
|
-
import { z as
|
|
18696
|
-
var analogDcOperatingPointSimulationProps =
|
|
18793
|
+
import { z as z107 } from "zod";
|
|
18794
|
+
var analogDcOperatingPointSimulationProps = z107.object({
|
|
18697
18795
|
...analogAnalysisSimulationBaseProps
|
|
18698
18796
|
});
|
|
18699
18797
|
expectTypesMatch(true);
|
|
18700
18798
|
|
|
18701
18799
|
// lib/components/analogdcsweepsimulation.ts
|
|
18702
18800
|
import { current, voltage as voltage3 } from "circuit-json";
|
|
18703
|
-
import { z as
|
|
18704
|
-
var dcSweepQuantity =
|
|
18705
|
-
var analogDcSweepSimulationProps =
|
|
18801
|
+
import { z as z108 } from "zod";
|
|
18802
|
+
var dcSweepQuantity = z108.union([voltage3, current]);
|
|
18803
|
+
var analogDcSweepSimulationProps = z108.object({
|
|
18706
18804
|
...analogAnalysisSimulationBaseProps,
|
|
18707
|
-
sweepSource:
|
|
18805
|
+
sweepSource: z108.string().min(1),
|
|
18708
18806
|
sweepStart: dcSweepQuantity,
|
|
18709
18807
|
sweepStop: dcSweepQuantity,
|
|
18710
18808
|
sweepStep: dcSweepQuantity.refine(
|
|
@@ -18714,7 +18812,7 @@ var analogDcSweepSimulationProps = z104.object({
|
|
|
18714
18812
|
}).superRefine((simulation, context) => {
|
|
18715
18813
|
if (Math.sign(simulation.sweepStop - simulation.sweepStart) !== Math.sign(simulation.sweepStep)) {
|
|
18716
18814
|
context.addIssue({
|
|
18717
|
-
code:
|
|
18815
|
+
code: z108.ZodIssueCode.custom,
|
|
18718
18816
|
path: ["sweepStep"],
|
|
18719
18817
|
message: "sweepStep must move from sweepStart toward sweepStop"
|
|
18720
18818
|
});
|
|
@@ -18724,10 +18822,10 @@ expectTypesMatch(true);
|
|
|
18724
18822
|
|
|
18725
18823
|
// lib/components/analogacsweepsimulation.ts
|
|
18726
18824
|
import { frequency as frequency3 } from "circuit-json";
|
|
18727
|
-
import { z as
|
|
18728
|
-
var analogAcSweepSimulationProps =
|
|
18825
|
+
import { z as z109 } from "zod";
|
|
18826
|
+
var analogAcSweepSimulationProps = z109.object({
|
|
18729
18827
|
...analogAnalysisSimulationBaseProps,
|
|
18730
|
-
sweepType:
|
|
18828
|
+
sweepType: z109.enum(["linear", "decade", "octave"]),
|
|
18731
18829
|
startFrequency: frequency3.refine(
|
|
18732
18830
|
(startFrequencyHz) => startFrequencyHz > 0,
|
|
18733
18831
|
"startFrequency must be positive"
|
|
@@ -18736,12 +18834,12 @@ var analogAcSweepSimulationProps = z105.object({
|
|
|
18736
18834
|
(stopFrequencyHz) => stopFrequencyHz > 0,
|
|
18737
18835
|
"stopFrequency must be positive"
|
|
18738
18836
|
),
|
|
18739
|
-
samplesPerInterval:
|
|
18740
|
-
sampleCount:
|
|
18837
|
+
samplesPerInterval: z109.number().int().positive().optional(),
|
|
18838
|
+
sampleCount: z109.number().int().positive().optional()
|
|
18741
18839
|
}).superRefine((simulation, context) => {
|
|
18742
18840
|
if (simulation.stopFrequency <= simulation.startFrequency) {
|
|
18743
18841
|
context.addIssue({
|
|
18744
|
-
code:
|
|
18842
|
+
code: z109.ZodIssueCode.custom,
|
|
18745
18843
|
path: ["stopFrequency"],
|
|
18746
18844
|
message: "stopFrequency must be greater than startFrequency"
|
|
18747
18845
|
});
|
|
@@ -18749,14 +18847,14 @@ var analogAcSweepSimulationProps = z105.object({
|
|
|
18749
18847
|
if (simulation.sweepType === "linear") {
|
|
18750
18848
|
if (simulation.sampleCount === void 0) {
|
|
18751
18849
|
context.addIssue({
|
|
18752
|
-
code:
|
|
18850
|
+
code: z109.ZodIssueCode.custom,
|
|
18753
18851
|
path: ["sampleCount"],
|
|
18754
18852
|
message: "sampleCount is required for a linear AC sweep"
|
|
18755
18853
|
});
|
|
18756
18854
|
}
|
|
18757
18855
|
if (simulation.samplesPerInterval !== void 0) {
|
|
18758
18856
|
context.addIssue({
|
|
18759
|
-
code:
|
|
18857
|
+
code: z109.ZodIssueCode.custom,
|
|
18760
18858
|
path: ["samplesPerInterval"],
|
|
18761
18859
|
message: "samplesPerInterval is only valid for decade or octave sweeps"
|
|
18762
18860
|
});
|
|
@@ -18765,14 +18863,14 @@ var analogAcSweepSimulationProps = z105.object({
|
|
|
18765
18863
|
}
|
|
18766
18864
|
if (simulation.samplesPerInterval === void 0) {
|
|
18767
18865
|
context.addIssue({
|
|
18768
|
-
code:
|
|
18866
|
+
code: z109.ZodIssueCode.custom,
|
|
18769
18867
|
path: ["samplesPerInterval"],
|
|
18770
18868
|
message: "samplesPerInterval is required for decade or octave sweeps"
|
|
18771
18869
|
});
|
|
18772
18870
|
}
|
|
18773
18871
|
if (simulation.sampleCount !== void 0) {
|
|
18774
18872
|
context.addIssue({
|
|
18775
|
-
code:
|
|
18873
|
+
code: z109.ZodIssueCode.custom,
|
|
18776
18874
|
path: ["sampleCount"],
|
|
18777
18875
|
message: "sampleCount is only valid for a linear sweep"
|
|
18778
18876
|
});
|
|
@@ -18782,8 +18880,8 @@ expectTypesMatch(true);
|
|
|
18782
18880
|
|
|
18783
18881
|
// lib/components/pcb-return-current-excitation.ts
|
|
18784
18882
|
import { layer_ref as layer_ref9 } from "circuit-json";
|
|
18785
|
-
import { z as
|
|
18786
|
-
var selector =
|
|
18883
|
+
import { z as z110 } from "zod";
|
|
18884
|
+
var selector = z110.string().trim().min(1, "Provide a nonempty selector");
|
|
18787
18885
|
var quantity2 = "[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?";
|
|
18788
18886
|
var prefixScale = {
|
|
18789
18887
|
"": 1,
|
|
@@ -18810,14 +18908,14 @@ function positiveQuantity(unit, label, example) {
|
|
|
18810
18908
|
const pattern = new RegExp(
|
|
18811
18909
|
`^(${quantity2})\\s*(?:([yzafpnumkMGTPEZY\xB5\u03BC]?)(?:${unit}))?$`
|
|
18812
18910
|
);
|
|
18813
|
-
return
|
|
18814
|
-
|
|
18815
|
-
|
|
18911
|
+
return z110.union([
|
|
18912
|
+
z110.number(),
|
|
18913
|
+
z110.string().trim().regex(pattern, `Use ${label} or a unit string, e.g. ${example}`)
|
|
18816
18914
|
]).transform((value) => {
|
|
18817
18915
|
if (typeof value === "number") return value;
|
|
18818
18916
|
const match = pattern.exec(value);
|
|
18819
18917
|
return Number(match[1]) * prefixScale[match[2] ?? ""];
|
|
18820
|
-
}).pipe(
|
|
18918
|
+
}).pipe(z110.number().finite().positive(`${label} must be greater than zero`));
|
|
18821
18919
|
}
|
|
18822
18920
|
var positiveCurrent = positiveQuantity("A", "peak amperes", "5mA");
|
|
18823
18921
|
var positiveResistance = positiveQuantity(
|
|
@@ -18825,8 +18923,8 @@ var positiveResistance = positiveQuantity(
|
|
|
18825
18923
|
"real ohms",
|
|
18826
18924
|
"100ohm"
|
|
18827
18925
|
);
|
|
18828
|
-
var pcbReturnCurrentExcitationProps =
|
|
18829
|
-
name:
|
|
18926
|
+
var pcbReturnCurrentExcitationProps = z110.object({
|
|
18927
|
+
name: z110.string().trim().min(1).optional(),
|
|
18830
18928
|
source: selector,
|
|
18831
18929
|
load: selector,
|
|
18832
18930
|
ground: selector,
|
|
@@ -18842,10 +18940,10 @@ var pcbReturnCurrentExcitationProps = z106.object({
|
|
|
18842
18940
|
expectTypesMatch(true);
|
|
18843
18941
|
|
|
18844
18942
|
// lib/components/pcb-return-current-simulation.ts
|
|
18845
|
-
import { z as
|
|
18846
|
-
var pcbReturnCurrentSimulationProps =
|
|
18847
|
-
name:
|
|
18848
|
-
children:
|
|
18943
|
+
import { z as z111 } from "zod";
|
|
18944
|
+
var pcbReturnCurrentSimulationProps = z111.object({
|
|
18945
|
+
name: z111.string().trim().min(1).optional(),
|
|
18946
|
+
children: z111.custom().optional()
|
|
18849
18947
|
}).strict();
|
|
18850
18948
|
expectTypesMatch(true);
|
|
18851
18949
|
|
|
@@ -18863,43 +18961,43 @@ import {
|
|
|
18863
18961
|
resistance as resistance4,
|
|
18864
18962
|
voltage as voltage4
|
|
18865
18963
|
} from "circuit-json";
|
|
18866
|
-
import { z as
|
|
18867
|
-
var resistanceSweepQuantity = resistance4.pipe(
|
|
18868
|
-
var capacitanceSweepQuantity = capacitance4.pipe(
|
|
18869
|
-
var inductanceSweepQuantity = inductance.pipe(
|
|
18870
|
-
var voltageSweepQuantity = voltage4.pipe(
|
|
18871
|
-
var currentSweepQuantity = current2.pipe(
|
|
18964
|
+
import { z as z112 } from "zod";
|
|
18965
|
+
var resistanceSweepQuantity = resistance4.pipe(z112.number());
|
|
18966
|
+
var capacitanceSweepQuantity = capacitance4.pipe(z112.number());
|
|
18967
|
+
var inductanceSweepQuantity = inductance.pipe(z112.number());
|
|
18968
|
+
var voltageSweepQuantity = voltage4.pipe(z112.number());
|
|
18969
|
+
var currentSweepQuantity = current2.pipe(z112.number());
|
|
18872
18970
|
var createAnalogSweepCoordinateProps = (sweepQuantity) => ({
|
|
18873
|
-
name:
|
|
18874
|
-
values:
|
|
18971
|
+
name: z112.string().optional(),
|
|
18972
|
+
values: z112.array(sweepQuantity).min(1).optional(),
|
|
18875
18973
|
start: sweepQuantity.optional(),
|
|
18876
18974
|
stop: sweepQuantity.optional(),
|
|
18877
18975
|
step: sweepQuantity.optional()
|
|
18878
18976
|
});
|
|
18879
|
-
var analogResistanceSweepParameterProps =
|
|
18977
|
+
var analogResistanceSweepParameterProps = z112.object({
|
|
18880
18978
|
...createAnalogSweepCoordinateProps(resistanceSweepQuantity),
|
|
18881
|
-
parameterType:
|
|
18882
|
-
resistorRef:
|
|
18979
|
+
parameterType: z112.literal("resistance"),
|
|
18980
|
+
resistorRef: z112.string().min(1)
|
|
18883
18981
|
}).strict();
|
|
18884
|
-
var analogCapacitanceSweepParameterProps =
|
|
18982
|
+
var analogCapacitanceSweepParameterProps = z112.object({
|
|
18885
18983
|
...createAnalogSweepCoordinateProps(capacitanceSweepQuantity),
|
|
18886
|
-
parameterType:
|
|
18887
|
-
capacitorRef:
|
|
18984
|
+
parameterType: z112.literal("capacitance"),
|
|
18985
|
+
capacitorRef: z112.string().min(1)
|
|
18888
18986
|
}).strict();
|
|
18889
|
-
var analogInductanceSweepParameterProps =
|
|
18987
|
+
var analogInductanceSweepParameterProps = z112.object({
|
|
18890
18988
|
...createAnalogSweepCoordinateProps(inductanceSweepQuantity),
|
|
18891
|
-
parameterType:
|
|
18892
|
-
inductorRef:
|
|
18989
|
+
parameterType: z112.literal("inductance"),
|
|
18990
|
+
inductorRef: z112.string().min(1)
|
|
18893
18991
|
}).strict();
|
|
18894
|
-
var analogVoltageSweepParameterProps =
|
|
18992
|
+
var analogVoltageSweepParameterProps = z112.object({
|
|
18895
18993
|
...createAnalogSweepCoordinateProps(voltageSweepQuantity),
|
|
18896
|
-
parameterType:
|
|
18897
|
-
net:
|
|
18994
|
+
parameterType: z112.literal("voltage"),
|
|
18995
|
+
net: z112.string().min(1)
|
|
18898
18996
|
}).strict();
|
|
18899
|
-
var analogCurrentSweepParameterProps =
|
|
18997
|
+
var analogCurrentSweepParameterProps = z112.object({
|
|
18900
18998
|
...createAnalogSweepCoordinateProps(currentSweepQuantity),
|
|
18901
|
-
parameterType:
|
|
18902
|
-
currentSourceRef:
|
|
18999
|
+
parameterType: z112.literal("current"),
|
|
19000
|
+
currentSourceRef: z112.string().min(1)
|
|
18903
19001
|
}).strict();
|
|
18904
19002
|
var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
18905
19003
|
const hasExplicitSweepCoordinates = sweepCoordinates.values !== void 0;
|
|
@@ -18911,34 +19009,34 @@ var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
|
18911
19009
|
const hasRangeCoordinates = rangeCoordinateCount > 0;
|
|
18912
19010
|
if (hasExplicitSweepCoordinates === hasRangeCoordinates) {
|
|
18913
19011
|
context.addIssue({
|
|
18914
|
-
code:
|
|
19012
|
+
code: z112.ZodIssueCode.custom,
|
|
18915
19013
|
message: "Provide either values or start/stop/step"
|
|
18916
19014
|
});
|
|
18917
19015
|
return;
|
|
18918
19016
|
}
|
|
18919
19017
|
if (rangeCoordinateCount !== 0 && rangeCoordinateCount !== 3) {
|
|
18920
19018
|
context.addIssue({
|
|
18921
|
-
code:
|
|
19019
|
+
code: z112.ZodIssueCode.custom,
|
|
18922
19020
|
message: "start, stop, and step must be provided together"
|
|
18923
19021
|
});
|
|
18924
19022
|
return;
|
|
18925
19023
|
}
|
|
18926
19024
|
if (sweepCoordinates.step === 0) {
|
|
18927
19025
|
context.addIssue({
|
|
18928
|
-
code:
|
|
19026
|
+
code: z112.ZodIssueCode.custom,
|
|
18929
19027
|
path: ["step"],
|
|
18930
19028
|
message: "step must be nonzero"
|
|
18931
19029
|
});
|
|
18932
19030
|
}
|
|
18933
19031
|
if (sweepCoordinates.start !== void 0 && sweepCoordinates.stop !== void 0 && sweepCoordinates.step !== void 0 && Math.sign(sweepCoordinates.stop - sweepCoordinates.start) !== Math.sign(sweepCoordinates.step)) {
|
|
18934
19032
|
context.addIssue({
|
|
18935
|
-
code:
|
|
19033
|
+
code: z112.ZodIssueCode.custom,
|
|
18936
19034
|
path: ["step"],
|
|
18937
19035
|
message: "step must move from start toward stop"
|
|
18938
19036
|
});
|
|
18939
19037
|
}
|
|
18940
19038
|
};
|
|
18941
|
-
var analogSweepParameterProps =
|
|
19039
|
+
var analogSweepParameterProps = z112.discriminatedUnion("parameterType", [
|
|
18942
19040
|
analogResistanceSweepParameterProps,
|
|
18943
19041
|
analogCapacitanceSweepParameterProps,
|
|
18944
19042
|
analogInductanceSweepParameterProps,
|
|
@@ -18953,26 +19051,26 @@ expectTypesMatch(true);
|
|
|
18953
19051
|
expectTypesMatch(true);
|
|
18954
19052
|
|
|
18955
19053
|
// lib/components/autoroutingphase.ts
|
|
18956
|
-
import { z as
|
|
18957
|
-
var autoroutingPhaseProps =
|
|
18958
|
-
key:
|
|
18959
|
-
name:
|
|
19054
|
+
import { z as z113 } from "zod";
|
|
19055
|
+
var autoroutingPhaseProps = z113.object({
|
|
19056
|
+
key: z113.any().optional(),
|
|
19057
|
+
name: z113.string().optional(),
|
|
18960
19058
|
autorouter: autorouterProp.optional(),
|
|
18961
19059
|
algorithmFn: autorouterConfig.shape.algorithmFn,
|
|
18962
19060
|
preflightRoutingCheckPolicy: preflightRoutingCheckPolicy.optional(),
|
|
18963
|
-
phaseIndex:
|
|
18964
|
-
pcbTracePaths:
|
|
19061
|
+
phaseIndex: z113.number().optional(),
|
|
19062
|
+
pcbTracePaths: z113.array(fanoutTracePath).optional(),
|
|
18965
19063
|
...routingTolerances.shape,
|
|
18966
|
-
region:
|
|
18967
|
-
shape:
|
|
18968
|
-
minX:
|
|
18969
|
-
maxX:
|
|
18970
|
-
minY:
|
|
18971
|
-
maxY:
|
|
19064
|
+
region: z113.object({
|
|
19065
|
+
shape: z113.literal("rect").optional(),
|
|
19066
|
+
minX: z113.number(),
|
|
19067
|
+
maxX: z113.number(),
|
|
19068
|
+
minY: z113.number(),
|
|
19069
|
+
maxY: z113.number()
|
|
18972
19070
|
}).optional(),
|
|
18973
|
-
connection:
|
|
18974
|
-
connections:
|
|
18975
|
-
reroute:
|
|
19071
|
+
connection: z113.string().optional(),
|
|
19072
|
+
connections: z113.array(z113.string()).optional(),
|
|
19073
|
+
reroute: z113.boolean().optional(),
|
|
18976
19074
|
...fanoutProps.shape
|
|
18977
19075
|
}).superRefine((value, ctx) => {
|
|
18978
19076
|
const isSimplifyAutorouter = value.autorouter === "simplify" || typeof value.autorouter === "object" && value.autorouter?.preset === "simplify";
|
|
@@ -18983,7 +19081,7 @@ var autoroutingPhaseProps = z109.object({
|
|
|
18983
19081
|
}
|
|
18984
19082
|
if (value.reroute !== void 0 && !(isSimplifyAutorouter && value.reroute === true) && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
18985
19083
|
ctx.addIssue({
|
|
18986
|
-
code:
|
|
19084
|
+
code: z113.ZodIssueCode.custom,
|
|
18987
19085
|
message: "region, connection, or connections is required when reroute is provided",
|
|
18988
19086
|
path: ["region"]
|
|
18989
19087
|
});
|
|
@@ -18992,15 +19090,15 @@ var autoroutingPhaseProps = z109.object({
|
|
|
18992
19090
|
expectTypesMatch(true);
|
|
18993
19091
|
|
|
18994
19092
|
// lib/components/spicemodel.ts
|
|
18995
|
-
import { z as
|
|
18996
|
-
var spicemodelProps =
|
|
18997
|
-
source:
|
|
18998
|
-
spicePinMapping:
|
|
19093
|
+
import { z as z114 } from "zod";
|
|
19094
|
+
var spicemodelProps = z114.object({
|
|
19095
|
+
source: z114.string(),
|
|
19096
|
+
spicePinMapping: z114.record(z114.string(), z114.string()).optional()
|
|
18999
19097
|
});
|
|
19000
19098
|
expectTypesMatch(true);
|
|
19001
19099
|
|
|
19002
19100
|
// lib/components/transistor.ts
|
|
19003
|
-
import { z as
|
|
19101
|
+
import { z as z115 } from "zod";
|
|
19004
19102
|
var transistorPinsLabels = [
|
|
19005
19103
|
"pin1",
|
|
19006
19104
|
"pin2",
|
|
@@ -19013,7 +19111,7 @@ var transistorPinsLabels = [
|
|
|
19013
19111
|
"drain"
|
|
19014
19112
|
];
|
|
19015
19113
|
var transistorProps = commonComponentProps.extend({
|
|
19016
|
-
type:
|
|
19114
|
+
type: z115.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
19017
19115
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
19018
19116
|
});
|
|
19019
19117
|
var transistorPins = [
|
|
@@ -19027,7 +19125,7 @@ var transistorPins = [
|
|
|
19027
19125
|
expectTypesMatch(true);
|
|
19028
19126
|
|
|
19029
19127
|
// lib/components/mosfet.ts
|
|
19030
|
-
import { z as
|
|
19128
|
+
import { z as z116 } from "zod";
|
|
19031
19129
|
var mosfetPins = [
|
|
19032
19130
|
"pin1",
|
|
19033
19131
|
"drain",
|
|
@@ -19037,11 +19135,11 @@ var mosfetPins = [
|
|
|
19037
19135
|
"gate"
|
|
19038
19136
|
];
|
|
19039
19137
|
var mosfetProps = commonComponentProps.extend({
|
|
19040
|
-
channelType:
|
|
19041
|
-
mosfetMode:
|
|
19042
|
-
symbolDrainSide:
|
|
19043
|
-
symbolSourceSide:
|
|
19044
|
-
symbolGateSide:
|
|
19138
|
+
channelType: z116.enum(["n", "p"]),
|
|
19139
|
+
mosfetMode: z116.enum(["enhancement", "depletion"]),
|
|
19140
|
+
symbolDrainSide: z116.enum(["left", "right", "top", "bottom"]).optional(),
|
|
19141
|
+
symbolSourceSide: z116.enum(["left", "right", "top", "bottom"]).optional(),
|
|
19142
|
+
symbolGateSide: z116.enum(["left", "right", "top", "bottom"]).optional(),
|
|
19045
19143
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
19046
19144
|
});
|
|
19047
19145
|
expectTypesMatch(true);
|
|
@@ -19063,29 +19161,29 @@ expectTypesMatch(true);
|
|
|
19063
19161
|
|
|
19064
19162
|
// lib/components/inductor.ts
|
|
19065
19163
|
import { inductance as inductance2 } from "circuit-json";
|
|
19066
|
-
import { z as
|
|
19164
|
+
import { z as z118 } from "zod";
|
|
19067
19165
|
var inductorPins = lrPins;
|
|
19068
19166
|
var inductorProps = commonComponentProps.extend({
|
|
19069
19167
|
inductance: inductance2,
|
|
19070
|
-
maxCurrentRating:
|
|
19168
|
+
maxCurrentRating: z118.union([z118.string(), z118.number()]).optional(),
|
|
19071
19169
|
schOrientation: schematicOrientation.optional(),
|
|
19072
19170
|
connections: createConnectionsProp(inductorPins).optional()
|
|
19073
19171
|
});
|
|
19074
19172
|
expectTypesMatch(true);
|
|
19075
19173
|
|
|
19076
19174
|
// lib/components/internal-circuit.ts
|
|
19077
|
-
import { z as
|
|
19078
|
-
var internalCircuitProps =
|
|
19079
|
-
children:
|
|
19175
|
+
import { z as z119 } from "zod";
|
|
19176
|
+
var internalCircuitProps = z119.object({
|
|
19177
|
+
children: z119.custom().optional()
|
|
19080
19178
|
});
|
|
19081
19179
|
expectTypesMatch(
|
|
19082
19180
|
true
|
|
19083
19181
|
);
|
|
19084
19182
|
|
|
19085
19183
|
// lib/components/diode.ts
|
|
19086
|
-
import { z as
|
|
19184
|
+
import { z as z120 } from "zod";
|
|
19087
19185
|
var diodePins = lrPolarPins;
|
|
19088
|
-
var diodeConnectionKeys =
|
|
19186
|
+
var diodeConnectionKeys = z120.enum([
|
|
19089
19187
|
"anode",
|
|
19090
19188
|
"cathode",
|
|
19091
19189
|
"pin1",
|
|
@@ -19093,13 +19191,13 @@ var diodeConnectionKeys = z116.enum([
|
|
|
19093
19191
|
"pos",
|
|
19094
19192
|
"neg"
|
|
19095
19193
|
]);
|
|
19096
|
-
var connectionTarget3 =
|
|
19097
|
-
var connectionsProp2 =
|
|
19098
|
-
var diodePinLabelsProp =
|
|
19099
|
-
|
|
19100
|
-
schematicPinLabel.or(
|
|
19194
|
+
var connectionTarget3 = z120.string().or(z120.array(z120.string()).readonly()).or(z120.array(z120.string()));
|
|
19195
|
+
var connectionsProp2 = z120.record(diodeConnectionKeys, connectionTarget3);
|
|
19196
|
+
var diodePinLabelsProp = z120.record(
|
|
19197
|
+
z120.enum(diodePins),
|
|
19198
|
+
schematicPinLabel.or(z120.array(schematicPinLabel).readonly()).or(z120.array(schematicPinLabel))
|
|
19101
19199
|
);
|
|
19102
|
-
var diodeVariant =
|
|
19200
|
+
var diodeVariant = z120.enum([
|
|
19103
19201
|
"standard",
|
|
19104
19202
|
"schottky",
|
|
19105
19203
|
"zener",
|
|
@@ -19110,12 +19208,12 @@ var diodeVariant = z116.enum([
|
|
|
19110
19208
|
var diodeProps = commonComponentProps.extend({
|
|
19111
19209
|
connections: connectionsProp2.optional(),
|
|
19112
19210
|
variant: diodeVariant.optional().default("standard"),
|
|
19113
|
-
standard:
|
|
19114
|
-
schottky:
|
|
19115
|
-
zener:
|
|
19116
|
-
avalanche:
|
|
19117
|
-
photo:
|
|
19118
|
-
tvs:
|
|
19211
|
+
standard: z120.boolean().optional(),
|
|
19212
|
+
schottky: z120.boolean().optional(),
|
|
19213
|
+
zener: z120.boolean().optional(),
|
|
19214
|
+
avalanche: z120.boolean().optional(),
|
|
19215
|
+
photo: z120.boolean().optional(),
|
|
19216
|
+
tvs: z120.boolean().optional(),
|
|
19119
19217
|
schOrientation: schematicOrientation.optional(),
|
|
19120
19218
|
schSize: schematicSymbolSize.optional(),
|
|
19121
19219
|
pinLabels: diodePinLabelsProp.optional()
|
|
@@ -19130,11 +19228,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
19130
19228
|
].filter(Boolean).length;
|
|
19131
19229
|
if (enabledFlags > 1) {
|
|
19132
19230
|
ctx.addIssue({
|
|
19133
|
-
code:
|
|
19231
|
+
code: z120.ZodIssueCode.custom,
|
|
19134
19232
|
message: "Exactly one diode variant must be enabled",
|
|
19135
19233
|
path: []
|
|
19136
19234
|
});
|
|
19137
|
-
return
|
|
19235
|
+
return z120.INVALID;
|
|
19138
19236
|
}
|
|
19139
19237
|
}).transform((data) => {
|
|
19140
19238
|
const result = {
|
|
@@ -19180,18 +19278,18 @@ var diodeProps = commonComponentProps.extend({
|
|
|
19180
19278
|
expectTypesMatch(true);
|
|
19181
19279
|
|
|
19182
19280
|
// lib/components/led.ts
|
|
19183
|
-
import { z as
|
|
19184
|
-
var legacyNumericLedPinLabelsProp =
|
|
19185
|
-
|
|
19186
|
-
schematicPinLabel.or(
|
|
19281
|
+
import { z as z121 } from "zod";
|
|
19282
|
+
var legacyNumericLedPinLabelsProp = z121.record(
|
|
19283
|
+
z121.enum(["1", "2"]),
|
|
19284
|
+
schematicPinLabel.or(z121.array(schematicPinLabel).readonly()).or(z121.array(schematicPinLabel))
|
|
19187
19285
|
).transform((pinLabels) => ({
|
|
19188
19286
|
...pinLabels["1"] === void 0 ? {} : { pin1: pinLabels["1"] },
|
|
19189
19287
|
...pinLabels["2"] === void 0 ? {} : { pin2: pinLabels["2"] }
|
|
19190
19288
|
}));
|
|
19191
19289
|
var ledProps = commonComponentProps.extend({
|
|
19192
|
-
color:
|
|
19193
|
-
wavelength:
|
|
19194
|
-
schDisplayValue:
|
|
19290
|
+
color: z121.string().optional(),
|
|
19291
|
+
wavelength: z121.string().optional(),
|
|
19292
|
+
schDisplayValue: z121.string().optional(),
|
|
19195
19293
|
schOrientation: schematicOrientation.optional(),
|
|
19196
19294
|
/** Select a compact schematic symbol; omitted, default, and md retain the standard symbol. */
|
|
19197
19295
|
schSize: schematicSymbolSize.optional(),
|
|
@@ -19199,28 +19297,28 @@ var ledProps = commonComponentProps.extend({
|
|
|
19199
19297
|
// wrappers, then normalized to the canonical pin1/pin2 representation.
|
|
19200
19298
|
pinLabels: diodePinLabelsProp.or(legacyNumericLedPinLabelsProp).optional(),
|
|
19201
19299
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
19202
|
-
laser:
|
|
19300
|
+
laser: z121.boolean().optional()
|
|
19203
19301
|
});
|
|
19204
19302
|
var ledPins = lrPolarPins;
|
|
19205
19303
|
|
|
19206
19304
|
// lib/components/switch.ts
|
|
19207
|
-
import { ms as
|
|
19208
|
-
import { z as
|
|
19305
|
+
import { ms as ms5, frequency as frequency4 } from "circuit-json";
|
|
19306
|
+
import { z as z122 } from "zod";
|
|
19209
19307
|
var switchProps = commonComponentProps.extend({
|
|
19210
|
-
type:
|
|
19211
|
-
isNormallyClosed:
|
|
19212
|
-
spst:
|
|
19213
|
-
spdt:
|
|
19214
|
-
dpst:
|
|
19215
|
-
dpdt:
|
|
19308
|
+
type: z122.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
19309
|
+
isNormallyClosed: z122.boolean().optional().default(false),
|
|
19310
|
+
spst: z122.boolean().optional(),
|
|
19311
|
+
spdt: z122.boolean().optional(),
|
|
19312
|
+
dpst: z122.boolean().optional(),
|
|
19313
|
+
dpdt: z122.boolean().optional(),
|
|
19216
19314
|
pinLabels: pinLabelsProp.optional(),
|
|
19217
19315
|
noConnect: noConnectProp.optional(),
|
|
19218
19316
|
simSwitchFrequency: frequency4.optional(),
|
|
19219
|
-
simCloseAt:
|
|
19220
|
-
simOpenAt:
|
|
19221
|
-
simStartClosed:
|
|
19222
|
-
simStartOpen:
|
|
19223
|
-
connections:
|
|
19317
|
+
simCloseAt: ms5.optional(),
|
|
19318
|
+
simOpenAt: ms5.optional(),
|
|
19319
|
+
simStartClosed: z122.boolean().optional(),
|
|
19320
|
+
simStartOpen: z122.boolean().optional(),
|
|
19321
|
+
connections: z122.custom().pipe(z122.record(z122.string(), connectionTarget)).optional()
|
|
19224
19322
|
}).transform((props) => {
|
|
19225
19323
|
const updatedProps = { ...props };
|
|
19226
19324
|
if (updatedProps.dpdt) {
|
|
@@ -19252,33 +19350,33 @@ expectTypesMatch(true);
|
|
|
19252
19350
|
|
|
19253
19351
|
// lib/components/fabrication-note-text.ts
|
|
19254
19352
|
import { length as length4 } from "circuit-json";
|
|
19255
|
-
import { z as
|
|
19353
|
+
import { z as z123 } from "zod";
|
|
19256
19354
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
19257
|
-
text:
|
|
19258
|
-
anchorAlignment:
|
|
19259
|
-
font:
|
|
19355
|
+
text: z123.string(),
|
|
19356
|
+
anchorAlignment: z123.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
19357
|
+
font: z123.enum(["tscircuit2024"]).optional(),
|
|
19260
19358
|
fontSize: length4.optional(),
|
|
19261
|
-
color:
|
|
19359
|
+
color: z123.string().optional()
|
|
19262
19360
|
});
|
|
19263
19361
|
expectTypesMatch(true);
|
|
19264
19362
|
|
|
19265
19363
|
// lib/components/fabrication-note-rect.ts
|
|
19266
19364
|
import { distance as distance25 } from "circuit-json";
|
|
19267
|
-
import { z as
|
|
19365
|
+
import { z as z124 } from "zod";
|
|
19268
19366
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19269
19367
|
width: distance25,
|
|
19270
19368
|
height: distance25,
|
|
19271
19369
|
strokeWidth: distance25.optional(),
|
|
19272
|
-
isFilled:
|
|
19273
|
-
hasStroke:
|
|
19274
|
-
isStrokeDashed:
|
|
19275
|
-
color:
|
|
19370
|
+
isFilled: z124.boolean().optional(),
|
|
19371
|
+
hasStroke: z124.boolean().optional(),
|
|
19372
|
+
isStrokeDashed: z124.boolean().optional(),
|
|
19373
|
+
color: z124.string().optional(),
|
|
19276
19374
|
cornerRadius: distance25.optional()
|
|
19277
19375
|
});
|
|
19278
19376
|
|
|
19279
19377
|
// lib/components/fabrication-note-path.ts
|
|
19280
19378
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
19281
|
-
import { z as
|
|
19379
|
+
import { z as z125 } from "zod";
|
|
19282
19380
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
19283
19381
|
pcbLeftEdgeX: true,
|
|
19284
19382
|
pcbRightEdgeX: true,
|
|
@@ -19290,19 +19388,19 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
19290
19388
|
pcbOffsetY: true,
|
|
19291
19389
|
pcbRotation: true
|
|
19292
19390
|
}).extend({
|
|
19293
|
-
route:
|
|
19391
|
+
route: z125.array(route_hint_point3),
|
|
19294
19392
|
strokeWidth: length5.optional(),
|
|
19295
|
-
color:
|
|
19393
|
+
color: z125.string().optional(),
|
|
19296
19394
|
/** Fill the route, closing its boundary implicitly. Omitted means false. */
|
|
19297
|
-
isFilled:
|
|
19395
|
+
isFilled: z125.boolean().optional(),
|
|
19298
19396
|
/** Draw the route's outline. Omitted means true; false disables it. */
|
|
19299
|
-
hasStroke:
|
|
19397
|
+
hasStroke: z125.boolean().optional()
|
|
19300
19398
|
});
|
|
19301
19399
|
|
|
19302
19400
|
// lib/components/fabrication-note-dimension.ts
|
|
19303
19401
|
import { distance as distance26, length as length6 } from "circuit-json";
|
|
19304
|
-
import { z as
|
|
19305
|
-
var dimensionTarget =
|
|
19402
|
+
import { z as z126 } from "zod";
|
|
19403
|
+
var dimensionTarget = z126.union([z126.string(), point]);
|
|
19306
19404
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
19307
19405
|
pcbLeftEdgeX: true,
|
|
19308
19406
|
pcbRightEdgeX: true,
|
|
@@ -19316,44 +19414,44 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
19316
19414
|
}).extend({
|
|
19317
19415
|
from: dimensionTarget,
|
|
19318
19416
|
to: dimensionTarget,
|
|
19319
|
-
text:
|
|
19417
|
+
text: z126.string().optional(),
|
|
19320
19418
|
offset: distance26.optional(),
|
|
19321
|
-
offsetDirection:
|
|
19322
|
-
font:
|
|
19419
|
+
offsetDirection: z126.object({ x: z126.number().finite(), y: z126.number().finite() }).optional(),
|
|
19420
|
+
font: z126.enum(["tscircuit2024"]).optional(),
|
|
19323
19421
|
fontSize: length6.optional(),
|
|
19324
|
-
color:
|
|
19422
|
+
color: z126.string().optional(),
|
|
19325
19423
|
arrowSize: distance26.optional(),
|
|
19326
|
-
units:
|
|
19327
|
-
outerEdgeToEdge:
|
|
19328
|
-
centerToCenter:
|
|
19329
|
-
innerEdgeToEdge:
|
|
19424
|
+
units: z126.enum(["in", "mm"]).optional(),
|
|
19425
|
+
outerEdgeToEdge: z126.literal(true).optional(),
|
|
19426
|
+
centerToCenter: z126.literal(true).optional(),
|
|
19427
|
+
innerEdgeToEdge: z126.literal(true).optional()
|
|
19330
19428
|
});
|
|
19331
19429
|
expectTypesMatch(true);
|
|
19332
19430
|
|
|
19333
19431
|
// lib/components/pcb-trace.ts
|
|
19334
19432
|
import { distance as distance27, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
19335
|
-
import { z as
|
|
19336
|
-
var pcbTraceProps =
|
|
19337
|
-
layer:
|
|
19433
|
+
import { z as z127 } from "zod";
|
|
19434
|
+
var pcbTraceProps = z127.object({
|
|
19435
|
+
layer: z127.string().optional(),
|
|
19338
19436
|
thickness: distance27.optional(),
|
|
19339
|
-
route:
|
|
19437
|
+
route: z127.array(route_hint_point4)
|
|
19340
19438
|
});
|
|
19341
19439
|
|
|
19342
19440
|
// lib/components/via.ts
|
|
19343
19441
|
import { distance as distance28, layer_ref as layer_ref10 } from "circuit-json";
|
|
19344
|
-
import { z as
|
|
19442
|
+
import { z as z128 } from "zod";
|
|
19345
19443
|
var viaProps = commonLayoutProps.extend({
|
|
19346
|
-
name:
|
|
19444
|
+
name: z128.string().optional(),
|
|
19347
19445
|
fromLayer: layer_ref10.optional(),
|
|
19348
19446
|
toLayer: layer_ref10.optional(),
|
|
19349
19447
|
holeDiameter: distance28.optional(),
|
|
19350
19448
|
outerDiameter: distance28.optional(),
|
|
19351
|
-
layers:
|
|
19352
|
-
connectsTo:
|
|
19353
|
-
netIsAssignable:
|
|
19354
|
-
tented:
|
|
19355
|
-
|
|
19356
|
-
|
|
19449
|
+
layers: z128.array(layer_ref10).optional(),
|
|
19450
|
+
connectsTo: z128.string().or(z128.array(z128.string())).optional(),
|
|
19451
|
+
netIsAssignable: z128.boolean().optional(),
|
|
19452
|
+
tented: z128.union([
|
|
19453
|
+
z128.boolean(),
|
|
19454
|
+
z128.enum([
|
|
19357
19455
|
"both_sides",
|
|
19358
19456
|
"top_and_bottom_tented",
|
|
19359
19457
|
"top_tented",
|
|
@@ -19372,15 +19470,15 @@ expectTypesMatch(true);
|
|
|
19372
19470
|
|
|
19373
19471
|
// lib/components/testpoint.ts
|
|
19374
19472
|
import { distance as distance29 } from "circuit-json";
|
|
19375
|
-
import { z as
|
|
19473
|
+
import { z as z129 } from "zod";
|
|
19376
19474
|
var testpointPins = ["pin1"];
|
|
19377
|
-
var testpointConnectionsProp =
|
|
19475
|
+
var testpointConnectionsProp = z129.object({
|
|
19378
19476
|
pin1: connectionTarget
|
|
19379
19477
|
}).strict();
|
|
19380
19478
|
var testpointProps = commonComponentProps.extend({
|
|
19381
19479
|
connections: testpointConnectionsProp.optional(),
|
|
19382
|
-
footprintVariant:
|
|
19383
|
-
padShape:
|
|
19480
|
+
footprintVariant: z129.enum(["pad", "through_hole"]).optional(),
|
|
19481
|
+
padShape: z129.enum(["rect", "circle"]).optional().default("circle"),
|
|
19384
19482
|
padDiameter: distance29.optional(),
|
|
19385
19483
|
holeDiameter: distance29.optional(),
|
|
19386
19484
|
width: distance29.optional(),
|
|
@@ -19392,42 +19490,42 @@ var testpointProps = commonComponentProps.extend({
|
|
|
19392
19490
|
expectTypesMatch(true);
|
|
19393
19491
|
|
|
19394
19492
|
// lib/components/breakoutpoint.ts
|
|
19395
|
-
import { z as
|
|
19493
|
+
import { z as z130 } from "zod";
|
|
19396
19494
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
19397
|
-
connection:
|
|
19495
|
+
connection: z130.string()
|
|
19398
19496
|
});
|
|
19399
19497
|
expectTypesMatch(true);
|
|
19400
19498
|
|
|
19401
19499
|
// lib/components/pcb-keepout.ts
|
|
19402
19500
|
import { distance as distance30, layer_ref as layer_ref11 } from "circuit-json";
|
|
19403
|
-
import { z as
|
|
19404
|
-
var pcbKeepoutProps =
|
|
19501
|
+
import { z as z131 } from "zod";
|
|
19502
|
+
var pcbKeepoutProps = z131.union([
|
|
19405
19503
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19406
|
-
shape:
|
|
19504
|
+
shape: z131.literal("circle"),
|
|
19407
19505
|
radius: distance30,
|
|
19408
|
-
layers:
|
|
19506
|
+
layers: z131.array(layer_ref11).optional(),
|
|
19409
19507
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
19410
|
-
warningOnly:
|
|
19508
|
+
warningOnly: z131.boolean().optional(),
|
|
19411
19509
|
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19412
|
-
allowTraces:
|
|
19510
|
+
allowTraces: z131.boolean().optional(),
|
|
19413
19511
|
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19414
|
-
allowPlacements:
|
|
19415
|
-
excludeRefs:
|
|
19512
|
+
allowPlacements: z131.boolean().optional(),
|
|
19513
|
+
excludeRefs: z131.array(z131.string()).optional().describe(
|
|
19416
19514
|
'Component selectors excluded from the keepout, such as ".ANT1"'
|
|
19417
19515
|
)
|
|
19418
19516
|
}),
|
|
19419
19517
|
pcbLayoutProps.extend({
|
|
19420
|
-
shape:
|
|
19518
|
+
shape: z131.literal("rect"),
|
|
19421
19519
|
width: distance30,
|
|
19422
19520
|
height: distance30,
|
|
19423
|
-
layers:
|
|
19521
|
+
layers: z131.array(layer_ref11).optional(),
|
|
19424
19522
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
19425
|
-
warningOnly:
|
|
19523
|
+
warningOnly: z131.boolean().optional(),
|
|
19426
19524
|
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19427
|
-
allowTraces:
|
|
19525
|
+
allowTraces: z131.boolean().optional(),
|
|
19428
19526
|
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19429
|
-
allowPlacements:
|
|
19430
|
-
excludeRefs:
|
|
19527
|
+
allowPlacements: z131.boolean().optional(),
|
|
19528
|
+
excludeRefs: z131.array(z131.string()).optional().describe(
|
|
19431
19529
|
'Component selectors excluded from the keepout, such as ".ANT1"'
|
|
19432
19530
|
)
|
|
19433
19531
|
})
|
|
@@ -19435,20 +19533,20 @@ var pcbKeepoutProps = z127.union([
|
|
|
19435
19533
|
|
|
19436
19534
|
// lib/components/courtyard-rect.ts
|
|
19437
19535
|
import { distance as distance31 } from "circuit-json";
|
|
19438
|
-
import { z as
|
|
19536
|
+
import { z as z132 } from "zod";
|
|
19439
19537
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
19440
19538
|
width: distance31,
|
|
19441
19539
|
height: distance31,
|
|
19442
19540
|
strokeWidth: distance31.optional(),
|
|
19443
|
-
isFilled:
|
|
19444
|
-
hasStroke:
|
|
19445
|
-
isStrokeDashed:
|
|
19446
|
-
color:
|
|
19541
|
+
isFilled: z132.boolean().optional(),
|
|
19542
|
+
hasStroke: z132.boolean().optional(),
|
|
19543
|
+
isStrokeDashed: z132.boolean().optional(),
|
|
19544
|
+
color: z132.string().optional()
|
|
19447
19545
|
});
|
|
19448
19546
|
|
|
19449
19547
|
// lib/components/courtyard-outline.ts
|
|
19450
19548
|
import { length as length7 } from "circuit-json";
|
|
19451
|
-
import { z as
|
|
19549
|
+
import { z as z133 } from "zod";
|
|
19452
19550
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
19453
19551
|
pcbLeftEdgeX: true,
|
|
19454
19552
|
pcbRightEdgeX: true,
|
|
@@ -19460,11 +19558,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
19460
19558
|
pcbOffsetY: true,
|
|
19461
19559
|
pcbRotation: true
|
|
19462
19560
|
}).extend({
|
|
19463
|
-
outline:
|
|
19561
|
+
outline: z133.array(point),
|
|
19464
19562
|
strokeWidth: length7.optional(),
|
|
19465
|
-
isClosed:
|
|
19466
|
-
isStrokeDashed:
|
|
19467
|
-
color:
|
|
19563
|
+
isClosed: z133.boolean().optional(),
|
|
19564
|
+
isStrokeDashed: z133.boolean().optional(),
|
|
19565
|
+
color: z133.string().optional()
|
|
19468
19566
|
});
|
|
19469
19567
|
|
|
19470
19568
|
// lib/components/courtyard-circle.ts
|
|
@@ -19484,16 +19582,16 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
19484
19582
|
});
|
|
19485
19583
|
|
|
19486
19584
|
// lib/components/copper-pour.ts
|
|
19487
|
-
import { z as
|
|
19585
|
+
import { z as z136 } from "zod";
|
|
19488
19586
|
import { layer_ref as layer_ref12 } from "circuit-json";
|
|
19489
|
-
var copperPourProps =
|
|
19490
|
-
name:
|
|
19587
|
+
var copperPourProps = z136.object({
|
|
19588
|
+
name: z136.string().optional(),
|
|
19491
19589
|
layer: layer_ref12,
|
|
19492
|
-
connectsTo:
|
|
19493
|
-
crosshatch:
|
|
19494
|
-
crosshatchPitch: distance.pipe(
|
|
19495
|
-
crosshatchWidth: distance.pipe(
|
|
19496
|
-
unbroken:
|
|
19590
|
+
connectsTo: z136.string(),
|
|
19591
|
+
crosshatch: z136.boolean().optional(),
|
|
19592
|
+
crosshatchPitch: distance.pipe(z136.number().finite().positive()).optional(),
|
|
19593
|
+
crosshatchWidth: distance.pipe(z136.number().finite().positive()).optional(),
|
|
19594
|
+
unbroken: z136.boolean().optional().describe(
|
|
19497
19595
|
"Reserves the pour region during autorouting so unrelated traces do not split it. Vias may still cross the region using antipads."
|
|
19498
19596
|
),
|
|
19499
19597
|
padMargin: distance.optional(),
|
|
@@ -19501,13 +19599,13 @@ var copperPourProps = z132.object({
|
|
|
19501
19599
|
clearance: distance.optional(),
|
|
19502
19600
|
boardEdgeMargin: distance.optional(),
|
|
19503
19601
|
cutoutMargin: distance.optional(),
|
|
19504
|
-
useThermalReliefs:
|
|
19505
|
-
outline:
|
|
19506
|
-
coveredWithSolderMask:
|
|
19602
|
+
useThermalReliefs: z136.boolean().optional(),
|
|
19603
|
+
outline: z136.array(point).optional(),
|
|
19604
|
+
coveredWithSolderMask: z136.boolean().optional().default(true)
|
|
19507
19605
|
}).superRefine((props, ctx) => {
|
|
19508
19606
|
if (props.crosshatch && (props.crosshatchWidth ?? 0.25) >= (props.crosshatchPitch ?? 1)) {
|
|
19509
19607
|
ctx.addIssue({
|
|
19510
|
-
code:
|
|
19608
|
+
code: z136.ZodIssueCode.custom,
|
|
19511
19609
|
path: ["crosshatchWidth"],
|
|
19512
19610
|
message: "crosshatchWidth must be less than crosshatchPitch"
|
|
19513
19611
|
});
|
|
@@ -19517,16 +19615,16 @@ expectTypesMatch(true);
|
|
|
19517
19615
|
|
|
19518
19616
|
// lib/components/cadassembly.ts
|
|
19519
19617
|
import { layer_ref as layer_ref13 } from "circuit-json";
|
|
19520
|
-
import { z as
|
|
19521
|
-
var cadassemblyProps =
|
|
19618
|
+
import { z as z137 } from "zod";
|
|
19619
|
+
var cadassemblyProps = z137.object({
|
|
19522
19620
|
originalLayer: layer_ref13.default("top").optional(),
|
|
19523
|
-
children:
|
|
19621
|
+
children: z137.any().optional()
|
|
19524
19622
|
});
|
|
19525
19623
|
expectTypesMatch(true);
|
|
19526
19624
|
|
|
19527
19625
|
// lib/components/cadmodel.ts
|
|
19528
|
-
import { z as
|
|
19529
|
-
var pcbPosition =
|
|
19626
|
+
import { z as z138 } from "zod";
|
|
19627
|
+
var pcbPosition = z138.object({
|
|
19530
19628
|
pcbX: pcbCoordinate.optional(),
|
|
19531
19629
|
pcbY: pcbCoordinate.optional(),
|
|
19532
19630
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -19545,7 +19643,7 @@ var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
|
19545
19643
|
expectTypesMatch(true);
|
|
19546
19644
|
var cadModelInputObject = cadModelBase.extend({
|
|
19547
19645
|
/** Modelprinter specification or HTTP(S) URL; mutually exclusive with modelUrl. */
|
|
19548
|
-
model:
|
|
19646
|
+
model: z138.string().trim().min(1).optional(),
|
|
19549
19647
|
modelUrl: url.optional()
|
|
19550
19648
|
}).merge(pcbPosition).refine(
|
|
19551
19649
|
(props) => props.model === void 0 !== (props.modelUrl === void 0),
|
|
@@ -19558,7 +19656,7 @@ var cadModelInputObject = cadModelBase.extend({
|
|
|
19558
19656
|
modelUrl: model === void 0 ? props.modelUrl : /^https?:\/\//i.test(model) ? model : `https://modelcdn.tscircuit.com/jscad_models/${encodeURIComponent(model)}.glb`
|
|
19559
19657
|
})).pipe(cadModelObject);
|
|
19560
19658
|
expectTypesMatch(true);
|
|
19561
|
-
var cadmodelProps =
|
|
19659
|
+
var cadmodelProps = z138.union([z138.null(), url, cadModelInputObject]);
|
|
19562
19660
|
|
|
19563
19661
|
// lib/components/power-source.ts
|
|
19564
19662
|
import { voltage as voltage5 } from "circuit-json";
|
|
@@ -19567,10 +19665,10 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
19567
19665
|
});
|
|
19568
19666
|
|
|
19569
19667
|
// lib/components/voltagesource.ts
|
|
19570
|
-
import { frequency as frequency5, ms as
|
|
19571
|
-
import { z as
|
|
19668
|
+
import { frequency as frequency5, ms as ms6, rotation as rotation6, voltage as voltage6 } from "circuit-json";
|
|
19669
|
+
import { z as z139 } from "zod";
|
|
19572
19670
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19573
|
-
var percentage =
|
|
19671
|
+
var percentage = z139.union([z139.string(), z139.number()]).transform((val) => {
|
|
19574
19672
|
if (typeof val === "string") {
|
|
19575
19673
|
if (val.endsWith("%")) {
|
|
19576
19674
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -19579,20 +19677,20 @@ var percentage = z135.union([z135.string(), z135.number()]).transform((val) => {
|
|
|
19579
19677
|
}
|
|
19580
19678
|
return val;
|
|
19581
19679
|
}).pipe(
|
|
19582
|
-
|
|
19680
|
+
z139.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
19583
19681
|
);
|
|
19584
19682
|
var voltageSourceProps = commonComponentProps.extend({
|
|
19585
19683
|
voltage: voltage6.optional(),
|
|
19586
19684
|
frequency: frequency5.optional(),
|
|
19587
19685
|
peakToPeakVoltage: voltage6.optional(),
|
|
19588
|
-
waveShape:
|
|
19686
|
+
waveShape: z139.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
19589
19687
|
phase: rotation6.optional(),
|
|
19590
19688
|
dutyCycle: percentage.optional(),
|
|
19591
|
-
pulseDelay:
|
|
19592
|
-
riseTime:
|
|
19593
|
-
fallTime:
|
|
19594
|
-
pulseWidth:
|
|
19595
|
-
period:
|
|
19689
|
+
pulseDelay: ms6.optional(),
|
|
19690
|
+
riseTime: ms6.optional(),
|
|
19691
|
+
fallTime: ms6.optional(),
|
|
19692
|
+
pulseWidth: ms6.optional(),
|
|
19693
|
+
period: ms6.optional(),
|
|
19596
19694
|
acMagnitude: voltage6.optional(),
|
|
19597
19695
|
acPhase: rotation6.optional(),
|
|
19598
19696
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -19602,9 +19700,9 @@ expectTypesMatch(true);
|
|
|
19602
19700
|
|
|
19603
19701
|
// lib/components/currentsource.ts
|
|
19604
19702
|
import { frequency as frequency6, rotation as rotation7, current as current3 } from "circuit-json";
|
|
19605
|
-
import { z as
|
|
19703
|
+
import { z as z140 } from "zod";
|
|
19606
19704
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19607
|
-
var percentage2 =
|
|
19705
|
+
var percentage2 = z140.union([z140.string(), z140.number()]).transform((val) => {
|
|
19608
19706
|
if (typeof val === "string") {
|
|
19609
19707
|
if (val.endsWith("%")) {
|
|
19610
19708
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -19613,13 +19711,13 @@ var percentage2 = z136.union([z136.string(), z136.number()]).transform((val) =>
|
|
|
19613
19711
|
}
|
|
19614
19712
|
return val;
|
|
19615
19713
|
}).pipe(
|
|
19616
|
-
|
|
19714
|
+
z140.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
19617
19715
|
);
|
|
19618
19716
|
var currentSourceProps = commonComponentProps.extend({
|
|
19619
19717
|
current: current3.optional(),
|
|
19620
19718
|
frequency: frequency6.optional(),
|
|
19621
19719
|
peakToPeakCurrent: current3.optional(),
|
|
19622
|
-
waveShape:
|
|
19720
|
+
waveShape: z140.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
19623
19721
|
phase: rotation7.optional(),
|
|
19624
19722
|
dutyCycle: percentage2.optional(),
|
|
19625
19723
|
acMagnitude: current3.optional(),
|
|
@@ -19630,21 +19728,21 @@ var currentSourcePins = lrPolarPins;
|
|
|
19630
19728
|
expectTypesMatch(true);
|
|
19631
19729
|
|
|
19632
19730
|
// lib/components/voltageprobe.ts
|
|
19633
|
-
import { z as
|
|
19731
|
+
import { z as z141 } from "zod";
|
|
19634
19732
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
19635
|
-
name:
|
|
19636
|
-
connectsTo:
|
|
19637
|
-
referenceTo:
|
|
19638
|
-
color:
|
|
19639
|
-
graphDisplayName:
|
|
19640
|
-
graphCenter:
|
|
19641
|
-
graphVerticalOffset:
|
|
19642
|
-
graphVoltagePerDiv:
|
|
19733
|
+
name: z141.string().optional(),
|
|
19734
|
+
connectsTo: z141.string(),
|
|
19735
|
+
referenceTo: z141.string().optional(),
|
|
19736
|
+
color: z141.string().optional(),
|
|
19737
|
+
graphDisplayName: z141.string().optional(),
|
|
19738
|
+
graphCenter: z141.number().optional(),
|
|
19739
|
+
graphVerticalOffset: z141.number().or(z141.string()).optional(),
|
|
19740
|
+
graphVoltagePerDiv: z141.number().or(z141.string()).optional()
|
|
19643
19741
|
});
|
|
19644
19742
|
expectTypesMatch(true);
|
|
19645
19743
|
|
|
19646
19744
|
// lib/components/ammeter.ts
|
|
19647
|
-
import { z as
|
|
19745
|
+
import { z as z142 } from "zod";
|
|
19648
19746
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19649
19747
|
var hasAmmeterConnectionPair = (connections) => {
|
|
19650
19748
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -19654,64 +19752,64 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
19654
19752
|
hasAmmeterConnectionPair,
|
|
19655
19753
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
19656
19754
|
),
|
|
19657
|
-
color:
|
|
19658
|
-
graphDisplayName:
|
|
19659
|
-
graphCenter:
|
|
19660
|
-
graphVerticalOffset:
|
|
19661
|
-
graphCurrentPerDiv:
|
|
19755
|
+
color: z142.string().optional(),
|
|
19756
|
+
graphDisplayName: z142.string().optional(),
|
|
19757
|
+
graphCenter: z142.number().optional(),
|
|
19758
|
+
graphVerticalOffset: z142.number().or(z142.string()).optional(),
|
|
19759
|
+
graphCurrentPerDiv: z142.number().or(z142.string()).optional()
|
|
19662
19760
|
});
|
|
19663
19761
|
var ammeterPins = ammeterPinLabels;
|
|
19664
19762
|
expectTypesMatch(true);
|
|
19665
19763
|
|
|
19666
19764
|
// lib/components/schematic-arc.ts
|
|
19667
19765
|
import { distance as distance34, point as point5, rotation as rotation8 } from "circuit-json";
|
|
19668
|
-
import { z as
|
|
19669
|
-
var schematicArcProps =
|
|
19766
|
+
import { z as z143 } from "zod";
|
|
19767
|
+
var schematicArcProps = z143.object({
|
|
19670
19768
|
center: point5,
|
|
19671
19769
|
radius: distance34,
|
|
19672
19770
|
startAngleDegrees: rotation8,
|
|
19673
19771
|
endAngleDegrees: rotation8,
|
|
19674
|
-
direction:
|
|
19772
|
+
direction: z143.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
19675
19773
|
strokeWidth: distance34.optional(),
|
|
19676
|
-
color:
|
|
19677
|
-
isDashed:
|
|
19774
|
+
color: z143.string().optional(),
|
|
19775
|
+
isDashed: z143.boolean().optional().default(false)
|
|
19678
19776
|
});
|
|
19679
19777
|
expectTypesMatch(true);
|
|
19680
19778
|
|
|
19681
19779
|
// lib/components/toolingrail.ts
|
|
19682
|
-
import { z as
|
|
19683
|
-
var toolingrailProps =
|
|
19684
|
-
children:
|
|
19780
|
+
import { z as z144 } from "zod";
|
|
19781
|
+
var toolingrailProps = z144.object({
|
|
19782
|
+
children: z144.any().optional()
|
|
19685
19783
|
});
|
|
19686
19784
|
expectTypesMatch(true);
|
|
19687
19785
|
|
|
19688
19786
|
// lib/components/schematic-box.ts
|
|
19689
19787
|
import { distance as distance35 } from "circuit-json";
|
|
19690
|
-
import { z as
|
|
19691
|
-
var schematicBoxProps =
|
|
19692
|
-
name:
|
|
19693
|
-
chipRef:
|
|
19788
|
+
import { z as z145 } from "zod";
|
|
19789
|
+
var schematicBoxProps = z145.object({
|
|
19790
|
+
name: z145.string().optional(),
|
|
19791
|
+
chipRef: z145.string().optional(),
|
|
19694
19792
|
pinLabels: pinLabelsProp.optional(),
|
|
19695
19793
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
19696
19794
|
schPinStyle: schematicPinStyle.optional(),
|
|
19697
19795
|
schX: distance35.optional(),
|
|
19698
19796
|
schY: distance35.optional(),
|
|
19699
|
-
schSectionName:
|
|
19700
|
-
schSheetName:
|
|
19797
|
+
schSectionName: z145.string().optional(),
|
|
19798
|
+
schSheetName: z145.string().optional(),
|
|
19701
19799
|
width: distance35.optional(),
|
|
19702
19800
|
height: distance35.optional(),
|
|
19703
|
-
overlay:
|
|
19801
|
+
overlay: z145.array(z145.string()).optional(),
|
|
19704
19802
|
padding: distance35.optional(),
|
|
19705
19803
|
paddingLeft: distance35.optional(),
|
|
19706
19804
|
paddingRight: distance35.optional(),
|
|
19707
19805
|
paddingTop: distance35.optional(),
|
|
19708
19806
|
paddingBottom: distance35.optional(),
|
|
19709
|
-
title:
|
|
19807
|
+
title: z145.string().optional(),
|
|
19710
19808
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
19711
|
-
titleColor:
|
|
19809
|
+
titleColor: z145.string().optional(),
|
|
19712
19810
|
titleFontSize: distance35.optional(),
|
|
19713
|
-
titleInside:
|
|
19714
|
-
strokeStyle:
|
|
19811
|
+
titleInside: z145.boolean().default(false),
|
|
19812
|
+
strokeStyle: z145.enum(["solid", "dashed"]).default("solid")
|
|
19715
19813
|
}).refine(
|
|
19716
19814
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
19717
19815
|
{
|
|
@@ -19727,21 +19825,21 @@ expectTypesMatch(true);
|
|
|
19727
19825
|
|
|
19728
19826
|
// lib/components/schematic-symbol.ts
|
|
19729
19827
|
import { rotation as rotation9 } from "circuit-json";
|
|
19730
|
-
import { z as
|
|
19731
|
-
var schematicSymbolConnections =
|
|
19828
|
+
import { z as z146 } from "zod";
|
|
19829
|
+
var schematicSymbolConnections = z146.custom().pipe(z146.record(z146.string(), connectionTarget)).refine((value) => Object.keys(value).length > 0, {
|
|
19732
19830
|
message: "connections must map at least one schematic symbol port"
|
|
19733
19831
|
});
|
|
19734
|
-
var schematicSymbolProps =
|
|
19735
|
-
name:
|
|
19736
|
-
displayName:
|
|
19737
|
-
chipRef:
|
|
19738
|
-
symbolName:
|
|
19832
|
+
var schematicSymbolProps = z146.object({
|
|
19833
|
+
name: z146.string().min(1),
|
|
19834
|
+
displayName: z146.string().optional(),
|
|
19835
|
+
chipRef: z146.string().min(1).optional(),
|
|
19836
|
+
symbolName: z146.string().min(1),
|
|
19739
19837
|
connections: schematicSymbolConnections.optional(),
|
|
19740
19838
|
schX: distance.optional(),
|
|
19741
19839
|
schY: distance.optional(),
|
|
19742
19840
|
schRotation: rotation9.optional(),
|
|
19743
|
-
schSectionName:
|
|
19744
|
-
schSheetName:
|
|
19841
|
+
schSectionName: z146.string().optional(),
|
|
19842
|
+
schSheetName: z146.string().optional()
|
|
19745
19843
|
});
|
|
19746
19844
|
expectTypesMatch(
|
|
19747
19845
|
true
|
|
@@ -19749,15 +19847,15 @@ expectTypesMatch(
|
|
|
19749
19847
|
|
|
19750
19848
|
// lib/components/schematic-circle.ts
|
|
19751
19849
|
import { distance as distance36, point as point6 } from "circuit-json";
|
|
19752
|
-
import { z as
|
|
19753
|
-
var schematicCircleProps =
|
|
19850
|
+
import { z as z147 } from "zod";
|
|
19851
|
+
var schematicCircleProps = z147.object({
|
|
19754
19852
|
center: point6,
|
|
19755
19853
|
radius: distance36,
|
|
19756
19854
|
strokeWidth: distance36.optional(),
|
|
19757
|
-
color:
|
|
19758
|
-
isFilled:
|
|
19759
|
-
fillColor:
|
|
19760
|
-
isDashed:
|
|
19855
|
+
color: z147.string().optional(),
|
|
19856
|
+
isFilled: z147.boolean().optional().default(false),
|
|
19857
|
+
fillColor: z147.string().optional(),
|
|
19858
|
+
isDashed: z147.boolean().optional().default(false)
|
|
19761
19859
|
});
|
|
19762
19860
|
expectTypesMatch(
|
|
19763
19861
|
true
|
|
@@ -19765,32 +19863,32 @@ expectTypesMatch(
|
|
|
19765
19863
|
|
|
19766
19864
|
// lib/components/schematic-rect.ts
|
|
19767
19865
|
import { distance as distance37, rotation as rotation10 } from "circuit-json";
|
|
19768
|
-
import { z as
|
|
19769
|
-
var schematicRectProps =
|
|
19866
|
+
import { z as z148 } from "zod";
|
|
19867
|
+
var schematicRectProps = z148.object({
|
|
19770
19868
|
schX: distance37.optional(),
|
|
19771
19869
|
schY: distance37.optional(),
|
|
19772
19870
|
width: distance37,
|
|
19773
19871
|
height: distance37,
|
|
19774
19872
|
rotation: rotation10.default(0),
|
|
19775
19873
|
strokeWidth: distance37.optional(),
|
|
19776
|
-
color:
|
|
19777
|
-
isFilled:
|
|
19778
|
-
fillColor:
|
|
19779
|
-
isDashed:
|
|
19874
|
+
color: z148.string().optional(),
|
|
19875
|
+
isFilled: z148.boolean().optional().default(false),
|
|
19876
|
+
fillColor: z148.string().optional(),
|
|
19877
|
+
isDashed: z148.boolean().optional().default(false)
|
|
19780
19878
|
});
|
|
19781
19879
|
expectTypesMatch(true);
|
|
19782
19880
|
|
|
19783
19881
|
// lib/components/schematic-line.ts
|
|
19784
19882
|
import { distance as distance38 } from "circuit-json";
|
|
19785
|
-
import { z as
|
|
19786
|
-
var schematicLineProps =
|
|
19883
|
+
import { z as z149 } from "zod";
|
|
19884
|
+
var schematicLineProps = z149.object({
|
|
19787
19885
|
x1: distance38,
|
|
19788
19886
|
y1: distance38,
|
|
19789
19887
|
x2: distance38,
|
|
19790
19888
|
y2: distance38,
|
|
19791
19889
|
strokeWidth: distance38.optional(),
|
|
19792
|
-
color:
|
|
19793
|
-
isDashed:
|
|
19890
|
+
color: z149.string().optional(),
|
|
19891
|
+
isDashed: z149.boolean().optional().default(false),
|
|
19794
19892
|
dashLength: distance38.optional(),
|
|
19795
19893
|
dashGap: distance38.optional()
|
|
19796
19894
|
});
|
|
@@ -19798,11 +19896,11 @@ expectTypesMatch(true);
|
|
|
19798
19896
|
|
|
19799
19897
|
// lib/components/schematic-text.ts
|
|
19800
19898
|
import { distance as distance39, rotation as rotation11 } from "circuit-json";
|
|
19801
|
-
import { z as
|
|
19899
|
+
import { z as z151 } from "zod";
|
|
19802
19900
|
|
|
19803
19901
|
// lib/common/fivePointAnchor.ts
|
|
19804
|
-
import { z as
|
|
19805
|
-
var fivePointAnchor =
|
|
19902
|
+
import { z as z150 } from "zod";
|
|
19903
|
+
var fivePointAnchor = z150.enum([
|
|
19806
19904
|
"center",
|
|
19807
19905
|
"left",
|
|
19808
19906
|
"right",
|
|
@@ -19811,39 +19909,39 @@ var fivePointAnchor = z146.enum([
|
|
|
19811
19909
|
]);
|
|
19812
19910
|
|
|
19813
19911
|
// lib/components/schematic-text.ts
|
|
19814
|
-
var schematicTextProps =
|
|
19912
|
+
var schematicTextProps = z151.object({
|
|
19815
19913
|
schX: distance39.optional(),
|
|
19816
19914
|
schY: distance39.optional(),
|
|
19817
|
-
text:
|
|
19818
|
-
fontSize:
|
|
19819
|
-
anchor:
|
|
19820
|
-
color:
|
|
19915
|
+
text: z151.string(),
|
|
19916
|
+
fontSize: z151.number().default(1),
|
|
19917
|
+
anchor: z151.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
19918
|
+
color: z151.string().default("#000000"),
|
|
19821
19919
|
schRotation: rotation11.default(0)
|
|
19822
19920
|
});
|
|
19823
19921
|
expectTypesMatch(true);
|
|
19824
19922
|
|
|
19825
19923
|
// lib/components/schematic-path.ts
|
|
19826
19924
|
import { distance as distance40, point as point7 } from "circuit-json";
|
|
19827
|
-
import { z as
|
|
19828
|
-
var schematicPathProps =
|
|
19829
|
-
points:
|
|
19830
|
-
svgPath:
|
|
19925
|
+
import { z as z152 } from "zod";
|
|
19926
|
+
var schematicPathProps = z152.object({
|
|
19927
|
+
points: z152.array(point7).optional(),
|
|
19928
|
+
svgPath: z152.string().optional(),
|
|
19831
19929
|
strokeWidth: distance40.optional(),
|
|
19832
|
-
strokeColor:
|
|
19930
|
+
strokeColor: z152.string().optional(),
|
|
19833
19931
|
dashLength: distance40.optional(),
|
|
19834
19932
|
dashGap: distance40.optional(),
|
|
19835
|
-
isFilled:
|
|
19836
|
-
fillColor:
|
|
19933
|
+
isFilled: z152.boolean().optional().default(false),
|
|
19934
|
+
fillColor: z152.string().optional()
|
|
19837
19935
|
});
|
|
19838
19936
|
expectTypesMatch(true);
|
|
19839
19937
|
|
|
19840
19938
|
// lib/components/schematic-table.ts
|
|
19841
19939
|
import { distance as distance41 } from "circuit-json";
|
|
19842
|
-
import { z as
|
|
19843
|
-
var schematicTableProps =
|
|
19940
|
+
import { z as z153 } from "zod";
|
|
19941
|
+
var schematicTableProps = z153.object({
|
|
19844
19942
|
schX: distance41.optional(),
|
|
19845
19943
|
schY: distance41.optional(),
|
|
19846
|
-
children:
|
|
19944
|
+
children: z153.any().optional(),
|
|
19847
19945
|
cellPadding: distance41.optional(),
|
|
19848
19946
|
borderWidth: distance41.optional(),
|
|
19849
19947
|
anchor: ninePointAnchor.optional(),
|
|
@@ -19853,34 +19951,34 @@ expectTypesMatch(true);
|
|
|
19853
19951
|
|
|
19854
19952
|
// lib/components/schematic-row.ts
|
|
19855
19953
|
import { distance as distance42 } from "circuit-json";
|
|
19856
|
-
import { z as
|
|
19857
|
-
var schematicRowProps =
|
|
19858
|
-
children:
|
|
19954
|
+
import { z as z154 } from "zod";
|
|
19955
|
+
var schematicRowProps = z154.object({
|
|
19956
|
+
children: z154.any().optional(),
|
|
19859
19957
|
height: distance42.optional()
|
|
19860
19958
|
});
|
|
19861
19959
|
expectTypesMatch(true);
|
|
19862
19960
|
|
|
19863
19961
|
// lib/components/schematic-cell.ts
|
|
19864
19962
|
import { distance as distance43 } from "circuit-json";
|
|
19865
|
-
import { z as
|
|
19866
|
-
var schematicCellProps =
|
|
19867
|
-
children:
|
|
19868
|
-
horizontalAlign:
|
|
19869
|
-
verticalAlign:
|
|
19963
|
+
import { z as z155 } from "zod";
|
|
19964
|
+
var schematicCellProps = z155.object({
|
|
19965
|
+
children: z155.string().optional(),
|
|
19966
|
+
horizontalAlign: z155.enum(["left", "center", "right"]).optional(),
|
|
19967
|
+
verticalAlign: z155.enum(["top", "middle", "bottom"]).optional(),
|
|
19870
19968
|
fontSize: distance43.optional(),
|
|
19871
|
-
rowSpan:
|
|
19872
|
-
colSpan:
|
|
19969
|
+
rowSpan: z155.number().optional(),
|
|
19970
|
+
colSpan: z155.number().optional(),
|
|
19873
19971
|
width: distance43.optional(),
|
|
19874
|
-
text:
|
|
19972
|
+
text: z155.string().optional()
|
|
19875
19973
|
});
|
|
19876
19974
|
expectTypesMatch(true);
|
|
19877
19975
|
|
|
19878
19976
|
// lib/components/schematic-section.ts
|
|
19879
19977
|
import { distance as distance44 } from "circuit-json";
|
|
19880
|
-
import { z as
|
|
19881
|
-
var schematicSectionProps =
|
|
19882
|
-
displayName:
|
|
19883
|
-
name:
|
|
19978
|
+
import { z as z156 } from "zod";
|
|
19979
|
+
var schematicSectionProps = z156.object({
|
|
19980
|
+
displayName: z156.string().optional(),
|
|
19981
|
+
name: z156.string(),
|
|
19884
19982
|
sectionTitleFontSize: distance44.optional()
|
|
19885
19983
|
});
|
|
19886
19984
|
expectTypesMatch(
|
|
@@ -19888,30 +19986,30 @@ expectTypesMatch(
|
|
|
19888
19986
|
);
|
|
19889
19987
|
|
|
19890
19988
|
// lib/components/schematic-sheet.ts
|
|
19891
|
-
import { z as
|
|
19989
|
+
import { z as z157 } from "zod";
|
|
19892
19990
|
import { distance as distance45 } from "circuit-json";
|
|
19893
|
-
var schematicSheetProps =
|
|
19894
|
-
name:
|
|
19895
|
-
displayName:
|
|
19896
|
-
sheetIndex:
|
|
19897
|
-
sheetSize:
|
|
19898
|
-
sheetWidth: distance45.pipe(
|
|
19899
|
-
sheetHeight: distance45.pipe(
|
|
19900
|
-
children:
|
|
19991
|
+
var schematicSheetProps = z157.object({
|
|
19992
|
+
name: z157.string().optional(),
|
|
19993
|
+
displayName: z157.string().optional(),
|
|
19994
|
+
sheetIndex: z157.number().optional(),
|
|
19995
|
+
sheetSize: z157.enum(["A4", "ANSI_B"]).default("A4"),
|
|
19996
|
+
sheetWidth: distance45.pipe(z157.number().positive()).optional(),
|
|
19997
|
+
sheetHeight: distance45.pipe(z157.number().positive()).optional(),
|
|
19998
|
+
children: z157.any().optional()
|
|
19901
19999
|
});
|
|
19902
20000
|
expectTypesMatch(true);
|
|
19903
20001
|
|
|
19904
20002
|
// lib/components/schematic-graphic.ts
|
|
19905
|
-
import { z as
|
|
20003
|
+
import { z as z158 } from "zod";
|
|
19906
20004
|
var nonemptyUrl = url.refine((value) => value.trim().length > 0, {
|
|
19907
20005
|
message: "imageUrl cannot be empty"
|
|
19908
20006
|
});
|
|
19909
20007
|
var positiveDistance6 = (fieldName) => distance.refine((value) => Number.isFinite(value) && value > 0, {
|
|
19910
20008
|
message: `${fieldName} must be a positive finite distance`
|
|
19911
20009
|
});
|
|
19912
|
-
var schematicGraphicProps =
|
|
20010
|
+
var schematicGraphicProps = z158.object({
|
|
19913
20011
|
imageUrl: nonemptyUrl.optional(),
|
|
19914
|
-
svgContent:
|
|
20012
|
+
svgContent: z158.string().refine((value) => value.trim().length > 0, {
|
|
19915
20013
|
message: "svgContent cannot be empty"
|
|
19916
20014
|
}).optional(),
|
|
19917
20015
|
width: positiveDistance6("width").optional(),
|
|
@@ -19919,7 +20017,7 @@ var schematicGraphicProps = z154.object({
|
|
|
19919
20017
|
}).superRefine(({ imageUrl, svgContent }, ctx) => {
|
|
19920
20018
|
if (imageUrl === void 0 && svgContent === void 0) {
|
|
19921
20019
|
ctx.addIssue({
|
|
19922
|
-
code:
|
|
20020
|
+
code: z158.ZodIssueCode.custom,
|
|
19923
20021
|
message: "At least one of imageUrl or svgContent is required"
|
|
19924
20022
|
});
|
|
19925
20023
|
}
|
|
@@ -19930,40 +20028,40 @@ expectTypesMatch(
|
|
|
19930
20028
|
|
|
19931
20029
|
// lib/components/copper-text.ts
|
|
19932
20030
|
import { layer_ref as layer_ref14, length as length8 } from "circuit-json";
|
|
19933
|
-
import { z as
|
|
20031
|
+
import { z as z159 } from "zod";
|
|
19934
20032
|
var copperTextProps = pcbLayoutProps.extend({
|
|
19935
|
-
text:
|
|
20033
|
+
text: z159.string(),
|
|
19936
20034
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
19937
|
-
font:
|
|
20035
|
+
font: z159.enum(["tscircuit2024"]).optional(),
|
|
19938
20036
|
fontSize: length8.optional(),
|
|
19939
|
-
layers:
|
|
19940
|
-
knockout:
|
|
19941
|
-
mirrored:
|
|
20037
|
+
layers: z159.array(layer_ref14).optional(),
|
|
20038
|
+
knockout: z159.boolean().optional(),
|
|
20039
|
+
mirrored: z159.boolean().optional()
|
|
19942
20040
|
});
|
|
19943
20041
|
|
|
19944
20042
|
// lib/components/silkscreen-text.ts
|
|
19945
20043
|
import { layer_ref as layer_ref15, length as length9 } from "circuit-json";
|
|
19946
|
-
import { z as
|
|
20044
|
+
import { z as z160 } from "zod";
|
|
19947
20045
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
19948
|
-
text:
|
|
20046
|
+
text: z160.string(),
|
|
19949
20047
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
19950
|
-
font:
|
|
20048
|
+
font: z160.enum(["tscircuit2024"]).optional(),
|
|
19951
20049
|
fontSize: length9.optional(),
|
|
19952
20050
|
/**
|
|
19953
20051
|
* If true, text will knock out underlying silkscreen
|
|
19954
20052
|
*/
|
|
19955
|
-
isKnockout:
|
|
20053
|
+
isKnockout: z160.boolean().optional(),
|
|
19956
20054
|
knockoutPadding: length9.optional(),
|
|
19957
20055
|
knockoutPaddingLeft: length9.optional(),
|
|
19958
20056
|
knockoutPaddingRight: length9.optional(),
|
|
19959
20057
|
knockoutPaddingTop: length9.optional(),
|
|
19960
20058
|
knockoutPaddingBottom: length9.optional(),
|
|
19961
|
-
layers:
|
|
20059
|
+
layers: z160.array(layer_ref15).optional()
|
|
19962
20060
|
});
|
|
19963
20061
|
|
|
19964
20062
|
// lib/components/silkscreen-path.ts
|
|
19965
20063
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
19966
|
-
import { z as
|
|
20064
|
+
import { z as z161 } from "zod";
|
|
19967
20065
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
19968
20066
|
pcbLeftEdgeX: true,
|
|
19969
20067
|
pcbRightEdgeX: true,
|
|
@@ -19975,7 +20073,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
19975
20073
|
pcbOffsetY: true,
|
|
19976
20074
|
pcbRotation: true
|
|
19977
20075
|
}).extend({
|
|
19978
|
-
route:
|
|
20076
|
+
route: z161.array(route_hint_point5),
|
|
19979
20077
|
strokeWidth: length10.optional()
|
|
19980
20078
|
});
|
|
19981
20079
|
|
|
@@ -19997,10 +20095,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
19997
20095
|
|
|
19998
20096
|
// lib/components/silkscreen-rect.ts
|
|
19999
20097
|
import { distance as distance47 } from "circuit-json";
|
|
20000
|
-
import { z as
|
|
20098
|
+
import { z as z162 } from "zod";
|
|
20001
20099
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
20002
|
-
filled:
|
|
20003
|
-
stroke:
|
|
20100
|
+
filled: z162.boolean().default(true).optional(),
|
|
20101
|
+
stroke: z162.enum(["dashed", "solid", "none"]).optional(),
|
|
20004
20102
|
strokeWidth: distance47.optional(),
|
|
20005
20103
|
width: distance47,
|
|
20006
20104
|
height: distance47,
|
|
@@ -20009,10 +20107,10 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
20009
20107
|
|
|
20010
20108
|
// lib/components/silkscreen-circle.ts
|
|
20011
20109
|
import { distance as distance48 } from "circuit-json";
|
|
20012
|
-
import { z as
|
|
20110
|
+
import { z as z163 } from "zod";
|
|
20013
20111
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
20014
|
-
isFilled:
|
|
20015
|
-
isOutline:
|
|
20112
|
+
isFilled: z163.boolean().optional(),
|
|
20113
|
+
isOutline: z163.boolean().optional(),
|
|
20016
20114
|
strokeWidth: distance48.optional(),
|
|
20017
20115
|
radius: distance48
|
|
20018
20116
|
});
|
|
@@ -20030,69 +20128,69 @@ expectTypesMatch(true);
|
|
|
20030
20128
|
|
|
20031
20129
|
// lib/components/trace-hint.ts
|
|
20032
20130
|
import { distance as distance49, layer_ref as layer_ref16, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
20033
|
-
import { z as
|
|
20034
|
-
var routeHintPointProps =
|
|
20131
|
+
import { z as z165 } from "zod";
|
|
20132
|
+
var routeHintPointProps = z165.object({
|
|
20035
20133
|
x: distance49,
|
|
20036
20134
|
y: distance49,
|
|
20037
|
-
via:
|
|
20135
|
+
via: z165.boolean().optional(),
|
|
20038
20136
|
toLayer: layer_ref16.optional()
|
|
20039
20137
|
});
|
|
20040
|
-
var traceHintProps =
|
|
20041
|
-
for:
|
|
20138
|
+
var traceHintProps = z165.object({
|
|
20139
|
+
for: z165.string().optional().describe(
|
|
20042
20140
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
20043
20141
|
),
|
|
20044
|
-
order:
|
|
20142
|
+
order: z165.number().optional(),
|
|
20045
20143
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
20046
|
-
offsets:
|
|
20047
|
-
traceWidth:
|
|
20144
|
+
offsets: z165.array(route_hint_point6).or(z165.array(routeHintPointProps)).optional(),
|
|
20145
|
+
traceWidth: z165.number().optional()
|
|
20048
20146
|
});
|
|
20049
20147
|
|
|
20050
20148
|
// lib/components/port.ts
|
|
20051
20149
|
import { distance as distance50 } from "circuit-json";
|
|
20052
|
-
import { z as
|
|
20150
|
+
import { z as z166 } from "zod";
|
|
20053
20151
|
var portProps = commonLayoutProps.extend({
|
|
20054
|
-
name:
|
|
20055
|
-
pinNumber:
|
|
20056
|
-
schStemLength:
|
|
20057
|
-
schPinLabelFontSize:
|
|
20152
|
+
name: z166.string().optional(),
|
|
20153
|
+
pinNumber: z166.number().optional(),
|
|
20154
|
+
schStemLength: z166.number().optional(),
|
|
20155
|
+
schPinLabelFontSize: z166.enum(["default", "sm"]).or(
|
|
20058
20156
|
distance50.refine((value) => Number.isFinite(value) && value > 0, {
|
|
20059
20157
|
message: "Schematic pin-label font size must be positive and finite"
|
|
20060
20158
|
})
|
|
20061
20159
|
).optional(),
|
|
20062
|
-
aliases:
|
|
20063
|
-
layer:
|
|
20064
|
-
layers:
|
|
20065
|
-
schX:
|
|
20066
|
-
schY:
|
|
20160
|
+
aliases: z166.array(z166.string()).optional(),
|
|
20161
|
+
layer: z166.string().optional(),
|
|
20162
|
+
layers: z166.array(z166.string()).optional(),
|
|
20163
|
+
schX: z166.number().optional(),
|
|
20164
|
+
schY: z166.number().optional(),
|
|
20067
20165
|
direction: direction.optional(),
|
|
20068
|
-
connectsTo:
|
|
20166
|
+
connectsTo: z166.string().or(z166.array(z166.string())).optional(),
|
|
20069
20167
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
20070
|
-
hasInversionCircle:
|
|
20168
|
+
hasInversionCircle: z166.boolean().optional()
|
|
20071
20169
|
});
|
|
20072
20170
|
|
|
20073
20171
|
// lib/components/pcb-note-text.ts
|
|
20074
20172
|
import { length as length11 } from "circuit-json";
|
|
20075
|
-
import { z as
|
|
20173
|
+
import { z as z167 } from "zod";
|
|
20076
20174
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
20077
|
-
text:
|
|
20078
|
-
anchorAlignment:
|
|
20079
|
-
font:
|
|
20175
|
+
text: z167.string(),
|
|
20176
|
+
anchorAlignment: z167.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
20177
|
+
font: z167.enum(["tscircuit2024"]).optional(),
|
|
20080
20178
|
fontSize: length11.optional(),
|
|
20081
|
-
color:
|
|
20179
|
+
color: z167.string().optional()
|
|
20082
20180
|
});
|
|
20083
20181
|
expectTypesMatch(true);
|
|
20084
20182
|
|
|
20085
20183
|
// lib/components/pcb-note-rect.ts
|
|
20086
20184
|
import { distance as distance51 } from "circuit-json";
|
|
20087
|
-
import { z as
|
|
20185
|
+
import { z as z168 } from "zod";
|
|
20088
20186
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
20089
20187
|
width: distance51,
|
|
20090
20188
|
height: distance51,
|
|
20091
20189
|
strokeWidth: distance51.optional(),
|
|
20092
|
-
isFilled:
|
|
20093
|
-
hasStroke:
|
|
20094
|
-
isStrokeDashed:
|
|
20095
|
-
color:
|
|
20190
|
+
isFilled: z168.boolean().optional(),
|
|
20191
|
+
hasStroke: z168.boolean().optional(),
|
|
20192
|
+
isStrokeDashed: z168.boolean().optional(),
|
|
20193
|
+
color: z168.string().optional(),
|
|
20096
20194
|
cornerRadius: distance51.optional()
|
|
20097
20195
|
});
|
|
20098
20196
|
expectTypesMatch(true);
|
|
@@ -20102,7 +20200,7 @@ import {
|
|
|
20102
20200
|
length as length12,
|
|
20103
20201
|
route_hint_point as route_hint_point7
|
|
20104
20202
|
} from "circuit-json";
|
|
20105
|
-
import { z as
|
|
20203
|
+
import { z as z169 } from "zod";
|
|
20106
20204
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
20107
20205
|
pcbLeftEdgeX: true,
|
|
20108
20206
|
pcbRightEdgeX: true,
|
|
@@ -20114,15 +20212,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
20114
20212
|
pcbOffsetY: true,
|
|
20115
20213
|
pcbRotation: true
|
|
20116
20214
|
}).extend({
|
|
20117
|
-
route:
|
|
20215
|
+
route: z169.array(route_hint_point7),
|
|
20118
20216
|
strokeWidth: length12.optional(),
|
|
20119
|
-
color:
|
|
20217
|
+
color: z169.string().optional()
|
|
20120
20218
|
});
|
|
20121
20219
|
expectTypesMatch(true);
|
|
20122
20220
|
|
|
20123
20221
|
// lib/components/pcb-note-line.ts
|
|
20124
20222
|
import { distance as distance52 } from "circuit-json";
|
|
20125
|
-
import { z as
|
|
20223
|
+
import { z as z170 } from "zod";
|
|
20126
20224
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
20127
20225
|
pcbLeftEdgeX: true,
|
|
20128
20226
|
pcbRightEdgeX: true,
|
|
@@ -20139,15 +20237,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
20139
20237
|
x2: distance52,
|
|
20140
20238
|
y2: distance52,
|
|
20141
20239
|
strokeWidth: distance52.optional(),
|
|
20142
|
-
color:
|
|
20143
|
-
isDashed:
|
|
20240
|
+
color: z170.string().optional(),
|
|
20241
|
+
isDashed: z170.boolean().optional()
|
|
20144
20242
|
});
|
|
20145
20243
|
expectTypesMatch(true);
|
|
20146
20244
|
|
|
20147
20245
|
// lib/components/pcb-note-dimension.ts
|
|
20148
20246
|
import { distance as distance53, length as length13 } from "circuit-json";
|
|
20149
|
-
import { z as
|
|
20150
|
-
var dimensionTarget2 =
|
|
20247
|
+
import { z as z171 } from "zod";
|
|
20248
|
+
var dimensionTarget2 = z171.union([z171.string(), point]);
|
|
20151
20249
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
20152
20250
|
pcbLeftEdgeX: true,
|
|
20153
20251
|
pcbRightEdgeX: true,
|
|
@@ -20161,118 +20259,119 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
20161
20259
|
}).extend({
|
|
20162
20260
|
from: dimensionTarget2,
|
|
20163
20261
|
to: dimensionTarget2,
|
|
20164
|
-
text:
|
|
20262
|
+
text: z171.string().optional(),
|
|
20165
20263
|
offset: distance53.optional(),
|
|
20166
|
-
offsetDirection:
|
|
20167
|
-
font:
|
|
20264
|
+
offsetDirection: z171.object({ x: z171.number().finite(), y: z171.number().finite() }).optional(),
|
|
20265
|
+
font: z171.enum(["tscircuit2024"]).optional(),
|
|
20168
20266
|
fontSize: length13.optional(),
|
|
20169
|
-
color:
|
|
20267
|
+
color: z171.string().optional(),
|
|
20170
20268
|
arrowSize: distance53.optional(),
|
|
20171
|
-
units:
|
|
20172
|
-
outerEdgeToEdge:
|
|
20173
|
-
centerToCenter:
|
|
20174
|
-
innerEdgeToEdge:
|
|
20269
|
+
units: z171.enum(["in", "mm"]).optional(),
|
|
20270
|
+
outerEdgeToEdge: z171.literal(true).optional(),
|
|
20271
|
+
centerToCenter: z171.literal(true).optional(),
|
|
20272
|
+
innerEdgeToEdge: z171.literal(true).optional()
|
|
20175
20273
|
});
|
|
20176
20274
|
expectTypesMatch(
|
|
20177
20275
|
true
|
|
20178
20276
|
);
|
|
20179
20277
|
|
|
20180
20278
|
// lib/platformConfig.ts
|
|
20181
|
-
import { z as
|
|
20182
|
-
var unvalidatedCircuitJson =
|
|
20183
|
-
var footprintLibraryResult =
|
|
20184
|
-
footprintCircuitJson:
|
|
20279
|
+
import { z as z172 } from "zod";
|
|
20280
|
+
var unvalidatedCircuitJson = z172.array(z172.any()).describe("Circuit JSON");
|
|
20281
|
+
var footprintLibraryResult = z172.object({
|
|
20282
|
+
footprintCircuitJson: z172.array(z172.any()),
|
|
20185
20283
|
cadModel: cadModelProp.optional()
|
|
20186
20284
|
});
|
|
20187
|
-
var pathToCircuitJsonFn =
|
|
20188
|
-
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
).returns(
|
|
20285
|
+
var pathToCircuitJsonFn = z172.function().args(z172.string()).returns(z172.promise(footprintLibraryResult)).or(
|
|
20286
|
+
z172.function().args(
|
|
20287
|
+
z172.string(),
|
|
20288
|
+
z172.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
20289
|
+
).returns(z172.promise(footprintLibraryResult))
|
|
20192
20290
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
20193
|
-
var footprintFileParserEntry =
|
|
20194
|
-
loadFromUrl:
|
|
20291
|
+
var footprintFileParserEntry = z172.object({
|
|
20292
|
+
loadFromUrl: z172.function().args(z172.string()).returns(z172.promise(footprintLibraryResult)).describe(
|
|
20195
20293
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
20196
20294
|
)
|
|
20197
20295
|
});
|
|
20198
|
-
var spiceEngineSimulationResult =
|
|
20199
|
-
engineVersionString:
|
|
20296
|
+
var spiceEngineSimulationResult = z172.object({
|
|
20297
|
+
engineVersionString: z172.string().optional(),
|
|
20200
20298
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
20201
20299
|
});
|
|
20202
|
-
var spiceEngineZod =
|
|
20203
|
-
simulate:
|
|
20300
|
+
var spiceEngineZod = z172.object({
|
|
20301
|
+
simulate: z172.function().args(z172.string()).returns(z172.promise(spiceEngineSimulationResult)).describe(
|
|
20204
20302
|
"A function that takes a SPICE string and returns a simulation result"
|
|
20205
20303
|
)
|
|
20206
20304
|
});
|
|
20207
|
-
var defaultSpiceEngine =
|
|
20208
|
-
|
|
20209
|
-
)
|
|
20210
|
-
|
|
20211
|
-
run: z168.function().args().returns(z168.promise(z168.unknown())).describe("Run the autorouter"),
|
|
20212
|
-
getOutputSimpleRouteJson: z168.function().args().returns(z168.promise(z168.any())).describe("Get the resulting SimpleRouteJson")
|
|
20305
|
+
var defaultSpiceEngine = z172.custom((value) => typeof value === "string");
|
|
20306
|
+
var autorouterInstance = z172.object({
|
|
20307
|
+
run: z172.function().args().returns(z172.promise(z172.unknown())).describe("Run the autorouter"),
|
|
20308
|
+
getOutputSimpleRouteJson: z172.function().args().returns(z172.promise(z172.any())).describe("Get the resulting SimpleRouteJson")
|
|
20213
20309
|
});
|
|
20214
|
-
var autorouterDefinition =
|
|
20215
|
-
createAutorouter:
|
|
20310
|
+
var autorouterDefinition = z172.object({
|
|
20311
|
+
createAutorouter: z172.function().args(z172.any(), z172.any().optional()).returns(z172.union([autorouterInstance, z172.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
20216
20312
|
});
|
|
20217
|
-
var platformFetch =
|
|
20218
|
-
var localCacheEngine =
|
|
20313
|
+
var platformFetch = z172.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
20314
|
+
var localCacheEngine = z172.custom(
|
|
20219
20315
|
(value) => typeof value === "object" && value !== null && "getItem" in value && typeof value.getItem === "function" && "setItem" in value && typeof value.setItem === "function"
|
|
20220
20316
|
);
|
|
20221
|
-
var fabricatorEngine =
|
|
20317
|
+
var fabricatorEngine = z172.custom(
|
|
20222
20318
|
(value) => typeof value === "object" && value !== null && "runDrcChecks" in value && typeof value.runDrcChecks === "function"
|
|
20223
20319
|
);
|
|
20224
|
-
var platformConfig =
|
|
20320
|
+
var platformConfig = z172.object({
|
|
20225
20321
|
partsEngine: partsEngine.optional(),
|
|
20226
|
-
checkAvailability:
|
|
20322
|
+
checkAvailability: z172.boolean().describe(
|
|
20227
20323
|
"Opt in to networked JLCPCB availability checks during rendering. Disabled by default; enabling adds non-deterministic diagnostics."
|
|
20228
20324
|
).optional(),
|
|
20229
20325
|
fabricatorEngine: fabricatorEngine.optional(),
|
|
20230
20326
|
autorouter: autorouterProp.optional(),
|
|
20231
|
-
|
|
20232
|
-
|
|
20327
|
+
autorouterThreads: z172.number().int().positive().safe().describe(
|
|
20328
|
+
"Requested local autorouting thread count for supporting hosts. 1 requests inline solving; omission preserves the host default. Browsers stay single-threaded and cloud routing is unaffected."
|
|
20329
|
+
).optional(),
|
|
20330
|
+
autorouterMap: z172.record(z172.string(), autorouterDefinition).optional(),
|
|
20331
|
+
allowLegacyAutorouters: z172.boolean().optional(),
|
|
20233
20332
|
registryApiUrl: url.optional(),
|
|
20234
20333
|
cloudAutorouterUrl: url.optional(),
|
|
20235
20334
|
jscdnBaseUrl: url.optional(),
|
|
20236
|
-
projectName:
|
|
20335
|
+
projectName: z172.string().optional(),
|
|
20237
20336
|
projectBaseUrl: url.optional(),
|
|
20238
|
-
version:
|
|
20337
|
+
version: z172.string().optional(),
|
|
20239
20338
|
url: url.optional(),
|
|
20240
|
-
printBoardInformationToSilkscreen:
|
|
20241
|
-
includeBoardFiles:
|
|
20339
|
+
printBoardInformationToSilkscreen: z172.boolean().optional(),
|
|
20340
|
+
includeBoardFiles: z172.array(z172.string()).describe(
|
|
20242
20341
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
20243
20342
|
).optional(),
|
|
20244
|
-
snapshotsDir:
|
|
20343
|
+
snapshotsDir: z172.string().describe(
|
|
20245
20344
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
20246
20345
|
).optional(),
|
|
20247
20346
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
20248
|
-
unitPreference:
|
|
20347
|
+
unitPreference: z172.enum(["mm", "in", "mil"]).optional(),
|
|
20249
20348
|
localCacheEngine: localCacheEngine.optional(),
|
|
20250
|
-
useCloudAutorouter:
|
|
20251
|
-
enablePartOrientationAnalysis:
|
|
20252
|
-
pcbPackSolverTimeoutMs:
|
|
20253
|
-
pcbDisabled:
|
|
20254
|
-
routingDisabled:
|
|
20255
|
-
schematicDisabled:
|
|
20256
|
-
partsEngineDisabled:
|
|
20257
|
-
analogSimulationDisabled:
|
|
20258
|
-
drcChecksDisabled:
|
|
20259
|
-
netlistDrcChecksDisabled:
|
|
20260
|
-
routingDrcChecksDisabled:
|
|
20261
|
-
placementDrcChecksDisabled:
|
|
20262
|
-
pinSpecificationDrcChecksDisabled:
|
|
20263
|
-
spiceEngineMap:
|
|
20264
|
-
footprintLibraryMap:
|
|
20265
|
-
|
|
20266
|
-
|
|
20349
|
+
useCloudAutorouter: z172.boolean().optional(),
|
|
20350
|
+
enablePartOrientationAnalysis: z172.boolean().optional(),
|
|
20351
|
+
pcbPackSolverTimeoutMs: z172.number().finite().positive().optional(),
|
|
20352
|
+
pcbDisabled: z172.boolean().optional(),
|
|
20353
|
+
routingDisabled: z172.boolean().optional(),
|
|
20354
|
+
schematicDisabled: z172.boolean().optional(),
|
|
20355
|
+
partsEngineDisabled: z172.boolean().optional(),
|
|
20356
|
+
analogSimulationDisabled: z172.boolean().optional(),
|
|
20357
|
+
drcChecksDisabled: z172.boolean().optional(),
|
|
20358
|
+
netlistDrcChecksDisabled: z172.boolean().optional(),
|
|
20359
|
+
routingDrcChecksDisabled: z172.boolean().optional(),
|
|
20360
|
+
placementDrcChecksDisabled: z172.boolean().optional(),
|
|
20361
|
+
pinSpecificationDrcChecksDisabled: z172.boolean().optional(),
|
|
20362
|
+
spiceEngineMap: z172.record(z172.string(), spiceEngineZod).optional(),
|
|
20363
|
+
footprintLibraryMap: z172.record(
|
|
20364
|
+
z172.string(),
|
|
20365
|
+
z172.union([
|
|
20267
20366
|
pathToCircuitJsonFn,
|
|
20268
|
-
|
|
20269
|
-
|
|
20270
|
-
|
|
20367
|
+
z172.record(
|
|
20368
|
+
z172.string(),
|
|
20369
|
+
z172.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
20271
20370
|
)
|
|
20272
20371
|
])
|
|
20273
20372
|
).optional(),
|
|
20274
|
-
footprintFileParserMap:
|
|
20275
|
-
resolveProjectStaticFileImportUrl:
|
|
20373
|
+
footprintFileParserMap: z172.record(z172.string(), footprintFileParserEntry).optional(),
|
|
20374
|
+
resolveProjectStaticFileImportUrl: z172.function().args(z172.string()).returns(z172.promise(z172.string())).describe(
|
|
20276
20375
|
"A function that returns a string URL for static files for the project"
|
|
20277
20376
|
).optional(),
|
|
20278
20377
|
platformFetch: platformFetch.optional()
|
|
@@ -20306,6 +20405,8 @@ export {
|
|
|
20306
20405
|
analogCurrentSweepParameterProps,
|
|
20307
20406
|
analogDcOperatingPointSimulationProps,
|
|
20308
20407
|
analogDcSweepSimulationProps,
|
|
20408
|
+
analogDigitalStimulusProps,
|
|
20409
|
+
analogEyeDiagramProps,
|
|
20309
20410
|
analogInductanceSweepParameterProps,
|
|
20310
20411
|
analogResistanceSweepParameterProps,
|
|
20311
20412
|
analogSimulationProps,
|
|
@@ -20430,6 +20531,11 @@ export {
|
|
|
20430
20531
|
fuseProps,
|
|
20431
20532
|
groupProps,
|
|
20432
20533
|
holeProps,
|
|
20534
|
+
ibisModelAsset,
|
|
20535
|
+
ibisModelDefinition,
|
|
20536
|
+
ibisModelProps,
|
|
20537
|
+
ibisPinReferences,
|
|
20538
|
+
ibisPinRunState,
|
|
20433
20539
|
impedanceTarget,
|
|
20434
20540
|
inductorPins,
|
|
20435
20541
|
inductorProps,
|