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