circuit-json 0.0.202 → 0.0.204
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 +5 -4
- package/dist/index.mjs +228 -227
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -259,12 +259,26 @@ var getZodPrefixedIdWithDefault = (prefix) => {
|
|
|
259
259
|
return z5.string().optional().default(() => `${prefix}_${nanoid(10)}`);
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
+
// src/common/NinePointAnchor.ts
|
|
263
|
+
import { z as z6 } from "zod";
|
|
264
|
+
var ninePointAnchor = z6.enum([
|
|
265
|
+
"top_left",
|
|
266
|
+
"top_center",
|
|
267
|
+
"top_right",
|
|
268
|
+
"center_left",
|
|
269
|
+
"center",
|
|
270
|
+
"center_right",
|
|
271
|
+
"bottom_left",
|
|
272
|
+
"bottom_center",
|
|
273
|
+
"bottom_right"
|
|
274
|
+
]);
|
|
275
|
+
|
|
262
276
|
// src/source/source_simple_capacitor.ts
|
|
263
|
-
import { z as
|
|
277
|
+
import { z as z9 } from "zod";
|
|
264
278
|
|
|
265
279
|
// src/pcb/properties/supplier_name.ts
|
|
266
|
-
import { z as
|
|
267
|
-
var supplier_name =
|
|
280
|
+
import { z as z7 } from "zod";
|
|
281
|
+
var supplier_name = z7.enum([
|
|
268
282
|
"jlcpcb",
|
|
269
283
|
"macrofab",
|
|
270
284
|
"pcbway",
|
|
@@ -294,147 +308,147 @@ expectStringUnionsMatch(
|
|
|
294
308
|
expectStringUnionsMatch(true);
|
|
295
309
|
|
|
296
310
|
// src/source/base/source_component_base.ts
|
|
297
|
-
import { z as
|
|
298
|
-
var source_component_base =
|
|
299
|
-
type:
|
|
300
|
-
ftype:
|
|
301
|
-
source_component_id:
|
|
302
|
-
name:
|
|
303
|
-
manufacturer_part_number:
|
|
304
|
-
supplier_part_numbers:
|
|
305
|
-
display_value:
|
|
306
|
-
are_pins_interchangeable:
|
|
307
|
-
internally_connected_source_port_ids:
|
|
308
|
-
source_group_id:
|
|
311
|
+
import { z as z8 } from "zod";
|
|
312
|
+
var source_component_base = z8.object({
|
|
313
|
+
type: z8.literal("source_component"),
|
|
314
|
+
ftype: z8.string().optional(),
|
|
315
|
+
source_component_id: z8.string(),
|
|
316
|
+
name: z8.string(),
|
|
317
|
+
manufacturer_part_number: z8.string().optional(),
|
|
318
|
+
supplier_part_numbers: z8.record(supplier_name, z8.array(z8.string())).optional(),
|
|
319
|
+
display_value: z8.string().optional(),
|
|
320
|
+
are_pins_interchangeable: z8.boolean().optional(),
|
|
321
|
+
internally_connected_source_port_ids: z8.array(z8.array(z8.string())).optional(),
|
|
322
|
+
source_group_id: z8.string().optional()
|
|
309
323
|
});
|
|
310
324
|
expectTypesMatch(true);
|
|
311
325
|
|
|
312
326
|
// src/source/source_simple_capacitor.ts
|
|
313
327
|
var source_simple_capacitor = source_component_base.extend({
|
|
314
|
-
ftype:
|
|
328
|
+
ftype: z9.literal("simple_capacitor"),
|
|
315
329
|
capacitance,
|
|
316
330
|
max_voltage_rating: voltage.optional(),
|
|
317
|
-
display_capacitance:
|
|
331
|
+
display_capacitance: z9.string().optional(),
|
|
318
332
|
max_decoupling_trace_length: distance.optional()
|
|
319
333
|
});
|
|
320
334
|
expectTypesMatch(true);
|
|
321
335
|
|
|
322
336
|
// src/source/source_simple_resistor.ts
|
|
323
|
-
import { z as
|
|
337
|
+
import { z as z10 } from "zod";
|
|
324
338
|
var source_simple_resistor = source_component_base.extend({
|
|
325
|
-
ftype:
|
|
339
|
+
ftype: z10.literal("simple_resistor"),
|
|
326
340
|
resistance,
|
|
327
|
-
display_resistance:
|
|
341
|
+
display_resistance: z10.string().optional()
|
|
328
342
|
});
|
|
329
343
|
expectTypesMatch(true);
|
|
330
344
|
|
|
331
345
|
// src/source/source_simple_diode.ts
|
|
332
|
-
import { z as
|
|
346
|
+
import { z as z11 } from "zod";
|
|
333
347
|
var source_simple_diode = source_component_base.extend({
|
|
334
|
-
ftype:
|
|
348
|
+
ftype: z11.literal("simple_diode")
|
|
335
349
|
});
|
|
336
350
|
expectTypesMatch(true);
|
|
337
351
|
|
|
338
352
|
// src/source/source_simple_led.ts
|
|
339
|
-
import { z as
|
|
353
|
+
import { z as z12 } from "zod";
|
|
340
354
|
var source_simple_led = source_simple_diode.extend({
|
|
341
|
-
ftype:
|
|
342
|
-
color:
|
|
343
|
-
wavelength:
|
|
355
|
+
ftype: z12.literal("simple_led"),
|
|
356
|
+
color: z12.string().optional(),
|
|
357
|
+
wavelength: z12.string().optional()
|
|
344
358
|
});
|
|
345
359
|
expectTypesMatch(true);
|
|
346
360
|
|
|
347
361
|
// src/source/source_simple_ground.ts
|
|
348
|
-
import { z as
|
|
362
|
+
import { z as z13 } from "zod";
|
|
349
363
|
var source_simple_ground = source_component_base.extend({
|
|
350
|
-
ftype:
|
|
364
|
+
ftype: z13.literal("simple_ground")
|
|
351
365
|
});
|
|
352
366
|
expectTypesMatch(true);
|
|
353
367
|
|
|
354
368
|
// src/source/source_simple_bug.ts
|
|
355
|
-
import { z as
|
|
369
|
+
import { z as z14 } from "zod";
|
|
356
370
|
var source_simple_bug = source_component_base.extend({
|
|
357
|
-
ftype:
|
|
371
|
+
ftype: z14.literal("simple_bug")
|
|
358
372
|
}).describe("@deprecated");
|
|
359
373
|
|
|
360
374
|
// src/source/source_simple_chip.ts
|
|
361
|
-
import { z as
|
|
375
|
+
import { z as z15 } from "zod";
|
|
362
376
|
var source_simple_chip = source_component_base.extend({
|
|
363
|
-
ftype:
|
|
377
|
+
ftype: z15.literal("simple_chip")
|
|
364
378
|
});
|
|
365
379
|
expectTypesMatch(true);
|
|
366
380
|
|
|
367
381
|
// src/source/source_simple_power_source.ts
|
|
368
|
-
import { z as
|
|
382
|
+
import { z as z16 } from "zod";
|
|
369
383
|
var source_simple_power_source = source_component_base.extend({
|
|
370
|
-
ftype:
|
|
384
|
+
ftype: z16.literal("simple_power_source"),
|
|
371
385
|
voltage
|
|
372
386
|
});
|
|
373
387
|
expectTypesMatch(true);
|
|
374
388
|
|
|
375
389
|
// src/source/any_source_component.ts
|
|
376
|
-
import { z as
|
|
390
|
+
import { z as z32 } from "zod";
|
|
377
391
|
|
|
378
392
|
// src/source/source_simple_fuse.ts
|
|
379
|
-
import { z as
|
|
393
|
+
import { z as z17 } from "zod";
|
|
380
394
|
var source_simple_fuse = source_component_base.extend({
|
|
381
|
-
ftype:
|
|
382
|
-
current_rating_amps:
|
|
383
|
-
voltage_rating_volts:
|
|
395
|
+
ftype: z17.literal("simple_fuse"),
|
|
396
|
+
current_rating_amps: z17.number().describe("Nominal current in amps the fuse is rated for"),
|
|
397
|
+
voltage_rating_volts: z17.number().describe("Voltage rating in volts, e.g. \xB15V would be 5")
|
|
384
398
|
});
|
|
385
399
|
expectTypesMatch(true);
|
|
386
400
|
|
|
387
401
|
// src/source/source_simple_battery.ts
|
|
388
|
-
import { z as
|
|
402
|
+
import { z as z18 } from "zod";
|
|
389
403
|
var source_simple_battery = source_component_base.extend({
|
|
390
|
-
ftype:
|
|
404
|
+
ftype: z18.literal("simple_battery"),
|
|
391
405
|
capacity: battery_capacity
|
|
392
406
|
});
|
|
393
407
|
expectTypesMatch(true);
|
|
394
408
|
|
|
395
409
|
// src/source/source_simple_inductor.ts
|
|
396
|
-
import { z as
|
|
410
|
+
import { z as z19 } from "zod";
|
|
397
411
|
var source_simple_inductor = source_component_base.extend({
|
|
398
|
-
ftype:
|
|
412
|
+
ftype: z19.literal("simple_inductor"),
|
|
399
413
|
inductance
|
|
400
414
|
});
|
|
401
415
|
expectTypesMatch(true);
|
|
402
416
|
|
|
403
417
|
// src/source/source_simple_push_button.ts
|
|
404
|
-
import { z as
|
|
418
|
+
import { z as z20 } from "zod";
|
|
405
419
|
var source_simple_push_button = source_component_base.extend({
|
|
406
|
-
ftype:
|
|
420
|
+
ftype: z20.literal("simple_push_button")
|
|
407
421
|
});
|
|
408
422
|
expectTypesMatch(true);
|
|
409
423
|
|
|
410
424
|
// src/source/source_simple_potentiometer.ts
|
|
411
|
-
import { z as
|
|
425
|
+
import { z as z21 } from "zod";
|
|
412
426
|
var source_simple_potentiometer = source_component_base.extend({
|
|
413
|
-
ftype:
|
|
427
|
+
ftype: z21.literal("simple_potentiometer"),
|
|
414
428
|
max_resistance: resistance
|
|
415
429
|
});
|
|
416
430
|
|
|
417
431
|
// src/source/source_simple_crystal.ts
|
|
418
|
-
import { z as
|
|
432
|
+
import { z as z22 } from "zod";
|
|
419
433
|
var source_simple_crystal = source_component_base.extend({
|
|
420
|
-
ftype:
|
|
421
|
-
frequency:
|
|
422
|
-
load_capacitance:
|
|
434
|
+
ftype: z22.literal("simple_crystal"),
|
|
435
|
+
frequency: z22.number().describe("Frequency in Hz"),
|
|
436
|
+
load_capacitance: z22.number().optional().describe("Load capacitance in pF")
|
|
423
437
|
});
|
|
424
438
|
expectTypesMatch(true);
|
|
425
439
|
|
|
426
440
|
// src/source/source_simple_pin_header.ts
|
|
427
|
-
import { z as
|
|
441
|
+
import { z as z23 } from "zod";
|
|
428
442
|
var source_simple_pin_header = source_component_base.extend({
|
|
429
|
-
ftype:
|
|
430
|
-
pin_count:
|
|
431
|
-
gender:
|
|
443
|
+
ftype: z23.literal("simple_pin_header"),
|
|
444
|
+
pin_count: z23.number(),
|
|
445
|
+
gender: z23.enum(["male", "female"]).optional().default("male")
|
|
432
446
|
});
|
|
433
447
|
|
|
434
448
|
// src/source/source_simple_resonator.ts
|
|
435
|
-
import { z as
|
|
449
|
+
import { z as z24 } from "zod";
|
|
436
450
|
var source_simple_resonator = source_component_base.extend({
|
|
437
|
-
ftype:
|
|
451
|
+
ftype: z24.literal("simple_resonator"),
|
|
438
452
|
load_capacitance: capacitance,
|
|
439
453
|
equivalent_series_resistance: resistance.optional(),
|
|
440
454
|
frequency
|
|
@@ -442,92 +456,92 @@ var source_simple_resonator = source_component_base.extend({
|
|
|
442
456
|
expectTypesMatch(true);
|
|
443
457
|
|
|
444
458
|
// src/source/source_simple_transistor.ts
|
|
445
|
-
import { z as
|
|
459
|
+
import { z as z25 } from "zod";
|
|
446
460
|
var source_simple_transistor = source_component_base.extend({
|
|
447
|
-
ftype:
|
|
448
|
-
transistor_type:
|
|
461
|
+
ftype: z25.literal("simple_transistor"),
|
|
462
|
+
transistor_type: z25.enum(["npn", "pnp"])
|
|
449
463
|
});
|
|
450
464
|
expectTypesMatch(true);
|
|
451
465
|
|
|
452
466
|
// src/source/source_simple_test_point.ts
|
|
453
|
-
import { z as
|
|
467
|
+
import { z as z26 } from "zod";
|
|
454
468
|
var source_simple_test_point = source_component_base.extend({
|
|
455
|
-
ftype:
|
|
456
|
-
footprint_variant:
|
|
457
|
-
pad_shape:
|
|
458
|
-
pad_diameter:
|
|
459
|
-
hole_diameter:
|
|
460
|
-
width:
|
|
461
|
-
height:
|
|
469
|
+
ftype: z26.literal("simple_test_point"),
|
|
470
|
+
footprint_variant: z26.enum(["pad", "through_hole"]).optional(),
|
|
471
|
+
pad_shape: z26.enum(["rect", "circle"]).optional(),
|
|
472
|
+
pad_diameter: z26.union([z26.number(), z26.string()]).optional(),
|
|
473
|
+
hole_diameter: z26.union([z26.number(), z26.string()]).optional(),
|
|
474
|
+
width: z26.union([z26.number(), z26.string()]).optional(),
|
|
475
|
+
height: z26.union([z26.number(), z26.string()]).optional()
|
|
462
476
|
});
|
|
463
477
|
expectTypesMatch(true);
|
|
464
478
|
|
|
465
479
|
// src/source/source_simple_mosfet.ts
|
|
466
|
-
import { z as
|
|
480
|
+
import { z as z27 } from "zod";
|
|
467
481
|
var source_simple_mosfet = source_component_base.extend({
|
|
468
|
-
ftype:
|
|
469
|
-
channel_type:
|
|
470
|
-
mosfet_mode:
|
|
482
|
+
ftype: z27.literal("simple_mosfet"),
|
|
483
|
+
channel_type: z27.enum(["n", "p"]),
|
|
484
|
+
mosfet_mode: z27.enum(["enhancement", "depletion"])
|
|
471
485
|
});
|
|
472
486
|
expectTypesMatch(true);
|
|
473
487
|
|
|
474
488
|
// src/source/source_simple_switch.ts
|
|
475
|
-
import { z as
|
|
489
|
+
import { z as z28 } from "zod";
|
|
476
490
|
var source_simple_switch = source_component_base.extend({
|
|
477
|
-
ftype:
|
|
491
|
+
ftype: z28.literal("simple_switch")
|
|
478
492
|
});
|
|
479
493
|
expectTypesMatch(true);
|
|
480
494
|
|
|
481
495
|
// src/source/source_project_metadata.ts
|
|
482
|
-
import { z as
|
|
483
|
-
var source_project_metadata =
|
|
484
|
-
type:
|
|
485
|
-
name:
|
|
486
|
-
software_used_string:
|
|
487
|
-
project_url:
|
|
488
|
-
created_at:
|
|
496
|
+
import { z as z29 } from "zod";
|
|
497
|
+
var source_project_metadata = z29.object({
|
|
498
|
+
type: z29.literal("source_project_metadata"),
|
|
499
|
+
name: z29.string().optional(),
|
|
500
|
+
software_used_string: z29.string().optional(),
|
|
501
|
+
project_url: z29.string().optional(),
|
|
502
|
+
created_at: z29.string().datetime().optional()
|
|
489
503
|
});
|
|
490
504
|
expectTypesMatch(true);
|
|
491
505
|
|
|
492
506
|
// src/source/source_missing_property_error.ts
|
|
493
|
-
import { z as
|
|
494
|
-
var source_missing_property_error =
|
|
495
|
-
type:
|
|
507
|
+
import { z as z30 } from "zod";
|
|
508
|
+
var source_missing_property_error = z30.object({
|
|
509
|
+
type: z30.literal("source_missing_property_error"),
|
|
496
510
|
source_missing_property_error_id: getZodPrefixedIdWithDefault(
|
|
497
511
|
"source_missing_property_error"
|
|
498
512
|
),
|
|
499
|
-
source_component_id:
|
|
500
|
-
property_name:
|
|
501
|
-
error_type:
|
|
502
|
-
message:
|
|
513
|
+
source_component_id: z30.string(),
|
|
514
|
+
property_name: z30.string(),
|
|
515
|
+
error_type: z30.literal("source_missing_property_error").default("source_missing_property_error"),
|
|
516
|
+
message: z30.string()
|
|
503
517
|
}).describe("The source code is missing a property");
|
|
504
518
|
expectTypesMatch(true);
|
|
505
519
|
|
|
506
520
|
// src/source/source_failed_to_create_component_error.ts
|
|
507
|
-
import { z as
|
|
508
|
-
var source_failed_to_create_component_error =
|
|
509
|
-
type:
|
|
521
|
+
import { z as z31 } from "zod";
|
|
522
|
+
var source_failed_to_create_component_error = z31.object({
|
|
523
|
+
type: z31.literal("source_failed_to_create_component_error"),
|
|
510
524
|
source_failed_to_create_component_error_id: getZodPrefixedIdWithDefault(
|
|
511
525
|
"source_failed_to_create_component_error"
|
|
512
526
|
),
|
|
513
|
-
error_type:
|
|
514
|
-
component_name:
|
|
515
|
-
subcircuit_id:
|
|
516
|
-
parent_source_component_id:
|
|
517
|
-
message:
|
|
518
|
-
pcb_center:
|
|
519
|
-
x:
|
|
520
|
-
y:
|
|
527
|
+
error_type: z31.literal("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),
|
|
528
|
+
component_name: z31.string().optional(),
|
|
529
|
+
subcircuit_id: z31.string().optional(),
|
|
530
|
+
parent_source_component_id: z31.string().optional(),
|
|
531
|
+
message: z31.string(),
|
|
532
|
+
pcb_center: z31.object({
|
|
533
|
+
x: z31.number().optional(),
|
|
534
|
+
y: z31.number().optional()
|
|
521
535
|
}).optional(),
|
|
522
|
-
schematic_center:
|
|
523
|
-
x:
|
|
524
|
-
y:
|
|
536
|
+
schematic_center: z31.object({
|
|
537
|
+
x: z31.number().optional(),
|
|
538
|
+
y: z31.number().optional()
|
|
525
539
|
}).optional()
|
|
526
540
|
}).describe("Error emitted when a component fails to be constructed");
|
|
527
541
|
expectTypesMatch(true);
|
|
528
542
|
|
|
529
543
|
// src/source/any_source_component.ts
|
|
530
|
-
var any_source_component =
|
|
544
|
+
var any_source_component = z32.union([
|
|
531
545
|
source_simple_resistor,
|
|
532
546
|
source_simple_capacitor,
|
|
533
547
|
source_simple_diode,
|
|
@@ -554,152 +568,152 @@ var any_source_component = z31.union([
|
|
|
554
568
|
]);
|
|
555
569
|
|
|
556
570
|
// src/source/source_port.ts
|
|
557
|
-
import { z as z32 } from "zod";
|
|
558
|
-
var source_port = z32.object({
|
|
559
|
-
type: z32.literal("source_port"),
|
|
560
|
-
pin_number: z32.number().optional(),
|
|
561
|
-
port_hints: z32.array(z32.string()).optional(),
|
|
562
|
-
name: z32.string(),
|
|
563
|
-
source_port_id: z32.string(),
|
|
564
|
-
source_component_id: z32.string(),
|
|
565
|
-
subcircuit_id: z32.string().optional(),
|
|
566
|
-
subcircuit_connectivity_map_key: z32.string().optional()
|
|
567
|
-
});
|
|
568
|
-
expectTypesMatch(true);
|
|
569
|
-
|
|
570
|
-
// src/source/source_trace.ts
|
|
571
571
|
import { z as z33 } from "zod";
|
|
572
|
-
var
|
|
573
|
-
type: z33.literal("
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
572
|
+
var source_port = z33.object({
|
|
573
|
+
type: z33.literal("source_port"),
|
|
574
|
+
pin_number: z33.number().optional(),
|
|
575
|
+
port_hints: z33.array(z33.string()).optional(),
|
|
576
|
+
name: z33.string(),
|
|
577
|
+
source_port_id: z33.string(),
|
|
578
|
+
source_component_id: z33.string(),
|
|
577
579
|
subcircuit_id: z33.string().optional(),
|
|
578
|
-
subcircuit_connectivity_map_key: z33.string().optional()
|
|
579
|
-
max_length: z33.number().optional(),
|
|
580
|
-
min_trace_thickness: z33.number().optional(),
|
|
581
|
-
display_name: z33.string().optional()
|
|
580
|
+
subcircuit_connectivity_map_key: z33.string().optional()
|
|
582
581
|
});
|
|
583
582
|
expectTypesMatch(true);
|
|
584
583
|
|
|
585
|
-
// src/source/
|
|
584
|
+
// src/source/source_trace.ts
|
|
586
585
|
import { z as z34 } from "zod";
|
|
587
|
-
var
|
|
588
|
-
type: z34.literal("
|
|
589
|
-
|
|
586
|
+
var source_trace = z34.object({
|
|
587
|
+
type: z34.literal("source_trace"),
|
|
588
|
+
source_trace_id: z34.string(),
|
|
589
|
+
connected_source_port_ids: z34.array(z34.string()),
|
|
590
|
+
connected_source_net_ids: z34.array(z34.string()),
|
|
590
591
|
subcircuit_id: z34.string().optional(),
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
592
|
+
subcircuit_connectivity_map_key: z34.string().optional(),
|
|
593
|
+
max_length: z34.number().optional(),
|
|
594
|
+
min_trace_thickness: z34.number().optional(),
|
|
595
|
+
display_name: z34.string().optional()
|
|
594
596
|
});
|
|
597
|
+
expectTypesMatch(true);
|
|
595
598
|
|
|
596
|
-
// src/source/
|
|
599
|
+
// src/source/source_group.ts
|
|
597
600
|
import { z as z35 } from "zod";
|
|
598
|
-
var
|
|
599
|
-
type: z35.literal("
|
|
600
|
-
|
|
601
|
-
name: z35.string(),
|
|
602
|
-
member_source_group_ids: z35.array(z35.string()),
|
|
603
|
-
is_power: z35.boolean().optional(),
|
|
604
|
-
is_ground: z35.boolean().optional(),
|
|
605
|
-
is_digital_signal: z35.boolean().optional(),
|
|
606
|
-
is_analog_signal: z35.boolean().optional(),
|
|
607
|
-
trace_width: z35.number().optional(),
|
|
601
|
+
var source_group = z35.object({
|
|
602
|
+
type: z35.literal("source_group"),
|
|
603
|
+
source_group_id: z35.string(),
|
|
608
604
|
subcircuit_id: z35.string().optional(),
|
|
609
|
-
|
|
605
|
+
parent_subcircuit_id: z35.string().optional(),
|
|
606
|
+
is_subcircuit: z35.boolean().optional(),
|
|
607
|
+
name: z35.string().optional()
|
|
610
608
|
});
|
|
611
609
|
|
|
612
|
-
// src/
|
|
610
|
+
// src/source/source_net.ts
|
|
613
611
|
import { z as z36 } from "zod";
|
|
614
|
-
var
|
|
615
|
-
type: z36.literal("
|
|
616
|
-
|
|
612
|
+
var source_net = z36.object({
|
|
613
|
+
type: z36.literal("source_net"),
|
|
614
|
+
source_net_id: z36.string(),
|
|
615
|
+
name: z36.string(),
|
|
616
|
+
member_source_group_ids: z36.array(z36.string()),
|
|
617
|
+
is_power: z36.boolean().optional(),
|
|
618
|
+
is_ground: z36.boolean().optional(),
|
|
619
|
+
is_digital_signal: z36.boolean().optional(),
|
|
620
|
+
is_analog_signal: z36.boolean().optional(),
|
|
621
|
+
trace_width: z36.number().optional(),
|
|
622
|
+
subcircuit_id: z36.string().optional(),
|
|
623
|
+
subcircuit_connectivity_map_key: z36.string().optional()
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
// src/schematic/schematic_box.ts
|
|
627
|
+
import { z as z37 } from "zod";
|
|
628
|
+
var schematic_box = z37.object({
|
|
629
|
+
type: z37.literal("schematic_box"),
|
|
630
|
+
schematic_component_id: z37.string(),
|
|
617
631
|
width: distance,
|
|
618
632
|
height: distance,
|
|
619
|
-
is_dashed:
|
|
633
|
+
is_dashed: z37.boolean().default(false),
|
|
620
634
|
x: distance,
|
|
621
635
|
y: distance
|
|
622
636
|
}).describe("Draws a box on the schematic");
|
|
623
637
|
expectTypesMatch(true);
|
|
624
638
|
|
|
625
639
|
// src/schematic/schematic_path.ts
|
|
626
|
-
import { z as
|
|
627
|
-
var schematic_path =
|
|
628
|
-
type:
|
|
629
|
-
schematic_component_id:
|
|
630
|
-
fill_color:
|
|
631
|
-
is_filled:
|
|
632
|
-
points:
|
|
640
|
+
import { z as z38 } from "zod";
|
|
641
|
+
var schematic_path = z38.object({
|
|
642
|
+
type: z38.literal("schematic_path"),
|
|
643
|
+
schematic_component_id: z38.string(),
|
|
644
|
+
fill_color: z38.enum(["red", "blue"]).optional(),
|
|
645
|
+
is_filled: z38.boolean().optional(),
|
|
646
|
+
points: z38.array(point)
|
|
633
647
|
});
|
|
634
648
|
expectTypesMatch(true);
|
|
635
649
|
|
|
636
650
|
// src/schematic/schematic_component.ts
|
|
637
|
-
import { z as
|
|
638
|
-
var schematic_pin_styles =
|
|
639
|
-
|
|
651
|
+
import { z as z39 } from "zod";
|
|
652
|
+
var schematic_pin_styles = z39.record(
|
|
653
|
+
z39.object({
|
|
640
654
|
left_margin: length.optional(),
|
|
641
655
|
right_margin: length.optional(),
|
|
642
656
|
top_margin: length.optional(),
|
|
643
657
|
bottom_margin: length.optional()
|
|
644
658
|
})
|
|
645
659
|
);
|
|
646
|
-
var schematic_component_port_arrangement_by_size =
|
|
647
|
-
left_size:
|
|
648
|
-
right_size:
|
|
649
|
-
top_size:
|
|
650
|
-
bottom_size:
|
|
660
|
+
var schematic_component_port_arrangement_by_size = z39.object({
|
|
661
|
+
left_size: z39.number(),
|
|
662
|
+
right_size: z39.number(),
|
|
663
|
+
top_size: z39.number().optional(),
|
|
664
|
+
bottom_size: z39.number().optional()
|
|
651
665
|
});
|
|
652
666
|
expectTypesMatch(true);
|
|
653
|
-
var schematic_component_port_arrangement_by_sides =
|
|
654
|
-
left_side:
|
|
655
|
-
pins:
|
|
667
|
+
var schematic_component_port_arrangement_by_sides = z39.object({
|
|
668
|
+
left_side: z39.object({
|
|
669
|
+
pins: z39.array(z39.number()),
|
|
656
670
|
// @ts-ignore
|
|
657
|
-
direction:
|
|
671
|
+
direction: z39.enum(["top-to-bottom", "bottom-to-top"]).optional()
|
|
658
672
|
}).optional(),
|
|
659
|
-
right_side:
|
|
660
|
-
pins:
|
|
673
|
+
right_side: z39.object({
|
|
674
|
+
pins: z39.array(z39.number()),
|
|
661
675
|
// @ts-ignore
|
|
662
|
-
direction:
|
|
676
|
+
direction: z39.enum(["top-to-bottom", "bottom-to-top"]).optional()
|
|
663
677
|
}).optional(),
|
|
664
|
-
top_side:
|
|
665
|
-
pins:
|
|
678
|
+
top_side: z39.object({
|
|
679
|
+
pins: z39.array(z39.number()),
|
|
666
680
|
// @ts-ignore
|
|
667
|
-
direction:
|
|
681
|
+
direction: z39.enum(["left-to-right", "right-to-left"]).optional()
|
|
668
682
|
}).optional(),
|
|
669
|
-
bottom_side:
|
|
670
|
-
pins:
|
|
683
|
+
bottom_side: z39.object({
|
|
684
|
+
pins: z39.array(z39.number()),
|
|
671
685
|
// @ts-ignore
|
|
672
|
-
direction:
|
|
686
|
+
direction: z39.enum(["left-to-right", "right-to-left"]).optional()
|
|
673
687
|
}).optional()
|
|
674
688
|
});
|
|
675
689
|
expectTypesMatch(true);
|
|
676
|
-
var port_arrangement =
|
|
690
|
+
var port_arrangement = z39.union([
|
|
677
691
|
schematic_component_port_arrangement_by_size,
|
|
678
692
|
schematic_component_port_arrangement_by_sides
|
|
679
693
|
]);
|
|
680
|
-
var schematic_component =
|
|
681
|
-
type:
|
|
694
|
+
var schematic_component = z39.object({
|
|
695
|
+
type: z39.literal("schematic_component"),
|
|
682
696
|
size,
|
|
683
697
|
center: point,
|
|
684
|
-
source_component_id:
|
|
685
|
-
schematic_component_id:
|
|
698
|
+
source_component_id: z39.string(),
|
|
699
|
+
schematic_component_id: z39.string(),
|
|
686
700
|
pin_spacing: length.optional(),
|
|
687
701
|
pin_styles: schematic_pin_styles.optional(),
|
|
688
702
|
box_width: length.optional(),
|
|
689
|
-
symbol_name:
|
|
703
|
+
symbol_name: z39.string().optional(),
|
|
690
704
|
port_arrangement: port_arrangement.optional(),
|
|
691
|
-
port_labels:
|
|
692
|
-
symbol_display_value:
|
|
693
|
-
subcircuit_id:
|
|
694
|
-
schematic_group_id:
|
|
705
|
+
port_labels: z39.record(z39.string()).optional(),
|
|
706
|
+
symbol_display_value: z39.string().optional(),
|
|
707
|
+
subcircuit_id: z39.string().optional(),
|
|
708
|
+
schematic_group_id: z39.string().optional()
|
|
695
709
|
});
|
|
696
710
|
expectTypesMatch(true);
|
|
697
711
|
|
|
698
712
|
// src/schematic/schematic_line.ts
|
|
699
|
-
import { z as
|
|
700
|
-
var schematic_line =
|
|
701
|
-
type:
|
|
702
|
-
schematic_component_id:
|
|
713
|
+
import { z as z40 } from "zod";
|
|
714
|
+
var schematic_line = z40.object({
|
|
715
|
+
type: z40.literal("schematic_line"),
|
|
716
|
+
schematic_component_id: z40.string(),
|
|
703
717
|
x1: distance,
|
|
704
718
|
x2: distance,
|
|
705
719
|
y1: distance,
|
|
@@ -708,30 +722,30 @@ var schematic_line = z39.object({
|
|
|
708
722
|
expectTypesMatch(true);
|
|
709
723
|
|
|
710
724
|
// src/schematic/schematic_trace.ts
|
|
711
|
-
import { z as
|
|
712
|
-
var schematic_trace =
|
|
713
|
-
type:
|
|
714
|
-
schematic_trace_id:
|
|
715
|
-
source_trace_id:
|
|
716
|
-
junctions:
|
|
717
|
-
|
|
718
|
-
x:
|
|
719
|
-
y:
|
|
725
|
+
import { z as z41 } from "zod";
|
|
726
|
+
var schematic_trace = z41.object({
|
|
727
|
+
type: z41.literal("schematic_trace"),
|
|
728
|
+
schematic_trace_id: z41.string(),
|
|
729
|
+
source_trace_id: z41.string(),
|
|
730
|
+
junctions: z41.array(
|
|
731
|
+
z41.object({
|
|
732
|
+
x: z41.number(),
|
|
733
|
+
y: z41.number()
|
|
720
734
|
})
|
|
721
735
|
),
|
|
722
|
-
edges:
|
|
723
|
-
|
|
724
|
-
from:
|
|
725
|
-
x:
|
|
726
|
-
y:
|
|
736
|
+
edges: z41.array(
|
|
737
|
+
z41.object({
|
|
738
|
+
from: z41.object({
|
|
739
|
+
x: z41.number(),
|
|
740
|
+
y: z41.number()
|
|
727
741
|
}),
|
|
728
|
-
to:
|
|
729
|
-
x:
|
|
730
|
-
y:
|
|
742
|
+
to: z41.object({
|
|
743
|
+
x: z41.number(),
|
|
744
|
+
y: z41.number()
|
|
731
745
|
}),
|
|
732
|
-
is_crossing:
|
|
733
|
-
from_schematic_port_id:
|
|
734
|
-
to_schematic_port_id:
|
|
746
|
+
is_crossing: z41.boolean().optional(),
|
|
747
|
+
from_schematic_port_id: z41.string().optional(),
|
|
748
|
+
to_schematic_port_id: z41.string().optional()
|
|
735
749
|
})
|
|
736
750
|
)
|
|
737
751
|
});
|
|
@@ -740,20 +754,6 @@ expectTypesMatch(true);
|
|
|
740
754
|
// src/schematic/schematic_text.ts
|
|
741
755
|
import { z as z43 } from "zod";
|
|
742
756
|
|
|
743
|
-
// src/common/NinePointAnchor.ts
|
|
744
|
-
import { z as z41 } from "zod";
|
|
745
|
-
var ninePointAnchor = z41.enum([
|
|
746
|
-
"top_left",
|
|
747
|
-
"top_center",
|
|
748
|
-
"top_right",
|
|
749
|
-
"center_left",
|
|
750
|
-
"center",
|
|
751
|
-
"center_right",
|
|
752
|
-
"bottom_left",
|
|
753
|
-
"bottom_center",
|
|
754
|
-
"bottom_right"
|
|
755
|
-
]);
|
|
756
|
-
|
|
757
757
|
// src/common/FivePointAnchor.ts
|
|
758
758
|
import { z as z42 } from "zod";
|
|
759
759
|
var fivePointAnchor = z42.enum([
|
|
@@ -1180,7 +1180,7 @@ var pcb_smtpad_polygon = z59.object({
|
|
|
1180
1180
|
pcb_component_id: z59.string().optional(),
|
|
1181
1181
|
pcb_port_id: z59.string().optional()
|
|
1182
1182
|
});
|
|
1183
|
-
var pcb_smtpad = z59.
|
|
1183
|
+
var pcb_smtpad = z59.discriminatedUnion("shape", [
|
|
1184
1184
|
pcb_smtpad_circle,
|
|
1185
1185
|
pcb_smtpad_rect,
|
|
1186
1186
|
pcb_smtpad_rotated_rect,
|
|
@@ -1817,6 +1817,7 @@ export {
|
|
|
1817
1817
|
layer_ref,
|
|
1818
1818
|
layer_string,
|
|
1819
1819
|
length,
|
|
1820
|
+
ninePointAnchor,
|
|
1820
1821
|
pcb_autorouting_error,
|
|
1821
1822
|
pcb_board,
|
|
1822
1823
|
pcb_breakout_point,
|