@tscircuit/props 0.0.113 → 0.0.115
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 +418 -1
- package/dist/index.js +173 -161
- package/dist/index.js.map +1 -1
- package/lib/components/resonator.ts +22 -0
- package/lib/index.ts +1 -0
- package/lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts +4 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
route_hint_point as route_hint_point4,
|
|
9
9
|
voltage
|
|
10
10
|
} from "circuit-json";
|
|
11
|
-
import { z as
|
|
11
|
+
import { z as z41 } from "zod";
|
|
12
12
|
|
|
13
13
|
// lib/typecheck.ts
|
|
14
14
|
var expectTypesMatch = (shouldBe) => {
|
|
@@ -341,33 +341,43 @@ var crystalProps = commonComponentProps.extend({
|
|
|
341
341
|
var crystalPins = lrPins;
|
|
342
342
|
expectTypesMatch(true);
|
|
343
343
|
|
|
344
|
-
// lib/components/
|
|
345
|
-
import { capacitance as capacitance2 } from "circuit-json";
|
|
344
|
+
// lib/components/resonator.ts
|
|
345
|
+
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
346
346
|
import { z as z17 } from "zod";
|
|
347
|
+
var resonatorProps = commonComponentProps.extend({
|
|
348
|
+
frequency: frequency2,
|
|
349
|
+
loadCapacitance: capacitance2,
|
|
350
|
+
pinVariant: z17.literal("3pin")
|
|
351
|
+
});
|
|
352
|
+
expectTypesMatch(true);
|
|
353
|
+
|
|
354
|
+
// lib/components/capacitor.ts
|
|
355
|
+
import { capacitance as capacitance3 } from "circuit-json";
|
|
356
|
+
import { z as z18 } from "zod";
|
|
347
357
|
var capacitorProps = commonComponentProps.extend({
|
|
348
|
-
capacitance:
|
|
349
|
-
polarized:
|
|
350
|
-
decouplingFor:
|
|
351
|
-
decouplingTo:
|
|
352
|
-
bypassFor:
|
|
353
|
-
bypassTo:
|
|
358
|
+
capacitance: capacitance3,
|
|
359
|
+
polarized: z18.boolean().optional().default(false),
|
|
360
|
+
decouplingFor: z18.string().optional(),
|
|
361
|
+
decouplingTo: z18.string().optional(),
|
|
362
|
+
bypassFor: z18.string().optional(),
|
|
363
|
+
bypassTo: z18.string().optional()
|
|
354
364
|
});
|
|
355
365
|
var capacitorPins = lrPolarPins;
|
|
356
366
|
expectTypesMatch(true);
|
|
357
367
|
|
|
358
368
|
// lib/components/net.ts
|
|
359
|
-
import { z as
|
|
360
|
-
var netProps =
|
|
361
|
-
name:
|
|
369
|
+
import { z as z19 } from "zod";
|
|
370
|
+
var netProps = z19.object({
|
|
371
|
+
name: z19.string()
|
|
362
372
|
});
|
|
363
373
|
expectTypesMatch(true);
|
|
364
374
|
|
|
365
375
|
// lib/components/constrainedlayout.ts
|
|
366
|
-
import { z as
|
|
367
|
-
var constrainedLayoutProps =
|
|
368
|
-
name:
|
|
369
|
-
pcbOnly:
|
|
370
|
-
schOnly:
|
|
376
|
+
import { z as z20 } from "zod";
|
|
377
|
+
var constrainedLayoutProps = z20.object({
|
|
378
|
+
name: z20.string().optional(),
|
|
379
|
+
pcbOnly: z20.boolean().optional(),
|
|
380
|
+
schOnly: z20.boolean().optional()
|
|
371
381
|
});
|
|
372
382
|
expectTypesMatch(true);
|
|
373
383
|
|
|
@@ -376,46 +386,46 @@ import "zod";
|
|
|
376
386
|
import { distance as distance9, length as length2 } from "circuit-json";
|
|
377
387
|
|
|
378
388
|
// lib/components/constraint.ts
|
|
379
|
-
import { z as
|
|
380
|
-
var pcbXDistConstraintProps =
|
|
381
|
-
pcb:
|
|
389
|
+
import { z as z22 } from "zod";
|
|
390
|
+
var pcbXDistConstraintProps = z22.object({
|
|
391
|
+
pcb: z22.literal(true).optional(),
|
|
382
392
|
xDist: distance9,
|
|
383
|
-
left:
|
|
384
|
-
right:
|
|
385
|
-
edgeToEdge:
|
|
386
|
-
centerToCenter:
|
|
393
|
+
left: z22.string(),
|
|
394
|
+
right: z22.string(),
|
|
395
|
+
edgeToEdge: z22.literal(true).optional(),
|
|
396
|
+
centerToCenter: z22.literal(true).optional()
|
|
387
397
|
});
|
|
388
398
|
expectTypesMatch(
|
|
389
399
|
true
|
|
390
400
|
);
|
|
391
|
-
var pcbYDistConstraintProps =
|
|
392
|
-
pcb:
|
|
401
|
+
var pcbYDistConstraintProps = z22.object({
|
|
402
|
+
pcb: z22.literal(true).optional(),
|
|
393
403
|
yDist: distance9,
|
|
394
|
-
top:
|
|
395
|
-
bottom:
|
|
396
|
-
edgeToEdge:
|
|
397
|
-
centerToCenter:
|
|
404
|
+
top: z22.string(),
|
|
405
|
+
bottom: z22.string(),
|
|
406
|
+
edgeToEdge: z22.literal(true).optional(),
|
|
407
|
+
centerToCenter: z22.literal(true).optional()
|
|
398
408
|
});
|
|
399
409
|
expectTypesMatch(
|
|
400
410
|
true
|
|
401
411
|
);
|
|
402
|
-
var pcbSameYConstraintProps =
|
|
403
|
-
pcb:
|
|
404
|
-
sameY:
|
|
405
|
-
for:
|
|
412
|
+
var pcbSameYConstraintProps = z22.object({
|
|
413
|
+
pcb: z22.literal(true).optional(),
|
|
414
|
+
sameY: z22.literal(true).optional(),
|
|
415
|
+
for: z22.array(z22.string())
|
|
406
416
|
});
|
|
407
417
|
expectTypesMatch(
|
|
408
418
|
true
|
|
409
419
|
);
|
|
410
|
-
var pcbSameXConstraintProps =
|
|
411
|
-
pcb:
|
|
412
|
-
sameX:
|
|
413
|
-
for:
|
|
420
|
+
var pcbSameXConstraintProps = z22.object({
|
|
421
|
+
pcb: z22.literal(true).optional(),
|
|
422
|
+
sameX: z22.literal(true).optional(),
|
|
423
|
+
for: z22.array(z22.string())
|
|
414
424
|
});
|
|
415
425
|
expectTypesMatch(
|
|
416
426
|
true
|
|
417
427
|
);
|
|
418
|
-
var constraintProps =
|
|
428
|
+
var constraintProps = z22.union([
|
|
419
429
|
pcbXDistConstraintProps,
|
|
420
430
|
pcbYDistConstraintProps,
|
|
421
431
|
pcbSameYConstraintProps,
|
|
@@ -424,29 +434,29 @@ var constraintProps = z21.union([
|
|
|
424
434
|
expectTypesMatch(true);
|
|
425
435
|
|
|
426
436
|
// lib/components/smtpad.ts
|
|
427
|
-
import { z as
|
|
437
|
+
import { z as z23 } from "zod";
|
|
428
438
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
429
|
-
shape:
|
|
439
|
+
shape: z23.literal("rect"),
|
|
430
440
|
width: distance9,
|
|
431
441
|
height: distance9,
|
|
432
442
|
portHints: portHints.optional()
|
|
433
443
|
});
|
|
434
444
|
expectTypesMatch(true);
|
|
435
445
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
436
|
-
shape:
|
|
446
|
+
shape: z23.literal("rotated_rect"),
|
|
437
447
|
width: distance9,
|
|
438
448
|
height: distance9,
|
|
439
|
-
ccwRotation:
|
|
449
|
+
ccwRotation: z23.number(),
|
|
440
450
|
portHints: portHints.optional()
|
|
441
451
|
});
|
|
442
452
|
expectTypesMatch(true);
|
|
443
453
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
444
|
-
shape:
|
|
454
|
+
shape: z23.literal("circle"),
|
|
445
455
|
radius: distance9,
|
|
446
456
|
portHints: portHints.optional()
|
|
447
457
|
});
|
|
448
458
|
expectTypesMatch(true);
|
|
449
|
-
var smtPadProps =
|
|
459
|
+
var smtPadProps = z23.union([
|
|
450
460
|
circleSmtPadProps,
|
|
451
461
|
rectSmtPadProps,
|
|
452
462
|
rotatedRectSmtPadProps
|
|
@@ -454,28 +464,28 @@ var smtPadProps = z22.union([
|
|
|
454
464
|
expectTypesMatch(true);
|
|
455
465
|
|
|
456
466
|
// lib/components/solderpaste.ts
|
|
457
|
-
import { z as
|
|
467
|
+
import { z as z24 } from "zod";
|
|
458
468
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
459
|
-
shape:
|
|
469
|
+
shape: z24.literal("rect"),
|
|
460
470
|
width: distance9,
|
|
461
471
|
height: distance9
|
|
462
472
|
});
|
|
463
473
|
expectTypesMatch(true);
|
|
464
474
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
465
|
-
shape:
|
|
475
|
+
shape: z24.literal("circle"),
|
|
466
476
|
radius: distance9
|
|
467
477
|
});
|
|
468
478
|
expectTypesMatch(true);
|
|
469
|
-
var solderPasteProps =
|
|
479
|
+
var solderPasteProps = z24.union([
|
|
470
480
|
circleSolderPasteProps,
|
|
471
481
|
rectSolderPasteProps
|
|
472
482
|
]);
|
|
473
483
|
expectTypesMatch(true);
|
|
474
484
|
|
|
475
485
|
// lib/components/hole.ts
|
|
476
|
-
import { z as
|
|
486
|
+
import { z as z25 } from "zod";
|
|
477
487
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
478
|
-
name:
|
|
488
|
+
name: z25.string().optional(),
|
|
479
489
|
diameter: distance9.optional(),
|
|
480
490
|
radius: distance9.optional()
|
|
481
491
|
}).transform((d) => ({
|
|
@@ -487,23 +497,23 @@ expectTypesMatch(true);
|
|
|
487
497
|
|
|
488
498
|
// lib/components/trace.ts
|
|
489
499
|
import { distance as distance10, route_hint_point } from "circuit-json";
|
|
490
|
-
import { z as
|
|
491
|
-
var portRef =
|
|
492
|
-
|
|
493
|
-
|
|
500
|
+
import { z as z26 } from "zod";
|
|
501
|
+
var portRef = z26.union([
|
|
502
|
+
z26.string(),
|
|
503
|
+
z26.custom(
|
|
494
504
|
(v) => Boolean(v.getPortSelector)
|
|
495
505
|
)
|
|
496
506
|
]);
|
|
497
|
-
var baseTraceProps =
|
|
498
|
-
key:
|
|
507
|
+
var baseTraceProps = z26.object({
|
|
508
|
+
key: z26.string().optional(),
|
|
499
509
|
thickness: distance10.optional(),
|
|
500
|
-
schematicRouteHints:
|
|
501
|
-
pcbRouteHints:
|
|
502
|
-
schDisplayLabel:
|
|
510
|
+
schematicRouteHints: z26.array(point).optional(),
|
|
511
|
+
pcbRouteHints: z26.array(route_hint_point).optional(),
|
|
512
|
+
schDisplayLabel: z26.string().optional()
|
|
503
513
|
});
|
|
504
|
-
var traceProps =
|
|
514
|
+
var traceProps = z26.union([
|
|
505
515
|
baseTraceProps.extend({
|
|
506
|
-
path:
|
|
516
|
+
path: z26.array(portRef)
|
|
507
517
|
}),
|
|
508
518
|
baseTraceProps.extend({
|
|
509
519
|
from: portRef,
|
|
@@ -513,15 +523,15 @@ var traceProps = z25.union([
|
|
|
513
523
|
|
|
514
524
|
// lib/components/footprint.ts
|
|
515
525
|
import { layer_ref as layer_ref2 } from "circuit-json";
|
|
516
|
-
import { z as
|
|
517
|
-
var footprintProps =
|
|
526
|
+
import { z as z27 } from "zod";
|
|
527
|
+
var footprintProps = z27.object({
|
|
518
528
|
originalLayer: layer_ref2.default("top").optional()
|
|
519
529
|
});
|
|
520
530
|
expectTypesMatch(true);
|
|
521
531
|
|
|
522
532
|
// lib/components/battery.ts
|
|
523
|
-
import { z as
|
|
524
|
-
var capacity =
|
|
533
|
+
import { z as z28 } from "zod";
|
|
534
|
+
var capacity = z28.number().or(z28.string().endsWith("mAh")).transform((v) => {
|
|
525
535
|
if (typeof v === "string") {
|
|
526
536
|
const valString = v.replace("mAh", "");
|
|
527
537
|
const num = Number.parseFloat(valString);
|
|
@@ -540,29 +550,29 @@ expectTypesMatch(true);
|
|
|
540
550
|
|
|
541
551
|
// lib/components/pin-header.ts
|
|
542
552
|
import { distance as distance11 } from "circuit-json";
|
|
543
|
-
import { z as
|
|
553
|
+
import { z as z29 } from "zod";
|
|
544
554
|
var pinHeaderProps = commonComponentProps.extend({
|
|
545
|
-
pinCount:
|
|
555
|
+
pinCount: z29.number(),
|
|
546
556
|
pitch: distance11.optional(),
|
|
547
|
-
gender:
|
|
548
|
-
showSilkscreenPinLabels:
|
|
549
|
-
doubleRow:
|
|
557
|
+
gender: z29.enum(["male", "female"]).optional().default("male"),
|
|
558
|
+
showSilkscreenPinLabels: z29.boolean().optional(),
|
|
559
|
+
doubleRow: z29.boolean().optional(),
|
|
550
560
|
holeDiameter: distance11.optional(),
|
|
551
561
|
platedDiameter: distance11.optional(),
|
|
552
|
-
pinLabels:
|
|
553
|
-
facingDirection:
|
|
562
|
+
pinLabels: z29.array(z29.string()).optional(),
|
|
563
|
+
facingDirection: z29.enum(["left", "right"]).optional()
|
|
554
564
|
});
|
|
555
565
|
expectTypesMatch(true);
|
|
556
566
|
|
|
557
567
|
// lib/components/netalias.ts
|
|
558
|
-
import { z as
|
|
568
|
+
import { z as z30 } from "zod";
|
|
559
569
|
import { rotation as rotation2 } from "circuit-json";
|
|
560
|
-
var netAliasProps =
|
|
561
|
-
net:
|
|
570
|
+
var netAliasProps = z30.object({
|
|
571
|
+
net: z30.string().optional(),
|
|
562
572
|
schX: distance9.optional(),
|
|
563
573
|
schY: distance9.optional(),
|
|
564
574
|
schRotation: rotation2.optional(),
|
|
565
|
-
anchorSide:
|
|
575
|
+
anchorSide: z30.enum(["left", "up", "right", "down"]).optional()
|
|
566
576
|
});
|
|
567
577
|
expectTypesMatch(true);
|
|
568
578
|
|
|
@@ -575,37 +585,38 @@ var subcircuitProps = subcircuitGroupProps;
|
|
|
575
585
|
expectTypesMatch(true);
|
|
576
586
|
|
|
577
587
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
578
|
-
import { z as
|
|
579
|
-
var base_manual_edit_event =
|
|
580
|
-
edit_event_id:
|
|
581
|
-
in_progress:
|
|
582
|
-
created_at:
|
|
588
|
+
import { z as z32 } from "zod";
|
|
589
|
+
var base_manual_edit_event = z32.object({
|
|
590
|
+
edit_event_id: z32.string(),
|
|
591
|
+
in_progress: z32.boolean().optional(),
|
|
592
|
+
created_at: z32.number()
|
|
583
593
|
});
|
|
584
594
|
expectTypesMatch(
|
|
585
595
|
true
|
|
586
596
|
);
|
|
587
597
|
|
|
588
598
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
589
|
-
import { z as
|
|
599
|
+
import { z as z33 } from "zod";
|
|
590
600
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
591
|
-
pcb_edit_event_type:
|
|
592
|
-
edit_event_type:
|
|
593
|
-
pcb_component_id:
|
|
594
|
-
original_center:
|
|
595
|
-
new_center:
|
|
601
|
+
pcb_edit_event_type: z33.literal("edit_component_location").describe("deprecated"),
|
|
602
|
+
edit_event_type: z33.literal("edit_pcb_component_location"),
|
|
603
|
+
pcb_component_id: z33.string(),
|
|
604
|
+
original_center: z33.object({ x: z33.number(), y: z33.number() }),
|
|
605
|
+
new_center: z33.object({ x: z33.number(), y: z33.number() })
|
|
596
606
|
});
|
|
597
607
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
598
608
|
expectTypesMatch(true);
|
|
599
609
|
|
|
600
610
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
601
|
-
import { z as
|
|
611
|
+
import { z as z34 } from "zod";
|
|
602
612
|
import "circuit-json";
|
|
603
613
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
604
|
-
pcb_edit_event_type:
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
614
|
+
pcb_edit_event_type: z34.literal("edit_trace_hint").describe("deprecated"),
|
|
615
|
+
edit_event_type: z34.literal("edit_pcb_trace_hint").optional(),
|
|
616
|
+
pcb_port_id: z34.string(),
|
|
617
|
+
pcb_trace_hint_id: z34.string().optional(),
|
|
618
|
+
route: z34.array(
|
|
619
|
+
z34.object({ x: z34.number(), y: z34.number(), via: z34.boolean().optional() })
|
|
609
620
|
)
|
|
610
621
|
});
|
|
611
622
|
expectTypesMatch(
|
|
@@ -613,18 +624,18 @@ expectTypesMatch(
|
|
|
613
624
|
);
|
|
614
625
|
|
|
615
626
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
616
|
-
import { z as
|
|
627
|
+
import { z as z35 } from "zod";
|
|
617
628
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
618
|
-
edit_event_type:
|
|
619
|
-
schematic_component_id:
|
|
620
|
-
original_center:
|
|
621
|
-
new_center:
|
|
629
|
+
edit_event_type: z35.literal("edit_schematic_component_location"),
|
|
630
|
+
schematic_component_id: z35.string(),
|
|
631
|
+
original_center: z35.object({ x: z35.number(), y: z35.number() }),
|
|
632
|
+
new_center: z35.object({ x: z35.number(), y: z35.number() })
|
|
622
633
|
});
|
|
623
634
|
expectTypesMatch(true);
|
|
624
635
|
|
|
625
636
|
// lib/manual-edits/manual_edit_event.ts
|
|
626
|
-
import { z as
|
|
627
|
-
var manual_edit_event =
|
|
637
|
+
import { z as z36 } from "zod";
|
|
638
|
+
var manual_edit_event = z36.union([
|
|
628
639
|
edit_pcb_component_location_event,
|
|
629
640
|
edit_trace_hint_event,
|
|
630
641
|
edit_schematic_component_location_event
|
|
@@ -632,33 +643,33 @@ var manual_edit_event = z35.union([
|
|
|
632
643
|
expectTypesMatch(true);
|
|
633
644
|
|
|
634
645
|
// lib/manual-edits/manual_edit_file.ts
|
|
635
|
-
import { z as
|
|
646
|
+
import { z as z40 } from "zod";
|
|
636
647
|
|
|
637
648
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
638
|
-
import { z as
|
|
649
|
+
import { z as z37 } from "zod";
|
|
639
650
|
import { point as point2 } from "circuit-json";
|
|
640
|
-
var manual_pcb_placement =
|
|
641
|
-
selector:
|
|
642
|
-
relative_to:
|
|
651
|
+
var manual_pcb_placement = z37.object({
|
|
652
|
+
selector: z37.string(),
|
|
653
|
+
relative_to: z37.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
643
654
|
center: point2
|
|
644
655
|
});
|
|
645
656
|
expectTypesMatch(true);
|
|
646
657
|
|
|
647
658
|
// lib/manual-edits/manual_trace_hint.ts
|
|
648
|
-
import { z as
|
|
659
|
+
import { z as z38 } from "zod";
|
|
649
660
|
import { route_hint_point as route_hint_point3 } from "circuit-json";
|
|
650
|
-
var manual_trace_hint =
|
|
651
|
-
pcb_port_selector:
|
|
652
|
-
offsets:
|
|
661
|
+
var manual_trace_hint = z38.object({
|
|
662
|
+
pcb_port_selector: z38.string(),
|
|
663
|
+
offsets: z38.array(route_hint_point3)
|
|
653
664
|
});
|
|
654
665
|
expectTypesMatch(true);
|
|
655
666
|
|
|
656
667
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
657
|
-
import { z as
|
|
668
|
+
import { z as z39 } from "zod";
|
|
658
669
|
import { point as point4 } from "circuit-json";
|
|
659
|
-
var manual_schematic_placement =
|
|
660
|
-
selector:
|
|
661
|
-
relative_to:
|
|
670
|
+
var manual_schematic_placement = z39.object({
|
|
671
|
+
selector: z39.string(),
|
|
672
|
+
relative_to: z39.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
662
673
|
center: point4
|
|
663
674
|
});
|
|
664
675
|
expectTypesMatch(
|
|
@@ -666,10 +677,10 @@ expectTypesMatch(
|
|
|
666
677
|
);
|
|
667
678
|
|
|
668
679
|
// lib/manual-edits/manual_edit_file.ts
|
|
669
|
-
var manual_edit_file =
|
|
670
|
-
pcb_placements:
|
|
671
|
-
manual_trace_hints:
|
|
672
|
-
schematic_placements:
|
|
680
|
+
var manual_edit_file = z40.object({
|
|
681
|
+
pcb_placements: z40.array(manual_pcb_placement).optional(),
|
|
682
|
+
manual_trace_hints: z40.array(manual_trace_hint).optional(),
|
|
683
|
+
schematic_placements: z40.array(manual_schematic_placement).optional()
|
|
673
684
|
});
|
|
674
685
|
|
|
675
686
|
// lib/index.ts
|
|
@@ -680,72 +691,72 @@ var inductorPins = lrPins;
|
|
|
680
691
|
var diodeProps = commonComponentProps.extend({});
|
|
681
692
|
var diodePins = lrPolarPins;
|
|
682
693
|
var ledProps = commonComponentProps.extend({
|
|
683
|
-
color:
|
|
694
|
+
color: z41.string().optional()
|
|
684
695
|
});
|
|
685
696
|
var ledPins = lrPolarPins;
|
|
686
697
|
var switchProps = commonComponentProps.extend({
|
|
687
|
-
ftype:
|
|
688
|
-
switchType:
|
|
689
|
-
isNormallyClosed:
|
|
698
|
+
ftype: z41.literal("switch"),
|
|
699
|
+
switchType: z41.enum(["spst"]).default("spst"),
|
|
700
|
+
isNormallyClosed: z41.boolean().default(false)
|
|
690
701
|
});
|
|
691
|
-
var distanceOrMultiplier2 = distance12.or(
|
|
702
|
+
var distanceOrMultiplier2 = distance12.or(z41.enum(["2x", "3x", "4x"]));
|
|
692
703
|
var viaProps = commonLayoutProps.extend({
|
|
693
704
|
fromLayer: layer_ref4,
|
|
694
705
|
toLayer: layer_ref4,
|
|
695
706
|
holeDiameter: distance12,
|
|
696
707
|
outerDiameter: distance12
|
|
697
708
|
});
|
|
698
|
-
var pcbKeepoutProps =
|
|
709
|
+
var pcbKeepoutProps = z41.union([
|
|
699
710
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
700
|
-
shape:
|
|
711
|
+
shape: z41.literal("circle"),
|
|
701
712
|
radius: distance12
|
|
702
713
|
}),
|
|
703
714
|
pcbLayoutProps.extend({
|
|
704
|
-
shape:
|
|
715
|
+
shape: z41.literal("rect"),
|
|
705
716
|
width: distance12,
|
|
706
717
|
height: distance12
|
|
707
718
|
})
|
|
708
719
|
]);
|
|
709
|
-
var schematicBoxProps =
|
|
720
|
+
var schematicBoxProps = z41.object({
|
|
710
721
|
schX: distance12,
|
|
711
722
|
schY: distance12,
|
|
712
723
|
width: distance12,
|
|
713
724
|
height: distance12
|
|
714
725
|
});
|
|
715
|
-
var schematicTextProps =
|
|
726
|
+
var schematicTextProps = z41.object({
|
|
716
727
|
schX: distance12,
|
|
717
728
|
schY: distance12,
|
|
718
|
-
text:
|
|
729
|
+
text: z41.string()
|
|
719
730
|
});
|
|
720
|
-
var schematicLineProps =
|
|
731
|
+
var schematicLineProps = z41.object({
|
|
721
732
|
x1: distance12,
|
|
722
733
|
y1: distance12,
|
|
723
734
|
x2: distance12,
|
|
724
735
|
y2: distance12
|
|
725
736
|
});
|
|
726
|
-
var schematicPathProps =
|
|
727
|
-
points:
|
|
728
|
-
isFilled:
|
|
729
|
-
fillColor:
|
|
737
|
+
var schematicPathProps = z41.object({
|
|
738
|
+
points: z41.array(point5),
|
|
739
|
+
isFilled: z41.boolean().optional().default(false),
|
|
740
|
+
fillColor: z41.enum(["red", "blue"]).optional()
|
|
730
741
|
});
|
|
731
742
|
var componentProps = commonComponentProps;
|
|
732
743
|
var powerSourceProps = commonComponentProps.extend({
|
|
733
744
|
voltage
|
|
734
745
|
});
|
|
735
746
|
var portProps = commonLayoutProps.extend({
|
|
736
|
-
name:
|
|
737
|
-
pinNumber:
|
|
738
|
-
aliases:
|
|
747
|
+
name: z41.string(),
|
|
748
|
+
pinNumber: z41.number().optional(),
|
|
749
|
+
aliases: z41.array(z41.string()).optional(),
|
|
739
750
|
direction
|
|
740
751
|
});
|
|
741
752
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
742
|
-
text:
|
|
743
|
-
anchorAlignment:
|
|
744
|
-
font:
|
|
753
|
+
text: z41.string(),
|
|
754
|
+
anchorAlignment: z41.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
755
|
+
font: z41.enum(["tscircuit2024"]).optional(),
|
|
745
756
|
fontSize: length3.optional()
|
|
746
757
|
});
|
|
747
758
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
748
|
-
route:
|
|
759
|
+
route: z41.array(route_hint_point4),
|
|
749
760
|
strokeWidth: length3.optional()
|
|
750
761
|
});
|
|
751
762
|
var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
@@ -756,49 +767,49 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
|
|
|
756
767
|
y2: distance12
|
|
757
768
|
});
|
|
758
769
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
759
|
-
isFilled:
|
|
760
|
-
isOutline:
|
|
770
|
+
isFilled: z41.boolean().optional(),
|
|
771
|
+
isOutline: z41.boolean().optional(),
|
|
761
772
|
strokeWidth: distance12.optional(),
|
|
762
773
|
width: distance12,
|
|
763
774
|
height: distance12
|
|
764
775
|
});
|
|
765
776
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
766
|
-
isFilled:
|
|
767
|
-
isOutline:
|
|
777
|
+
isFilled: z41.boolean().optional(),
|
|
778
|
+
isOutline: z41.boolean().optional(),
|
|
768
779
|
strokeWidth: distance12.optional(),
|
|
769
780
|
radius: distance12
|
|
770
781
|
});
|
|
771
|
-
var routeHintPointProps =
|
|
782
|
+
var routeHintPointProps = z41.object({
|
|
772
783
|
x: distance12,
|
|
773
784
|
y: distance12,
|
|
774
|
-
via:
|
|
785
|
+
via: z41.boolean().optional(),
|
|
775
786
|
toLayer: layer_ref4.optional()
|
|
776
787
|
});
|
|
777
|
-
var traceHintProps =
|
|
778
|
-
for:
|
|
788
|
+
var traceHintProps = z41.object({
|
|
789
|
+
for: z41.string().optional().describe(
|
|
779
790
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
780
791
|
),
|
|
781
|
-
order:
|
|
792
|
+
order: z41.number().optional(),
|
|
782
793
|
offset: route_hint_point4.or(routeHintPointProps).optional(),
|
|
783
|
-
offsets:
|
|
784
|
-
traceWidth:
|
|
794
|
+
offsets: z41.array(route_hint_point4).or(z41.array(routeHintPointProps)).optional(),
|
|
795
|
+
traceWidth: z41.number().optional()
|
|
785
796
|
});
|
|
786
|
-
var pcbTraceProps =
|
|
787
|
-
layer:
|
|
797
|
+
var pcbTraceProps = z41.object({
|
|
798
|
+
layer: z41.string().optional(),
|
|
788
799
|
thickness: distance12.optional(),
|
|
789
|
-
route:
|
|
800
|
+
route: z41.array(route_hint_point4)
|
|
790
801
|
});
|
|
791
802
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
792
|
-
text:
|
|
793
|
-
anchorAlignment:
|
|
794
|
-
font:
|
|
803
|
+
text: z41.string(),
|
|
804
|
+
anchorAlignment: z41.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
805
|
+
font: z41.enum(["tscircuit2024"]).optional(),
|
|
795
806
|
fontSize: length3.optional(),
|
|
796
|
-
color:
|
|
807
|
+
color: z41.string().optional()
|
|
797
808
|
});
|
|
798
809
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
799
|
-
route:
|
|
810
|
+
route: z41.array(route_hint_point4),
|
|
800
811
|
strokeWidth: length3.optional(),
|
|
801
|
-
color:
|
|
812
|
+
color: z41.string().optional()
|
|
802
813
|
});
|
|
803
814
|
export {
|
|
804
815
|
autorouterConfig,
|
|
@@ -878,6 +889,7 @@ export {
|
|
|
878
889
|
rectSolderPasteProps,
|
|
879
890
|
resistorPins,
|
|
880
891
|
resistorProps,
|
|
892
|
+
resonatorProps,
|
|
881
893
|
rotatedRectSmtPadProps,
|
|
882
894
|
rotationPoint3,
|
|
883
895
|
routeHintPointProps,
|