circuit-json 0.0.127 → 0.0.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/index.d.mts +206 -1
- package/dist/index.mjs +421 -409
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -352,7 +352,7 @@ var source_simple_power_source = source_component_base.extend({
|
|
|
352
352
|
expectTypesMatch(true);
|
|
353
353
|
|
|
354
354
|
// src/source/any_source_component.ts
|
|
355
|
-
import { z as
|
|
355
|
+
import { z as z25 } from "zod";
|
|
356
356
|
|
|
357
357
|
// src/source/source_simple_battery.ts
|
|
358
358
|
import { z as z16 } from "zod";
|
|
@@ -419,8 +419,17 @@ var source_simple_transistor = source_component_base.extend({
|
|
|
419
419
|
});
|
|
420
420
|
expectTypesMatch(true);
|
|
421
421
|
|
|
422
|
+
// src/source/source_simple_mosfet.ts
|
|
423
|
+
import { z as z24 } from "zod";
|
|
424
|
+
var source_simple_mosfet = source_component_base.extend({
|
|
425
|
+
ftype: z24.literal("simple_mosfet"),
|
|
426
|
+
channel_type: z24.enum(["n", "p"]),
|
|
427
|
+
mosfet_mode: z24.enum(["enhancement", "depletion"])
|
|
428
|
+
});
|
|
429
|
+
expectTypesMatch(true);
|
|
430
|
+
|
|
422
431
|
// src/source/any_source_component.ts
|
|
423
|
-
var any_source_component =
|
|
432
|
+
var any_source_component = z25.union([
|
|
424
433
|
source_simple_resistor,
|
|
425
434
|
source_simple_capacitor,
|
|
426
435
|
source_simple_diode,
|
|
@@ -436,61 +445,62 @@ var any_source_component = z24.union([
|
|
|
436
445
|
source_simple_crystal,
|
|
437
446
|
source_simple_pin_header,
|
|
438
447
|
source_simple_resonator,
|
|
439
|
-
source_simple_transistor
|
|
448
|
+
source_simple_transistor,
|
|
449
|
+
source_simple_mosfet
|
|
440
450
|
]);
|
|
441
451
|
|
|
442
452
|
// src/source/source_port.ts
|
|
443
|
-
import { z as
|
|
444
|
-
var source_port =
|
|
445
|
-
type:
|
|
446
|
-
pin_number:
|
|
447
|
-
port_hints:
|
|
448
|
-
name:
|
|
449
|
-
source_port_id:
|
|
450
|
-
source_component_id:
|
|
453
|
+
import { z as z26 } from "zod";
|
|
454
|
+
var source_port = z26.object({
|
|
455
|
+
type: z26.literal("source_port"),
|
|
456
|
+
pin_number: z26.number().optional(),
|
|
457
|
+
port_hints: z26.array(z26.string()).optional(),
|
|
458
|
+
name: z26.string(),
|
|
459
|
+
source_port_id: z26.string(),
|
|
460
|
+
source_component_id: z26.string()
|
|
451
461
|
});
|
|
452
462
|
expectTypesMatch(true);
|
|
453
463
|
|
|
454
464
|
// src/source/source_trace.ts
|
|
455
|
-
import { z as
|
|
456
|
-
var source_trace =
|
|
457
|
-
type:
|
|
458
|
-
source_trace_id:
|
|
459
|
-
connected_source_port_ids:
|
|
460
|
-
connected_source_net_ids:
|
|
461
|
-
subcircuit_connectivity_map_key:
|
|
462
|
-
max_length:
|
|
463
|
-
display_name:
|
|
465
|
+
import { z as z27 } from "zod";
|
|
466
|
+
var source_trace = z27.object({
|
|
467
|
+
type: z27.literal("source_trace"),
|
|
468
|
+
source_trace_id: z27.string(),
|
|
469
|
+
connected_source_port_ids: z27.array(z27.string()),
|
|
470
|
+
connected_source_net_ids: z27.array(z27.string()),
|
|
471
|
+
subcircuit_connectivity_map_key: z27.string().optional(),
|
|
472
|
+
max_length: z27.number().optional(),
|
|
473
|
+
display_name: z27.string().optional()
|
|
464
474
|
});
|
|
465
475
|
expectTypesMatch(true);
|
|
466
476
|
|
|
467
477
|
// src/source/source_group.ts
|
|
468
|
-
import { z as
|
|
469
|
-
var source_group =
|
|
470
|
-
type:
|
|
471
|
-
source_group_id:
|
|
472
|
-
name:
|
|
478
|
+
import { z as z28 } from "zod";
|
|
479
|
+
var source_group = z28.object({
|
|
480
|
+
type: z28.literal("source_group"),
|
|
481
|
+
source_group_id: z28.string(),
|
|
482
|
+
name: z28.string().optional()
|
|
473
483
|
});
|
|
474
484
|
|
|
475
485
|
// src/source/source_net.ts
|
|
476
|
-
import { z as
|
|
477
|
-
var source_net =
|
|
478
|
-
type:
|
|
479
|
-
source_net_id:
|
|
480
|
-
name:
|
|
481
|
-
member_source_group_ids:
|
|
482
|
-
is_power:
|
|
483
|
-
is_ground:
|
|
484
|
-
is_digital_signal:
|
|
485
|
-
is_analog_signal:
|
|
486
|
-
trace_width:
|
|
486
|
+
import { z as z29 } from "zod";
|
|
487
|
+
var source_net = z29.object({
|
|
488
|
+
type: z29.literal("source_net"),
|
|
489
|
+
source_net_id: z29.string(),
|
|
490
|
+
name: z29.string(),
|
|
491
|
+
member_source_group_ids: z29.array(z29.string()),
|
|
492
|
+
is_power: z29.boolean().optional(),
|
|
493
|
+
is_ground: z29.boolean().optional(),
|
|
494
|
+
is_digital_signal: z29.boolean().optional(),
|
|
495
|
+
is_analog_signal: z29.boolean().optional(),
|
|
496
|
+
trace_width: z29.number().optional()
|
|
487
497
|
});
|
|
488
498
|
|
|
489
499
|
// src/schematic/schematic_box.ts
|
|
490
|
-
import { z as
|
|
491
|
-
var schematic_box =
|
|
492
|
-
type:
|
|
493
|
-
schematic_component_id:
|
|
500
|
+
import { z as z30 } from "zod";
|
|
501
|
+
var schematic_box = z30.object({
|
|
502
|
+
type: z30.literal("schematic_box"),
|
|
503
|
+
schematic_component_id: z30.string(),
|
|
494
504
|
width: distance,
|
|
495
505
|
height: distance,
|
|
496
506
|
x: distance,
|
|
@@ -499,82 +509,82 @@ var schematic_box = z29.object({
|
|
|
499
509
|
expectTypesMatch(true);
|
|
500
510
|
|
|
501
511
|
// src/schematic/schematic_path.ts
|
|
502
|
-
import { z as
|
|
503
|
-
var schematic_path =
|
|
504
|
-
type:
|
|
505
|
-
schematic_component_id:
|
|
506
|
-
fill_color:
|
|
507
|
-
is_filled:
|
|
508
|
-
points:
|
|
512
|
+
import { z as z31 } from "zod";
|
|
513
|
+
var schematic_path = z31.object({
|
|
514
|
+
type: z31.literal("schematic_path"),
|
|
515
|
+
schematic_component_id: z31.string(),
|
|
516
|
+
fill_color: z31.enum(["red", "blue"]).optional(),
|
|
517
|
+
is_filled: z31.boolean().optional(),
|
|
518
|
+
points: z31.array(point)
|
|
509
519
|
});
|
|
510
520
|
expectTypesMatch(true);
|
|
511
521
|
|
|
512
522
|
// src/schematic/schematic_component.ts
|
|
513
|
-
import { z as
|
|
514
|
-
var schematic_pin_styles =
|
|
515
|
-
|
|
523
|
+
import { z as z32 } from "zod";
|
|
524
|
+
var schematic_pin_styles = z32.record(
|
|
525
|
+
z32.object({
|
|
516
526
|
left_margin: length.optional(),
|
|
517
527
|
right_margin: length.optional(),
|
|
518
528
|
top_margin: length.optional(),
|
|
519
529
|
bottom_margin: length.optional()
|
|
520
530
|
})
|
|
521
531
|
);
|
|
522
|
-
var schematic_component_port_arrangement_by_size =
|
|
523
|
-
left_size:
|
|
524
|
-
right_size:
|
|
525
|
-
top_size:
|
|
526
|
-
bottom_size:
|
|
532
|
+
var schematic_component_port_arrangement_by_size = z32.object({
|
|
533
|
+
left_size: z32.number(),
|
|
534
|
+
right_size: z32.number(),
|
|
535
|
+
top_size: z32.number().optional(),
|
|
536
|
+
bottom_size: z32.number().optional()
|
|
527
537
|
});
|
|
528
538
|
expectTypesMatch(true);
|
|
529
|
-
var schematic_component_port_arrangement_by_sides =
|
|
530
|
-
left_side:
|
|
531
|
-
pins:
|
|
539
|
+
var schematic_component_port_arrangement_by_sides = z32.object({
|
|
540
|
+
left_side: z32.object({
|
|
541
|
+
pins: z32.array(z32.number()),
|
|
532
542
|
// @ts-ignore
|
|
533
|
-
direction:
|
|
543
|
+
direction: z32.enum(["top-to-bottom", "bottom-to-top"]).optional()
|
|
534
544
|
}).optional(),
|
|
535
|
-
right_side:
|
|
536
|
-
pins:
|
|
545
|
+
right_side: z32.object({
|
|
546
|
+
pins: z32.array(z32.number()),
|
|
537
547
|
// @ts-ignore
|
|
538
|
-
direction:
|
|
548
|
+
direction: z32.enum(["top-to-bottom", "bottom-to-top"]).optional()
|
|
539
549
|
}).optional(),
|
|
540
|
-
top_side:
|
|
541
|
-
pins:
|
|
550
|
+
top_side: z32.object({
|
|
551
|
+
pins: z32.array(z32.number()),
|
|
542
552
|
// @ts-ignore
|
|
543
|
-
direction:
|
|
553
|
+
direction: z32.enum(["left-to-right", "right-to-left"]).optional()
|
|
544
554
|
}).optional(),
|
|
545
|
-
bottom_side:
|
|
546
|
-
pins:
|
|
555
|
+
bottom_side: z32.object({
|
|
556
|
+
pins: z32.array(z32.number()),
|
|
547
557
|
// @ts-ignore
|
|
548
|
-
direction:
|
|
558
|
+
direction: z32.enum(["left-to-right", "right-to-left"]).optional()
|
|
549
559
|
}).optional()
|
|
550
560
|
});
|
|
551
561
|
expectTypesMatch(true);
|
|
552
|
-
var port_arrangement =
|
|
562
|
+
var port_arrangement = z32.union([
|
|
553
563
|
schematic_component_port_arrangement_by_size,
|
|
554
564
|
schematic_component_port_arrangement_by_sides
|
|
555
565
|
]);
|
|
556
|
-
var schematic_component =
|
|
557
|
-
type:
|
|
566
|
+
var schematic_component = z32.object({
|
|
567
|
+
type: z32.literal("schematic_component"),
|
|
558
568
|
rotation: rotation.default(0),
|
|
559
569
|
size,
|
|
560
570
|
center: point,
|
|
561
|
-
source_component_id:
|
|
562
|
-
schematic_component_id:
|
|
571
|
+
source_component_id: z32.string(),
|
|
572
|
+
schematic_component_id: z32.string(),
|
|
563
573
|
pin_spacing: length.optional(),
|
|
564
574
|
pin_styles: schematic_pin_styles.optional(),
|
|
565
575
|
box_width: length.optional(),
|
|
566
|
-
symbol_name:
|
|
576
|
+
symbol_name: z32.string().optional(),
|
|
567
577
|
port_arrangement: port_arrangement.optional(),
|
|
568
|
-
port_labels:
|
|
569
|
-
symbol_display_value:
|
|
578
|
+
port_labels: z32.record(z32.string()).optional(),
|
|
579
|
+
symbol_display_value: z32.string().optional()
|
|
570
580
|
});
|
|
571
581
|
expectTypesMatch(true);
|
|
572
582
|
|
|
573
583
|
// src/schematic/schematic_line.ts
|
|
574
|
-
import { z as
|
|
575
|
-
var schematic_line =
|
|
576
|
-
type:
|
|
577
|
-
schematic_component_id:
|
|
584
|
+
import { z as z33 } from "zod";
|
|
585
|
+
var schematic_line = z33.object({
|
|
586
|
+
type: z33.literal("schematic_line"),
|
|
587
|
+
schematic_component_id: z33.string(),
|
|
578
588
|
x1: distance,
|
|
579
589
|
x2: distance,
|
|
580
590
|
y1: distance,
|
|
@@ -583,113 +593,113 @@ var schematic_line = z32.object({
|
|
|
583
593
|
expectTypesMatch(true);
|
|
584
594
|
|
|
585
595
|
// src/schematic/schematic_trace.ts
|
|
586
|
-
import { z as
|
|
587
|
-
var schematic_trace =
|
|
588
|
-
type:
|
|
589
|
-
schematic_trace_id:
|
|
590
|
-
source_trace_id:
|
|
591
|
-
junctions:
|
|
592
|
-
|
|
593
|
-
x:
|
|
594
|
-
y:
|
|
596
|
+
import { z as z34 } from "zod";
|
|
597
|
+
var schematic_trace = z34.object({
|
|
598
|
+
type: z34.literal("schematic_trace"),
|
|
599
|
+
schematic_trace_id: z34.string(),
|
|
600
|
+
source_trace_id: z34.string(),
|
|
601
|
+
junctions: z34.array(
|
|
602
|
+
z34.object({
|
|
603
|
+
x: z34.number(),
|
|
604
|
+
y: z34.number()
|
|
595
605
|
})
|
|
596
606
|
),
|
|
597
|
-
edges:
|
|
598
|
-
|
|
599
|
-
from:
|
|
600
|
-
x:
|
|
601
|
-
y:
|
|
607
|
+
edges: z34.array(
|
|
608
|
+
z34.object({
|
|
609
|
+
from: z34.object({
|
|
610
|
+
x: z34.number(),
|
|
611
|
+
y: z34.number()
|
|
602
612
|
}),
|
|
603
|
-
to:
|
|
604
|
-
x:
|
|
605
|
-
y:
|
|
613
|
+
to: z34.object({
|
|
614
|
+
x: z34.number(),
|
|
615
|
+
y: z34.number()
|
|
606
616
|
}),
|
|
607
|
-
is_crossing:
|
|
608
|
-
from_schematic_port_id:
|
|
609
|
-
to_schematic_port_id:
|
|
617
|
+
is_crossing: z34.boolean().optional(),
|
|
618
|
+
from_schematic_port_id: z34.string().optional(),
|
|
619
|
+
to_schematic_port_id: z34.string().optional()
|
|
610
620
|
})
|
|
611
621
|
)
|
|
612
622
|
});
|
|
613
623
|
expectTypesMatch(true);
|
|
614
624
|
|
|
615
625
|
// src/schematic/schematic_text.ts
|
|
616
|
-
import { z as
|
|
617
|
-
var schematic_text =
|
|
618
|
-
type:
|
|
619
|
-
schematic_component_id:
|
|
620
|
-
schematic_text_id:
|
|
621
|
-
text:
|
|
622
|
-
position:
|
|
626
|
+
import { z as z35 } from "zod";
|
|
627
|
+
var schematic_text = z35.object({
|
|
628
|
+
type: z35.literal("schematic_text"),
|
|
629
|
+
schematic_component_id: z35.string(),
|
|
630
|
+
schematic_text_id: z35.string(),
|
|
631
|
+
text: z35.string(),
|
|
632
|
+
position: z35.object({
|
|
623
633
|
x: distance,
|
|
624
634
|
y: distance
|
|
625
635
|
}),
|
|
626
|
-
rotation:
|
|
627
|
-
anchor:
|
|
628
|
-
color:
|
|
636
|
+
rotation: z35.number().default(0),
|
|
637
|
+
anchor: z35.enum(["center", "left", "right", "top", "bottom"]).default("center"),
|
|
638
|
+
color: z35.string().default("#000000")
|
|
629
639
|
});
|
|
630
640
|
expectTypesMatch(true);
|
|
631
641
|
|
|
632
642
|
// src/schematic/schematic_port.ts
|
|
633
|
-
import { z as
|
|
634
|
-
var schematic_port =
|
|
635
|
-
type:
|
|
636
|
-
schematic_port_id:
|
|
637
|
-
source_port_id:
|
|
638
|
-
schematic_component_id:
|
|
643
|
+
import { z as z36 } from "zod";
|
|
644
|
+
var schematic_port = z36.object({
|
|
645
|
+
type: z36.literal("schematic_port"),
|
|
646
|
+
schematic_port_id: z36.string(),
|
|
647
|
+
source_port_id: z36.string(),
|
|
648
|
+
schematic_component_id: z36.string().optional(),
|
|
639
649
|
center: point,
|
|
640
|
-
facing_direction:
|
|
641
|
-
distance_from_component_edge:
|
|
642
|
-
side_of_component:
|
|
643
|
-
true_ccw_index:
|
|
644
|
-
pin_number:
|
|
645
|
-
display_pin_label:
|
|
650
|
+
facing_direction: z36.enum(["up", "down", "left", "right"]).optional(),
|
|
651
|
+
distance_from_component_edge: z36.number().optional(),
|
|
652
|
+
side_of_component: z36.enum(["top", "bottom", "left", "right"]).optional(),
|
|
653
|
+
true_ccw_index: z36.number().optional(),
|
|
654
|
+
pin_number: z36.number().optional(),
|
|
655
|
+
display_pin_label: z36.string().optional()
|
|
646
656
|
}).describe("Defines a port on a schematic component");
|
|
647
657
|
expectTypesMatch(true);
|
|
648
658
|
|
|
649
659
|
// src/schematic/schematic_net_label.ts
|
|
650
|
-
import { z as
|
|
651
|
-
var schematic_net_label =
|
|
652
|
-
type:
|
|
653
|
-
source_net_id:
|
|
660
|
+
import { z as z37 } from "zod";
|
|
661
|
+
var schematic_net_label = z37.object({
|
|
662
|
+
type: z37.literal("schematic_net_label"),
|
|
663
|
+
source_net_id: z37.string(),
|
|
654
664
|
center: point,
|
|
655
665
|
anchor_position: point.optional(),
|
|
656
|
-
anchor_side:
|
|
657
|
-
text:
|
|
658
|
-
symbol_name:
|
|
666
|
+
anchor_side: z37.enum(["top", "bottom", "left", "right"]),
|
|
667
|
+
text: z37.string(),
|
|
668
|
+
symbol_name: z37.string().optional()
|
|
659
669
|
});
|
|
660
670
|
|
|
661
671
|
// src/schematic/schematic_error.ts
|
|
662
|
-
import { z as
|
|
663
|
-
var schematic_error =
|
|
664
|
-
type:
|
|
665
|
-
schematic_error_id:
|
|
672
|
+
import { z as z38 } from "zod";
|
|
673
|
+
var schematic_error = z38.object({
|
|
674
|
+
type: z38.literal("schematic_error"),
|
|
675
|
+
schematic_error_id: z38.string(),
|
|
666
676
|
// eventually each error type should be broken out into a dir of files
|
|
667
|
-
error_type:
|
|
668
|
-
message:
|
|
677
|
+
error_type: z38.literal("schematic_port_not_found"),
|
|
678
|
+
message: z38.string()
|
|
669
679
|
}).describe("Defines a schematic error on the schematic");
|
|
670
680
|
expectTypesMatch(true);
|
|
671
681
|
|
|
672
682
|
// src/schematic/schematic_debug_object.ts
|
|
673
|
-
import { z as
|
|
674
|
-
var schematic_debug_object_base =
|
|
675
|
-
type:
|
|
676
|
-
label:
|
|
683
|
+
import { z as z39 } from "zod";
|
|
684
|
+
var schematic_debug_object_base = z39.object({
|
|
685
|
+
type: z39.literal("schematic_debug_object"),
|
|
686
|
+
label: z39.string().optional()
|
|
677
687
|
});
|
|
678
688
|
var schematic_debug_rect = schematic_debug_object_base.extend({
|
|
679
|
-
shape:
|
|
689
|
+
shape: z39.literal("rect"),
|
|
680
690
|
center: point,
|
|
681
691
|
size
|
|
682
692
|
});
|
|
683
693
|
var schematic_debug_line = schematic_debug_object_base.extend({
|
|
684
|
-
shape:
|
|
694
|
+
shape: z39.literal("line"),
|
|
685
695
|
start: point,
|
|
686
696
|
end: point
|
|
687
697
|
});
|
|
688
698
|
var schematic_debug_point = schematic_debug_object_base.extend({
|
|
689
|
-
shape:
|
|
699
|
+
shape: z39.literal("point"),
|
|
690
700
|
center: point
|
|
691
701
|
});
|
|
692
|
-
var schematic_debug_object =
|
|
702
|
+
var schematic_debug_object = z39.discriminatedUnion("shape", [
|
|
693
703
|
schematic_debug_rect,
|
|
694
704
|
schematic_debug_line,
|
|
695
705
|
schematic_debug_point
|
|
@@ -697,18 +707,18 @@ var schematic_debug_object = z38.discriminatedUnion("shape", [
|
|
|
697
707
|
expectTypesMatch(true);
|
|
698
708
|
|
|
699
709
|
// src/schematic/schematic_voltage_probe.ts
|
|
700
|
-
import { z as
|
|
701
|
-
var schematic_voltage_probe =
|
|
702
|
-
type:
|
|
703
|
-
schematic_voltage_probe_id:
|
|
710
|
+
import { z as z40 } from "zod";
|
|
711
|
+
var schematic_voltage_probe = z40.object({
|
|
712
|
+
type: z40.literal("schematic_voltage_probe"),
|
|
713
|
+
schematic_voltage_probe_id: z40.string(),
|
|
704
714
|
position: point,
|
|
705
|
-
schematic_trace_id:
|
|
715
|
+
schematic_trace_id: z40.string(),
|
|
706
716
|
voltage: voltage.optional()
|
|
707
717
|
}).describe("Defines a voltage probe measurement point on a schematic trace");
|
|
708
718
|
expectTypesMatch(true);
|
|
709
719
|
|
|
710
720
|
// src/pcb/properties/layer_ref.ts
|
|
711
|
-
import { z as
|
|
721
|
+
import { z as z41 } from "zod";
|
|
712
722
|
var all_layers = [
|
|
713
723
|
"top",
|
|
714
724
|
"bottom",
|
|
@@ -719,9 +729,9 @@ var all_layers = [
|
|
|
719
729
|
"inner5",
|
|
720
730
|
"inner6"
|
|
721
731
|
];
|
|
722
|
-
var layer_string =
|
|
732
|
+
var layer_string = z41.enum(all_layers);
|
|
723
733
|
var layer_ref = layer_string.or(
|
|
724
|
-
|
|
734
|
+
z41.object({
|
|
725
735
|
name: layer_string
|
|
726
736
|
})
|
|
727
737
|
).transform((layer) => {
|
|
@@ -730,34 +740,34 @@ var layer_ref = layer_string.or(
|
|
|
730
740
|
}
|
|
731
741
|
return layer.name;
|
|
732
742
|
});
|
|
733
|
-
var visible_layer =
|
|
743
|
+
var visible_layer = z41.enum(["top", "bottom"]);
|
|
734
744
|
|
|
735
745
|
// src/pcb/properties/pcb_route_hints.ts
|
|
736
|
-
import { z as
|
|
737
|
-
var pcb_route_hint =
|
|
746
|
+
import { z as z42 } from "zod";
|
|
747
|
+
var pcb_route_hint = z42.object({
|
|
738
748
|
x: distance,
|
|
739
749
|
y: distance,
|
|
740
|
-
via:
|
|
750
|
+
via: z42.boolean().optional(),
|
|
741
751
|
via_to_layer: layer_ref.optional()
|
|
742
752
|
});
|
|
743
|
-
var pcb_route_hints =
|
|
753
|
+
var pcb_route_hints = z42.array(pcb_route_hint);
|
|
744
754
|
|
|
745
755
|
// src/pcb/properties/route_hint_point.ts
|
|
746
|
-
import { z as
|
|
747
|
-
var route_hint_point =
|
|
756
|
+
import { z as z43 } from "zod";
|
|
757
|
+
var route_hint_point = z43.object({
|
|
748
758
|
x: distance,
|
|
749
759
|
y: distance,
|
|
750
|
-
via:
|
|
760
|
+
via: z43.boolean().optional(),
|
|
751
761
|
to_layer: layer_ref.optional(),
|
|
752
762
|
trace_width: distance.optional()
|
|
753
763
|
});
|
|
754
764
|
|
|
755
765
|
// src/pcb/pcb_component.ts
|
|
756
|
-
import { z as
|
|
757
|
-
var pcb_component =
|
|
758
|
-
type:
|
|
766
|
+
import { z as z44 } from "zod";
|
|
767
|
+
var pcb_component = z44.object({
|
|
768
|
+
type: z44.literal("pcb_component"),
|
|
759
769
|
pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
|
|
760
|
-
source_component_id:
|
|
770
|
+
source_component_id: z44.string(),
|
|
761
771
|
center: point,
|
|
762
772
|
layer: layer_ref,
|
|
763
773
|
rotation,
|
|
@@ -767,12 +777,12 @@ var pcb_component = z43.object({
|
|
|
767
777
|
expectTypesMatch(true);
|
|
768
778
|
|
|
769
779
|
// src/pcb/pcb_hole.ts
|
|
770
|
-
import { z as
|
|
771
|
-
var pcb_hole_circle_or_square =
|
|
772
|
-
type:
|
|
780
|
+
import { z as z45 } from "zod";
|
|
781
|
+
var pcb_hole_circle_or_square = z45.object({
|
|
782
|
+
type: z45.literal("pcb_hole"),
|
|
773
783
|
pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
|
|
774
|
-
hole_shape:
|
|
775
|
-
hole_diameter:
|
|
784
|
+
hole_shape: z45.enum(["circle", "square"]),
|
|
785
|
+
hole_diameter: z45.number(),
|
|
776
786
|
x: distance,
|
|
777
787
|
y: distance
|
|
778
788
|
});
|
|
@@ -780,12 +790,12 @@ var pcb_hole_circle_or_square_shape = pcb_hole_circle_or_square.describe(
|
|
|
780
790
|
"Defines a circular or square hole on the PCB"
|
|
781
791
|
);
|
|
782
792
|
expectTypesMatch(true);
|
|
783
|
-
var pcb_hole_oval =
|
|
784
|
-
type:
|
|
793
|
+
var pcb_hole_oval = z45.object({
|
|
794
|
+
type: z45.literal("pcb_hole"),
|
|
785
795
|
pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
|
|
786
|
-
hole_shape:
|
|
787
|
-
hole_width:
|
|
788
|
-
hole_height:
|
|
796
|
+
hole_shape: z45.literal("oval"),
|
|
797
|
+
hole_width: z45.number(),
|
|
798
|
+
hole_height: z45.number(),
|
|
789
799
|
x: distance,
|
|
790
800
|
y: distance
|
|
791
801
|
});
|
|
@@ -796,52 +806,52 @@ expectTypesMatch(true);
|
|
|
796
806
|
var pcb_hole = pcb_hole_circle_or_square.or(pcb_hole_oval);
|
|
797
807
|
|
|
798
808
|
// src/pcb/pcb_plated_hole.ts
|
|
799
|
-
import { z as
|
|
800
|
-
var pcb_plated_hole_circle =
|
|
801
|
-
type:
|
|
802
|
-
shape:
|
|
803
|
-
outer_diameter:
|
|
804
|
-
hole_diameter:
|
|
809
|
+
import { z as z46 } from "zod";
|
|
810
|
+
var pcb_plated_hole_circle = z46.object({
|
|
811
|
+
type: z46.literal("pcb_plated_hole"),
|
|
812
|
+
shape: z46.literal("circle"),
|
|
813
|
+
outer_diameter: z46.number(),
|
|
814
|
+
hole_diameter: z46.number(),
|
|
805
815
|
x: distance,
|
|
806
816
|
y: distance,
|
|
807
|
-
layers:
|
|
808
|
-
port_hints:
|
|
809
|
-
pcb_component_id:
|
|
810
|
-
pcb_port_id:
|
|
817
|
+
layers: z46.array(layer_ref),
|
|
818
|
+
port_hints: z46.array(z46.string()).optional(),
|
|
819
|
+
pcb_component_id: z46.string().optional(),
|
|
820
|
+
pcb_port_id: z46.string().optional(),
|
|
811
821
|
pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
|
|
812
822
|
});
|
|
813
|
-
var pcb_plated_hole_oval =
|
|
814
|
-
type:
|
|
815
|
-
shape:
|
|
816
|
-
outer_width:
|
|
817
|
-
outer_height:
|
|
818
|
-
hole_width:
|
|
819
|
-
hole_height:
|
|
823
|
+
var pcb_plated_hole_oval = z46.object({
|
|
824
|
+
type: z46.literal("pcb_plated_hole"),
|
|
825
|
+
shape: z46.enum(["oval", "pill"]),
|
|
826
|
+
outer_width: z46.number(),
|
|
827
|
+
outer_height: z46.number(),
|
|
828
|
+
hole_width: z46.number(),
|
|
829
|
+
hole_height: z46.number(),
|
|
820
830
|
x: distance,
|
|
821
831
|
y: distance,
|
|
822
|
-
layers:
|
|
823
|
-
port_hints:
|
|
824
|
-
pcb_component_id:
|
|
825
|
-
pcb_port_id:
|
|
832
|
+
layers: z46.array(layer_ref),
|
|
833
|
+
port_hints: z46.array(z46.string()).optional(),
|
|
834
|
+
pcb_component_id: z46.string().optional(),
|
|
835
|
+
pcb_port_id: z46.string().optional(),
|
|
826
836
|
pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
|
|
827
837
|
});
|
|
828
|
-
var pcb_circular_hole_with_rect_pad =
|
|
829
|
-
type:
|
|
830
|
-
shape:
|
|
831
|
-
hole_shape:
|
|
832
|
-
pad_shape:
|
|
833
|
-
hole_diameter:
|
|
834
|
-
rect_pad_width:
|
|
835
|
-
rect_pad_height:
|
|
838
|
+
var pcb_circular_hole_with_rect_pad = z46.object({
|
|
839
|
+
type: z46.literal("pcb_plated_hole"),
|
|
840
|
+
shape: z46.literal("circular_hole_with_rect_pad"),
|
|
841
|
+
hole_shape: z46.literal("circle"),
|
|
842
|
+
pad_shape: z46.literal("rect"),
|
|
843
|
+
hole_diameter: z46.number(),
|
|
844
|
+
rect_pad_width: z46.number(),
|
|
845
|
+
rect_pad_height: z46.number(),
|
|
836
846
|
x: distance,
|
|
837
847
|
y: distance,
|
|
838
|
-
layers:
|
|
839
|
-
port_hints:
|
|
840
|
-
pcb_component_id:
|
|
841
|
-
pcb_port_id:
|
|
848
|
+
layers: z46.array(layer_ref),
|
|
849
|
+
port_hints: z46.array(z46.string()).optional(),
|
|
850
|
+
pcb_component_id: z46.string().optional(),
|
|
851
|
+
pcb_port_id: z46.string().optional(),
|
|
842
852
|
pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
|
|
843
853
|
});
|
|
844
|
-
var pcb_plated_hole =
|
|
854
|
+
var pcb_plated_hole = z46.union([
|
|
845
855
|
pcb_plated_hole_circle,
|
|
846
856
|
pcb_plated_hole_oval,
|
|
847
857
|
pcb_circular_hole_with_rect_pad
|
|
@@ -853,157 +863,157 @@ expectTypesMatch(true);
|
|
|
853
863
|
expectTypesMatch(true);
|
|
854
864
|
|
|
855
865
|
// src/pcb/pcb_port.ts
|
|
856
|
-
import { z as
|
|
857
|
-
var pcb_port =
|
|
858
|
-
type:
|
|
866
|
+
import { z as z47 } from "zod";
|
|
867
|
+
var pcb_port = z47.object({
|
|
868
|
+
type: z47.literal("pcb_port"),
|
|
859
869
|
pcb_port_id: getZodPrefixedIdWithDefault("pcb_port"),
|
|
860
|
-
source_port_id:
|
|
861
|
-
pcb_component_id:
|
|
870
|
+
source_port_id: z47.string(),
|
|
871
|
+
pcb_component_id: z47.string(),
|
|
862
872
|
x: distance,
|
|
863
873
|
y: distance,
|
|
864
|
-
layers:
|
|
874
|
+
layers: z47.array(layer_ref)
|
|
865
875
|
}).describe("Defines a port on the PCB");
|
|
866
876
|
expectTypesMatch(true);
|
|
867
877
|
|
|
868
878
|
// src/pcb/pcb_smtpad.ts
|
|
869
|
-
import { z as
|
|
870
|
-
var pcb_smtpad_circle =
|
|
871
|
-
type:
|
|
872
|
-
shape:
|
|
879
|
+
import { z as z48 } from "zod";
|
|
880
|
+
var pcb_smtpad_circle = z48.object({
|
|
881
|
+
type: z48.literal("pcb_smtpad"),
|
|
882
|
+
shape: z48.literal("circle"),
|
|
873
883
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
874
884
|
x: distance,
|
|
875
885
|
y: distance,
|
|
876
|
-
radius:
|
|
886
|
+
radius: z48.number(),
|
|
877
887
|
layer: layer_ref,
|
|
878
|
-
port_hints:
|
|
879
|
-
pcb_component_id:
|
|
880
|
-
pcb_port_id:
|
|
888
|
+
port_hints: z48.array(z48.string()).optional(),
|
|
889
|
+
pcb_component_id: z48.string().optional(),
|
|
890
|
+
pcb_port_id: z48.string().optional()
|
|
881
891
|
});
|
|
882
|
-
var pcb_smtpad_rect =
|
|
883
|
-
type:
|
|
884
|
-
shape:
|
|
892
|
+
var pcb_smtpad_rect = z48.object({
|
|
893
|
+
type: z48.literal("pcb_smtpad"),
|
|
894
|
+
shape: z48.literal("rect"),
|
|
885
895
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
886
896
|
x: distance,
|
|
887
897
|
y: distance,
|
|
888
|
-
width:
|
|
889
|
-
height:
|
|
898
|
+
width: z48.number(),
|
|
899
|
+
height: z48.number(),
|
|
890
900
|
layer: layer_ref,
|
|
891
|
-
port_hints:
|
|
892
|
-
pcb_component_id:
|
|
893
|
-
pcb_port_id:
|
|
901
|
+
port_hints: z48.array(z48.string()).optional(),
|
|
902
|
+
pcb_component_id: z48.string().optional(),
|
|
903
|
+
pcb_port_id: z48.string().optional()
|
|
894
904
|
});
|
|
895
|
-
var pcb_smtpad_rotated_rect =
|
|
896
|
-
type:
|
|
897
|
-
shape:
|
|
905
|
+
var pcb_smtpad_rotated_rect = z48.object({
|
|
906
|
+
type: z48.literal("pcb_smtpad"),
|
|
907
|
+
shape: z48.literal("rotated_rect"),
|
|
898
908
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
899
909
|
x: distance,
|
|
900
910
|
y: distance,
|
|
901
|
-
width:
|
|
902
|
-
height:
|
|
911
|
+
width: z48.number(),
|
|
912
|
+
height: z48.number(),
|
|
903
913
|
ccw_rotation: rotation,
|
|
904
914
|
layer: layer_ref,
|
|
905
|
-
port_hints:
|
|
906
|
-
pcb_component_id:
|
|
907
|
-
pcb_port_id:
|
|
915
|
+
port_hints: z48.array(z48.string()).optional(),
|
|
916
|
+
pcb_component_id: z48.string().optional(),
|
|
917
|
+
pcb_port_id: z48.string().optional()
|
|
908
918
|
});
|
|
909
|
-
var pcb_smtpad =
|
|
919
|
+
var pcb_smtpad = z48.union([pcb_smtpad_circle, pcb_smtpad_rect, pcb_smtpad_rotated_rect]).describe("Defines an SMT pad on the PCB");
|
|
910
920
|
expectTypesMatch(true);
|
|
911
921
|
expectTypesMatch(true);
|
|
912
922
|
expectTypesMatch(true);
|
|
913
923
|
|
|
914
924
|
// src/pcb/pcb_solder_paste.ts
|
|
915
|
-
import { z as
|
|
916
|
-
var pcb_solder_paste_circle =
|
|
917
|
-
type:
|
|
918
|
-
shape:
|
|
925
|
+
import { z as z49 } from "zod";
|
|
926
|
+
var pcb_solder_paste_circle = z49.object({
|
|
927
|
+
type: z49.literal("pcb_solder_paste"),
|
|
928
|
+
shape: z49.literal("circle"),
|
|
919
929
|
pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
|
|
920
930
|
x: distance,
|
|
921
931
|
y: distance,
|
|
922
|
-
radius:
|
|
932
|
+
radius: z49.number(),
|
|
923
933
|
layer: layer_ref,
|
|
924
|
-
pcb_component_id:
|
|
925
|
-
pcb_smtpad_id:
|
|
934
|
+
pcb_component_id: z49.string().optional(),
|
|
935
|
+
pcb_smtpad_id: z49.string().optional()
|
|
926
936
|
});
|
|
927
|
-
var pcb_solder_paste_rect =
|
|
928
|
-
type:
|
|
929
|
-
shape:
|
|
937
|
+
var pcb_solder_paste_rect = z49.object({
|
|
938
|
+
type: z49.literal("pcb_solder_paste"),
|
|
939
|
+
shape: z49.literal("rect"),
|
|
930
940
|
pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
|
|
931
941
|
x: distance,
|
|
932
942
|
y: distance,
|
|
933
|
-
width:
|
|
934
|
-
height:
|
|
943
|
+
width: z49.number(),
|
|
944
|
+
height: z49.number(),
|
|
935
945
|
layer: layer_ref,
|
|
936
|
-
pcb_component_id:
|
|
937
|
-
pcb_smtpad_id:
|
|
946
|
+
pcb_component_id: z49.string().optional(),
|
|
947
|
+
pcb_smtpad_id: z49.string().optional()
|
|
938
948
|
});
|
|
939
|
-
var pcb_solder_paste =
|
|
949
|
+
var pcb_solder_paste = z49.union([pcb_solder_paste_circle, pcb_solder_paste_rect]).describe("Defines solderpaste on the PCB");
|
|
940
950
|
expectTypesMatch(true);
|
|
941
951
|
expectTypesMatch(true);
|
|
942
952
|
|
|
943
953
|
// src/pcb/pcb_text.ts
|
|
944
|
-
import { z as
|
|
945
|
-
var pcb_text =
|
|
946
|
-
type:
|
|
954
|
+
import { z as z50 } from "zod";
|
|
955
|
+
var pcb_text = z50.object({
|
|
956
|
+
type: z50.literal("pcb_text"),
|
|
947
957
|
pcb_text_id: getZodPrefixedIdWithDefault("pcb_text"),
|
|
948
|
-
text:
|
|
958
|
+
text: z50.string(),
|
|
949
959
|
center: point,
|
|
950
960
|
layer: layer_ref,
|
|
951
961
|
width: length,
|
|
952
962
|
height: length,
|
|
953
|
-
lines:
|
|
963
|
+
lines: z50.number(),
|
|
954
964
|
// @ts-ignore
|
|
955
|
-
align:
|
|
965
|
+
align: z50.enum(["bottom-left"])
|
|
956
966
|
}).describe("Defines text on the PCB");
|
|
957
967
|
expectTypesMatch(true);
|
|
958
968
|
|
|
959
969
|
// src/pcb/pcb_trace.ts
|
|
960
|
-
import { z as
|
|
961
|
-
var pcb_trace_route_point_wire =
|
|
962
|
-
route_type:
|
|
970
|
+
import { z as z51 } from "zod";
|
|
971
|
+
var pcb_trace_route_point_wire = z51.object({
|
|
972
|
+
route_type: z51.literal("wire"),
|
|
963
973
|
x: distance,
|
|
964
974
|
y: distance,
|
|
965
975
|
width: distance,
|
|
966
|
-
start_pcb_port_id:
|
|
967
|
-
end_pcb_port_id:
|
|
976
|
+
start_pcb_port_id: z51.string().optional(),
|
|
977
|
+
end_pcb_port_id: z51.string().optional(),
|
|
968
978
|
layer: layer_ref
|
|
969
979
|
});
|
|
970
|
-
var pcb_trace_route_point_via =
|
|
971
|
-
route_type:
|
|
980
|
+
var pcb_trace_route_point_via = z51.object({
|
|
981
|
+
route_type: z51.literal("via"),
|
|
972
982
|
x: distance,
|
|
973
983
|
y: distance,
|
|
974
|
-
from_layer:
|
|
975
|
-
to_layer:
|
|
984
|
+
from_layer: z51.string(),
|
|
985
|
+
to_layer: z51.string()
|
|
976
986
|
});
|
|
977
|
-
var pcb_trace_route_point =
|
|
987
|
+
var pcb_trace_route_point = z51.union([
|
|
978
988
|
pcb_trace_route_point_wire,
|
|
979
989
|
pcb_trace_route_point_via
|
|
980
990
|
]);
|
|
981
|
-
var pcb_trace =
|
|
982
|
-
type:
|
|
983
|
-
source_trace_id:
|
|
984
|
-
pcb_component_id:
|
|
991
|
+
var pcb_trace = z51.object({
|
|
992
|
+
type: z51.literal("pcb_trace"),
|
|
993
|
+
source_trace_id: z51.string().optional(),
|
|
994
|
+
pcb_component_id: z51.string().optional(),
|
|
985
995
|
pcb_trace_id: getZodPrefixedIdWithDefault("pcb_trace"),
|
|
986
|
-
route_thickness_mode:
|
|
987
|
-
route_order_index:
|
|
988
|
-
should_round_corners:
|
|
989
|
-
trace_length:
|
|
990
|
-
route:
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
route_type:
|
|
996
|
+
route_thickness_mode: z51.enum(["constant", "interpolated"]).default("constant").optional(),
|
|
997
|
+
route_order_index: z51.number().optional(),
|
|
998
|
+
should_round_corners: z51.boolean().optional(),
|
|
999
|
+
trace_length: z51.number().optional(),
|
|
1000
|
+
route: z51.array(
|
|
1001
|
+
z51.union([
|
|
1002
|
+
z51.object({
|
|
1003
|
+
route_type: z51.literal("wire"),
|
|
994
1004
|
x: distance,
|
|
995
1005
|
y: distance,
|
|
996
1006
|
width: distance,
|
|
997
|
-
start_pcb_port_id:
|
|
998
|
-
end_pcb_port_id:
|
|
1007
|
+
start_pcb_port_id: z51.string().optional(),
|
|
1008
|
+
end_pcb_port_id: z51.string().optional(),
|
|
999
1009
|
layer: layer_ref
|
|
1000
1010
|
}),
|
|
1001
|
-
|
|
1002
|
-
route_type:
|
|
1011
|
+
z51.object({
|
|
1012
|
+
route_type: z51.literal("via"),
|
|
1003
1013
|
x: distance,
|
|
1004
1014
|
y: distance,
|
|
1005
|
-
from_layer:
|
|
1006
|
-
to_layer:
|
|
1015
|
+
from_layer: z51.string(),
|
|
1016
|
+
to_layer: z51.string()
|
|
1007
1017
|
})
|
|
1008
1018
|
])
|
|
1009
1019
|
)
|
|
@@ -1012,34 +1022,34 @@ expectTypesMatch(true);
|
|
|
1012
1022
|
expectTypesMatch(true);
|
|
1013
1023
|
|
|
1014
1024
|
// src/pcb/pcb_trace_error.ts
|
|
1015
|
-
import { z as
|
|
1016
|
-
var pcb_trace_error =
|
|
1017
|
-
type:
|
|
1025
|
+
import { z as z52 } from "zod";
|
|
1026
|
+
var pcb_trace_error = z52.object({
|
|
1027
|
+
type: z52.literal("pcb_trace_error"),
|
|
1018
1028
|
pcb_trace_error_id: getZodPrefixedIdWithDefault("pcb_trace_error"),
|
|
1019
|
-
error_type:
|
|
1020
|
-
message:
|
|
1029
|
+
error_type: z52.literal("pcb_trace_error"),
|
|
1030
|
+
message: z52.string(),
|
|
1021
1031
|
center: point.optional(),
|
|
1022
|
-
pcb_trace_id:
|
|
1023
|
-
source_trace_id:
|
|
1024
|
-
pcb_component_ids:
|
|
1025
|
-
pcb_port_ids:
|
|
1032
|
+
pcb_trace_id: z52.string(),
|
|
1033
|
+
source_trace_id: z52.string(),
|
|
1034
|
+
pcb_component_ids: z52.array(z52.string()),
|
|
1035
|
+
pcb_port_ids: z52.array(z52.string())
|
|
1026
1036
|
}).describe("Defines a trace error on the PCB");
|
|
1027
1037
|
expectTypesMatch(true);
|
|
1028
1038
|
|
|
1029
1039
|
// src/pcb/pcb_port_not_matched_error.ts
|
|
1030
|
-
import { z as
|
|
1031
|
-
var pcb_port_not_matched_error =
|
|
1032
|
-
type:
|
|
1040
|
+
import { z as z53 } from "zod";
|
|
1041
|
+
var pcb_port_not_matched_error = z53.object({
|
|
1042
|
+
type: z53.literal("pcb_port_not_matched_error"),
|
|
1033
1043
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
1034
|
-
message:
|
|
1035
|
-
pcb_component_ids:
|
|
1044
|
+
message: z53.string(),
|
|
1045
|
+
pcb_component_ids: z53.array(z53.string())
|
|
1036
1046
|
}).describe("Defines a trace error on the PCB where a port is not matched");
|
|
1037
1047
|
expectTypesMatch(true);
|
|
1038
1048
|
|
|
1039
1049
|
// src/pcb/pcb_via.ts
|
|
1040
|
-
import { z as
|
|
1041
|
-
var pcb_via =
|
|
1042
|
-
type:
|
|
1050
|
+
import { z as z54 } from "zod";
|
|
1051
|
+
var pcb_via = z54.object({
|
|
1052
|
+
type: z54.literal("pcb_via"),
|
|
1043
1053
|
pcb_via_id: getZodPrefixedIdWithDefault("pcb_via"),
|
|
1044
1054
|
x: distance,
|
|
1045
1055
|
y: distance,
|
|
@@ -1049,51 +1059,51 @@ var pcb_via = z53.object({
|
|
|
1049
1059
|
from_layer: layer_ref.optional(),
|
|
1050
1060
|
/** @deprecated */
|
|
1051
1061
|
to_layer: layer_ref.optional(),
|
|
1052
|
-
layers:
|
|
1053
|
-
pcb_trace_id:
|
|
1062
|
+
layers: z54.array(layer_ref),
|
|
1063
|
+
pcb_trace_id: z54.string().optional()
|
|
1054
1064
|
}).describe("Defines a via on the PCB");
|
|
1055
1065
|
expectTypesMatch(true);
|
|
1056
1066
|
|
|
1057
1067
|
// src/pcb/pcb_board.ts
|
|
1058
|
-
import { z as
|
|
1059
|
-
var pcb_board =
|
|
1060
|
-
type:
|
|
1068
|
+
import { z as z55 } from "zod";
|
|
1069
|
+
var pcb_board = z55.object({
|
|
1070
|
+
type: z55.literal("pcb_board"),
|
|
1061
1071
|
pcb_board_id: getZodPrefixedIdWithDefault("pcb_board"),
|
|
1062
1072
|
width: length,
|
|
1063
1073
|
height: length,
|
|
1064
1074
|
center: point,
|
|
1065
1075
|
thickness: length.optional().default(1.4),
|
|
1066
|
-
num_layers:
|
|
1067
|
-
outline:
|
|
1076
|
+
num_layers: z55.number().optional().default(4),
|
|
1077
|
+
outline: z55.array(point).optional()
|
|
1068
1078
|
}).describe("Defines the board outline of the PCB");
|
|
1069
1079
|
expectTypesMatch(true);
|
|
1070
1080
|
|
|
1071
1081
|
// src/pcb/pcb_placement_error.ts
|
|
1072
|
-
import { z as
|
|
1073
|
-
var pcb_placement_error =
|
|
1074
|
-
type:
|
|
1082
|
+
import { z as z56 } from "zod";
|
|
1083
|
+
var pcb_placement_error = z56.object({
|
|
1084
|
+
type: z56.literal("pcb_placement_error"),
|
|
1075
1085
|
pcb_placement_error_id: getZodPrefixedIdWithDefault("pcb_placement_error"),
|
|
1076
|
-
message:
|
|
1086
|
+
message: z56.string()
|
|
1077
1087
|
}).describe("Defines a placement error on the PCB");
|
|
1078
1088
|
expectTypesMatch(true);
|
|
1079
1089
|
|
|
1080
1090
|
// src/pcb/pcb_trace_hint.ts
|
|
1081
|
-
import { z as
|
|
1082
|
-
var pcb_trace_hint =
|
|
1083
|
-
type:
|
|
1091
|
+
import { z as z57 } from "zod";
|
|
1092
|
+
var pcb_trace_hint = z57.object({
|
|
1093
|
+
type: z57.literal("pcb_trace_hint"),
|
|
1084
1094
|
pcb_trace_hint_id: getZodPrefixedIdWithDefault("pcb_trace_hint"),
|
|
1085
|
-
pcb_port_id:
|
|
1086
|
-
pcb_component_id:
|
|
1087
|
-
route:
|
|
1095
|
+
pcb_port_id: z57.string(),
|
|
1096
|
+
pcb_component_id: z57.string(),
|
|
1097
|
+
route: z57.array(route_hint_point)
|
|
1088
1098
|
}).describe("A hint that can be used during generation of a PCB trace");
|
|
1089
1099
|
expectTypesMatch(true);
|
|
1090
1100
|
|
|
1091
1101
|
// src/pcb/pcb_silkscreen_line.ts
|
|
1092
|
-
import { z as
|
|
1093
|
-
var pcb_silkscreen_line =
|
|
1094
|
-
type:
|
|
1102
|
+
import { z as z58 } from "zod";
|
|
1103
|
+
var pcb_silkscreen_line = z58.object({
|
|
1104
|
+
type: z58.literal("pcb_silkscreen_line"),
|
|
1095
1105
|
pcb_silkscreen_line_id: getZodPrefixedIdWithDefault("pcb_silkscreen_line"),
|
|
1096
|
-
pcb_component_id:
|
|
1106
|
+
pcb_component_id: z58.string(),
|
|
1097
1107
|
stroke_width: distance.default("0.1mm"),
|
|
1098
1108
|
x1: distance,
|
|
1099
1109
|
y1: distance,
|
|
@@ -1104,40 +1114,40 @@ var pcb_silkscreen_line = z57.object({
|
|
|
1104
1114
|
expectTypesMatch(true);
|
|
1105
1115
|
|
|
1106
1116
|
// src/pcb/pcb_silkscreen_path.ts
|
|
1107
|
-
import { z as
|
|
1108
|
-
var pcb_silkscreen_path =
|
|
1109
|
-
type:
|
|
1117
|
+
import { z as z59 } from "zod";
|
|
1118
|
+
var pcb_silkscreen_path = z59.object({
|
|
1119
|
+
type: z59.literal("pcb_silkscreen_path"),
|
|
1110
1120
|
pcb_silkscreen_path_id: getZodPrefixedIdWithDefault("pcb_silkscreen_path"),
|
|
1111
|
-
pcb_component_id:
|
|
1121
|
+
pcb_component_id: z59.string(),
|
|
1112
1122
|
layer: visible_layer,
|
|
1113
|
-
route:
|
|
1123
|
+
route: z59.array(point),
|
|
1114
1124
|
stroke_width: length
|
|
1115
1125
|
}).describe("Defines a silkscreen path on the PCB");
|
|
1116
1126
|
expectTypesMatch(true);
|
|
1117
1127
|
|
|
1118
1128
|
// src/pcb/pcb_silkscreen_text.ts
|
|
1119
|
-
import { z as
|
|
1120
|
-
var pcb_silkscreen_text =
|
|
1121
|
-
type:
|
|
1129
|
+
import { z as z60 } from "zod";
|
|
1130
|
+
var pcb_silkscreen_text = z60.object({
|
|
1131
|
+
type: z60.literal("pcb_silkscreen_text"),
|
|
1122
1132
|
pcb_silkscreen_text_id: getZodPrefixedIdWithDefault("pcb_silkscreen_text"),
|
|
1123
|
-
font:
|
|
1133
|
+
font: z60.literal("tscircuit2024").default("tscircuit2024"),
|
|
1124
1134
|
font_size: distance.default("0.2mm"),
|
|
1125
|
-
pcb_component_id:
|
|
1126
|
-
text:
|
|
1127
|
-
ccw_rotation:
|
|
1135
|
+
pcb_component_id: z60.string(),
|
|
1136
|
+
text: z60.string(),
|
|
1137
|
+
ccw_rotation: z60.number().optional(),
|
|
1128
1138
|
layer: layer_ref,
|
|
1129
|
-
is_mirrored:
|
|
1139
|
+
is_mirrored: z60.boolean().default(false).optional(),
|
|
1130
1140
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
1131
|
-
anchor_alignment:
|
|
1141
|
+
anchor_alignment: z60.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center")
|
|
1132
1142
|
}).describe("Defines silkscreen text on the PCB");
|
|
1133
1143
|
expectTypesMatch(true);
|
|
1134
1144
|
|
|
1135
1145
|
// src/pcb/pcb_silkscreen_rect.ts
|
|
1136
|
-
import { z as
|
|
1137
|
-
var pcb_silkscreen_rect =
|
|
1138
|
-
type:
|
|
1146
|
+
import { z as z61 } from "zod";
|
|
1147
|
+
var pcb_silkscreen_rect = z61.object({
|
|
1148
|
+
type: z61.literal("pcb_silkscreen_rect"),
|
|
1139
1149
|
pcb_silkscreen_rect_id: getZodPrefixedIdWithDefault("pcb_silkscreen_rect"),
|
|
1140
|
-
pcb_component_id:
|
|
1150
|
+
pcb_component_id: z61.string(),
|
|
1141
1151
|
center: point,
|
|
1142
1152
|
width: length,
|
|
1143
1153
|
height: length,
|
|
@@ -1146,13 +1156,13 @@ var pcb_silkscreen_rect = z60.object({
|
|
|
1146
1156
|
expectTypesMatch(true);
|
|
1147
1157
|
|
|
1148
1158
|
// src/pcb/pcb_silkscreen_circle.ts
|
|
1149
|
-
import { z as
|
|
1150
|
-
var pcb_silkscreen_circle =
|
|
1151
|
-
type:
|
|
1159
|
+
import { z as z62 } from "zod";
|
|
1160
|
+
var pcb_silkscreen_circle = z62.object({
|
|
1161
|
+
type: z62.literal("pcb_silkscreen_circle"),
|
|
1152
1162
|
pcb_silkscreen_circle_id: getZodPrefixedIdWithDefault(
|
|
1153
1163
|
"pcb_silkscreen_circle"
|
|
1154
1164
|
),
|
|
1155
|
-
pcb_component_id:
|
|
1165
|
+
pcb_component_id: z62.string(),
|
|
1156
1166
|
center: point,
|
|
1157
1167
|
radius: length,
|
|
1158
1168
|
layer: visible_layer
|
|
@@ -1160,11 +1170,11 @@ var pcb_silkscreen_circle = z61.object({
|
|
|
1160
1170
|
expectTypesMatch(true);
|
|
1161
1171
|
|
|
1162
1172
|
// src/pcb/pcb_silkscreen_oval.ts
|
|
1163
|
-
import { z as
|
|
1164
|
-
var pcb_silkscreen_oval =
|
|
1165
|
-
type:
|
|
1173
|
+
import { z as z63 } from "zod";
|
|
1174
|
+
var pcb_silkscreen_oval = z63.object({
|
|
1175
|
+
type: z63.literal("pcb_silkscreen_oval"),
|
|
1166
1176
|
pcb_silkscreen_oval_id: getZodPrefixedIdWithDefault("pcb_silkscreen_oval"),
|
|
1167
|
-
pcb_component_id:
|
|
1177
|
+
pcb_component_id: z63.string(),
|
|
1168
1178
|
center: point,
|
|
1169
1179
|
radius_x: distance,
|
|
1170
1180
|
radius_y: distance,
|
|
@@ -1173,133 +1183,133 @@ var pcb_silkscreen_oval = z62.object({
|
|
|
1173
1183
|
expectTypesMatch(true);
|
|
1174
1184
|
|
|
1175
1185
|
// src/pcb/pcb_fabrication_note_text.ts
|
|
1176
|
-
import { z as
|
|
1177
|
-
var pcb_fabrication_note_text =
|
|
1178
|
-
type:
|
|
1186
|
+
import { z as z64 } from "zod";
|
|
1187
|
+
var pcb_fabrication_note_text = z64.object({
|
|
1188
|
+
type: z64.literal("pcb_fabrication_note_text"),
|
|
1179
1189
|
pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(
|
|
1180
1190
|
"pcb_fabrication_note_text"
|
|
1181
1191
|
),
|
|
1182
|
-
font:
|
|
1192
|
+
font: z64.literal("tscircuit2024").default("tscircuit2024"),
|
|
1183
1193
|
font_size: distance.default("1mm"),
|
|
1184
|
-
pcb_component_id:
|
|
1185
|
-
text:
|
|
1194
|
+
pcb_component_id: z64.string(),
|
|
1195
|
+
text: z64.string(),
|
|
1186
1196
|
layer: visible_layer,
|
|
1187
1197
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
1188
|
-
anchor_alignment:
|
|
1189
|
-
color:
|
|
1198
|
+
anchor_alignment: z64.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1199
|
+
color: z64.string().optional()
|
|
1190
1200
|
}).describe(
|
|
1191
1201
|
"Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"
|
|
1192
1202
|
);
|
|
1193
1203
|
expectTypesMatch(true);
|
|
1194
1204
|
|
|
1195
1205
|
// src/pcb/pcb_fabrication_note_path.ts
|
|
1196
|
-
import { z as
|
|
1197
|
-
var pcb_fabrication_note_path =
|
|
1198
|
-
type:
|
|
1206
|
+
import { z as z65 } from "zod";
|
|
1207
|
+
var pcb_fabrication_note_path = z65.object({
|
|
1208
|
+
type: z65.literal("pcb_fabrication_note_path"),
|
|
1199
1209
|
pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(
|
|
1200
1210
|
"pcb_fabrication_note_path"
|
|
1201
1211
|
),
|
|
1202
|
-
pcb_component_id:
|
|
1212
|
+
pcb_component_id: z65.string(),
|
|
1203
1213
|
layer: layer_ref,
|
|
1204
|
-
route:
|
|
1214
|
+
route: z65.array(point),
|
|
1205
1215
|
stroke_width: length,
|
|
1206
|
-
color:
|
|
1216
|
+
color: z65.string().optional()
|
|
1207
1217
|
}).describe(
|
|
1208
1218
|
"Defines a fabrication path on the PCB for fabricators or assemblers"
|
|
1209
1219
|
);
|
|
1210
1220
|
expectTypesMatch(true);
|
|
1211
1221
|
|
|
1212
1222
|
// src/pcb/pcb_keepout.ts
|
|
1213
|
-
import { z as
|
|
1214
|
-
var pcb_keepout =
|
|
1215
|
-
type:
|
|
1216
|
-
shape:
|
|
1223
|
+
import { z as z66 } from "zod";
|
|
1224
|
+
var pcb_keepout = z66.object({
|
|
1225
|
+
type: z66.literal("pcb_keepout"),
|
|
1226
|
+
shape: z66.literal("rect"),
|
|
1217
1227
|
center: point,
|
|
1218
1228
|
width: distance,
|
|
1219
1229
|
height: distance,
|
|
1220
|
-
pcb_keepout_id:
|
|
1221
|
-
layers:
|
|
1230
|
+
pcb_keepout_id: z66.string(),
|
|
1231
|
+
layers: z66.array(z66.string()),
|
|
1222
1232
|
// Specify layers where the keepout applies
|
|
1223
|
-
description:
|
|
1233
|
+
description: z66.string().optional()
|
|
1224
1234
|
// Optional description of the keepout
|
|
1225
1235
|
}).or(
|
|
1226
|
-
|
|
1227
|
-
type:
|
|
1228
|
-
shape:
|
|
1236
|
+
z66.object({
|
|
1237
|
+
type: z66.literal("pcb_keepout"),
|
|
1238
|
+
shape: z66.literal("circle"),
|
|
1229
1239
|
center: point,
|
|
1230
1240
|
radius: distance,
|
|
1231
|
-
pcb_keepout_id:
|
|
1232
|
-
layers:
|
|
1241
|
+
pcb_keepout_id: z66.string(),
|
|
1242
|
+
layers: z66.array(z66.string()),
|
|
1233
1243
|
// Specify layers where the keepout applies
|
|
1234
|
-
description:
|
|
1244
|
+
description: z66.string().optional()
|
|
1235
1245
|
// Optional description of the keepout
|
|
1236
1246
|
})
|
|
1237
1247
|
);
|
|
1238
1248
|
|
|
1239
1249
|
// src/pcb/pcb_missing_footprint_error.ts
|
|
1240
|
-
import { z as
|
|
1241
|
-
var pcb_missing_footprint_error =
|
|
1242
|
-
type:
|
|
1250
|
+
import { z as z67 } from "zod";
|
|
1251
|
+
var pcb_missing_footprint_error = z67.object({
|
|
1252
|
+
type: z67.literal("pcb_missing_footprint_error"),
|
|
1243
1253
|
pcb_missing_footprint_error_id: getZodPrefixedIdWithDefault(
|
|
1244
1254
|
"pcb_missing_footprint_error"
|
|
1245
1255
|
),
|
|
1246
|
-
error_type:
|
|
1247
|
-
source_component_id:
|
|
1248
|
-
message:
|
|
1256
|
+
error_type: z67.literal("pcb_missing_footprint_error"),
|
|
1257
|
+
source_component_id: z67.string(),
|
|
1258
|
+
message: z67.string()
|
|
1249
1259
|
}).describe("Defines a missing footprint error on the PCB");
|
|
1250
1260
|
expectTypesMatch(
|
|
1251
1261
|
true
|
|
1252
1262
|
);
|
|
1253
1263
|
|
|
1254
1264
|
// src/pcb/pcb_manual_edit_conflict_error.ts
|
|
1255
|
-
import { z as
|
|
1256
|
-
var pcb_manual_edit_conflict_error =
|
|
1257
|
-
type:
|
|
1265
|
+
import { z as z68 } from "zod";
|
|
1266
|
+
var pcb_manual_edit_conflict_error = z68.object({
|
|
1267
|
+
type: z68.literal("pcb_manual_edit_conflict_error"),
|
|
1258
1268
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_manual_edit_conflict_error"),
|
|
1259
|
-
message:
|
|
1260
|
-
pcb_component_id:
|
|
1261
|
-
source_component_id:
|
|
1269
|
+
message: z68.string(),
|
|
1270
|
+
pcb_component_id: z68.string(),
|
|
1271
|
+
source_component_id: z68.string()
|
|
1262
1272
|
}).describe(
|
|
1263
1273
|
"Error emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"
|
|
1264
1274
|
);
|
|
1265
1275
|
expectTypesMatch(true);
|
|
1266
1276
|
|
|
1267
1277
|
// src/pcb/pcb_group.ts
|
|
1268
|
-
import { z as
|
|
1269
|
-
var pcb_group =
|
|
1270
|
-
type:
|
|
1278
|
+
import { z as z69 } from "zod";
|
|
1279
|
+
var pcb_group = z69.object({
|
|
1280
|
+
type: z69.literal("pcb_group"),
|
|
1271
1281
|
pcb_group_id: getZodPrefixedIdWithDefault("pcb_group"),
|
|
1272
1282
|
width: length,
|
|
1273
1283
|
height: length,
|
|
1274
1284
|
center: point,
|
|
1275
|
-
pcb_component_ids:
|
|
1276
|
-
name:
|
|
1277
|
-
description:
|
|
1285
|
+
pcb_component_ids: z69.array(z69.string()),
|
|
1286
|
+
name: z69.string().optional(),
|
|
1287
|
+
description: z69.string().optional()
|
|
1278
1288
|
}).describe("Defines a group of components on the PCB");
|
|
1279
1289
|
expectTypesMatch(true);
|
|
1280
1290
|
|
|
1281
1291
|
// src/cad/cad_component.ts
|
|
1282
|
-
import { z as
|
|
1283
|
-
var cad_component =
|
|
1284
|
-
type:
|
|
1285
|
-
cad_component_id:
|
|
1286
|
-
pcb_component_id:
|
|
1287
|
-
source_component_id:
|
|
1292
|
+
import { z as z70 } from "zod";
|
|
1293
|
+
var cad_component = z70.object({
|
|
1294
|
+
type: z70.literal("cad_component"),
|
|
1295
|
+
cad_component_id: z70.string(),
|
|
1296
|
+
pcb_component_id: z70.string(),
|
|
1297
|
+
source_component_id: z70.string(),
|
|
1288
1298
|
position: point3,
|
|
1289
1299
|
rotation: point3.optional(),
|
|
1290
1300
|
size: point3.optional(),
|
|
1291
1301
|
layer: layer_ref.optional(),
|
|
1292
1302
|
// These are all ways to generate/load the 3d model
|
|
1293
|
-
footprinter_string:
|
|
1294
|
-
model_obj_url:
|
|
1295
|
-
model_stl_url:
|
|
1296
|
-
model_3mf_url:
|
|
1297
|
-
model_jscad:
|
|
1303
|
+
footprinter_string: z70.string().optional(),
|
|
1304
|
+
model_obj_url: z70.string().optional(),
|
|
1305
|
+
model_stl_url: z70.string().optional(),
|
|
1306
|
+
model_3mf_url: z70.string().optional(),
|
|
1307
|
+
model_jscad: z70.any().optional()
|
|
1298
1308
|
}).describe("Defines a component on the PCB");
|
|
1299
1309
|
|
|
1300
1310
|
// src/any_circuit_element.ts
|
|
1301
|
-
import { z as
|
|
1302
|
-
var any_circuit_element =
|
|
1311
|
+
import { z as z71 } from "zod";
|
|
1312
|
+
var any_circuit_element = z71.union([
|
|
1303
1313
|
source_trace,
|
|
1304
1314
|
source_port,
|
|
1305
1315
|
any_source_component,
|
|
@@ -1317,6 +1327,7 @@ var any_circuit_element = z70.union([
|
|
|
1317
1327
|
source_simple_pin_header,
|
|
1318
1328
|
source_simple_resonator,
|
|
1319
1329
|
source_simple_transistor,
|
|
1330
|
+
source_simple_mosfet,
|
|
1320
1331
|
source_simple_potentiometer,
|
|
1321
1332
|
source_simple_push_button,
|
|
1322
1333
|
pcb_component,
|
|
@@ -1448,6 +1459,7 @@ export {
|
|
|
1448
1459
|
source_simple_diode,
|
|
1449
1460
|
source_simple_ground,
|
|
1450
1461
|
source_simple_inductor,
|
|
1462
|
+
source_simple_mosfet,
|
|
1451
1463
|
source_simple_pin_header,
|
|
1452
1464
|
source_simple_potentiometer,
|
|
1453
1465
|
source_simple_power_source,
|