@tscircuit/props 0.0.180 → 0.0.182
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.ts +210 -1
- package/dist/index.js +323 -296
- package/dist/index.js.map +1 -1
- package/lib/components/chip.ts +14 -1
- package/lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts +29 -0
- package/lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts +30 -0
- package/lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts +0 -1
- package/lib/manual-edits/manual-edit-events/index.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -181,11 +181,11 @@ var point = z9.object({
|
|
|
181
181
|
});
|
|
182
182
|
|
|
183
183
|
// lib/components/board.ts
|
|
184
|
-
import { z as
|
|
184
|
+
import { z as z22 } from "zod";
|
|
185
185
|
|
|
186
186
|
// lib/components/group.ts
|
|
187
187
|
import { length } from "circuit-json";
|
|
188
|
-
import { z as
|
|
188
|
+
import { z as z21 } from "zod";
|
|
189
189
|
|
|
190
190
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
191
191
|
import { z as z10 } from "zod";
|
|
@@ -212,7 +212,6 @@ expectTypesMatch(true);
|
|
|
212
212
|
|
|
213
213
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
214
214
|
import { z as z12 } from "zod";
|
|
215
|
-
import "circuit-json";
|
|
216
215
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
217
216
|
pcb_edit_event_type: z12.literal("edit_trace_hint").describe("deprecated"),
|
|
218
217
|
edit_event_type: z12.literal("edit_pcb_trace_hint").optional(),
|
|
@@ -236,9 +235,29 @@ var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
|
236
235
|
});
|
|
237
236
|
expectTypesMatch(true);
|
|
238
237
|
|
|
239
|
-
// lib/manual-edits/
|
|
238
|
+
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
240
239
|
import { z as z14 } from "zod";
|
|
241
|
-
var
|
|
240
|
+
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
241
|
+
edit_event_type: z14.literal("edit_pcb_group_location"),
|
|
242
|
+
pcb_group_id: z14.string(),
|
|
243
|
+
original_center: z14.object({ x: z14.number(), y: z14.number() }),
|
|
244
|
+
new_center: z14.object({ x: z14.number(), y: z14.number() })
|
|
245
|
+
});
|
|
246
|
+
expectTypesMatch(true);
|
|
247
|
+
|
|
248
|
+
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
249
|
+
import { z as z15 } from "zod";
|
|
250
|
+
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
251
|
+
edit_event_type: z15.literal("edit_schematic_group_location"),
|
|
252
|
+
schematic_group_id: z15.string(),
|
|
253
|
+
original_center: z15.object({ x: z15.number(), y: z15.number() }),
|
|
254
|
+
new_center: z15.object({ x: z15.number(), y: z15.number() })
|
|
255
|
+
});
|
|
256
|
+
expectTypesMatch(true);
|
|
257
|
+
|
|
258
|
+
// lib/manual-edits/manual_edit_event.ts
|
|
259
|
+
import { z as z16 } from "zod";
|
|
260
|
+
var manual_edit_event = z16.union([
|
|
242
261
|
edit_pcb_component_location_event,
|
|
243
262
|
edit_trace_hint_event,
|
|
244
263
|
edit_schematic_component_location_event
|
|
@@ -246,33 +265,33 @@ var manual_edit_event = z14.union([
|
|
|
246
265
|
expectTypesMatch(true);
|
|
247
266
|
|
|
248
267
|
// lib/manual-edits/manual_edits_file.ts
|
|
249
|
-
import { z as
|
|
268
|
+
import { z as z20 } from "zod";
|
|
250
269
|
|
|
251
270
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
252
|
-
import { z as
|
|
271
|
+
import { z as z17 } from "zod";
|
|
253
272
|
import { point as point2 } from "circuit-json";
|
|
254
|
-
var manual_pcb_placement =
|
|
255
|
-
selector:
|
|
256
|
-
relative_to:
|
|
273
|
+
var manual_pcb_placement = z17.object({
|
|
274
|
+
selector: z17.string(),
|
|
275
|
+
relative_to: z17.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
257
276
|
center: point2
|
|
258
277
|
});
|
|
259
278
|
expectTypesMatch(true);
|
|
260
279
|
|
|
261
280
|
// lib/manual-edits/manual_trace_hint.ts
|
|
262
|
-
import { z as
|
|
263
|
-
import { route_hint_point
|
|
264
|
-
var manual_trace_hint =
|
|
265
|
-
pcb_port_selector:
|
|
266
|
-
offsets:
|
|
281
|
+
import { z as z18 } from "zod";
|
|
282
|
+
import { route_hint_point } from "circuit-json";
|
|
283
|
+
var manual_trace_hint = z18.object({
|
|
284
|
+
pcb_port_selector: z18.string(),
|
|
285
|
+
offsets: z18.array(route_hint_point)
|
|
267
286
|
});
|
|
268
287
|
expectTypesMatch(true);
|
|
269
288
|
|
|
270
289
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
271
|
-
import { z as
|
|
290
|
+
import { z as z19 } from "zod";
|
|
272
291
|
import { point as point4 } from "circuit-json";
|
|
273
|
-
var manual_schematic_placement =
|
|
274
|
-
selector:
|
|
275
|
-
relative_to:
|
|
292
|
+
var manual_schematic_placement = z19.object({
|
|
293
|
+
selector: z19.string(),
|
|
294
|
+
relative_to: z19.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
276
295
|
center: point4
|
|
277
296
|
});
|
|
278
297
|
expectTypesMatch(
|
|
@@ -280,57 +299,57 @@ expectTypesMatch(
|
|
|
280
299
|
);
|
|
281
300
|
|
|
282
301
|
// lib/manual-edits/manual_edits_file.ts
|
|
283
|
-
var manual_edits_file =
|
|
284
|
-
pcb_placements:
|
|
285
|
-
manual_trace_hints:
|
|
286
|
-
schematic_placements:
|
|
302
|
+
var manual_edits_file = z20.object({
|
|
303
|
+
pcb_placements: z20.array(manual_pcb_placement).optional(),
|
|
304
|
+
manual_trace_hints: z20.array(manual_trace_hint).optional(),
|
|
305
|
+
schematic_placements: z20.array(manual_schematic_placement).optional()
|
|
287
306
|
});
|
|
288
307
|
expectTypesMatch(true);
|
|
289
308
|
|
|
290
309
|
// lib/components/group.ts
|
|
291
|
-
var layoutConfig =
|
|
292
|
-
layoutMode:
|
|
293
|
-
position:
|
|
294
|
-
grid:
|
|
295
|
-
gridCols:
|
|
296
|
-
gridRows:
|
|
297
|
-
gridTemplateRows:
|
|
298
|
-
gridTemplateColumns:
|
|
299
|
-
gridTemplate:
|
|
300
|
-
gridGap:
|
|
301
|
-
flex:
|
|
302
|
-
flexDirection:
|
|
303
|
-
alignItems:
|
|
304
|
-
justifyContent:
|
|
305
|
-
flexRow:
|
|
306
|
-
flexColumn:
|
|
307
|
-
gap:
|
|
310
|
+
var layoutConfig = z21.object({
|
|
311
|
+
layoutMode: z21.enum(["grid", "flex", "none"]).optional(),
|
|
312
|
+
position: z21.enum(["absolute", "relative"]).optional(),
|
|
313
|
+
grid: z21.boolean().optional(),
|
|
314
|
+
gridCols: z21.number().or(z21.string()).optional(),
|
|
315
|
+
gridRows: z21.number().or(z21.string()).optional(),
|
|
316
|
+
gridTemplateRows: z21.string().optional(),
|
|
317
|
+
gridTemplateColumns: z21.string().optional(),
|
|
318
|
+
gridTemplate: z21.string().optional(),
|
|
319
|
+
gridGap: z21.number().or(z21.string()).optional(),
|
|
320
|
+
flex: z21.boolean().or(z21.string()).optional(),
|
|
321
|
+
flexDirection: z21.enum(["row", "column"]).optional(),
|
|
322
|
+
alignItems: z21.enum(["start", "center", "end", "stretch"]).optional(),
|
|
323
|
+
justifyContent: z21.enum(["start", "center", "end", "stretch"]).optional(),
|
|
324
|
+
flexRow: z21.boolean().optional(),
|
|
325
|
+
flexColumn: z21.boolean().optional(),
|
|
326
|
+
gap: z21.number().or(z21.string()).optional()
|
|
308
327
|
});
|
|
309
328
|
expectTypesMatch(true);
|
|
310
|
-
var autorouterConfig =
|
|
311
|
-
serverUrl:
|
|
312
|
-
inputFormat:
|
|
313
|
-
serverMode:
|
|
314
|
-
serverCacheEnabled:
|
|
315
|
-
cache:
|
|
316
|
-
groupMode:
|
|
317
|
-
algorithmFn:
|
|
329
|
+
var autorouterConfig = z21.object({
|
|
330
|
+
serverUrl: z21.string().optional(),
|
|
331
|
+
inputFormat: z21.enum(["simplified", "circuit-json"]).optional(),
|
|
332
|
+
serverMode: z21.enum(["job", "solve-endpoint"]).optional(),
|
|
333
|
+
serverCacheEnabled: z21.boolean().optional(),
|
|
334
|
+
cache: z21.custom((v) => true).optional(),
|
|
335
|
+
groupMode: z21.enum(["sequential-trace", "subcircuit"]).optional(),
|
|
336
|
+
algorithmFn: z21.custom(
|
|
318
337
|
(v) => typeof v === "function" || v === void 0
|
|
319
338
|
).optional(),
|
|
320
|
-
local:
|
|
339
|
+
local: z21.boolean().optional()
|
|
321
340
|
});
|
|
322
|
-
var autorouterProp =
|
|
341
|
+
var autorouterProp = z21.union([
|
|
323
342
|
autorouterConfig,
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
343
|
+
z21.literal("sequential-trace"),
|
|
344
|
+
z21.literal("subcircuit"),
|
|
345
|
+
z21.literal("auto"),
|
|
346
|
+
z21.literal("auto-local"),
|
|
347
|
+
z21.literal("auto-cloud")
|
|
329
348
|
]);
|
|
330
349
|
var baseGroupProps = commonLayoutProps.extend({
|
|
331
|
-
name:
|
|
332
|
-
children:
|
|
333
|
-
key:
|
|
350
|
+
name: z21.string().optional(),
|
|
351
|
+
children: z21.any().optional(),
|
|
352
|
+
key: z21.any().optional(),
|
|
334
353
|
...layoutConfig.shape,
|
|
335
354
|
pcbWidth: length.optional(),
|
|
336
355
|
pcbHeight: length.optional(),
|
|
@@ -339,24 +358,24 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
339
358
|
pcbLayout: layoutConfig.optional(),
|
|
340
359
|
schLayout: layoutConfig.optional()
|
|
341
360
|
});
|
|
342
|
-
var partsEngine =
|
|
361
|
+
var partsEngine = z21.custom((v) => "findPart" in v);
|
|
343
362
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
344
|
-
layout:
|
|
363
|
+
layout: z21.custom((v) => true).optional(),
|
|
345
364
|
manualEdits: manual_edits_file.optional(),
|
|
346
|
-
schAutoLayoutEnabled:
|
|
347
|
-
schTraceAutoLabelEnabled:
|
|
348
|
-
routingDisabled:
|
|
365
|
+
schAutoLayoutEnabled: z21.boolean().optional(),
|
|
366
|
+
schTraceAutoLabelEnabled: z21.boolean().optional(),
|
|
367
|
+
routingDisabled: z21.boolean().optional(),
|
|
349
368
|
defaultTraceWidth: length.optional(),
|
|
350
369
|
minTraceWidth: length.optional(),
|
|
351
370
|
partsEngine: partsEngine.optional(),
|
|
352
|
-
pcbRouteCache:
|
|
371
|
+
pcbRouteCache: z21.custom((v) => true).optional(),
|
|
353
372
|
autorouter: autorouterProp.optional()
|
|
354
373
|
});
|
|
355
374
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
356
|
-
subcircuit:
|
|
375
|
+
subcircuit: z21.literal(true)
|
|
357
376
|
});
|
|
358
|
-
var groupProps =
|
|
359
|
-
baseGroupProps.extend({ subcircuit:
|
|
377
|
+
var groupProps = z21.discriminatedUnion("subcircuit", [
|
|
378
|
+
baseGroupProps.extend({ subcircuit: z21.literal(false).optional() }),
|
|
360
379
|
subcircuitGroupPropsWithBool
|
|
361
380
|
]);
|
|
362
381
|
expectTypesMatch(true);
|
|
@@ -367,35 +386,40 @@ expectTypesMatch(true);
|
|
|
367
386
|
var boardProps = subcircuitGroupProps.extend({
|
|
368
387
|
width: distance5.optional(),
|
|
369
388
|
height: distance5.optional(),
|
|
370
|
-
outline:
|
|
389
|
+
outline: z22.array(point).optional(),
|
|
371
390
|
outlineOffsetX: distance5.optional(),
|
|
372
391
|
outlineOffsetY: distance5.optional(),
|
|
373
|
-
material:
|
|
392
|
+
material: z22.enum(["fr4", "fr1"]).default("fr4")
|
|
374
393
|
});
|
|
375
394
|
expectTypesMatch(true);
|
|
376
395
|
|
|
377
396
|
// lib/components/chip.ts
|
|
378
|
-
import { distance as distance6 } from "circuit-json";
|
|
379
|
-
import { z as
|
|
380
|
-
var connectionTarget =
|
|
381
|
-
var connectionsProp =
|
|
382
|
-
var pinLabelsProp =
|
|
383
|
-
|
|
384
|
-
|
|
397
|
+
import { distance as distance6, supplier_name as supplier_name2 } from "circuit-json";
|
|
398
|
+
import { z as z23 } from "zod";
|
|
399
|
+
var connectionTarget = z23.string().or(z23.array(z23.string()).readonly()).or(z23.array(z23.string()));
|
|
400
|
+
var connectionsProp = z23.custom().pipe(z23.record(z23.string(), connectionTarget));
|
|
401
|
+
var pinLabelsProp = z23.record(
|
|
402
|
+
z23.string(),
|
|
403
|
+
z23.string().or(z23.array(z23.string()).readonly()).or(z23.array(z23.string()))
|
|
385
404
|
);
|
|
386
405
|
expectTypesMatch(true);
|
|
406
|
+
var pinCompatibleVariant = z23.object({
|
|
407
|
+
manufacturerPartNumber: z23.string().optional(),
|
|
408
|
+
supplierPartNumber: z23.record(supplier_name2, z23.array(z23.string())).optional()
|
|
409
|
+
});
|
|
387
410
|
var chipProps = commonComponentProps.extend({
|
|
388
|
-
manufacturerPartNumber:
|
|
411
|
+
manufacturerPartNumber: z23.string().optional(),
|
|
389
412
|
pinLabels: pinLabelsProp.optional(),
|
|
390
|
-
internallyConnectedPins:
|
|
391
|
-
externallyConnectedPins:
|
|
413
|
+
internallyConnectedPins: z23.array(z23.array(z23.string())).optional(),
|
|
414
|
+
externallyConnectedPins: z23.array(z23.array(z23.string())).optional(),
|
|
392
415
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
393
416
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
417
|
+
pinCompatibleVariants: z23.array(pinCompatibleVariant).optional(),
|
|
394
418
|
schPinStyle: schematicPinStyle.optional(),
|
|
395
419
|
schPinSpacing: distance6.optional(),
|
|
396
420
|
schWidth: distance6.optional(),
|
|
397
421
|
schHeight: distance6.optional(),
|
|
398
|
-
noSchematicRepresentation:
|
|
422
|
+
noSchematicRepresentation: z23.boolean().optional(),
|
|
399
423
|
connections: connectionsProp.optional()
|
|
400
424
|
});
|
|
401
425
|
var bugProps = chipProps;
|
|
@@ -403,40 +427,40 @@ expectTypesMatch(true);
|
|
|
403
427
|
|
|
404
428
|
// lib/components/jumper.ts
|
|
405
429
|
import { distance as distance7 } from "circuit-json";
|
|
406
|
-
import { z as
|
|
430
|
+
import { z as z24 } from "zod";
|
|
407
431
|
var jumperProps = commonComponentProps.extend({
|
|
408
|
-
manufacturerPartNumber:
|
|
409
|
-
pinLabels:
|
|
432
|
+
manufacturerPartNumber: z24.string().optional(),
|
|
433
|
+
pinLabels: z24.record(z24.number().or(z24.string()), z24.string().or(z24.array(z24.string()))).optional(),
|
|
410
434
|
schPinStyle: schematicPinStyle.optional(),
|
|
411
435
|
schPinSpacing: distance7.optional(),
|
|
412
436
|
schWidth: distance7.optional(),
|
|
413
437
|
schHeight: distance7.optional(),
|
|
414
|
-
schDirection:
|
|
438
|
+
schDirection: z24.enum(["left", "right"]).optional(),
|
|
415
439
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
416
|
-
pinCount:
|
|
417
|
-
internallyConnectedPins:
|
|
440
|
+
pinCount: z24.union([z24.literal(2), z24.literal(3)]).optional(),
|
|
441
|
+
internallyConnectedPins: z24.array(z24.array(z24.string())).optional()
|
|
418
442
|
});
|
|
419
443
|
expectTypesMatch(true);
|
|
420
444
|
|
|
421
445
|
// lib/components/platedhole.ts
|
|
422
446
|
import { distance as distance8 } from "circuit-json";
|
|
423
|
-
import { z as
|
|
424
|
-
var distanceHiddenUndefined =
|
|
447
|
+
import { z as z25 } from "zod";
|
|
448
|
+
var distanceHiddenUndefined = z25.custom().transform((a) => {
|
|
425
449
|
if (a === void 0)
|
|
426
450
|
return void 0;
|
|
427
451
|
return distance8.parse(a);
|
|
428
452
|
});
|
|
429
|
-
var platedHoleProps =
|
|
453
|
+
var platedHoleProps = z25.union([
|
|
430
454
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
431
|
-
name:
|
|
432
|
-
shape:
|
|
455
|
+
name: z25.string().optional(),
|
|
456
|
+
shape: z25.literal("circle"),
|
|
433
457
|
holeDiameter: distance8,
|
|
434
458
|
outerDiameter: distance8,
|
|
435
459
|
portHints: portHints.optional()
|
|
436
460
|
}),
|
|
437
461
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
438
|
-
name:
|
|
439
|
-
shape:
|
|
462
|
+
name: z25.string().optional(),
|
|
463
|
+
shape: z25.literal("oval"),
|
|
440
464
|
outerWidth: distance8,
|
|
441
465
|
outerHeight: distance8,
|
|
442
466
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -446,8 +470,8 @@ var platedHoleProps = z23.union([
|
|
|
446
470
|
portHints: portHints.optional()
|
|
447
471
|
}),
|
|
448
472
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
449
|
-
name:
|
|
450
|
-
shape:
|
|
473
|
+
name: z25.string().optional(),
|
|
474
|
+
shape: z25.literal("pill"),
|
|
451
475
|
outerWidth: distance8,
|
|
452
476
|
outerHeight: distance8,
|
|
453
477
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -457,13 +481,13 @@ var platedHoleProps = z23.union([
|
|
|
457
481
|
portHints: portHints.optional()
|
|
458
482
|
}),
|
|
459
483
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
460
|
-
name:
|
|
484
|
+
name: z25.string().optional(),
|
|
461
485
|
holeDiameter: distance8,
|
|
462
486
|
rectPadWidth: distance8,
|
|
463
487
|
rectPadHeight: distance8,
|
|
464
|
-
holeShape:
|
|
465
|
-
padShape:
|
|
466
|
-
shape:
|
|
488
|
+
holeShape: z25.literal("circle").optional(),
|
|
489
|
+
padShape: z25.literal("rect").optional(),
|
|
490
|
+
shape: z25.literal("circularHoleWithRectPad").optional(),
|
|
467
491
|
portHints: portHints.optional()
|
|
468
492
|
}).refine(
|
|
469
493
|
(prop) => {
|
|
@@ -488,21 +512,21 @@ expectTypesMatch(true);
|
|
|
488
512
|
import { resistance } from "circuit-json";
|
|
489
513
|
|
|
490
514
|
// lib/common/connectionsProp.ts
|
|
491
|
-
import { z as
|
|
492
|
-
var connectionTarget2 =
|
|
515
|
+
import { z as z26 } from "zod";
|
|
516
|
+
var connectionTarget2 = z26.string().or(z26.array(z26.string()).readonly()).or(z26.array(z26.string()));
|
|
493
517
|
var createConnectionsProp = (labels) => {
|
|
494
|
-
return
|
|
518
|
+
return z26.record(z26.enum(labels), connectionTarget2);
|
|
495
519
|
};
|
|
496
520
|
|
|
497
521
|
// lib/components/resistor.ts
|
|
498
|
-
import { z as
|
|
522
|
+
import { z as z27 } from "zod";
|
|
499
523
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
500
524
|
var resistorProps = commonComponentProps.extend({
|
|
501
525
|
resistance,
|
|
502
|
-
pullupFor:
|
|
503
|
-
pullupTo:
|
|
504
|
-
pulldownFor:
|
|
505
|
-
pulldownTo:
|
|
526
|
+
pullupFor: z27.string().optional(),
|
|
527
|
+
pullupTo: z27.string().optional(),
|
|
528
|
+
pulldownFor: z27.string().optional(),
|
|
529
|
+
pulldownTo: z27.string().optional(),
|
|
506
530
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
507
531
|
});
|
|
508
532
|
var resistorPins = lrPins;
|
|
@@ -510,54 +534,54 @@ expectTypesMatch(true);
|
|
|
510
534
|
|
|
511
535
|
// lib/components/potentiometer.ts
|
|
512
536
|
import { resistance as resistance2 } from "circuit-json";
|
|
513
|
-
import { z as
|
|
537
|
+
import { z as z28 } from "zod";
|
|
514
538
|
var potentiometerProps = commonComponentProps.extend({
|
|
515
539
|
maxResistance: resistance2,
|
|
516
|
-
pinVariant:
|
|
540
|
+
pinVariant: z28.enum(["two_pin", "three_pin"]).optional()
|
|
517
541
|
});
|
|
518
542
|
expectTypesMatch(true);
|
|
519
543
|
|
|
520
544
|
// lib/components/crystal.ts
|
|
521
545
|
import { frequency, capacitance } from "circuit-json";
|
|
522
|
-
import { z as
|
|
546
|
+
import { z as z29 } from "zod";
|
|
523
547
|
var crystalProps = commonComponentProps.extend({
|
|
524
548
|
frequency,
|
|
525
549
|
loadCapacitance: capacitance,
|
|
526
|
-
pinVariant:
|
|
550
|
+
pinVariant: z29.enum(["two_pin", "four_pin"]).optional()
|
|
527
551
|
});
|
|
528
552
|
var crystalPins = lrPins;
|
|
529
553
|
expectTypesMatch(true);
|
|
530
554
|
|
|
531
555
|
// lib/components/resonator.ts
|
|
532
556
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
533
|
-
import { z as
|
|
557
|
+
import { z as z30 } from "zod";
|
|
534
558
|
var resonatorProps = commonComponentProps.extend({
|
|
535
559
|
frequency: frequency2,
|
|
536
560
|
loadCapacitance: capacitance2,
|
|
537
|
-
pinVariant:
|
|
561
|
+
pinVariant: z30.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
538
562
|
});
|
|
539
563
|
expectTypesMatch(true);
|
|
540
564
|
|
|
541
565
|
// lib/components/stampboard.ts
|
|
542
566
|
import { distance as distance9 } from "circuit-json";
|
|
543
|
-
import { z as
|
|
567
|
+
import { z as z31 } from "zod";
|
|
544
568
|
var stampboardProps = boardProps.extend({
|
|
545
|
-
leftPinCount:
|
|
546
|
-
rightPinCount:
|
|
547
|
-
topPinCount:
|
|
548
|
-
bottomPinCount:
|
|
549
|
-
leftPins:
|
|
550
|
-
rightPins:
|
|
551
|
-
topPins:
|
|
552
|
-
bottomPins:
|
|
569
|
+
leftPinCount: z31.number().optional(),
|
|
570
|
+
rightPinCount: z31.number().optional(),
|
|
571
|
+
topPinCount: z31.number().optional(),
|
|
572
|
+
bottomPinCount: z31.number().optional(),
|
|
573
|
+
leftPins: z31.array(z31.string()).optional(),
|
|
574
|
+
rightPins: z31.array(z31.string()).optional(),
|
|
575
|
+
topPins: z31.array(z31.string()).optional(),
|
|
576
|
+
bottomPins: z31.array(z31.string()).optional(),
|
|
553
577
|
pinPitch: distance9.optional(),
|
|
554
|
-
innerHoles:
|
|
578
|
+
innerHoles: z31.boolean().optional()
|
|
555
579
|
});
|
|
556
580
|
expectTypesMatch(true);
|
|
557
581
|
|
|
558
582
|
// lib/components/capacitor.ts
|
|
559
583
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
560
|
-
import { z as
|
|
584
|
+
import { z as z32 } from "zod";
|
|
561
585
|
var capacitorPinLabels = [
|
|
562
586
|
"pin1",
|
|
563
587
|
"pin2",
|
|
@@ -569,31 +593,31 @@ var capacitorPinLabels = [
|
|
|
569
593
|
var capacitorProps = commonComponentProps.extend({
|
|
570
594
|
capacitance: capacitance3,
|
|
571
595
|
maxVoltageRating: voltage.optional(),
|
|
572
|
-
schShowRatings:
|
|
573
|
-
polarized:
|
|
574
|
-
decouplingFor:
|
|
575
|
-
decouplingTo:
|
|
576
|
-
bypassFor:
|
|
577
|
-
bypassTo:
|
|
578
|
-
maxDecouplingTraceLength:
|
|
596
|
+
schShowRatings: z32.boolean().optional().default(false),
|
|
597
|
+
polarized: z32.boolean().optional().default(false),
|
|
598
|
+
decouplingFor: z32.string().optional(),
|
|
599
|
+
decouplingTo: z32.string().optional(),
|
|
600
|
+
bypassFor: z32.string().optional(),
|
|
601
|
+
bypassTo: z32.string().optional(),
|
|
602
|
+
maxDecouplingTraceLength: z32.number().optional(),
|
|
579
603
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
580
604
|
});
|
|
581
605
|
var capacitorPins = lrPolarPins;
|
|
582
606
|
expectTypesMatch(true);
|
|
583
607
|
|
|
584
608
|
// lib/components/net.ts
|
|
585
|
-
import { z as
|
|
586
|
-
var netProps =
|
|
587
|
-
name:
|
|
609
|
+
import { z as z33 } from "zod";
|
|
610
|
+
var netProps = z33.object({
|
|
611
|
+
name: z33.string()
|
|
588
612
|
});
|
|
589
613
|
expectTypesMatch(true);
|
|
590
614
|
|
|
591
615
|
// lib/components/constrainedlayout.ts
|
|
592
|
-
import { z as
|
|
593
|
-
var constrainedLayoutProps =
|
|
594
|
-
name:
|
|
595
|
-
pcbOnly:
|
|
596
|
-
schOnly:
|
|
616
|
+
import { z as z34 } from "zod";
|
|
617
|
+
var constrainedLayoutProps = z34.object({
|
|
618
|
+
name: z34.string().optional(),
|
|
619
|
+
pcbOnly: z34.boolean().optional(),
|
|
620
|
+
schOnly: z34.boolean().optional()
|
|
597
621
|
});
|
|
598
622
|
expectTypesMatch(true);
|
|
599
623
|
|
|
@@ -602,46 +626,46 @@ import "zod";
|
|
|
602
626
|
import { distance as distance10, length as length2 } from "circuit-json";
|
|
603
627
|
|
|
604
628
|
// lib/components/constraint.ts
|
|
605
|
-
import { z as
|
|
606
|
-
var pcbXDistConstraintProps =
|
|
607
|
-
pcb:
|
|
629
|
+
import { z as z36 } from "zod";
|
|
630
|
+
var pcbXDistConstraintProps = z36.object({
|
|
631
|
+
pcb: z36.literal(true).optional(),
|
|
608
632
|
xDist: distance10,
|
|
609
|
-
left:
|
|
610
|
-
right:
|
|
611
|
-
edgeToEdge:
|
|
612
|
-
centerToCenter:
|
|
633
|
+
left: z36.string(),
|
|
634
|
+
right: z36.string(),
|
|
635
|
+
edgeToEdge: z36.literal(true).optional(),
|
|
636
|
+
centerToCenter: z36.literal(true).optional()
|
|
613
637
|
});
|
|
614
638
|
expectTypesMatch(
|
|
615
639
|
true
|
|
616
640
|
);
|
|
617
|
-
var pcbYDistConstraintProps =
|
|
618
|
-
pcb:
|
|
641
|
+
var pcbYDistConstraintProps = z36.object({
|
|
642
|
+
pcb: z36.literal(true).optional(),
|
|
619
643
|
yDist: distance10,
|
|
620
|
-
top:
|
|
621
|
-
bottom:
|
|
622
|
-
edgeToEdge:
|
|
623
|
-
centerToCenter:
|
|
644
|
+
top: z36.string(),
|
|
645
|
+
bottom: z36.string(),
|
|
646
|
+
edgeToEdge: z36.literal(true).optional(),
|
|
647
|
+
centerToCenter: z36.literal(true).optional()
|
|
624
648
|
});
|
|
625
649
|
expectTypesMatch(
|
|
626
650
|
true
|
|
627
651
|
);
|
|
628
|
-
var pcbSameYConstraintProps =
|
|
629
|
-
pcb:
|
|
630
|
-
sameY:
|
|
631
|
-
for:
|
|
652
|
+
var pcbSameYConstraintProps = z36.object({
|
|
653
|
+
pcb: z36.literal(true).optional(),
|
|
654
|
+
sameY: z36.literal(true).optional(),
|
|
655
|
+
for: z36.array(z36.string())
|
|
632
656
|
});
|
|
633
657
|
expectTypesMatch(
|
|
634
658
|
true
|
|
635
659
|
);
|
|
636
|
-
var pcbSameXConstraintProps =
|
|
637
|
-
pcb:
|
|
638
|
-
sameX:
|
|
639
|
-
for:
|
|
660
|
+
var pcbSameXConstraintProps = z36.object({
|
|
661
|
+
pcb: z36.literal(true).optional(),
|
|
662
|
+
sameX: z36.literal(true).optional(),
|
|
663
|
+
for: z36.array(z36.string())
|
|
640
664
|
});
|
|
641
665
|
expectTypesMatch(
|
|
642
666
|
true
|
|
643
667
|
);
|
|
644
|
-
var constraintProps =
|
|
668
|
+
var constraintProps = z36.union([
|
|
645
669
|
pcbXDistConstraintProps,
|
|
646
670
|
pcbYDistConstraintProps,
|
|
647
671
|
pcbSameYConstraintProps,
|
|
@@ -650,37 +674,37 @@ var constraintProps = z34.union([
|
|
|
650
674
|
expectTypesMatch(true);
|
|
651
675
|
|
|
652
676
|
// lib/components/smtpad.ts
|
|
653
|
-
import { z as
|
|
677
|
+
import { z as z37 } from "zod";
|
|
654
678
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
655
|
-
shape:
|
|
679
|
+
shape: z37.literal("rect"),
|
|
656
680
|
width: distance10,
|
|
657
681
|
height: distance10,
|
|
658
682
|
portHints: portHints.optional()
|
|
659
683
|
});
|
|
660
684
|
expectTypesMatch(true);
|
|
661
685
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
662
|
-
shape:
|
|
686
|
+
shape: z37.literal("rotated_rect"),
|
|
663
687
|
width: distance10,
|
|
664
688
|
height: distance10,
|
|
665
|
-
ccwRotation:
|
|
689
|
+
ccwRotation: z37.number(),
|
|
666
690
|
portHints: portHints.optional()
|
|
667
691
|
});
|
|
668
692
|
expectTypesMatch(true);
|
|
669
693
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
670
|
-
shape:
|
|
694
|
+
shape: z37.literal("circle"),
|
|
671
695
|
radius: distance10,
|
|
672
696
|
portHints: portHints.optional()
|
|
673
697
|
});
|
|
674
698
|
expectTypesMatch(true);
|
|
675
699
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
676
|
-
shape:
|
|
700
|
+
shape: z37.literal("pill"),
|
|
677
701
|
width: distance10,
|
|
678
702
|
height: distance10,
|
|
679
703
|
radius: distance10,
|
|
680
704
|
portHints: portHints.optional()
|
|
681
705
|
});
|
|
682
706
|
expectTypesMatch(true);
|
|
683
|
-
var smtPadProps =
|
|
707
|
+
var smtPadProps = z37.union([
|
|
684
708
|
circleSmtPadProps,
|
|
685
709
|
rectSmtPadProps,
|
|
686
710
|
rotatedRectSmtPadProps,
|
|
@@ -689,28 +713,28 @@ var smtPadProps = z35.union([
|
|
|
689
713
|
expectTypesMatch(true);
|
|
690
714
|
|
|
691
715
|
// lib/components/solderpaste.ts
|
|
692
|
-
import { z as
|
|
716
|
+
import { z as z38 } from "zod";
|
|
693
717
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
694
|
-
shape:
|
|
718
|
+
shape: z38.literal("rect"),
|
|
695
719
|
width: distance10,
|
|
696
720
|
height: distance10
|
|
697
721
|
});
|
|
698
722
|
expectTypesMatch(true);
|
|
699
723
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
700
|
-
shape:
|
|
724
|
+
shape: z38.literal("circle"),
|
|
701
725
|
radius: distance10
|
|
702
726
|
});
|
|
703
727
|
expectTypesMatch(true);
|
|
704
|
-
var solderPasteProps =
|
|
728
|
+
var solderPasteProps = z38.union([
|
|
705
729
|
circleSolderPasteProps,
|
|
706
730
|
rectSolderPasteProps
|
|
707
731
|
]);
|
|
708
732
|
expectTypesMatch(true);
|
|
709
733
|
|
|
710
734
|
// lib/components/hole.ts
|
|
711
|
-
import { z as
|
|
735
|
+
import { z as z39 } from "zod";
|
|
712
736
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
713
|
-
name:
|
|
737
|
+
name: z39.string().optional(),
|
|
714
738
|
diameter: distance10.optional(),
|
|
715
739
|
radius: distance10.optional()
|
|
716
740
|
}).transform((d) => ({
|
|
@@ -721,25 +745,25 @@ var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
721
745
|
expectTypesMatch(true);
|
|
722
746
|
|
|
723
747
|
// lib/components/trace.ts
|
|
724
|
-
import { distance as distance11, route_hint_point as
|
|
725
|
-
import { z as
|
|
726
|
-
var portRef =
|
|
727
|
-
|
|
728
|
-
|
|
748
|
+
import { distance as distance11, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
749
|
+
import { z as z40 } from "zod";
|
|
750
|
+
var portRef = z40.union([
|
|
751
|
+
z40.string(),
|
|
752
|
+
z40.custom(
|
|
729
753
|
(v) => Boolean(v.getPortSelector)
|
|
730
754
|
)
|
|
731
755
|
]);
|
|
732
|
-
var baseTraceProps =
|
|
733
|
-
key:
|
|
756
|
+
var baseTraceProps = z40.object({
|
|
757
|
+
key: z40.string().optional(),
|
|
734
758
|
thickness: distance11.optional(),
|
|
735
|
-
schematicRouteHints:
|
|
736
|
-
pcbRouteHints:
|
|
737
|
-
schDisplayLabel:
|
|
759
|
+
schematicRouteHints: z40.array(point).optional(),
|
|
760
|
+
pcbRouteHints: z40.array(route_hint_point2).optional(),
|
|
761
|
+
schDisplayLabel: z40.string().optional(),
|
|
738
762
|
maxLength: distance11.optional()
|
|
739
763
|
});
|
|
740
|
-
var traceProps =
|
|
764
|
+
var traceProps = z40.union([
|
|
741
765
|
baseTraceProps.extend({
|
|
742
|
-
path:
|
|
766
|
+
path: z40.array(portRef)
|
|
743
767
|
}),
|
|
744
768
|
baseTraceProps.extend({
|
|
745
769
|
from: portRef,
|
|
@@ -749,15 +773,15 @@ var traceProps = z38.union([
|
|
|
749
773
|
|
|
750
774
|
// lib/components/footprint.ts
|
|
751
775
|
import { layer_ref as layer_ref4 } from "circuit-json";
|
|
752
|
-
import { z as
|
|
753
|
-
var footprintProps =
|
|
776
|
+
import { z as z41 } from "zod";
|
|
777
|
+
var footprintProps = z41.object({
|
|
754
778
|
originalLayer: layer_ref4.default("top").optional()
|
|
755
779
|
});
|
|
756
780
|
expectTypesMatch(true);
|
|
757
781
|
|
|
758
782
|
// lib/components/battery.ts
|
|
759
|
-
import { z as
|
|
760
|
-
var capacity =
|
|
783
|
+
import { z as z42 } from "zod";
|
|
784
|
+
var capacity = z42.number().or(z42.string().endsWith("mAh")).transform((v) => {
|
|
761
785
|
if (typeof v === "string") {
|
|
762
786
|
const valString = v.replace("mAh", "");
|
|
763
787
|
const num = Number.parseFloat(valString);
|
|
@@ -776,30 +800,30 @@ expectTypesMatch(true);
|
|
|
776
800
|
|
|
777
801
|
// lib/components/pin-header.ts
|
|
778
802
|
import { distance as distance12 } from "circuit-json";
|
|
779
|
-
import { z as
|
|
803
|
+
import { z as z43 } from "zod";
|
|
780
804
|
var pinHeaderProps = commonComponentProps.extend({
|
|
781
|
-
pinCount:
|
|
805
|
+
pinCount: z43.number(),
|
|
782
806
|
pitch: distance12.optional(),
|
|
783
|
-
schFacingDirection:
|
|
784
|
-
gender:
|
|
785
|
-
showSilkscreenPinLabels:
|
|
786
|
-
doubleRow:
|
|
807
|
+
schFacingDirection: z43.enum(["up", "down", "left", "right"]).optional(),
|
|
808
|
+
gender: z43.enum(["male", "female"]).optional().default("male"),
|
|
809
|
+
showSilkscreenPinLabels: z43.boolean().optional(),
|
|
810
|
+
doubleRow: z43.boolean().optional(),
|
|
787
811
|
holeDiameter: distance12.optional(),
|
|
788
812
|
platedDiameter: distance12.optional(),
|
|
789
|
-
pinLabels:
|
|
790
|
-
facingDirection:
|
|
813
|
+
pinLabels: z43.array(z43.string()).optional(),
|
|
814
|
+
facingDirection: z43.enum(["left", "right"]).optional()
|
|
791
815
|
});
|
|
792
816
|
expectTypesMatch(true);
|
|
793
817
|
|
|
794
818
|
// lib/components/netalias.ts
|
|
795
|
-
import { z as
|
|
819
|
+
import { z as z44 } from "zod";
|
|
796
820
|
import { rotation as rotation2 } from "circuit-json";
|
|
797
|
-
var netAliasProps =
|
|
798
|
-
net:
|
|
821
|
+
var netAliasProps = z44.object({
|
|
822
|
+
net: z44.string().optional(),
|
|
799
823
|
schX: distance10.optional(),
|
|
800
824
|
schY: distance10.optional(),
|
|
801
825
|
schRotation: rotation2.optional(),
|
|
802
|
-
anchorSide:
|
|
826
|
+
anchorSide: z44.enum(["left", "up", "right", "down"]).optional()
|
|
803
827
|
});
|
|
804
828
|
expectTypesMatch(true);
|
|
805
829
|
|
|
@@ -813,9 +837,9 @@ var subcircuitProps = subcircuitGroupProps;
|
|
|
813
837
|
expectTypesMatch(true);
|
|
814
838
|
|
|
815
839
|
// lib/components/transistor.ts
|
|
816
|
-
import { z as
|
|
840
|
+
import { z as z46 } from "zod";
|
|
817
841
|
var transistorProps = commonComponentProps.extend({
|
|
818
|
-
type:
|
|
842
|
+
type: z46.enum(["npn", "pnp", "bjt", "jfet", "mosfet"])
|
|
819
843
|
});
|
|
820
844
|
var transistorPins = [
|
|
821
845
|
"pin1",
|
|
@@ -828,10 +852,10 @@ var transistorPins = [
|
|
|
828
852
|
expectTypesMatch(true);
|
|
829
853
|
|
|
830
854
|
// lib/components/mosfet.ts
|
|
831
|
-
import { z as
|
|
855
|
+
import { z as z47 } from "zod";
|
|
832
856
|
var mosfetProps = commonComponentProps.extend({
|
|
833
|
-
channelType:
|
|
834
|
-
mosfetMode:
|
|
857
|
+
channelType: z47.enum(["n", "p"]),
|
|
858
|
+
mosfetMode: z47.enum(["enhancement", "depletion"])
|
|
835
859
|
});
|
|
836
860
|
var mosfetPins = [
|
|
837
861
|
"pin1",
|
|
@@ -851,8 +875,8 @@ var inductorProps = commonComponentProps.extend({
|
|
|
851
875
|
var inductorPins = lrPins;
|
|
852
876
|
|
|
853
877
|
// lib/components/diode.ts
|
|
854
|
-
import { z as
|
|
855
|
-
var diodeConnectionKeys =
|
|
878
|
+
import { z as z48 } from "zod";
|
|
879
|
+
var diodeConnectionKeys = z48.enum([
|
|
856
880
|
"anode",
|
|
857
881
|
"cathode",
|
|
858
882
|
"pin1",
|
|
@@ -860,17 +884,17 @@ var diodeConnectionKeys = z46.enum([
|
|
|
860
884
|
"pos",
|
|
861
885
|
"neg"
|
|
862
886
|
]);
|
|
863
|
-
var connectionTarget3 =
|
|
864
|
-
var connectionsProp2 =
|
|
865
|
-
var diodeVariant =
|
|
887
|
+
var connectionTarget3 = z48.string().or(z48.array(z48.string()).readonly()).or(z48.array(z48.string()));
|
|
888
|
+
var connectionsProp2 = z48.record(diodeConnectionKeys, connectionTarget3);
|
|
889
|
+
var diodeVariant = z48.enum(["standard", "schottky", "zener", "photo", "tvs"]);
|
|
866
890
|
var diodeProps = commonComponentProps.extend({
|
|
867
891
|
connections: connectionsProp2.optional(),
|
|
868
892
|
variant: diodeVariant.optional().default("standard"),
|
|
869
|
-
standard:
|
|
870
|
-
schottky:
|
|
871
|
-
zener:
|
|
872
|
-
photo:
|
|
873
|
-
tvs:
|
|
893
|
+
standard: z48.boolean().optional(),
|
|
894
|
+
schottky: z48.boolean().optional(),
|
|
895
|
+
zener: z48.boolean().optional(),
|
|
896
|
+
photo: z48.boolean().optional(),
|
|
897
|
+
tvs: z48.boolean().optional()
|
|
874
898
|
}).superRefine((data, ctx) => {
|
|
875
899
|
const enabledFlags = [
|
|
876
900
|
data.standard,
|
|
@@ -881,11 +905,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
881
905
|
].filter(Boolean).length;
|
|
882
906
|
if (enabledFlags > 1) {
|
|
883
907
|
ctx.addIssue({
|
|
884
|
-
code:
|
|
908
|
+
code: z48.ZodIssueCode.custom,
|
|
885
909
|
message: "Exactly one diode variant must be enabled",
|
|
886
910
|
path: []
|
|
887
911
|
});
|
|
888
|
-
return
|
|
912
|
+
return z48.INVALID;
|
|
889
913
|
}
|
|
890
914
|
}).transform((data) => {
|
|
891
915
|
const result = {
|
|
@@ -933,21 +957,21 @@ var diodePins = lrPolarPins;
|
|
|
933
957
|
expectTypesMatch(true);
|
|
934
958
|
|
|
935
959
|
// lib/components/led.ts
|
|
936
|
-
import { z as
|
|
960
|
+
import { z as z49 } from "zod";
|
|
937
961
|
var ledProps = commonComponentProps.extend({
|
|
938
|
-
color:
|
|
962
|
+
color: z49.string().optional()
|
|
939
963
|
});
|
|
940
964
|
var ledPins = lrPolarPins;
|
|
941
965
|
|
|
942
966
|
// lib/components/switch.ts
|
|
943
|
-
import { z as
|
|
967
|
+
import { z as z50 } from "zod";
|
|
944
968
|
var switchProps = commonComponentProps.extend({
|
|
945
|
-
type:
|
|
946
|
-
isNormallyClosed:
|
|
947
|
-
spst:
|
|
948
|
-
spdt:
|
|
949
|
-
dpst:
|
|
950
|
-
dpdt:
|
|
969
|
+
type: z50.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
970
|
+
isNormallyClosed: z50.boolean().optional().default(false),
|
|
971
|
+
spst: z50.boolean().optional(),
|
|
972
|
+
spdt: z50.boolean().optional(),
|
|
973
|
+
dpst: z50.boolean().optional(),
|
|
974
|
+
dpdt: z50.boolean().optional()
|
|
951
975
|
}).transform((props) => {
|
|
952
976
|
const updatedProps = { ...props };
|
|
953
977
|
if (updatedProps.dpdt) {
|
|
@@ -979,31 +1003,31 @@ expectTypesMatch(true);
|
|
|
979
1003
|
|
|
980
1004
|
// lib/components/fabrication-note-text.ts
|
|
981
1005
|
import { length as length3 } from "circuit-json";
|
|
982
|
-
import { z as
|
|
1006
|
+
import { z as z51 } from "zod";
|
|
983
1007
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
984
|
-
text:
|
|
985
|
-
anchorAlignment:
|
|
986
|
-
font:
|
|
1008
|
+
text: z51.string(),
|
|
1009
|
+
anchorAlignment: z51.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1010
|
+
font: z51.enum(["tscircuit2024"]).optional(),
|
|
987
1011
|
fontSize: length3.optional(),
|
|
988
|
-
color:
|
|
1012
|
+
color: z51.string().optional()
|
|
989
1013
|
});
|
|
990
1014
|
|
|
991
1015
|
// lib/components/fabrication-note-path.ts
|
|
992
|
-
import { length as length4, route_hint_point as
|
|
993
|
-
import { z as
|
|
1016
|
+
import { length as length4, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
1017
|
+
import { z as z52 } from "zod";
|
|
994
1018
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
995
|
-
route:
|
|
1019
|
+
route: z52.array(route_hint_point3),
|
|
996
1020
|
strokeWidth: length4.optional(),
|
|
997
|
-
color:
|
|
1021
|
+
color: z52.string().optional()
|
|
998
1022
|
});
|
|
999
1023
|
|
|
1000
1024
|
// lib/components/pcb-trace.ts
|
|
1001
|
-
import { distance as distance13, route_hint_point as
|
|
1002
|
-
import { z as
|
|
1003
|
-
var pcbTraceProps =
|
|
1004
|
-
layer:
|
|
1025
|
+
import { distance as distance13, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
1026
|
+
import { z as z53 } from "zod";
|
|
1027
|
+
var pcbTraceProps = z53.object({
|
|
1028
|
+
layer: z53.string().optional(),
|
|
1005
1029
|
thickness: distance13.optional(),
|
|
1006
|
-
route:
|
|
1030
|
+
route: z53.array(route_hint_point4)
|
|
1007
1031
|
});
|
|
1008
1032
|
|
|
1009
1033
|
// lib/components/via.ts
|
|
@@ -1017,14 +1041,14 @@ var viaProps = commonLayoutProps.extend({
|
|
|
1017
1041
|
|
|
1018
1042
|
// lib/components/pcb-keepout.ts
|
|
1019
1043
|
import { distance as distance15 } from "circuit-json";
|
|
1020
|
-
import { z as
|
|
1021
|
-
var pcbKeepoutProps =
|
|
1044
|
+
import { z as z54 } from "zod";
|
|
1045
|
+
var pcbKeepoutProps = z54.union([
|
|
1022
1046
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1023
|
-
shape:
|
|
1047
|
+
shape: z54.literal("circle"),
|
|
1024
1048
|
radius: distance15
|
|
1025
1049
|
}),
|
|
1026
1050
|
pcbLayoutProps.extend({
|
|
1027
|
-
shape:
|
|
1051
|
+
shape: z54.literal("rect"),
|
|
1028
1052
|
width: distance15,
|
|
1029
1053
|
height: distance15
|
|
1030
1054
|
})
|
|
@@ -1038,8 +1062,8 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
1038
1062
|
|
|
1039
1063
|
// lib/components/schematic-box.ts
|
|
1040
1064
|
import { distance as distance16 } from "circuit-json";
|
|
1041
|
-
import { z as
|
|
1042
|
-
var schematicBoxProps =
|
|
1065
|
+
import { z as z55 } from "zod";
|
|
1066
|
+
var schematicBoxProps = z55.object({
|
|
1043
1067
|
schX: distance16,
|
|
1044
1068
|
schY: distance16,
|
|
1045
1069
|
width: distance16,
|
|
@@ -1048,8 +1072,8 @@ var schematicBoxProps = z53.object({
|
|
|
1048
1072
|
|
|
1049
1073
|
// lib/components/schematic-line.ts
|
|
1050
1074
|
import { distance as distance17 } from "circuit-json";
|
|
1051
|
-
import { z as
|
|
1052
|
-
var schematicLineProps =
|
|
1075
|
+
import { z as z56 } from "zod";
|
|
1076
|
+
var schematicLineProps = z56.object({
|
|
1053
1077
|
x1: distance17,
|
|
1054
1078
|
y1: distance17,
|
|
1055
1079
|
x2: distance17,
|
|
@@ -1058,11 +1082,11 @@ var schematicLineProps = z54.object({
|
|
|
1058
1082
|
|
|
1059
1083
|
// lib/components/schematic-text.ts
|
|
1060
1084
|
import { distance as distance18, rotation as rotation3 } from "circuit-json";
|
|
1061
|
-
import { z as
|
|
1085
|
+
import { z as z59 } from "zod";
|
|
1062
1086
|
|
|
1063
1087
|
// lib/common/nine_point_anchor.ts
|
|
1064
|
-
import { z as
|
|
1065
|
-
var nine_point_anchor =
|
|
1088
|
+
import { z as z57 } from "zod";
|
|
1089
|
+
var nine_point_anchor = z57.enum([
|
|
1066
1090
|
"top_left",
|
|
1067
1091
|
"top_center",
|
|
1068
1092
|
"top_right",
|
|
@@ -1075,8 +1099,8 @@ var nine_point_anchor = z55.enum([
|
|
|
1075
1099
|
]);
|
|
1076
1100
|
|
|
1077
1101
|
// lib/common/five_point_anchor.ts
|
|
1078
|
-
import { z as
|
|
1079
|
-
var five_point_anchor =
|
|
1102
|
+
import { z as z58 } from "zod";
|
|
1103
|
+
var five_point_anchor = z58.enum([
|
|
1080
1104
|
"center",
|
|
1081
1105
|
"left",
|
|
1082
1106
|
"right",
|
|
@@ -1085,40 +1109,40 @@ var five_point_anchor = z56.enum([
|
|
|
1085
1109
|
]);
|
|
1086
1110
|
|
|
1087
1111
|
// lib/components/schematic-text.ts
|
|
1088
|
-
var schematicTextProps =
|
|
1112
|
+
var schematicTextProps = z59.object({
|
|
1089
1113
|
schX: distance18,
|
|
1090
1114
|
schY: distance18,
|
|
1091
|
-
text:
|
|
1092
|
-
fontSize:
|
|
1093
|
-
anchor:
|
|
1094
|
-
color:
|
|
1115
|
+
text: z59.string(),
|
|
1116
|
+
fontSize: z59.number().default(1),
|
|
1117
|
+
anchor: z59.union([five_point_anchor.describe("legacy"), nine_point_anchor]).default("center"),
|
|
1118
|
+
color: z59.string().default("#000000"),
|
|
1095
1119
|
schRotation: rotation3.default(0)
|
|
1096
1120
|
});
|
|
1097
1121
|
|
|
1098
1122
|
// lib/components/schematic-path.ts
|
|
1099
1123
|
import { point as point5 } from "circuit-json";
|
|
1100
|
-
import { z as
|
|
1101
|
-
var schematicPathProps =
|
|
1102
|
-
points:
|
|
1103
|
-
isFilled:
|
|
1104
|
-
fillColor:
|
|
1124
|
+
import { z as z60 } from "zod";
|
|
1125
|
+
var schematicPathProps = z60.object({
|
|
1126
|
+
points: z60.array(point5),
|
|
1127
|
+
isFilled: z60.boolean().optional().default(false),
|
|
1128
|
+
fillColor: z60.enum(["red", "blue"]).optional()
|
|
1105
1129
|
});
|
|
1106
1130
|
|
|
1107
1131
|
// lib/components/silkscreen-text.ts
|
|
1108
1132
|
import { length as length5 } from "circuit-json";
|
|
1109
|
-
import { z as
|
|
1133
|
+
import { z as z61 } from "zod";
|
|
1110
1134
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
1111
|
-
text:
|
|
1112
|
-
anchorAlignment:
|
|
1113
|
-
font:
|
|
1135
|
+
text: z61.string(),
|
|
1136
|
+
anchorAlignment: z61.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1137
|
+
font: z61.enum(["tscircuit2024"]).optional(),
|
|
1114
1138
|
fontSize: length5.optional()
|
|
1115
1139
|
});
|
|
1116
1140
|
|
|
1117
1141
|
// lib/components/silkscreen-path.ts
|
|
1118
|
-
import { length as length6, route_hint_point as
|
|
1119
|
-
import { z as
|
|
1142
|
+
import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
1143
|
+
import { z as z62 } from "zod";
|
|
1120
1144
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1121
|
-
route:
|
|
1145
|
+
route: z62.array(route_hint_point5),
|
|
1122
1146
|
strokeWidth: length6.optional()
|
|
1123
1147
|
});
|
|
1124
1148
|
|
|
@@ -1134,10 +1158,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
|
|
|
1134
1158
|
|
|
1135
1159
|
// lib/components/silkscreen-rect.ts
|
|
1136
1160
|
import { distance as distance20 } from "circuit-json";
|
|
1137
|
-
import { z as
|
|
1161
|
+
import { z as z63 } from "zod";
|
|
1138
1162
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1139
|
-
isFilled:
|
|
1140
|
-
isOutline:
|
|
1163
|
+
isFilled: z63.boolean().optional(),
|
|
1164
|
+
isOutline: z63.boolean().optional(),
|
|
1141
1165
|
strokeWidth: distance20.optional(),
|
|
1142
1166
|
width: distance20,
|
|
1143
1167
|
height: distance20
|
|
@@ -1145,49 +1169,49 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1145
1169
|
|
|
1146
1170
|
// lib/components/silkscreen-circle.ts
|
|
1147
1171
|
import { distance as distance21 } from "circuit-json";
|
|
1148
|
-
import { z as
|
|
1172
|
+
import { z as z64 } from "zod";
|
|
1149
1173
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1150
|
-
isFilled:
|
|
1151
|
-
isOutline:
|
|
1174
|
+
isFilled: z64.boolean().optional(),
|
|
1175
|
+
isOutline: z64.boolean().optional(),
|
|
1152
1176
|
strokeWidth: distance21.optional(),
|
|
1153
1177
|
radius: distance21
|
|
1154
1178
|
});
|
|
1155
1179
|
|
|
1156
1180
|
// lib/components/trace-hint.ts
|
|
1157
|
-
import { distance as distance22, layer_ref as layer_ref6, route_hint_point as
|
|
1158
|
-
import { z as
|
|
1159
|
-
var routeHintPointProps =
|
|
1181
|
+
import { distance as distance22, layer_ref as layer_ref6, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
1182
|
+
import { z as z65 } from "zod";
|
|
1183
|
+
var routeHintPointProps = z65.object({
|
|
1160
1184
|
x: distance22,
|
|
1161
1185
|
y: distance22,
|
|
1162
|
-
via:
|
|
1186
|
+
via: z65.boolean().optional(),
|
|
1163
1187
|
toLayer: layer_ref6.optional()
|
|
1164
1188
|
});
|
|
1165
|
-
var traceHintProps =
|
|
1166
|
-
for:
|
|
1189
|
+
var traceHintProps = z65.object({
|
|
1190
|
+
for: z65.string().optional().describe(
|
|
1167
1191
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
1168
1192
|
),
|
|
1169
|
-
order:
|
|
1170
|
-
offset:
|
|
1171
|
-
offsets:
|
|
1172
|
-
traceWidth:
|
|
1193
|
+
order: z65.number().optional(),
|
|
1194
|
+
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
1195
|
+
offsets: z65.array(route_hint_point6).or(z65.array(routeHintPointProps)).optional(),
|
|
1196
|
+
traceWidth: z65.number().optional()
|
|
1173
1197
|
});
|
|
1174
1198
|
|
|
1175
1199
|
// lib/components/port.ts
|
|
1176
|
-
import { z as
|
|
1200
|
+
import { z as z66 } from "zod";
|
|
1177
1201
|
var portProps = commonLayoutProps.extend({
|
|
1178
|
-
name:
|
|
1179
|
-
pinNumber:
|
|
1180
|
-
aliases:
|
|
1202
|
+
name: z66.string(),
|
|
1203
|
+
pinNumber: z66.number().optional(),
|
|
1204
|
+
aliases: z66.array(z66.string()).optional(),
|
|
1181
1205
|
direction
|
|
1182
1206
|
});
|
|
1183
1207
|
|
|
1184
1208
|
// lib/platformConfig.ts
|
|
1185
|
-
import { z as
|
|
1186
|
-
var platformConfig =
|
|
1209
|
+
import { z as z67 } from "zod";
|
|
1210
|
+
var platformConfig = z67.object({
|
|
1187
1211
|
partsEngine: partsEngine.optional(),
|
|
1188
1212
|
autorouter: autorouterProp.optional(),
|
|
1189
|
-
registryApiUrl:
|
|
1190
|
-
cloudAutorouterUrl:
|
|
1213
|
+
registryApiUrl: z67.string().optional(),
|
|
1214
|
+
cloudAutorouterUrl: z67.string().optional()
|
|
1191
1215
|
});
|
|
1192
1216
|
expectTypesMatch(true);
|
|
1193
1217
|
export {
|
|
@@ -1224,7 +1248,9 @@ export {
|
|
|
1224
1248
|
distanceOrMultiplier,
|
|
1225
1249
|
edit_component_location_event,
|
|
1226
1250
|
edit_pcb_component_location_event,
|
|
1251
|
+
edit_pcb_group_location_event,
|
|
1227
1252
|
edit_schematic_component_location_event,
|
|
1253
|
+
edit_schematic_group_location_event,
|
|
1228
1254
|
edit_trace_hint_event,
|
|
1229
1255
|
explicitPinSideDefinition,
|
|
1230
1256
|
fabricationNotePathProps,
|
|
@@ -1259,6 +1285,7 @@ export {
|
|
|
1259
1285
|
pcbXDistConstraintProps,
|
|
1260
1286
|
pcbYDistConstraintProps,
|
|
1261
1287
|
pillSmtPadProps,
|
|
1288
|
+
pinCompatibleVariant,
|
|
1262
1289
|
pinHeaderProps,
|
|
1263
1290
|
pinLabelsProp,
|
|
1264
1291
|
platedHoleProps,
|