@tscircuit/props 0.0.490 → 0.0.492
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +548 -109
- package/dist/index.js +882 -863
- package/dist/index.js.map +1 -1
- package/lib/common/layout.ts +1 -123
- package/lib/common/pinAttributeMap.ts +77 -0
- package/lib/components/platedhole.ts +53 -3
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
rotation as rotation2,
|
|
31
31
|
supplier_name
|
|
32
32
|
} from "circuit-json";
|
|
33
|
-
import { z as
|
|
33
|
+
import { z as z16 } from "zod";
|
|
34
34
|
|
|
35
35
|
// lib/common/cadModel.ts
|
|
36
36
|
import { z as z6 } from "zod";
|
|
@@ -284,21 +284,63 @@ var pcbSx = z12.record(
|
|
|
284
284
|
);
|
|
285
285
|
expectTypesMatch(true);
|
|
286
286
|
|
|
287
|
+
// lib/common/pinAttributeMap.ts
|
|
288
|
+
import { z as z13 } from "zod";
|
|
289
|
+
var pinCapability = z13.enum([
|
|
290
|
+
"i2c_sda",
|
|
291
|
+
"i2c_scl",
|
|
292
|
+
"spi_cs",
|
|
293
|
+
"spi_sck",
|
|
294
|
+
"spi_mosi",
|
|
295
|
+
"spi_miso",
|
|
296
|
+
"uart_tx",
|
|
297
|
+
"uart_rx"
|
|
298
|
+
]);
|
|
299
|
+
var pinAttributeMap = z13.object({
|
|
300
|
+
capabilities: z13.array(pinCapability).optional(),
|
|
301
|
+
activeCapabilities: z13.array(pinCapability).optional(),
|
|
302
|
+
activeCapability: pinCapability.optional(),
|
|
303
|
+
providesPower: z13.boolean().optional(),
|
|
304
|
+
requiresPower: z13.boolean().optional(),
|
|
305
|
+
providesGround: z13.boolean().optional(),
|
|
306
|
+
requiresGround: z13.boolean().optional(),
|
|
307
|
+
providesVoltage: z13.union([z13.string(), z13.number()]).optional(),
|
|
308
|
+
requiresVoltage: z13.union([z13.string(), z13.number()]).optional(),
|
|
309
|
+
doNotConnect: z13.boolean().optional(),
|
|
310
|
+
includeInBoardPinout: z13.boolean().optional(),
|
|
311
|
+
highlightColor: z13.string().optional(),
|
|
312
|
+
mustBeConnected: z13.boolean().optional(),
|
|
313
|
+
canUseInternalPullup: z13.boolean().optional(),
|
|
314
|
+
isUsingInternalPullup: z13.boolean().optional(),
|
|
315
|
+
needsExternalPullup: z13.boolean().optional(),
|
|
316
|
+
canUseInternalPulldown: z13.boolean().optional(),
|
|
317
|
+
isUsingInternalPulldown: z13.boolean().optional(),
|
|
318
|
+
needsExternalPulldown: z13.boolean().optional(),
|
|
319
|
+
canUseOpenDrain: z13.boolean().optional(),
|
|
320
|
+
isUsingOpenDrain: z13.boolean().optional(),
|
|
321
|
+
canUsePushPull: z13.boolean().optional(),
|
|
322
|
+
isUsingPushPull: z13.boolean().optional(),
|
|
323
|
+
shouldHaveDecouplingCapacitor: z13.boolean().optional(),
|
|
324
|
+
recommendedDecouplingCapacitorCapacitance: z13.union([z13.string(), z13.number()]).optional(),
|
|
325
|
+
isGpio: z13.boolean().optional()
|
|
326
|
+
});
|
|
327
|
+
expectTypesMatch(true);
|
|
328
|
+
|
|
287
329
|
// lib/common/schStyle.ts
|
|
288
330
|
import { distance as distance7 } from "circuit-json";
|
|
289
|
-
import { z as
|
|
290
|
-
var schStyle =
|
|
291
|
-
defaultPassiveSize:
|
|
292
|
-
defaultCapacitorOrientation:
|
|
331
|
+
import { z as z14 } from "zod";
|
|
332
|
+
var schStyle = z14.object({
|
|
333
|
+
defaultPassiveSize: z14.union([z14.enum(["xs", "sm", "md"]), distance7]).optional(),
|
|
334
|
+
defaultCapacitorOrientation: z14.enum(["vertical", "none"]).optional()
|
|
293
335
|
});
|
|
294
336
|
expectTypesMatch(true);
|
|
295
337
|
|
|
296
338
|
// lib/common/symbolProp.ts
|
|
297
|
-
import { z as
|
|
298
|
-
var symbolProp =
|
|
339
|
+
import { z as z15 } from "zod";
|
|
340
|
+
var symbolProp = z15.custom((v) => true);
|
|
299
341
|
|
|
300
342
|
// lib/common/layout.ts
|
|
301
|
-
var pcbLayoutProps =
|
|
343
|
+
var pcbLayoutProps = z16.object({
|
|
302
344
|
pcbX: pcbCoordinate.optional(),
|
|
303
345
|
pcbY: pcbCoordinate.optional(),
|
|
304
346
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -308,14 +350,14 @@ var pcbLayoutProps = z15.object({
|
|
|
308
350
|
pcbOffsetX: distance8.optional(),
|
|
309
351
|
pcbOffsetY: distance8.optional(),
|
|
310
352
|
pcbRotation: rotation2.optional(),
|
|
311
|
-
pcbPositionAnchor:
|
|
312
|
-
pcbPositionMode:
|
|
353
|
+
pcbPositionAnchor: z16.string().optional(),
|
|
354
|
+
pcbPositionMode: z16.enum([
|
|
313
355
|
"relative_to_group_anchor",
|
|
314
356
|
"auto",
|
|
315
357
|
"relative_to_board_anchor",
|
|
316
358
|
"relative_to_component_anchor"
|
|
317
359
|
]).optional(),
|
|
318
|
-
shouldBeOnEdgeOfBoard:
|
|
360
|
+
shouldBeOnEdgeOfBoard: z16.boolean().optional(),
|
|
319
361
|
layer: layer_ref.optional(),
|
|
320
362
|
pcbMarginTop: distance8.optional(),
|
|
321
363
|
pcbMarginRight: distance8.optional(),
|
|
@@ -325,11 +367,11 @@ var pcbLayoutProps = z15.object({
|
|
|
325
367
|
pcbMarginY: distance8.optional(),
|
|
326
368
|
pcbStyle: pcbStyle.optional(),
|
|
327
369
|
pcbSx: pcbSx.optional(),
|
|
328
|
-
pcbRelative:
|
|
329
|
-
relative:
|
|
370
|
+
pcbRelative: z16.boolean().optional(),
|
|
371
|
+
relative: z16.boolean().optional()
|
|
330
372
|
});
|
|
331
373
|
expectTypesMatch(true);
|
|
332
|
-
var commonLayoutProps =
|
|
374
|
+
var commonLayoutProps = z16.object({
|
|
333
375
|
pcbX: pcbCoordinate.optional(),
|
|
334
376
|
pcbY: pcbCoordinate.optional(),
|
|
335
377
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -339,14 +381,14 @@ var commonLayoutProps = z15.object({
|
|
|
339
381
|
pcbOffsetX: distance8.optional(),
|
|
340
382
|
pcbOffsetY: distance8.optional(),
|
|
341
383
|
pcbRotation: rotation2.optional(),
|
|
342
|
-
pcbPositionAnchor:
|
|
343
|
-
pcbPositionMode:
|
|
384
|
+
pcbPositionAnchor: z16.string().optional(),
|
|
385
|
+
pcbPositionMode: z16.enum([
|
|
344
386
|
"relative_to_group_anchor",
|
|
345
387
|
"auto",
|
|
346
388
|
"relative_to_board_anchor",
|
|
347
389
|
"relative_to_component_anchor"
|
|
348
390
|
]).optional(),
|
|
349
|
-
shouldBeOnEdgeOfBoard:
|
|
391
|
+
shouldBeOnEdgeOfBoard: z16.boolean().optional(),
|
|
350
392
|
pcbMarginTop: distance8.optional(),
|
|
351
393
|
pcbMarginRight: distance8.optional(),
|
|
352
394
|
pcbMarginBottom: distance8.optional(),
|
|
@@ -368,97 +410,38 @@ var commonLayoutProps = z15.object({
|
|
|
368
410
|
footprint: footprintProp.optional(),
|
|
369
411
|
symbol: symbolProp.optional(),
|
|
370
412
|
schStyle: schStyle.optional(),
|
|
371
|
-
relative:
|
|
372
|
-
schRelative:
|
|
373
|
-
pcbRelative:
|
|
374
|
-
});
|
|
375
|
-
expectTypesMatch(true);
|
|
376
|
-
var supplierProps =
|
|
377
|
-
supplierPartNumbers:
|
|
378
|
-
});
|
|
379
|
-
expectTypesMatch(true);
|
|
380
|
-
var pinAttributeMap = z15.object({
|
|
381
|
-
capabilities: z15.array(
|
|
382
|
-
z15.enum([
|
|
383
|
-
"i2c_sda",
|
|
384
|
-
"i2c_scl",
|
|
385
|
-
"spi_cs",
|
|
386
|
-
"spi_sck",
|
|
387
|
-
"spi_mosi",
|
|
388
|
-
"spi_miso",
|
|
389
|
-
"uart_tx",
|
|
390
|
-
"uart_rx"
|
|
391
|
-
])
|
|
392
|
-
).optional(),
|
|
393
|
-
activeCapabilities: z15.array(
|
|
394
|
-
z15.enum([
|
|
395
|
-
"i2c_sda",
|
|
396
|
-
"i2c_scl",
|
|
397
|
-
"spi_cs",
|
|
398
|
-
"spi_sck",
|
|
399
|
-
"spi_mosi",
|
|
400
|
-
"spi_miso",
|
|
401
|
-
"uart_tx",
|
|
402
|
-
"uart_rx"
|
|
403
|
-
])
|
|
404
|
-
).optional(),
|
|
405
|
-
activeCapability: z15.enum([
|
|
406
|
-
"i2c_sda",
|
|
407
|
-
"i2c_scl",
|
|
408
|
-
"spi_cs",
|
|
409
|
-
"spi_sck",
|
|
410
|
-
"spi_mosi",
|
|
411
|
-
"spi_miso",
|
|
412
|
-
"uart_tx",
|
|
413
|
-
"uart_rx"
|
|
414
|
-
]).optional(),
|
|
415
|
-
providesPower: z15.boolean().optional(),
|
|
416
|
-
requiresPower: z15.boolean().optional(),
|
|
417
|
-
providesGround: z15.boolean().optional(),
|
|
418
|
-
requiresGround: z15.boolean().optional(),
|
|
419
|
-
providesVoltage: z15.union([z15.string(), z15.number()]).optional(),
|
|
420
|
-
requiresVoltage: z15.union([z15.string(), z15.number()]).optional(),
|
|
421
|
-
doNotConnect: z15.boolean().optional(),
|
|
422
|
-
includeInBoardPinout: z15.boolean().optional(),
|
|
423
|
-
highlightColor: z15.string().optional(),
|
|
424
|
-
mustBeConnected: z15.boolean().optional(),
|
|
425
|
-
canUseInternalPullup: z15.boolean().optional(),
|
|
426
|
-
isUsingInternalPullup: z15.boolean().optional(),
|
|
427
|
-
needsExternalPullup: z15.boolean().optional(),
|
|
428
|
-
canUseInternalPulldown: z15.boolean().optional(),
|
|
429
|
-
isUsingInternalPulldown: z15.boolean().optional(),
|
|
430
|
-
needsExternalPulldown: z15.boolean().optional(),
|
|
431
|
-
canUseOpenDrain: z15.boolean().optional(),
|
|
432
|
-
isUsingOpenDrain: z15.boolean().optional(),
|
|
433
|
-
canUsePushPull: z15.boolean().optional(),
|
|
434
|
-
isUsingPushPull: z15.boolean().optional(),
|
|
435
|
-
shouldHaveDecouplingCapacitor: z15.boolean().optional(),
|
|
436
|
-
recommendedDecouplingCapacitorCapacitance: z15.union([z15.string(), z15.number()]).optional()
|
|
413
|
+
relative: z16.boolean().optional(),
|
|
414
|
+
schRelative: z16.boolean().optional(),
|
|
415
|
+
pcbRelative: z16.boolean().optional()
|
|
416
|
+
});
|
|
417
|
+
expectTypesMatch(true);
|
|
418
|
+
var supplierProps = z16.object({
|
|
419
|
+
supplierPartNumbers: z16.record(supplier_name, z16.array(z16.string())).optional()
|
|
437
420
|
});
|
|
438
421
|
expectTypesMatch(true);
|
|
439
422
|
var commonComponentProps = commonLayoutProps.merge(supplierProps).extend({
|
|
440
|
-
key:
|
|
441
|
-
name:
|
|
442
|
-
displayName:
|
|
423
|
+
key: z16.any().optional(),
|
|
424
|
+
name: z16.string(),
|
|
425
|
+
displayName: z16.string().optional(),
|
|
443
426
|
datasheetUrl: url.optional(),
|
|
444
427
|
cadModel: cadModelProp.optional(),
|
|
445
428
|
kicadFootprintMetadata: kicadFootprintMetadata.optional(),
|
|
446
429
|
kicadSymbolMetadata: kicadSymbolMetadata.optional(),
|
|
447
|
-
children:
|
|
448
|
-
symbolName:
|
|
449
|
-
doNotPlace:
|
|
450
|
-
allowOffBoard:
|
|
430
|
+
children: z16.any().optional(),
|
|
431
|
+
symbolName: z16.string().optional(),
|
|
432
|
+
doNotPlace: z16.boolean().optional(),
|
|
433
|
+
allowOffBoard: z16.boolean().optional().describe(
|
|
451
434
|
"Allows the PCB component to hang off the board (e.g. for USB ports or displays)"
|
|
452
435
|
),
|
|
453
|
-
obstructsWithinBounds:
|
|
436
|
+
obstructsWithinBounds: z16.boolean().optional().describe(
|
|
454
437
|
"Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath"
|
|
455
438
|
),
|
|
456
|
-
showAsTranslucentModel:
|
|
439
|
+
showAsTranslucentModel: z16.boolean().optional().describe(
|
|
457
440
|
"Whether to show this component's CAD model as translucent in the 3D viewer."
|
|
458
441
|
),
|
|
459
|
-
pinAttributes:
|
|
460
|
-
mfn:
|
|
461
|
-
manufacturerPartNumber:
|
|
442
|
+
pinAttributes: z16.record(z16.string(), pinAttributeMap).optional(),
|
|
443
|
+
mfn: z16.string().describe("Manufacturer Part Number").optional(),
|
|
444
|
+
manufacturerPartNumber: z16.string().optional()
|
|
462
445
|
});
|
|
463
446
|
expectTypesMatch(true);
|
|
464
447
|
var componentProps = commonComponentProps;
|
|
@@ -473,7 +456,7 @@ var lrPolarPins = [
|
|
|
473
456
|
"cathode",
|
|
474
457
|
"neg"
|
|
475
458
|
];
|
|
476
|
-
var distanceOrMultiplier = distance8.or(
|
|
459
|
+
var distanceOrMultiplier = distance8.or(z16.enum(["2x", "3x", "4x"]));
|
|
477
460
|
|
|
478
461
|
// lib/generated/footprinter-autocomplete.ts
|
|
479
462
|
var footprinterStringExamples = [
|
|
@@ -502,8 +485,8 @@ var footprinterStringExamples = [
|
|
|
502
485
|
];
|
|
503
486
|
|
|
504
487
|
// lib/common/schematicOrientation.ts
|
|
505
|
-
import { z as
|
|
506
|
-
var schematicOrientation =
|
|
488
|
+
import { z as z17 } from "zod";
|
|
489
|
+
var schematicOrientation = z17.enum([
|
|
507
490
|
"vertical",
|
|
508
491
|
"horizontal",
|
|
509
492
|
"pos_top",
|
|
@@ -522,32 +505,32 @@ expectTypesMatch(
|
|
|
522
505
|
);
|
|
523
506
|
|
|
524
507
|
// lib/common/schematicPinDefinitions.ts
|
|
525
|
-
import { z as
|
|
526
|
-
var explicitPinSideDefinition =
|
|
527
|
-
pins:
|
|
528
|
-
direction:
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
508
|
+
import { z as z18 } from "zod";
|
|
509
|
+
var explicitPinSideDefinition = z18.object({
|
|
510
|
+
pins: z18.array(z18.union([z18.number(), z18.string()])),
|
|
511
|
+
direction: z18.union([
|
|
512
|
+
z18.literal("top-to-bottom"),
|
|
513
|
+
z18.literal("left-to-right"),
|
|
514
|
+
z18.literal("bottom-to-top"),
|
|
515
|
+
z18.literal("right-to-left")
|
|
533
516
|
])
|
|
534
517
|
});
|
|
535
|
-
var pinSideDefinitionInput =
|
|
536
|
-
var pinSideDefinitionWithDefaultDirection = (direction2) =>
|
|
518
|
+
var pinSideDefinitionInput = z18.array(z18.union([z18.number(), z18.string()]));
|
|
519
|
+
var pinSideDefinitionWithDefaultDirection = (direction2) => z18.union([explicitPinSideDefinition, pinSideDefinitionInput]).transform(
|
|
537
520
|
(value) => Array.isArray(value) ? {
|
|
538
521
|
pins: value,
|
|
539
522
|
direction: direction2
|
|
540
523
|
} : value
|
|
541
524
|
);
|
|
542
|
-
var schematicPortArrangement =
|
|
543
|
-
leftSize:
|
|
544
|
-
topSize:
|
|
545
|
-
rightSize:
|
|
546
|
-
bottomSize:
|
|
547
|
-
leftPinCount:
|
|
548
|
-
rightPinCount:
|
|
549
|
-
topPinCount:
|
|
550
|
-
bottomPinCount:
|
|
525
|
+
var schematicPortArrangement = z18.object({
|
|
526
|
+
leftSize: z18.number().optional().describe("@deprecated, use leftPinCount"),
|
|
527
|
+
topSize: z18.number().optional().describe("@deprecated, use topPinCount"),
|
|
528
|
+
rightSize: z18.number().optional().describe("@deprecated, use rightPinCount"),
|
|
529
|
+
bottomSize: z18.number().optional().describe("@deprecated, use bottomPinCount"),
|
|
530
|
+
leftPinCount: z18.number().optional(),
|
|
531
|
+
rightPinCount: z18.number().optional(),
|
|
532
|
+
topPinCount: z18.number().optional(),
|
|
533
|
+
bottomPinCount: z18.number().optional(),
|
|
551
534
|
leftSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
552
535
|
rightSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
553
536
|
topSide: pinSideDefinitionWithDefaultDirection("left-to-right").optional(),
|
|
@@ -558,9 +541,9 @@ expectTypesMatch(true);
|
|
|
558
541
|
|
|
559
542
|
// lib/common/schematicPinStyle.ts
|
|
560
543
|
import { distance as distance9 } from "circuit-json";
|
|
561
|
-
import { z as
|
|
562
|
-
var schematicPinStyle =
|
|
563
|
-
|
|
544
|
+
import { z as z19 } from "zod";
|
|
545
|
+
var schematicPinStyle = z19.record(
|
|
546
|
+
z19.object({
|
|
564
547
|
marginLeft: distance9.optional(),
|
|
565
548
|
marginRight: distance9.optional(),
|
|
566
549
|
marginTop: distance9.optional(),
|
|
@@ -574,17 +557,17 @@ var schematicPinStyle = z18.record(
|
|
|
574
557
|
expectTypesMatch(true);
|
|
575
558
|
|
|
576
559
|
// lib/common/schematicPinLabel.ts
|
|
577
|
-
import { z as
|
|
578
|
-
var schematicPinLabel =
|
|
560
|
+
import { z as z20 } from "zod";
|
|
561
|
+
var schematicPinLabel = z20.string().regex(/^[A-Za-z0-9_]+$/);
|
|
579
562
|
|
|
580
563
|
// lib/common/schematicSize.ts
|
|
581
564
|
import { distance as distance10 } from "circuit-json";
|
|
582
|
-
import { z as
|
|
583
|
-
var schematicSymbolSize = distance10.or(
|
|
565
|
+
import { z as z21 } from "zod";
|
|
566
|
+
var schematicSymbolSize = distance10.or(z21.enum(["xs", "sm", "default", "md"])).describe("distance between pin1 and pin2 of the schematic symbol");
|
|
584
567
|
|
|
585
568
|
// lib/common/kicadPinMetadata.ts
|
|
586
|
-
import { z as
|
|
587
|
-
var kicadPinElectricalType =
|
|
569
|
+
import { z as z22 } from "zod";
|
|
570
|
+
var kicadPinElectricalType = z22.enum([
|
|
588
571
|
"input",
|
|
589
572
|
"output",
|
|
590
573
|
"bidirectional",
|
|
@@ -598,7 +581,7 @@ var kicadPinElectricalType = z21.enum([
|
|
|
598
581
|
"open_emitter",
|
|
599
582
|
"no_connect"
|
|
600
583
|
]);
|
|
601
|
-
var kicadPinGraphicStyle =
|
|
584
|
+
var kicadPinGraphicStyle = z22.enum([
|
|
602
585
|
"line",
|
|
603
586
|
"inverted",
|
|
604
587
|
"clock",
|
|
@@ -609,7 +592,7 @@ var kicadPinGraphicStyle = z21.enum([
|
|
|
609
592
|
"falling_edge_clock",
|
|
610
593
|
"nonlogic"
|
|
611
594
|
]);
|
|
612
|
-
var kicadPinMetadata =
|
|
595
|
+
var kicadPinMetadata = z22.object({
|
|
613
596
|
electricalType: kicadPinElectricalType.optional(),
|
|
614
597
|
graphicStyle: kicadPinGraphicStyle.optional(),
|
|
615
598
|
pinLength: distance.optional(),
|
|
@@ -619,8 +602,8 @@ var kicadPinMetadata = z21.object({
|
|
|
619
602
|
expectTypesMatch(true);
|
|
620
603
|
|
|
621
604
|
// lib/common/ninePointAnchor.ts
|
|
622
|
-
import { z as
|
|
623
|
-
var ninePointAnchor =
|
|
605
|
+
import { z as z23 } from "zod";
|
|
606
|
+
var ninePointAnchor = z23.enum([
|
|
624
607
|
"top_left",
|
|
625
608
|
"top_center",
|
|
626
609
|
"top_right",
|
|
@@ -633,44 +616,44 @@ var ninePointAnchor = z22.enum([
|
|
|
633
616
|
]);
|
|
634
617
|
|
|
635
618
|
// lib/components/board.ts
|
|
636
|
-
import { z as
|
|
619
|
+
import { z as z37 } from "zod";
|
|
637
620
|
|
|
638
621
|
// lib/components/group.ts
|
|
639
622
|
import { length as length3, distance as distance11 } from "circuit-json";
|
|
640
|
-
import { z as
|
|
623
|
+
import { z as z36 } from "zod";
|
|
641
624
|
|
|
642
625
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
643
|
-
import { z as
|
|
644
|
-
var base_manual_edit_event =
|
|
645
|
-
edit_event_id:
|
|
646
|
-
in_progress:
|
|
647
|
-
created_at:
|
|
626
|
+
import { z as z24 } from "zod";
|
|
627
|
+
var base_manual_edit_event = z24.object({
|
|
628
|
+
edit_event_id: z24.string(),
|
|
629
|
+
in_progress: z24.boolean().optional(),
|
|
630
|
+
created_at: z24.number()
|
|
648
631
|
});
|
|
649
632
|
expectTypesMatch(
|
|
650
633
|
true
|
|
651
634
|
);
|
|
652
635
|
|
|
653
636
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
654
|
-
import { z as
|
|
637
|
+
import { z as z25 } from "zod";
|
|
655
638
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
656
|
-
pcb_edit_event_type:
|
|
657
|
-
edit_event_type:
|
|
658
|
-
pcb_component_id:
|
|
659
|
-
original_center:
|
|
660
|
-
new_center:
|
|
639
|
+
pcb_edit_event_type: z25.literal("edit_component_location").describe("deprecated"),
|
|
640
|
+
edit_event_type: z25.literal("edit_pcb_component_location"),
|
|
641
|
+
pcb_component_id: z25.string(),
|
|
642
|
+
original_center: z25.object({ x: z25.number(), y: z25.number() }),
|
|
643
|
+
new_center: z25.object({ x: z25.number(), y: z25.number() })
|
|
661
644
|
});
|
|
662
645
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
663
646
|
expectTypesMatch(true);
|
|
664
647
|
|
|
665
648
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
666
|
-
import { z as
|
|
649
|
+
import { z as z26 } from "zod";
|
|
667
650
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
668
|
-
pcb_edit_event_type:
|
|
669
|
-
edit_event_type:
|
|
670
|
-
pcb_port_id:
|
|
671
|
-
pcb_trace_hint_id:
|
|
672
|
-
route:
|
|
673
|
-
|
|
651
|
+
pcb_edit_event_type: z26.literal("edit_trace_hint").describe("deprecated"),
|
|
652
|
+
edit_event_type: z26.literal("edit_pcb_trace_hint").optional(),
|
|
653
|
+
pcb_port_id: z26.string(),
|
|
654
|
+
pcb_trace_hint_id: z26.string().optional(),
|
|
655
|
+
route: z26.array(
|
|
656
|
+
z26.object({ x: z26.number(), y: z26.number(), via: z26.boolean().optional() })
|
|
674
657
|
)
|
|
675
658
|
});
|
|
676
659
|
expectTypesMatch(
|
|
@@ -678,38 +661,38 @@ expectTypesMatch(
|
|
|
678
661
|
);
|
|
679
662
|
|
|
680
663
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
681
|
-
import { z as
|
|
664
|
+
import { z as z27 } from "zod";
|
|
682
665
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
683
|
-
edit_event_type:
|
|
684
|
-
schematic_component_id:
|
|
685
|
-
original_center:
|
|
686
|
-
new_center:
|
|
666
|
+
edit_event_type: z27.literal("edit_schematic_component_location"),
|
|
667
|
+
schematic_component_id: z27.string(),
|
|
668
|
+
original_center: z27.object({ x: z27.number(), y: z27.number() }),
|
|
669
|
+
new_center: z27.object({ x: z27.number(), y: z27.number() })
|
|
687
670
|
});
|
|
688
671
|
expectTypesMatch(true);
|
|
689
672
|
|
|
690
673
|
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
691
|
-
import { z as
|
|
674
|
+
import { z as z28 } from "zod";
|
|
692
675
|
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
693
|
-
edit_event_type:
|
|
694
|
-
pcb_group_id:
|
|
695
|
-
original_center:
|
|
696
|
-
new_center:
|
|
676
|
+
edit_event_type: z28.literal("edit_pcb_group_location"),
|
|
677
|
+
pcb_group_id: z28.string(),
|
|
678
|
+
original_center: z28.object({ x: z28.number(), y: z28.number() }),
|
|
679
|
+
new_center: z28.object({ x: z28.number(), y: z28.number() })
|
|
697
680
|
});
|
|
698
681
|
expectTypesMatch(true);
|
|
699
682
|
|
|
700
683
|
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
701
|
-
import { z as
|
|
684
|
+
import { z as z29 } from "zod";
|
|
702
685
|
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
703
|
-
edit_event_type:
|
|
704
|
-
schematic_group_id:
|
|
705
|
-
original_center:
|
|
706
|
-
new_center:
|
|
686
|
+
edit_event_type: z29.literal("edit_schematic_group_location"),
|
|
687
|
+
schematic_group_id: z29.string(),
|
|
688
|
+
original_center: z29.object({ x: z29.number(), y: z29.number() }),
|
|
689
|
+
new_center: z29.object({ x: z29.number(), y: z29.number() })
|
|
707
690
|
});
|
|
708
691
|
expectTypesMatch(true);
|
|
709
692
|
|
|
710
693
|
// lib/manual-edits/manual_edit_event.ts
|
|
711
|
-
import { z as
|
|
712
|
-
var manual_edit_event =
|
|
694
|
+
import { z as z30 } from "zod";
|
|
695
|
+
var manual_edit_event = z30.union([
|
|
713
696
|
edit_pcb_component_location_event,
|
|
714
697
|
edit_trace_hint_event,
|
|
715
698
|
edit_schematic_component_location_event
|
|
@@ -717,33 +700,33 @@ var manual_edit_event = z29.union([
|
|
|
717
700
|
expectTypesMatch(true);
|
|
718
701
|
|
|
719
702
|
// lib/manual-edits/manual_edits_file.ts
|
|
720
|
-
import { z as
|
|
703
|
+
import { z as z34 } from "zod";
|
|
721
704
|
|
|
722
705
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
723
|
-
import { z as
|
|
706
|
+
import { z as z31 } from "zod";
|
|
724
707
|
import { point as point2 } from "circuit-json";
|
|
725
|
-
var manual_pcb_placement =
|
|
726
|
-
selector:
|
|
727
|
-
relative_to:
|
|
708
|
+
var manual_pcb_placement = z31.object({
|
|
709
|
+
selector: z31.string(),
|
|
710
|
+
relative_to: z31.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
728
711
|
center: point2
|
|
729
712
|
});
|
|
730
713
|
expectTypesMatch(true);
|
|
731
714
|
|
|
732
715
|
// lib/manual-edits/manual_trace_hint.ts
|
|
733
|
-
import { z as
|
|
716
|
+
import { z as z32 } from "zod";
|
|
734
717
|
import { route_hint_point } from "circuit-json";
|
|
735
|
-
var manual_trace_hint =
|
|
736
|
-
pcb_port_selector:
|
|
737
|
-
offsets:
|
|
718
|
+
var manual_trace_hint = z32.object({
|
|
719
|
+
pcb_port_selector: z32.string(),
|
|
720
|
+
offsets: z32.array(route_hint_point)
|
|
738
721
|
});
|
|
739
722
|
expectTypesMatch(true);
|
|
740
723
|
|
|
741
724
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
742
|
-
import { z as
|
|
725
|
+
import { z as z33 } from "zod";
|
|
743
726
|
import { point as point4 } from "circuit-json";
|
|
744
|
-
var manual_schematic_placement =
|
|
745
|
-
selector:
|
|
746
|
-
relative_to:
|
|
727
|
+
var manual_schematic_placement = z33.object({
|
|
728
|
+
selector: z33.string(),
|
|
729
|
+
relative_to: z33.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
747
730
|
center: point4
|
|
748
731
|
});
|
|
749
732
|
expectTypesMatch(
|
|
@@ -751,37 +734,37 @@ expectTypesMatch(
|
|
|
751
734
|
);
|
|
752
735
|
|
|
753
736
|
// lib/manual-edits/manual_edits_file.ts
|
|
754
|
-
var manual_edits_file =
|
|
755
|
-
pcb_placements:
|
|
756
|
-
manual_trace_hints:
|
|
757
|
-
schematic_placements:
|
|
737
|
+
var manual_edits_file = z34.object({
|
|
738
|
+
pcb_placements: z34.array(manual_pcb_placement).optional(),
|
|
739
|
+
manual_trace_hints: z34.array(manual_trace_hint).optional(),
|
|
740
|
+
schematic_placements: z34.array(manual_schematic_placement).optional()
|
|
758
741
|
});
|
|
759
742
|
expectTypesMatch(true);
|
|
760
743
|
|
|
761
744
|
// lib/common/connectionsProp.ts
|
|
762
|
-
import { z as
|
|
763
|
-
var connectionTarget =
|
|
745
|
+
import { z as z35 } from "zod";
|
|
746
|
+
var connectionTarget = z35.string().or(z35.array(z35.string()).readonly()).or(z35.array(z35.string()));
|
|
764
747
|
var createConnectionsProp = (labels) => {
|
|
765
|
-
return
|
|
748
|
+
return z35.record(z35.enum(labels), connectionTarget);
|
|
766
749
|
};
|
|
767
750
|
|
|
768
751
|
// lib/components/group.ts
|
|
769
|
-
var layoutConfig =
|
|
770
|
-
layoutMode:
|
|
771
|
-
position:
|
|
772
|
-
grid:
|
|
773
|
-
gridCols:
|
|
774
|
-
gridRows:
|
|
775
|
-
gridTemplateRows:
|
|
776
|
-
gridTemplateColumns:
|
|
777
|
-
gridTemplate:
|
|
778
|
-
gridGap:
|
|
779
|
-
gridRowGap:
|
|
780
|
-
gridColumnGap:
|
|
781
|
-
flex:
|
|
782
|
-
flexDirection:
|
|
783
|
-
alignItems:
|
|
784
|
-
justifyContent:
|
|
752
|
+
var layoutConfig = z36.object({
|
|
753
|
+
layoutMode: z36.enum(["grid", "flex", "match-adapt", "relative", "none"]).optional(),
|
|
754
|
+
position: z36.enum(["absolute", "relative"]).optional(),
|
|
755
|
+
grid: z36.boolean().optional(),
|
|
756
|
+
gridCols: z36.number().or(z36.string()).optional(),
|
|
757
|
+
gridRows: z36.number().or(z36.string()).optional(),
|
|
758
|
+
gridTemplateRows: z36.string().optional(),
|
|
759
|
+
gridTemplateColumns: z36.string().optional(),
|
|
760
|
+
gridTemplate: z36.string().optional(),
|
|
761
|
+
gridGap: z36.number().or(z36.string()).optional(),
|
|
762
|
+
gridRowGap: z36.number().or(z36.string()).optional(),
|
|
763
|
+
gridColumnGap: z36.number().or(z36.string()).optional(),
|
|
764
|
+
flex: z36.boolean().or(z36.string()).optional(),
|
|
765
|
+
flexDirection: z36.enum(["row", "column"]).optional(),
|
|
766
|
+
alignItems: z36.enum(["start", "center", "end", "stretch"]).optional(),
|
|
767
|
+
justifyContent: z36.enum([
|
|
785
768
|
"start",
|
|
786
769
|
"center",
|
|
787
770
|
"end",
|
|
@@ -790,16 +773,16 @@ var layoutConfig = z35.object({
|
|
|
790
773
|
"space-around",
|
|
791
774
|
"space-evenly"
|
|
792
775
|
]).optional(),
|
|
793
|
-
flexRow:
|
|
794
|
-
flexColumn:
|
|
795
|
-
gap:
|
|
796
|
-
pack:
|
|
797
|
-
packOrderStrategy:
|
|
776
|
+
flexRow: z36.boolean().optional(),
|
|
777
|
+
flexColumn: z36.boolean().optional(),
|
|
778
|
+
gap: z36.number().or(z36.string()).optional(),
|
|
779
|
+
pack: z36.boolean().optional().describe("Pack the contents of this group using a packing strategy"),
|
|
780
|
+
packOrderStrategy: z36.enum([
|
|
798
781
|
"largest_to_smallest",
|
|
799
782
|
"first_to_last",
|
|
800
783
|
"highest_to_lowest_pin_count"
|
|
801
784
|
]).optional(),
|
|
802
|
-
packPlacementStrategy:
|
|
785
|
+
packPlacementStrategy: z36.enum(["shortest_connection_along_outline"]).optional(),
|
|
803
786
|
padding: length3.optional(),
|
|
804
787
|
paddingLeft: length3.optional(),
|
|
805
788
|
paddingRight: length3.optional(),
|
|
@@ -809,29 +792,29 @@ var layoutConfig = z35.object({
|
|
|
809
792
|
paddingY: length3.optional(),
|
|
810
793
|
width: length3.optional(),
|
|
811
794
|
height: length3.optional(),
|
|
812
|
-
matchAdapt:
|
|
813
|
-
matchAdaptTemplate:
|
|
795
|
+
matchAdapt: z36.boolean().optional(),
|
|
796
|
+
matchAdaptTemplate: z36.any().optional()
|
|
814
797
|
});
|
|
815
798
|
expectTypesMatch(true);
|
|
816
|
-
var border =
|
|
799
|
+
var border = z36.object({
|
|
817
800
|
strokeWidth: length3.optional(),
|
|
818
|
-
dashed:
|
|
819
|
-
solid:
|
|
801
|
+
dashed: z36.boolean().optional(),
|
|
802
|
+
solid: z36.boolean().optional()
|
|
820
803
|
});
|
|
821
|
-
var pcbAnchorAlignmentAutocomplete =
|
|
822
|
-
var autorouterConfig =
|
|
804
|
+
var pcbAnchorAlignmentAutocomplete = z36.custom((value) => typeof value === "string");
|
|
805
|
+
var autorouterConfig = z36.object({
|
|
823
806
|
serverUrl: url.optional(),
|
|
824
|
-
inputFormat:
|
|
825
|
-
serverMode:
|
|
826
|
-
serverCacheEnabled:
|
|
827
|
-
cache:
|
|
807
|
+
inputFormat: z36.enum(["simplified", "circuit-json"]).optional(),
|
|
808
|
+
serverMode: z36.enum(["job", "solve-endpoint"]).optional(),
|
|
809
|
+
serverCacheEnabled: z36.boolean().optional(),
|
|
810
|
+
cache: z36.custom((v) => true).optional(),
|
|
828
811
|
traceClearance: length3.optional(),
|
|
829
|
-
availableJumperTypes:
|
|
830
|
-
groupMode:
|
|
831
|
-
algorithmFn:
|
|
812
|
+
availableJumperTypes: z36.array(z36.enum(["1206x4", "0603"])).optional(),
|
|
813
|
+
groupMode: z36.enum(["sequential_trace", "subcircuit", "sequential-trace"]).optional(),
|
|
814
|
+
algorithmFn: z36.custom(
|
|
832
815
|
(v) => typeof v === "function" || v === void 0
|
|
833
816
|
).optional(),
|
|
834
|
-
preset:
|
|
817
|
+
preset: z36.enum([
|
|
835
818
|
"sequential_trace",
|
|
836
819
|
"subcircuit",
|
|
837
820
|
"auto",
|
|
@@ -846,58 +829,58 @@ var autorouterConfig = z35.object({
|
|
|
846
829
|
"auto-local",
|
|
847
830
|
"auto-cloud"
|
|
848
831
|
]).optional(),
|
|
849
|
-
local:
|
|
850
|
-
});
|
|
851
|
-
var autorouterPreset =
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
832
|
+
local: z36.boolean().optional()
|
|
833
|
+
});
|
|
834
|
+
var autorouterPreset = z36.union([
|
|
835
|
+
z36.literal("sequential_trace"),
|
|
836
|
+
z36.literal("subcircuit"),
|
|
837
|
+
z36.literal("auto"),
|
|
838
|
+
z36.literal("auto_local"),
|
|
839
|
+
z36.literal("auto_cloud"),
|
|
840
|
+
z36.literal("auto_jumper"),
|
|
841
|
+
z36.literal("tscircuit_beta"),
|
|
842
|
+
z36.literal("freerouting"),
|
|
843
|
+
z36.literal("laser_prefab"),
|
|
861
844
|
// Prefabricated PCB with laser copper ablation
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
845
|
+
z36.literal("auto-jumper"),
|
|
846
|
+
z36.literal("sequential-trace"),
|
|
847
|
+
z36.literal("auto-local"),
|
|
848
|
+
z36.literal("auto-cloud")
|
|
866
849
|
]);
|
|
867
|
-
var autorouterString =
|
|
868
|
-
var autorouterProp =
|
|
850
|
+
var autorouterString = z36.string();
|
|
851
|
+
var autorouterProp = z36.union([
|
|
869
852
|
autorouterConfig,
|
|
870
853
|
autorouterPreset,
|
|
871
854
|
autorouterString
|
|
872
855
|
]);
|
|
873
|
-
var autorouterEffortLevel =
|
|
856
|
+
var autorouterEffortLevel = z36.enum(["1x", "2x", "5x", "10x", "100x"]);
|
|
874
857
|
var baseGroupProps = commonLayoutProps.extend({
|
|
875
|
-
name:
|
|
876
|
-
children:
|
|
877
|
-
schTitle:
|
|
878
|
-
key:
|
|
879
|
-
showAsSchematicBox:
|
|
880
|
-
connections:
|
|
858
|
+
name: z36.string().optional(),
|
|
859
|
+
children: z36.any().optional(),
|
|
860
|
+
schTitle: z36.string().optional(),
|
|
861
|
+
key: z36.any().optional(),
|
|
862
|
+
showAsSchematicBox: z36.boolean().optional(),
|
|
863
|
+
connections: z36.record(z36.string(), connectionTarget.optional()).optional(),
|
|
881
864
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
882
865
|
schPinSpacing: length3.optional(),
|
|
883
866
|
schPinStyle: schematicPinStyle.optional(),
|
|
884
867
|
...layoutConfig.shape,
|
|
885
868
|
grid: layoutConfig.shape.grid.describe("@deprecated use pcbGrid"),
|
|
886
869
|
flex: layoutConfig.shape.flex.describe("@deprecated use pcbFlex"),
|
|
887
|
-
pcbGrid:
|
|
888
|
-
pcbGridCols:
|
|
889
|
-
pcbGridRows:
|
|
890
|
-
pcbGridTemplateRows:
|
|
891
|
-
pcbGridTemplateColumns:
|
|
892
|
-
pcbGridTemplate:
|
|
893
|
-
pcbGridGap:
|
|
894
|
-
pcbGridRowGap:
|
|
895
|
-
pcbGridColumnGap:
|
|
896
|
-
pcbFlex:
|
|
897
|
-
pcbFlexGap:
|
|
898
|
-
pcbFlexDirection:
|
|
899
|
-
pcbAlignItems:
|
|
900
|
-
pcbJustifyContent:
|
|
870
|
+
pcbGrid: z36.boolean().optional(),
|
|
871
|
+
pcbGridCols: z36.number().or(z36.string()).optional(),
|
|
872
|
+
pcbGridRows: z36.number().or(z36.string()).optional(),
|
|
873
|
+
pcbGridTemplateRows: z36.string().optional(),
|
|
874
|
+
pcbGridTemplateColumns: z36.string().optional(),
|
|
875
|
+
pcbGridTemplate: z36.string().optional(),
|
|
876
|
+
pcbGridGap: z36.number().or(z36.string()).optional(),
|
|
877
|
+
pcbGridRowGap: z36.number().or(z36.string()).optional(),
|
|
878
|
+
pcbGridColumnGap: z36.number().or(z36.string()).optional(),
|
|
879
|
+
pcbFlex: z36.boolean().or(z36.string()).optional(),
|
|
880
|
+
pcbFlexGap: z36.number().or(z36.string()).optional(),
|
|
881
|
+
pcbFlexDirection: z36.enum(["row", "column"]).optional(),
|
|
882
|
+
pcbAlignItems: z36.enum(["start", "center", "end", "stretch"]).optional(),
|
|
883
|
+
pcbJustifyContent: z36.enum([
|
|
901
884
|
"start",
|
|
902
885
|
"center",
|
|
903
886
|
"end",
|
|
@@ -906,25 +889,25 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
906
889
|
"space-around",
|
|
907
890
|
"space-evenly"
|
|
908
891
|
]).optional(),
|
|
909
|
-
pcbFlexRow:
|
|
910
|
-
pcbFlexColumn:
|
|
911
|
-
pcbGap:
|
|
912
|
-
pcbPack:
|
|
913
|
-
pcbPackGap:
|
|
914
|
-
schGrid:
|
|
915
|
-
schGridCols:
|
|
916
|
-
schGridRows:
|
|
917
|
-
schGridTemplateRows:
|
|
918
|
-
schGridTemplateColumns:
|
|
919
|
-
schGridTemplate:
|
|
920
|
-
schGridGap:
|
|
921
|
-
schGridRowGap:
|
|
922
|
-
schGridColumnGap:
|
|
923
|
-
schFlex:
|
|
924
|
-
schFlexGap:
|
|
925
|
-
schFlexDirection:
|
|
926
|
-
schAlignItems:
|
|
927
|
-
schJustifyContent:
|
|
892
|
+
pcbFlexRow: z36.boolean().optional(),
|
|
893
|
+
pcbFlexColumn: z36.boolean().optional(),
|
|
894
|
+
pcbGap: z36.number().or(z36.string()).optional(),
|
|
895
|
+
pcbPack: z36.boolean().optional(),
|
|
896
|
+
pcbPackGap: z36.number().or(z36.string()).optional(),
|
|
897
|
+
schGrid: z36.boolean().optional(),
|
|
898
|
+
schGridCols: z36.number().or(z36.string()).optional(),
|
|
899
|
+
schGridRows: z36.number().or(z36.string()).optional(),
|
|
900
|
+
schGridTemplateRows: z36.string().optional(),
|
|
901
|
+
schGridTemplateColumns: z36.string().optional(),
|
|
902
|
+
schGridTemplate: z36.string().optional(),
|
|
903
|
+
schGridGap: z36.number().or(z36.string()).optional(),
|
|
904
|
+
schGridRowGap: z36.number().or(z36.string()).optional(),
|
|
905
|
+
schGridColumnGap: z36.number().or(z36.string()).optional(),
|
|
906
|
+
schFlex: z36.boolean().or(z36.string()).optional(),
|
|
907
|
+
schFlexGap: z36.number().or(z36.string()).optional(),
|
|
908
|
+
schFlexDirection: z36.enum(["row", "column"]).optional(),
|
|
909
|
+
schAlignItems: z36.enum(["start", "center", "end", "stretch"]).optional(),
|
|
910
|
+
schJustifyContent: z36.enum([
|
|
928
911
|
"start",
|
|
929
912
|
"center",
|
|
930
913
|
"end",
|
|
@@ -933,11 +916,11 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
933
916
|
"space-around",
|
|
934
917
|
"space-evenly"
|
|
935
918
|
]).optional(),
|
|
936
|
-
schFlexRow:
|
|
937
|
-
schFlexColumn:
|
|
938
|
-
schGap:
|
|
939
|
-
schPack:
|
|
940
|
-
schMatchAdapt:
|
|
919
|
+
schFlexRow: z36.boolean().optional(),
|
|
920
|
+
schFlexColumn: z36.boolean().optional(),
|
|
921
|
+
schGap: z36.number().or(z36.string()).optional(),
|
|
922
|
+
schPack: z36.boolean().optional(),
|
|
923
|
+
schMatchAdapt: z36.boolean().optional(),
|
|
941
924
|
pcbWidth: length3.optional(),
|
|
942
925
|
pcbHeight: length3.optional(),
|
|
943
926
|
minTraceWidth: length3.optional(),
|
|
@@ -960,38 +943,38 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
960
943
|
pcbPaddingBottom: length3.optional(),
|
|
961
944
|
pcbAnchorAlignment: pcbAnchorAlignmentAutocomplete.optional()
|
|
962
945
|
});
|
|
963
|
-
var partsEngine =
|
|
946
|
+
var partsEngine = z36.custom((v) => "findPart" in v);
|
|
964
947
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
965
948
|
manualEdits: manual_edits_file.optional(),
|
|
966
|
-
schAutoLayoutEnabled:
|
|
967
|
-
schTraceAutoLabelEnabled:
|
|
949
|
+
schAutoLayoutEnabled: z36.boolean().optional(),
|
|
950
|
+
schTraceAutoLabelEnabled: z36.boolean().optional(),
|
|
968
951
|
schMaxTraceDistance: distance11.optional(),
|
|
969
|
-
routingDisabled:
|
|
970
|
-
bomDisabled:
|
|
952
|
+
routingDisabled: z36.boolean().optional(),
|
|
953
|
+
bomDisabled: z36.boolean().optional(),
|
|
971
954
|
defaultTraceWidth: length3.optional(),
|
|
972
955
|
minTraceWidth: length3.optional(),
|
|
973
956
|
nominalTraceWidth: length3.optional(),
|
|
974
957
|
partsEngine: partsEngine.optional(),
|
|
975
|
-
_subcircuitCachingEnabled:
|
|
976
|
-
pcbRouteCache:
|
|
958
|
+
_subcircuitCachingEnabled: z36.boolean().optional(),
|
|
959
|
+
pcbRouteCache: z36.custom((v) => true).optional(),
|
|
977
960
|
autorouter: autorouterProp.optional(),
|
|
978
961
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
979
|
-
autorouterVersion:
|
|
980
|
-
square:
|
|
981
|
-
emptyArea:
|
|
982
|
-
filledArea:
|
|
962
|
+
autorouterVersion: z36.enum(["v1", "v2", "latest"]).optional(),
|
|
963
|
+
square: z36.boolean().optional(),
|
|
964
|
+
emptyArea: z36.string().optional(),
|
|
965
|
+
filledArea: z36.string().optional(),
|
|
983
966
|
width: distance11.optional(),
|
|
984
967
|
height: distance11.optional(),
|
|
985
|
-
outline:
|
|
968
|
+
outline: z36.array(point).optional(),
|
|
986
969
|
outlineOffsetX: distance11.optional(),
|
|
987
970
|
outlineOffsetY: distance11.optional(),
|
|
988
|
-
circuitJson:
|
|
971
|
+
circuitJson: z36.array(z36.any()).optional()
|
|
989
972
|
});
|
|
990
973
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
991
|
-
subcircuit:
|
|
974
|
+
subcircuit: z36.literal(true)
|
|
992
975
|
});
|
|
993
|
-
var groupProps =
|
|
994
|
-
baseGroupProps.extend({ subcircuit:
|
|
976
|
+
var groupProps = z36.discriminatedUnion("subcircuit", [
|
|
977
|
+
baseGroupProps.extend({ subcircuit: z36.literal(false).optional() }),
|
|
995
978
|
subcircuitGroupPropsWithBool
|
|
996
979
|
]);
|
|
997
980
|
expectTypesMatch(true);
|
|
@@ -1000,35 +983,35 @@ expectTypesMatch(true);
|
|
|
1000
983
|
expectTypesMatch(true);
|
|
1001
984
|
|
|
1002
985
|
// lib/components/board.ts
|
|
1003
|
-
var boardColor =
|
|
986
|
+
var boardColor = z37.custom((value) => typeof value === "string");
|
|
1004
987
|
var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
1005
|
-
material:
|
|
1006
|
-
layers:
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
988
|
+
material: z37.enum(["fr4", "fr1"]).default("fr4"),
|
|
989
|
+
layers: z37.union([
|
|
990
|
+
z37.literal(1),
|
|
991
|
+
z37.literal(2),
|
|
992
|
+
z37.literal(4),
|
|
993
|
+
z37.literal(6),
|
|
994
|
+
z37.literal(8)
|
|
1012
995
|
]).default(2),
|
|
1013
996
|
borderRadius: distance.optional(),
|
|
1014
997
|
thickness: distance.optional(),
|
|
1015
998
|
boardAnchorPosition: point.optional(),
|
|
1016
999
|
anchorAlignment: ninePointAnchor.optional(),
|
|
1017
1000
|
boardAnchorAlignment: ninePointAnchor.optional().describe("Prefer using anchorAlignment when possible"),
|
|
1018
|
-
title:
|
|
1001
|
+
title: z37.string().optional(),
|
|
1019
1002
|
solderMaskColor: boardColor.optional(),
|
|
1020
1003
|
topSolderMaskColor: boardColor.optional(),
|
|
1021
1004
|
bottomSolderMaskColor: boardColor.optional(),
|
|
1022
1005
|
silkscreenColor: boardColor.optional(),
|
|
1023
1006
|
topSilkscreenColor: boardColor.optional(),
|
|
1024
1007
|
bottomSilkscreenColor: boardColor.optional(),
|
|
1025
|
-
doubleSidedAssembly:
|
|
1026
|
-
schematicDisabled:
|
|
1008
|
+
doubleSidedAssembly: z37.boolean().optional().default(false),
|
|
1009
|
+
schematicDisabled: z37.boolean().optional()
|
|
1027
1010
|
});
|
|
1028
1011
|
expectTypesMatch(true);
|
|
1029
1012
|
|
|
1030
1013
|
// lib/components/panel.ts
|
|
1031
|
-
import { z as
|
|
1014
|
+
import { z as z38 } from "zod";
|
|
1032
1015
|
var panelProps = baseGroupProps.omit({
|
|
1033
1016
|
width: true,
|
|
1034
1017
|
height: true,
|
|
@@ -1037,25 +1020,25 @@ var panelProps = baseGroupProps.omit({
|
|
|
1037
1020
|
}).extend({
|
|
1038
1021
|
width: distance.optional(),
|
|
1039
1022
|
height: distance.optional(),
|
|
1040
|
-
children:
|
|
1023
|
+
children: z38.any().optional(),
|
|
1041
1024
|
anchorAlignment: ninePointAnchor.optional(),
|
|
1042
|
-
noSolderMask:
|
|
1043
|
-
panelizationMethod:
|
|
1025
|
+
noSolderMask: z38.boolean().optional(),
|
|
1026
|
+
panelizationMethod: z38.enum(["tab-routing", "none"]).optional(),
|
|
1044
1027
|
boardGap: distance.optional(),
|
|
1045
|
-
layoutMode:
|
|
1046
|
-
row:
|
|
1047
|
-
col:
|
|
1028
|
+
layoutMode: z38.enum(["grid", "pack", "none"]).optional(),
|
|
1029
|
+
row: z38.number().optional(),
|
|
1030
|
+
col: z38.number().optional(),
|
|
1048
1031
|
cellWidth: distance.optional(),
|
|
1049
1032
|
cellHeight: distance.optional(),
|
|
1050
1033
|
tabWidth: distance.optional(),
|
|
1051
1034
|
tabLength: distance.optional(),
|
|
1052
|
-
mouseBites:
|
|
1035
|
+
mouseBites: z38.boolean().optional(),
|
|
1053
1036
|
edgePadding: distance.optional(),
|
|
1054
1037
|
edgePaddingLeft: distance.optional(),
|
|
1055
1038
|
edgePaddingRight: distance.optional(),
|
|
1056
1039
|
edgePaddingTop: distance.optional(),
|
|
1057
1040
|
edgePaddingBottom: distance.optional(),
|
|
1058
|
-
_subcircuitCachingEnabled:
|
|
1041
|
+
_subcircuitCachingEnabled: z38.boolean().optional()
|
|
1059
1042
|
});
|
|
1060
1043
|
expectTypesMatch(true);
|
|
1061
1044
|
|
|
@@ -1078,33 +1061,33 @@ expectTypesMatch(true);
|
|
|
1078
1061
|
|
|
1079
1062
|
// lib/components/chip.ts
|
|
1080
1063
|
import { distance as distance13, supplier_name as supplier_name2 } from "circuit-json";
|
|
1081
|
-
import { z as
|
|
1082
|
-
var connectionTarget2 =
|
|
1083
|
-
var connectionsProp =
|
|
1084
|
-
var pinLabelsProp =
|
|
1064
|
+
import { z as z41 } from "zod";
|
|
1065
|
+
var connectionTarget2 = z41.string().or(z41.array(z41.string()).readonly()).or(z41.array(z41.string()));
|
|
1066
|
+
var connectionsProp = z41.custom().pipe(z41.record(z41.string(), connectionTarget2));
|
|
1067
|
+
var pinLabelsProp = z41.record(
|
|
1085
1068
|
schematicPinLabel,
|
|
1086
|
-
schematicPinLabel.or(
|
|
1069
|
+
schematicPinLabel.or(z41.array(schematicPinLabel).readonly()).or(z41.array(schematicPinLabel))
|
|
1087
1070
|
);
|
|
1088
1071
|
expectTypesMatch(true);
|
|
1089
|
-
var pinCompatibleVariant =
|
|
1090
|
-
manufacturerPartNumber:
|
|
1091
|
-
supplierPartNumber:
|
|
1072
|
+
var pinCompatibleVariant = z41.object({
|
|
1073
|
+
manufacturerPartNumber: z41.string().optional(),
|
|
1074
|
+
supplierPartNumber: z41.record(supplier_name2, z41.array(z41.string())).optional()
|
|
1092
1075
|
});
|
|
1093
1076
|
var chipProps = commonComponentProps.extend({
|
|
1094
|
-
manufacturerPartNumber:
|
|
1077
|
+
manufacturerPartNumber: z41.string().optional(),
|
|
1095
1078
|
pinLabels: pinLabelsProp.optional(),
|
|
1096
|
-
showPinAliases:
|
|
1097
|
-
pcbPinLabels:
|
|
1098
|
-
internallyConnectedPins:
|
|
1099
|
-
externallyConnectedPins:
|
|
1079
|
+
showPinAliases: z41.boolean().optional(),
|
|
1080
|
+
pcbPinLabels: z41.record(z41.string(), z41.string()).optional(),
|
|
1081
|
+
internallyConnectedPins: z41.array(z41.array(z41.union([z41.string(), z41.number()]))).optional(),
|
|
1082
|
+
externallyConnectedPins: z41.array(z41.array(z41.string())).optional(),
|
|
1100
1083
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
1101
1084
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
1102
|
-
pinCompatibleVariants:
|
|
1085
|
+
pinCompatibleVariants: z41.array(pinCompatibleVariant).optional(),
|
|
1103
1086
|
schPinStyle: schematicPinStyle.optional(),
|
|
1104
1087
|
schPinSpacing: distance13.optional(),
|
|
1105
1088
|
schWidth: distance13.optional(),
|
|
1106
1089
|
schHeight: distance13.optional(),
|
|
1107
|
-
noSchematicRepresentation:
|
|
1090
|
+
noSchematicRepresentation: z41.boolean().optional(),
|
|
1108
1091
|
connections: connectionsProp.optional()
|
|
1109
1092
|
});
|
|
1110
1093
|
var bugProps = chipProps;
|
|
@@ -1116,108 +1099,139 @@ expectTypesMatch(true);
|
|
|
1116
1099
|
|
|
1117
1100
|
// lib/components/jumper.ts
|
|
1118
1101
|
import { distance as distance14 } from "circuit-json";
|
|
1119
|
-
import { z as
|
|
1102
|
+
import { z as z42 } from "zod";
|
|
1120
1103
|
var jumperProps = commonComponentProps.extend({
|
|
1121
|
-
manufacturerPartNumber:
|
|
1122
|
-
pinLabels:
|
|
1123
|
-
|
|
1124
|
-
schematicPinLabel.or(
|
|
1104
|
+
manufacturerPartNumber: z42.string().optional(),
|
|
1105
|
+
pinLabels: z42.record(
|
|
1106
|
+
z42.number().or(schematicPinLabel),
|
|
1107
|
+
schematicPinLabel.or(z42.array(schematicPinLabel))
|
|
1125
1108
|
).optional(),
|
|
1126
1109
|
schPinStyle: schematicPinStyle.optional(),
|
|
1127
1110
|
schPinSpacing: distance14.optional(),
|
|
1128
1111
|
schWidth: distance14.optional(),
|
|
1129
1112
|
schHeight: distance14.optional(),
|
|
1130
|
-
schDirection:
|
|
1113
|
+
schDirection: z42.enum(["left", "right"]).optional(),
|
|
1131
1114
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
1132
1115
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
1133
|
-
pcbPinLabels:
|
|
1134
|
-
pinCount:
|
|
1135
|
-
internallyConnectedPins:
|
|
1136
|
-
connections:
|
|
1116
|
+
pcbPinLabels: z42.record(z42.string(), z42.string()).optional(),
|
|
1117
|
+
pinCount: z42.union([z42.literal(2), z42.literal(3)]).optional(),
|
|
1118
|
+
internallyConnectedPins: z42.array(z42.array(z42.union([z42.string(), z42.number()]))).optional(),
|
|
1119
|
+
connections: z42.custom().pipe(z42.record(z42.string(), connectionTarget)).optional()
|
|
1137
1120
|
});
|
|
1138
1121
|
expectTypesMatch(true);
|
|
1139
1122
|
|
|
1140
1123
|
// lib/components/solderjumper.ts
|
|
1141
|
-
import { z as
|
|
1124
|
+
import { z as z43 } from "zod";
|
|
1142
1125
|
var solderjumperProps = jumperProps.extend({
|
|
1143
|
-
bridgedPins:
|
|
1144
|
-
bridged:
|
|
1126
|
+
bridgedPins: z43.array(z43.array(z43.string())).optional(),
|
|
1127
|
+
bridged: z43.boolean().optional()
|
|
1145
1128
|
});
|
|
1146
1129
|
expectTypesMatch(true);
|
|
1147
1130
|
|
|
1148
1131
|
// lib/components/connector.ts
|
|
1149
1132
|
import { distance as distance15 } from "circuit-json";
|
|
1150
|
-
import { z as
|
|
1133
|
+
import { z as z44 } from "zod";
|
|
1151
1134
|
var connectorProps = commonComponentProps.extend({
|
|
1152
|
-
manufacturerPartNumber:
|
|
1153
|
-
pinLabels:
|
|
1154
|
-
|
|
1155
|
-
schematicPinLabel.or(
|
|
1135
|
+
manufacturerPartNumber: z44.string().optional(),
|
|
1136
|
+
pinLabels: z44.record(
|
|
1137
|
+
z44.number().or(schematicPinLabel),
|
|
1138
|
+
schematicPinLabel.or(z44.array(schematicPinLabel))
|
|
1156
1139
|
).optional(),
|
|
1157
1140
|
schPinStyle: schematicPinStyle.optional(),
|
|
1158
1141
|
schPinSpacing: distance15.optional(),
|
|
1159
1142
|
schWidth: distance15.optional(),
|
|
1160
1143
|
schHeight: distance15.optional(),
|
|
1161
|
-
schDirection:
|
|
1144
|
+
schDirection: z44.enum(["left", "right"]).optional(),
|
|
1162
1145
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
1163
|
-
internallyConnectedPins:
|
|
1164
|
-
standard:
|
|
1146
|
+
internallyConnectedPins: z44.array(z44.array(z44.union([z44.string(), z44.number()]))).optional(),
|
|
1147
|
+
standard: z44.enum(["usb_c", "m2"]).optional()
|
|
1165
1148
|
});
|
|
1166
1149
|
expectTypesMatch(true);
|
|
1167
1150
|
|
|
1168
1151
|
// lib/components/interconnect.ts
|
|
1169
|
-
import { z as
|
|
1152
|
+
import { z as z45 } from "zod";
|
|
1170
1153
|
var interconnectProps = commonComponentProps.extend({
|
|
1171
|
-
standard:
|
|
1172
|
-
pinLabels:
|
|
1173
|
-
|
|
1174
|
-
schematicPinLabel.or(
|
|
1154
|
+
standard: z45.enum(["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]).optional(),
|
|
1155
|
+
pinLabels: z45.record(
|
|
1156
|
+
z45.number().or(schematicPinLabel),
|
|
1157
|
+
schematicPinLabel.or(z45.array(schematicPinLabel))
|
|
1175
1158
|
).optional(),
|
|
1176
|
-
internallyConnectedPins:
|
|
1159
|
+
internallyConnectedPins: z45.array(z45.array(z45.union([z45.string(), z45.number()]))).optional()
|
|
1177
1160
|
});
|
|
1178
1161
|
expectTypesMatch(true);
|
|
1179
1162
|
|
|
1180
1163
|
// lib/components/fuse.ts
|
|
1181
|
-
import { z as
|
|
1164
|
+
import { z as z46 } from "zod";
|
|
1182
1165
|
var fusePinLabels = ["pin1", "pin2"];
|
|
1183
1166
|
var fuseProps = commonComponentProps.extend({
|
|
1184
|
-
currentRating:
|
|
1185
|
-
voltageRating:
|
|
1186
|
-
schShowRatings:
|
|
1167
|
+
currentRating: z46.union([z46.number(), z46.string()]),
|
|
1168
|
+
voltageRating: z46.union([z46.number(), z46.string()]).optional(),
|
|
1169
|
+
schShowRatings: z46.boolean().optional(),
|
|
1187
1170
|
schOrientation: schematicOrientation.optional(),
|
|
1188
|
-
connections:
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1171
|
+
connections: z46.record(
|
|
1172
|
+
z46.string(),
|
|
1173
|
+
z46.union([
|
|
1174
|
+
z46.string(),
|
|
1175
|
+
z46.array(z46.string()).readonly(),
|
|
1176
|
+
z46.array(z46.string())
|
|
1194
1177
|
])
|
|
1195
1178
|
).optional()
|
|
1196
1179
|
});
|
|
1197
1180
|
|
|
1198
1181
|
// lib/components/platedhole.ts
|
|
1199
1182
|
import { distance as distance16 } from "circuit-json";
|
|
1200
|
-
import { z as
|
|
1201
|
-
var
|
|
1183
|
+
import { z as z47 } from "zod";
|
|
1184
|
+
var DEFAULT_PIN_HEADER_HOLE_DIAMETER = "0.04in";
|
|
1185
|
+
var DEFAULT_PIN_HEADER_OUTER_DIAMETER = "0.1in";
|
|
1186
|
+
var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
1187
|
+
if (!rawProps || typeof rawProps !== "object") return rawProps;
|
|
1188
|
+
const props = { ...rawProps };
|
|
1189
|
+
if (props.shape !== void 0) return props;
|
|
1190
|
+
if (props.padOutline !== void 0) {
|
|
1191
|
+
props.shape = "hole_with_polygon_pad";
|
|
1192
|
+
return props;
|
|
1193
|
+
}
|
|
1194
|
+
if (props.rectPadWidth !== void 0 || props.rectPadHeight !== void 0) {
|
|
1195
|
+
if (props.holeDiameter !== void 0) {
|
|
1196
|
+
props.shape = "circular_hole_with_rect_pad";
|
|
1197
|
+
return props;
|
|
1198
|
+
}
|
|
1199
|
+
props.shape = "pill_hole_with_rect_pad";
|
|
1200
|
+
return props;
|
|
1201
|
+
}
|
|
1202
|
+
if (props.outerDiameter !== void 0 || props.holeDiameter !== void 0 || props.padDiameter !== void 0) {
|
|
1203
|
+
props.shape = "circle";
|
|
1204
|
+
return props;
|
|
1205
|
+
}
|
|
1206
|
+
if (props.outerWidth !== void 0 || props.outerHeight !== void 0) {
|
|
1207
|
+
props.shape = props.rectPad === true ? "pill" : "oval";
|
|
1208
|
+
return props;
|
|
1209
|
+
}
|
|
1210
|
+
props.shape = "circle";
|
|
1211
|
+
props.holeDiameter = DEFAULT_PIN_HEADER_HOLE_DIAMETER;
|
|
1212
|
+
props.outerDiameter = DEFAULT_PIN_HEADER_OUTER_DIAMETER;
|
|
1213
|
+
return props;
|
|
1214
|
+
};
|
|
1215
|
+
var distanceHiddenUndefined = z47.custom().transform((a) => {
|
|
1202
1216
|
if (a === void 0) return void 0;
|
|
1203
1217
|
return distance16.parse(a);
|
|
1204
1218
|
});
|
|
1205
|
-
var
|
|
1219
|
+
var platedHolePropsByShape = z47.discriminatedUnion("shape", [
|
|
1206
1220
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1207
|
-
name:
|
|
1208
|
-
connectsTo:
|
|
1209
|
-
shape:
|
|
1221
|
+
name: z47.string().optional(),
|
|
1222
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1223
|
+
shape: z47.literal("circle"),
|
|
1210
1224
|
holeDiameter: distance16,
|
|
1211
1225
|
outerDiameter: distance16,
|
|
1212
1226
|
padDiameter: distance16.optional().describe("Diameter of the copper pad"),
|
|
1213
1227
|
portHints: portHints.optional(),
|
|
1214
1228
|
solderMaskMargin: distance16.optional(),
|
|
1215
|
-
coveredWithSolderMask:
|
|
1229
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1216
1230
|
}),
|
|
1217
1231
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1218
|
-
name:
|
|
1219
|
-
connectsTo:
|
|
1220
|
-
shape:
|
|
1232
|
+
name: z47.string().optional(),
|
|
1233
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1234
|
+
shape: z47.literal("oval"),
|
|
1221
1235
|
outerWidth: distance16,
|
|
1222
1236
|
outerHeight: distance16,
|
|
1223
1237
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -1226,13 +1240,13 @@ var platedHoleProps = z46.discriminatedUnion("shape", [
|
|
|
1226
1240
|
innerHeight: distance16.optional().describe("DEPRECATED use holeHeight"),
|
|
1227
1241
|
portHints: portHints.optional(),
|
|
1228
1242
|
solderMaskMargin: distance16.optional(),
|
|
1229
|
-
coveredWithSolderMask:
|
|
1243
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1230
1244
|
}),
|
|
1231
1245
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1232
|
-
name:
|
|
1233
|
-
connectsTo:
|
|
1234
|
-
shape:
|
|
1235
|
-
rectPad:
|
|
1246
|
+
name: z47.string().optional(),
|
|
1247
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1248
|
+
shape: z47.literal("pill"),
|
|
1249
|
+
rectPad: z47.boolean().optional(),
|
|
1236
1250
|
outerWidth: distance16,
|
|
1237
1251
|
outerHeight: distance16,
|
|
1238
1252
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -1243,30 +1257,30 @@ var platedHoleProps = z46.discriminatedUnion("shape", [
|
|
|
1243
1257
|
holeOffsetX: distance16.optional(),
|
|
1244
1258
|
holeOffsetY: distance16.optional(),
|
|
1245
1259
|
solderMaskMargin: distance16.optional(),
|
|
1246
|
-
coveredWithSolderMask:
|
|
1260
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1247
1261
|
}),
|
|
1248
1262
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1249
|
-
name:
|
|
1250
|
-
connectsTo:
|
|
1251
|
-
shape:
|
|
1263
|
+
name: z47.string().optional(),
|
|
1264
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1265
|
+
shape: z47.literal("circular_hole_with_rect_pad"),
|
|
1252
1266
|
holeDiameter: distance16,
|
|
1253
1267
|
rectPadWidth: distance16,
|
|
1254
1268
|
rectPadHeight: distance16,
|
|
1255
1269
|
rectBorderRadius: distance16.optional(),
|
|
1256
|
-
holeShape:
|
|
1257
|
-
padShape:
|
|
1270
|
+
holeShape: z47.literal("circle").optional(),
|
|
1271
|
+
padShape: z47.literal("rect").optional(),
|
|
1258
1272
|
portHints: portHints.optional(),
|
|
1259
1273
|
holeOffsetX: distance16.optional(),
|
|
1260
1274
|
holeOffsetY: distance16.optional(),
|
|
1261
1275
|
solderMaskMargin: distance16.optional(),
|
|
1262
|
-
coveredWithSolderMask:
|
|
1276
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1263
1277
|
}),
|
|
1264
1278
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1265
|
-
name:
|
|
1266
|
-
connectsTo:
|
|
1267
|
-
shape:
|
|
1268
|
-
holeShape:
|
|
1269
|
-
padShape:
|
|
1279
|
+
name: z47.string().optional(),
|
|
1280
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1281
|
+
shape: z47.literal("pill_hole_with_rect_pad"),
|
|
1282
|
+
holeShape: z47.literal("pill").optional(),
|
|
1283
|
+
padShape: z47.literal("rect").optional(),
|
|
1270
1284
|
holeWidth: distance16,
|
|
1271
1285
|
holeHeight: distance16,
|
|
1272
1286
|
rectPadWidth: distance16,
|
|
@@ -1275,24 +1289,24 @@ var platedHoleProps = z46.discriminatedUnion("shape", [
|
|
|
1275
1289
|
holeOffsetX: distance16.optional(),
|
|
1276
1290
|
holeOffsetY: distance16.optional(),
|
|
1277
1291
|
solderMaskMargin: distance16.optional(),
|
|
1278
|
-
coveredWithSolderMask:
|
|
1292
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1279
1293
|
}),
|
|
1280
1294
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1281
|
-
name:
|
|
1282
|
-
connectsTo:
|
|
1283
|
-
shape:
|
|
1284
|
-
holeShape:
|
|
1295
|
+
name: z47.string().optional(),
|
|
1296
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1297
|
+
shape: z47.literal("hole_with_polygon_pad"),
|
|
1298
|
+
holeShape: z47.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
1285
1299
|
holeDiameter: distance16.optional(),
|
|
1286
1300
|
holeWidth: distance16.optional(),
|
|
1287
1301
|
holeHeight: distance16.optional(),
|
|
1288
|
-
padOutline:
|
|
1302
|
+
padOutline: z47.array(point),
|
|
1289
1303
|
holeOffsetX: distance16,
|
|
1290
1304
|
holeOffsetY: distance16,
|
|
1291
1305
|
portHints: portHints.optional(),
|
|
1292
1306
|
solderMaskMargin: distance16.optional(),
|
|
1293
|
-
coveredWithSolderMask:
|
|
1307
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1294
1308
|
})
|
|
1295
|
-
]).
|
|
1309
|
+
]).transform((a) => {
|
|
1296
1310
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
1297
1311
|
a.holeWidth ??= a.innerWidth;
|
|
1298
1312
|
}
|
|
@@ -1301,15 +1315,19 @@ var platedHoleProps = z46.discriminatedUnion("shape", [
|
|
|
1301
1315
|
}
|
|
1302
1316
|
return a;
|
|
1303
1317
|
});
|
|
1318
|
+
var platedHoleProps = z47.preprocess(
|
|
1319
|
+
inferPlatedHoleShapeAndDefaults,
|
|
1320
|
+
platedHolePropsByShape
|
|
1321
|
+
);
|
|
1304
1322
|
expectTypesMatch(true);
|
|
1305
1323
|
|
|
1306
1324
|
// lib/components/resistor.ts
|
|
1307
1325
|
import { resistance } from "circuit-json";
|
|
1308
|
-
import { z as
|
|
1326
|
+
import { z as z48 } from "zod";
|
|
1309
1327
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
1310
1328
|
var resistorProps = commonComponentProps.extend({
|
|
1311
1329
|
resistance,
|
|
1312
|
-
tolerance:
|
|
1330
|
+
tolerance: z48.union([z48.string(), z48.number()]).transform((val) => {
|
|
1313
1331
|
if (typeof val === "string") {
|
|
1314
1332
|
if (val.endsWith("%")) {
|
|
1315
1333
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -1318,12 +1336,12 @@ var resistorProps = commonComponentProps.extend({
|
|
|
1318
1336
|
}
|
|
1319
1337
|
return val;
|
|
1320
1338
|
}).pipe(
|
|
1321
|
-
|
|
1339
|
+
z48.number().min(0, "Tolerance must be non-negative").max(1, "Tolerance cannot be greater than 100%")
|
|
1322
1340
|
).optional(),
|
|
1323
|
-
pullupFor:
|
|
1324
|
-
pullupTo:
|
|
1325
|
-
pulldownFor:
|
|
1326
|
-
pulldownTo:
|
|
1341
|
+
pullupFor: z48.string().optional(),
|
|
1342
|
+
pullupTo: z48.string().optional(),
|
|
1343
|
+
pulldownFor: z48.string().optional(),
|
|
1344
|
+
pulldownTo: z48.string().optional(),
|
|
1327
1345
|
schOrientation: schematicOrientation.optional(),
|
|
1328
1346
|
schSize: schematicSymbolSize.optional(),
|
|
1329
1347
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
@@ -1333,25 +1351,25 @@ expectTypesMatch(true);
|
|
|
1333
1351
|
|
|
1334
1352
|
// lib/components/potentiometer.ts
|
|
1335
1353
|
import { resistance as resistance2 } from "circuit-json";
|
|
1336
|
-
import { z as
|
|
1354
|
+
import { z as z49 } from "zod";
|
|
1337
1355
|
var potentiometerPinLabels = ["pin1", "pin2", "pin3"];
|
|
1338
1356
|
var potentiometerProps = commonComponentProps.extend({
|
|
1339
1357
|
maxResistance: resistance2,
|
|
1340
|
-
pinVariant:
|
|
1358
|
+
pinVariant: z49.enum(["two_pin", "three_pin"]).optional(),
|
|
1341
1359
|
connections: createConnectionsProp(potentiometerPinLabels).optional()
|
|
1342
1360
|
});
|
|
1343
1361
|
expectTypesMatch(true);
|
|
1344
1362
|
|
|
1345
1363
|
// lib/components/crystal.ts
|
|
1346
1364
|
import { frequency, capacitance } from "circuit-json";
|
|
1347
|
-
import { z as
|
|
1365
|
+
import { z as z50 } from "zod";
|
|
1348
1366
|
var crystalPins = lrPins;
|
|
1349
1367
|
var crystalProps = commonComponentProps.extend({
|
|
1350
1368
|
frequency,
|
|
1351
1369
|
loadCapacitance: capacitance,
|
|
1352
|
-
manufacturerPartNumber:
|
|
1353
|
-
mpn:
|
|
1354
|
-
pinVariant:
|
|
1370
|
+
manufacturerPartNumber: z50.string().optional(),
|
|
1371
|
+
mpn: z50.string().optional(),
|
|
1372
|
+
pinVariant: z50.enum(["two_pin", "four_pin"]).optional(),
|
|
1355
1373
|
schOrientation: schematicOrientation.optional(),
|
|
1356
1374
|
connections: createConnectionsProp(crystalPins).optional()
|
|
1357
1375
|
});
|
|
@@ -1359,34 +1377,34 @@ expectTypesMatch(true);
|
|
|
1359
1377
|
|
|
1360
1378
|
// lib/components/resonator.ts
|
|
1361
1379
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
1362
|
-
import { z as
|
|
1380
|
+
import { z as z51 } from "zod";
|
|
1363
1381
|
var resonatorProps = commonComponentProps.extend({
|
|
1364
1382
|
frequency: frequency2,
|
|
1365
1383
|
loadCapacitance: capacitance2,
|
|
1366
|
-
pinVariant:
|
|
1384
|
+
pinVariant: z51.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
1367
1385
|
});
|
|
1368
1386
|
expectTypesMatch(true);
|
|
1369
1387
|
|
|
1370
1388
|
// lib/components/stampboard.ts
|
|
1371
1389
|
import { distance as distance17 } from "circuit-json";
|
|
1372
|
-
import { z as
|
|
1390
|
+
import { z as z52 } from "zod";
|
|
1373
1391
|
var stampboardProps = boardProps.extend({
|
|
1374
|
-
leftPinCount:
|
|
1375
|
-
rightPinCount:
|
|
1376
|
-
topPinCount:
|
|
1377
|
-
bottomPinCount:
|
|
1378
|
-
leftPins:
|
|
1379
|
-
rightPins:
|
|
1380
|
-
topPins:
|
|
1381
|
-
bottomPins:
|
|
1392
|
+
leftPinCount: z52.number().optional(),
|
|
1393
|
+
rightPinCount: z52.number().optional(),
|
|
1394
|
+
topPinCount: z52.number().optional(),
|
|
1395
|
+
bottomPinCount: z52.number().optional(),
|
|
1396
|
+
leftPins: z52.array(z52.string()).optional(),
|
|
1397
|
+
rightPins: z52.array(z52.string()).optional(),
|
|
1398
|
+
topPins: z52.array(z52.string()).optional(),
|
|
1399
|
+
bottomPins: z52.array(z52.string()).optional(),
|
|
1382
1400
|
pinPitch: distance17.optional(),
|
|
1383
|
-
innerHoles:
|
|
1401
|
+
innerHoles: z52.boolean().optional()
|
|
1384
1402
|
});
|
|
1385
1403
|
expectTypesMatch(true);
|
|
1386
1404
|
|
|
1387
1405
|
// lib/components/capacitor.ts
|
|
1388
1406
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
1389
|
-
import { z as
|
|
1407
|
+
import { z as z53 } from "zod";
|
|
1390
1408
|
var capacitorPinLabels = [
|
|
1391
1409
|
"pin1",
|
|
1392
1410
|
"pin2",
|
|
@@ -1398,13 +1416,13 @@ var capacitorPinLabels = [
|
|
|
1398
1416
|
var capacitorProps = commonComponentProps.extend({
|
|
1399
1417
|
capacitance: capacitance3,
|
|
1400
1418
|
maxVoltageRating: voltage.optional(),
|
|
1401
|
-
schShowRatings:
|
|
1402
|
-
polarized:
|
|
1403
|
-
decouplingFor:
|
|
1404
|
-
decouplingTo:
|
|
1405
|
-
bypassFor:
|
|
1406
|
-
bypassTo:
|
|
1407
|
-
maxDecouplingTraceLength:
|
|
1419
|
+
schShowRatings: z53.boolean().optional().default(false),
|
|
1420
|
+
polarized: z53.boolean().optional().default(false),
|
|
1421
|
+
decouplingFor: z53.string().optional(),
|
|
1422
|
+
decouplingTo: z53.string().optional(),
|
|
1423
|
+
bypassFor: z53.string().optional(),
|
|
1424
|
+
bypassTo: z53.string().optional(),
|
|
1425
|
+
maxDecouplingTraceLength: z53.number().optional(),
|
|
1408
1426
|
schOrientation: schematicOrientation.optional(),
|
|
1409
1427
|
schSize: schematicSymbolSize.optional(),
|
|
1410
1428
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
@@ -1413,13 +1431,13 @@ var capacitorPins = lrPolarPins;
|
|
|
1413
1431
|
expectTypesMatch(true);
|
|
1414
1432
|
|
|
1415
1433
|
// lib/components/net.ts
|
|
1416
|
-
import { z as
|
|
1417
|
-
var netProps =
|
|
1418
|
-
name:
|
|
1419
|
-
connectsTo:
|
|
1420
|
-
highlightColor:
|
|
1421
|
-
isPowerNet:
|
|
1422
|
-
isGroundNet:
|
|
1434
|
+
import { z as z54 } from "zod";
|
|
1435
|
+
var netProps = z54.object({
|
|
1436
|
+
name: z54.string(),
|
|
1437
|
+
connectsTo: z54.string().or(z54.array(z54.string())).optional(),
|
|
1438
|
+
highlightColor: z54.string().optional(),
|
|
1439
|
+
isPowerNet: z54.boolean().optional(),
|
|
1440
|
+
isGroundNet: z54.boolean().optional()
|
|
1423
1441
|
});
|
|
1424
1442
|
expectTypesMatch(true);
|
|
1425
1443
|
|
|
@@ -1432,55 +1450,55 @@ var fiducialProps = commonComponentProps.extend({
|
|
|
1432
1450
|
expectTypesMatch(true);
|
|
1433
1451
|
|
|
1434
1452
|
// lib/components/constrainedlayout.ts
|
|
1435
|
-
import { z as
|
|
1436
|
-
var constrainedLayoutProps =
|
|
1437
|
-
name:
|
|
1438
|
-
pcbOnly:
|
|
1439
|
-
schOnly:
|
|
1453
|
+
import { z as z56 } from "zod";
|
|
1454
|
+
var constrainedLayoutProps = z56.object({
|
|
1455
|
+
name: z56.string().optional(),
|
|
1456
|
+
pcbOnly: z56.boolean().optional(),
|
|
1457
|
+
schOnly: z56.boolean().optional()
|
|
1440
1458
|
});
|
|
1441
1459
|
expectTypesMatch(true);
|
|
1442
1460
|
|
|
1443
1461
|
// lib/components/constraint.ts
|
|
1444
|
-
import { z as
|
|
1445
|
-
var pcbXDistConstraintProps =
|
|
1446
|
-
pcb:
|
|
1462
|
+
import { z as z57 } from "zod";
|
|
1463
|
+
var pcbXDistConstraintProps = z57.object({
|
|
1464
|
+
pcb: z57.literal(true).optional(),
|
|
1447
1465
|
xDist: distance,
|
|
1448
|
-
left:
|
|
1449
|
-
right:
|
|
1450
|
-
edgeToEdge:
|
|
1451
|
-
centerToCenter:
|
|
1466
|
+
left: z57.string(),
|
|
1467
|
+
right: z57.string(),
|
|
1468
|
+
edgeToEdge: z57.literal(true).optional(),
|
|
1469
|
+
centerToCenter: z57.literal(true).optional()
|
|
1452
1470
|
});
|
|
1453
1471
|
expectTypesMatch(
|
|
1454
1472
|
true
|
|
1455
1473
|
);
|
|
1456
|
-
var pcbYDistConstraintProps =
|
|
1457
|
-
pcb:
|
|
1474
|
+
var pcbYDistConstraintProps = z57.object({
|
|
1475
|
+
pcb: z57.literal(true).optional(),
|
|
1458
1476
|
yDist: distance,
|
|
1459
|
-
top:
|
|
1460
|
-
bottom:
|
|
1461
|
-
edgeToEdge:
|
|
1462
|
-
centerToCenter:
|
|
1477
|
+
top: z57.string(),
|
|
1478
|
+
bottom: z57.string(),
|
|
1479
|
+
edgeToEdge: z57.literal(true).optional(),
|
|
1480
|
+
centerToCenter: z57.literal(true).optional()
|
|
1463
1481
|
});
|
|
1464
1482
|
expectTypesMatch(
|
|
1465
1483
|
true
|
|
1466
1484
|
);
|
|
1467
|
-
var pcbSameYConstraintProps =
|
|
1468
|
-
pcb:
|
|
1469
|
-
sameY:
|
|
1470
|
-
for:
|
|
1485
|
+
var pcbSameYConstraintProps = z57.object({
|
|
1486
|
+
pcb: z57.literal(true).optional(),
|
|
1487
|
+
sameY: z57.literal(true).optional(),
|
|
1488
|
+
for: z57.array(z57.string())
|
|
1471
1489
|
});
|
|
1472
1490
|
expectTypesMatch(
|
|
1473
1491
|
true
|
|
1474
1492
|
);
|
|
1475
|
-
var pcbSameXConstraintProps =
|
|
1476
|
-
pcb:
|
|
1477
|
-
sameX:
|
|
1478
|
-
for:
|
|
1493
|
+
var pcbSameXConstraintProps = z57.object({
|
|
1494
|
+
pcb: z57.literal(true).optional(),
|
|
1495
|
+
sameX: z57.literal(true).optional(),
|
|
1496
|
+
for: z57.array(z57.string())
|
|
1479
1497
|
});
|
|
1480
1498
|
expectTypesMatch(
|
|
1481
1499
|
true
|
|
1482
1500
|
);
|
|
1483
|
-
var constraintProps =
|
|
1501
|
+
var constraintProps = z57.union([
|
|
1484
1502
|
pcbXDistConstraintProps,
|
|
1485
1503
|
pcbYDistConstraintProps,
|
|
1486
1504
|
pcbSameYConstraintProps,
|
|
@@ -1489,13 +1507,13 @@ var constraintProps = z56.union([
|
|
|
1489
1507
|
expectTypesMatch(true);
|
|
1490
1508
|
|
|
1491
1509
|
// lib/components/cutout.ts
|
|
1492
|
-
import { z as
|
|
1510
|
+
import { z as z58 } from "zod";
|
|
1493
1511
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
1494
1512
|
layer: true,
|
|
1495
1513
|
pcbRotation: true
|
|
1496
1514
|
}).extend({
|
|
1497
|
-
name:
|
|
1498
|
-
shape:
|
|
1515
|
+
name: z58.string().optional(),
|
|
1516
|
+
shape: z58.literal("rect"),
|
|
1499
1517
|
width: distance,
|
|
1500
1518
|
height: distance
|
|
1501
1519
|
});
|
|
@@ -1504,8 +1522,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
1504
1522
|
layer: true,
|
|
1505
1523
|
pcbRotation: true
|
|
1506
1524
|
}).extend({
|
|
1507
|
-
name:
|
|
1508
|
-
shape:
|
|
1525
|
+
name: z58.string().optional(),
|
|
1526
|
+
shape: z58.literal("circle"),
|
|
1509
1527
|
radius: distance
|
|
1510
1528
|
});
|
|
1511
1529
|
expectTypesMatch(true);
|
|
@@ -1513,28 +1531,28 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
1513
1531
|
layer: true,
|
|
1514
1532
|
pcbRotation: true
|
|
1515
1533
|
}).extend({
|
|
1516
|
-
name:
|
|
1517
|
-
shape:
|
|
1518
|
-
points:
|
|
1534
|
+
name: z58.string().optional(),
|
|
1535
|
+
shape: z58.literal("polygon"),
|
|
1536
|
+
points: z58.array(point)
|
|
1519
1537
|
});
|
|
1520
1538
|
expectTypesMatch(true);
|
|
1521
|
-
var cutoutProps =
|
|
1539
|
+
var cutoutProps = z58.discriminatedUnion("shape", [
|
|
1522
1540
|
rectCutoutProps,
|
|
1523
1541
|
circleCutoutProps,
|
|
1524
1542
|
polygonCutoutProps
|
|
1525
1543
|
]);
|
|
1526
1544
|
|
|
1527
1545
|
// lib/components/smtpad.ts
|
|
1528
|
-
import { z as
|
|
1546
|
+
import { z as z59 } from "zod";
|
|
1529
1547
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1530
|
-
name:
|
|
1531
|
-
shape:
|
|
1548
|
+
name: z59.string().optional(),
|
|
1549
|
+
shape: z59.literal("rect"),
|
|
1532
1550
|
width: distance,
|
|
1533
1551
|
height: distance,
|
|
1534
1552
|
rectBorderRadius: distance.optional(),
|
|
1535
1553
|
cornerRadius: distance.optional(),
|
|
1536
1554
|
portHints: portHints.optional(),
|
|
1537
|
-
coveredWithSolderMask:
|
|
1555
|
+
coveredWithSolderMask: z59.boolean().optional(),
|
|
1538
1556
|
solderMaskMargin: distance.optional(),
|
|
1539
1557
|
solderMaskMarginLeft: distance.optional(),
|
|
1540
1558
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -1543,14 +1561,14 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1543
1561
|
});
|
|
1544
1562
|
expectTypesMatch(true);
|
|
1545
1563
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1546
|
-
name:
|
|
1547
|
-
shape:
|
|
1564
|
+
name: z59.string().optional(),
|
|
1565
|
+
shape: z59.literal("rotated_rect"),
|
|
1548
1566
|
width: distance,
|
|
1549
1567
|
height: distance,
|
|
1550
|
-
ccwRotation:
|
|
1568
|
+
ccwRotation: z59.number(),
|
|
1551
1569
|
cornerRadius: distance.optional(),
|
|
1552
1570
|
portHints: portHints.optional(),
|
|
1553
|
-
coveredWithSolderMask:
|
|
1571
|
+
coveredWithSolderMask: z59.boolean().optional(),
|
|
1554
1572
|
solderMaskMargin: distance.optional(),
|
|
1555
1573
|
solderMaskMarginLeft: distance.optional(),
|
|
1556
1574
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -1559,35 +1577,35 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1559
1577
|
});
|
|
1560
1578
|
expectTypesMatch(true);
|
|
1561
1579
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1562
|
-
name:
|
|
1563
|
-
shape:
|
|
1580
|
+
name: z59.string().optional(),
|
|
1581
|
+
shape: z59.literal("circle"),
|
|
1564
1582
|
radius: distance,
|
|
1565
1583
|
portHints: portHints.optional(),
|
|
1566
|
-
coveredWithSolderMask:
|
|
1584
|
+
coveredWithSolderMask: z59.boolean().optional(),
|
|
1567
1585
|
solderMaskMargin: distance.optional()
|
|
1568
1586
|
});
|
|
1569
1587
|
expectTypesMatch(true);
|
|
1570
1588
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1571
|
-
name:
|
|
1572
|
-
shape:
|
|
1589
|
+
name: z59.string().optional(),
|
|
1590
|
+
shape: z59.literal("pill"),
|
|
1573
1591
|
width: distance,
|
|
1574
1592
|
height: distance,
|
|
1575
1593
|
radius: distance,
|
|
1576
1594
|
portHints: portHints.optional(),
|
|
1577
|
-
coveredWithSolderMask:
|
|
1595
|
+
coveredWithSolderMask: z59.boolean().optional(),
|
|
1578
1596
|
solderMaskMargin: distance.optional()
|
|
1579
1597
|
});
|
|
1580
1598
|
expectTypesMatch(true);
|
|
1581
1599
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1582
|
-
name:
|
|
1583
|
-
shape:
|
|
1584
|
-
points:
|
|
1600
|
+
name: z59.string().optional(),
|
|
1601
|
+
shape: z59.literal("polygon"),
|
|
1602
|
+
points: z59.array(point),
|
|
1585
1603
|
portHints: portHints.optional(),
|
|
1586
|
-
coveredWithSolderMask:
|
|
1604
|
+
coveredWithSolderMask: z59.boolean().optional(),
|
|
1587
1605
|
solderMaskMargin: distance.optional()
|
|
1588
1606
|
});
|
|
1589
1607
|
expectTypesMatch(true);
|
|
1590
|
-
var smtPadProps =
|
|
1608
|
+
var smtPadProps = z59.discriminatedUnion("shape", [
|
|
1591
1609
|
circleSmtPadProps,
|
|
1592
1610
|
rectSmtPadProps,
|
|
1593
1611
|
rotatedRectSmtPadProps,
|
|
@@ -1597,55 +1615,55 @@ var smtPadProps = z58.discriminatedUnion("shape", [
|
|
|
1597
1615
|
expectTypesMatch(true);
|
|
1598
1616
|
|
|
1599
1617
|
// lib/components/solderpaste.ts
|
|
1600
|
-
import { z as
|
|
1618
|
+
import { z as z60 } from "zod";
|
|
1601
1619
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1602
|
-
shape:
|
|
1620
|
+
shape: z60.literal("rect"),
|
|
1603
1621
|
width: distance,
|
|
1604
1622
|
height: distance
|
|
1605
1623
|
});
|
|
1606
1624
|
expectTypesMatch(true);
|
|
1607
1625
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1608
|
-
shape:
|
|
1626
|
+
shape: z60.literal("circle"),
|
|
1609
1627
|
radius: distance
|
|
1610
1628
|
});
|
|
1611
1629
|
expectTypesMatch(true);
|
|
1612
|
-
var solderPasteProps =
|
|
1630
|
+
var solderPasteProps = z60.union([
|
|
1613
1631
|
circleSolderPasteProps,
|
|
1614
1632
|
rectSolderPasteProps
|
|
1615
1633
|
]);
|
|
1616
1634
|
expectTypesMatch(true);
|
|
1617
1635
|
|
|
1618
1636
|
// lib/components/hole.ts
|
|
1619
|
-
import { z as
|
|
1637
|
+
import { z as z61 } from "zod";
|
|
1620
1638
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
1621
|
-
name:
|
|
1622
|
-
shape:
|
|
1639
|
+
name: z61.string().optional(),
|
|
1640
|
+
shape: z61.literal("circle").optional(),
|
|
1623
1641
|
diameter: distance.optional(),
|
|
1624
1642
|
radius: distance.optional(),
|
|
1625
1643
|
solderMaskMargin: distance.optional(),
|
|
1626
|
-
coveredWithSolderMask:
|
|
1644
|
+
coveredWithSolderMask: z61.boolean().optional()
|
|
1627
1645
|
}).transform((d) => ({
|
|
1628
1646
|
...d,
|
|
1629
1647
|
diameter: d.diameter ?? 2 * d.radius,
|
|
1630
1648
|
radius: d.radius ?? d.diameter / 2
|
|
1631
1649
|
}));
|
|
1632
1650
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
1633
|
-
name:
|
|
1634
|
-
shape:
|
|
1651
|
+
name: z61.string().optional(),
|
|
1652
|
+
shape: z61.literal("pill"),
|
|
1635
1653
|
width: distance,
|
|
1636
1654
|
height: distance,
|
|
1637
1655
|
solderMaskMargin: distance.optional(),
|
|
1638
|
-
coveredWithSolderMask:
|
|
1656
|
+
coveredWithSolderMask: z61.boolean().optional()
|
|
1639
1657
|
});
|
|
1640
1658
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
1641
|
-
name:
|
|
1642
|
-
shape:
|
|
1659
|
+
name: z61.string().optional(),
|
|
1660
|
+
shape: z61.literal("rect"),
|
|
1643
1661
|
width: distance,
|
|
1644
1662
|
height: distance,
|
|
1645
1663
|
solderMaskMargin: distance.optional(),
|
|
1646
|
-
coveredWithSolderMask:
|
|
1664
|
+
coveredWithSolderMask: z61.boolean().optional()
|
|
1647
1665
|
});
|
|
1648
|
-
var holeProps =
|
|
1666
|
+
var holeProps = z61.union([
|
|
1649
1667
|
circleHoleProps,
|
|
1650
1668
|
pillHoleProps,
|
|
1651
1669
|
rectHoleProps
|
|
@@ -1654,54 +1672,54 @@ expectTypesMatch(true);
|
|
|
1654
1672
|
|
|
1655
1673
|
// lib/components/trace.ts
|
|
1656
1674
|
import { distance as distance18, layer_ref as layer_ref4, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
1657
|
-
import { z as
|
|
1658
|
-
var portRef =
|
|
1659
|
-
|
|
1660
|
-
|
|
1675
|
+
import { z as z62 } from "zod";
|
|
1676
|
+
var portRef = z62.union([
|
|
1677
|
+
z62.string(),
|
|
1678
|
+
z62.custom(
|
|
1661
1679
|
(v) => Boolean(v.getPortSelector)
|
|
1662
1680
|
)
|
|
1663
1681
|
]);
|
|
1664
1682
|
var pcbPathPoint = point.extend({
|
|
1665
|
-
via:
|
|
1683
|
+
via: z62.boolean().optional(),
|
|
1666
1684
|
fromLayer: layer_ref4.optional(),
|
|
1667
1685
|
toLayer: layer_ref4.optional()
|
|
1668
1686
|
}).superRefine((value, ctx) => {
|
|
1669
1687
|
if (value.via) {
|
|
1670
1688
|
if (!value.toLayer) {
|
|
1671
1689
|
ctx.addIssue({
|
|
1672
|
-
code:
|
|
1690
|
+
code: z62.ZodIssueCode.custom,
|
|
1673
1691
|
message: "toLayer is required when via is true",
|
|
1674
1692
|
path: ["toLayer"]
|
|
1675
1693
|
});
|
|
1676
1694
|
}
|
|
1677
1695
|
} else if (value.fromLayer || value.toLayer) {
|
|
1678
1696
|
ctx.addIssue({
|
|
1679
|
-
code:
|
|
1697
|
+
code: z62.ZodIssueCode.custom,
|
|
1680
1698
|
message: "fromLayer/toLayer are only allowed when via is true",
|
|
1681
1699
|
path: ["via"]
|
|
1682
1700
|
});
|
|
1683
1701
|
}
|
|
1684
1702
|
});
|
|
1685
|
-
var pcbPath =
|
|
1686
|
-
var baseTraceProps =
|
|
1687
|
-
key:
|
|
1703
|
+
var pcbPath = z62.array(z62.union([pcbPathPoint, z62.string()]));
|
|
1704
|
+
var baseTraceProps = z62.object({
|
|
1705
|
+
key: z62.string().optional(),
|
|
1688
1706
|
thickness: distance18.optional(),
|
|
1689
1707
|
width: distance18.optional().describe("Alias for trace thickness"),
|
|
1690
|
-
schematicRouteHints:
|
|
1691
|
-
pcbRouteHints:
|
|
1692
|
-
pcbPathRelativeTo:
|
|
1708
|
+
schematicRouteHints: z62.array(point).optional(),
|
|
1709
|
+
pcbRouteHints: z62.array(route_hint_point2).optional(),
|
|
1710
|
+
pcbPathRelativeTo: z62.string().optional(),
|
|
1693
1711
|
pcbPath: pcbPath.optional(),
|
|
1694
|
-
pcbPaths:
|
|
1695
|
-
pcbStraightLine:
|
|
1696
|
-
schDisplayLabel:
|
|
1697
|
-
schStroke:
|
|
1698
|
-
highlightColor:
|
|
1712
|
+
pcbPaths: z62.array(pcbPath).optional(),
|
|
1713
|
+
pcbStraightLine: z62.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
1714
|
+
schDisplayLabel: z62.string().optional(),
|
|
1715
|
+
schStroke: z62.string().optional(),
|
|
1716
|
+
highlightColor: z62.string().optional(),
|
|
1699
1717
|
maxLength: distance18.optional(),
|
|
1700
|
-
connectsTo:
|
|
1718
|
+
connectsTo: z62.string().or(z62.array(z62.string())).optional()
|
|
1701
1719
|
});
|
|
1702
|
-
var traceProps =
|
|
1720
|
+
var traceProps = z62.union([
|
|
1703
1721
|
baseTraceProps.extend({
|
|
1704
|
-
path:
|
|
1722
|
+
path: z62.array(portRef)
|
|
1705
1723
|
}),
|
|
1706
1724
|
baseTraceProps.extend({
|
|
1707
1725
|
from: portRef,
|
|
@@ -1711,29 +1729,29 @@ var traceProps = z61.union([
|
|
|
1711
1729
|
|
|
1712
1730
|
// lib/components/footprint.ts
|
|
1713
1731
|
import { layer_ref as layer_ref5 } from "circuit-json";
|
|
1714
|
-
import { z as
|
|
1715
|
-
var footprintProps =
|
|
1716
|
-
children:
|
|
1732
|
+
import { z as z63 } from "zod";
|
|
1733
|
+
var footprintProps = z63.object({
|
|
1734
|
+
children: z63.any().optional(),
|
|
1717
1735
|
originalLayer: layer_ref5.default("top").optional(),
|
|
1718
|
-
circuitJson:
|
|
1736
|
+
circuitJson: z63.array(z63.any()).optional(),
|
|
1719
1737
|
src: footprintProp.describe("Can be a footprint or kicad string").optional()
|
|
1720
1738
|
});
|
|
1721
1739
|
expectTypesMatch(true);
|
|
1722
1740
|
|
|
1723
1741
|
// lib/components/symbol.ts
|
|
1724
|
-
import { z as
|
|
1725
|
-
var symbolProps =
|
|
1726
|
-
originalFacingDirection:
|
|
1742
|
+
import { z as z64 } from "zod";
|
|
1743
|
+
var symbolProps = z64.object({
|
|
1744
|
+
originalFacingDirection: z64.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
1727
1745
|
width: distance.optional(),
|
|
1728
1746
|
height: distance.optional(),
|
|
1729
|
-
name:
|
|
1747
|
+
name: z64.string().optional()
|
|
1730
1748
|
});
|
|
1731
1749
|
expectTypesMatch(true);
|
|
1732
1750
|
|
|
1733
1751
|
// lib/components/battery.ts
|
|
1734
1752
|
import { voltage as voltage2 } from "circuit-json";
|
|
1735
|
-
import { z as
|
|
1736
|
-
var capacity =
|
|
1753
|
+
import { z as z65 } from "zod";
|
|
1754
|
+
var capacity = z65.number().or(z65.string().endsWith("mAh")).transform((v) => {
|
|
1737
1755
|
if (typeof v === "string") {
|
|
1738
1756
|
const valString = v.replace("mAh", "");
|
|
1739
1757
|
const num = Number.parseFloat(valString);
|
|
@@ -1747,14 +1765,14 @@ var capacity = z64.number().or(z64.string().endsWith("mAh")).transform((v) => {
|
|
|
1747
1765
|
var batteryProps = commonComponentProps.extend({
|
|
1748
1766
|
capacity: capacity.optional(),
|
|
1749
1767
|
voltage: voltage2.optional(),
|
|
1750
|
-
standard:
|
|
1768
|
+
standard: z65.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
1751
1769
|
schOrientation: schematicOrientation.optional()
|
|
1752
1770
|
});
|
|
1753
1771
|
var batteryPins = lrPolarPins;
|
|
1754
1772
|
expectTypesMatch(true);
|
|
1755
1773
|
|
|
1756
1774
|
// lib/components/mountedboard.ts
|
|
1757
|
-
import { z as
|
|
1775
|
+
import { z as z66 } from "zod";
|
|
1758
1776
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
1759
1777
|
manufacturerPartNumber: chipProps.shape.manufacturerPartNumber,
|
|
1760
1778
|
pinLabels: chipProps.shape.pinLabels,
|
|
@@ -1766,7 +1784,7 @@ var mountedboardProps = subcircuitGroupProps.extend({
|
|
|
1766
1784
|
internallyConnectedPins: chipProps.shape.internallyConnectedPins,
|
|
1767
1785
|
externallyConnectedPins: chipProps.shape.externallyConnectedPins,
|
|
1768
1786
|
boardToBoardDistance: distance.optional(),
|
|
1769
|
-
mountOrientation:
|
|
1787
|
+
mountOrientation: z66.enum(["faceDown", "faceUp"]).optional()
|
|
1770
1788
|
});
|
|
1771
1789
|
expectTypesMatch(true);
|
|
1772
1790
|
|
|
@@ -1774,29 +1792,29 @@ expectTypesMatch(true);
|
|
|
1774
1792
|
import { distance as distance19 } from "circuit-json";
|
|
1775
1793
|
|
|
1776
1794
|
// lib/common/pcbOrientation.ts
|
|
1777
|
-
import { z as
|
|
1778
|
-
var pcbOrientation =
|
|
1795
|
+
import { z as z67 } from "zod";
|
|
1796
|
+
var pcbOrientation = z67.enum(["vertical", "horizontal"]).describe(
|
|
1779
1797
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
1780
1798
|
);
|
|
1781
1799
|
expectTypesMatch(true);
|
|
1782
1800
|
|
|
1783
1801
|
// lib/components/pin-header.ts
|
|
1784
|
-
import { z as
|
|
1802
|
+
import { z as z68 } from "zod";
|
|
1785
1803
|
var pinHeaderProps = commonComponentProps.extend({
|
|
1786
|
-
pinCount:
|
|
1804
|
+
pinCount: z68.number(),
|
|
1787
1805
|
pitch: distance19.optional(),
|
|
1788
|
-
schFacingDirection:
|
|
1789
|
-
gender:
|
|
1790
|
-
showSilkscreenPinLabels:
|
|
1791
|
-
pcbPinLabels:
|
|
1792
|
-
doubleRow:
|
|
1793
|
-
rightAngle:
|
|
1806
|
+
schFacingDirection: z68.enum(["up", "down", "left", "right"]).optional(),
|
|
1807
|
+
gender: z68.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
1808
|
+
showSilkscreenPinLabels: z68.boolean().optional(),
|
|
1809
|
+
pcbPinLabels: z68.record(z68.string(), z68.string()).optional(),
|
|
1810
|
+
doubleRow: z68.boolean().optional(),
|
|
1811
|
+
rightAngle: z68.boolean().optional(),
|
|
1794
1812
|
pcbOrientation: pcbOrientation.optional(),
|
|
1795
1813
|
holeDiameter: distance19.optional(),
|
|
1796
1814
|
platedDiameter: distance19.optional(),
|
|
1797
|
-
pinLabels:
|
|
1798
|
-
connections:
|
|
1799
|
-
facingDirection:
|
|
1815
|
+
pinLabels: z68.record(z68.string(), schematicPinLabel).or(z68.array(schematicPinLabel)).optional(),
|
|
1816
|
+
connections: z68.custom().pipe(z68.record(z68.string(), connectionTarget)).optional(),
|
|
1817
|
+
facingDirection: z68.enum(["left", "right"]).optional(),
|
|
1800
1818
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
1801
1819
|
schPinStyle: schematicPinStyle.optional(),
|
|
1802
1820
|
schPinSpacing: distance19.optional(),
|
|
@@ -1806,29 +1824,29 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
1806
1824
|
expectTypesMatch(true);
|
|
1807
1825
|
|
|
1808
1826
|
// lib/components/netalias.ts
|
|
1809
|
-
import { z as
|
|
1827
|
+
import { z as z69 } from "zod";
|
|
1810
1828
|
import { rotation as rotation3 } from "circuit-json";
|
|
1811
|
-
var netAliasProps =
|
|
1812
|
-
net:
|
|
1813
|
-
connection:
|
|
1829
|
+
var netAliasProps = z69.object({
|
|
1830
|
+
net: z69.string().optional(),
|
|
1831
|
+
connection: z69.string().optional(),
|
|
1814
1832
|
schX: distance.optional(),
|
|
1815
1833
|
schY: distance.optional(),
|
|
1816
1834
|
schRotation: rotation3.optional(),
|
|
1817
|
-
anchorSide:
|
|
1835
|
+
anchorSide: z69.enum(["left", "top", "right", "bottom"]).optional()
|
|
1818
1836
|
});
|
|
1819
1837
|
expectTypesMatch(true);
|
|
1820
1838
|
|
|
1821
1839
|
// lib/components/netlabel.ts
|
|
1822
|
-
import { z as
|
|
1840
|
+
import { z as z70 } from "zod";
|
|
1823
1841
|
import { rotation as rotation4 } from "circuit-json";
|
|
1824
|
-
var netLabelProps =
|
|
1825
|
-
net:
|
|
1826
|
-
connection:
|
|
1827
|
-
connectsTo:
|
|
1842
|
+
var netLabelProps = z70.object({
|
|
1843
|
+
net: z70.string().optional(),
|
|
1844
|
+
connection: z70.string().optional(),
|
|
1845
|
+
connectsTo: z70.string().or(z70.array(z70.string())).optional(),
|
|
1828
1846
|
schX: distance.optional(),
|
|
1829
1847
|
schY: distance.optional(),
|
|
1830
1848
|
schRotation: rotation4.optional(),
|
|
1831
|
-
anchorSide:
|
|
1849
|
+
anchorSide: z70.enum(["left", "top", "right", "bottom"]).optional()
|
|
1832
1850
|
});
|
|
1833
1851
|
expectTypesMatch(true);
|
|
1834
1852
|
|
|
@@ -1843,12 +1861,12 @@ expectTypesMatch(true);
|
|
|
1843
1861
|
|
|
1844
1862
|
// lib/components/analogsimulation.ts
|
|
1845
1863
|
import { ms } from "circuit-json";
|
|
1846
|
-
import { z as
|
|
1847
|
-
var spiceEngine =
|
|
1864
|
+
import { z as z72 } from "zod";
|
|
1865
|
+
var spiceEngine = z72.custom(
|
|
1848
1866
|
(value) => typeof value === "string"
|
|
1849
1867
|
);
|
|
1850
|
-
var analogSimulationProps =
|
|
1851
|
-
simulationType:
|
|
1868
|
+
var analogSimulationProps = z72.object({
|
|
1869
|
+
simulationType: z72.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
1852
1870
|
duration: ms.optional(),
|
|
1853
1871
|
timePerStep: ms.optional(),
|
|
1854
1872
|
spiceEngine: spiceEngine.optional()
|
|
@@ -1858,7 +1876,7 @@ expectTypesMatch(
|
|
|
1858
1876
|
);
|
|
1859
1877
|
|
|
1860
1878
|
// lib/components/transistor.ts
|
|
1861
|
-
import { z as
|
|
1879
|
+
import { z as z73 } from "zod";
|
|
1862
1880
|
var transistorPinsLabels = [
|
|
1863
1881
|
"pin1",
|
|
1864
1882
|
"pin2",
|
|
@@ -1871,7 +1889,7 @@ var transistorPinsLabels = [
|
|
|
1871
1889
|
"drain"
|
|
1872
1890
|
];
|
|
1873
1891
|
var transistorProps = commonComponentProps.extend({
|
|
1874
|
-
type:
|
|
1892
|
+
type: z73.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
1875
1893
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
1876
1894
|
});
|
|
1877
1895
|
var transistorPins = [
|
|
@@ -1885,10 +1903,10 @@ var transistorPins = [
|
|
|
1885
1903
|
expectTypesMatch(true);
|
|
1886
1904
|
|
|
1887
1905
|
// lib/components/mosfet.ts
|
|
1888
|
-
import { z as
|
|
1906
|
+
import { z as z74 } from "zod";
|
|
1889
1907
|
var mosfetProps = commonComponentProps.extend({
|
|
1890
|
-
channelType:
|
|
1891
|
-
mosfetMode:
|
|
1908
|
+
channelType: z74.enum(["n", "p"]),
|
|
1909
|
+
mosfetMode: z74.enum(["enhancement", "depletion"])
|
|
1892
1910
|
});
|
|
1893
1911
|
var mosfetPins = [
|
|
1894
1912
|
"pin1",
|
|
@@ -1917,19 +1935,19 @@ expectTypesMatch(true);
|
|
|
1917
1935
|
|
|
1918
1936
|
// lib/components/inductor.ts
|
|
1919
1937
|
import { inductance } from "circuit-json";
|
|
1920
|
-
import { z as
|
|
1938
|
+
import { z as z76 } from "zod";
|
|
1921
1939
|
var inductorPins = lrPins;
|
|
1922
1940
|
var inductorProps = commonComponentProps.extend({
|
|
1923
1941
|
inductance,
|
|
1924
|
-
maxCurrentRating:
|
|
1942
|
+
maxCurrentRating: z76.union([z76.string(), z76.number()]).optional(),
|
|
1925
1943
|
schOrientation: schematicOrientation.optional(),
|
|
1926
1944
|
connections: createConnectionsProp(inductorPins).optional()
|
|
1927
1945
|
});
|
|
1928
1946
|
expectTypesMatch(true);
|
|
1929
1947
|
|
|
1930
1948
|
// lib/components/diode.ts
|
|
1931
|
-
import { z as
|
|
1932
|
-
var diodeConnectionKeys =
|
|
1949
|
+
import { z as z77 } from "zod";
|
|
1950
|
+
var diodeConnectionKeys = z77.enum([
|
|
1933
1951
|
"anode",
|
|
1934
1952
|
"cathode",
|
|
1935
1953
|
"pin1",
|
|
@@ -1937,9 +1955,9 @@ var diodeConnectionKeys = z76.enum([
|
|
|
1937
1955
|
"pos",
|
|
1938
1956
|
"neg"
|
|
1939
1957
|
]);
|
|
1940
|
-
var connectionTarget3 =
|
|
1941
|
-
var connectionsProp2 =
|
|
1942
|
-
var diodeVariant =
|
|
1958
|
+
var connectionTarget3 = z77.string().or(z77.array(z77.string()).readonly()).or(z77.array(z77.string()));
|
|
1959
|
+
var connectionsProp2 = z77.record(diodeConnectionKeys, connectionTarget3);
|
|
1960
|
+
var diodeVariant = z77.enum([
|
|
1943
1961
|
"standard",
|
|
1944
1962
|
"schottky",
|
|
1945
1963
|
"zener",
|
|
@@ -1950,12 +1968,12 @@ var diodeVariant = z76.enum([
|
|
|
1950
1968
|
var diodeProps = commonComponentProps.extend({
|
|
1951
1969
|
connections: connectionsProp2.optional(),
|
|
1952
1970
|
variant: diodeVariant.optional().default("standard"),
|
|
1953
|
-
standard:
|
|
1954
|
-
schottky:
|
|
1955
|
-
zener:
|
|
1956
|
-
avalanche:
|
|
1957
|
-
photo:
|
|
1958
|
-
tvs:
|
|
1971
|
+
standard: z77.boolean().optional(),
|
|
1972
|
+
schottky: z77.boolean().optional(),
|
|
1973
|
+
zener: z77.boolean().optional(),
|
|
1974
|
+
avalanche: z77.boolean().optional(),
|
|
1975
|
+
photo: z77.boolean().optional(),
|
|
1976
|
+
tvs: z77.boolean().optional(),
|
|
1959
1977
|
schOrientation: schematicOrientation.optional()
|
|
1960
1978
|
}).superRefine((data, ctx) => {
|
|
1961
1979
|
const enabledFlags = [
|
|
@@ -1968,11 +1986,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
1968
1986
|
].filter(Boolean).length;
|
|
1969
1987
|
if (enabledFlags > 1) {
|
|
1970
1988
|
ctx.addIssue({
|
|
1971
|
-
code:
|
|
1989
|
+
code: z77.ZodIssueCode.custom,
|
|
1972
1990
|
message: "Exactly one diode variant must be enabled",
|
|
1973
1991
|
path: []
|
|
1974
1992
|
});
|
|
1975
|
-
return
|
|
1993
|
+
return z77.INVALID;
|
|
1976
1994
|
}
|
|
1977
1995
|
}).transform((data) => {
|
|
1978
1996
|
const result = {
|
|
@@ -2019,33 +2037,33 @@ var diodePins = lrPolarPins;
|
|
|
2019
2037
|
expectTypesMatch(true);
|
|
2020
2038
|
|
|
2021
2039
|
// lib/components/led.ts
|
|
2022
|
-
import { z as
|
|
2040
|
+
import { z as z78 } from "zod";
|
|
2023
2041
|
var ledProps = commonComponentProps.extend({
|
|
2024
|
-
color:
|
|
2025
|
-
wavelength:
|
|
2026
|
-
schDisplayValue:
|
|
2042
|
+
color: z78.string().optional(),
|
|
2043
|
+
wavelength: z78.string().optional(),
|
|
2044
|
+
schDisplayValue: z78.string().optional(),
|
|
2027
2045
|
schOrientation: schematicOrientation.optional(),
|
|
2028
2046
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
2029
|
-
laser:
|
|
2047
|
+
laser: z78.boolean().optional()
|
|
2030
2048
|
});
|
|
2031
2049
|
var ledPins = lrPolarPins;
|
|
2032
2050
|
|
|
2033
2051
|
// lib/components/switch.ts
|
|
2034
2052
|
import { ms as ms2, frequency as frequency3 } from "circuit-json";
|
|
2035
|
-
import { z as
|
|
2053
|
+
import { z as z79 } from "zod";
|
|
2036
2054
|
var switchProps = commonComponentProps.extend({
|
|
2037
|
-
type:
|
|
2038
|
-
isNormallyClosed:
|
|
2039
|
-
spst:
|
|
2040
|
-
spdt:
|
|
2041
|
-
dpst:
|
|
2042
|
-
dpdt:
|
|
2055
|
+
type: z79.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
2056
|
+
isNormallyClosed: z79.boolean().optional().default(false),
|
|
2057
|
+
spst: z79.boolean().optional(),
|
|
2058
|
+
spdt: z79.boolean().optional(),
|
|
2059
|
+
dpst: z79.boolean().optional(),
|
|
2060
|
+
dpdt: z79.boolean().optional(),
|
|
2043
2061
|
simSwitchFrequency: frequency3.optional(),
|
|
2044
2062
|
simCloseAt: ms2.optional(),
|
|
2045
2063
|
simOpenAt: ms2.optional(),
|
|
2046
|
-
simStartClosed:
|
|
2047
|
-
simStartOpen:
|
|
2048
|
-
connections:
|
|
2064
|
+
simStartClosed: z79.boolean().optional(),
|
|
2065
|
+
simStartOpen: z79.boolean().optional(),
|
|
2066
|
+
connections: z79.custom().pipe(z79.record(z79.string(), connectionTarget)).optional()
|
|
2049
2067
|
}).transform((props) => {
|
|
2050
2068
|
const updatedProps = { ...props };
|
|
2051
2069
|
if (updatedProps.dpdt) {
|
|
@@ -2077,33 +2095,33 @@ expectTypesMatch(true);
|
|
|
2077
2095
|
|
|
2078
2096
|
// lib/components/fabrication-note-text.ts
|
|
2079
2097
|
import { length as length4 } from "circuit-json";
|
|
2080
|
-
import { z as
|
|
2098
|
+
import { z as z80 } from "zod";
|
|
2081
2099
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
2082
|
-
text:
|
|
2083
|
-
anchorAlignment:
|
|
2084
|
-
font:
|
|
2100
|
+
text: z80.string(),
|
|
2101
|
+
anchorAlignment: z80.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2102
|
+
font: z80.enum(["tscircuit2024"]).optional(),
|
|
2085
2103
|
fontSize: length4.optional(),
|
|
2086
|
-
color:
|
|
2104
|
+
color: z80.string().optional()
|
|
2087
2105
|
});
|
|
2088
2106
|
expectTypesMatch(true);
|
|
2089
2107
|
|
|
2090
2108
|
// lib/components/fabrication-note-rect.ts
|
|
2091
2109
|
import { distance as distance20 } from "circuit-json";
|
|
2092
|
-
import { z as
|
|
2110
|
+
import { z as z81 } from "zod";
|
|
2093
2111
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2094
2112
|
width: distance20,
|
|
2095
2113
|
height: distance20,
|
|
2096
2114
|
strokeWidth: distance20.optional(),
|
|
2097
|
-
isFilled:
|
|
2098
|
-
hasStroke:
|
|
2099
|
-
isStrokeDashed:
|
|
2100
|
-
color:
|
|
2115
|
+
isFilled: z81.boolean().optional(),
|
|
2116
|
+
hasStroke: z81.boolean().optional(),
|
|
2117
|
+
isStrokeDashed: z81.boolean().optional(),
|
|
2118
|
+
color: z81.string().optional(),
|
|
2101
2119
|
cornerRadius: distance20.optional()
|
|
2102
2120
|
});
|
|
2103
2121
|
|
|
2104
2122
|
// lib/components/fabrication-note-path.ts
|
|
2105
2123
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
2106
|
-
import { z as
|
|
2124
|
+
import { z as z82 } from "zod";
|
|
2107
2125
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
2108
2126
|
pcbLeftEdgeX: true,
|
|
2109
2127
|
pcbRightEdgeX: true,
|
|
@@ -2115,15 +2133,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
2115
2133
|
pcbOffsetY: true,
|
|
2116
2134
|
pcbRotation: true
|
|
2117
2135
|
}).extend({
|
|
2118
|
-
route:
|
|
2136
|
+
route: z82.array(route_hint_point3),
|
|
2119
2137
|
strokeWidth: length5.optional(),
|
|
2120
|
-
color:
|
|
2138
|
+
color: z82.string().optional()
|
|
2121
2139
|
});
|
|
2122
2140
|
|
|
2123
2141
|
// lib/components/fabrication-note-dimension.ts
|
|
2124
2142
|
import { distance as distance21, length as length6 } from "circuit-json";
|
|
2125
|
-
import { z as
|
|
2126
|
-
var dimensionTarget =
|
|
2143
|
+
import { z as z83 } from "zod";
|
|
2144
|
+
var dimensionTarget = z83.union([z83.string(), point]);
|
|
2127
2145
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
2128
2146
|
pcbLeftEdgeX: true,
|
|
2129
2147
|
pcbRightEdgeX: true,
|
|
@@ -2137,53 +2155,53 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
2137
2155
|
}).extend({
|
|
2138
2156
|
from: dimensionTarget,
|
|
2139
2157
|
to: dimensionTarget,
|
|
2140
|
-
text:
|
|
2158
|
+
text: z83.string().optional(),
|
|
2141
2159
|
offset: distance21.optional(),
|
|
2142
|
-
font:
|
|
2160
|
+
font: z83.enum(["tscircuit2024"]).optional(),
|
|
2143
2161
|
fontSize: length6.optional(),
|
|
2144
|
-
color:
|
|
2162
|
+
color: z83.string().optional(),
|
|
2145
2163
|
arrowSize: distance21.optional(),
|
|
2146
|
-
units:
|
|
2147
|
-
outerEdgeToEdge:
|
|
2148
|
-
centerToCenter:
|
|
2149
|
-
innerEdgeToEdge:
|
|
2164
|
+
units: z83.enum(["in", "mm"]).optional(),
|
|
2165
|
+
outerEdgeToEdge: z83.literal(true).optional(),
|
|
2166
|
+
centerToCenter: z83.literal(true).optional(),
|
|
2167
|
+
innerEdgeToEdge: z83.literal(true).optional()
|
|
2150
2168
|
});
|
|
2151
2169
|
expectTypesMatch(true);
|
|
2152
2170
|
|
|
2153
2171
|
// lib/components/pcb-trace.ts
|
|
2154
2172
|
import { distance as distance22, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
2155
|
-
import { z as
|
|
2156
|
-
var pcbTraceProps =
|
|
2157
|
-
layer:
|
|
2173
|
+
import { z as z84 } from "zod";
|
|
2174
|
+
var pcbTraceProps = z84.object({
|
|
2175
|
+
layer: z84.string().optional(),
|
|
2158
2176
|
thickness: distance22.optional(),
|
|
2159
|
-
route:
|
|
2177
|
+
route: z84.array(route_hint_point4)
|
|
2160
2178
|
});
|
|
2161
2179
|
|
|
2162
2180
|
// lib/components/via.ts
|
|
2163
2181
|
import { distance as distance23, layer_ref as layer_ref6 } from "circuit-json";
|
|
2164
|
-
import { z as
|
|
2182
|
+
import { z as z85 } from "zod";
|
|
2165
2183
|
var viaProps = commonLayoutProps.extend({
|
|
2166
|
-
name:
|
|
2184
|
+
name: z85.string().optional(),
|
|
2167
2185
|
fromLayer: layer_ref6,
|
|
2168
2186
|
toLayer: layer_ref6,
|
|
2169
2187
|
holeDiameter: distance23.optional(),
|
|
2170
2188
|
outerDiameter: distance23.optional(),
|
|
2171
|
-
connectsTo:
|
|
2172
|
-
netIsAssignable:
|
|
2189
|
+
connectsTo: z85.string().or(z85.array(z85.string())).optional(),
|
|
2190
|
+
netIsAssignable: z85.boolean().optional()
|
|
2173
2191
|
});
|
|
2174
2192
|
expectTypesMatch(true);
|
|
2175
2193
|
|
|
2176
2194
|
// lib/components/testpoint.ts
|
|
2177
2195
|
import { distance as distance24 } from "circuit-json";
|
|
2178
|
-
import { z as
|
|
2196
|
+
import { z as z86 } from "zod";
|
|
2179
2197
|
var testpointPins = ["pin1"];
|
|
2180
|
-
var testpointConnectionsProp =
|
|
2198
|
+
var testpointConnectionsProp = z86.object({
|
|
2181
2199
|
pin1: connectionTarget
|
|
2182
2200
|
}).strict();
|
|
2183
2201
|
var testpointProps = commonComponentProps.extend({
|
|
2184
2202
|
connections: testpointConnectionsProp.optional(),
|
|
2185
|
-
footprintVariant:
|
|
2186
|
-
padShape:
|
|
2203
|
+
footprintVariant: z86.enum(["pad", "through_hole"]).optional(),
|
|
2204
|
+
padShape: z86.enum(["rect", "circle"]).optional().default("circle"),
|
|
2187
2205
|
padDiameter: distance24.optional(),
|
|
2188
2206
|
holeDiameter: distance24.optional(),
|
|
2189
2207
|
width: distance24.optional(),
|
|
@@ -2195,22 +2213,22 @@ var testpointProps = commonComponentProps.extend({
|
|
|
2195
2213
|
expectTypesMatch(true);
|
|
2196
2214
|
|
|
2197
2215
|
// lib/components/breakoutpoint.ts
|
|
2198
|
-
import { z as
|
|
2216
|
+
import { z as z87 } from "zod";
|
|
2199
2217
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
2200
|
-
connection:
|
|
2218
|
+
connection: z87.string()
|
|
2201
2219
|
});
|
|
2202
2220
|
expectTypesMatch(true);
|
|
2203
2221
|
|
|
2204
2222
|
// lib/components/pcb-keepout.ts
|
|
2205
2223
|
import { distance as distance25 } from "circuit-json";
|
|
2206
|
-
import { z as
|
|
2207
|
-
var pcbKeepoutProps =
|
|
2224
|
+
import { z as z88 } from "zod";
|
|
2225
|
+
var pcbKeepoutProps = z88.union([
|
|
2208
2226
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2209
|
-
shape:
|
|
2227
|
+
shape: z88.literal("circle"),
|
|
2210
2228
|
radius: distance25
|
|
2211
2229
|
}),
|
|
2212
2230
|
pcbLayoutProps.extend({
|
|
2213
|
-
shape:
|
|
2231
|
+
shape: z88.literal("rect"),
|
|
2214
2232
|
width: distance25,
|
|
2215
2233
|
height: distance25
|
|
2216
2234
|
})
|
|
@@ -2218,20 +2236,20 @@ var pcbKeepoutProps = z87.union([
|
|
|
2218
2236
|
|
|
2219
2237
|
// lib/components/courtyard-rect.ts
|
|
2220
2238
|
import { distance as distance26 } from "circuit-json";
|
|
2221
|
-
import { z as
|
|
2239
|
+
import { z as z89 } from "zod";
|
|
2222
2240
|
var courtyardRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2223
2241
|
width: distance26,
|
|
2224
2242
|
height: distance26,
|
|
2225
2243
|
strokeWidth: distance26.optional(),
|
|
2226
|
-
isFilled:
|
|
2227
|
-
hasStroke:
|
|
2228
|
-
isStrokeDashed:
|
|
2229
|
-
color:
|
|
2244
|
+
isFilled: z89.boolean().optional(),
|
|
2245
|
+
hasStroke: z89.boolean().optional(),
|
|
2246
|
+
isStrokeDashed: z89.boolean().optional(),
|
|
2247
|
+
color: z89.string().optional()
|
|
2230
2248
|
});
|
|
2231
2249
|
|
|
2232
2250
|
// lib/components/courtyard-outline.ts
|
|
2233
2251
|
import { length as length7 } from "circuit-json";
|
|
2234
|
-
import { z as
|
|
2252
|
+
import { z as z90 } from "zod";
|
|
2235
2253
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
2236
2254
|
pcbLeftEdgeX: true,
|
|
2237
2255
|
pcbRightEdgeX: true,
|
|
@@ -2243,11 +2261,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
2243
2261
|
pcbOffsetY: true,
|
|
2244
2262
|
pcbRotation: true
|
|
2245
2263
|
}).extend({
|
|
2246
|
-
outline:
|
|
2264
|
+
outline: z90.array(point),
|
|
2247
2265
|
strokeWidth: length7.optional(),
|
|
2248
|
-
isClosed:
|
|
2249
|
-
isStrokeDashed:
|
|
2250
|
-
color:
|
|
2266
|
+
isClosed: z90.boolean().optional(),
|
|
2267
|
+
isStrokeDashed: z90.boolean().optional(),
|
|
2268
|
+
color: z90.string().optional()
|
|
2251
2269
|
});
|
|
2252
2270
|
|
|
2253
2271
|
// lib/components/courtyard-circle.ts
|
|
@@ -2267,34 +2285,34 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
2267
2285
|
});
|
|
2268
2286
|
|
|
2269
2287
|
// lib/components/copper-pour.ts
|
|
2270
|
-
import { z as
|
|
2288
|
+
import { z as z93 } from "zod";
|
|
2271
2289
|
import { layer_ref as layer_ref7 } from "circuit-json";
|
|
2272
|
-
var copperPourProps =
|
|
2273
|
-
name:
|
|
2290
|
+
var copperPourProps = z93.object({
|
|
2291
|
+
name: z93.string().optional(),
|
|
2274
2292
|
layer: layer_ref7,
|
|
2275
|
-
connectsTo:
|
|
2293
|
+
connectsTo: z93.string(),
|
|
2276
2294
|
padMargin: distance.optional(),
|
|
2277
2295
|
traceMargin: distance.optional(),
|
|
2278
2296
|
clearance: distance.optional(),
|
|
2279
2297
|
boardEdgeMargin: distance.optional(),
|
|
2280
2298
|
cutoutMargin: distance.optional(),
|
|
2281
|
-
outline:
|
|
2282
|
-
coveredWithSolderMask:
|
|
2299
|
+
outline: z93.array(point).optional(),
|
|
2300
|
+
coveredWithSolderMask: z93.boolean().optional().default(true)
|
|
2283
2301
|
});
|
|
2284
2302
|
expectTypesMatch(true);
|
|
2285
2303
|
|
|
2286
2304
|
// lib/components/cadassembly.ts
|
|
2287
2305
|
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
2288
|
-
import { z as
|
|
2289
|
-
var cadassemblyProps =
|
|
2306
|
+
import { z as z94 } from "zod";
|
|
2307
|
+
var cadassemblyProps = z94.object({
|
|
2290
2308
|
originalLayer: layer_ref8.default("top").optional(),
|
|
2291
|
-
children:
|
|
2309
|
+
children: z94.any().optional()
|
|
2292
2310
|
});
|
|
2293
2311
|
expectTypesMatch(true);
|
|
2294
2312
|
|
|
2295
2313
|
// lib/components/cadmodel.ts
|
|
2296
|
-
import { z as
|
|
2297
|
-
var pcbPosition =
|
|
2314
|
+
import { z as z95 } from "zod";
|
|
2315
|
+
var pcbPosition = z95.object({
|
|
2298
2316
|
pcbX: pcbCoordinate.optional(),
|
|
2299
2317
|
pcbY: pcbCoordinate.optional(),
|
|
2300
2318
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -2311,7 +2329,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
2311
2329
|
});
|
|
2312
2330
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
2313
2331
|
expectTypesMatch(true);
|
|
2314
|
-
var cadmodelProps =
|
|
2332
|
+
var cadmodelProps = z95.union([z95.null(), url, cadModelObject]);
|
|
2315
2333
|
|
|
2316
2334
|
// lib/components/power-source.ts
|
|
2317
2335
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -2321,9 +2339,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
2321
2339
|
|
|
2322
2340
|
// lib/components/voltagesource.ts
|
|
2323
2341
|
import { frequency as frequency4, rotation as rotation5, voltage as voltage4 } from "circuit-json";
|
|
2324
|
-
import { z as
|
|
2342
|
+
import { z as z96 } from "zod";
|
|
2325
2343
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
2326
|
-
var percentage =
|
|
2344
|
+
var percentage = z96.union([z96.string(), z96.number()]).transform((val) => {
|
|
2327
2345
|
if (typeof val === "string") {
|
|
2328
2346
|
if (val.endsWith("%")) {
|
|
2329
2347
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -2332,13 +2350,13 @@ var percentage = z95.union([z95.string(), z95.number()]).transform((val) => {
|
|
|
2332
2350
|
}
|
|
2333
2351
|
return val;
|
|
2334
2352
|
}).pipe(
|
|
2335
|
-
|
|
2353
|
+
z96.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2336
2354
|
);
|
|
2337
2355
|
var voltageSourceProps = commonComponentProps.extend({
|
|
2338
2356
|
voltage: voltage4.optional(),
|
|
2339
2357
|
frequency: frequency4.optional(),
|
|
2340
2358
|
peakToPeakVoltage: voltage4.optional(),
|
|
2341
|
-
waveShape:
|
|
2359
|
+
waveShape: z96.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
2342
2360
|
phase: rotation5.optional(),
|
|
2343
2361
|
dutyCycle: percentage.optional(),
|
|
2344
2362
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -2348,9 +2366,9 @@ expectTypesMatch(true);
|
|
|
2348
2366
|
|
|
2349
2367
|
// lib/components/currentsource.ts
|
|
2350
2368
|
import { frequency as frequency5, rotation as rotation6, current } from "circuit-json";
|
|
2351
|
-
import { z as
|
|
2369
|
+
import { z as z97 } from "zod";
|
|
2352
2370
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
2353
|
-
var percentage2 =
|
|
2371
|
+
var percentage2 = z97.union([z97.string(), z97.number()]).transform((val) => {
|
|
2354
2372
|
if (typeof val === "string") {
|
|
2355
2373
|
if (val.endsWith("%")) {
|
|
2356
2374
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -2359,13 +2377,13 @@ var percentage2 = z96.union([z96.string(), z96.number()]).transform((val) => {
|
|
|
2359
2377
|
}
|
|
2360
2378
|
return val;
|
|
2361
2379
|
}).pipe(
|
|
2362
|
-
|
|
2380
|
+
z97.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2363
2381
|
);
|
|
2364
2382
|
var currentSourceProps = commonComponentProps.extend({
|
|
2365
2383
|
current: current.optional(),
|
|
2366
2384
|
frequency: frequency5.optional(),
|
|
2367
2385
|
peakToPeakCurrent: current.optional(),
|
|
2368
|
-
waveShape:
|
|
2386
|
+
waveShape: z97.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
2369
2387
|
phase: rotation6.optional(),
|
|
2370
2388
|
dutyCycle: percentage2.optional(),
|
|
2371
2389
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
@@ -2374,57 +2392,57 @@ var currentSourcePins = lrPolarPins;
|
|
|
2374
2392
|
expectTypesMatch(true);
|
|
2375
2393
|
|
|
2376
2394
|
// lib/components/voltageprobe.ts
|
|
2377
|
-
import { z as
|
|
2395
|
+
import { z as z98 } from "zod";
|
|
2378
2396
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
2379
|
-
name:
|
|
2380
|
-
connectsTo:
|
|
2381
|
-
referenceTo:
|
|
2382
|
-
color:
|
|
2397
|
+
name: z98.string().optional(),
|
|
2398
|
+
connectsTo: z98.string(),
|
|
2399
|
+
referenceTo: z98.string().optional(),
|
|
2400
|
+
color: z98.string().optional()
|
|
2383
2401
|
});
|
|
2384
2402
|
expectTypesMatch(true);
|
|
2385
2403
|
|
|
2386
2404
|
// lib/components/schematic-arc.ts
|
|
2387
2405
|
import { distance as distance29, point as point5, rotation as rotation7 } from "circuit-json";
|
|
2388
|
-
import { z as
|
|
2389
|
-
var schematicArcProps =
|
|
2406
|
+
import { z as z99 } from "zod";
|
|
2407
|
+
var schematicArcProps = z99.object({
|
|
2390
2408
|
center: point5,
|
|
2391
2409
|
radius: distance29,
|
|
2392
2410
|
startAngleDegrees: rotation7,
|
|
2393
2411
|
endAngleDegrees: rotation7,
|
|
2394
|
-
direction:
|
|
2412
|
+
direction: z99.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
2395
2413
|
strokeWidth: distance29.optional(),
|
|
2396
|
-
color:
|
|
2397
|
-
isDashed:
|
|
2414
|
+
color: z99.string().optional(),
|
|
2415
|
+
isDashed: z99.boolean().optional().default(false)
|
|
2398
2416
|
});
|
|
2399
2417
|
expectTypesMatch(true);
|
|
2400
2418
|
|
|
2401
2419
|
// lib/components/toolingrail.ts
|
|
2402
|
-
import { z as
|
|
2403
|
-
var toolingrailProps =
|
|
2404
|
-
children:
|
|
2420
|
+
import { z as z100 } from "zod";
|
|
2421
|
+
var toolingrailProps = z100.object({
|
|
2422
|
+
children: z100.any().optional()
|
|
2405
2423
|
});
|
|
2406
2424
|
expectTypesMatch(true);
|
|
2407
2425
|
|
|
2408
2426
|
// lib/components/schematic-box.ts
|
|
2409
2427
|
import { distance as distance30 } from "circuit-json";
|
|
2410
|
-
import { z as
|
|
2411
|
-
var schematicBoxProps =
|
|
2428
|
+
import { z as z101 } from "zod";
|
|
2429
|
+
var schematicBoxProps = z101.object({
|
|
2412
2430
|
schX: distance30.optional(),
|
|
2413
2431
|
schY: distance30.optional(),
|
|
2414
2432
|
width: distance30.optional(),
|
|
2415
2433
|
height: distance30.optional(),
|
|
2416
|
-
overlay:
|
|
2434
|
+
overlay: z101.array(z101.string()).optional(),
|
|
2417
2435
|
padding: distance30.optional(),
|
|
2418
2436
|
paddingLeft: distance30.optional(),
|
|
2419
2437
|
paddingRight: distance30.optional(),
|
|
2420
2438
|
paddingTop: distance30.optional(),
|
|
2421
2439
|
paddingBottom: distance30.optional(),
|
|
2422
|
-
title:
|
|
2440
|
+
title: z101.string().optional(),
|
|
2423
2441
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
2424
|
-
titleColor:
|
|
2442
|
+
titleColor: z101.string().optional(),
|
|
2425
2443
|
titleFontSize: distance30.optional(),
|
|
2426
|
-
titleInside:
|
|
2427
|
-
strokeStyle:
|
|
2444
|
+
titleInside: z101.boolean().default(false),
|
|
2445
|
+
strokeStyle: z101.enum(["solid", "dashed"]).default("solid")
|
|
2428
2446
|
}).refine(
|
|
2429
2447
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
2430
2448
|
{
|
|
@@ -2440,15 +2458,15 @@ expectTypesMatch(true);
|
|
|
2440
2458
|
|
|
2441
2459
|
// lib/components/schematic-circle.ts
|
|
2442
2460
|
import { distance as distance31, point as point6 } from "circuit-json";
|
|
2443
|
-
import { z as
|
|
2444
|
-
var schematicCircleProps =
|
|
2461
|
+
import { z as z102 } from "zod";
|
|
2462
|
+
var schematicCircleProps = z102.object({
|
|
2445
2463
|
center: point6,
|
|
2446
2464
|
radius: distance31,
|
|
2447
2465
|
strokeWidth: distance31.optional(),
|
|
2448
|
-
color:
|
|
2449
|
-
isFilled:
|
|
2450
|
-
fillColor:
|
|
2451
|
-
isDashed:
|
|
2466
|
+
color: z102.string().optional(),
|
|
2467
|
+
isFilled: z102.boolean().optional().default(false),
|
|
2468
|
+
fillColor: z102.string().optional(),
|
|
2469
|
+
isDashed: z102.boolean().optional().default(false)
|
|
2452
2470
|
});
|
|
2453
2471
|
expectTypesMatch(
|
|
2454
2472
|
true
|
|
@@ -2456,43 +2474,43 @@ expectTypesMatch(
|
|
|
2456
2474
|
|
|
2457
2475
|
// lib/components/schematic-rect.ts
|
|
2458
2476
|
import { distance as distance32, rotation as rotation8 } from "circuit-json";
|
|
2459
|
-
import { z as
|
|
2460
|
-
var schematicRectProps =
|
|
2477
|
+
import { z as z103 } from "zod";
|
|
2478
|
+
var schematicRectProps = z103.object({
|
|
2461
2479
|
schX: distance32.optional(),
|
|
2462
2480
|
schY: distance32.optional(),
|
|
2463
2481
|
width: distance32,
|
|
2464
2482
|
height: distance32,
|
|
2465
2483
|
rotation: rotation8.default(0),
|
|
2466
2484
|
strokeWidth: distance32.optional(),
|
|
2467
|
-
color:
|
|
2468
|
-
isFilled:
|
|
2469
|
-
fillColor:
|
|
2470
|
-
isDashed:
|
|
2485
|
+
color: z103.string().optional(),
|
|
2486
|
+
isFilled: z103.boolean().optional().default(false),
|
|
2487
|
+
fillColor: z103.string().optional(),
|
|
2488
|
+
isDashed: z103.boolean().optional().default(false),
|
|
2471
2489
|
cornerRadius: distance32.optional()
|
|
2472
2490
|
});
|
|
2473
2491
|
expectTypesMatch(true);
|
|
2474
2492
|
|
|
2475
2493
|
// lib/components/schematic-line.ts
|
|
2476
2494
|
import { distance as distance33 } from "circuit-json";
|
|
2477
|
-
import { z as
|
|
2478
|
-
var schematicLineProps =
|
|
2495
|
+
import { z as z104 } from "zod";
|
|
2496
|
+
var schematicLineProps = z104.object({
|
|
2479
2497
|
x1: distance33,
|
|
2480
2498
|
y1: distance33,
|
|
2481
2499
|
x2: distance33,
|
|
2482
2500
|
y2: distance33,
|
|
2483
2501
|
strokeWidth: distance33.optional(),
|
|
2484
|
-
color:
|
|
2485
|
-
isDashed:
|
|
2502
|
+
color: z104.string().optional(),
|
|
2503
|
+
isDashed: z104.boolean().optional().default(false)
|
|
2486
2504
|
});
|
|
2487
2505
|
expectTypesMatch(true);
|
|
2488
2506
|
|
|
2489
2507
|
// lib/components/schematic-text.ts
|
|
2490
2508
|
import { distance as distance34, rotation as rotation9 } from "circuit-json";
|
|
2491
|
-
import { z as
|
|
2509
|
+
import { z as z106 } from "zod";
|
|
2492
2510
|
|
|
2493
2511
|
// lib/common/fivePointAnchor.ts
|
|
2494
|
-
import { z as
|
|
2495
|
-
var fivePointAnchor =
|
|
2512
|
+
import { z as z105 } from "zod";
|
|
2513
|
+
var fivePointAnchor = z105.enum([
|
|
2496
2514
|
"center",
|
|
2497
2515
|
"left",
|
|
2498
2516
|
"right",
|
|
@@ -2501,37 +2519,37 @@ var fivePointAnchor = z104.enum([
|
|
|
2501
2519
|
]);
|
|
2502
2520
|
|
|
2503
2521
|
// lib/components/schematic-text.ts
|
|
2504
|
-
var schematicTextProps =
|
|
2522
|
+
var schematicTextProps = z106.object({
|
|
2505
2523
|
schX: distance34.optional(),
|
|
2506
2524
|
schY: distance34.optional(),
|
|
2507
|
-
text:
|
|
2508
|
-
fontSize:
|
|
2509
|
-
anchor:
|
|
2510
|
-
color:
|
|
2525
|
+
text: z106.string(),
|
|
2526
|
+
fontSize: z106.number().default(1),
|
|
2527
|
+
anchor: z106.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
2528
|
+
color: z106.string().default("#000000"),
|
|
2511
2529
|
schRotation: rotation9.default(0)
|
|
2512
2530
|
});
|
|
2513
2531
|
expectTypesMatch(true);
|
|
2514
2532
|
|
|
2515
2533
|
// lib/components/schematic-path.ts
|
|
2516
2534
|
import { distance as distance35, point as point8 } from "circuit-json";
|
|
2517
|
-
import { z as
|
|
2518
|
-
var schematicPathProps =
|
|
2519
|
-
points:
|
|
2520
|
-
svgPath:
|
|
2535
|
+
import { z as z107 } from "zod";
|
|
2536
|
+
var schematicPathProps = z107.object({
|
|
2537
|
+
points: z107.array(point8).optional(),
|
|
2538
|
+
svgPath: z107.string().optional(),
|
|
2521
2539
|
strokeWidth: distance35.optional(),
|
|
2522
|
-
strokeColor:
|
|
2523
|
-
isFilled:
|
|
2524
|
-
fillColor:
|
|
2540
|
+
strokeColor: z107.string().optional(),
|
|
2541
|
+
isFilled: z107.boolean().optional().default(false),
|
|
2542
|
+
fillColor: z107.string().optional()
|
|
2525
2543
|
});
|
|
2526
2544
|
expectTypesMatch(true);
|
|
2527
2545
|
|
|
2528
2546
|
// lib/components/schematic-table.ts
|
|
2529
2547
|
import { distance as distance36 } from "circuit-json";
|
|
2530
|
-
import { z as
|
|
2531
|
-
var schematicTableProps =
|
|
2548
|
+
import { z as z108 } from "zod";
|
|
2549
|
+
var schematicTableProps = z108.object({
|
|
2532
2550
|
schX: distance36.optional(),
|
|
2533
2551
|
schY: distance36.optional(),
|
|
2534
|
-
children:
|
|
2552
|
+
children: z108.any().optional(),
|
|
2535
2553
|
cellPadding: distance36.optional(),
|
|
2536
2554
|
borderWidth: distance36.optional(),
|
|
2537
2555
|
anchor: ninePointAnchor.optional(),
|
|
@@ -2541,64 +2559,64 @@ expectTypesMatch(true);
|
|
|
2541
2559
|
|
|
2542
2560
|
// lib/components/schematic-row.ts
|
|
2543
2561
|
import { distance as distance37 } from "circuit-json";
|
|
2544
|
-
import { z as
|
|
2545
|
-
var schematicRowProps =
|
|
2546
|
-
children:
|
|
2562
|
+
import { z as z109 } from "zod";
|
|
2563
|
+
var schematicRowProps = z109.object({
|
|
2564
|
+
children: z109.any().optional(),
|
|
2547
2565
|
height: distance37.optional()
|
|
2548
2566
|
});
|
|
2549
2567
|
expectTypesMatch(true);
|
|
2550
2568
|
|
|
2551
2569
|
// lib/components/schematic-cell.ts
|
|
2552
2570
|
import { distance as distance38 } from "circuit-json";
|
|
2553
|
-
import { z as
|
|
2554
|
-
var schematicCellProps =
|
|
2555
|
-
children:
|
|
2556
|
-
horizontalAlign:
|
|
2557
|
-
verticalAlign:
|
|
2571
|
+
import { z as z110 } from "zod";
|
|
2572
|
+
var schematicCellProps = z110.object({
|
|
2573
|
+
children: z110.string().optional(),
|
|
2574
|
+
horizontalAlign: z110.enum(["left", "center", "right"]).optional(),
|
|
2575
|
+
verticalAlign: z110.enum(["top", "middle", "bottom"]).optional(),
|
|
2558
2576
|
fontSize: distance38.optional(),
|
|
2559
|
-
rowSpan:
|
|
2560
|
-
colSpan:
|
|
2577
|
+
rowSpan: z110.number().optional(),
|
|
2578
|
+
colSpan: z110.number().optional(),
|
|
2561
2579
|
width: distance38.optional(),
|
|
2562
|
-
text:
|
|
2580
|
+
text: z110.string().optional()
|
|
2563
2581
|
});
|
|
2564
2582
|
expectTypesMatch(true);
|
|
2565
2583
|
|
|
2566
2584
|
// lib/components/copper-text.ts
|
|
2567
2585
|
import { layer_ref as layer_ref9, length as length8 } from "circuit-json";
|
|
2568
|
-
import { z as
|
|
2586
|
+
import { z as z111 } from "zod";
|
|
2569
2587
|
var copperTextProps = pcbLayoutProps.extend({
|
|
2570
|
-
text:
|
|
2588
|
+
text: z111.string(),
|
|
2571
2589
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2572
|
-
font:
|
|
2590
|
+
font: z111.enum(["tscircuit2024"]).optional(),
|
|
2573
2591
|
fontSize: length8.optional(),
|
|
2574
|
-
layers:
|
|
2575
|
-
knockout:
|
|
2576
|
-
mirrored:
|
|
2592
|
+
layers: z111.array(layer_ref9).optional(),
|
|
2593
|
+
knockout: z111.boolean().optional(),
|
|
2594
|
+
mirrored: z111.boolean().optional()
|
|
2577
2595
|
});
|
|
2578
2596
|
|
|
2579
2597
|
// lib/components/silkscreen-text.ts
|
|
2580
2598
|
import { layer_ref as layer_ref10, length as length9 } from "circuit-json";
|
|
2581
|
-
import { z as
|
|
2599
|
+
import { z as z112 } from "zod";
|
|
2582
2600
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
2583
|
-
text:
|
|
2601
|
+
text: z112.string(),
|
|
2584
2602
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2585
|
-
font:
|
|
2603
|
+
font: z112.enum(["tscircuit2024"]).optional(),
|
|
2586
2604
|
fontSize: length9.optional(),
|
|
2587
2605
|
/**
|
|
2588
2606
|
* If true, text will knock out underlying silkscreen
|
|
2589
2607
|
*/
|
|
2590
|
-
isKnockout:
|
|
2608
|
+
isKnockout: z112.boolean().optional(),
|
|
2591
2609
|
knockoutPadding: length9.optional(),
|
|
2592
2610
|
knockoutPaddingLeft: length9.optional(),
|
|
2593
2611
|
knockoutPaddingRight: length9.optional(),
|
|
2594
2612
|
knockoutPaddingTop: length9.optional(),
|
|
2595
2613
|
knockoutPaddingBottom: length9.optional(),
|
|
2596
|
-
layers:
|
|
2614
|
+
layers: z112.array(layer_ref10).optional()
|
|
2597
2615
|
});
|
|
2598
2616
|
|
|
2599
2617
|
// lib/components/silkscreen-path.ts
|
|
2600
2618
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
2601
|
-
import { z as
|
|
2619
|
+
import { z as z113 } from "zod";
|
|
2602
2620
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
2603
2621
|
pcbLeftEdgeX: true,
|
|
2604
2622
|
pcbRightEdgeX: true,
|
|
@@ -2610,7 +2628,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
2610
2628
|
pcbOffsetY: true,
|
|
2611
2629
|
pcbRotation: true
|
|
2612
2630
|
}).extend({
|
|
2613
|
-
route:
|
|
2631
|
+
route: z113.array(route_hint_point5),
|
|
2614
2632
|
strokeWidth: length10.optional()
|
|
2615
2633
|
});
|
|
2616
2634
|
|
|
@@ -2632,10 +2650,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
2632
2650
|
|
|
2633
2651
|
// lib/components/silkscreen-rect.ts
|
|
2634
2652
|
import { distance as distance40 } from "circuit-json";
|
|
2635
|
-
import { z as
|
|
2653
|
+
import { z as z114 } from "zod";
|
|
2636
2654
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2637
|
-
filled:
|
|
2638
|
-
stroke:
|
|
2655
|
+
filled: z114.boolean().default(true).optional(),
|
|
2656
|
+
stroke: z114.enum(["dashed", "solid", "none"]).optional(),
|
|
2639
2657
|
strokeWidth: distance40.optional(),
|
|
2640
2658
|
width: distance40,
|
|
2641
2659
|
height: distance40,
|
|
@@ -2644,73 +2662,73 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
2644
2662
|
|
|
2645
2663
|
// lib/components/silkscreen-circle.ts
|
|
2646
2664
|
import { distance as distance41 } from "circuit-json";
|
|
2647
|
-
import { z as
|
|
2665
|
+
import { z as z115 } from "zod";
|
|
2648
2666
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2649
|
-
isFilled:
|
|
2650
|
-
isOutline:
|
|
2667
|
+
isFilled: z115.boolean().optional(),
|
|
2668
|
+
isOutline: z115.boolean().optional(),
|
|
2651
2669
|
strokeWidth: distance41.optional(),
|
|
2652
2670
|
radius: distance41
|
|
2653
2671
|
});
|
|
2654
2672
|
|
|
2655
2673
|
// lib/components/trace-hint.ts
|
|
2656
2674
|
import { distance as distance42, layer_ref as layer_ref11, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
2657
|
-
import { z as
|
|
2658
|
-
var routeHintPointProps =
|
|
2675
|
+
import { z as z116 } from "zod";
|
|
2676
|
+
var routeHintPointProps = z116.object({
|
|
2659
2677
|
x: distance42,
|
|
2660
2678
|
y: distance42,
|
|
2661
|
-
via:
|
|
2679
|
+
via: z116.boolean().optional(),
|
|
2662
2680
|
toLayer: layer_ref11.optional()
|
|
2663
2681
|
});
|
|
2664
|
-
var traceHintProps =
|
|
2665
|
-
for:
|
|
2682
|
+
var traceHintProps = z116.object({
|
|
2683
|
+
for: z116.string().optional().describe(
|
|
2666
2684
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
2667
2685
|
),
|
|
2668
|
-
order:
|
|
2686
|
+
order: z116.number().optional(),
|
|
2669
2687
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
2670
|
-
offsets:
|
|
2671
|
-
traceWidth:
|
|
2688
|
+
offsets: z116.array(route_hint_point6).or(z116.array(routeHintPointProps)).optional(),
|
|
2689
|
+
traceWidth: z116.number().optional()
|
|
2672
2690
|
});
|
|
2673
2691
|
|
|
2674
2692
|
// lib/components/port.ts
|
|
2675
|
-
import { z as
|
|
2693
|
+
import { z as z117 } from "zod";
|
|
2676
2694
|
var portProps = commonLayoutProps.extend({
|
|
2677
|
-
name:
|
|
2678
|
-
pinNumber:
|
|
2679
|
-
schStemLength:
|
|
2680
|
-
aliases:
|
|
2681
|
-
layer:
|
|
2682
|
-
layers:
|
|
2683
|
-
schX:
|
|
2684
|
-
schY:
|
|
2695
|
+
name: z117.string(),
|
|
2696
|
+
pinNumber: z117.number().optional(),
|
|
2697
|
+
schStemLength: z117.number().optional(),
|
|
2698
|
+
aliases: z117.array(z117.string()).optional(),
|
|
2699
|
+
layer: z117.string().optional(),
|
|
2700
|
+
layers: z117.array(z117.string()).optional(),
|
|
2701
|
+
schX: z117.number().optional(),
|
|
2702
|
+
schY: z117.number().optional(),
|
|
2685
2703
|
direction,
|
|
2686
|
-
connectsTo:
|
|
2704
|
+
connectsTo: z117.string().or(z117.array(z117.string())).optional(),
|
|
2687
2705
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
2688
|
-
hasInversionCircle:
|
|
2706
|
+
hasInversionCircle: z117.boolean().optional()
|
|
2689
2707
|
});
|
|
2690
2708
|
|
|
2691
2709
|
// lib/components/pcb-note-text.ts
|
|
2692
2710
|
import { length as length11 } from "circuit-json";
|
|
2693
|
-
import { z as
|
|
2711
|
+
import { z as z118 } from "zod";
|
|
2694
2712
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
2695
|
-
text:
|
|
2696
|
-
anchorAlignment:
|
|
2697
|
-
font:
|
|
2713
|
+
text: z118.string(),
|
|
2714
|
+
anchorAlignment: z118.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2715
|
+
font: z118.enum(["tscircuit2024"]).optional(),
|
|
2698
2716
|
fontSize: length11.optional(),
|
|
2699
|
-
color:
|
|
2717
|
+
color: z118.string().optional()
|
|
2700
2718
|
});
|
|
2701
2719
|
expectTypesMatch(true);
|
|
2702
2720
|
|
|
2703
2721
|
// lib/components/pcb-note-rect.ts
|
|
2704
2722
|
import { distance as distance43 } from "circuit-json";
|
|
2705
|
-
import { z as
|
|
2723
|
+
import { z as z119 } from "zod";
|
|
2706
2724
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2707
2725
|
width: distance43,
|
|
2708
2726
|
height: distance43,
|
|
2709
2727
|
strokeWidth: distance43.optional(),
|
|
2710
|
-
isFilled:
|
|
2711
|
-
hasStroke:
|
|
2712
|
-
isStrokeDashed:
|
|
2713
|
-
color:
|
|
2728
|
+
isFilled: z119.boolean().optional(),
|
|
2729
|
+
hasStroke: z119.boolean().optional(),
|
|
2730
|
+
isStrokeDashed: z119.boolean().optional(),
|
|
2731
|
+
color: z119.string().optional(),
|
|
2714
2732
|
cornerRadius: distance43.optional()
|
|
2715
2733
|
});
|
|
2716
2734
|
expectTypesMatch(true);
|
|
@@ -2720,7 +2738,7 @@ import {
|
|
|
2720
2738
|
length as length12,
|
|
2721
2739
|
route_hint_point as route_hint_point7
|
|
2722
2740
|
} from "circuit-json";
|
|
2723
|
-
import { z as
|
|
2741
|
+
import { z as z120 } from "zod";
|
|
2724
2742
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
2725
2743
|
pcbLeftEdgeX: true,
|
|
2726
2744
|
pcbRightEdgeX: true,
|
|
@@ -2732,15 +2750,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
2732
2750
|
pcbOffsetY: true,
|
|
2733
2751
|
pcbRotation: true
|
|
2734
2752
|
}).extend({
|
|
2735
|
-
route:
|
|
2753
|
+
route: z120.array(route_hint_point7),
|
|
2736
2754
|
strokeWidth: length12.optional(),
|
|
2737
|
-
color:
|
|
2755
|
+
color: z120.string().optional()
|
|
2738
2756
|
});
|
|
2739
2757
|
expectTypesMatch(true);
|
|
2740
2758
|
|
|
2741
2759
|
// lib/components/pcb-note-line.ts
|
|
2742
2760
|
import { distance as distance44 } from "circuit-json";
|
|
2743
|
-
import { z as
|
|
2761
|
+
import { z as z121 } from "zod";
|
|
2744
2762
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
2745
2763
|
pcbLeftEdgeX: true,
|
|
2746
2764
|
pcbRightEdgeX: true,
|
|
@@ -2757,15 +2775,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
2757
2775
|
x2: distance44,
|
|
2758
2776
|
y2: distance44,
|
|
2759
2777
|
strokeWidth: distance44.optional(),
|
|
2760
|
-
color:
|
|
2761
|
-
isDashed:
|
|
2778
|
+
color: z121.string().optional(),
|
|
2779
|
+
isDashed: z121.boolean().optional()
|
|
2762
2780
|
});
|
|
2763
2781
|
expectTypesMatch(true);
|
|
2764
2782
|
|
|
2765
2783
|
// lib/components/pcb-note-dimension.ts
|
|
2766
2784
|
import { distance as distance45, length as length13 } from "circuit-json";
|
|
2767
|
-
import { z as
|
|
2768
|
-
var dimensionTarget2 =
|
|
2785
|
+
import { z as z122 } from "zod";
|
|
2786
|
+
var dimensionTarget2 = z122.union([z122.string(), point]);
|
|
2769
2787
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
2770
2788
|
pcbLeftEdgeX: true,
|
|
2771
2789
|
pcbRightEdgeX: true,
|
|
@@ -2779,100 +2797,100 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
2779
2797
|
}).extend({
|
|
2780
2798
|
from: dimensionTarget2,
|
|
2781
2799
|
to: dimensionTarget2,
|
|
2782
|
-
text:
|
|
2800
|
+
text: z122.string().optional(),
|
|
2783
2801
|
offset: distance45.optional(),
|
|
2784
|
-
font:
|
|
2802
|
+
font: z122.enum(["tscircuit2024"]).optional(),
|
|
2785
2803
|
fontSize: length13.optional(),
|
|
2786
|
-
color:
|
|
2804
|
+
color: z122.string().optional(),
|
|
2787
2805
|
arrowSize: distance45.optional(),
|
|
2788
|
-
units:
|
|
2789
|
-
outerEdgeToEdge:
|
|
2790
|
-
centerToCenter:
|
|
2791
|
-
innerEdgeToEdge:
|
|
2806
|
+
units: z122.enum(["in", "mm"]).optional(),
|
|
2807
|
+
outerEdgeToEdge: z122.literal(true).optional(),
|
|
2808
|
+
centerToCenter: z122.literal(true).optional(),
|
|
2809
|
+
innerEdgeToEdge: z122.literal(true).optional()
|
|
2792
2810
|
});
|
|
2793
2811
|
expectTypesMatch(
|
|
2794
2812
|
true
|
|
2795
2813
|
);
|
|
2796
2814
|
|
|
2797
2815
|
// lib/platformConfig.ts
|
|
2798
|
-
import { z as
|
|
2799
|
-
var unvalidatedCircuitJson =
|
|
2800
|
-
var footprintLibraryResult =
|
|
2801
|
-
footprintCircuitJson:
|
|
2816
|
+
import { z as z123 } from "zod";
|
|
2817
|
+
var unvalidatedCircuitJson = z123.array(z123.any()).describe("Circuit JSON");
|
|
2818
|
+
var footprintLibraryResult = z123.object({
|
|
2819
|
+
footprintCircuitJson: z123.array(z123.any()),
|
|
2802
2820
|
cadModel: cadModelProp.optional()
|
|
2803
2821
|
});
|
|
2804
|
-
var pathToCircuitJsonFn =
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
).returns(
|
|
2822
|
+
var pathToCircuitJsonFn = z123.function().args(z123.string()).returns(z123.promise(footprintLibraryResult)).or(
|
|
2823
|
+
z123.function().args(
|
|
2824
|
+
z123.string(),
|
|
2825
|
+
z123.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
2826
|
+
).returns(z123.promise(footprintLibraryResult))
|
|
2809
2827
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
2810
|
-
var footprintFileParserEntry =
|
|
2811
|
-
loadFromUrl:
|
|
2828
|
+
var footprintFileParserEntry = z123.object({
|
|
2829
|
+
loadFromUrl: z123.function().args(z123.string()).returns(z123.promise(footprintLibraryResult)).describe(
|
|
2812
2830
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
2813
2831
|
)
|
|
2814
2832
|
});
|
|
2815
|
-
var spiceEngineSimulationResult =
|
|
2816
|
-
engineVersionString:
|
|
2833
|
+
var spiceEngineSimulationResult = z123.object({
|
|
2834
|
+
engineVersionString: z123.string().optional(),
|
|
2817
2835
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
2818
2836
|
});
|
|
2819
|
-
var spiceEngineZod =
|
|
2820
|
-
simulate:
|
|
2837
|
+
var spiceEngineZod = z123.object({
|
|
2838
|
+
simulate: z123.function().args(z123.string()).returns(z123.promise(spiceEngineSimulationResult)).describe(
|
|
2821
2839
|
"A function that takes a SPICE string and returns a simulation result"
|
|
2822
2840
|
)
|
|
2823
2841
|
});
|
|
2824
|
-
var defaultSpiceEngine =
|
|
2842
|
+
var defaultSpiceEngine = z123.custom(
|
|
2825
2843
|
(value) => typeof value === "string"
|
|
2826
2844
|
);
|
|
2827
|
-
var autorouterInstance =
|
|
2828
|
-
run:
|
|
2829
|
-
getOutputSimpleRouteJson:
|
|
2845
|
+
var autorouterInstance = z123.object({
|
|
2846
|
+
run: z123.function().args().returns(z123.promise(z123.unknown())).describe("Run the autorouter"),
|
|
2847
|
+
getOutputSimpleRouteJson: z123.function().args().returns(z123.promise(z123.any())).describe("Get the resulting SimpleRouteJson")
|
|
2830
2848
|
});
|
|
2831
|
-
var autorouterDefinition =
|
|
2832
|
-
createAutorouter:
|
|
2849
|
+
var autorouterDefinition = z123.object({
|
|
2850
|
+
createAutorouter: z123.function().args(z123.any(), z123.any().optional()).returns(z123.union([autorouterInstance, z123.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
2833
2851
|
});
|
|
2834
|
-
var platformFetch =
|
|
2835
|
-
var platformConfig =
|
|
2852
|
+
var platformFetch = z123.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
2853
|
+
var platformConfig = z123.object({
|
|
2836
2854
|
partsEngine: partsEngine.optional(),
|
|
2837
2855
|
autorouter: autorouterProp.optional(),
|
|
2838
|
-
autorouterMap:
|
|
2856
|
+
autorouterMap: z123.record(z123.string(), autorouterDefinition).optional(),
|
|
2839
2857
|
registryApiUrl: url.optional(),
|
|
2840
2858
|
cloudAutorouterUrl: url.optional(),
|
|
2841
|
-
projectName:
|
|
2859
|
+
projectName: z123.string().optional(),
|
|
2842
2860
|
projectBaseUrl: url.optional(),
|
|
2843
|
-
version:
|
|
2861
|
+
version: z123.string().optional(),
|
|
2844
2862
|
url: url.optional(),
|
|
2845
|
-
printBoardInformationToSilkscreen:
|
|
2846
|
-
includeBoardFiles:
|
|
2863
|
+
printBoardInformationToSilkscreen: z123.boolean().optional(),
|
|
2864
|
+
includeBoardFiles: z123.array(z123.string()).describe(
|
|
2847
2865
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
2848
2866
|
).optional(),
|
|
2849
|
-
snapshotsDir:
|
|
2867
|
+
snapshotsDir: z123.string().describe(
|
|
2850
2868
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
2851
2869
|
).optional(),
|
|
2852
2870
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
2853
|
-
unitPreference:
|
|
2854
|
-
localCacheEngine:
|
|
2855
|
-
pcbDisabled:
|
|
2856
|
-
routingDisabled:
|
|
2857
|
-
schematicDisabled:
|
|
2858
|
-
partsEngineDisabled:
|
|
2859
|
-
drcChecksDisabled:
|
|
2860
|
-
netlistDrcChecksDisabled:
|
|
2861
|
-
routingDrcChecksDisabled:
|
|
2862
|
-
placementDrcChecksDisabled:
|
|
2863
|
-
spiceEngineMap:
|
|
2864
|
-
footprintLibraryMap:
|
|
2865
|
-
|
|
2866
|
-
|
|
2871
|
+
unitPreference: z123.enum(["mm", "in", "mil"]).optional(),
|
|
2872
|
+
localCacheEngine: z123.any().optional(),
|
|
2873
|
+
pcbDisabled: z123.boolean().optional(),
|
|
2874
|
+
routingDisabled: z123.boolean().optional(),
|
|
2875
|
+
schematicDisabled: z123.boolean().optional(),
|
|
2876
|
+
partsEngineDisabled: z123.boolean().optional(),
|
|
2877
|
+
drcChecksDisabled: z123.boolean().optional(),
|
|
2878
|
+
netlistDrcChecksDisabled: z123.boolean().optional(),
|
|
2879
|
+
routingDrcChecksDisabled: z123.boolean().optional(),
|
|
2880
|
+
placementDrcChecksDisabled: z123.boolean().optional(),
|
|
2881
|
+
spiceEngineMap: z123.record(z123.string(), spiceEngineZod).optional(),
|
|
2882
|
+
footprintLibraryMap: z123.record(
|
|
2883
|
+
z123.string(),
|
|
2884
|
+
z123.union([
|
|
2867
2885
|
pathToCircuitJsonFn,
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2886
|
+
z123.record(
|
|
2887
|
+
z123.string(),
|
|
2888
|
+
z123.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
2871
2889
|
)
|
|
2872
2890
|
])
|
|
2873
2891
|
).optional(),
|
|
2874
|
-
footprintFileParserMap:
|
|
2875
|
-
resolveProjectStaticFileImportUrl:
|
|
2892
|
+
footprintFileParserMap: z123.record(z123.string(), footprintFileParserEntry).optional(),
|
|
2893
|
+
resolveProjectStaticFileImportUrl: z123.function().args(z123.string()).returns(z123.promise(z123.string())).describe(
|
|
2876
2894
|
"A function that returns a string URL for static files for the project"
|
|
2877
2895
|
).optional(),
|
|
2878
2896
|
platformFetch: platformFetch.optional()
|
|
@@ -3029,6 +3047,7 @@ export {
|
|
|
3029
3047
|
pcbYDistConstraintProps,
|
|
3030
3048
|
pillSmtPadProps,
|
|
3031
3049
|
pinAttributeMap,
|
|
3050
|
+
pinCapability,
|
|
3032
3051
|
pinCompatibleVariant,
|
|
3033
3052
|
pinHeaderProps,
|
|
3034
3053
|
pinLabelsProp,
|