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