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