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