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