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