circuit-json 0.0.102 → 0.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +185 -3
- package/dist/index.mjs +378 -368
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -338,7 +338,7 @@ var source_simple_power_source = source_component_base.extend({
|
|
|
338
338
|
});
|
|
339
339
|
|
|
340
340
|
// src/source/any_source_component.ts
|
|
341
|
-
import { z as
|
|
341
|
+
import { z as z20 } from "zod";
|
|
342
342
|
|
|
343
343
|
// src/source/source_simple_battery.ts
|
|
344
344
|
import { z as z16 } from "zod";
|
|
@@ -360,8 +360,15 @@ var source_simple_push_button = source_component_base.extend({
|
|
|
360
360
|
ftype: z18.literal("simple_push_button")
|
|
361
361
|
});
|
|
362
362
|
|
|
363
|
+
// src/source/source_simple_potentiometer.ts
|
|
364
|
+
import { z as z19 } from "zod";
|
|
365
|
+
var source_simple_potentiometer = source_component_base.extend({
|
|
366
|
+
ftype: z19.literal("simple_potentiometer"),
|
|
367
|
+
max_resistance: resistance
|
|
368
|
+
});
|
|
369
|
+
|
|
363
370
|
// src/source/any_source_component.ts
|
|
364
|
-
var any_source_component =
|
|
371
|
+
var any_source_component = z20.union([
|
|
365
372
|
source_simple_resistor,
|
|
366
373
|
source_simple_capacitor,
|
|
367
374
|
source_simple_diode,
|
|
@@ -372,58 +379,59 @@ var any_source_component = z19.union([
|
|
|
372
379
|
source_simple_power_source,
|
|
373
380
|
source_simple_battery,
|
|
374
381
|
source_simple_inductor,
|
|
375
|
-
source_simple_push_button
|
|
382
|
+
source_simple_push_button,
|
|
383
|
+
source_simple_potentiometer
|
|
376
384
|
]);
|
|
377
385
|
|
|
378
386
|
// src/source/source_port.ts
|
|
379
|
-
import { z as
|
|
380
|
-
var source_port =
|
|
381
|
-
type:
|
|
382
|
-
pin_number:
|
|
383
|
-
port_hints:
|
|
384
|
-
name:
|
|
385
|
-
source_port_id:
|
|
386
|
-
source_component_id:
|
|
387
|
+
import { z as z21 } from "zod";
|
|
388
|
+
var source_port = z21.object({
|
|
389
|
+
type: z21.literal("source_port"),
|
|
390
|
+
pin_number: z21.number().optional(),
|
|
391
|
+
port_hints: z21.array(z21.string()).optional(),
|
|
392
|
+
name: z21.string(),
|
|
393
|
+
source_port_id: z21.string(),
|
|
394
|
+
source_component_id: z21.string()
|
|
387
395
|
});
|
|
388
396
|
|
|
389
397
|
// src/source/source_trace.ts
|
|
390
|
-
import { z as
|
|
391
|
-
var source_trace =
|
|
392
|
-
type:
|
|
393
|
-
source_trace_id:
|
|
394
|
-
connected_source_port_ids:
|
|
395
|
-
connected_source_net_ids:
|
|
396
|
-
subcircuit_connectivity_map_key:
|
|
398
|
+
import { z as z22 } from "zod";
|
|
399
|
+
var source_trace = z22.object({
|
|
400
|
+
type: z22.literal("source_trace"),
|
|
401
|
+
source_trace_id: z22.string(),
|
|
402
|
+
connected_source_port_ids: z22.array(z22.string()),
|
|
403
|
+
connected_source_net_ids: z22.array(z22.string()),
|
|
404
|
+
subcircuit_connectivity_map_key: z22.string().optional()
|
|
397
405
|
});
|
|
398
406
|
expectTypesMatch(true);
|
|
399
407
|
|
|
400
408
|
// src/source/source_group.ts
|
|
401
|
-
import { z as
|
|
402
|
-
var source_group =
|
|
403
|
-
type:
|
|
404
|
-
source_group_id:
|
|
405
|
-
name:
|
|
409
|
+
import { z as z23 } from "zod";
|
|
410
|
+
var source_group = z23.object({
|
|
411
|
+
type: z23.literal("source_group"),
|
|
412
|
+
source_group_id: z23.string(),
|
|
413
|
+
name: z23.string().optional()
|
|
406
414
|
});
|
|
407
415
|
|
|
408
416
|
// src/source/source_net.ts
|
|
409
|
-
import { z as
|
|
410
|
-
var source_net =
|
|
411
|
-
type:
|
|
412
|
-
source_net_id:
|
|
413
|
-
name:
|
|
414
|
-
member_source_group_ids:
|
|
415
|
-
is_power:
|
|
416
|
-
is_ground:
|
|
417
|
-
is_digital_signal:
|
|
418
|
-
is_analog_signal:
|
|
419
|
-
trace_width:
|
|
417
|
+
import { z as z24 } from "zod";
|
|
418
|
+
var source_net = z24.object({
|
|
419
|
+
type: z24.literal("source_net"),
|
|
420
|
+
source_net_id: z24.string(),
|
|
421
|
+
name: z24.string(),
|
|
422
|
+
member_source_group_ids: z24.array(z24.string()),
|
|
423
|
+
is_power: z24.boolean().optional(),
|
|
424
|
+
is_ground: z24.boolean().optional(),
|
|
425
|
+
is_digital_signal: z24.boolean().optional(),
|
|
426
|
+
is_analog_signal: z24.boolean().optional(),
|
|
427
|
+
trace_width: z24.number().optional()
|
|
420
428
|
});
|
|
421
429
|
|
|
422
430
|
// src/schematic/schematic_box.ts
|
|
423
|
-
import { z as
|
|
424
|
-
var schematic_box =
|
|
425
|
-
type:
|
|
426
|
-
schematic_component_id:
|
|
431
|
+
import { z as z25 } from "zod";
|
|
432
|
+
var schematic_box = z25.object({
|
|
433
|
+
type: z25.literal("schematic_box"),
|
|
434
|
+
schematic_component_id: z25.string(),
|
|
427
435
|
width: distance,
|
|
428
436
|
height: distance,
|
|
429
437
|
x: distance,
|
|
@@ -431,77 +439,77 @@ var schematic_box = z24.object({
|
|
|
431
439
|
}).describe("Draws a box on the schematic");
|
|
432
440
|
|
|
433
441
|
// src/schematic/schematic_path.ts
|
|
434
|
-
import { z as
|
|
435
|
-
var schematic_path =
|
|
436
|
-
type:
|
|
437
|
-
schematic_component_id:
|
|
438
|
-
fill_color:
|
|
439
|
-
is_filled:
|
|
440
|
-
points:
|
|
442
|
+
import { z as z26 } from "zod";
|
|
443
|
+
var schematic_path = z26.object({
|
|
444
|
+
type: z26.literal("schematic_path"),
|
|
445
|
+
schematic_component_id: z26.string(),
|
|
446
|
+
fill_color: z26.enum(["red", "blue"]).optional(),
|
|
447
|
+
is_filled: z26.boolean().optional(),
|
|
448
|
+
points: z26.array(point)
|
|
441
449
|
});
|
|
442
450
|
|
|
443
451
|
// src/schematic/schematic_component.ts
|
|
444
|
-
import { z as
|
|
445
|
-
var schematic_pin_styles =
|
|
446
|
-
|
|
452
|
+
import { z as z27 } from "zod";
|
|
453
|
+
var schematic_pin_styles = z27.record(
|
|
454
|
+
z27.object({
|
|
447
455
|
left_margin: length.optional(),
|
|
448
456
|
right_margin: length.optional(),
|
|
449
457
|
top_margin: length.optional(),
|
|
450
458
|
bottom_margin: length.optional()
|
|
451
459
|
})
|
|
452
460
|
);
|
|
453
|
-
var schematic_component_port_arrangement_by_size =
|
|
454
|
-
left_size:
|
|
455
|
-
right_size:
|
|
456
|
-
top_size:
|
|
457
|
-
bottom_size:
|
|
461
|
+
var schematic_component_port_arrangement_by_size = z27.object({
|
|
462
|
+
left_size: z27.number(),
|
|
463
|
+
right_size: z27.number(),
|
|
464
|
+
top_size: z27.number().optional(),
|
|
465
|
+
bottom_size: z27.number().optional()
|
|
458
466
|
});
|
|
459
467
|
expectTypesMatch(true);
|
|
460
|
-
var schematic_component_port_arrangement_by_sides =
|
|
461
|
-
left_side:
|
|
462
|
-
pins:
|
|
463
|
-
direction:
|
|
468
|
+
var schematic_component_port_arrangement_by_sides = z27.object({
|
|
469
|
+
left_side: z27.object({
|
|
470
|
+
pins: z27.array(z27.number()),
|
|
471
|
+
direction: z27.enum(["top-to-bottom", "bottom-to-top"]).optional()
|
|
464
472
|
}).optional(),
|
|
465
|
-
right_side:
|
|
466
|
-
pins:
|
|
467
|
-
direction:
|
|
473
|
+
right_side: z27.object({
|
|
474
|
+
pins: z27.array(z27.number()),
|
|
475
|
+
direction: z27.enum(["top-to-bottom", "bottom-to-top"]).optional()
|
|
468
476
|
}).optional(),
|
|
469
|
-
top_side:
|
|
470
|
-
pins:
|
|
471
|
-
direction:
|
|
477
|
+
top_side: z27.object({
|
|
478
|
+
pins: z27.array(z27.number()),
|
|
479
|
+
direction: z27.enum(["left-to-right", "right-to-left"]).optional()
|
|
472
480
|
}).optional(),
|
|
473
|
-
bottom_side:
|
|
474
|
-
pins:
|
|
475
|
-
direction:
|
|
481
|
+
bottom_side: z27.object({
|
|
482
|
+
pins: z27.array(z27.number()),
|
|
483
|
+
direction: z27.enum(["left-to-right", "right-to-left"]).optional()
|
|
476
484
|
}).optional()
|
|
477
485
|
});
|
|
478
486
|
expectTypesMatch(true);
|
|
479
|
-
var port_arrangement =
|
|
487
|
+
var port_arrangement = z27.union([
|
|
480
488
|
schematic_component_port_arrangement_by_size,
|
|
481
489
|
schematic_component_port_arrangement_by_sides
|
|
482
490
|
]);
|
|
483
|
-
var schematic_component =
|
|
484
|
-
type:
|
|
491
|
+
var schematic_component = z27.object({
|
|
492
|
+
type: z27.literal("schematic_component"),
|
|
485
493
|
rotation: rotation.default(0),
|
|
486
494
|
size,
|
|
487
495
|
center: point,
|
|
488
|
-
source_component_id:
|
|
489
|
-
schematic_component_id:
|
|
496
|
+
source_component_id: z27.string(),
|
|
497
|
+
schematic_component_id: z27.string(),
|
|
490
498
|
pin_spacing: length.optional(),
|
|
491
499
|
pin_styles: schematic_pin_styles.optional(),
|
|
492
500
|
box_width: length.optional(),
|
|
493
|
-
symbol_name:
|
|
501
|
+
symbol_name: z27.string().optional(),
|
|
494
502
|
port_arrangement: port_arrangement.optional(),
|
|
495
|
-
port_labels:
|
|
496
|
-
symbol_display_value:
|
|
503
|
+
port_labels: z27.record(z27.string()).optional(),
|
|
504
|
+
symbol_display_value: z27.string().optional()
|
|
497
505
|
});
|
|
498
506
|
expectTypesMatch(true);
|
|
499
507
|
|
|
500
508
|
// src/schematic/schematic_line.ts
|
|
501
|
-
import { z as
|
|
502
|
-
var schematic_line =
|
|
503
|
-
type:
|
|
504
|
-
schematic_component_id:
|
|
509
|
+
import { z as z28 } from "zod";
|
|
510
|
+
var schematic_line = z28.object({
|
|
511
|
+
type: z28.literal("schematic_line"),
|
|
512
|
+
schematic_component_id: z28.string(),
|
|
505
513
|
x1: distance,
|
|
506
514
|
x2: distance,
|
|
507
515
|
y1: distance,
|
|
@@ -509,111 +517,111 @@ var schematic_line = z27.object({
|
|
|
509
517
|
});
|
|
510
518
|
|
|
511
519
|
// src/schematic/schematic_trace.ts
|
|
512
|
-
import { z as
|
|
513
|
-
var schematic_trace =
|
|
514
|
-
type:
|
|
515
|
-
schematic_trace_id:
|
|
516
|
-
source_trace_id:
|
|
517
|
-
junctions:
|
|
518
|
-
|
|
519
|
-
x:
|
|
520
|
-
y:
|
|
520
|
+
import { z as z29 } from "zod";
|
|
521
|
+
var schematic_trace = z29.object({
|
|
522
|
+
type: z29.literal("schematic_trace"),
|
|
523
|
+
schematic_trace_id: z29.string(),
|
|
524
|
+
source_trace_id: z29.string(),
|
|
525
|
+
junctions: z29.array(
|
|
526
|
+
z29.object({
|
|
527
|
+
x: z29.number(),
|
|
528
|
+
y: z29.number()
|
|
521
529
|
})
|
|
522
530
|
),
|
|
523
|
-
edges:
|
|
524
|
-
|
|
525
|
-
from:
|
|
526
|
-
x:
|
|
527
|
-
y:
|
|
531
|
+
edges: z29.array(
|
|
532
|
+
z29.object({
|
|
533
|
+
from: z29.object({
|
|
534
|
+
x: z29.number(),
|
|
535
|
+
y: z29.number()
|
|
528
536
|
}),
|
|
529
|
-
to:
|
|
530
|
-
x:
|
|
531
|
-
y:
|
|
537
|
+
to: z29.object({
|
|
538
|
+
x: z29.number(),
|
|
539
|
+
y: z29.number()
|
|
532
540
|
}),
|
|
533
|
-
is_crossing:
|
|
534
|
-
from_schematic_port_id:
|
|
535
|
-
to_schematic_port_id:
|
|
541
|
+
is_crossing: z29.boolean().optional(),
|
|
542
|
+
from_schematic_port_id: z29.string().optional(),
|
|
543
|
+
to_schematic_port_id: z29.string().optional()
|
|
536
544
|
})
|
|
537
545
|
)
|
|
538
546
|
});
|
|
539
547
|
expectTypesMatch(true);
|
|
540
548
|
|
|
541
549
|
// src/schematic/schematic_text.ts
|
|
542
|
-
import { z as
|
|
543
|
-
var schematic_text =
|
|
544
|
-
type:
|
|
545
|
-
schematic_component_id:
|
|
546
|
-
schematic_text_id:
|
|
547
|
-
text:
|
|
548
|
-
position:
|
|
550
|
+
import { z as z30 } from "zod";
|
|
551
|
+
var schematic_text = z30.object({
|
|
552
|
+
type: z30.literal("schematic_text"),
|
|
553
|
+
schematic_component_id: z30.string(),
|
|
554
|
+
schematic_text_id: z30.string(),
|
|
555
|
+
text: z30.string(),
|
|
556
|
+
position: z30.object({
|
|
549
557
|
x: distance,
|
|
550
558
|
y: distance
|
|
551
559
|
}),
|
|
552
|
-
rotation:
|
|
553
|
-
anchor:
|
|
554
|
-
color:
|
|
560
|
+
rotation: z30.number().default(0),
|
|
561
|
+
anchor: z30.enum(["center", "left", "right", "top", "bottom"]).default("center"),
|
|
562
|
+
color: z30.string().default("#000000")
|
|
555
563
|
});
|
|
556
564
|
|
|
557
565
|
// src/schematic/schematic_port.ts
|
|
558
|
-
import { z as
|
|
559
|
-
var schematic_port =
|
|
560
|
-
type:
|
|
561
|
-
schematic_port_id:
|
|
562
|
-
source_port_id:
|
|
563
|
-
schematic_component_id:
|
|
566
|
+
import { z as z31 } from "zod";
|
|
567
|
+
var schematic_port = z31.object({
|
|
568
|
+
type: z31.literal("schematic_port"),
|
|
569
|
+
schematic_port_id: z31.string(),
|
|
570
|
+
source_port_id: z31.string(),
|
|
571
|
+
schematic_component_id: z31.string().optional(),
|
|
564
572
|
center: point,
|
|
565
|
-
facing_direction:
|
|
566
|
-
distance_from_component_edge:
|
|
567
|
-
side_of_component:
|
|
568
|
-
true_ccw_index:
|
|
569
|
-
pin_number:
|
|
570
|
-
display_pin_label:
|
|
573
|
+
facing_direction: z31.enum(["up", "down", "left", "right"]).optional(),
|
|
574
|
+
distance_from_component_edge: z31.number().optional(),
|
|
575
|
+
side_of_component: z31.enum(["top", "bottom", "left", "right"]).optional(),
|
|
576
|
+
true_ccw_index: z31.number().optional(),
|
|
577
|
+
pin_number: z31.number().optional(),
|
|
578
|
+
display_pin_label: z31.string().optional()
|
|
571
579
|
}).describe("Defines a port on a schematic component");
|
|
572
580
|
expectTypesMatch(true);
|
|
573
581
|
|
|
574
582
|
// src/schematic/schematic_net_label.ts
|
|
575
|
-
import { z as
|
|
576
|
-
var schematic_net_label =
|
|
577
|
-
type:
|
|
578
|
-
source_net_id:
|
|
583
|
+
import { z as z32 } from "zod";
|
|
584
|
+
var schematic_net_label = z32.object({
|
|
585
|
+
type: z32.literal("schematic_net_label"),
|
|
586
|
+
source_net_id: z32.string(),
|
|
579
587
|
center: point,
|
|
580
588
|
anchor_position: point.optional(),
|
|
581
|
-
anchor_side:
|
|
582
|
-
text:
|
|
583
|
-
symbol_name:
|
|
589
|
+
anchor_side: z32.enum(["top", "bottom", "left", "right"]),
|
|
590
|
+
text: z32.string(),
|
|
591
|
+
symbol_name: z32.string().optional()
|
|
584
592
|
});
|
|
585
593
|
|
|
586
594
|
// src/schematic/schematic_error.ts
|
|
587
|
-
import { z as
|
|
588
|
-
var schematic_error =
|
|
589
|
-
schematic_error_id:
|
|
590
|
-
type:
|
|
595
|
+
import { z as z33 } from "zod";
|
|
596
|
+
var schematic_error = z33.object({
|
|
597
|
+
schematic_error_id: z33.string(),
|
|
598
|
+
type: z33.literal("schematic_error"),
|
|
591
599
|
// eventually each error type should be broken out into a dir of files
|
|
592
|
-
error_type:
|
|
593
|
-
message:
|
|
600
|
+
error_type: z33.literal("schematic_port_not_found"),
|
|
601
|
+
message: z33.string()
|
|
594
602
|
}).describe("Defines a schematic error on the schematic");
|
|
595
603
|
|
|
596
604
|
// src/schematic/schematic_debug_object.ts
|
|
597
|
-
import { z as
|
|
598
|
-
var schematic_debug_object_base =
|
|
599
|
-
type:
|
|
600
|
-
label:
|
|
605
|
+
import { z as z34 } from "zod";
|
|
606
|
+
var schematic_debug_object_base = z34.object({
|
|
607
|
+
type: z34.literal("schematic_debug_object"),
|
|
608
|
+
label: z34.string().optional()
|
|
601
609
|
});
|
|
602
610
|
var schematic_debug_rect = schematic_debug_object_base.extend({
|
|
603
|
-
shape:
|
|
611
|
+
shape: z34.literal("rect"),
|
|
604
612
|
center: point,
|
|
605
613
|
size
|
|
606
614
|
});
|
|
607
615
|
var schematic_debug_line = schematic_debug_object_base.extend({
|
|
608
|
-
shape:
|
|
616
|
+
shape: z34.literal("line"),
|
|
609
617
|
start: point,
|
|
610
618
|
end: point
|
|
611
619
|
});
|
|
612
620
|
var schematic_debug_point = schematic_debug_object_base.extend({
|
|
613
|
-
shape:
|
|
621
|
+
shape: z34.literal("point"),
|
|
614
622
|
center: point
|
|
615
623
|
});
|
|
616
|
-
var schematic_debug_object =
|
|
624
|
+
var schematic_debug_object = z34.discriminatedUnion("shape", [
|
|
617
625
|
schematic_debug_rect,
|
|
618
626
|
schematic_debug_line,
|
|
619
627
|
schematic_debug_point
|
|
@@ -621,7 +629,7 @@ var schematic_debug_object = z33.discriminatedUnion("shape", [
|
|
|
621
629
|
expectTypesMatch(true);
|
|
622
630
|
|
|
623
631
|
// src/pcb/properties/layer_ref.ts
|
|
624
|
-
import { z as
|
|
632
|
+
import { z as z35 } from "zod";
|
|
625
633
|
var all_layers = [
|
|
626
634
|
"top",
|
|
627
635
|
"bottom",
|
|
@@ -632,9 +640,9 @@ var all_layers = [
|
|
|
632
640
|
"inner5",
|
|
633
641
|
"inner6"
|
|
634
642
|
];
|
|
635
|
-
var layer_string =
|
|
643
|
+
var layer_string = z35.enum(all_layers);
|
|
636
644
|
var layer_ref = layer_string.or(
|
|
637
|
-
|
|
645
|
+
z35.object({
|
|
638
646
|
name: layer_string
|
|
639
647
|
})
|
|
640
648
|
).transform((layer) => {
|
|
@@ -643,34 +651,34 @@ var layer_ref = layer_string.or(
|
|
|
643
651
|
}
|
|
644
652
|
return layer.name;
|
|
645
653
|
});
|
|
646
|
-
var visible_layer =
|
|
654
|
+
var visible_layer = z35.enum(["top", "bottom"]);
|
|
647
655
|
|
|
648
656
|
// src/pcb/properties/pcb_route_hints.ts
|
|
649
|
-
import { z as
|
|
650
|
-
var pcb_route_hint =
|
|
657
|
+
import { z as z36 } from "zod";
|
|
658
|
+
var pcb_route_hint = z36.object({
|
|
651
659
|
x: distance,
|
|
652
660
|
y: distance,
|
|
653
|
-
via:
|
|
661
|
+
via: z36.boolean().optional(),
|
|
654
662
|
via_to_layer: layer_ref.optional()
|
|
655
663
|
});
|
|
656
|
-
var pcb_route_hints =
|
|
664
|
+
var pcb_route_hints = z36.array(pcb_route_hint);
|
|
657
665
|
|
|
658
666
|
// src/pcb/properties/route_hint_point.ts
|
|
659
|
-
import { z as
|
|
660
|
-
var route_hint_point =
|
|
667
|
+
import { z as z37 } from "zod";
|
|
668
|
+
var route_hint_point = z37.object({
|
|
661
669
|
x: distance,
|
|
662
670
|
y: distance,
|
|
663
|
-
via:
|
|
671
|
+
via: z37.boolean().optional(),
|
|
664
672
|
to_layer: layer_ref.optional(),
|
|
665
673
|
trace_width: distance.optional()
|
|
666
674
|
});
|
|
667
675
|
|
|
668
676
|
// src/pcb/pcb_component.ts
|
|
669
|
-
import { z as
|
|
670
|
-
var pcb_component =
|
|
671
|
-
type:
|
|
677
|
+
import { z as z38 } from "zod";
|
|
678
|
+
var pcb_component = z38.object({
|
|
679
|
+
type: z38.literal("pcb_component"),
|
|
672
680
|
pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
|
|
673
|
-
source_component_id:
|
|
681
|
+
source_component_id: z38.string(),
|
|
674
682
|
center: point,
|
|
675
683
|
layer: layer_ref,
|
|
676
684
|
rotation,
|
|
@@ -680,12 +688,12 @@ var pcb_component = z37.object({
|
|
|
680
688
|
expectTypesMatch(true);
|
|
681
689
|
|
|
682
690
|
// src/pcb/pcb_hole.ts
|
|
683
|
-
import { z as
|
|
684
|
-
var pcb_hole_circle_or_square =
|
|
685
|
-
type:
|
|
691
|
+
import { z as z39 } from "zod";
|
|
692
|
+
var pcb_hole_circle_or_square = z39.object({
|
|
693
|
+
type: z39.literal("pcb_hole"),
|
|
686
694
|
pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
|
|
687
|
-
hole_shape:
|
|
688
|
-
hole_diameter:
|
|
695
|
+
hole_shape: z39.enum(["circle", "square"]),
|
|
696
|
+
hole_diameter: z39.number(),
|
|
689
697
|
x: distance,
|
|
690
698
|
y: distance
|
|
691
699
|
});
|
|
@@ -693,12 +701,12 @@ var pcb_hole_circle_or_square_shape = pcb_hole_circle_or_square.describe(
|
|
|
693
701
|
"Defines a circular or square hole on the PCB"
|
|
694
702
|
);
|
|
695
703
|
expectTypesMatch(true);
|
|
696
|
-
var pcb_hole_oval =
|
|
697
|
-
type:
|
|
704
|
+
var pcb_hole_oval = z39.object({
|
|
705
|
+
type: z39.literal("pcb_hole"),
|
|
698
706
|
pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
|
|
699
|
-
hole_shape:
|
|
700
|
-
hole_width:
|
|
701
|
-
hole_height:
|
|
707
|
+
hole_shape: z39.literal("oval"),
|
|
708
|
+
hole_width: z39.number(),
|
|
709
|
+
hole_height: z39.number(),
|
|
702
710
|
x: distance,
|
|
703
711
|
y: distance
|
|
704
712
|
});
|
|
@@ -709,36 +717,36 @@ expectTypesMatch(true);
|
|
|
709
717
|
var pcb_hole = pcb_hole_circle_or_square.or(pcb_hole_oval);
|
|
710
718
|
|
|
711
719
|
// src/pcb/pcb_plated_hole.ts
|
|
712
|
-
import { z as
|
|
713
|
-
var pcb_plated_hole_circle =
|
|
714
|
-
type:
|
|
715
|
-
shape:
|
|
716
|
-
outer_diameter:
|
|
717
|
-
hole_diameter:
|
|
720
|
+
import { z as z40 } from "zod";
|
|
721
|
+
var pcb_plated_hole_circle = z40.object({
|
|
722
|
+
type: z40.literal("pcb_plated_hole"),
|
|
723
|
+
shape: z40.literal("circle"),
|
|
724
|
+
outer_diameter: z40.number(),
|
|
725
|
+
hole_diameter: z40.number(),
|
|
718
726
|
x: distance,
|
|
719
727
|
y: distance,
|
|
720
|
-
layers:
|
|
721
|
-
port_hints:
|
|
722
|
-
pcb_component_id:
|
|
723
|
-
pcb_port_id:
|
|
728
|
+
layers: z40.array(layer_ref),
|
|
729
|
+
port_hints: z40.array(z40.string()).optional(),
|
|
730
|
+
pcb_component_id: z40.string().optional(),
|
|
731
|
+
pcb_port_id: z40.string().optional(),
|
|
724
732
|
pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
|
|
725
733
|
});
|
|
726
|
-
var pcb_plated_hole_oval =
|
|
727
|
-
type:
|
|
728
|
-
shape:
|
|
729
|
-
outer_width:
|
|
730
|
-
outer_height:
|
|
731
|
-
hole_width:
|
|
732
|
-
hole_height:
|
|
734
|
+
var pcb_plated_hole_oval = z40.object({
|
|
735
|
+
type: z40.literal("pcb_plated_hole"),
|
|
736
|
+
shape: z40.enum(["oval", "pill"]),
|
|
737
|
+
outer_width: z40.number(),
|
|
738
|
+
outer_height: z40.number(),
|
|
739
|
+
hole_width: z40.number(),
|
|
740
|
+
hole_height: z40.number(),
|
|
733
741
|
x: distance,
|
|
734
742
|
y: distance,
|
|
735
|
-
layers:
|
|
736
|
-
port_hints:
|
|
737
|
-
pcb_component_id:
|
|
738
|
-
pcb_port_id:
|
|
743
|
+
layers: z40.array(layer_ref),
|
|
744
|
+
port_hints: z40.array(z40.string()).optional(),
|
|
745
|
+
pcb_component_id: z40.string().optional(),
|
|
746
|
+
pcb_port_id: z40.string().optional(),
|
|
739
747
|
pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
|
|
740
748
|
});
|
|
741
|
-
var pcb_plated_hole =
|
|
749
|
+
var pcb_plated_hole = z40.union([
|
|
742
750
|
pcb_plated_hole_circle,
|
|
743
751
|
pcb_plated_hole_oval
|
|
744
752
|
]);
|
|
@@ -748,140 +756,140 @@ expectTypesMatch(
|
|
|
748
756
|
expectTypesMatch(true);
|
|
749
757
|
|
|
750
758
|
// src/pcb/pcb_port.ts
|
|
751
|
-
import { z as
|
|
752
|
-
var pcb_port =
|
|
753
|
-
type:
|
|
759
|
+
import { z as z41 } from "zod";
|
|
760
|
+
var pcb_port = z41.object({
|
|
761
|
+
type: z41.literal("pcb_port"),
|
|
754
762
|
pcb_port_id: getZodPrefixedIdWithDefault("pcb_port"),
|
|
755
|
-
source_port_id:
|
|
756
|
-
pcb_component_id:
|
|
763
|
+
source_port_id: z41.string(),
|
|
764
|
+
pcb_component_id: z41.string(),
|
|
757
765
|
x: distance,
|
|
758
766
|
y: distance,
|
|
759
|
-
layers:
|
|
767
|
+
layers: z41.array(layer_ref)
|
|
760
768
|
}).describe("Defines a port on the PCB");
|
|
761
769
|
expectTypesMatch(true);
|
|
762
770
|
|
|
763
771
|
// src/pcb/pcb_smtpad.ts
|
|
764
|
-
import { z as
|
|
765
|
-
var pcb_smtpad_circle =
|
|
766
|
-
type:
|
|
767
|
-
shape:
|
|
772
|
+
import { z as z42 } from "zod";
|
|
773
|
+
var pcb_smtpad_circle = z42.object({
|
|
774
|
+
type: z42.literal("pcb_smtpad"),
|
|
775
|
+
shape: z42.literal("circle"),
|
|
768
776
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
769
777
|
x: distance,
|
|
770
778
|
y: distance,
|
|
771
|
-
radius:
|
|
779
|
+
radius: z42.number(),
|
|
772
780
|
layer: layer_ref,
|
|
773
|
-
port_hints:
|
|
774
|
-
pcb_component_id:
|
|
775
|
-
pcb_port_id:
|
|
781
|
+
port_hints: z42.array(z42.string()).optional(),
|
|
782
|
+
pcb_component_id: z42.string().optional(),
|
|
783
|
+
pcb_port_id: z42.string().optional()
|
|
776
784
|
});
|
|
777
|
-
var pcb_smtpad_rect =
|
|
778
|
-
type:
|
|
779
|
-
shape:
|
|
785
|
+
var pcb_smtpad_rect = z42.object({
|
|
786
|
+
type: z42.literal("pcb_smtpad"),
|
|
787
|
+
shape: z42.literal("rect"),
|
|
780
788
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
781
789
|
x: distance,
|
|
782
790
|
y: distance,
|
|
783
|
-
width:
|
|
784
|
-
height:
|
|
791
|
+
width: z42.number(),
|
|
792
|
+
height: z42.number(),
|
|
785
793
|
layer: layer_ref,
|
|
786
|
-
port_hints:
|
|
787
|
-
pcb_component_id:
|
|
788
|
-
pcb_port_id:
|
|
794
|
+
port_hints: z42.array(z42.string()).optional(),
|
|
795
|
+
pcb_component_id: z42.string().optional(),
|
|
796
|
+
pcb_port_id: z42.string().optional()
|
|
789
797
|
});
|
|
790
|
-
var pcb_smtpad =
|
|
798
|
+
var pcb_smtpad = z42.union([pcb_smtpad_circle, pcb_smtpad_rect]).describe("Defines an SMT pad on the PCB");
|
|
791
799
|
expectTypesMatch(true);
|
|
792
800
|
expectTypesMatch(true);
|
|
793
801
|
|
|
794
802
|
// src/pcb/pcb_solder_paste.ts
|
|
795
|
-
import { z as
|
|
796
|
-
var pcb_solder_paste_circle =
|
|
797
|
-
type:
|
|
798
|
-
shape:
|
|
803
|
+
import { z as z43 } from "zod";
|
|
804
|
+
var pcb_solder_paste_circle = z43.object({
|
|
805
|
+
type: z43.literal("pcb_solder_paste"),
|
|
806
|
+
shape: z43.literal("circle"),
|
|
799
807
|
pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
|
|
800
808
|
x: distance,
|
|
801
809
|
y: distance,
|
|
802
|
-
radius:
|
|
810
|
+
radius: z43.number(),
|
|
803
811
|
layer: layer_ref,
|
|
804
|
-
pcb_component_id:
|
|
805
|
-
pcb_smtpad_id:
|
|
812
|
+
pcb_component_id: z43.string().optional(),
|
|
813
|
+
pcb_smtpad_id: z43.string().optional()
|
|
806
814
|
});
|
|
807
|
-
var pcb_solder_paste_rect =
|
|
808
|
-
type:
|
|
809
|
-
shape:
|
|
815
|
+
var pcb_solder_paste_rect = z43.object({
|
|
816
|
+
type: z43.literal("pcb_solder_paste"),
|
|
817
|
+
shape: z43.literal("rect"),
|
|
810
818
|
pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
|
|
811
819
|
x: distance,
|
|
812
820
|
y: distance,
|
|
813
|
-
width:
|
|
814
|
-
height:
|
|
821
|
+
width: z43.number(),
|
|
822
|
+
height: z43.number(),
|
|
815
823
|
layer: layer_ref,
|
|
816
|
-
pcb_component_id:
|
|
817
|
-
pcb_smtpad_id:
|
|
824
|
+
pcb_component_id: z43.string().optional(),
|
|
825
|
+
pcb_smtpad_id: z43.string().optional()
|
|
818
826
|
});
|
|
819
|
-
var pcb_solder_paste =
|
|
827
|
+
var pcb_solder_paste = z43.union([pcb_solder_paste_circle, pcb_solder_paste_rect]).describe("Defines solderpaste on the PCB");
|
|
820
828
|
expectTypesMatch(true);
|
|
821
829
|
expectTypesMatch(true);
|
|
822
830
|
|
|
823
831
|
// src/pcb/pcb_text.ts
|
|
824
|
-
import { z as
|
|
825
|
-
var pcb_text =
|
|
826
|
-
type:
|
|
832
|
+
import { z as z44 } from "zod";
|
|
833
|
+
var pcb_text = z44.object({
|
|
834
|
+
type: z44.literal("pcb_text"),
|
|
827
835
|
pcb_text_id: getZodPrefixedIdWithDefault("pcb_text"),
|
|
828
|
-
text:
|
|
836
|
+
text: z44.string(),
|
|
829
837
|
center: point,
|
|
830
838
|
layer: layer_ref,
|
|
831
839
|
width: length,
|
|
832
840
|
height: length,
|
|
833
|
-
lines:
|
|
834
|
-
align:
|
|
841
|
+
lines: z44.number(),
|
|
842
|
+
align: z44.enum(["bottom-left"])
|
|
835
843
|
}).describe("Defines text on the PCB");
|
|
836
844
|
expectTypesMatch(true);
|
|
837
845
|
|
|
838
846
|
// src/pcb/pcb_trace.ts
|
|
839
|
-
import { z as
|
|
840
|
-
var pcb_trace_route_point_wire =
|
|
841
|
-
route_type:
|
|
847
|
+
import { z as z45 } from "zod";
|
|
848
|
+
var pcb_trace_route_point_wire = z45.object({
|
|
849
|
+
route_type: z45.literal("wire"),
|
|
842
850
|
x: distance,
|
|
843
851
|
y: distance,
|
|
844
852
|
width: distance,
|
|
845
|
-
start_pcb_port_id:
|
|
846
|
-
end_pcb_port_id:
|
|
853
|
+
start_pcb_port_id: z45.string().optional(),
|
|
854
|
+
end_pcb_port_id: z45.string().optional(),
|
|
847
855
|
layer: layer_ref
|
|
848
856
|
});
|
|
849
|
-
var pcb_trace_route_point_via =
|
|
850
|
-
route_type:
|
|
857
|
+
var pcb_trace_route_point_via = z45.object({
|
|
858
|
+
route_type: z45.literal("via"),
|
|
851
859
|
x: distance,
|
|
852
860
|
y: distance,
|
|
853
|
-
from_layer:
|
|
854
|
-
to_layer:
|
|
861
|
+
from_layer: z45.string(),
|
|
862
|
+
to_layer: z45.string()
|
|
855
863
|
});
|
|
856
|
-
var pcb_trace_route_point =
|
|
864
|
+
var pcb_trace_route_point = z45.union([
|
|
857
865
|
pcb_trace_route_point_wire,
|
|
858
866
|
pcb_trace_route_point_via
|
|
859
867
|
]);
|
|
860
|
-
var pcb_trace =
|
|
861
|
-
type:
|
|
862
|
-
source_trace_id:
|
|
863
|
-
pcb_component_id:
|
|
868
|
+
var pcb_trace = z45.object({
|
|
869
|
+
type: z45.literal("pcb_trace"),
|
|
870
|
+
source_trace_id: z45.string().optional(),
|
|
871
|
+
pcb_component_id: z45.string().optional(),
|
|
864
872
|
pcb_trace_id: getZodPrefixedIdWithDefault("pcb_trace"),
|
|
865
|
-
route_thickness_mode:
|
|
866
|
-
route_order_index:
|
|
867
|
-
should_round_corners:
|
|
868
|
-
route:
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
route_type:
|
|
873
|
+
route_thickness_mode: z45.enum(["constant", "interpolated"]).default("constant").optional(),
|
|
874
|
+
route_order_index: z45.number().optional(),
|
|
875
|
+
should_round_corners: z45.boolean().optional(),
|
|
876
|
+
route: z45.array(
|
|
877
|
+
z45.union([
|
|
878
|
+
z45.object({
|
|
879
|
+
route_type: z45.literal("wire"),
|
|
872
880
|
x: distance,
|
|
873
881
|
y: distance,
|
|
874
882
|
width: distance,
|
|
875
|
-
start_pcb_port_id:
|
|
876
|
-
end_pcb_port_id:
|
|
883
|
+
start_pcb_port_id: z45.string().optional(),
|
|
884
|
+
end_pcb_port_id: z45.string().optional(),
|
|
877
885
|
layer: layer_ref
|
|
878
886
|
}),
|
|
879
|
-
|
|
880
|
-
route_type:
|
|
887
|
+
z45.object({
|
|
888
|
+
route_type: z45.literal("via"),
|
|
881
889
|
x: distance,
|
|
882
890
|
y: distance,
|
|
883
|
-
from_layer:
|
|
884
|
-
to_layer:
|
|
891
|
+
from_layer: z45.string(),
|
|
892
|
+
to_layer: z45.string()
|
|
885
893
|
})
|
|
886
894
|
])
|
|
887
895
|
)
|
|
@@ -890,34 +898,34 @@ expectTypesMatch(true);
|
|
|
890
898
|
expectTypesMatch(true);
|
|
891
899
|
|
|
892
900
|
// src/pcb/pcb_trace_error.ts
|
|
893
|
-
import { z as
|
|
894
|
-
var pcb_trace_error =
|
|
895
|
-
type:
|
|
901
|
+
import { z as z46 } from "zod";
|
|
902
|
+
var pcb_trace_error = z46.object({
|
|
903
|
+
type: z46.literal("pcb_trace_error"),
|
|
896
904
|
pcb_trace_error_id: getZodPrefixedIdWithDefault("pcb_trace_error"),
|
|
897
|
-
error_type:
|
|
898
|
-
message:
|
|
905
|
+
error_type: z46.literal("pcb_trace_error"),
|
|
906
|
+
message: z46.string(),
|
|
899
907
|
center: point.optional(),
|
|
900
|
-
pcb_trace_id:
|
|
901
|
-
source_trace_id:
|
|
902
|
-
pcb_component_ids:
|
|
903
|
-
pcb_port_ids:
|
|
908
|
+
pcb_trace_id: z46.string(),
|
|
909
|
+
source_trace_id: z46.string(),
|
|
910
|
+
pcb_component_ids: z46.array(z46.string()),
|
|
911
|
+
pcb_port_ids: z46.array(z46.string())
|
|
904
912
|
}).describe("Defines a trace error on the PCB");
|
|
905
913
|
expectTypesMatch(true);
|
|
906
914
|
|
|
907
915
|
// src/pcb/pcb_port_not_matched_error.ts
|
|
908
|
-
import { z as
|
|
909
|
-
var pcb_port_not_matched_error =
|
|
910
|
-
type:
|
|
916
|
+
import { z as z47 } from "zod";
|
|
917
|
+
var pcb_port_not_matched_error = z47.object({
|
|
918
|
+
type: z47.literal("pcb_port_not_matched_error"),
|
|
911
919
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
912
|
-
message:
|
|
913
|
-
pcb_component_ids:
|
|
920
|
+
message: z47.string(),
|
|
921
|
+
pcb_component_ids: z47.array(z47.string())
|
|
914
922
|
}).describe("Defines a trace error on the PCB where a port is not matched");
|
|
915
923
|
expectTypesMatch(true);
|
|
916
924
|
|
|
917
925
|
// src/pcb/pcb_via.ts
|
|
918
|
-
import { z as
|
|
919
|
-
var pcb_via =
|
|
920
|
-
type:
|
|
926
|
+
import { z as z48 } from "zod";
|
|
927
|
+
var pcb_via = z48.object({
|
|
928
|
+
type: z48.literal("pcb_via"),
|
|
921
929
|
pcb_via_id: getZodPrefixedIdWithDefault("pcb_via"),
|
|
922
930
|
x: distance,
|
|
923
931
|
y: distance,
|
|
@@ -927,51 +935,51 @@ var pcb_via = z47.object({
|
|
|
927
935
|
from_layer: layer_ref.optional(),
|
|
928
936
|
/** @deprecated */
|
|
929
937
|
to_layer: layer_ref.optional(),
|
|
930
|
-
layers:
|
|
931
|
-
pcb_trace_id:
|
|
938
|
+
layers: z48.array(layer_ref),
|
|
939
|
+
pcb_trace_id: z48.string().optional()
|
|
932
940
|
}).describe("Defines a via on the PCB");
|
|
933
941
|
expectTypesMatch(true);
|
|
934
942
|
|
|
935
943
|
// src/pcb/pcb_board.ts
|
|
936
|
-
import { z as
|
|
937
|
-
var pcb_board =
|
|
938
|
-
type:
|
|
944
|
+
import { z as z49 } from "zod";
|
|
945
|
+
var pcb_board = z49.object({
|
|
946
|
+
type: z49.literal("pcb_board"),
|
|
939
947
|
pcb_board_id: getZodPrefixedIdWithDefault("pcb_board"),
|
|
940
948
|
width: length,
|
|
941
949
|
height: length,
|
|
942
950
|
center: point,
|
|
943
951
|
thickness: length.optional().default(1.4),
|
|
944
|
-
num_layers:
|
|
945
|
-
outline:
|
|
952
|
+
num_layers: z49.number().optional().default(4),
|
|
953
|
+
outline: z49.array(point).optional()
|
|
946
954
|
}).describe("Defines the board outline of the PCB");
|
|
947
955
|
expectTypesMatch(true);
|
|
948
956
|
|
|
949
957
|
// src/pcb/pcb_placement_error.ts
|
|
950
|
-
import { z as
|
|
951
|
-
var pcb_placement_error =
|
|
952
|
-
type:
|
|
958
|
+
import { z as z50 } from "zod";
|
|
959
|
+
var pcb_placement_error = z50.object({
|
|
960
|
+
type: z50.literal("pcb_placement_error"),
|
|
953
961
|
pcb_placement_error_id: getZodPrefixedIdWithDefault("pcb_placement_error"),
|
|
954
|
-
message:
|
|
962
|
+
message: z50.string()
|
|
955
963
|
}).describe("Defines a placement error on the PCB");
|
|
956
964
|
expectTypesMatch(true);
|
|
957
965
|
|
|
958
966
|
// src/pcb/pcb_trace_hint.ts
|
|
959
|
-
import { z as
|
|
960
|
-
var pcb_trace_hint =
|
|
961
|
-
type:
|
|
967
|
+
import { z as z51 } from "zod";
|
|
968
|
+
var pcb_trace_hint = z51.object({
|
|
969
|
+
type: z51.literal("pcb_trace_hint"),
|
|
962
970
|
pcb_trace_hint_id: getZodPrefixedIdWithDefault("pcb_trace_hint"),
|
|
963
|
-
pcb_port_id:
|
|
964
|
-
pcb_component_id:
|
|
965
|
-
route:
|
|
971
|
+
pcb_port_id: z51.string(),
|
|
972
|
+
pcb_component_id: z51.string(),
|
|
973
|
+
route: z51.array(route_hint_point)
|
|
966
974
|
}).describe("A hint that can be used during generation of a PCB trace");
|
|
967
975
|
expectTypesMatch(true);
|
|
968
976
|
|
|
969
977
|
// src/pcb/pcb_silkscreen_line.ts
|
|
970
|
-
import { z as
|
|
971
|
-
var pcb_silkscreen_line =
|
|
972
|
-
type:
|
|
978
|
+
import { z as z52 } from "zod";
|
|
979
|
+
var pcb_silkscreen_line = z52.object({
|
|
980
|
+
type: z52.literal("pcb_silkscreen_line"),
|
|
973
981
|
pcb_silkscreen_line_id: getZodPrefixedIdWithDefault("pcb_silkscreen_line"),
|
|
974
|
-
pcb_component_id:
|
|
982
|
+
pcb_component_id: z52.string(),
|
|
975
983
|
stroke_width: distance.default("0.1mm"),
|
|
976
984
|
x1: distance,
|
|
977
985
|
y1: distance,
|
|
@@ -982,39 +990,39 @@ var pcb_silkscreen_line = z51.object({
|
|
|
982
990
|
expectTypesMatch(true);
|
|
983
991
|
|
|
984
992
|
// src/pcb/pcb_silkscreen_path.ts
|
|
985
|
-
import { z as
|
|
986
|
-
var pcb_silkscreen_path =
|
|
987
|
-
type:
|
|
993
|
+
import { z as z53 } from "zod";
|
|
994
|
+
var pcb_silkscreen_path = z53.object({
|
|
995
|
+
type: z53.literal("pcb_silkscreen_path"),
|
|
988
996
|
pcb_silkscreen_path_id: getZodPrefixedIdWithDefault("pcb_silkscreen_path"),
|
|
989
|
-
pcb_component_id:
|
|
997
|
+
pcb_component_id: z53.string(),
|
|
990
998
|
layer: visible_layer,
|
|
991
|
-
route:
|
|
999
|
+
route: z53.array(point),
|
|
992
1000
|
stroke_width: length
|
|
993
1001
|
}).describe("Defines a silkscreen path on the PCB");
|
|
994
1002
|
expectTypesMatch(true);
|
|
995
1003
|
|
|
996
1004
|
// src/pcb/pcb_silkscreen_text.ts
|
|
997
|
-
import { z as
|
|
998
|
-
var pcb_silkscreen_text =
|
|
999
|
-
type:
|
|
1005
|
+
import { z as z54 } from "zod";
|
|
1006
|
+
var pcb_silkscreen_text = z54.object({
|
|
1007
|
+
type: z54.literal("pcb_silkscreen_text"),
|
|
1000
1008
|
pcb_silkscreen_text_id: getZodPrefixedIdWithDefault("pcb_silkscreen_text"),
|
|
1001
|
-
font:
|
|
1009
|
+
font: z54.literal("tscircuit2024").default("tscircuit2024"),
|
|
1002
1010
|
font_size: distance.default("0.2mm"),
|
|
1003
|
-
pcb_component_id:
|
|
1004
|
-
text:
|
|
1011
|
+
pcb_component_id: z54.string(),
|
|
1012
|
+
text: z54.string(),
|
|
1005
1013
|
layer: layer_ref,
|
|
1006
|
-
is_mirrored:
|
|
1014
|
+
is_mirrored: z54.boolean().default(false).optional(),
|
|
1007
1015
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
1008
|
-
anchor_alignment:
|
|
1016
|
+
anchor_alignment: z54.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center")
|
|
1009
1017
|
}).describe("Defines silkscreen text on the PCB");
|
|
1010
1018
|
expectTypesMatch(true);
|
|
1011
1019
|
|
|
1012
1020
|
// src/pcb/pcb_silkscreen_rect.ts
|
|
1013
|
-
import { z as
|
|
1014
|
-
var pcb_silkscreen_rect =
|
|
1015
|
-
type:
|
|
1021
|
+
import { z as z55 } from "zod";
|
|
1022
|
+
var pcb_silkscreen_rect = z55.object({
|
|
1023
|
+
type: z55.literal("pcb_silkscreen_rect"),
|
|
1016
1024
|
pcb_silkscreen_rect_id: getZodPrefixedIdWithDefault("pcb_silkscreen_rect"),
|
|
1017
|
-
pcb_component_id:
|
|
1025
|
+
pcb_component_id: z55.string(),
|
|
1018
1026
|
center: point,
|
|
1019
1027
|
width: length,
|
|
1020
1028
|
height: length,
|
|
@@ -1023,13 +1031,13 @@ var pcb_silkscreen_rect = z54.object({
|
|
|
1023
1031
|
expectTypesMatch(true);
|
|
1024
1032
|
|
|
1025
1033
|
// src/pcb/pcb_silkscreen_circle.ts
|
|
1026
|
-
import { z as
|
|
1027
|
-
var pcb_silkscreen_circle =
|
|
1028
|
-
type:
|
|
1034
|
+
import { z as z56 } from "zod";
|
|
1035
|
+
var pcb_silkscreen_circle = z56.object({
|
|
1036
|
+
type: z56.literal("pcb_silkscreen_circle"),
|
|
1029
1037
|
pcb_silkscreen_circle_id: getZodPrefixedIdWithDefault(
|
|
1030
1038
|
"pcb_silkscreen_circle"
|
|
1031
1039
|
),
|
|
1032
|
-
pcb_component_id:
|
|
1040
|
+
pcb_component_id: z56.string(),
|
|
1033
1041
|
center: point,
|
|
1034
1042
|
radius: length,
|
|
1035
1043
|
layer: visible_layer
|
|
@@ -1037,11 +1045,11 @@ var pcb_silkscreen_circle = z55.object({
|
|
|
1037
1045
|
expectTypesMatch(true);
|
|
1038
1046
|
|
|
1039
1047
|
// src/pcb/pcb_silkscreen_oval.ts
|
|
1040
|
-
import { z as
|
|
1041
|
-
var pcb_silkscreen_oval =
|
|
1042
|
-
type:
|
|
1048
|
+
import { z as z57 } from "zod";
|
|
1049
|
+
var pcb_silkscreen_oval = z57.object({
|
|
1050
|
+
type: z57.literal("pcb_silkscreen_oval"),
|
|
1043
1051
|
pcb_silkscreen_oval_id: getZodPrefixedIdWithDefault("pcb_silkscreen_oval"),
|
|
1044
|
-
pcb_component_id:
|
|
1052
|
+
pcb_component_id: z57.string(),
|
|
1045
1053
|
center: point,
|
|
1046
1054
|
radius_x: distance,
|
|
1047
1055
|
radius_y: distance,
|
|
@@ -1050,106 +1058,106 @@ var pcb_silkscreen_oval = z56.object({
|
|
|
1050
1058
|
expectTypesMatch(true);
|
|
1051
1059
|
|
|
1052
1060
|
// src/pcb/pcb_fabrication_note_text.ts
|
|
1053
|
-
import { z as
|
|
1054
|
-
var pcb_fabrication_note_text =
|
|
1055
|
-
type:
|
|
1061
|
+
import { z as z58 } from "zod";
|
|
1062
|
+
var pcb_fabrication_note_text = z58.object({
|
|
1063
|
+
type: z58.literal("pcb_fabrication_note_text"),
|
|
1056
1064
|
pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(
|
|
1057
1065
|
"pcb_fabrication_note_text"
|
|
1058
1066
|
),
|
|
1059
|
-
font:
|
|
1067
|
+
font: z58.literal("tscircuit2024").default("tscircuit2024"),
|
|
1060
1068
|
font_size: distance.default("1mm"),
|
|
1061
|
-
pcb_component_id:
|
|
1062
|
-
text:
|
|
1069
|
+
pcb_component_id: z58.string(),
|
|
1070
|
+
text: z58.string(),
|
|
1063
1071
|
layer: visible_layer,
|
|
1064
1072
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
1065
|
-
anchor_alignment:
|
|
1066
|
-
color:
|
|
1073
|
+
anchor_alignment: z58.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1074
|
+
color: z58.string().optional()
|
|
1067
1075
|
}).describe(
|
|
1068
1076
|
"Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"
|
|
1069
1077
|
);
|
|
1070
1078
|
expectTypesMatch(true);
|
|
1071
1079
|
|
|
1072
1080
|
// src/pcb/pcb_fabrication_note_path.ts
|
|
1073
|
-
import { z as
|
|
1074
|
-
var pcb_fabrication_note_path =
|
|
1075
|
-
type:
|
|
1081
|
+
import { z as z59 } from "zod";
|
|
1082
|
+
var pcb_fabrication_note_path = z59.object({
|
|
1083
|
+
type: z59.literal("pcb_fabrication_note_path"),
|
|
1076
1084
|
pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(
|
|
1077
1085
|
"pcb_fabrication_note_path"
|
|
1078
1086
|
),
|
|
1079
|
-
pcb_component_id:
|
|
1087
|
+
pcb_component_id: z59.string(),
|
|
1080
1088
|
layer: layer_ref,
|
|
1081
|
-
route:
|
|
1089
|
+
route: z59.array(point),
|
|
1082
1090
|
stroke_width: length,
|
|
1083
|
-
color:
|
|
1091
|
+
color: z59.string().optional()
|
|
1084
1092
|
}).describe(
|
|
1085
1093
|
"Defines a fabrication path on the PCB for fabricators or assemblers"
|
|
1086
1094
|
);
|
|
1087
1095
|
expectTypesMatch(true);
|
|
1088
1096
|
|
|
1089
1097
|
// src/pcb/pcb_keepout.ts
|
|
1090
|
-
import { z as
|
|
1091
|
-
var pcb_keepout =
|
|
1092
|
-
type:
|
|
1093
|
-
shape:
|
|
1098
|
+
import { z as z60 } from "zod";
|
|
1099
|
+
var pcb_keepout = z60.object({
|
|
1100
|
+
type: z60.literal("pcb_keepout"),
|
|
1101
|
+
shape: z60.literal("rect"),
|
|
1094
1102
|
center: point,
|
|
1095
1103
|
width: distance,
|
|
1096
1104
|
height: distance,
|
|
1097
|
-
pcb_keepout_id:
|
|
1098
|
-
layers:
|
|
1105
|
+
pcb_keepout_id: z60.string(),
|
|
1106
|
+
layers: z60.array(z60.string()),
|
|
1099
1107
|
// Specify layers where the keepout applies
|
|
1100
|
-
description:
|
|
1108
|
+
description: z60.string().optional()
|
|
1101
1109
|
// Optional description of the keepout
|
|
1102
1110
|
}).or(
|
|
1103
|
-
|
|
1104
|
-
type:
|
|
1105
|
-
shape:
|
|
1111
|
+
z60.object({
|
|
1112
|
+
type: z60.literal("pcb_keepout"),
|
|
1113
|
+
shape: z60.literal("circle"),
|
|
1106
1114
|
center: point,
|
|
1107
1115
|
radius: distance,
|
|
1108
|
-
pcb_keepout_id:
|
|
1109
|
-
layers:
|
|
1116
|
+
pcb_keepout_id: z60.string(),
|
|
1117
|
+
layers: z60.array(z60.string()),
|
|
1110
1118
|
// Specify layers where the keepout applies
|
|
1111
|
-
description:
|
|
1119
|
+
description: z60.string().optional()
|
|
1112
1120
|
// Optional description of the keepout
|
|
1113
1121
|
})
|
|
1114
1122
|
);
|
|
1115
1123
|
|
|
1116
1124
|
// src/pcb/pcb_missing_footprint_error.ts
|
|
1117
|
-
import { z as
|
|
1118
|
-
var pcb_missing_footprint_error =
|
|
1119
|
-
type:
|
|
1125
|
+
import { z as z61 } from "zod";
|
|
1126
|
+
var pcb_missing_footprint_error = z61.object({
|
|
1127
|
+
type: z61.literal("pcb_missing_footprint_error"),
|
|
1120
1128
|
pcb_missing_footprint_error_id: getZodPrefixedIdWithDefault(
|
|
1121
1129
|
"pcb_missing_footprint_error"
|
|
1122
1130
|
),
|
|
1123
|
-
error_type:
|
|
1124
|
-
source_component_id:
|
|
1125
|
-
message:
|
|
1131
|
+
error_type: z61.literal("pcb_missing_footprint_error"),
|
|
1132
|
+
source_component_id: z61.string(),
|
|
1133
|
+
message: z61.string()
|
|
1126
1134
|
}).describe("Defines a missing footprint error on the PCB");
|
|
1127
1135
|
expectTypesMatch(
|
|
1128
1136
|
true
|
|
1129
1137
|
);
|
|
1130
1138
|
|
|
1131
1139
|
// src/cad/cad_component.ts
|
|
1132
|
-
import { z as
|
|
1133
|
-
var cad_component =
|
|
1134
|
-
type:
|
|
1135
|
-
cad_component_id:
|
|
1136
|
-
pcb_component_id:
|
|
1137
|
-
source_component_id:
|
|
1140
|
+
import { z as z62 } from "zod";
|
|
1141
|
+
var cad_component = z62.object({
|
|
1142
|
+
type: z62.literal("cad_component"),
|
|
1143
|
+
cad_component_id: z62.string(),
|
|
1144
|
+
pcb_component_id: z62.string(),
|
|
1145
|
+
source_component_id: z62.string(),
|
|
1138
1146
|
position: point3,
|
|
1139
1147
|
rotation: point3.optional(),
|
|
1140
1148
|
size: point3.optional(),
|
|
1141
1149
|
layer: layer_ref.optional(),
|
|
1142
1150
|
// These are all ways to generate/load the 3d model
|
|
1143
|
-
footprinter_string:
|
|
1144
|
-
model_obj_url:
|
|
1145
|
-
model_stl_url:
|
|
1146
|
-
model_3mf_url:
|
|
1147
|
-
model_jscad:
|
|
1151
|
+
footprinter_string: z62.string().optional(),
|
|
1152
|
+
model_obj_url: z62.string().optional(),
|
|
1153
|
+
model_stl_url: z62.string().optional(),
|
|
1154
|
+
model_3mf_url: z62.string().optional(),
|
|
1155
|
+
model_jscad: z62.any().optional()
|
|
1148
1156
|
}).describe("Defines a component on the PCB");
|
|
1149
1157
|
|
|
1150
1158
|
// src/any_circuit_element.ts
|
|
1151
|
-
import { z as
|
|
1152
|
-
var any_circuit_element =
|
|
1159
|
+
import { z as z63 } from "zod";
|
|
1160
|
+
var any_circuit_element = z63.union([
|
|
1153
1161
|
source_trace,
|
|
1154
1162
|
source_port,
|
|
1155
1163
|
any_source_component,
|
|
@@ -1164,6 +1172,7 @@ var any_circuit_element = z62.union([
|
|
|
1164
1172
|
source_simple_power_source,
|
|
1165
1173
|
source_simple_battery,
|
|
1166
1174
|
source_simple_inductor,
|
|
1175
|
+
source_simple_potentiometer,
|
|
1167
1176
|
source_simple_push_button,
|
|
1168
1177
|
pcb_component,
|
|
1169
1178
|
pcb_hole,
|
|
@@ -1286,6 +1295,7 @@ export {
|
|
|
1286
1295
|
source_simple_diode,
|
|
1287
1296
|
source_simple_ground,
|
|
1288
1297
|
source_simple_inductor,
|
|
1298
|
+
source_simple_potentiometer,
|
|
1289
1299
|
source_simple_power_source,
|
|
1290
1300
|
source_simple_push_button,
|
|
1291
1301
|
source_simple_resistor,
|