@tscircuit/props 0.0.592 → 0.0.594
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 +18 -0
- package/dist/index.d.ts +63 -14
- package/dist/index.js +471 -453
- package/dist/index.js.map +1 -1
- package/lib/common/ninePointAnchor.ts +2 -0
- package/lib/components/autoroutingphase.ts +22 -0
- package/lib/components/bus.ts +22 -0
- package/lib/components/group.ts +8 -0
- package/lib/index.ts +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -16369,6 +16369,8 @@ var autorouterConfig = z41.object({
|
|
|
16369
16369
|
"krt",
|
|
16370
16370
|
"freerouting",
|
|
16371
16371
|
"laser_prefab",
|
|
16372
|
+
"single_layer_fanout",
|
|
16373
|
+
"fanout",
|
|
16372
16374
|
"auto-jumper",
|
|
16373
16375
|
"sequential-trace",
|
|
16374
16376
|
"auto-local",
|
|
@@ -16389,6 +16391,8 @@ var autorouterPreset = z41.union([
|
|
|
16389
16391
|
z41.literal("freerouting"),
|
|
16390
16392
|
z41.literal("laser_prefab"),
|
|
16391
16393
|
// Prefabricated PCB with laser copper ablation
|
|
16394
|
+
z41.literal("single_layer_fanout"),
|
|
16395
|
+
z41.literal("fanout"),
|
|
16392
16396
|
z41.literal("auto-jumper"),
|
|
16393
16397
|
z41.literal("sequential-trace"),
|
|
16394
16398
|
z41.literal("auto-local"),
|
|
@@ -17334,20 +17338,28 @@ var traceProps = z68.union([
|
|
|
17334
17338
|
})
|
|
17335
17339
|
]);
|
|
17336
17340
|
|
|
17337
|
-
// lib/components/
|
|
17341
|
+
// lib/components/bus.ts
|
|
17338
17342
|
import { z as z69 } from "zod";
|
|
17339
|
-
var
|
|
17343
|
+
var busProps = z69.object({
|
|
17340
17344
|
name: z69.string().optional(),
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17345
|
+
connections: z69.array(z69.string()).min(2)
|
|
17346
|
+
});
|
|
17347
|
+
expectTypesMatch(true);
|
|
17348
|
+
|
|
17349
|
+
// lib/components/differentialpair.ts
|
|
17350
|
+
import { z as z70 } from "zod";
|
|
17351
|
+
var differentialPairProps = z70.object({
|
|
17352
|
+
name: z70.string().optional(),
|
|
17353
|
+
positiveConnection: z70.string(),
|
|
17354
|
+
negativeConnection: z70.string(),
|
|
17355
|
+
maxLengthSkew: z70.number().min(0).finite().optional()
|
|
17344
17356
|
});
|
|
17345
17357
|
expectTypesMatch(true);
|
|
17346
17358
|
|
|
17347
17359
|
// lib/components/footprint.ts
|
|
17348
17360
|
import { layer_ref as layer_ref5 } from "circuit-json";
|
|
17349
|
-
import { z as
|
|
17350
|
-
var footprintInsertionDirection =
|
|
17361
|
+
import { z as z71 } from "zod";
|
|
17362
|
+
var footprintInsertionDirection = z71.enum([
|
|
17351
17363
|
"from_above",
|
|
17352
17364
|
"from_left",
|
|
17353
17365
|
"from_right",
|
|
@@ -17355,11 +17367,11 @@ var footprintInsertionDirection = z70.enum([
|
|
|
17355
17367
|
"from_back"
|
|
17356
17368
|
]);
|
|
17357
17369
|
expectTypesMatch(true);
|
|
17358
|
-
var footprintProps =
|
|
17359
|
-
children:
|
|
17360
|
-
name:
|
|
17370
|
+
var footprintProps = z71.object({
|
|
17371
|
+
children: z71.any().optional(),
|
|
17372
|
+
name: z71.string().optional(),
|
|
17361
17373
|
originalLayer: layer_ref5.default("top").optional(),
|
|
17362
|
-
circuitJson:
|
|
17374
|
+
circuitJson: z71.array(z71.any()).optional(),
|
|
17363
17375
|
src: footprintProp.describe("Can be a footprint or kicad string").optional(),
|
|
17364
17376
|
insertionDirection: footprintInsertionDirection.optional().describe(
|
|
17365
17377
|
"Direction a cable or mating part is inserted into this footprint in its unrotated orientation."
|
|
@@ -17368,19 +17380,19 @@ var footprintProps = z70.object({
|
|
|
17368
17380
|
expectTypesMatch(true);
|
|
17369
17381
|
|
|
17370
17382
|
// lib/components/symbol.ts
|
|
17371
|
-
import { z as
|
|
17372
|
-
var symbolProps =
|
|
17373
|
-
originalFacingDirection:
|
|
17383
|
+
import { z as z72 } from "zod";
|
|
17384
|
+
var symbolProps = z72.object({
|
|
17385
|
+
originalFacingDirection: z72.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
17374
17386
|
width: distance.optional(),
|
|
17375
17387
|
height: distance.optional(),
|
|
17376
|
-
name:
|
|
17388
|
+
name: z72.string().optional()
|
|
17377
17389
|
});
|
|
17378
17390
|
expectTypesMatch(true);
|
|
17379
17391
|
|
|
17380
17392
|
// lib/components/battery.ts
|
|
17381
17393
|
import { voltage as voltage2 } from "circuit-json";
|
|
17382
|
-
import { z as
|
|
17383
|
-
var capacity =
|
|
17394
|
+
import { z as z73 } from "zod";
|
|
17395
|
+
var capacity = z73.number().or(z73.string().endsWith("mAh")).transform((v) => {
|
|
17384
17396
|
if (typeof v === "string") {
|
|
17385
17397
|
const valString = v.replace("mAh", "");
|
|
17386
17398
|
const num = Number.parseFloat(valString);
|
|
@@ -17395,14 +17407,14 @@ var batteryPins = lrPolarPins;
|
|
|
17395
17407
|
var batteryProps = commonComponentProps.extend({
|
|
17396
17408
|
capacity: capacity.optional(),
|
|
17397
17409
|
voltage: voltage2.optional(),
|
|
17398
|
-
standard:
|
|
17410
|
+
standard: z73.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
17399
17411
|
schOrientation: schematicOrientation.optional(),
|
|
17400
17412
|
connections: createConnectionsProp(batteryPins).optional()
|
|
17401
17413
|
});
|
|
17402
17414
|
expectTypesMatch(true);
|
|
17403
17415
|
|
|
17404
17416
|
// lib/components/mountedboard.ts
|
|
17405
|
-
import { z as
|
|
17417
|
+
import { z as z74 } from "zod";
|
|
17406
17418
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
17407
17419
|
manufacturerPartNumber: chipProps.shape.manufacturerPartNumber,
|
|
17408
17420
|
pinLabels: chipProps.shape.pinLabels,
|
|
@@ -17414,7 +17426,7 @@ var mountedboardProps = subcircuitGroupProps.extend({
|
|
|
17414
17426
|
internallyConnectedPins: chipProps.shape.internallyConnectedPins,
|
|
17415
17427
|
externallyConnectedPins: chipProps.shape.externallyConnectedPins,
|
|
17416
17428
|
boardToBoardDistance: distance.optional(),
|
|
17417
|
-
mountOrientation:
|
|
17429
|
+
mountOrientation: z74.enum(["faceDown", "faceUp"]).optional()
|
|
17418
17430
|
});
|
|
17419
17431
|
expectTypesMatch(true);
|
|
17420
17432
|
|
|
@@ -17422,29 +17434,29 @@ expectTypesMatch(true);
|
|
|
17422
17434
|
import { distance as distance20 } from "circuit-json";
|
|
17423
17435
|
|
|
17424
17436
|
// lib/common/pcbOrientation.ts
|
|
17425
|
-
import { z as
|
|
17426
|
-
var pcbOrientation =
|
|
17437
|
+
import { z as z75 } from "zod";
|
|
17438
|
+
var pcbOrientation = z75.enum(["vertical", "horizontal"]).describe(
|
|
17427
17439
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
17428
17440
|
);
|
|
17429
17441
|
expectTypesMatch(true);
|
|
17430
17442
|
|
|
17431
17443
|
// lib/components/pin-header.ts
|
|
17432
|
-
import { z as
|
|
17444
|
+
import { z as z76 } from "zod";
|
|
17433
17445
|
var pinHeaderProps = commonComponentProps.extend({
|
|
17434
|
-
pinCount:
|
|
17446
|
+
pinCount: z76.number(),
|
|
17435
17447
|
pitch: distance20.optional(),
|
|
17436
|
-
schFacingDirection:
|
|
17437
|
-
gender:
|
|
17438
|
-
showSilkscreenPinLabels:
|
|
17439
|
-
pcbPinLabels:
|
|
17440
|
-
doubleRow:
|
|
17441
|
-
rightAngle:
|
|
17448
|
+
schFacingDirection: z76.enum(["up", "down", "left", "right"]).optional(),
|
|
17449
|
+
gender: z76.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
17450
|
+
showSilkscreenPinLabels: z76.boolean().optional(),
|
|
17451
|
+
pcbPinLabels: z76.record(z76.string(), z76.string()).optional(),
|
|
17452
|
+
doubleRow: z76.boolean().optional(),
|
|
17453
|
+
rightAngle: z76.boolean().optional(),
|
|
17442
17454
|
pcbOrientation: pcbOrientation.optional(),
|
|
17443
17455
|
holeDiameter: distance20.optional(),
|
|
17444
17456
|
platedDiameter: distance20.optional(),
|
|
17445
|
-
pinLabels:
|
|
17446
|
-
connections:
|
|
17447
|
-
facingDirection:
|
|
17457
|
+
pinLabels: z76.record(z76.string(), schematicPinLabel).or(z76.array(schematicPinLabel)).optional(),
|
|
17458
|
+
connections: z76.custom().pipe(z76.record(z76.string(), connectionTarget)).optional(),
|
|
17459
|
+
facingDirection: z76.enum(["left", "right"]).optional(),
|
|
17448
17460
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
17449
17461
|
schPinStyle: schematicPinStyle.optional(),
|
|
17450
17462
|
schPinSpacing: distance20.optional(),
|
|
@@ -17454,29 +17466,29 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
17454
17466
|
expectTypesMatch(true);
|
|
17455
17467
|
|
|
17456
17468
|
// lib/components/netalias.ts
|
|
17457
|
-
import { z as
|
|
17469
|
+
import { z as z77 } from "zod";
|
|
17458
17470
|
import { rotation as rotation3 } from "circuit-json";
|
|
17459
|
-
var netAliasProps =
|
|
17460
|
-
net:
|
|
17461
|
-
connection:
|
|
17471
|
+
var netAliasProps = z77.object({
|
|
17472
|
+
net: z77.string().optional(),
|
|
17473
|
+
connection: z77.string().optional(),
|
|
17462
17474
|
schX: distance.optional(),
|
|
17463
17475
|
schY: distance.optional(),
|
|
17464
17476
|
schRotation: rotation3.optional(),
|
|
17465
|
-
anchorSide:
|
|
17477
|
+
anchorSide: z77.enum(["left", "top", "right", "bottom"]).optional()
|
|
17466
17478
|
});
|
|
17467
17479
|
expectTypesMatch(true);
|
|
17468
17480
|
|
|
17469
17481
|
// lib/components/netlabel.ts
|
|
17470
|
-
import { z as
|
|
17482
|
+
import { z as z78 } from "zod";
|
|
17471
17483
|
import { rotation as rotation4 } from "circuit-json";
|
|
17472
|
-
var netLabelProps =
|
|
17473
|
-
net:
|
|
17474
|
-
connection:
|
|
17475
|
-
connectsTo:
|
|
17484
|
+
var netLabelProps = z78.object({
|
|
17485
|
+
net: z78.string().optional(),
|
|
17486
|
+
connection: z78.string().optional(),
|
|
17487
|
+
connectsTo: z78.string().or(z78.array(z78.string())).optional(),
|
|
17476
17488
|
schX: distance.optional(),
|
|
17477
17489
|
schY: distance.optional(),
|
|
17478
17490
|
schRotation: rotation4.optional(),
|
|
17479
|
-
anchorSide:
|
|
17491
|
+
anchorSide: z78.enum(["left", "top", "right", "bottom"]).optional()
|
|
17480
17492
|
});
|
|
17481
17493
|
expectTypesMatch(true);
|
|
17482
17494
|
|
|
@@ -17491,32 +17503,32 @@ expectTypesMatch(true);
|
|
|
17491
17503
|
|
|
17492
17504
|
// lib/components/analogsimulation.ts
|
|
17493
17505
|
import { ms } from "circuit-json";
|
|
17494
|
-
import { z as
|
|
17495
|
-
var spiceEngine =
|
|
17506
|
+
import { z as z80 } from "zod";
|
|
17507
|
+
var spiceEngine = z80.custom(
|
|
17496
17508
|
(value) => typeof value === "string"
|
|
17497
17509
|
);
|
|
17498
|
-
var spiceOptions =
|
|
17499
|
-
method:
|
|
17500
|
-
reltol:
|
|
17501
|
-
abstol:
|
|
17502
|
-
vntol:
|
|
17510
|
+
var spiceOptions = z80.object({
|
|
17511
|
+
method: z80.enum(["trap", "gear"]).optional(),
|
|
17512
|
+
reltol: z80.union([z80.number(), z80.string()]).optional(),
|
|
17513
|
+
abstol: z80.union([z80.number(), z80.string()]).optional(),
|
|
17514
|
+
vntol: z80.union([z80.number(), z80.string()]).optional()
|
|
17503
17515
|
});
|
|
17504
17516
|
var analogAnalysisSimulationBaseProps = {
|
|
17505
|
-
name:
|
|
17517
|
+
name: z80.string().optional(),
|
|
17506
17518
|
spiceEngine: spiceEngine.optional(),
|
|
17507
17519
|
spiceOptions: spiceOptions.optional(),
|
|
17508
|
-
graphIndependentAxes:
|
|
17509
|
-
children:
|
|
17520
|
+
graphIndependentAxes: z80.boolean().optional(),
|
|
17521
|
+
children: z80.custom().optional()
|
|
17510
17522
|
};
|
|
17511
|
-
var analogSimulationProps =
|
|
17512
|
-
name:
|
|
17513
|
-
simulationType:
|
|
17523
|
+
var analogSimulationProps = z80.object({
|
|
17524
|
+
name: z80.string().optional(),
|
|
17525
|
+
simulationType: z80.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
17514
17526
|
duration: ms.optional(),
|
|
17515
17527
|
startTime: ms.optional(),
|
|
17516
17528
|
timePerStep: ms.optional(),
|
|
17517
17529
|
spiceEngine: spiceEngine.optional(),
|
|
17518
17530
|
spiceOptions: spiceOptions.optional(),
|
|
17519
|
-
graphIndependentAxes:
|
|
17531
|
+
graphIndependentAxes: z80.boolean().optional()
|
|
17520
17532
|
});
|
|
17521
17533
|
expectTypesMatch(
|
|
17522
17534
|
true
|
|
@@ -17524,12 +17536,12 @@ expectTypesMatch(
|
|
|
17524
17536
|
|
|
17525
17537
|
// lib/components/analogtransientsimulation.ts
|
|
17526
17538
|
import { ms as ms2 } from "circuit-json";
|
|
17527
|
-
import { z as
|
|
17539
|
+
import { z as z81 } from "zod";
|
|
17528
17540
|
var positiveMilliseconds = ms2.refine(
|
|
17529
17541
|
(milliseconds) => milliseconds > 0,
|
|
17530
17542
|
"Time must be positive"
|
|
17531
17543
|
);
|
|
17532
|
-
var analogTransientSimulationProps =
|
|
17544
|
+
var analogTransientSimulationProps = z81.object({
|
|
17533
17545
|
...analogAnalysisSimulationBaseProps,
|
|
17534
17546
|
duration: positiveMilliseconds.default("10ms"),
|
|
17535
17547
|
startTime: ms2.default("0ms"),
|
|
@@ -17537,7 +17549,7 @@ var analogTransientSimulationProps = z80.object({
|
|
|
17537
17549
|
}).superRefine((simulation, context) => {
|
|
17538
17550
|
if (simulation.startTime < 0 || simulation.startTime > simulation.duration) {
|
|
17539
17551
|
context.addIssue({
|
|
17540
|
-
code:
|
|
17552
|
+
code: z81.ZodIssueCode.custom,
|
|
17541
17553
|
path: ["startTime"],
|
|
17542
17554
|
message: "startTime must be between zero and duration"
|
|
17543
17555
|
});
|
|
@@ -17546,19 +17558,19 @@ var analogTransientSimulationProps = z80.object({
|
|
|
17546
17558
|
expectTypesMatch(true);
|
|
17547
17559
|
|
|
17548
17560
|
// lib/components/analogdcoperatingpointsimulation.ts
|
|
17549
|
-
import { z as
|
|
17550
|
-
var analogDcOperatingPointSimulationProps =
|
|
17561
|
+
import { z as z82 } from "zod";
|
|
17562
|
+
var analogDcOperatingPointSimulationProps = z82.object({
|
|
17551
17563
|
...analogAnalysisSimulationBaseProps
|
|
17552
17564
|
});
|
|
17553
17565
|
expectTypesMatch(true);
|
|
17554
17566
|
|
|
17555
17567
|
// lib/components/analogdcsweepsimulation.ts
|
|
17556
17568
|
import { current, voltage as voltage3 } from "circuit-json";
|
|
17557
|
-
import { z as
|
|
17558
|
-
var dcSweepQuantity =
|
|
17559
|
-
var analogDcSweepSimulationProps =
|
|
17569
|
+
import { z as z83 } from "zod";
|
|
17570
|
+
var dcSweepQuantity = z83.union([voltage3, current]);
|
|
17571
|
+
var analogDcSweepSimulationProps = z83.object({
|
|
17560
17572
|
...analogAnalysisSimulationBaseProps,
|
|
17561
|
-
sweepSource:
|
|
17573
|
+
sweepSource: z83.string().min(1),
|
|
17562
17574
|
sweepStart: dcSweepQuantity,
|
|
17563
17575
|
sweepStop: dcSweepQuantity,
|
|
17564
17576
|
sweepStep: dcSweepQuantity.refine(
|
|
@@ -17568,7 +17580,7 @@ var analogDcSweepSimulationProps = z82.object({
|
|
|
17568
17580
|
}).superRefine((simulation, context) => {
|
|
17569
17581
|
if (Math.sign(simulation.sweepStop - simulation.sweepStart) !== Math.sign(simulation.sweepStep)) {
|
|
17570
17582
|
context.addIssue({
|
|
17571
|
-
code:
|
|
17583
|
+
code: z83.ZodIssueCode.custom,
|
|
17572
17584
|
path: ["sweepStep"],
|
|
17573
17585
|
message: "sweepStep must move from sweepStart toward sweepStop"
|
|
17574
17586
|
});
|
|
@@ -17578,10 +17590,10 @@ expectTypesMatch(true);
|
|
|
17578
17590
|
|
|
17579
17591
|
// lib/components/analogacsweepsimulation.ts
|
|
17580
17592
|
import { frequency as frequency3 } from "circuit-json";
|
|
17581
|
-
import { z as
|
|
17582
|
-
var analogAcSweepSimulationProps =
|
|
17593
|
+
import { z as z84 } from "zod";
|
|
17594
|
+
var analogAcSweepSimulationProps = z84.object({
|
|
17583
17595
|
...analogAnalysisSimulationBaseProps,
|
|
17584
|
-
sweepType:
|
|
17596
|
+
sweepType: z84.enum(["linear", "decade", "octave"]),
|
|
17585
17597
|
startFrequency: frequency3.refine(
|
|
17586
17598
|
(startFrequencyHz) => startFrequencyHz > 0,
|
|
17587
17599
|
"startFrequency must be positive"
|
|
@@ -17590,12 +17602,12 @@ var analogAcSweepSimulationProps = z83.object({
|
|
|
17590
17602
|
(stopFrequencyHz) => stopFrequencyHz > 0,
|
|
17591
17603
|
"stopFrequency must be positive"
|
|
17592
17604
|
),
|
|
17593
|
-
samplesPerInterval:
|
|
17594
|
-
sampleCount:
|
|
17605
|
+
samplesPerInterval: z84.number().int().positive().optional(),
|
|
17606
|
+
sampleCount: z84.number().int().positive().optional()
|
|
17595
17607
|
}).superRefine((simulation, context) => {
|
|
17596
17608
|
if (simulation.stopFrequency <= simulation.startFrequency) {
|
|
17597
17609
|
context.addIssue({
|
|
17598
|
-
code:
|
|
17610
|
+
code: z84.ZodIssueCode.custom,
|
|
17599
17611
|
path: ["stopFrequency"],
|
|
17600
17612
|
message: "stopFrequency must be greater than startFrequency"
|
|
17601
17613
|
});
|
|
@@ -17603,14 +17615,14 @@ var analogAcSweepSimulationProps = z83.object({
|
|
|
17603
17615
|
if (simulation.sweepType === "linear") {
|
|
17604
17616
|
if (simulation.sampleCount === void 0) {
|
|
17605
17617
|
context.addIssue({
|
|
17606
|
-
code:
|
|
17618
|
+
code: z84.ZodIssueCode.custom,
|
|
17607
17619
|
path: ["sampleCount"],
|
|
17608
17620
|
message: "sampleCount is required for a linear AC sweep"
|
|
17609
17621
|
});
|
|
17610
17622
|
}
|
|
17611
17623
|
if (simulation.samplesPerInterval !== void 0) {
|
|
17612
17624
|
context.addIssue({
|
|
17613
|
-
code:
|
|
17625
|
+
code: z84.ZodIssueCode.custom,
|
|
17614
17626
|
path: ["samplesPerInterval"],
|
|
17615
17627
|
message: "samplesPerInterval is only valid for decade or octave sweeps"
|
|
17616
17628
|
});
|
|
@@ -17619,14 +17631,14 @@ var analogAcSweepSimulationProps = z83.object({
|
|
|
17619
17631
|
}
|
|
17620
17632
|
if (simulation.samplesPerInterval === void 0) {
|
|
17621
17633
|
context.addIssue({
|
|
17622
|
-
code:
|
|
17634
|
+
code: z84.ZodIssueCode.custom,
|
|
17623
17635
|
path: ["samplesPerInterval"],
|
|
17624
17636
|
message: "samplesPerInterval is required for decade or octave sweeps"
|
|
17625
17637
|
});
|
|
17626
17638
|
}
|
|
17627
17639
|
if (simulation.sampleCount !== void 0) {
|
|
17628
17640
|
context.addIssue({
|
|
17629
|
-
code:
|
|
17641
|
+
code: z84.ZodIssueCode.custom,
|
|
17630
17642
|
path: ["sampleCount"],
|
|
17631
17643
|
message: "sampleCount is only valid for a linear sweep"
|
|
17632
17644
|
});
|
|
@@ -17642,43 +17654,43 @@ import {
|
|
|
17642
17654
|
resistance as resistance3,
|
|
17643
17655
|
voltage as voltage4
|
|
17644
17656
|
} from "circuit-json";
|
|
17645
|
-
import { z as
|
|
17646
|
-
var resistanceSweepQuantity = resistance3.pipe(
|
|
17647
|
-
var capacitanceSweepQuantity = capacitance4.pipe(
|
|
17648
|
-
var inductanceSweepQuantity = inductance.pipe(
|
|
17649
|
-
var voltageSweepQuantity = voltage4.pipe(
|
|
17650
|
-
var currentSweepQuantity = current2.pipe(
|
|
17657
|
+
import { z as z85 } from "zod";
|
|
17658
|
+
var resistanceSweepQuantity = resistance3.pipe(z85.number());
|
|
17659
|
+
var capacitanceSweepQuantity = capacitance4.pipe(z85.number());
|
|
17660
|
+
var inductanceSweepQuantity = inductance.pipe(z85.number());
|
|
17661
|
+
var voltageSweepQuantity = voltage4.pipe(z85.number());
|
|
17662
|
+
var currentSweepQuantity = current2.pipe(z85.number());
|
|
17651
17663
|
var createAnalogSweepCoordinateProps = (sweepQuantity) => ({
|
|
17652
|
-
name:
|
|
17653
|
-
values:
|
|
17664
|
+
name: z85.string().optional(),
|
|
17665
|
+
values: z85.array(sweepQuantity).min(1).optional(),
|
|
17654
17666
|
start: sweepQuantity.optional(),
|
|
17655
17667
|
stop: sweepQuantity.optional(),
|
|
17656
17668
|
step: sweepQuantity.optional()
|
|
17657
17669
|
});
|
|
17658
|
-
var analogResistanceSweepParameterProps =
|
|
17670
|
+
var analogResistanceSweepParameterProps = z85.object({
|
|
17659
17671
|
...createAnalogSweepCoordinateProps(resistanceSweepQuantity),
|
|
17660
|
-
parameterType:
|
|
17661
|
-
resistorRef:
|
|
17672
|
+
parameterType: z85.literal("resistance"),
|
|
17673
|
+
resistorRef: z85.string().min(1)
|
|
17662
17674
|
}).strict();
|
|
17663
|
-
var analogCapacitanceSweepParameterProps =
|
|
17675
|
+
var analogCapacitanceSweepParameterProps = z85.object({
|
|
17664
17676
|
...createAnalogSweepCoordinateProps(capacitanceSweepQuantity),
|
|
17665
|
-
parameterType:
|
|
17666
|
-
capacitorRef:
|
|
17677
|
+
parameterType: z85.literal("capacitance"),
|
|
17678
|
+
capacitorRef: z85.string().min(1)
|
|
17667
17679
|
}).strict();
|
|
17668
|
-
var analogInductanceSweepParameterProps =
|
|
17680
|
+
var analogInductanceSweepParameterProps = z85.object({
|
|
17669
17681
|
...createAnalogSweepCoordinateProps(inductanceSweepQuantity),
|
|
17670
|
-
parameterType:
|
|
17671
|
-
inductorRef:
|
|
17682
|
+
parameterType: z85.literal("inductance"),
|
|
17683
|
+
inductorRef: z85.string().min(1)
|
|
17672
17684
|
}).strict();
|
|
17673
|
-
var analogVoltageSweepParameterProps =
|
|
17685
|
+
var analogVoltageSweepParameterProps = z85.object({
|
|
17674
17686
|
...createAnalogSweepCoordinateProps(voltageSweepQuantity),
|
|
17675
|
-
parameterType:
|
|
17676
|
-
net:
|
|
17687
|
+
parameterType: z85.literal("voltage"),
|
|
17688
|
+
net: z85.string().min(1)
|
|
17677
17689
|
}).strict();
|
|
17678
|
-
var analogCurrentSweepParameterProps =
|
|
17690
|
+
var analogCurrentSweepParameterProps = z85.object({
|
|
17679
17691
|
...createAnalogSweepCoordinateProps(currentSweepQuantity),
|
|
17680
|
-
parameterType:
|
|
17681
|
-
currentSourceRef:
|
|
17692
|
+
parameterType: z85.literal("current"),
|
|
17693
|
+
currentSourceRef: z85.string().min(1)
|
|
17682
17694
|
}).strict();
|
|
17683
17695
|
var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
17684
17696
|
const hasExplicitSweepCoordinates = sweepCoordinates.values !== void 0;
|
|
@@ -17690,34 +17702,34 @@ var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
|
17690
17702
|
const hasRangeCoordinates = rangeCoordinateCount > 0;
|
|
17691
17703
|
if (hasExplicitSweepCoordinates === hasRangeCoordinates) {
|
|
17692
17704
|
context.addIssue({
|
|
17693
|
-
code:
|
|
17705
|
+
code: z85.ZodIssueCode.custom,
|
|
17694
17706
|
message: "Provide either values or start/stop/step"
|
|
17695
17707
|
});
|
|
17696
17708
|
return;
|
|
17697
17709
|
}
|
|
17698
17710
|
if (rangeCoordinateCount !== 0 && rangeCoordinateCount !== 3) {
|
|
17699
17711
|
context.addIssue({
|
|
17700
|
-
code:
|
|
17712
|
+
code: z85.ZodIssueCode.custom,
|
|
17701
17713
|
message: "start, stop, and step must be provided together"
|
|
17702
17714
|
});
|
|
17703
17715
|
return;
|
|
17704
17716
|
}
|
|
17705
17717
|
if (sweepCoordinates.step === 0) {
|
|
17706
17718
|
context.addIssue({
|
|
17707
|
-
code:
|
|
17719
|
+
code: z85.ZodIssueCode.custom,
|
|
17708
17720
|
path: ["step"],
|
|
17709
17721
|
message: "step must be nonzero"
|
|
17710
17722
|
});
|
|
17711
17723
|
}
|
|
17712
17724
|
if (sweepCoordinates.start !== void 0 && sweepCoordinates.stop !== void 0 && sweepCoordinates.step !== void 0 && Math.sign(sweepCoordinates.stop - sweepCoordinates.start) !== Math.sign(sweepCoordinates.step)) {
|
|
17713
17725
|
context.addIssue({
|
|
17714
|
-
code:
|
|
17726
|
+
code: z85.ZodIssueCode.custom,
|
|
17715
17727
|
path: ["step"],
|
|
17716
17728
|
message: "step must move from start toward stop"
|
|
17717
17729
|
});
|
|
17718
17730
|
}
|
|
17719
17731
|
};
|
|
17720
|
-
var analogSweepParameterProps =
|
|
17732
|
+
var analogSweepParameterProps = z85.discriminatedUnion("parameterType", [
|
|
17721
17733
|
analogResistanceSweepParameterProps,
|
|
17722
17734
|
analogCapacitanceSweepParameterProps,
|
|
17723
17735
|
analogInductanceSweepParameterProps,
|
|
@@ -17732,27 +17744,32 @@ expectTypesMatch(true);
|
|
|
17732
17744
|
expectTypesMatch(true);
|
|
17733
17745
|
|
|
17734
17746
|
// lib/components/autoroutingphase.ts
|
|
17735
|
-
import { z as
|
|
17736
|
-
var
|
|
17737
|
-
|
|
17738
|
-
|
|
17747
|
+
import { z as z86 } from "zod";
|
|
17748
|
+
var busFanoutDirection = z86.union([
|
|
17749
|
+
ninePointAnchor,
|
|
17750
|
+
z86.object({ direction: ninePointAnchor })
|
|
17751
|
+
]);
|
|
17752
|
+
var autoroutingPhaseProps = z86.object({
|
|
17753
|
+
key: z86.any().optional(),
|
|
17754
|
+
name: z86.string().optional(),
|
|
17739
17755
|
autorouter: autorouterProp.optional(),
|
|
17740
|
-
phaseIndex:
|
|
17756
|
+
phaseIndex: z86.number().optional(),
|
|
17741
17757
|
...routingTolerances.shape,
|
|
17742
|
-
region:
|
|
17743
|
-
shape:
|
|
17744
|
-
minX:
|
|
17745
|
-
maxX:
|
|
17746
|
-
minY:
|
|
17747
|
-
maxY:
|
|
17758
|
+
region: z86.object({
|
|
17759
|
+
shape: z86.literal("rect").optional(),
|
|
17760
|
+
minX: z86.number(),
|
|
17761
|
+
maxX: z86.number(),
|
|
17762
|
+
minY: z86.number(),
|
|
17763
|
+
maxY: z86.number()
|
|
17748
17764
|
}).optional(),
|
|
17749
|
-
connection:
|
|
17750
|
-
connections:
|
|
17751
|
-
reroute:
|
|
17765
|
+
connection: z86.string().optional(),
|
|
17766
|
+
connections: z86.array(z86.string()).optional(),
|
|
17767
|
+
reroute: z86.boolean().optional(),
|
|
17768
|
+
busFanoutDirections: z86.record(busFanoutDirection).optional()
|
|
17752
17769
|
}).superRefine((value, ctx) => {
|
|
17753
17770
|
if (value.reroute !== void 0 && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
17754
17771
|
ctx.addIssue({
|
|
17755
|
-
code:
|
|
17772
|
+
code: z86.ZodIssueCode.custom,
|
|
17756
17773
|
message: "region, connection, or connections is required when reroute is provided",
|
|
17757
17774
|
path: ["region"]
|
|
17758
17775
|
});
|
|
@@ -17761,15 +17778,15 @@ var autoroutingPhaseProps = z85.object({
|
|
|
17761
17778
|
expectTypesMatch(true);
|
|
17762
17779
|
|
|
17763
17780
|
// lib/components/spicemodel.ts
|
|
17764
|
-
import { z as
|
|
17765
|
-
var spicemodelProps =
|
|
17766
|
-
source:
|
|
17767
|
-
spicePinMapping:
|
|
17781
|
+
import { z as z87 } from "zod";
|
|
17782
|
+
var spicemodelProps = z87.object({
|
|
17783
|
+
source: z87.string(),
|
|
17784
|
+
spicePinMapping: z87.record(z87.string(), z87.string()).optional()
|
|
17768
17785
|
});
|
|
17769
17786
|
expectTypesMatch(true);
|
|
17770
17787
|
|
|
17771
17788
|
// lib/components/transistor.ts
|
|
17772
|
-
import { z as
|
|
17789
|
+
import { z as z88 } from "zod";
|
|
17773
17790
|
var transistorPinsLabels = [
|
|
17774
17791
|
"pin1",
|
|
17775
17792
|
"pin2",
|
|
@@ -17782,7 +17799,7 @@ var transistorPinsLabels = [
|
|
|
17782
17799
|
"drain"
|
|
17783
17800
|
];
|
|
17784
17801
|
var transistorProps = commonComponentProps.extend({
|
|
17785
|
-
type:
|
|
17802
|
+
type: z88.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
17786
17803
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
17787
17804
|
});
|
|
17788
17805
|
var transistorPins = [
|
|
@@ -17796,7 +17813,7 @@ var transistorPins = [
|
|
|
17796
17813
|
expectTypesMatch(true);
|
|
17797
17814
|
|
|
17798
17815
|
// lib/components/mosfet.ts
|
|
17799
|
-
import { z as
|
|
17816
|
+
import { z as z89 } from "zod";
|
|
17800
17817
|
var mosfetPins = [
|
|
17801
17818
|
"pin1",
|
|
17802
17819
|
"drain",
|
|
@@ -17806,11 +17823,11 @@ var mosfetPins = [
|
|
|
17806
17823
|
"gate"
|
|
17807
17824
|
];
|
|
17808
17825
|
var mosfetProps = commonComponentProps.extend({
|
|
17809
|
-
channelType:
|
|
17810
|
-
mosfetMode:
|
|
17811
|
-
symbolDrainSide:
|
|
17812
|
-
symbolSourceSide:
|
|
17813
|
-
symbolGateSide:
|
|
17826
|
+
channelType: z89.enum(["n", "p"]),
|
|
17827
|
+
mosfetMode: z89.enum(["enhancement", "depletion"]),
|
|
17828
|
+
symbolDrainSide: z89.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17829
|
+
symbolSourceSide: z89.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17830
|
+
symbolGateSide: z89.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17814
17831
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
17815
17832
|
});
|
|
17816
17833
|
expectTypesMatch(true);
|
|
@@ -17832,29 +17849,29 @@ expectTypesMatch(true);
|
|
|
17832
17849
|
|
|
17833
17850
|
// lib/components/inductor.ts
|
|
17834
17851
|
import { inductance as inductance2 } from "circuit-json";
|
|
17835
|
-
import { z as
|
|
17852
|
+
import { z as z91 } from "zod";
|
|
17836
17853
|
var inductorPins = lrPins;
|
|
17837
17854
|
var inductorProps = commonComponentProps.extend({
|
|
17838
17855
|
inductance: inductance2,
|
|
17839
|
-
maxCurrentRating:
|
|
17856
|
+
maxCurrentRating: z91.union([z91.string(), z91.number()]).optional(),
|
|
17840
17857
|
schOrientation: schematicOrientation.optional(),
|
|
17841
17858
|
connections: createConnectionsProp(inductorPins).optional()
|
|
17842
17859
|
});
|
|
17843
17860
|
expectTypesMatch(true);
|
|
17844
17861
|
|
|
17845
17862
|
// lib/components/internal-circuit.ts
|
|
17846
|
-
import { z as
|
|
17847
|
-
var internalCircuitProps =
|
|
17848
|
-
children:
|
|
17863
|
+
import { z as z92 } from "zod";
|
|
17864
|
+
var internalCircuitProps = z92.object({
|
|
17865
|
+
children: z92.custom().optional()
|
|
17849
17866
|
});
|
|
17850
17867
|
expectTypesMatch(
|
|
17851
17868
|
true
|
|
17852
17869
|
);
|
|
17853
17870
|
|
|
17854
17871
|
// lib/components/diode.ts
|
|
17855
|
-
import { z as
|
|
17872
|
+
import { z as z93 } from "zod";
|
|
17856
17873
|
var diodePins = lrPolarPins;
|
|
17857
|
-
var diodeConnectionKeys =
|
|
17874
|
+
var diodeConnectionKeys = z93.enum([
|
|
17858
17875
|
"anode",
|
|
17859
17876
|
"cathode",
|
|
17860
17877
|
"pin1",
|
|
@@ -17862,13 +17879,13 @@ var diodeConnectionKeys = z92.enum([
|
|
|
17862
17879
|
"pos",
|
|
17863
17880
|
"neg"
|
|
17864
17881
|
]);
|
|
17865
|
-
var connectionTarget3 =
|
|
17866
|
-
var connectionsProp2 =
|
|
17867
|
-
var diodePinLabelsProp =
|
|
17868
|
-
|
|
17869
|
-
schematicPinLabel.or(
|
|
17882
|
+
var connectionTarget3 = z93.string().or(z93.array(z93.string()).readonly()).or(z93.array(z93.string()));
|
|
17883
|
+
var connectionsProp2 = z93.record(diodeConnectionKeys, connectionTarget3);
|
|
17884
|
+
var diodePinLabelsProp = z93.record(
|
|
17885
|
+
z93.enum(diodePins),
|
|
17886
|
+
schematicPinLabel.or(z93.array(schematicPinLabel).readonly()).or(z93.array(schematicPinLabel))
|
|
17870
17887
|
);
|
|
17871
|
-
var diodeVariant =
|
|
17888
|
+
var diodeVariant = z93.enum([
|
|
17872
17889
|
"standard",
|
|
17873
17890
|
"schottky",
|
|
17874
17891
|
"zener",
|
|
@@ -17879,12 +17896,12 @@ var diodeVariant = z92.enum([
|
|
|
17879
17896
|
var diodeProps = commonComponentProps.extend({
|
|
17880
17897
|
connections: connectionsProp2.optional(),
|
|
17881
17898
|
variant: diodeVariant.optional().default("standard"),
|
|
17882
|
-
standard:
|
|
17883
|
-
schottky:
|
|
17884
|
-
zener:
|
|
17885
|
-
avalanche:
|
|
17886
|
-
photo:
|
|
17887
|
-
tvs:
|
|
17899
|
+
standard: z93.boolean().optional(),
|
|
17900
|
+
schottky: z93.boolean().optional(),
|
|
17901
|
+
zener: z93.boolean().optional(),
|
|
17902
|
+
avalanche: z93.boolean().optional(),
|
|
17903
|
+
photo: z93.boolean().optional(),
|
|
17904
|
+
tvs: z93.boolean().optional(),
|
|
17888
17905
|
schOrientation: schematicOrientation.optional(),
|
|
17889
17906
|
pinLabels: diodePinLabelsProp.optional()
|
|
17890
17907
|
}).superRefine((data, ctx) => {
|
|
@@ -17898,11 +17915,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17898
17915
|
].filter(Boolean).length;
|
|
17899
17916
|
if (enabledFlags > 1) {
|
|
17900
17917
|
ctx.addIssue({
|
|
17901
|
-
code:
|
|
17918
|
+
code: z93.ZodIssueCode.custom,
|
|
17902
17919
|
message: "Exactly one diode variant must be enabled",
|
|
17903
17920
|
path: []
|
|
17904
17921
|
});
|
|
17905
|
-
return
|
|
17922
|
+
return z93.INVALID;
|
|
17906
17923
|
}
|
|
17907
17924
|
}).transform((data) => {
|
|
17908
17925
|
const result = {
|
|
@@ -17948,34 +17965,34 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17948
17965
|
expectTypesMatch(true);
|
|
17949
17966
|
|
|
17950
17967
|
// lib/components/led.ts
|
|
17951
|
-
import { z as
|
|
17968
|
+
import { z as z94 } from "zod";
|
|
17952
17969
|
var ledProps = commonComponentProps.extend({
|
|
17953
|
-
color:
|
|
17954
|
-
wavelength:
|
|
17955
|
-
schDisplayValue:
|
|
17970
|
+
color: z94.string().optional(),
|
|
17971
|
+
wavelength: z94.string().optional(),
|
|
17972
|
+
schDisplayValue: z94.string().optional(),
|
|
17956
17973
|
schOrientation: schematicOrientation.optional(),
|
|
17957
17974
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
17958
|
-
laser:
|
|
17975
|
+
laser: z94.boolean().optional()
|
|
17959
17976
|
});
|
|
17960
17977
|
var ledPins = lrPolarPins;
|
|
17961
17978
|
|
|
17962
17979
|
// lib/components/switch.ts
|
|
17963
17980
|
import { ms as ms3, frequency as frequency4 } from "circuit-json";
|
|
17964
|
-
import { z as
|
|
17981
|
+
import { z as z95 } from "zod";
|
|
17965
17982
|
var switchProps = commonComponentProps.extend({
|
|
17966
|
-
type:
|
|
17967
|
-
isNormallyClosed:
|
|
17968
|
-
spst:
|
|
17969
|
-
spdt:
|
|
17970
|
-
dpst:
|
|
17971
|
-
dpdt:
|
|
17983
|
+
type: z95.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
17984
|
+
isNormallyClosed: z95.boolean().optional().default(false),
|
|
17985
|
+
spst: z95.boolean().optional(),
|
|
17986
|
+
spdt: z95.boolean().optional(),
|
|
17987
|
+
dpst: z95.boolean().optional(),
|
|
17988
|
+
dpdt: z95.boolean().optional(),
|
|
17972
17989
|
pinLabels: pinLabelsProp.optional(),
|
|
17973
17990
|
simSwitchFrequency: frequency4.optional(),
|
|
17974
17991
|
simCloseAt: ms3.optional(),
|
|
17975
17992
|
simOpenAt: ms3.optional(),
|
|
17976
|
-
simStartClosed:
|
|
17977
|
-
simStartOpen:
|
|
17978
|
-
connections:
|
|
17993
|
+
simStartClosed: z95.boolean().optional(),
|
|
17994
|
+
simStartOpen: z95.boolean().optional(),
|
|
17995
|
+
connections: z95.custom().pipe(z95.record(z95.string(), connectionTarget)).optional()
|
|
17979
17996
|
}).transform((props) => {
|
|
17980
17997
|
const updatedProps = { ...props };
|
|
17981
17998
|
if (updatedProps.dpdt) {
|
|
@@ -18007,33 +18024,33 @@ expectTypesMatch(true);
|
|
|
18007
18024
|
|
|
18008
18025
|
// lib/components/fabrication-note-text.ts
|
|
18009
18026
|
import { length as length4 } from "circuit-json";
|
|
18010
|
-
import { z as
|
|
18027
|
+
import { z as z96 } from "zod";
|
|
18011
18028
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
18012
|
-
text:
|
|
18013
|
-
anchorAlignment:
|
|
18014
|
-
font:
|
|
18029
|
+
text: z96.string(),
|
|
18030
|
+
anchorAlignment: z96.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18031
|
+
font: z96.enum(["tscircuit2024"]).optional(),
|
|
18015
18032
|
fontSize: length4.optional(),
|
|
18016
|
-
color:
|
|
18033
|
+
color: z96.string().optional()
|
|
18017
18034
|
});
|
|
18018
18035
|
expectTypesMatch(true);
|
|
18019
18036
|
|
|
18020
18037
|
// lib/components/fabrication-note-rect.ts
|
|
18021
18038
|
import { distance as distance21 } from "circuit-json";
|
|
18022
|
-
import { z as
|
|
18039
|
+
import { z as z97 } from "zod";
|
|
18023
18040
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18024
18041
|
width: distance21,
|
|
18025
18042
|
height: distance21,
|
|
18026
18043
|
strokeWidth: distance21.optional(),
|
|
18027
|
-
isFilled:
|
|
18028
|
-
hasStroke:
|
|
18029
|
-
isStrokeDashed:
|
|
18030
|
-
color:
|
|
18044
|
+
isFilled: z97.boolean().optional(),
|
|
18045
|
+
hasStroke: z97.boolean().optional(),
|
|
18046
|
+
isStrokeDashed: z97.boolean().optional(),
|
|
18047
|
+
color: z97.string().optional(),
|
|
18031
18048
|
cornerRadius: distance21.optional()
|
|
18032
18049
|
});
|
|
18033
18050
|
|
|
18034
18051
|
// lib/components/fabrication-note-path.ts
|
|
18035
18052
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
18036
|
-
import { z as
|
|
18053
|
+
import { z as z98 } from "zod";
|
|
18037
18054
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
18038
18055
|
pcbLeftEdgeX: true,
|
|
18039
18056
|
pcbRightEdgeX: true,
|
|
@@ -18045,15 +18062,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
18045
18062
|
pcbOffsetY: true,
|
|
18046
18063
|
pcbRotation: true
|
|
18047
18064
|
}).extend({
|
|
18048
|
-
route:
|
|
18065
|
+
route: z98.array(route_hint_point3),
|
|
18049
18066
|
strokeWidth: length5.optional(),
|
|
18050
|
-
color:
|
|
18067
|
+
color: z98.string().optional()
|
|
18051
18068
|
});
|
|
18052
18069
|
|
|
18053
18070
|
// lib/components/fabrication-note-dimension.ts
|
|
18054
18071
|
import { distance as distance22, length as length6 } from "circuit-json";
|
|
18055
|
-
import { z as
|
|
18056
|
-
var dimensionTarget =
|
|
18072
|
+
import { z as z99 } from "zod";
|
|
18073
|
+
var dimensionTarget = z99.union([z99.string(), point]);
|
|
18057
18074
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
18058
18075
|
pcbLeftEdgeX: true,
|
|
18059
18076
|
pcbRightEdgeX: true,
|
|
@@ -18067,54 +18084,54 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18067
18084
|
}).extend({
|
|
18068
18085
|
from: dimensionTarget,
|
|
18069
18086
|
to: dimensionTarget,
|
|
18070
|
-
text:
|
|
18087
|
+
text: z99.string().optional(),
|
|
18071
18088
|
offset: distance22.optional(),
|
|
18072
|
-
font:
|
|
18089
|
+
font: z99.enum(["tscircuit2024"]).optional(),
|
|
18073
18090
|
fontSize: length6.optional(),
|
|
18074
|
-
color:
|
|
18091
|
+
color: z99.string().optional(),
|
|
18075
18092
|
arrowSize: distance22.optional(),
|
|
18076
|
-
units:
|
|
18077
|
-
outerEdgeToEdge:
|
|
18078
|
-
centerToCenter:
|
|
18079
|
-
innerEdgeToEdge:
|
|
18093
|
+
units: z99.enum(["in", "mm"]).optional(),
|
|
18094
|
+
outerEdgeToEdge: z99.literal(true).optional(),
|
|
18095
|
+
centerToCenter: z99.literal(true).optional(),
|
|
18096
|
+
innerEdgeToEdge: z99.literal(true).optional()
|
|
18080
18097
|
});
|
|
18081
18098
|
expectTypesMatch(true);
|
|
18082
18099
|
|
|
18083
18100
|
// lib/components/pcb-trace.ts
|
|
18084
18101
|
import { distance as distance23, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
18085
|
-
import { z as
|
|
18086
|
-
var pcbTraceProps =
|
|
18087
|
-
layer:
|
|
18102
|
+
import { z as z100 } from "zod";
|
|
18103
|
+
var pcbTraceProps = z100.object({
|
|
18104
|
+
layer: z100.string().optional(),
|
|
18088
18105
|
thickness: distance23.optional(),
|
|
18089
|
-
route:
|
|
18106
|
+
route: z100.array(route_hint_point4)
|
|
18090
18107
|
});
|
|
18091
18108
|
|
|
18092
18109
|
// lib/components/via.ts
|
|
18093
18110
|
import { distance as distance24, layer_ref as layer_ref6 } from "circuit-json";
|
|
18094
|
-
import { z as
|
|
18111
|
+
import { z as z101 } from "zod";
|
|
18095
18112
|
var viaProps = commonLayoutProps.extend({
|
|
18096
|
-
name:
|
|
18113
|
+
name: z101.string().optional(),
|
|
18097
18114
|
fromLayer: layer_ref6.optional(),
|
|
18098
18115
|
toLayer: layer_ref6.optional(),
|
|
18099
18116
|
holeDiameter: distance24.optional(),
|
|
18100
18117
|
outerDiameter: distance24.optional(),
|
|
18101
|
-
layers:
|
|
18102
|
-
connectsTo:
|
|
18103
|
-
netIsAssignable:
|
|
18118
|
+
layers: z101.array(layer_ref6).optional(),
|
|
18119
|
+
connectsTo: z101.string().or(z101.array(z101.string())).optional(),
|
|
18120
|
+
netIsAssignable: z101.boolean().optional()
|
|
18104
18121
|
});
|
|
18105
18122
|
expectTypesMatch(true);
|
|
18106
18123
|
|
|
18107
18124
|
// lib/components/testpoint.ts
|
|
18108
18125
|
import { distance as distance25 } from "circuit-json";
|
|
18109
|
-
import { z as
|
|
18126
|
+
import { z as z102 } from "zod";
|
|
18110
18127
|
var testpointPins = ["pin1"];
|
|
18111
|
-
var testpointConnectionsProp =
|
|
18128
|
+
var testpointConnectionsProp = z102.object({
|
|
18112
18129
|
pin1: connectionTarget
|
|
18113
18130
|
}).strict();
|
|
18114
18131
|
var testpointProps = commonComponentProps.extend({
|
|
18115
18132
|
connections: testpointConnectionsProp.optional(),
|
|
18116
|
-
footprintVariant:
|
|
18117
|
-
padShape:
|
|
18133
|
+
footprintVariant: z102.enum(["pad", "through_hole"]).optional(),
|
|
18134
|
+
padShape: z102.enum(["rect", "circle"]).optional().default("circle"),
|
|
18118
18135
|
padDiameter: distance25.optional(),
|
|
18119
18136
|
holeDiameter: distance25.optional(),
|
|
18120
18137
|
width: distance25.optional(),
|
|
@@ -18126,45 +18143,45 @@ var testpointProps = commonComponentProps.extend({
|
|
|
18126
18143
|
expectTypesMatch(true);
|
|
18127
18144
|
|
|
18128
18145
|
// lib/components/breakoutpoint.ts
|
|
18129
|
-
import { z as
|
|
18146
|
+
import { z as z103 } from "zod";
|
|
18130
18147
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
18131
|
-
connection:
|
|
18148
|
+
connection: z103.string()
|
|
18132
18149
|
});
|
|
18133
18150
|
expectTypesMatch(true);
|
|
18134
18151
|
|
|
18135
18152
|
// lib/components/pcb-keepout.ts
|
|
18136
18153
|
import { distance as distance26, layer_ref as layer_ref7 } from "circuit-json";
|
|
18137
|
-
import { z as
|
|
18138
|
-
var pcbKeepoutProps =
|
|
18154
|
+
import { z as z104 } from "zod";
|
|
18155
|
+
var pcbKeepoutProps = z104.union([
|
|
18139
18156
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18140
|
-
shape:
|
|
18157
|
+
shape: z104.literal("circle"),
|
|
18141
18158
|
radius: distance26,
|
|
18142
|
-
layers:
|
|
18159
|
+
layers: z104.array(layer_ref7).optional()
|
|
18143
18160
|
}),
|
|
18144
18161
|
pcbLayoutProps.extend({
|
|
18145
|
-
shape:
|
|
18162
|
+
shape: z104.literal("rect"),
|
|
18146
18163
|
width: distance26,
|
|
18147
18164
|
height: distance26,
|
|
18148
|
-
layers:
|
|
18165
|
+
layers: z104.array(layer_ref7).optional()
|
|
18149
18166
|
})
|
|
18150
18167
|
]);
|
|
18151
18168
|
|
|
18152
18169
|
// lib/components/courtyard-rect.ts
|
|
18153
18170
|
import { distance as distance27 } from "circuit-json";
|
|
18154
|
-
import { z as
|
|
18171
|
+
import { z as z105 } from "zod";
|
|
18155
18172
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
18156
18173
|
width: distance27,
|
|
18157
18174
|
height: distance27,
|
|
18158
18175
|
strokeWidth: distance27.optional(),
|
|
18159
|
-
isFilled:
|
|
18160
|
-
hasStroke:
|
|
18161
|
-
isStrokeDashed:
|
|
18162
|
-
color:
|
|
18176
|
+
isFilled: z105.boolean().optional(),
|
|
18177
|
+
hasStroke: z105.boolean().optional(),
|
|
18178
|
+
isStrokeDashed: z105.boolean().optional(),
|
|
18179
|
+
color: z105.string().optional()
|
|
18163
18180
|
});
|
|
18164
18181
|
|
|
18165
18182
|
// lib/components/courtyard-outline.ts
|
|
18166
18183
|
import { length as length7 } from "circuit-json";
|
|
18167
|
-
import { z as
|
|
18184
|
+
import { z as z106 } from "zod";
|
|
18168
18185
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
18169
18186
|
pcbLeftEdgeX: true,
|
|
18170
18187
|
pcbRightEdgeX: true,
|
|
@@ -18176,11 +18193,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
18176
18193
|
pcbOffsetY: true,
|
|
18177
18194
|
pcbRotation: true
|
|
18178
18195
|
}).extend({
|
|
18179
|
-
outline:
|
|
18196
|
+
outline: z106.array(point),
|
|
18180
18197
|
strokeWidth: length7.optional(),
|
|
18181
|
-
isClosed:
|
|
18182
|
-
isStrokeDashed:
|
|
18183
|
-
color:
|
|
18198
|
+
isClosed: z106.boolean().optional(),
|
|
18199
|
+
isStrokeDashed: z106.boolean().optional(),
|
|
18200
|
+
color: z106.string().optional()
|
|
18184
18201
|
});
|
|
18185
18202
|
|
|
18186
18203
|
// lib/components/courtyard-circle.ts
|
|
@@ -18200,35 +18217,35 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
18200
18217
|
});
|
|
18201
18218
|
|
|
18202
18219
|
// lib/components/copper-pour.ts
|
|
18203
|
-
import { z as
|
|
18220
|
+
import { z as z109 } from "zod";
|
|
18204
18221
|
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
18205
|
-
var copperPourProps =
|
|
18206
|
-
name:
|
|
18222
|
+
var copperPourProps = z109.object({
|
|
18223
|
+
name: z109.string().optional(),
|
|
18207
18224
|
layer: layer_ref8,
|
|
18208
|
-
connectsTo:
|
|
18209
|
-
unbroken:
|
|
18225
|
+
connectsTo: z109.string(),
|
|
18226
|
+
unbroken: z109.boolean().optional(),
|
|
18210
18227
|
padMargin: distance.optional(),
|
|
18211
18228
|
traceMargin: distance.optional(),
|
|
18212
18229
|
clearance: distance.optional(),
|
|
18213
18230
|
boardEdgeMargin: distance.optional(),
|
|
18214
18231
|
cutoutMargin: distance.optional(),
|
|
18215
|
-
outline:
|
|
18216
|
-
coveredWithSolderMask:
|
|
18232
|
+
outline: z109.array(point).optional(),
|
|
18233
|
+
coveredWithSolderMask: z109.boolean().optional().default(true)
|
|
18217
18234
|
});
|
|
18218
18235
|
expectTypesMatch(true);
|
|
18219
18236
|
|
|
18220
18237
|
// lib/components/cadassembly.ts
|
|
18221
18238
|
import { layer_ref as layer_ref9 } from "circuit-json";
|
|
18222
|
-
import { z as
|
|
18223
|
-
var cadassemblyProps =
|
|
18239
|
+
import { z as z110 } from "zod";
|
|
18240
|
+
var cadassemblyProps = z110.object({
|
|
18224
18241
|
originalLayer: layer_ref9.default("top").optional(),
|
|
18225
|
-
children:
|
|
18242
|
+
children: z110.any().optional()
|
|
18226
18243
|
});
|
|
18227
18244
|
expectTypesMatch(true);
|
|
18228
18245
|
|
|
18229
18246
|
// lib/components/cadmodel.ts
|
|
18230
|
-
import { z as
|
|
18231
|
-
var pcbPosition =
|
|
18247
|
+
import { z as z111 } from "zod";
|
|
18248
|
+
var pcbPosition = z111.object({
|
|
18232
18249
|
pcbX: pcbCoordinate.optional(),
|
|
18233
18250
|
pcbY: pcbCoordinate.optional(),
|
|
18234
18251
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -18245,7 +18262,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
18245
18262
|
});
|
|
18246
18263
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
18247
18264
|
expectTypesMatch(true);
|
|
18248
|
-
var cadmodelProps =
|
|
18265
|
+
var cadmodelProps = z111.union([z111.null(), url, cadModelObject]);
|
|
18249
18266
|
|
|
18250
18267
|
// lib/components/power-source.ts
|
|
18251
18268
|
import { voltage as voltage5 } from "circuit-json";
|
|
@@ -18255,9 +18272,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
18255
18272
|
|
|
18256
18273
|
// lib/components/voltagesource.ts
|
|
18257
18274
|
import { frequency as frequency5, ms as ms4, rotation as rotation5, voltage as voltage6 } from "circuit-json";
|
|
18258
|
-
import { z as
|
|
18275
|
+
import { z as z112 } from "zod";
|
|
18259
18276
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18260
|
-
var percentage =
|
|
18277
|
+
var percentage = z112.union([z112.string(), z112.number()]).transform((val) => {
|
|
18261
18278
|
if (typeof val === "string") {
|
|
18262
18279
|
if (val.endsWith("%")) {
|
|
18263
18280
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18266,13 +18283,13 @@ var percentage = z111.union([z111.string(), z111.number()]).transform((val) => {
|
|
|
18266
18283
|
}
|
|
18267
18284
|
return val;
|
|
18268
18285
|
}).pipe(
|
|
18269
|
-
|
|
18286
|
+
z112.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18270
18287
|
);
|
|
18271
18288
|
var voltageSourceProps = commonComponentProps.extend({
|
|
18272
18289
|
voltage: voltage6.optional(),
|
|
18273
18290
|
frequency: frequency5.optional(),
|
|
18274
18291
|
peakToPeakVoltage: voltage6.optional(),
|
|
18275
|
-
waveShape:
|
|
18292
|
+
waveShape: z112.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18276
18293
|
phase: rotation5.optional(),
|
|
18277
18294
|
dutyCycle: percentage.optional(),
|
|
18278
18295
|
pulseDelay: ms4.optional(),
|
|
@@ -18289,9 +18306,9 @@ expectTypesMatch(true);
|
|
|
18289
18306
|
|
|
18290
18307
|
// lib/components/currentsource.ts
|
|
18291
18308
|
import { frequency as frequency6, rotation as rotation6, current as current3 } from "circuit-json";
|
|
18292
|
-
import { z as
|
|
18309
|
+
import { z as z113 } from "zod";
|
|
18293
18310
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18294
|
-
var percentage2 =
|
|
18311
|
+
var percentage2 = z113.union([z113.string(), z113.number()]).transform((val) => {
|
|
18295
18312
|
if (typeof val === "string") {
|
|
18296
18313
|
if (val.endsWith("%")) {
|
|
18297
18314
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18300,13 +18317,13 @@ var percentage2 = z112.union([z112.string(), z112.number()]).transform((val) =>
|
|
|
18300
18317
|
}
|
|
18301
18318
|
return val;
|
|
18302
18319
|
}).pipe(
|
|
18303
|
-
|
|
18320
|
+
z113.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18304
18321
|
);
|
|
18305
18322
|
var currentSourceProps = commonComponentProps.extend({
|
|
18306
18323
|
current: current3.optional(),
|
|
18307
18324
|
frequency: frequency6.optional(),
|
|
18308
18325
|
peakToPeakCurrent: current3.optional(),
|
|
18309
|
-
waveShape:
|
|
18326
|
+
waveShape: z113.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18310
18327
|
phase: rotation6.optional(),
|
|
18311
18328
|
dutyCycle: percentage2.optional(),
|
|
18312
18329
|
acMagnitude: current3.optional(),
|
|
@@ -18317,21 +18334,21 @@ var currentSourcePins = lrPolarPins;
|
|
|
18317
18334
|
expectTypesMatch(true);
|
|
18318
18335
|
|
|
18319
18336
|
// lib/components/voltageprobe.ts
|
|
18320
|
-
import { z as
|
|
18337
|
+
import { z as z114 } from "zod";
|
|
18321
18338
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
18322
|
-
name:
|
|
18323
|
-
connectsTo:
|
|
18324
|
-
referenceTo:
|
|
18325
|
-
color:
|
|
18326
|
-
graphDisplayName:
|
|
18327
|
-
graphCenter:
|
|
18328
|
-
graphVerticalOffset:
|
|
18329
|
-
graphVoltagePerDiv:
|
|
18339
|
+
name: z114.string().optional(),
|
|
18340
|
+
connectsTo: z114.string(),
|
|
18341
|
+
referenceTo: z114.string().optional(),
|
|
18342
|
+
color: z114.string().optional(),
|
|
18343
|
+
graphDisplayName: z114.string().optional(),
|
|
18344
|
+
graphCenter: z114.number().optional(),
|
|
18345
|
+
graphVerticalOffset: z114.number().or(z114.string()).optional(),
|
|
18346
|
+
graphVoltagePerDiv: z114.number().or(z114.string()).optional()
|
|
18330
18347
|
});
|
|
18331
18348
|
expectTypesMatch(true);
|
|
18332
18349
|
|
|
18333
18350
|
// lib/components/ammeter.ts
|
|
18334
|
-
import { z as
|
|
18351
|
+
import { z as z115 } from "zod";
|
|
18335
18352
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18336
18353
|
var hasAmmeterConnectionPair = (connections) => {
|
|
18337
18354
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -18341,63 +18358,63 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
18341
18358
|
hasAmmeterConnectionPair,
|
|
18342
18359
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
18343
18360
|
),
|
|
18344
|
-
color:
|
|
18345
|
-
graphDisplayName:
|
|
18346
|
-
graphCenter:
|
|
18347
|
-
graphVerticalOffset:
|
|
18348
|
-
graphCurrentPerDiv:
|
|
18361
|
+
color: z115.string().optional(),
|
|
18362
|
+
graphDisplayName: z115.string().optional(),
|
|
18363
|
+
graphCenter: z115.number().optional(),
|
|
18364
|
+
graphVerticalOffset: z115.number().or(z115.string()).optional(),
|
|
18365
|
+
graphCurrentPerDiv: z115.number().or(z115.string()).optional()
|
|
18349
18366
|
});
|
|
18350
18367
|
var ammeterPins = ammeterPinLabels;
|
|
18351
18368
|
expectTypesMatch(true);
|
|
18352
18369
|
|
|
18353
18370
|
// lib/components/schematic-arc.ts
|
|
18354
18371
|
import { distance as distance30, point as point5, rotation as rotation7 } from "circuit-json";
|
|
18355
|
-
import { z as
|
|
18356
|
-
var schematicArcProps =
|
|
18372
|
+
import { z as z116 } from "zod";
|
|
18373
|
+
var schematicArcProps = z116.object({
|
|
18357
18374
|
center: point5,
|
|
18358
18375
|
radius: distance30,
|
|
18359
18376
|
startAngleDegrees: rotation7,
|
|
18360
18377
|
endAngleDegrees: rotation7,
|
|
18361
|
-
direction:
|
|
18378
|
+
direction: z116.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
18362
18379
|
strokeWidth: distance30.optional(),
|
|
18363
|
-
color:
|
|
18364
|
-
isDashed:
|
|
18380
|
+
color: z116.string().optional(),
|
|
18381
|
+
isDashed: z116.boolean().optional().default(false)
|
|
18365
18382
|
});
|
|
18366
18383
|
expectTypesMatch(true);
|
|
18367
18384
|
|
|
18368
18385
|
// lib/components/toolingrail.ts
|
|
18369
|
-
import { z as
|
|
18370
|
-
var toolingrailProps =
|
|
18371
|
-
children:
|
|
18386
|
+
import { z as z117 } from "zod";
|
|
18387
|
+
var toolingrailProps = z117.object({
|
|
18388
|
+
children: z117.any().optional()
|
|
18372
18389
|
});
|
|
18373
18390
|
expectTypesMatch(true);
|
|
18374
18391
|
|
|
18375
18392
|
// lib/components/schematic-box.ts
|
|
18376
18393
|
import { distance as distance31 } from "circuit-json";
|
|
18377
|
-
import { z as
|
|
18378
|
-
var schematicBoxProps =
|
|
18379
|
-
name:
|
|
18380
|
-
chipRef:
|
|
18394
|
+
import { z as z118 } from "zod";
|
|
18395
|
+
var schematicBoxProps = z118.object({
|
|
18396
|
+
name: z118.string().optional(),
|
|
18397
|
+
chipRef: z118.string().optional(),
|
|
18381
18398
|
pinLabels: pinLabelsProp.optional(),
|
|
18382
18399
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
18383
18400
|
schX: distance31.optional(),
|
|
18384
18401
|
schY: distance31.optional(),
|
|
18385
|
-
schSectionName:
|
|
18386
|
-
schSheetName:
|
|
18402
|
+
schSectionName: z118.string().optional(),
|
|
18403
|
+
schSheetName: z118.string().optional(),
|
|
18387
18404
|
width: distance31.optional(),
|
|
18388
18405
|
height: distance31.optional(),
|
|
18389
|
-
overlay:
|
|
18406
|
+
overlay: z118.array(z118.string()).optional(),
|
|
18390
18407
|
padding: distance31.optional(),
|
|
18391
18408
|
paddingLeft: distance31.optional(),
|
|
18392
18409
|
paddingRight: distance31.optional(),
|
|
18393
18410
|
paddingTop: distance31.optional(),
|
|
18394
18411
|
paddingBottom: distance31.optional(),
|
|
18395
|
-
title:
|
|
18412
|
+
title: z118.string().optional(),
|
|
18396
18413
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
18397
|
-
titleColor:
|
|
18414
|
+
titleColor: z118.string().optional(),
|
|
18398
18415
|
titleFontSize: distance31.optional(),
|
|
18399
|
-
titleInside:
|
|
18400
|
-
strokeStyle:
|
|
18416
|
+
titleInside: z118.boolean().default(false),
|
|
18417
|
+
strokeStyle: z118.enum(["solid", "dashed"]).default("solid")
|
|
18401
18418
|
}).refine(
|
|
18402
18419
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
18403
18420
|
{
|
|
@@ -18413,21 +18430,21 @@ expectTypesMatch(true);
|
|
|
18413
18430
|
|
|
18414
18431
|
// lib/components/schematic-symbol.ts
|
|
18415
18432
|
import { rotation as rotation8 } from "circuit-json";
|
|
18416
|
-
import { z as
|
|
18417
|
-
var schematicSymbolConnections =
|
|
18433
|
+
import { z as z119 } from "zod";
|
|
18434
|
+
var schematicSymbolConnections = z119.custom().pipe(z119.record(z119.string(), connectionTarget)).refine((value) => Object.keys(value).length > 0, {
|
|
18418
18435
|
message: "connections must map at least one schematic symbol port"
|
|
18419
18436
|
});
|
|
18420
|
-
var schematicSymbolProps =
|
|
18421
|
-
name:
|
|
18422
|
-
displayName:
|
|
18423
|
-
chipRef:
|
|
18424
|
-
symbolName:
|
|
18437
|
+
var schematicSymbolProps = z119.object({
|
|
18438
|
+
name: z119.string().min(1),
|
|
18439
|
+
displayName: z119.string().optional(),
|
|
18440
|
+
chipRef: z119.string().min(1).optional(),
|
|
18441
|
+
symbolName: z119.string().min(1),
|
|
18425
18442
|
connections: schematicSymbolConnections.optional(),
|
|
18426
18443
|
schX: distance.optional(),
|
|
18427
18444
|
schY: distance.optional(),
|
|
18428
18445
|
schRotation: rotation8.optional(),
|
|
18429
|
-
schSectionName:
|
|
18430
|
-
schSheetName:
|
|
18446
|
+
schSectionName: z119.string().optional(),
|
|
18447
|
+
schSheetName: z119.string().optional()
|
|
18431
18448
|
});
|
|
18432
18449
|
expectTypesMatch(
|
|
18433
18450
|
true
|
|
@@ -18435,15 +18452,15 @@ expectTypesMatch(
|
|
|
18435
18452
|
|
|
18436
18453
|
// lib/components/schematic-circle.ts
|
|
18437
18454
|
import { distance as distance32, point as point6 } from "circuit-json";
|
|
18438
|
-
import { z as
|
|
18439
|
-
var schematicCircleProps =
|
|
18455
|
+
import { z as z120 } from "zod";
|
|
18456
|
+
var schematicCircleProps = z120.object({
|
|
18440
18457
|
center: point6,
|
|
18441
18458
|
radius: distance32,
|
|
18442
18459
|
strokeWidth: distance32.optional(),
|
|
18443
|
-
color:
|
|
18444
|
-
isFilled:
|
|
18445
|
-
fillColor:
|
|
18446
|
-
isDashed:
|
|
18460
|
+
color: z120.string().optional(),
|
|
18461
|
+
isFilled: z120.boolean().optional().default(false),
|
|
18462
|
+
fillColor: z120.string().optional(),
|
|
18463
|
+
isDashed: z120.boolean().optional().default(false)
|
|
18447
18464
|
});
|
|
18448
18465
|
expectTypesMatch(
|
|
18449
18466
|
true
|
|
@@ -18451,32 +18468,32 @@ expectTypesMatch(
|
|
|
18451
18468
|
|
|
18452
18469
|
// lib/components/schematic-rect.ts
|
|
18453
18470
|
import { distance as distance33, rotation as rotation9 } from "circuit-json";
|
|
18454
|
-
import { z as
|
|
18455
|
-
var schematicRectProps =
|
|
18471
|
+
import { z as z121 } from "zod";
|
|
18472
|
+
var schematicRectProps = z121.object({
|
|
18456
18473
|
schX: distance33.optional(),
|
|
18457
18474
|
schY: distance33.optional(),
|
|
18458
18475
|
width: distance33,
|
|
18459
18476
|
height: distance33,
|
|
18460
18477
|
rotation: rotation9.default(0),
|
|
18461
18478
|
strokeWidth: distance33.optional(),
|
|
18462
|
-
color:
|
|
18463
|
-
isFilled:
|
|
18464
|
-
fillColor:
|
|
18465
|
-
isDashed:
|
|
18479
|
+
color: z121.string().optional(),
|
|
18480
|
+
isFilled: z121.boolean().optional().default(false),
|
|
18481
|
+
fillColor: z121.string().optional(),
|
|
18482
|
+
isDashed: z121.boolean().optional().default(false)
|
|
18466
18483
|
});
|
|
18467
18484
|
expectTypesMatch(true);
|
|
18468
18485
|
|
|
18469
18486
|
// lib/components/schematic-line.ts
|
|
18470
18487
|
import { distance as distance34 } from "circuit-json";
|
|
18471
|
-
import { z as
|
|
18472
|
-
var schematicLineProps =
|
|
18488
|
+
import { z as z122 } from "zod";
|
|
18489
|
+
var schematicLineProps = z122.object({
|
|
18473
18490
|
x1: distance34,
|
|
18474
18491
|
y1: distance34,
|
|
18475
18492
|
x2: distance34,
|
|
18476
18493
|
y2: distance34,
|
|
18477
18494
|
strokeWidth: distance34.optional(),
|
|
18478
|
-
color:
|
|
18479
|
-
isDashed:
|
|
18495
|
+
color: z122.string().optional(),
|
|
18496
|
+
isDashed: z122.boolean().optional().default(false),
|
|
18480
18497
|
dashLength: distance34.optional(),
|
|
18481
18498
|
dashGap: distance34.optional()
|
|
18482
18499
|
});
|
|
@@ -18484,11 +18501,11 @@ expectTypesMatch(true);
|
|
|
18484
18501
|
|
|
18485
18502
|
// lib/components/schematic-text.ts
|
|
18486
18503
|
import { distance as distance35, rotation as rotation10 } from "circuit-json";
|
|
18487
|
-
import { z as
|
|
18504
|
+
import { z as z124 } from "zod";
|
|
18488
18505
|
|
|
18489
18506
|
// lib/common/fivePointAnchor.ts
|
|
18490
|
-
import { z as
|
|
18491
|
-
var fivePointAnchor =
|
|
18507
|
+
import { z as z123 } from "zod";
|
|
18508
|
+
var fivePointAnchor = z123.enum([
|
|
18492
18509
|
"center",
|
|
18493
18510
|
"left",
|
|
18494
18511
|
"right",
|
|
@@ -18497,39 +18514,39 @@ var fivePointAnchor = z122.enum([
|
|
|
18497
18514
|
]);
|
|
18498
18515
|
|
|
18499
18516
|
// lib/components/schematic-text.ts
|
|
18500
|
-
var schematicTextProps =
|
|
18517
|
+
var schematicTextProps = z124.object({
|
|
18501
18518
|
schX: distance35.optional(),
|
|
18502
18519
|
schY: distance35.optional(),
|
|
18503
|
-
text:
|
|
18504
|
-
fontSize:
|
|
18505
|
-
anchor:
|
|
18506
|
-
color:
|
|
18520
|
+
text: z124.string(),
|
|
18521
|
+
fontSize: z124.number().default(1),
|
|
18522
|
+
anchor: z124.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
18523
|
+
color: z124.string().default("#000000"),
|
|
18507
18524
|
schRotation: rotation10.default(0)
|
|
18508
18525
|
});
|
|
18509
18526
|
expectTypesMatch(true);
|
|
18510
18527
|
|
|
18511
18528
|
// lib/components/schematic-path.ts
|
|
18512
18529
|
import { distance as distance36, point as point7 } from "circuit-json";
|
|
18513
|
-
import { z as
|
|
18514
|
-
var schematicPathProps =
|
|
18515
|
-
points:
|
|
18516
|
-
svgPath:
|
|
18530
|
+
import { z as z125 } from "zod";
|
|
18531
|
+
var schematicPathProps = z125.object({
|
|
18532
|
+
points: z125.array(point7).optional(),
|
|
18533
|
+
svgPath: z125.string().optional(),
|
|
18517
18534
|
strokeWidth: distance36.optional(),
|
|
18518
|
-
strokeColor:
|
|
18535
|
+
strokeColor: z125.string().optional(),
|
|
18519
18536
|
dashLength: distance36.optional(),
|
|
18520
18537
|
dashGap: distance36.optional(),
|
|
18521
|
-
isFilled:
|
|
18522
|
-
fillColor:
|
|
18538
|
+
isFilled: z125.boolean().optional().default(false),
|
|
18539
|
+
fillColor: z125.string().optional()
|
|
18523
18540
|
});
|
|
18524
18541
|
expectTypesMatch(true);
|
|
18525
18542
|
|
|
18526
18543
|
// lib/components/schematic-table.ts
|
|
18527
18544
|
import { distance as distance37 } from "circuit-json";
|
|
18528
|
-
import { z as
|
|
18529
|
-
var schematicTableProps =
|
|
18545
|
+
import { z as z126 } from "zod";
|
|
18546
|
+
var schematicTableProps = z126.object({
|
|
18530
18547
|
schX: distance37.optional(),
|
|
18531
18548
|
schY: distance37.optional(),
|
|
18532
|
-
children:
|
|
18549
|
+
children: z126.any().optional(),
|
|
18533
18550
|
cellPadding: distance37.optional(),
|
|
18534
18551
|
borderWidth: distance37.optional(),
|
|
18535
18552
|
anchor: ninePointAnchor.optional(),
|
|
@@ -18539,34 +18556,34 @@ expectTypesMatch(true);
|
|
|
18539
18556
|
|
|
18540
18557
|
// lib/components/schematic-row.ts
|
|
18541
18558
|
import { distance as distance38 } from "circuit-json";
|
|
18542
|
-
import { z as
|
|
18543
|
-
var schematicRowProps =
|
|
18544
|
-
children:
|
|
18559
|
+
import { z as z127 } from "zod";
|
|
18560
|
+
var schematicRowProps = z127.object({
|
|
18561
|
+
children: z127.any().optional(),
|
|
18545
18562
|
height: distance38.optional()
|
|
18546
18563
|
});
|
|
18547
18564
|
expectTypesMatch(true);
|
|
18548
18565
|
|
|
18549
18566
|
// lib/components/schematic-cell.ts
|
|
18550
18567
|
import { distance as distance39 } from "circuit-json";
|
|
18551
|
-
import { z as
|
|
18552
|
-
var schematicCellProps =
|
|
18553
|
-
children:
|
|
18554
|
-
horizontalAlign:
|
|
18555
|
-
verticalAlign:
|
|
18568
|
+
import { z as z128 } from "zod";
|
|
18569
|
+
var schematicCellProps = z128.object({
|
|
18570
|
+
children: z128.string().optional(),
|
|
18571
|
+
horizontalAlign: z128.enum(["left", "center", "right"]).optional(),
|
|
18572
|
+
verticalAlign: z128.enum(["top", "middle", "bottom"]).optional(),
|
|
18556
18573
|
fontSize: distance39.optional(),
|
|
18557
|
-
rowSpan:
|
|
18558
|
-
colSpan:
|
|
18574
|
+
rowSpan: z128.number().optional(),
|
|
18575
|
+
colSpan: z128.number().optional(),
|
|
18559
18576
|
width: distance39.optional(),
|
|
18560
|
-
text:
|
|
18577
|
+
text: z128.string().optional()
|
|
18561
18578
|
});
|
|
18562
18579
|
expectTypesMatch(true);
|
|
18563
18580
|
|
|
18564
18581
|
// lib/components/schematic-section.ts
|
|
18565
18582
|
import { distance as distance40 } from "circuit-json";
|
|
18566
|
-
import { z as
|
|
18567
|
-
var schematicSectionProps =
|
|
18568
|
-
displayName:
|
|
18569
|
-
name:
|
|
18583
|
+
import { z as z129 } from "zod";
|
|
18584
|
+
var schematicSectionProps = z129.object({
|
|
18585
|
+
displayName: z129.string().optional(),
|
|
18586
|
+
name: z129.string(),
|
|
18570
18587
|
sectionTitleFontSize: distance40.optional()
|
|
18571
18588
|
});
|
|
18572
18589
|
expectTypesMatch(
|
|
@@ -18574,51 +18591,51 @@ expectTypesMatch(
|
|
|
18574
18591
|
);
|
|
18575
18592
|
|
|
18576
18593
|
// lib/components/schematic-sheet.ts
|
|
18577
|
-
import { z as
|
|
18578
|
-
var schematicSheetProps =
|
|
18579
|
-
name:
|
|
18580
|
-
displayName:
|
|
18581
|
-
sheetIndex:
|
|
18582
|
-
children:
|
|
18594
|
+
import { z as z130 } from "zod";
|
|
18595
|
+
var schematicSheetProps = z130.object({
|
|
18596
|
+
name: z130.string(),
|
|
18597
|
+
displayName: z130.string(),
|
|
18598
|
+
sheetIndex: z130.number().optional(),
|
|
18599
|
+
children: z130.any().optional()
|
|
18583
18600
|
});
|
|
18584
18601
|
expectTypesMatch(true);
|
|
18585
18602
|
|
|
18586
18603
|
// lib/components/copper-text.ts
|
|
18587
18604
|
import { layer_ref as layer_ref10, length as length8 } from "circuit-json";
|
|
18588
|
-
import { z as
|
|
18605
|
+
import { z as z131 } from "zod";
|
|
18589
18606
|
var copperTextProps = pcbLayoutProps.extend({
|
|
18590
|
-
text:
|
|
18607
|
+
text: z131.string(),
|
|
18591
18608
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18592
|
-
font:
|
|
18609
|
+
font: z131.enum(["tscircuit2024"]).optional(),
|
|
18593
18610
|
fontSize: length8.optional(),
|
|
18594
|
-
layers:
|
|
18595
|
-
knockout:
|
|
18596
|
-
mirrored:
|
|
18611
|
+
layers: z131.array(layer_ref10).optional(),
|
|
18612
|
+
knockout: z131.boolean().optional(),
|
|
18613
|
+
mirrored: z131.boolean().optional()
|
|
18597
18614
|
});
|
|
18598
18615
|
|
|
18599
18616
|
// lib/components/silkscreen-text.ts
|
|
18600
18617
|
import { layer_ref as layer_ref11, length as length9 } from "circuit-json";
|
|
18601
|
-
import { z as
|
|
18618
|
+
import { z as z132 } from "zod";
|
|
18602
18619
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
18603
|
-
text:
|
|
18620
|
+
text: z132.string(),
|
|
18604
18621
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18605
|
-
font:
|
|
18622
|
+
font: z132.enum(["tscircuit2024"]).optional(),
|
|
18606
18623
|
fontSize: length9.optional(),
|
|
18607
18624
|
/**
|
|
18608
18625
|
* If true, text will knock out underlying silkscreen
|
|
18609
18626
|
*/
|
|
18610
|
-
isKnockout:
|
|
18627
|
+
isKnockout: z132.boolean().optional(),
|
|
18611
18628
|
knockoutPadding: length9.optional(),
|
|
18612
18629
|
knockoutPaddingLeft: length9.optional(),
|
|
18613
18630
|
knockoutPaddingRight: length9.optional(),
|
|
18614
18631
|
knockoutPaddingTop: length9.optional(),
|
|
18615
18632
|
knockoutPaddingBottom: length9.optional(),
|
|
18616
|
-
layers:
|
|
18633
|
+
layers: z132.array(layer_ref11).optional()
|
|
18617
18634
|
});
|
|
18618
18635
|
|
|
18619
18636
|
// lib/components/silkscreen-path.ts
|
|
18620
18637
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
18621
|
-
import { z as
|
|
18638
|
+
import { z as z133 } from "zod";
|
|
18622
18639
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
18623
18640
|
pcbLeftEdgeX: true,
|
|
18624
18641
|
pcbRightEdgeX: true,
|
|
@@ -18630,7 +18647,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
18630
18647
|
pcbOffsetY: true,
|
|
18631
18648
|
pcbRotation: true
|
|
18632
18649
|
}).extend({
|
|
18633
|
-
route:
|
|
18650
|
+
route: z133.array(route_hint_point5),
|
|
18634
18651
|
strokeWidth: length10.optional()
|
|
18635
18652
|
});
|
|
18636
18653
|
|
|
@@ -18652,10 +18669,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
18652
18669
|
|
|
18653
18670
|
// lib/components/silkscreen-rect.ts
|
|
18654
18671
|
import { distance as distance42 } from "circuit-json";
|
|
18655
|
-
import { z as
|
|
18672
|
+
import { z as z134 } from "zod";
|
|
18656
18673
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18657
|
-
filled:
|
|
18658
|
-
stroke:
|
|
18674
|
+
filled: z134.boolean().default(true).optional(),
|
|
18675
|
+
stroke: z134.enum(["dashed", "solid", "none"]).optional(),
|
|
18659
18676
|
strokeWidth: distance42.optional(),
|
|
18660
18677
|
width: distance42,
|
|
18661
18678
|
height: distance42,
|
|
@@ -18664,10 +18681,10 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
18664
18681
|
|
|
18665
18682
|
// lib/components/silkscreen-circle.ts
|
|
18666
18683
|
import { distance as distance43 } from "circuit-json";
|
|
18667
|
-
import { z as
|
|
18684
|
+
import { z as z135 } from "zod";
|
|
18668
18685
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18669
|
-
isFilled:
|
|
18670
|
-
isOutline:
|
|
18686
|
+
isFilled: z135.boolean().optional(),
|
|
18687
|
+
isOutline: z135.boolean().optional(),
|
|
18671
18688
|
strokeWidth: distance43.optional(),
|
|
18672
18689
|
radius: distance43
|
|
18673
18690
|
});
|
|
@@ -18685,63 +18702,63 @@ expectTypesMatch(true);
|
|
|
18685
18702
|
|
|
18686
18703
|
// lib/components/trace-hint.ts
|
|
18687
18704
|
import { distance as distance44, layer_ref as layer_ref12, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
18688
|
-
import { z as
|
|
18689
|
-
var routeHintPointProps =
|
|
18705
|
+
import { z as z137 } from "zod";
|
|
18706
|
+
var routeHintPointProps = z137.object({
|
|
18690
18707
|
x: distance44,
|
|
18691
18708
|
y: distance44,
|
|
18692
|
-
via:
|
|
18709
|
+
via: z137.boolean().optional(),
|
|
18693
18710
|
toLayer: layer_ref12.optional()
|
|
18694
18711
|
});
|
|
18695
|
-
var traceHintProps =
|
|
18696
|
-
for:
|
|
18712
|
+
var traceHintProps = z137.object({
|
|
18713
|
+
for: z137.string().optional().describe(
|
|
18697
18714
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
18698
18715
|
),
|
|
18699
|
-
order:
|
|
18716
|
+
order: z137.number().optional(),
|
|
18700
18717
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
18701
|
-
offsets:
|
|
18702
|
-
traceWidth:
|
|
18718
|
+
offsets: z137.array(route_hint_point6).or(z137.array(routeHintPointProps)).optional(),
|
|
18719
|
+
traceWidth: z137.number().optional()
|
|
18703
18720
|
});
|
|
18704
18721
|
|
|
18705
18722
|
// lib/components/port.ts
|
|
18706
|
-
import { z as
|
|
18723
|
+
import { z as z138 } from "zod";
|
|
18707
18724
|
var portProps = commonLayoutProps.extend({
|
|
18708
|
-
name:
|
|
18709
|
-
pinNumber:
|
|
18710
|
-
schStemLength:
|
|
18711
|
-
aliases:
|
|
18712
|
-
layer:
|
|
18713
|
-
layers:
|
|
18714
|
-
schX:
|
|
18715
|
-
schY:
|
|
18725
|
+
name: z138.string().optional(),
|
|
18726
|
+
pinNumber: z138.number().optional(),
|
|
18727
|
+
schStemLength: z138.number().optional(),
|
|
18728
|
+
aliases: z138.array(z138.string()).optional(),
|
|
18729
|
+
layer: z138.string().optional(),
|
|
18730
|
+
layers: z138.array(z138.string()).optional(),
|
|
18731
|
+
schX: z138.number().optional(),
|
|
18732
|
+
schY: z138.number().optional(),
|
|
18716
18733
|
direction: direction.optional(),
|
|
18717
|
-
connectsTo:
|
|
18734
|
+
connectsTo: z138.string().or(z138.array(z138.string())).optional(),
|
|
18718
18735
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
18719
|
-
hasInversionCircle:
|
|
18736
|
+
hasInversionCircle: z138.boolean().optional()
|
|
18720
18737
|
});
|
|
18721
18738
|
|
|
18722
18739
|
// lib/components/pcb-note-text.ts
|
|
18723
18740
|
import { length as length11 } from "circuit-json";
|
|
18724
|
-
import { z as
|
|
18741
|
+
import { z as z139 } from "zod";
|
|
18725
18742
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
18726
|
-
text:
|
|
18727
|
-
anchorAlignment:
|
|
18728
|
-
font:
|
|
18743
|
+
text: z139.string(),
|
|
18744
|
+
anchorAlignment: z139.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18745
|
+
font: z139.enum(["tscircuit2024"]).optional(),
|
|
18729
18746
|
fontSize: length11.optional(),
|
|
18730
|
-
color:
|
|
18747
|
+
color: z139.string().optional()
|
|
18731
18748
|
});
|
|
18732
18749
|
expectTypesMatch(true);
|
|
18733
18750
|
|
|
18734
18751
|
// lib/components/pcb-note-rect.ts
|
|
18735
18752
|
import { distance as distance45 } from "circuit-json";
|
|
18736
|
-
import { z as
|
|
18753
|
+
import { z as z140 } from "zod";
|
|
18737
18754
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18738
18755
|
width: distance45,
|
|
18739
18756
|
height: distance45,
|
|
18740
18757
|
strokeWidth: distance45.optional(),
|
|
18741
|
-
isFilled:
|
|
18742
|
-
hasStroke:
|
|
18743
|
-
isStrokeDashed:
|
|
18744
|
-
color:
|
|
18758
|
+
isFilled: z140.boolean().optional(),
|
|
18759
|
+
hasStroke: z140.boolean().optional(),
|
|
18760
|
+
isStrokeDashed: z140.boolean().optional(),
|
|
18761
|
+
color: z140.string().optional(),
|
|
18745
18762
|
cornerRadius: distance45.optional()
|
|
18746
18763
|
});
|
|
18747
18764
|
expectTypesMatch(true);
|
|
@@ -18751,7 +18768,7 @@ import {
|
|
|
18751
18768
|
length as length12,
|
|
18752
18769
|
route_hint_point as route_hint_point7
|
|
18753
18770
|
} from "circuit-json";
|
|
18754
|
-
import { z as
|
|
18771
|
+
import { z as z141 } from "zod";
|
|
18755
18772
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
18756
18773
|
pcbLeftEdgeX: true,
|
|
18757
18774
|
pcbRightEdgeX: true,
|
|
@@ -18763,15 +18780,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
18763
18780
|
pcbOffsetY: true,
|
|
18764
18781
|
pcbRotation: true
|
|
18765
18782
|
}).extend({
|
|
18766
|
-
route:
|
|
18783
|
+
route: z141.array(route_hint_point7),
|
|
18767
18784
|
strokeWidth: length12.optional(),
|
|
18768
|
-
color:
|
|
18785
|
+
color: z141.string().optional()
|
|
18769
18786
|
});
|
|
18770
18787
|
expectTypesMatch(true);
|
|
18771
18788
|
|
|
18772
18789
|
// lib/components/pcb-note-line.ts
|
|
18773
18790
|
import { distance as distance46 } from "circuit-json";
|
|
18774
|
-
import { z as
|
|
18791
|
+
import { z as z142 } from "zod";
|
|
18775
18792
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
18776
18793
|
pcbLeftEdgeX: true,
|
|
18777
18794
|
pcbRightEdgeX: true,
|
|
@@ -18788,15 +18805,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
18788
18805
|
x2: distance46,
|
|
18789
18806
|
y2: distance46,
|
|
18790
18807
|
strokeWidth: distance46.optional(),
|
|
18791
|
-
color:
|
|
18792
|
-
isDashed:
|
|
18808
|
+
color: z142.string().optional(),
|
|
18809
|
+
isDashed: z142.boolean().optional()
|
|
18793
18810
|
});
|
|
18794
18811
|
expectTypesMatch(true);
|
|
18795
18812
|
|
|
18796
18813
|
// lib/components/pcb-note-dimension.ts
|
|
18797
18814
|
import { distance as distance47, length as length13 } from "circuit-json";
|
|
18798
|
-
import { z as
|
|
18799
|
-
var dimensionTarget2 =
|
|
18815
|
+
import { z as z143 } from "zod";
|
|
18816
|
+
var dimensionTarget2 = z143.union([z143.string(), point]);
|
|
18800
18817
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
18801
18818
|
pcbLeftEdgeX: true,
|
|
18802
18819
|
pcbRightEdgeX: true,
|
|
@@ -18810,101 +18827,101 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18810
18827
|
}).extend({
|
|
18811
18828
|
from: dimensionTarget2,
|
|
18812
18829
|
to: dimensionTarget2,
|
|
18813
|
-
text:
|
|
18830
|
+
text: z143.string().optional(),
|
|
18814
18831
|
offset: distance47.optional(),
|
|
18815
|
-
font:
|
|
18832
|
+
font: z143.enum(["tscircuit2024"]).optional(),
|
|
18816
18833
|
fontSize: length13.optional(),
|
|
18817
|
-
color:
|
|
18834
|
+
color: z143.string().optional(),
|
|
18818
18835
|
arrowSize: distance47.optional(),
|
|
18819
|
-
units:
|
|
18820
|
-
outerEdgeToEdge:
|
|
18821
|
-
centerToCenter:
|
|
18822
|
-
innerEdgeToEdge:
|
|
18836
|
+
units: z143.enum(["in", "mm"]).optional(),
|
|
18837
|
+
outerEdgeToEdge: z143.literal(true).optional(),
|
|
18838
|
+
centerToCenter: z143.literal(true).optional(),
|
|
18839
|
+
innerEdgeToEdge: z143.literal(true).optional()
|
|
18823
18840
|
});
|
|
18824
18841
|
expectTypesMatch(
|
|
18825
18842
|
true
|
|
18826
18843
|
);
|
|
18827
18844
|
|
|
18828
18845
|
// lib/platformConfig.ts
|
|
18829
|
-
import { z as
|
|
18830
|
-
var unvalidatedCircuitJson =
|
|
18831
|
-
var footprintLibraryResult =
|
|
18832
|
-
footprintCircuitJson:
|
|
18846
|
+
import { z as z144 } from "zod";
|
|
18847
|
+
var unvalidatedCircuitJson = z144.array(z144.any()).describe("Circuit JSON");
|
|
18848
|
+
var footprintLibraryResult = z144.object({
|
|
18849
|
+
footprintCircuitJson: z144.array(z144.any()),
|
|
18833
18850
|
cadModel: cadModelProp.optional()
|
|
18834
18851
|
});
|
|
18835
|
-
var pathToCircuitJsonFn =
|
|
18836
|
-
|
|
18837
|
-
|
|
18838
|
-
|
|
18839
|
-
).returns(
|
|
18852
|
+
var pathToCircuitJsonFn = z144.function().args(z144.string()).returns(z144.promise(footprintLibraryResult)).or(
|
|
18853
|
+
z144.function().args(
|
|
18854
|
+
z144.string(),
|
|
18855
|
+
z144.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
18856
|
+
).returns(z144.promise(footprintLibraryResult))
|
|
18840
18857
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
18841
|
-
var footprintFileParserEntry =
|
|
18842
|
-
loadFromUrl:
|
|
18858
|
+
var footprintFileParserEntry = z144.object({
|
|
18859
|
+
loadFromUrl: z144.function().args(z144.string()).returns(z144.promise(footprintLibraryResult)).describe(
|
|
18843
18860
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
18844
18861
|
)
|
|
18845
18862
|
});
|
|
18846
|
-
var spiceEngineSimulationResult =
|
|
18847
|
-
engineVersionString:
|
|
18863
|
+
var spiceEngineSimulationResult = z144.object({
|
|
18864
|
+
engineVersionString: z144.string().optional(),
|
|
18848
18865
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
18849
18866
|
});
|
|
18850
|
-
var spiceEngineZod =
|
|
18851
|
-
simulate:
|
|
18867
|
+
var spiceEngineZod = z144.object({
|
|
18868
|
+
simulate: z144.function().args(z144.string()).returns(z144.promise(spiceEngineSimulationResult)).describe(
|
|
18852
18869
|
"A function that takes a SPICE string and returns a simulation result"
|
|
18853
18870
|
)
|
|
18854
18871
|
});
|
|
18855
|
-
var defaultSpiceEngine =
|
|
18872
|
+
var defaultSpiceEngine = z144.custom(
|
|
18856
18873
|
(value) => typeof value === "string"
|
|
18857
18874
|
);
|
|
18858
|
-
var autorouterInstance =
|
|
18859
|
-
run:
|
|
18860
|
-
getOutputSimpleRouteJson:
|
|
18875
|
+
var autorouterInstance = z144.object({
|
|
18876
|
+
run: z144.function().args().returns(z144.promise(z144.unknown())).describe("Run the autorouter"),
|
|
18877
|
+
getOutputSimpleRouteJson: z144.function().args().returns(z144.promise(z144.any())).describe("Get the resulting SimpleRouteJson")
|
|
18861
18878
|
});
|
|
18862
|
-
var autorouterDefinition =
|
|
18863
|
-
createAutorouter:
|
|
18879
|
+
var autorouterDefinition = z144.object({
|
|
18880
|
+
createAutorouter: z144.function().args(z144.any(), z144.any().optional()).returns(z144.union([autorouterInstance, z144.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
18864
18881
|
});
|
|
18865
|
-
var platformFetch =
|
|
18866
|
-
var platformConfig =
|
|
18882
|
+
var platformFetch = z144.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
18883
|
+
var platformConfig = z144.object({
|
|
18867
18884
|
partsEngine: partsEngine.optional(),
|
|
18868
18885
|
autorouter: autorouterProp.optional(),
|
|
18869
|
-
autorouterMap:
|
|
18886
|
+
autorouterMap: z144.record(z144.string(), autorouterDefinition).optional(),
|
|
18870
18887
|
registryApiUrl: url.optional(),
|
|
18871
18888
|
cloudAutorouterUrl: url.optional(),
|
|
18872
|
-
projectName:
|
|
18889
|
+
projectName: z144.string().optional(),
|
|
18873
18890
|
projectBaseUrl: url.optional(),
|
|
18874
|
-
version:
|
|
18891
|
+
version: z144.string().optional(),
|
|
18875
18892
|
url: url.optional(),
|
|
18876
|
-
printBoardInformationToSilkscreen:
|
|
18877
|
-
includeBoardFiles:
|
|
18893
|
+
printBoardInformationToSilkscreen: z144.boolean().optional(),
|
|
18894
|
+
includeBoardFiles: z144.array(z144.string()).describe(
|
|
18878
18895
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
18879
18896
|
).optional(),
|
|
18880
|
-
snapshotsDir:
|
|
18897
|
+
snapshotsDir: z144.string().describe(
|
|
18881
18898
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
18882
18899
|
).optional(),
|
|
18883
18900
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
18884
|
-
unitPreference:
|
|
18885
|
-
localCacheEngine:
|
|
18886
|
-
pcbDisabled:
|
|
18887
|
-
routingDisabled:
|
|
18888
|
-
schematicDisabled:
|
|
18889
|
-
partsEngineDisabled:
|
|
18890
|
-
drcChecksDisabled:
|
|
18891
|
-
netlistDrcChecksDisabled:
|
|
18892
|
-
routingDrcChecksDisabled:
|
|
18893
|
-
placementDrcChecksDisabled:
|
|
18894
|
-
pinSpecificationDrcChecksDisabled:
|
|
18895
|
-
spiceEngineMap:
|
|
18896
|
-
footprintLibraryMap:
|
|
18897
|
-
|
|
18898
|
-
|
|
18901
|
+
unitPreference: z144.enum(["mm", "in", "mil"]).optional(),
|
|
18902
|
+
localCacheEngine: z144.any().optional(),
|
|
18903
|
+
pcbDisabled: z144.boolean().optional(),
|
|
18904
|
+
routingDisabled: z144.boolean().optional(),
|
|
18905
|
+
schematicDisabled: z144.boolean().optional(),
|
|
18906
|
+
partsEngineDisabled: z144.boolean().optional(),
|
|
18907
|
+
drcChecksDisabled: z144.boolean().optional(),
|
|
18908
|
+
netlistDrcChecksDisabled: z144.boolean().optional(),
|
|
18909
|
+
routingDrcChecksDisabled: z144.boolean().optional(),
|
|
18910
|
+
placementDrcChecksDisabled: z144.boolean().optional(),
|
|
18911
|
+
pinSpecificationDrcChecksDisabled: z144.boolean().optional(),
|
|
18912
|
+
spiceEngineMap: z144.record(z144.string(), spiceEngineZod).optional(),
|
|
18913
|
+
footprintLibraryMap: z144.record(
|
|
18914
|
+
z144.string(),
|
|
18915
|
+
z144.union([
|
|
18899
18916
|
pathToCircuitJsonFn,
|
|
18900
|
-
|
|
18901
|
-
|
|
18902
|
-
|
|
18917
|
+
z144.record(
|
|
18918
|
+
z144.string(),
|
|
18919
|
+
z144.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
18903
18920
|
)
|
|
18904
18921
|
])
|
|
18905
18922
|
).optional(),
|
|
18906
|
-
footprintFileParserMap:
|
|
18907
|
-
resolveProjectStaticFileImportUrl:
|
|
18923
|
+
footprintFileParserMap: z144.record(z144.string(), footprintFileParserEntry).optional(),
|
|
18924
|
+
resolveProjectStaticFileImportUrl: z144.function().args(z144.string()).returns(z144.promise(z144.string())).describe(
|
|
18908
18925
|
"A function that returns a string URL for static files for the project"
|
|
18909
18926
|
).optional(),
|
|
18910
18927
|
platformFetch: platformFetch.optional()
|
|
@@ -18959,6 +18976,7 @@ export {
|
|
|
18959
18976
|
breakoutPointProps,
|
|
18960
18977
|
breakoutProps,
|
|
18961
18978
|
bugProps,
|
|
18979
|
+
busProps,
|
|
18962
18980
|
cadModelAxisDirection,
|
|
18963
18981
|
cadModelAxisDirections,
|
|
18964
18982
|
cadModelBase,
|