@tscircuit/props 0.0.590 → 0.0.592
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 +210 -100
- package/dist/index.d.ts +821 -3
- package/dist/index.js +617 -363
- package/dist/index.js.map +1 -1
- package/lib/components/analogacsweepsimulation.ts +85 -0
- package/lib/components/analogdcoperatingpointsimulation.ts +18 -0
- package/lib/components/analogdcsweepsimulation.ts +50 -0
- package/lib/components/analogsimulation.ts +22 -0
- package/lib/components/analogsweepparameter.ts +213 -0
- package/lib/components/analogtransientsimulation.ts +47 -0
- package/lib/components/currentsource.ts +6 -0
- package/lib/components/schematic-symbol.ts +59 -0
- package/lib/components/voltagesource.ts +6 -0
- package/lib/index.ts +6 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17501,6 +17501,13 @@ var spiceOptions = z79.object({
|
|
|
17501
17501
|
abstol: z79.union([z79.number(), z79.string()]).optional(),
|
|
17502
17502
|
vntol: z79.union([z79.number(), z79.string()]).optional()
|
|
17503
17503
|
});
|
|
17504
|
+
var analogAnalysisSimulationBaseProps = {
|
|
17505
|
+
name: z79.string().optional(),
|
|
17506
|
+
spiceEngine: spiceEngine.optional(),
|
|
17507
|
+
spiceOptions: spiceOptions.optional(),
|
|
17508
|
+
graphIndependentAxes: z79.boolean().optional(),
|
|
17509
|
+
children: z79.custom().optional()
|
|
17510
|
+
};
|
|
17504
17511
|
var analogSimulationProps = z79.object({
|
|
17505
17512
|
name: z79.string().optional(),
|
|
17506
17513
|
simulationType: z79.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
@@ -17515,28 +17522,237 @@ expectTypesMatch(
|
|
|
17515
17522
|
true
|
|
17516
17523
|
);
|
|
17517
17524
|
|
|
17518
|
-
// lib/components/
|
|
17525
|
+
// lib/components/analogtransientsimulation.ts
|
|
17526
|
+
import { ms as ms2 } from "circuit-json";
|
|
17519
17527
|
import { z as z80 } from "zod";
|
|
17520
|
-
var
|
|
17521
|
-
|
|
17522
|
-
|
|
17528
|
+
var positiveMilliseconds = ms2.refine(
|
|
17529
|
+
(milliseconds) => milliseconds > 0,
|
|
17530
|
+
"Time must be positive"
|
|
17531
|
+
);
|
|
17532
|
+
var analogTransientSimulationProps = z80.object({
|
|
17533
|
+
...analogAnalysisSimulationBaseProps,
|
|
17534
|
+
duration: positiveMilliseconds.default("10ms"),
|
|
17535
|
+
startTime: ms2.default("0ms"),
|
|
17536
|
+
timePerStep: positiveMilliseconds.default("0.01ms")
|
|
17537
|
+
}).superRefine((simulation, context) => {
|
|
17538
|
+
if (simulation.startTime < 0 || simulation.startTime > simulation.duration) {
|
|
17539
|
+
context.addIssue({
|
|
17540
|
+
code: z80.ZodIssueCode.custom,
|
|
17541
|
+
path: ["startTime"],
|
|
17542
|
+
message: "startTime must be between zero and duration"
|
|
17543
|
+
});
|
|
17544
|
+
}
|
|
17545
|
+
});
|
|
17546
|
+
expectTypesMatch(true);
|
|
17547
|
+
|
|
17548
|
+
// lib/components/analogdcoperatingpointsimulation.ts
|
|
17549
|
+
import { z as z81 } from "zod";
|
|
17550
|
+
var analogDcOperatingPointSimulationProps = z81.object({
|
|
17551
|
+
...analogAnalysisSimulationBaseProps
|
|
17552
|
+
});
|
|
17553
|
+
expectTypesMatch(true);
|
|
17554
|
+
|
|
17555
|
+
// lib/components/analogdcsweepsimulation.ts
|
|
17556
|
+
import { current, voltage as voltage3 } from "circuit-json";
|
|
17557
|
+
import { z as z82 } from "zod";
|
|
17558
|
+
var dcSweepQuantity = z82.union([voltage3, current]);
|
|
17559
|
+
var analogDcSweepSimulationProps = z82.object({
|
|
17560
|
+
...analogAnalysisSimulationBaseProps,
|
|
17561
|
+
sweepSource: z82.string().min(1),
|
|
17562
|
+
sweepStart: dcSweepQuantity,
|
|
17563
|
+
sweepStop: dcSweepQuantity,
|
|
17564
|
+
sweepStep: dcSweepQuantity.refine(
|
|
17565
|
+
(sweepStep) => sweepStep !== 0,
|
|
17566
|
+
"sweepStep must be nonzero"
|
|
17567
|
+
)
|
|
17568
|
+
}).superRefine((simulation, context) => {
|
|
17569
|
+
if (Math.sign(simulation.sweepStop - simulation.sweepStart) !== Math.sign(simulation.sweepStep)) {
|
|
17570
|
+
context.addIssue({
|
|
17571
|
+
code: z82.ZodIssueCode.custom,
|
|
17572
|
+
path: ["sweepStep"],
|
|
17573
|
+
message: "sweepStep must move from sweepStart toward sweepStop"
|
|
17574
|
+
});
|
|
17575
|
+
}
|
|
17576
|
+
});
|
|
17577
|
+
expectTypesMatch(true);
|
|
17578
|
+
|
|
17579
|
+
// lib/components/analogacsweepsimulation.ts
|
|
17580
|
+
import { frequency as frequency3 } from "circuit-json";
|
|
17581
|
+
import { z as z83 } from "zod";
|
|
17582
|
+
var analogAcSweepSimulationProps = z83.object({
|
|
17583
|
+
...analogAnalysisSimulationBaseProps,
|
|
17584
|
+
sweepType: z83.enum(["linear", "decade", "octave"]),
|
|
17585
|
+
startFrequency: frequency3.refine(
|
|
17586
|
+
(startFrequencyHz) => startFrequencyHz > 0,
|
|
17587
|
+
"startFrequency must be positive"
|
|
17588
|
+
),
|
|
17589
|
+
stopFrequency: frequency3.refine(
|
|
17590
|
+
(stopFrequencyHz) => stopFrequencyHz > 0,
|
|
17591
|
+
"stopFrequency must be positive"
|
|
17592
|
+
),
|
|
17593
|
+
samplesPerInterval: z83.number().int().positive().optional(),
|
|
17594
|
+
sampleCount: z83.number().int().positive().optional()
|
|
17595
|
+
}).superRefine((simulation, context) => {
|
|
17596
|
+
if (simulation.stopFrequency <= simulation.startFrequency) {
|
|
17597
|
+
context.addIssue({
|
|
17598
|
+
code: z83.ZodIssueCode.custom,
|
|
17599
|
+
path: ["stopFrequency"],
|
|
17600
|
+
message: "stopFrequency must be greater than startFrequency"
|
|
17601
|
+
});
|
|
17602
|
+
}
|
|
17603
|
+
if (simulation.sweepType === "linear") {
|
|
17604
|
+
if (simulation.sampleCount === void 0) {
|
|
17605
|
+
context.addIssue({
|
|
17606
|
+
code: z83.ZodIssueCode.custom,
|
|
17607
|
+
path: ["sampleCount"],
|
|
17608
|
+
message: "sampleCount is required for a linear AC sweep"
|
|
17609
|
+
});
|
|
17610
|
+
}
|
|
17611
|
+
if (simulation.samplesPerInterval !== void 0) {
|
|
17612
|
+
context.addIssue({
|
|
17613
|
+
code: z83.ZodIssueCode.custom,
|
|
17614
|
+
path: ["samplesPerInterval"],
|
|
17615
|
+
message: "samplesPerInterval is only valid for decade or octave sweeps"
|
|
17616
|
+
});
|
|
17617
|
+
}
|
|
17618
|
+
return;
|
|
17619
|
+
}
|
|
17620
|
+
if (simulation.samplesPerInterval === void 0) {
|
|
17621
|
+
context.addIssue({
|
|
17622
|
+
code: z83.ZodIssueCode.custom,
|
|
17623
|
+
path: ["samplesPerInterval"],
|
|
17624
|
+
message: "samplesPerInterval is required for decade or octave sweeps"
|
|
17625
|
+
});
|
|
17626
|
+
}
|
|
17627
|
+
if (simulation.sampleCount !== void 0) {
|
|
17628
|
+
context.addIssue({
|
|
17629
|
+
code: z83.ZodIssueCode.custom,
|
|
17630
|
+
path: ["sampleCount"],
|
|
17631
|
+
message: "sampleCount is only valid for a linear sweep"
|
|
17632
|
+
});
|
|
17633
|
+
}
|
|
17634
|
+
});
|
|
17635
|
+
expectTypesMatch(true);
|
|
17636
|
+
|
|
17637
|
+
// lib/components/analogsweepparameter.ts
|
|
17638
|
+
import {
|
|
17639
|
+
capacitance as capacitance4,
|
|
17640
|
+
current as current2,
|
|
17641
|
+
inductance,
|
|
17642
|
+
resistance as resistance3,
|
|
17643
|
+
voltage as voltage4
|
|
17644
|
+
} from "circuit-json";
|
|
17645
|
+
import { z as z84 } from "zod";
|
|
17646
|
+
var resistanceSweepQuantity = resistance3.pipe(z84.number());
|
|
17647
|
+
var capacitanceSweepQuantity = capacitance4.pipe(z84.number());
|
|
17648
|
+
var inductanceSweepQuantity = inductance.pipe(z84.number());
|
|
17649
|
+
var voltageSweepQuantity = voltage4.pipe(z84.number());
|
|
17650
|
+
var currentSweepQuantity = current2.pipe(z84.number());
|
|
17651
|
+
var createAnalogSweepCoordinateProps = (sweepQuantity) => ({
|
|
17652
|
+
name: z84.string().optional(),
|
|
17653
|
+
values: z84.array(sweepQuantity).min(1).optional(),
|
|
17654
|
+
start: sweepQuantity.optional(),
|
|
17655
|
+
stop: sweepQuantity.optional(),
|
|
17656
|
+
step: sweepQuantity.optional()
|
|
17657
|
+
});
|
|
17658
|
+
var analogResistanceSweepParameterProps = z84.object({
|
|
17659
|
+
...createAnalogSweepCoordinateProps(resistanceSweepQuantity),
|
|
17660
|
+
parameterType: z84.literal("resistance"),
|
|
17661
|
+
resistorRef: z84.string().min(1)
|
|
17662
|
+
}).strict();
|
|
17663
|
+
var analogCapacitanceSweepParameterProps = z84.object({
|
|
17664
|
+
...createAnalogSweepCoordinateProps(capacitanceSweepQuantity),
|
|
17665
|
+
parameterType: z84.literal("capacitance"),
|
|
17666
|
+
capacitorRef: z84.string().min(1)
|
|
17667
|
+
}).strict();
|
|
17668
|
+
var analogInductanceSweepParameterProps = z84.object({
|
|
17669
|
+
...createAnalogSweepCoordinateProps(inductanceSweepQuantity),
|
|
17670
|
+
parameterType: z84.literal("inductance"),
|
|
17671
|
+
inductorRef: z84.string().min(1)
|
|
17672
|
+
}).strict();
|
|
17673
|
+
var analogVoltageSweepParameterProps = z84.object({
|
|
17674
|
+
...createAnalogSweepCoordinateProps(voltageSweepQuantity),
|
|
17675
|
+
parameterType: z84.literal("voltage"),
|
|
17676
|
+
net: z84.string().min(1)
|
|
17677
|
+
}).strict();
|
|
17678
|
+
var analogCurrentSweepParameterProps = z84.object({
|
|
17679
|
+
...createAnalogSweepCoordinateProps(currentSweepQuantity),
|
|
17680
|
+
parameterType: z84.literal("current"),
|
|
17681
|
+
currentSourceRef: z84.string().min(1)
|
|
17682
|
+
}).strict();
|
|
17683
|
+
var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
17684
|
+
const hasExplicitSweepCoordinates = sweepCoordinates.values !== void 0;
|
|
17685
|
+
const rangeCoordinateCount = [
|
|
17686
|
+
sweepCoordinates.start,
|
|
17687
|
+
sweepCoordinates.stop,
|
|
17688
|
+
sweepCoordinates.step
|
|
17689
|
+
].filter((rangeCoordinate) => rangeCoordinate !== void 0).length;
|
|
17690
|
+
const hasRangeCoordinates = rangeCoordinateCount > 0;
|
|
17691
|
+
if (hasExplicitSweepCoordinates === hasRangeCoordinates) {
|
|
17692
|
+
context.addIssue({
|
|
17693
|
+
code: z84.ZodIssueCode.custom,
|
|
17694
|
+
message: "Provide either values or start/stop/step"
|
|
17695
|
+
});
|
|
17696
|
+
return;
|
|
17697
|
+
}
|
|
17698
|
+
if (rangeCoordinateCount !== 0 && rangeCoordinateCount !== 3) {
|
|
17699
|
+
context.addIssue({
|
|
17700
|
+
code: z84.ZodIssueCode.custom,
|
|
17701
|
+
message: "start, stop, and step must be provided together"
|
|
17702
|
+
});
|
|
17703
|
+
return;
|
|
17704
|
+
}
|
|
17705
|
+
if (sweepCoordinates.step === 0) {
|
|
17706
|
+
context.addIssue({
|
|
17707
|
+
code: z84.ZodIssueCode.custom,
|
|
17708
|
+
path: ["step"],
|
|
17709
|
+
message: "step must be nonzero"
|
|
17710
|
+
});
|
|
17711
|
+
}
|
|
17712
|
+
if (sweepCoordinates.start !== void 0 && sweepCoordinates.stop !== void 0 && sweepCoordinates.step !== void 0 && Math.sign(sweepCoordinates.stop - sweepCoordinates.start) !== Math.sign(sweepCoordinates.step)) {
|
|
17713
|
+
context.addIssue({
|
|
17714
|
+
code: z84.ZodIssueCode.custom,
|
|
17715
|
+
path: ["step"],
|
|
17716
|
+
message: "step must move from start toward stop"
|
|
17717
|
+
});
|
|
17718
|
+
}
|
|
17719
|
+
};
|
|
17720
|
+
var analogSweepParameterProps = z84.discriminatedUnion("parameterType", [
|
|
17721
|
+
analogResistanceSweepParameterProps,
|
|
17722
|
+
analogCapacitanceSweepParameterProps,
|
|
17723
|
+
analogInductanceSweepParameterProps,
|
|
17724
|
+
analogVoltageSweepParameterProps,
|
|
17725
|
+
analogCurrentSweepParameterProps
|
|
17726
|
+
]).superRefine(validateAnalogSweepCoordinates);
|
|
17727
|
+
expectTypesMatch(true);
|
|
17728
|
+
expectTypesMatch(true);
|
|
17729
|
+
expectTypesMatch(true);
|
|
17730
|
+
expectTypesMatch(true);
|
|
17731
|
+
expectTypesMatch(true);
|
|
17732
|
+
expectTypesMatch(true);
|
|
17733
|
+
|
|
17734
|
+
// lib/components/autoroutingphase.ts
|
|
17735
|
+
import { z as z85 } from "zod";
|
|
17736
|
+
var autoroutingPhaseProps = z85.object({
|
|
17737
|
+
key: z85.any().optional(),
|
|
17738
|
+
name: z85.string().optional(),
|
|
17523
17739
|
autorouter: autorouterProp.optional(),
|
|
17524
|
-
phaseIndex:
|
|
17740
|
+
phaseIndex: z85.number().optional(),
|
|
17525
17741
|
...routingTolerances.shape,
|
|
17526
|
-
region:
|
|
17527
|
-
shape:
|
|
17528
|
-
minX:
|
|
17529
|
-
maxX:
|
|
17530
|
-
minY:
|
|
17531
|
-
maxY:
|
|
17742
|
+
region: z85.object({
|
|
17743
|
+
shape: z85.literal("rect").optional(),
|
|
17744
|
+
minX: z85.number(),
|
|
17745
|
+
maxX: z85.number(),
|
|
17746
|
+
minY: z85.number(),
|
|
17747
|
+
maxY: z85.number()
|
|
17532
17748
|
}).optional(),
|
|
17533
|
-
connection:
|
|
17534
|
-
connections:
|
|
17535
|
-
reroute:
|
|
17749
|
+
connection: z85.string().optional(),
|
|
17750
|
+
connections: z85.array(z85.string()).optional(),
|
|
17751
|
+
reroute: z85.boolean().optional()
|
|
17536
17752
|
}).superRefine((value, ctx) => {
|
|
17537
17753
|
if (value.reroute !== void 0 && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
17538
17754
|
ctx.addIssue({
|
|
17539
|
-
code:
|
|
17755
|
+
code: z85.ZodIssueCode.custom,
|
|
17540
17756
|
message: "region, connection, or connections is required when reroute is provided",
|
|
17541
17757
|
path: ["region"]
|
|
17542
17758
|
});
|
|
@@ -17545,15 +17761,15 @@ var autoroutingPhaseProps = z80.object({
|
|
|
17545
17761
|
expectTypesMatch(true);
|
|
17546
17762
|
|
|
17547
17763
|
// lib/components/spicemodel.ts
|
|
17548
|
-
import { z as
|
|
17549
|
-
var spicemodelProps =
|
|
17550
|
-
source:
|
|
17551
|
-
spicePinMapping:
|
|
17764
|
+
import { z as z86 } from "zod";
|
|
17765
|
+
var spicemodelProps = z86.object({
|
|
17766
|
+
source: z86.string(),
|
|
17767
|
+
spicePinMapping: z86.record(z86.string(), z86.string()).optional()
|
|
17552
17768
|
});
|
|
17553
17769
|
expectTypesMatch(true);
|
|
17554
17770
|
|
|
17555
17771
|
// lib/components/transistor.ts
|
|
17556
|
-
import { z as
|
|
17772
|
+
import { z as z87 } from "zod";
|
|
17557
17773
|
var transistorPinsLabels = [
|
|
17558
17774
|
"pin1",
|
|
17559
17775
|
"pin2",
|
|
@@ -17566,7 +17782,7 @@ var transistorPinsLabels = [
|
|
|
17566
17782
|
"drain"
|
|
17567
17783
|
];
|
|
17568
17784
|
var transistorProps = commonComponentProps.extend({
|
|
17569
|
-
type:
|
|
17785
|
+
type: z87.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
17570
17786
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
17571
17787
|
});
|
|
17572
17788
|
var transistorPins = [
|
|
@@ -17580,7 +17796,7 @@ var transistorPins = [
|
|
|
17580
17796
|
expectTypesMatch(true);
|
|
17581
17797
|
|
|
17582
17798
|
// lib/components/mosfet.ts
|
|
17583
|
-
import { z as
|
|
17799
|
+
import { z as z88 } from "zod";
|
|
17584
17800
|
var mosfetPins = [
|
|
17585
17801
|
"pin1",
|
|
17586
17802
|
"drain",
|
|
@@ -17590,11 +17806,11 @@ var mosfetPins = [
|
|
|
17590
17806
|
"gate"
|
|
17591
17807
|
];
|
|
17592
17808
|
var mosfetProps = commonComponentProps.extend({
|
|
17593
|
-
channelType:
|
|
17594
|
-
mosfetMode:
|
|
17595
|
-
symbolDrainSide:
|
|
17596
|
-
symbolSourceSide:
|
|
17597
|
-
symbolGateSide:
|
|
17809
|
+
channelType: z88.enum(["n", "p"]),
|
|
17810
|
+
mosfetMode: z88.enum(["enhancement", "depletion"]),
|
|
17811
|
+
symbolDrainSide: z88.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17812
|
+
symbolSourceSide: z88.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17813
|
+
symbolGateSide: z88.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17598
17814
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
17599
17815
|
});
|
|
17600
17816
|
expectTypesMatch(true);
|
|
@@ -17615,30 +17831,30 @@ var opampPins = opampPinLabels;
|
|
|
17615
17831
|
expectTypesMatch(true);
|
|
17616
17832
|
|
|
17617
17833
|
// lib/components/inductor.ts
|
|
17618
|
-
import { inductance } from "circuit-json";
|
|
17619
|
-
import { z as
|
|
17834
|
+
import { inductance as inductance2 } from "circuit-json";
|
|
17835
|
+
import { z as z90 } from "zod";
|
|
17620
17836
|
var inductorPins = lrPins;
|
|
17621
17837
|
var inductorProps = commonComponentProps.extend({
|
|
17622
|
-
inductance,
|
|
17623
|
-
maxCurrentRating:
|
|
17838
|
+
inductance: inductance2,
|
|
17839
|
+
maxCurrentRating: z90.union([z90.string(), z90.number()]).optional(),
|
|
17624
17840
|
schOrientation: schematicOrientation.optional(),
|
|
17625
17841
|
connections: createConnectionsProp(inductorPins).optional()
|
|
17626
17842
|
});
|
|
17627
17843
|
expectTypesMatch(true);
|
|
17628
17844
|
|
|
17629
17845
|
// lib/components/internal-circuit.ts
|
|
17630
|
-
import { z as
|
|
17631
|
-
var internalCircuitProps =
|
|
17632
|
-
children:
|
|
17846
|
+
import { z as z91 } from "zod";
|
|
17847
|
+
var internalCircuitProps = z91.object({
|
|
17848
|
+
children: z91.custom().optional()
|
|
17633
17849
|
});
|
|
17634
17850
|
expectTypesMatch(
|
|
17635
17851
|
true
|
|
17636
17852
|
);
|
|
17637
17853
|
|
|
17638
17854
|
// lib/components/diode.ts
|
|
17639
|
-
import { z as
|
|
17855
|
+
import { z as z92 } from "zod";
|
|
17640
17856
|
var diodePins = lrPolarPins;
|
|
17641
|
-
var diodeConnectionKeys =
|
|
17857
|
+
var diodeConnectionKeys = z92.enum([
|
|
17642
17858
|
"anode",
|
|
17643
17859
|
"cathode",
|
|
17644
17860
|
"pin1",
|
|
@@ -17646,13 +17862,13 @@ var diodeConnectionKeys = z87.enum([
|
|
|
17646
17862
|
"pos",
|
|
17647
17863
|
"neg"
|
|
17648
17864
|
]);
|
|
17649
|
-
var connectionTarget3 =
|
|
17650
|
-
var connectionsProp2 =
|
|
17651
|
-
var diodePinLabelsProp =
|
|
17652
|
-
|
|
17653
|
-
schematicPinLabel.or(
|
|
17865
|
+
var connectionTarget3 = z92.string().or(z92.array(z92.string()).readonly()).or(z92.array(z92.string()));
|
|
17866
|
+
var connectionsProp2 = z92.record(diodeConnectionKeys, connectionTarget3);
|
|
17867
|
+
var diodePinLabelsProp = z92.record(
|
|
17868
|
+
z92.enum(diodePins),
|
|
17869
|
+
schematicPinLabel.or(z92.array(schematicPinLabel).readonly()).or(z92.array(schematicPinLabel))
|
|
17654
17870
|
);
|
|
17655
|
-
var diodeVariant =
|
|
17871
|
+
var diodeVariant = z92.enum([
|
|
17656
17872
|
"standard",
|
|
17657
17873
|
"schottky",
|
|
17658
17874
|
"zener",
|
|
@@ -17663,12 +17879,12 @@ var diodeVariant = z87.enum([
|
|
|
17663
17879
|
var diodeProps = commonComponentProps.extend({
|
|
17664
17880
|
connections: connectionsProp2.optional(),
|
|
17665
17881
|
variant: diodeVariant.optional().default("standard"),
|
|
17666
|
-
standard:
|
|
17667
|
-
schottky:
|
|
17668
|
-
zener:
|
|
17669
|
-
avalanche:
|
|
17670
|
-
photo:
|
|
17671
|
-
tvs:
|
|
17882
|
+
standard: z92.boolean().optional(),
|
|
17883
|
+
schottky: z92.boolean().optional(),
|
|
17884
|
+
zener: z92.boolean().optional(),
|
|
17885
|
+
avalanche: z92.boolean().optional(),
|
|
17886
|
+
photo: z92.boolean().optional(),
|
|
17887
|
+
tvs: z92.boolean().optional(),
|
|
17672
17888
|
schOrientation: schematicOrientation.optional(),
|
|
17673
17889
|
pinLabels: diodePinLabelsProp.optional()
|
|
17674
17890
|
}).superRefine((data, ctx) => {
|
|
@@ -17682,11 +17898,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17682
17898
|
].filter(Boolean).length;
|
|
17683
17899
|
if (enabledFlags > 1) {
|
|
17684
17900
|
ctx.addIssue({
|
|
17685
|
-
code:
|
|
17901
|
+
code: z92.ZodIssueCode.custom,
|
|
17686
17902
|
message: "Exactly one diode variant must be enabled",
|
|
17687
17903
|
path: []
|
|
17688
17904
|
});
|
|
17689
|
-
return
|
|
17905
|
+
return z92.INVALID;
|
|
17690
17906
|
}
|
|
17691
17907
|
}).transform((data) => {
|
|
17692
17908
|
const result = {
|
|
@@ -17732,34 +17948,34 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17732
17948
|
expectTypesMatch(true);
|
|
17733
17949
|
|
|
17734
17950
|
// lib/components/led.ts
|
|
17735
|
-
import { z as
|
|
17951
|
+
import { z as z93 } from "zod";
|
|
17736
17952
|
var ledProps = commonComponentProps.extend({
|
|
17737
|
-
color:
|
|
17738
|
-
wavelength:
|
|
17739
|
-
schDisplayValue:
|
|
17953
|
+
color: z93.string().optional(),
|
|
17954
|
+
wavelength: z93.string().optional(),
|
|
17955
|
+
schDisplayValue: z93.string().optional(),
|
|
17740
17956
|
schOrientation: schematicOrientation.optional(),
|
|
17741
17957
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
17742
|
-
laser:
|
|
17958
|
+
laser: z93.boolean().optional()
|
|
17743
17959
|
});
|
|
17744
17960
|
var ledPins = lrPolarPins;
|
|
17745
17961
|
|
|
17746
17962
|
// lib/components/switch.ts
|
|
17747
|
-
import { ms as
|
|
17748
|
-
import { z as
|
|
17963
|
+
import { ms as ms3, frequency as frequency4 } from "circuit-json";
|
|
17964
|
+
import { z as z94 } from "zod";
|
|
17749
17965
|
var switchProps = commonComponentProps.extend({
|
|
17750
|
-
type:
|
|
17751
|
-
isNormallyClosed:
|
|
17752
|
-
spst:
|
|
17753
|
-
spdt:
|
|
17754
|
-
dpst:
|
|
17755
|
-
dpdt:
|
|
17966
|
+
type: z94.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
17967
|
+
isNormallyClosed: z94.boolean().optional().default(false),
|
|
17968
|
+
spst: z94.boolean().optional(),
|
|
17969
|
+
spdt: z94.boolean().optional(),
|
|
17970
|
+
dpst: z94.boolean().optional(),
|
|
17971
|
+
dpdt: z94.boolean().optional(),
|
|
17756
17972
|
pinLabels: pinLabelsProp.optional(),
|
|
17757
|
-
simSwitchFrequency:
|
|
17758
|
-
simCloseAt:
|
|
17759
|
-
simOpenAt:
|
|
17760
|
-
simStartClosed:
|
|
17761
|
-
simStartOpen:
|
|
17762
|
-
connections:
|
|
17973
|
+
simSwitchFrequency: frequency4.optional(),
|
|
17974
|
+
simCloseAt: ms3.optional(),
|
|
17975
|
+
simOpenAt: ms3.optional(),
|
|
17976
|
+
simStartClosed: z94.boolean().optional(),
|
|
17977
|
+
simStartOpen: z94.boolean().optional(),
|
|
17978
|
+
connections: z94.custom().pipe(z94.record(z94.string(), connectionTarget)).optional()
|
|
17763
17979
|
}).transform((props) => {
|
|
17764
17980
|
const updatedProps = { ...props };
|
|
17765
17981
|
if (updatedProps.dpdt) {
|
|
@@ -17791,33 +18007,33 @@ expectTypesMatch(true);
|
|
|
17791
18007
|
|
|
17792
18008
|
// lib/components/fabrication-note-text.ts
|
|
17793
18009
|
import { length as length4 } from "circuit-json";
|
|
17794
|
-
import { z as
|
|
18010
|
+
import { z as z95 } from "zod";
|
|
17795
18011
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
17796
|
-
text:
|
|
17797
|
-
anchorAlignment:
|
|
17798
|
-
font:
|
|
18012
|
+
text: z95.string(),
|
|
18013
|
+
anchorAlignment: z95.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18014
|
+
font: z95.enum(["tscircuit2024"]).optional(),
|
|
17799
18015
|
fontSize: length4.optional(),
|
|
17800
|
-
color:
|
|
18016
|
+
color: z95.string().optional()
|
|
17801
18017
|
});
|
|
17802
18018
|
expectTypesMatch(true);
|
|
17803
18019
|
|
|
17804
18020
|
// lib/components/fabrication-note-rect.ts
|
|
17805
18021
|
import { distance as distance21 } from "circuit-json";
|
|
17806
|
-
import { z as
|
|
18022
|
+
import { z as z96 } from "zod";
|
|
17807
18023
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17808
18024
|
width: distance21,
|
|
17809
18025
|
height: distance21,
|
|
17810
18026
|
strokeWidth: distance21.optional(),
|
|
17811
|
-
isFilled:
|
|
17812
|
-
hasStroke:
|
|
17813
|
-
isStrokeDashed:
|
|
17814
|
-
color:
|
|
18027
|
+
isFilled: z96.boolean().optional(),
|
|
18028
|
+
hasStroke: z96.boolean().optional(),
|
|
18029
|
+
isStrokeDashed: z96.boolean().optional(),
|
|
18030
|
+
color: z96.string().optional(),
|
|
17815
18031
|
cornerRadius: distance21.optional()
|
|
17816
18032
|
});
|
|
17817
18033
|
|
|
17818
18034
|
// lib/components/fabrication-note-path.ts
|
|
17819
18035
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
17820
|
-
import { z as
|
|
18036
|
+
import { z as z97 } from "zod";
|
|
17821
18037
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
17822
18038
|
pcbLeftEdgeX: true,
|
|
17823
18039
|
pcbRightEdgeX: true,
|
|
@@ -17829,15 +18045,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
17829
18045
|
pcbOffsetY: true,
|
|
17830
18046
|
pcbRotation: true
|
|
17831
18047
|
}).extend({
|
|
17832
|
-
route:
|
|
18048
|
+
route: z97.array(route_hint_point3),
|
|
17833
18049
|
strokeWidth: length5.optional(),
|
|
17834
|
-
color:
|
|
18050
|
+
color: z97.string().optional()
|
|
17835
18051
|
});
|
|
17836
18052
|
|
|
17837
18053
|
// lib/components/fabrication-note-dimension.ts
|
|
17838
18054
|
import { distance as distance22, length as length6 } from "circuit-json";
|
|
17839
|
-
import { z as
|
|
17840
|
-
var dimensionTarget =
|
|
18055
|
+
import { z as z98 } from "zod";
|
|
18056
|
+
var dimensionTarget = z98.union([z98.string(), point]);
|
|
17841
18057
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
17842
18058
|
pcbLeftEdgeX: true,
|
|
17843
18059
|
pcbRightEdgeX: true,
|
|
@@ -17851,54 +18067,54 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
17851
18067
|
}).extend({
|
|
17852
18068
|
from: dimensionTarget,
|
|
17853
18069
|
to: dimensionTarget,
|
|
17854
|
-
text:
|
|
18070
|
+
text: z98.string().optional(),
|
|
17855
18071
|
offset: distance22.optional(),
|
|
17856
|
-
font:
|
|
18072
|
+
font: z98.enum(["tscircuit2024"]).optional(),
|
|
17857
18073
|
fontSize: length6.optional(),
|
|
17858
|
-
color:
|
|
18074
|
+
color: z98.string().optional(),
|
|
17859
18075
|
arrowSize: distance22.optional(),
|
|
17860
|
-
units:
|
|
17861
|
-
outerEdgeToEdge:
|
|
17862
|
-
centerToCenter:
|
|
17863
|
-
innerEdgeToEdge:
|
|
18076
|
+
units: z98.enum(["in", "mm"]).optional(),
|
|
18077
|
+
outerEdgeToEdge: z98.literal(true).optional(),
|
|
18078
|
+
centerToCenter: z98.literal(true).optional(),
|
|
18079
|
+
innerEdgeToEdge: z98.literal(true).optional()
|
|
17864
18080
|
});
|
|
17865
18081
|
expectTypesMatch(true);
|
|
17866
18082
|
|
|
17867
18083
|
// lib/components/pcb-trace.ts
|
|
17868
18084
|
import { distance as distance23, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
17869
|
-
import { z as
|
|
17870
|
-
var pcbTraceProps =
|
|
17871
|
-
layer:
|
|
18085
|
+
import { z as z99 } from "zod";
|
|
18086
|
+
var pcbTraceProps = z99.object({
|
|
18087
|
+
layer: z99.string().optional(),
|
|
17872
18088
|
thickness: distance23.optional(),
|
|
17873
|
-
route:
|
|
18089
|
+
route: z99.array(route_hint_point4)
|
|
17874
18090
|
});
|
|
17875
18091
|
|
|
17876
18092
|
// lib/components/via.ts
|
|
17877
18093
|
import { distance as distance24, layer_ref as layer_ref6 } from "circuit-json";
|
|
17878
|
-
import { z as
|
|
18094
|
+
import { z as z100 } from "zod";
|
|
17879
18095
|
var viaProps = commonLayoutProps.extend({
|
|
17880
|
-
name:
|
|
18096
|
+
name: z100.string().optional(),
|
|
17881
18097
|
fromLayer: layer_ref6.optional(),
|
|
17882
18098
|
toLayer: layer_ref6.optional(),
|
|
17883
18099
|
holeDiameter: distance24.optional(),
|
|
17884
18100
|
outerDiameter: distance24.optional(),
|
|
17885
|
-
layers:
|
|
17886
|
-
connectsTo:
|
|
17887
|
-
netIsAssignable:
|
|
18101
|
+
layers: z100.array(layer_ref6).optional(),
|
|
18102
|
+
connectsTo: z100.string().or(z100.array(z100.string())).optional(),
|
|
18103
|
+
netIsAssignable: z100.boolean().optional()
|
|
17888
18104
|
});
|
|
17889
18105
|
expectTypesMatch(true);
|
|
17890
18106
|
|
|
17891
18107
|
// lib/components/testpoint.ts
|
|
17892
18108
|
import { distance as distance25 } from "circuit-json";
|
|
17893
|
-
import { z as
|
|
18109
|
+
import { z as z101 } from "zod";
|
|
17894
18110
|
var testpointPins = ["pin1"];
|
|
17895
|
-
var testpointConnectionsProp =
|
|
18111
|
+
var testpointConnectionsProp = z101.object({
|
|
17896
18112
|
pin1: connectionTarget
|
|
17897
18113
|
}).strict();
|
|
17898
18114
|
var testpointProps = commonComponentProps.extend({
|
|
17899
18115
|
connections: testpointConnectionsProp.optional(),
|
|
17900
|
-
footprintVariant:
|
|
17901
|
-
padShape:
|
|
18116
|
+
footprintVariant: z101.enum(["pad", "through_hole"]).optional(),
|
|
18117
|
+
padShape: z101.enum(["rect", "circle"]).optional().default("circle"),
|
|
17902
18118
|
padDiameter: distance25.optional(),
|
|
17903
18119
|
holeDiameter: distance25.optional(),
|
|
17904
18120
|
width: distance25.optional(),
|
|
@@ -17910,45 +18126,45 @@ var testpointProps = commonComponentProps.extend({
|
|
|
17910
18126
|
expectTypesMatch(true);
|
|
17911
18127
|
|
|
17912
18128
|
// lib/components/breakoutpoint.ts
|
|
17913
|
-
import { z as
|
|
18129
|
+
import { z as z102 } from "zod";
|
|
17914
18130
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17915
|
-
connection:
|
|
18131
|
+
connection: z102.string()
|
|
17916
18132
|
});
|
|
17917
18133
|
expectTypesMatch(true);
|
|
17918
18134
|
|
|
17919
18135
|
// lib/components/pcb-keepout.ts
|
|
17920
18136
|
import { distance as distance26, layer_ref as layer_ref7 } from "circuit-json";
|
|
17921
|
-
import { z as
|
|
17922
|
-
var pcbKeepoutProps =
|
|
18137
|
+
import { z as z103 } from "zod";
|
|
18138
|
+
var pcbKeepoutProps = z103.union([
|
|
17923
18139
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17924
|
-
shape:
|
|
18140
|
+
shape: z103.literal("circle"),
|
|
17925
18141
|
radius: distance26,
|
|
17926
|
-
layers:
|
|
18142
|
+
layers: z103.array(layer_ref7).optional()
|
|
17927
18143
|
}),
|
|
17928
18144
|
pcbLayoutProps.extend({
|
|
17929
|
-
shape:
|
|
18145
|
+
shape: z103.literal("rect"),
|
|
17930
18146
|
width: distance26,
|
|
17931
18147
|
height: distance26,
|
|
17932
|
-
layers:
|
|
18148
|
+
layers: z103.array(layer_ref7).optional()
|
|
17933
18149
|
})
|
|
17934
18150
|
]);
|
|
17935
18151
|
|
|
17936
18152
|
// lib/components/courtyard-rect.ts
|
|
17937
18153
|
import { distance as distance27 } from "circuit-json";
|
|
17938
|
-
import { z as
|
|
18154
|
+
import { z as z104 } from "zod";
|
|
17939
18155
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
17940
18156
|
width: distance27,
|
|
17941
18157
|
height: distance27,
|
|
17942
18158
|
strokeWidth: distance27.optional(),
|
|
17943
|
-
isFilled:
|
|
17944
|
-
hasStroke:
|
|
17945
|
-
isStrokeDashed:
|
|
17946
|
-
color:
|
|
18159
|
+
isFilled: z104.boolean().optional(),
|
|
18160
|
+
hasStroke: z104.boolean().optional(),
|
|
18161
|
+
isStrokeDashed: z104.boolean().optional(),
|
|
18162
|
+
color: z104.string().optional()
|
|
17947
18163
|
});
|
|
17948
18164
|
|
|
17949
18165
|
// lib/components/courtyard-outline.ts
|
|
17950
18166
|
import { length as length7 } from "circuit-json";
|
|
17951
|
-
import { z as
|
|
18167
|
+
import { z as z105 } from "zod";
|
|
17952
18168
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
17953
18169
|
pcbLeftEdgeX: true,
|
|
17954
18170
|
pcbRightEdgeX: true,
|
|
@@ -17960,11 +18176,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
17960
18176
|
pcbOffsetY: true,
|
|
17961
18177
|
pcbRotation: true
|
|
17962
18178
|
}).extend({
|
|
17963
|
-
outline:
|
|
18179
|
+
outline: z105.array(point),
|
|
17964
18180
|
strokeWidth: length7.optional(),
|
|
17965
|
-
isClosed:
|
|
17966
|
-
isStrokeDashed:
|
|
17967
|
-
color:
|
|
18181
|
+
isClosed: z105.boolean().optional(),
|
|
18182
|
+
isStrokeDashed: z105.boolean().optional(),
|
|
18183
|
+
color: z105.string().optional()
|
|
17968
18184
|
});
|
|
17969
18185
|
|
|
17970
18186
|
// lib/components/courtyard-circle.ts
|
|
@@ -17984,35 +18200,35 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17984
18200
|
});
|
|
17985
18201
|
|
|
17986
18202
|
// lib/components/copper-pour.ts
|
|
17987
|
-
import { z as
|
|
18203
|
+
import { z as z108 } from "zod";
|
|
17988
18204
|
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
17989
|
-
var copperPourProps =
|
|
17990
|
-
name:
|
|
18205
|
+
var copperPourProps = z108.object({
|
|
18206
|
+
name: z108.string().optional(),
|
|
17991
18207
|
layer: layer_ref8,
|
|
17992
|
-
connectsTo:
|
|
17993
|
-
unbroken:
|
|
18208
|
+
connectsTo: z108.string(),
|
|
18209
|
+
unbroken: z108.boolean().optional(),
|
|
17994
18210
|
padMargin: distance.optional(),
|
|
17995
18211
|
traceMargin: distance.optional(),
|
|
17996
18212
|
clearance: distance.optional(),
|
|
17997
18213
|
boardEdgeMargin: distance.optional(),
|
|
17998
18214
|
cutoutMargin: distance.optional(),
|
|
17999
|
-
outline:
|
|
18000
|
-
coveredWithSolderMask:
|
|
18215
|
+
outline: z108.array(point).optional(),
|
|
18216
|
+
coveredWithSolderMask: z108.boolean().optional().default(true)
|
|
18001
18217
|
});
|
|
18002
18218
|
expectTypesMatch(true);
|
|
18003
18219
|
|
|
18004
18220
|
// lib/components/cadassembly.ts
|
|
18005
18221
|
import { layer_ref as layer_ref9 } from "circuit-json";
|
|
18006
|
-
import { z as
|
|
18007
|
-
var cadassemblyProps =
|
|
18222
|
+
import { z as z109 } from "zod";
|
|
18223
|
+
var cadassemblyProps = z109.object({
|
|
18008
18224
|
originalLayer: layer_ref9.default("top").optional(),
|
|
18009
|
-
children:
|
|
18225
|
+
children: z109.any().optional()
|
|
18010
18226
|
});
|
|
18011
18227
|
expectTypesMatch(true);
|
|
18012
18228
|
|
|
18013
18229
|
// lib/components/cadmodel.ts
|
|
18014
|
-
import { z as
|
|
18015
|
-
var pcbPosition =
|
|
18230
|
+
import { z as z110 } from "zod";
|
|
18231
|
+
var pcbPosition = z110.object({
|
|
18016
18232
|
pcbX: pcbCoordinate.optional(),
|
|
18017
18233
|
pcbY: pcbCoordinate.optional(),
|
|
18018
18234
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -18029,19 +18245,19 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
18029
18245
|
});
|
|
18030
18246
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
18031
18247
|
expectTypesMatch(true);
|
|
18032
|
-
var cadmodelProps =
|
|
18248
|
+
var cadmodelProps = z110.union([z110.null(), url, cadModelObject]);
|
|
18033
18249
|
|
|
18034
18250
|
// lib/components/power-source.ts
|
|
18035
|
-
import { voltage as
|
|
18251
|
+
import { voltage as voltage5 } from "circuit-json";
|
|
18036
18252
|
var powerSourceProps = commonComponentProps.extend({
|
|
18037
|
-
voltage:
|
|
18253
|
+
voltage: voltage5
|
|
18038
18254
|
});
|
|
18039
18255
|
|
|
18040
18256
|
// lib/components/voltagesource.ts
|
|
18041
|
-
import { frequency as
|
|
18042
|
-
import { z as
|
|
18257
|
+
import { frequency as frequency5, ms as ms4, rotation as rotation5, voltage as voltage6 } from "circuit-json";
|
|
18258
|
+
import { z as z111 } from "zod";
|
|
18043
18259
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18044
|
-
var percentage =
|
|
18260
|
+
var percentage = z111.union([z111.string(), z111.number()]).transform((val) => {
|
|
18045
18261
|
if (typeof val === "string") {
|
|
18046
18262
|
if (val.endsWith("%")) {
|
|
18047
18263
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18050,30 +18266,32 @@ var percentage = z106.union([z106.string(), z106.number()]).transform((val) => {
|
|
|
18050
18266
|
}
|
|
18051
18267
|
return val;
|
|
18052
18268
|
}).pipe(
|
|
18053
|
-
|
|
18269
|
+
z111.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18054
18270
|
);
|
|
18055
18271
|
var voltageSourceProps = commonComponentProps.extend({
|
|
18056
|
-
voltage:
|
|
18057
|
-
frequency:
|
|
18058
|
-
peakToPeakVoltage:
|
|
18059
|
-
waveShape:
|
|
18272
|
+
voltage: voltage6.optional(),
|
|
18273
|
+
frequency: frequency5.optional(),
|
|
18274
|
+
peakToPeakVoltage: voltage6.optional(),
|
|
18275
|
+
waveShape: z111.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18060
18276
|
phase: rotation5.optional(),
|
|
18061
18277
|
dutyCycle: percentage.optional(),
|
|
18062
|
-
pulseDelay:
|
|
18063
|
-
riseTime:
|
|
18064
|
-
fallTime:
|
|
18065
|
-
pulseWidth:
|
|
18066
|
-
period:
|
|
18278
|
+
pulseDelay: ms4.optional(),
|
|
18279
|
+
riseTime: ms4.optional(),
|
|
18280
|
+
fallTime: ms4.optional(),
|
|
18281
|
+
pulseWidth: ms4.optional(),
|
|
18282
|
+
period: ms4.optional(),
|
|
18283
|
+
acMagnitude: voltage6.optional(),
|
|
18284
|
+
acPhase: rotation5.optional(),
|
|
18067
18285
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
18068
18286
|
});
|
|
18069
18287
|
var voltageSourcePins = lrPolarPins;
|
|
18070
18288
|
expectTypesMatch(true);
|
|
18071
18289
|
|
|
18072
18290
|
// lib/components/currentsource.ts
|
|
18073
|
-
import { frequency as
|
|
18074
|
-
import { z as
|
|
18291
|
+
import { frequency as frequency6, rotation as rotation6, current as current3 } from "circuit-json";
|
|
18292
|
+
import { z as z112 } from "zod";
|
|
18075
18293
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18076
|
-
var percentage2 =
|
|
18294
|
+
var percentage2 = z112.union([z112.string(), z112.number()]).transform((val) => {
|
|
18077
18295
|
if (typeof val === "string") {
|
|
18078
18296
|
if (val.endsWith("%")) {
|
|
18079
18297
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18082,36 +18300,38 @@ var percentage2 = z107.union([z107.string(), z107.number()]).transform((val) =>
|
|
|
18082
18300
|
}
|
|
18083
18301
|
return val;
|
|
18084
18302
|
}).pipe(
|
|
18085
|
-
|
|
18303
|
+
z112.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18086
18304
|
);
|
|
18087
18305
|
var currentSourceProps = commonComponentProps.extend({
|
|
18088
|
-
current:
|
|
18089
|
-
frequency:
|
|
18090
|
-
peakToPeakCurrent:
|
|
18091
|
-
waveShape:
|
|
18306
|
+
current: current3.optional(),
|
|
18307
|
+
frequency: frequency6.optional(),
|
|
18308
|
+
peakToPeakCurrent: current3.optional(),
|
|
18309
|
+
waveShape: z112.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18092
18310
|
phase: rotation6.optional(),
|
|
18093
18311
|
dutyCycle: percentage2.optional(),
|
|
18312
|
+
acMagnitude: current3.optional(),
|
|
18313
|
+
acPhase: rotation6.optional(),
|
|
18094
18314
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
18095
18315
|
});
|
|
18096
18316
|
var currentSourcePins = lrPolarPins;
|
|
18097
18317
|
expectTypesMatch(true);
|
|
18098
18318
|
|
|
18099
18319
|
// lib/components/voltageprobe.ts
|
|
18100
|
-
import { z as
|
|
18320
|
+
import { z as z113 } from "zod";
|
|
18101
18321
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
18102
|
-
name:
|
|
18103
|
-
connectsTo:
|
|
18104
|
-
referenceTo:
|
|
18105
|
-
color:
|
|
18106
|
-
graphDisplayName:
|
|
18107
|
-
graphCenter:
|
|
18108
|
-
graphVerticalOffset:
|
|
18109
|
-
graphVoltagePerDiv:
|
|
18322
|
+
name: z113.string().optional(),
|
|
18323
|
+
connectsTo: z113.string(),
|
|
18324
|
+
referenceTo: z113.string().optional(),
|
|
18325
|
+
color: z113.string().optional(),
|
|
18326
|
+
graphDisplayName: z113.string().optional(),
|
|
18327
|
+
graphCenter: z113.number().optional(),
|
|
18328
|
+
graphVerticalOffset: z113.number().or(z113.string()).optional(),
|
|
18329
|
+
graphVoltagePerDiv: z113.number().or(z113.string()).optional()
|
|
18110
18330
|
});
|
|
18111
18331
|
expectTypesMatch(true);
|
|
18112
18332
|
|
|
18113
18333
|
// lib/components/ammeter.ts
|
|
18114
|
-
import { z as
|
|
18334
|
+
import { z as z114 } from "zod";
|
|
18115
18335
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18116
18336
|
var hasAmmeterConnectionPair = (connections) => {
|
|
18117
18337
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -18121,63 +18341,63 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
18121
18341
|
hasAmmeterConnectionPair,
|
|
18122
18342
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
18123
18343
|
),
|
|
18124
|
-
color:
|
|
18125
|
-
graphDisplayName:
|
|
18126
|
-
graphCenter:
|
|
18127
|
-
graphVerticalOffset:
|
|
18128
|
-
graphCurrentPerDiv:
|
|
18344
|
+
color: z114.string().optional(),
|
|
18345
|
+
graphDisplayName: z114.string().optional(),
|
|
18346
|
+
graphCenter: z114.number().optional(),
|
|
18347
|
+
graphVerticalOffset: z114.number().or(z114.string()).optional(),
|
|
18348
|
+
graphCurrentPerDiv: z114.number().or(z114.string()).optional()
|
|
18129
18349
|
});
|
|
18130
18350
|
var ammeterPins = ammeterPinLabels;
|
|
18131
18351
|
expectTypesMatch(true);
|
|
18132
18352
|
|
|
18133
18353
|
// lib/components/schematic-arc.ts
|
|
18134
18354
|
import { distance as distance30, point as point5, rotation as rotation7 } from "circuit-json";
|
|
18135
|
-
import { z as
|
|
18136
|
-
var schematicArcProps =
|
|
18355
|
+
import { z as z115 } from "zod";
|
|
18356
|
+
var schematicArcProps = z115.object({
|
|
18137
18357
|
center: point5,
|
|
18138
18358
|
radius: distance30,
|
|
18139
18359
|
startAngleDegrees: rotation7,
|
|
18140
18360
|
endAngleDegrees: rotation7,
|
|
18141
|
-
direction:
|
|
18361
|
+
direction: z115.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
18142
18362
|
strokeWidth: distance30.optional(),
|
|
18143
|
-
color:
|
|
18144
|
-
isDashed:
|
|
18363
|
+
color: z115.string().optional(),
|
|
18364
|
+
isDashed: z115.boolean().optional().default(false)
|
|
18145
18365
|
});
|
|
18146
18366
|
expectTypesMatch(true);
|
|
18147
18367
|
|
|
18148
18368
|
// lib/components/toolingrail.ts
|
|
18149
|
-
import { z as
|
|
18150
|
-
var toolingrailProps =
|
|
18151
|
-
children:
|
|
18369
|
+
import { z as z116 } from "zod";
|
|
18370
|
+
var toolingrailProps = z116.object({
|
|
18371
|
+
children: z116.any().optional()
|
|
18152
18372
|
});
|
|
18153
18373
|
expectTypesMatch(true);
|
|
18154
18374
|
|
|
18155
18375
|
// lib/components/schematic-box.ts
|
|
18156
18376
|
import { distance as distance31 } from "circuit-json";
|
|
18157
|
-
import { z as
|
|
18158
|
-
var schematicBoxProps =
|
|
18159
|
-
name:
|
|
18160
|
-
chipRef:
|
|
18377
|
+
import { z as z117 } from "zod";
|
|
18378
|
+
var schematicBoxProps = z117.object({
|
|
18379
|
+
name: z117.string().optional(),
|
|
18380
|
+
chipRef: z117.string().optional(),
|
|
18161
18381
|
pinLabels: pinLabelsProp.optional(),
|
|
18162
18382
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
18163
18383
|
schX: distance31.optional(),
|
|
18164
18384
|
schY: distance31.optional(),
|
|
18165
|
-
schSectionName:
|
|
18166
|
-
schSheetName:
|
|
18385
|
+
schSectionName: z117.string().optional(),
|
|
18386
|
+
schSheetName: z117.string().optional(),
|
|
18167
18387
|
width: distance31.optional(),
|
|
18168
18388
|
height: distance31.optional(),
|
|
18169
|
-
overlay:
|
|
18389
|
+
overlay: z117.array(z117.string()).optional(),
|
|
18170
18390
|
padding: distance31.optional(),
|
|
18171
18391
|
paddingLeft: distance31.optional(),
|
|
18172
18392
|
paddingRight: distance31.optional(),
|
|
18173
18393
|
paddingTop: distance31.optional(),
|
|
18174
18394
|
paddingBottom: distance31.optional(),
|
|
18175
|
-
title:
|
|
18395
|
+
title: z117.string().optional(),
|
|
18176
18396
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
18177
|
-
titleColor:
|
|
18397
|
+
titleColor: z117.string().optional(),
|
|
18178
18398
|
titleFontSize: distance31.optional(),
|
|
18179
|
-
titleInside:
|
|
18180
|
-
strokeStyle:
|
|
18399
|
+
titleInside: z117.boolean().default(false),
|
|
18400
|
+
strokeStyle: z117.enum(["solid", "dashed"]).default("solid")
|
|
18181
18401
|
}).refine(
|
|
18182
18402
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
18183
18403
|
{
|
|
@@ -18191,62 +18411,84 @@ var schematicBoxProps = z112.object({
|
|
|
18191
18411
|
);
|
|
18192
18412
|
expectTypesMatch(true);
|
|
18193
18413
|
|
|
18414
|
+
// lib/components/schematic-symbol.ts
|
|
18415
|
+
import { rotation as rotation8 } from "circuit-json";
|
|
18416
|
+
import { z as z118 } from "zod";
|
|
18417
|
+
var schematicSymbolConnections = z118.custom().pipe(z118.record(z118.string(), connectionTarget)).refine((value) => Object.keys(value).length > 0, {
|
|
18418
|
+
message: "connections must map at least one schematic symbol port"
|
|
18419
|
+
});
|
|
18420
|
+
var schematicSymbolProps = z118.object({
|
|
18421
|
+
name: z118.string().min(1),
|
|
18422
|
+
displayName: z118.string().optional(),
|
|
18423
|
+
chipRef: z118.string().min(1).optional(),
|
|
18424
|
+
symbolName: z118.string().min(1),
|
|
18425
|
+
connections: schematicSymbolConnections.optional(),
|
|
18426
|
+
schX: distance.optional(),
|
|
18427
|
+
schY: distance.optional(),
|
|
18428
|
+
schRotation: rotation8.optional(),
|
|
18429
|
+
schSectionName: z118.string().optional(),
|
|
18430
|
+
schSheetName: z118.string().optional()
|
|
18431
|
+
});
|
|
18432
|
+
expectTypesMatch(
|
|
18433
|
+
true
|
|
18434
|
+
);
|
|
18435
|
+
|
|
18194
18436
|
// lib/components/schematic-circle.ts
|
|
18195
18437
|
import { distance as distance32, point as point6 } from "circuit-json";
|
|
18196
|
-
import { z as
|
|
18197
|
-
var schematicCircleProps =
|
|
18438
|
+
import { z as z119 } from "zod";
|
|
18439
|
+
var schematicCircleProps = z119.object({
|
|
18198
18440
|
center: point6,
|
|
18199
18441
|
radius: distance32,
|
|
18200
18442
|
strokeWidth: distance32.optional(),
|
|
18201
|
-
color:
|
|
18202
|
-
isFilled:
|
|
18203
|
-
fillColor:
|
|
18204
|
-
isDashed:
|
|
18443
|
+
color: z119.string().optional(),
|
|
18444
|
+
isFilled: z119.boolean().optional().default(false),
|
|
18445
|
+
fillColor: z119.string().optional(),
|
|
18446
|
+
isDashed: z119.boolean().optional().default(false)
|
|
18205
18447
|
});
|
|
18206
18448
|
expectTypesMatch(
|
|
18207
18449
|
true
|
|
18208
18450
|
);
|
|
18209
18451
|
|
|
18210
18452
|
// lib/components/schematic-rect.ts
|
|
18211
|
-
import { distance as distance33, rotation as
|
|
18212
|
-
import { z as
|
|
18213
|
-
var schematicRectProps =
|
|
18453
|
+
import { distance as distance33, rotation as rotation9 } from "circuit-json";
|
|
18454
|
+
import { z as z120 } from "zod";
|
|
18455
|
+
var schematicRectProps = z120.object({
|
|
18214
18456
|
schX: distance33.optional(),
|
|
18215
18457
|
schY: distance33.optional(),
|
|
18216
18458
|
width: distance33,
|
|
18217
18459
|
height: distance33,
|
|
18218
|
-
rotation:
|
|
18460
|
+
rotation: rotation9.default(0),
|
|
18219
18461
|
strokeWidth: distance33.optional(),
|
|
18220
|
-
color:
|
|
18221
|
-
isFilled:
|
|
18222
|
-
fillColor:
|
|
18223
|
-
isDashed:
|
|
18462
|
+
color: z120.string().optional(),
|
|
18463
|
+
isFilled: z120.boolean().optional().default(false),
|
|
18464
|
+
fillColor: z120.string().optional(),
|
|
18465
|
+
isDashed: z120.boolean().optional().default(false)
|
|
18224
18466
|
});
|
|
18225
18467
|
expectTypesMatch(true);
|
|
18226
18468
|
|
|
18227
18469
|
// lib/components/schematic-line.ts
|
|
18228
18470
|
import { distance as distance34 } from "circuit-json";
|
|
18229
|
-
import { z as
|
|
18230
|
-
var schematicLineProps =
|
|
18471
|
+
import { z as z121 } from "zod";
|
|
18472
|
+
var schematicLineProps = z121.object({
|
|
18231
18473
|
x1: distance34,
|
|
18232
18474
|
y1: distance34,
|
|
18233
18475
|
x2: distance34,
|
|
18234
18476
|
y2: distance34,
|
|
18235
18477
|
strokeWidth: distance34.optional(),
|
|
18236
|
-
color:
|
|
18237
|
-
isDashed:
|
|
18478
|
+
color: z121.string().optional(),
|
|
18479
|
+
isDashed: z121.boolean().optional().default(false),
|
|
18238
18480
|
dashLength: distance34.optional(),
|
|
18239
18481
|
dashGap: distance34.optional()
|
|
18240
18482
|
});
|
|
18241
18483
|
expectTypesMatch(true);
|
|
18242
18484
|
|
|
18243
18485
|
// lib/components/schematic-text.ts
|
|
18244
|
-
import { distance as distance35, rotation as
|
|
18245
|
-
import { z as
|
|
18486
|
+
import { distance as distance35, rotation as rotation10 } from "circuit-json";
|
|
18487
|
+
import { z as z123 } from "zod";
|
|
18246
18488
|
|
|
18247
18489
|
// lib/common/fivePointAnchor.ts
|
|
18248
|
-
import { z as
|
|
18249
|
-
var fivePointAnchor =
|
|
18490
|
+
import { z as z122 } from "zod";
|
|
18491
|
+
var fivePointAnchor = z122.enum([
|
|
18250
18492
|
"center",
|
|
18251
18493
|
"left",
|
|
18252
18494
|
"right",
|
|
@@ -18255,39 +18497,39 @@ var fivePointAnchor = z116.enum([
|
|
|
18255
18497
|
]);
|
|
18256
18498
|
|
|
18257
18499
|
// lib/components/schematic-text.ts
|
|
18258
|
-
var schematicTextProps =
|
|
18500
|
+
var schematicTextProps = z123.object({
|
|
18259
18501
|
schX: distance35.optional(),
|
|
18260
18502
|
schY: distance35.optional(),
|
|
18261
|
-
text:
|
|
18262
|
-
fontSize:
|
|
18263
|
-
anchor:
|
|
18264
|
-
color:
|
|
18265
|
-
schRotation:
|
|
18503
|
+
text: z123.string(),
|
|
18504
|
+
fontSize: z123.number().default(1),
|
|
18505
|
+
anchor: z123.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
18506
|
+
color: z123.string().default("#000000"),
|
|
18507
|
+
schRotation: rotation10.default(0)
|
|
18266
18508
|
});
|
|
18267
18509
|
expectTypesMatch(true);
|
|
18268
18510
|
|
|
18269
18511
|
// lib/components/schematic-path.ts
|
|
18270
18512
|
import { distance as distance36, point as point7 } from "circuit-json";
|
|
18271
|
-
import { z as
|
|
18272
|
-
var schematicPathProps =
|
|
18273
|
-
points:
|
|
18274
|
-
svgPath:
|
|
18513
|
+
import { z as z124 } from "zod";
|
|
18514
|
+
var schematicPathProps = z124.object({
|
|
18515
|
+
points: z124.array(point7).optional(),
|
|
18516
|
+
svgPath: z124.string().optional(),
|
|
18275
18517
|
strokeWidth: distance36.optional(),
|
|
18276
|
-
strokeColor:
|
|
18518
|
+
strokeColor: z124.string().optional(),
|
|
18277
18519
|
dashLength: distance36.optional(),
|
|
18278
18520
|
dashGap: distance36.optional(),
|
|
18279
|
-
isFilled:
|
|
18280
|
-
fillColor:
|
|
18521
|
+
isFilled: z124.boolean().optional().default(false),
|
|
18522
|
+
fillColor: z124.string().optional()
|
|
18281
18523
|
});
|
|
18282
18524
|
expectTypesMatch(true);
|
|
18283
18525
|
|
|
18284
18526
|
// lib/components/schematic-table.ts
|
|
18285
18527
|
import { distance as distance37 } from "circuit-json";
|
|
18286
|
-
import { z as
|
|
18287
|
-
var schematicTableProps =
|
|
18528
|
+
import { z as z125 } from "zod";
|
|
18529
|
+
var schematicTableProps = z125.object({
|
|
18288
18530
|
schX: distance37.optional(),
|
|
18289
18531
|
schY: distance37.optional(),
|
|
18290
|
-
children:
|
|
18532
|
+
children: z125.any().optional(),
|
|
18291
18533
|
cellPadding: distance37.optional(),
|
|
18292
18534
|
borderWidth: distance37.optional(),
|
|
18293
18535
|
anchor: ninePointAnchor.optional(),
|
|
@@ -18297,34 +18539,34 @@ expectTypesMatch(true);
|
|
|
18297
18539
|
|
|
18298
18540
|
// lib/components/schematic-row.ts
|
|
18299
18541
|
import { distance as distance38 } from "circuit-json";
|
|
18300
|
-
import { z as
|
|
18301
|
-
var schematicRowProps =
|
|
18302
|
-
children:
|
|
18542
|
+
import { z as z126 } from "zod";
|
|
18543
|
+
var schematicRowProps = z126.object({
|
|
18544
|
+
children: z126.any().optional(),
|
|
18303
18545
|
height: distance38.optional()
|
|
18304
18546
|
});
|
|
18305
18547
|
expectTypesMatch(true);
|
|
18306
18548
|
|
|
18307
18549
|
// lib/components/schematic-cell.ts
|
|
18308
18550
|
import { distance as distance39 } from "circuit-json";
|
|
18309
|
-
import { z as
|
|
18310
|
-
var schematicCellProps =
|
|
18311
|
-
children:
|
|
18312
|
-
horizontalAlign:
|
|
18313
|
-
verticalAlign:
|
|
18551
|
+
import { z as z127 } from "zod";
|
|
18552
|
+
var schematicCellProps = z127.object({
|
|
18553
|
+
children: z127.string().optional(),
|
|
18554
|
+
horizontalAlign: z127.enum(["left", "center", "right"]).optional(),
|
|
18555
|
+
verticalAlign: z127.enum(["top", "middle", "bottom"]).optional(),
|
|
18314
18556
|
fontSize: distance39.optional(),
|
|
18315
|
-
rowSpan:
|
|
18316
|
-
colSpan:
|
|
18557
|
+
rowSpan: z127.number().optional(),
|
|
18558
|
+
colSpan: z127.number().optional(),
|
|
18317
18559
|
width: distance39.optional(),
|
|
18318
|
-
text:
|
|
18560
|
+
text: z127.string().optional()
|
|
18319
18561
|
});
|
|
18320
18562
|
expectTypesMatch(true);
|
|
18321
18563
|
|
|
18322
18564
|
// lib/components/schematic-section.ts
|
|
18323
18565
|
import { distance as distance40 } from "circuit-json";
|
|
18324
|
-
import { z as
|
|
18325
|
-
var schematicSectionProps =
|
|
18326
|
-
displayName:
|
|
18327
|
-
name:
|
|
18566
|
+
import { z as z128 } from "zod";
|
|
18567
|
+
var schematicSectionProps = z128.object({
|
|
18568
|
+
displayName: z128.string().optional(),
|
|
18569
|
+
name: z128.string(),
|
|
18328
18570
|
sectionTitleFontSize: distance40.optional()
|
|
18329
18571
|
});
|
|
18330
18572
|
expectTypesMatch(
|
|
@@ -18332,51 +18574,51 @@ expectTypesMatch(
|
|
|
18332
18574
|
);
|
|
18333
18575
|
|
|
18334
18576
|
// lib/components/schematic-sheet.ts
|
|
18335
|
-
import { z as
|
|
18336
|
-
var schematicSheetProps =
|
|
18337
|
-
name:
|
|
18338
|
-
displayName:
|
|
18339
|
-
sheetIndex:
|
|
18340
|
-
children:
|
|
18577
|
+
import { z as z129 } from "zod";
|
|
18578
|
+
var schematicSheetProps = z129.object({
|
|
18579
|
+
name: z129.string(),
|
|
18580
|
+
displayName: z129.string(),
|
|
18581
|
+
sheetIndex: z129.number().optional(),
|
|
18582
|
+
children: z129.any().optional()
|
|
18341
18583
|
});
|
|
18342
18584
|
expectTypesMatch(true);
|
|
18343
18585
|
|
|
18344
18586
|
// lib/components/copper-text.ts
|
|
18345
18587
|
import { layer_ref as layer_ref10, length as length8 } from "circuit-json";
|
|
18346
|
-
import { z as
|
|
18588
|
+
import { z as z130 } from "zod";
|
|
18347
18589
|
var copperTextProps = pcbLayoutProps.extend({
|
|
18348
|
-
text:
|
|
18590
|
+
text: z130.string(),
|
|
18349
18591
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18350
|
-
font:
|
|
18592
|
+
font: z130.enum(["tscircuit2024"]).optional(),
|
|
18351
18593
|
fontSize: length8.optional(),
|
|
18352
|
-
layers:
|
|
18353
|
-
knockout:
|
|
18354
|
-
mirrored:
|
|
18594
|
+
layers: z130.array(layer_ref10).optional(),
|
|
18595
|
+
knockout: z130.boolean().optional(),
|
|
18596
|
+
mirrored: z130.boolean().optional()
|
|
18355
18597
|
});
|
|
18356
18598
|
|
|
18357
18599
|
// lib/components/silkscreen-text.ts
|
|
18358
18600
|
import { layer_ref as layer_ref11, length as length9 } from "circuit-json";
|
|
18359
|
-
import { z as
|
|
18601
|
+
import { z as z131 } from "zod";
|
|
18360
18602
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
18361
|
-
text:
|
|
18603
|
+
text: z131.string(),
|
|
18362
18604
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18363
|
-
font:
|
|
18605
|
+
font: z131.enum(["tscircuit2024"]).optional(),
|
|
18364
18606
|
fontSize: length9.optional(),
|
|
18365
18607
|
/**
|
|
18366
18608
|
* If true, text will knock out underlying silkscreen
|
|
18367
18609
|
*/
|
|
18368
|
-
isKnockout:
|
|
18610
|
+
isKnockout: z131.boolean().optional(),
|
|
18369
18611
|
knockoutPadding: length9.optional(),
|
|
18370
18612
|
knockoutPaddingLeft: length9.optional(),
|
|
18371
18613
|
knockoutPaddingRight: length9.optional(),
|
|
18372
18614
|
knockoutPaddingTop: length9.optional(),
|
|
18373
18615
|
knockoutPaddingBottom: length9.optional(),
|
|
18374
|
-
layers:
|
|
18616
|
+
layers: z131.array(layer_ref11).optional()
|
|
18375
18617
|
});
|
|
18376
18618
|
|
|
18377
18619
|
// lib/components/silkscreen-path.ts
|
|
18378
18620
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
18379
|
-
import { z as
|
|
18621
|
+
import { z as z132 } from "zod";
|
|
18380
18622
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
18381
18623
|
pcbLeftEdgeX: true,
|
|
18382
18624
|
pcbRightEdgeX: true,
|
|
@@ -18388,7 +18630,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
18388
18630
|
pcbOffsetY: true,
|
|
18389
18631
|
pcbRotation: true
|
|
18390
18632
|
}).extend({
|
|
18391
|
-
route:
|
|
18633
|
+
route: z132.array(route_hint_point5),
|
|
18392
18634
|
strokeWidth: length10.optional()
|
|
18393
18635
|
});
|
|
18394
18636
|
|
|
@@ -18410,10 +18652,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
18410
18652
|
|
|
18411
18653
|
// lib/components/silkscreen-rect.ts
|
|
18412
18654
|
import { distance as distance42 } from "circuit-json";
|
|
18413
|
-
import { z as
|
|
18655
|
+
import { z as z133 } from "zod";
|
|
18414
18656
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18415
|
-
filled:
|
|
18416
|
-
stroke:
|
|
18657
|
+
filled: z133.boolean().default(true).optional(),
|
|
18658
|
+
stroke: z133.enum(["dashed", "solid", "none"]).optional(),
|
|
18417
18659
|
strokeWidth: distance42.optional(),
|
|
18418
18660
|
width: distance42,
|
|
18419
18661
|
height: distance42,
|
|
@@ -18422,10 +18664,10 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
18422
18664
|
|
|
18423
18665
|
// lib/components/silkscreen-circle.ts
|
|
18424
18666
|
import { distance as distance43 } from "circuit-json";
|
|
18425
|
-
import { z as
|
|
18667
|
+
import { z as z134 } from "zod";
|
|
18426
18668
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18427
|
-
isFilled:
|
|
18428
|
-
isOutline:
|
|
18669
|
+
isFilled: z134.boolean().optional(),
|
|
18670
|
+
isOutline: z134.boolean().optional(),
|
|
18429
18671
|
strokeWidth: distance43.optional(),
|
|
18430
18672
|
radius: distance43
|
|
18431
18673
|
});
|
|
@@ -18443,63 +18685,63 @@ expectTypesMatch(true);
|
|
|
18443
18685
|
|
|
18444
18686
|
// lib/components/trace-hint.ts
|
|
18445
18687
|
import { distance as distance44, layer_ref as layer_ref12, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
18446
|
-
import { z as
|
|
18447
|
-
var routeHintPointProps =
|
|
18688
|
+
import { z as z136 } from "zod";
|
|
18689
|
+
var routeHintPointProps = z136.object({
|
|
18448
18690
|
x: distance44,
|
|
18449
18691
|
y: distance44,
|
|
18450
|
-
via:
|
|
18692
|
+
via: z136.boolean().optional(),
|
|
18451
18693
|
toLayer: layer_ref12.optional()
|
|
18452
18694
|
});
|
|
18453
|
-
var traceHintProps =
|
|
18454
|
-
for:
|
|
18695
|
+
var traceHintProps = z136.object({
|
|
18696
|
+
for: z136.string().optional().describe(
|
|
18455
18697
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
18456
18698
|
),
|
|
18457
|
-
order:
|
|
18699
|
+
order: z136.number().optional(),
|
|
18458
18700
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
18459
|
-
offsets:
|
|
18460
|
-
traceWidth:
|
|
18701
|
+
offsets: z136.array(route_hint_point6).or(z136.array(routeHintPointProps)).optional(),
|
|
18702
|
+
traceWidth: z136.number().optional()
|
|
18461
18703
|
});
|
|
18462
18704
|
|
|
18463
18705
|
// lib/components/port.ts
|
|
18464
|
-
import { z as
|
|
18706
|
+
import { z as z137 } from "zod";
|
|
18465
18707
|
var portProps = commonLayoutProps.extend({
|
|
18466
|
-
name:
|
|
18467
|
-
pinNumber:
|
|
18468
|
-
schStemLength:
|
|
18469
|
-
aliases:
|
|
18470
|
-
layer:
|
|
18471
|
-
layers:
|
|
18472
|
-
schX:
|
|
18473
|
-
schY:
|
|
18708
|
+
name: z137.string().optional(),
|
|
18709
|
+
pinNumber: z137.number().optional(),
|
|
18710
|
+
schStemLength: z137.number().optional(),
|
|
18711
|
+
aliases: z137.array(z137.string()).optional(),
|
|
18712
|
+
layer: z137.string().optional(),
|
|
18713
|
+
layers: z137.array(z137.string()).optional(),
|
|
18714
|
+
schX: z137.number().optional(),
|
|
18715
|
+
schY: z137.number().optional(),
|
|
18474
18716
|
direction: direction.optional(),
|
|
18475
|
-
connectsTo:
|
|
18717
|
+
connectsTo: z137.string().or(z137.array(z137.string())).optional(),
|
|
18476
18718
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
18477
|
-
hasInversionCircle:
|
|
18719
|
+
hasInversionCircle: z137.boolean().optional()
|
|
18478
18720
|
});
|
|
18479
18721
|
|
|
18480
18722
|
// lib/components/pcb-note-text.ts
|
|
18481
18723
|
import { length as length11 } from "circuit-json";
|
|
18482
|
-
import { z as
|
|
18724
|
+
import { z as z138 } from "zod";
|
|
18483
18725
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
18484
|
-
text:
|
|
18485
|
-
anchorAlignment:
|
|
18486
|
-
font:
|
|
18726
|
+
text: z138.string(),
|
|
18727
|
+
anchorAlignment: z138.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18728
|
+
font: z138.enum(["tscircuit2024"]).optional(),
|
|
18487
18729
|
fontSize: length11.optional(),
|
|
18488
|
-
color:
|
|
18730
|
+
color: z138.string().optional()
|
|
18489
18731
|
});
|
|
18490
18732
|
expectTypesMatch(true);
|
|
18491
18733
|
|
|
18492
18734
|
// lib/components/pcb-note-rect.ts
|
|
18493
18735
|
import { distance as distance45 } from "circuit-json";
|
|
18494
|
-
import { z as
|
|
18736
|
+
import { z as z139 } from "zod";
|
|
18495
18737
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18496
18738
|
width: distance45,
|
|
18497
18739
|
height: distance45,
|
|
18498
18740
|
strokeWidth: distance45.optional(),
|
|
18499
|
-
isFilled:
|
|
18500
|
-
hasStroke:
|
|
18501
|
-
isStrokeDashed:
|
|
18502
|
-
color:
|
|
18741
|
+
isFilled: z139.boolean().optional(),
|
|
18742
|
+
hasStroke: z139.boolean().optional(),
|
|
18743
|
+
isStrokeDashed: z139.boolean().optional(),
|
|
18744
|
+
color: z139.string().optional(),
|
|
18503
18745
|
cornerRadius: distance45.optional()
|
|
18504
18746
|
});
|
|
18505
18747
|
expectTypesMatch(true);
|
|
@@ -18509,7 +18751,7 @@ import {
|
|
|
18509
18751
|
length as length12,
|
|
18510
18752
|
route_hint_point as route_hint_point7
|
|
18511
18753
|
} from "circuit-json";
|
|
18512
|
-
import { z as
|
|
18754
|
+
import { z as z140 } from "zod";
|
|
18513
18755
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
18514
18756
|
pcbLeftEdgeX: true,
|
|
18515
18757
|
pcbRightEdgeX: true,
|
|
@@ -18521,15 +18763,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
18521
18763
|
pcbOffsetY: true,
|
|
18522
18764
|
pcbRotation: true
|
|
18523
18765
|
}).extend({
|
|
18524
|
-
route:
|
|
18766
|
+
route: z140.array(route_hint_point7),
|
|
18525
18767
|
strokeWidth: length12.optional(),
|
|
18526
|
-
color:
|
|
18768
|
+
color: z140.string().optional()
|
|
18527
18769
|
});
|
|
18528
18770
|
expectTypesMatch(true);
|
|
18529
18771
|
|
|
18530
18772
|
// lib/components/pcb-note-line.ts
|
|
18531
18773
|
import { distance as distance46 } from "circuit-json";
|
|
18532
|
-
import { z as
|
|
18774
|
+
import { z as z141 } from "zod";
|
|
18533
18775
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
18534
18776
|
pcbLeftEdgeX: true,
|
|
18535
18777
|
pcbRightEdgeX: true,
|
|
@@ -18546,15 +18788,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
18546
18788
|
x2: distance46,
|
|
18547
18789
|
y2: distance46,
|
|
18548
18790
|
strokeWidth: distance46.optional(),
|
|
18549
|
-
color:
|
|
18550
|
-
isDashed:
|
|
18791
|
+
color: z141.string().optional(),
|
|
18792
|
+
isDashed: z141.boolean().optional()
|
|
18551
18793
|
});
|
|
18552
18794
|
expectTypesMatch(true);
|
|
18553
18795
|
|
|
18554
18796
|
// lib/components/pcb-note-dimension.ts
|
|
18555
18797
|
import { distance as distance47, length as length13 } from "circuit-json";
|
|
18556
|
-
import { z as
|
|
18557
|
-
var dimensionTarget2 =
|
|
18798
|
+
import { z as z142 } from "zod";
|
|
18799
|
+
var dimensionTarget2 = z142.union([z142.string(), point]);
|
|
18558
18800
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
18559
18801
|
pcbLeftEdgeX: true,
|
|
18560
18802
|
pcbRightEdgeX: true,
|
|
@@ -18568,101 +18810,101 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18568
18810
|
}).extend({
|
|
18569
18811
|
from: dimensionTarget2,
|
|
18570
18812
|
to: dimensionTarget2,
|
|
18571
|
-
text:
|
|
18813
|
+
text: z142.string().optional(),
|
|
18572
18814
|
offset: distance47.optional(),
|
|
18573
|
-
font:
|
|
18815
|
+
font: z142.enum(["tscircuit2024"]).optional(),
|
|
18574
18816
|
fontSize: length13.optional(),
|
|
18575
|
-
color:
|
|
18817
|
+
color: z142.string().optional(),
|
|
18576
18818
|
arrowSize: distance47.optional(),
|
|
18577
|
-
units:
|
|
18578
|
-
outerEdgeToEdge:
|
|
18579
|
-
centerToCenter:
|
|
18580
|
-
innerEdgeToEdge:
|
|
18819
|
+
units: z142.enum(["in", "mm"]).optional(),
|
|
18820
|
+
outerEdgeToEdge: z142.literal(true).optional(),
|
|
18821
|
+
centerToCenter: z142.literal(true).optional(),
|
|
18822
|
+
innerEdgeToEdge: z142.literal(true).optional()
|
|
18581
18823
|
});
|
|
18582
18824
|
expectTypesMatch(
|
|
18583
18825
|
true
|
|
18584
18826
|
);
|
|
18585
18827
|
|
|
18586
18828
|
// lib/platformConfig.ts
|
|
18587
|
-
import { z as
|
|
18588
|
-
var unvalidatedCircuitJson =
|
|
18589
|
-
var footprintLibraryResult =
|
|
18590
|
-
footprintCircuitJson:
|
|
18829
|
+
import { z as z143 } from "zod";
|
|
18830
|
+
var unvalidatedCircuitJson = z143.array(z143.any()).describe("Circuit JSON");
|
|
18831
|
+
var footprintLibraryResult = z143.object({
|
|
18832
|
+
footprintCircuitJson: z143.array(z143.any()),
|
|
18591
18833
|
cadModel: cadModelProp.optional()
|
|
18592
18834
|
});
|
|
18593
|
-
var pathToCircuitJsonFn =
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
).returns(
|
|
18835
|
+
var pathToCircuitJsonFn = z143.function().args(z143.string()).returns(z143.promise(footprintLibraryResult)).or(
|
|
18836
|
+
z143.function().args(
|
|
18837
|
+
z143.string(),
|
|
18838
|
+
z143.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
18839
|
+
).returns(z143.promise(footprintLibraryResult))
|
|
18598
18840
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
18599
|
-
var footprintFileParserEntry =
|
|
18600
|
-
loadFromUrl:
|
|
18841
|
+
var footprintFileParserEntry = z143.object({
|
|
18842
|
+
loadFromUrl: z143.function().args(z143.string()).returns(z143.promise(footprintLibraryResult)).describe(
|
|
18601
18843
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
18602
18844
|
)
|
|
18603
18845
|
});
|
|
18604
|
-
var spiceEngineSimulationResult =
|
|
18605
|
-
engineVersionString:
|
|
18846
|
+
var spiceEngineSimulationResult = z143.object({
|
|
18847
|
+
engineVersionString: z143.string().optional(),
|
|
18606
18848
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
18607
18849
|
});
|
|
18608
|
-
var spiceEngineZod =
|
|
18609
|
-
simulate:
|
|
18850
|
+
var spiceEngineZod = z143.object({
|
|
18851
|
+
simulate: z143.function().args(z143.string()).returns(z143.promise(spiceEngineSimulationResult)).describe(
|
|
18610
18852
|
"A function that takes a SPICE string and returns a simulation result"
|
|
18611
18853
|
)
|
|
18612
18854
|
});
|
|
18613
|
-
var defaultSpiceEngine =
|
|
18855
|
+
var defaultSpiceEngine = z143.custom(
|
|
18614
18856
|
(value) => typeof value === "string"
|
|
18615
18857
|
);
|
|
18616
|
-
var autorouterInstance =
|
|
18617
|
-
run:
|
|
18618
|
-
getOutputSimpleRouteJson:
|
|
18858
|
+
var autorouterInstance = z143.object({
|
|
18859
|
+
run: z143.function().args().returns(z143.promise(z143.unknown())).describe("Run the autorouter"),
|
|
18860
|
+
getOutputSimpleRouteJson: z143.function().args().returns(z143.promise(z143.any())).describe("Get the resulting SimpleRouteJson")
|
|
18619
18861
|
});
|
|
18620
|
-
var autorouterDefinition =
|
|
18621
|
-
createAutorouter:
|
|
18862
|
+
var autorouterDefinition = z143.object({
|
|
18863
|
+
createAutorouter: z143.function().args(z143.any(), z143.any().optional()).returns(z143.union([autorouterInstance, z143.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
18622
18864
|
});
|
|
18623
|
-
var platformFetch =
|
|
18624
|
-
var platformConfig =
|
|
18865
|
+
var platformFetch = z143.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
18866
|
+
var platformConfig = z143.object({
|
|
18625
18867
|
partsEngine: partsEngine.optional(),
|
|
18626
18868
|
autorouter: autorouterProp.optional(),
|
|
18627
|
-
autorouterMap:
|
|
18869
|
+
autorouterMap: z143.record(z143.string(), autorouterDefinition).optional(),
|
|
18628
18870
|
registryApiUrl: url.optional(),
|
|
18629
18871
|
cloudAutorouterUrl: url.optional(),
|
|
18630
|
-
projectName:
|
|
18872
|
+
projectName: z143.string().optional(),
|
|
18631
18873
|
projectBaseUrl: url.optional(),
|
|
18632
|
-
version:
|
|
18874
|
+
version: z143.string().optional(),
|
|
18633
18875
|
url: url.optional(),
|
|
18634
|
-
printBoardInformationToSilkscreen:
|
|
18635
|
-
includeBoardFiles:
|
|
18876
|
+
printBoardInformationToSilkscreen: z143.boolean().optional(),
|
|
18877
|
+
includeBoardFiles: z143.array(z143.string()).describe(
|
|
18636
18878
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
18637
18879
|
).optional(),
|
|
18638
|
-
snapshotsDir:
|
|
18880
|
+
snapshotsDir: z143.string().describe(
|
|
18639
18881
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
18640
18882
|
).optional(),
|
|
18641
18883
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
18642
|
-
unitPreference:
|
|
18643
|
-
localCacheEngine:
|
|
18644
|
-
pcbDisabled:
|
|
18645
|
-
routingDisabled:
|
|
18646
|
-
schematicDisabled:
|
|
18647
|
-
partsEngineDisabled:
|
|
18648
|
-
drcChecksDisabled:
|
|
18649
|
-
netlistDrcChecksDisabled:
|
|
18650
|
-
routingDrcChecksDisabled:
|
|
18651
|
-
placementDrcChecksDisabled:
|
|
18652
|
-
pinSpecificationDrcChecksDisabled:
|
|
18653
|
-
spiceEngineMap:
|
|
18654
|
-
footprintLibraryMap:
|
|
18655
|
-
|
|
18656
|
-
|
|
18884
|
+
unitPreference: z143.enum(["mm", "in", "mil"]).optional(),
|
|
18885
|
+
localCacheEngine: z143.any().optional(),
|
|
18886
|
+
pcbDisabled: z143.boolean().optional(),
|
|
18887
|
+
routingDisabled: z143.boolean().optional(),
|
|
18888
|
+
schematicDisabled: z143.boolean().optional(),
|
|
18889
|
+
partsEngineDisabled: z143.boolean().optional(),
|
|
18890
|
+
drcChecksDisabled: z143.boolean().optional(),
|
|
18891
|
+
netlistDrcChecksDisabled: z143.boolean().optional(),
|
|
18892
|
+
routingDrcChecksDisabled: z143.boolean().optional(),
|
|
18893
|
+
placementDrcChecksDisabled: z143.boolean().optional(),
|
|
18894
|
+
pinSpecificationDrcChecksDisabled: z143.boolean().optional(),
|
|
18895
|
+
spiceEngineMap: z143.record(z143.string(), spiceEngineZod).optional(),
|
|
18896
|
+
footprintLibraryMap: z143.record(
|
|
18897
|
+
z143.string(),
|
|
18898
|
+
z143.union([
|
|
18657
18899
|
pathToCircuitJsonFn,
|
|
18658
|
-
|
|
18659
|
-
|
|
18660
|
-
|
|
18900
|
+
z143.record(
|
|
18901
|
+
z143.string(),
|
|
18902
|
+
z143.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
18661
18903
|
)
|
|
18662
18904
|
])
|
|
18663
18905
|
).optional(),
|
|
18664
|
-
footprintFileParserMap:
|
|
18665
|
-
resolveProjectStaticFileImportUrl:
|
|
18906
|
+
footprintFileParserMap: z143.record(z143.string(), footprintFileParserEntry).optional(),
|
|
18907
|
+
resolveProjectStaticFileImportUrl: z143.function().args(z143.string()).returns(z143.promise(z143.string())).describe(
|
|
18666
18908
|
"A function that returns a string URL for static files for the project"
|
|
18667
18909
|
).optional(),
|
|
18668
18910
|
platformFetch: platformFetch.optional()
|
|
@@ -18689,7 +18931,18 @@ export {
|
|
|
18689
18931
|
ammeterPinLabels,
|
|
18690
18932
|
ammeterPins,
|
|
18691
18933
|
ammeterProps,
|
|
18934
|
+
analogAcSweepSimulationProps,
|
|
18935
|
+
analogAnalysisSimulationBaseProps,
|
|
18936
|
+
analogCapacitanceSweepParameterProps,
|
|
18937
|
+
analogCurrentSweepParameterProps,
|
|
18938
|
+
analogDcOperatingPointSimulationProps,
|
|
18939
|
+
analogDcSweepSimulationProps,
|
|
18940
|
+
analogInductanceSweepParameterProps,
|
|
18941
|
+
analogResistanceSweepParameterProps,
|
|
18692
18942
|
analogSimulationProps,
|
|
18943
|
+
analogSweepParameterProps,
|
|
18944
|
+
analogTransientSimulationProps,
|
|
18945
|
+
analogVoltageSweepParameterProps,
|
|
18693
18946
|
assemblyDeviceProps,
|
|
18694
18947
|
assemblyProps,
|
|
18695
18948
|
autorouterConfig,
|
|
@@ -18889,6 +19142,7 @@ export {
|
|
|
18889
19142
|
schematicRowProps,
|
|
18890
19143
|
schematicSectionProps,
|
|
18891
19144
|
schematicSheetProps,
|
|
19145
|
+
schematicSymbolProps,
|
|
18892
19146
|
schematicSymbolSize,
|
|
18893
19147
|
schematicTableProps,
|
|
18894
19148
|
schematicTextProps,
|