@tscircuit/props 0.0.293 → 0.0.294
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/README.md +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +372 -371
- package/dist/index.js.map +1 -1
- package/lib/components/board.ts +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -210,55 +210,59 @@ expectTypesMatch(true);
|
|
|
210
210
|
import { z as z10 } from "zod";
|
|
211
211
|
var schematicPinLabel = z10.string().regex(/^[A-Za-z0-9_]+$/);
|
|
212
212
|
|
|
213
|
+
// lib/common/distance.ts
|
|
214
|
+
import "zod";
|
|
215
|
+
import { distance as distance4, length } from "circuit-json";
|
|
216
|
+
|
|
213
217
|
// lib/components/board.ts
|
|
214
|
-
import { z as
|
|
218
|
+
import { z as z25 } from "zod";
|
|
215
219
|
|
|
216
220
|
// lib/components/group.ts
|
|
217
|
-
import { length, distance as
|
|
221
|
+
import { length as length2, distance as distance6 } from "circuit-json";
|
|
218
222
|
|
|
219
223
|
// lib/common/point.ts
|
|
220
|
-
import { distance as
|
|
221
|
-
import { z as
|
|
222
|
-
var point =
|
|
223
|
-
x:
|
|
224
|
-
y:
|
|
224
|
+
import { distance as distance5 } from "circuit-json";
|
|
225
|
+
import { z as z12 } from "zod";
|
|
226
|
+
var point = z12.object({
|
|
227
|
+
x: distance5,
|
|
228
|
+
y: distance5
|
|
225
229
|
});
|
|
226
230
|
|
|
227
231
|
// lib/components/group.ts
|
|
228
|
-
import { z as
|
|
232
|
+
import { z as z24 } from "zod";
|
|
229
233
|
|
|
230
234
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
231
|
-
import { z as
|
|
232
|
-
var base_manual_edit_event =
|
|
233
|
-
edit_event_id:
|
|
234
|
-
in_progress:
|
|
235
|
-
created_at:
|
|
235
|
+
import { z as z13 } from "zod";
|
|
236
|
+
var base_manual_edit_event = z13.object({
|
|
237
|
+
edit_event_id: z13.string(),
|
|
238
|
+
in_progress: z13.boolean().optional(),
|
|
239
|
+
created_at: z13.number()
|
|
236
240
|
});
|
|
237
241
|
expectTypesMatch(
|
|
238
242
|
true
|
|
239
243
|
);
|
|
240
244
|
|
|
241
245
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
242
|
-
import { z as
|
|
246
|
+
import { z as z14 } from "zod";
|
|
243
247
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
244
|
-
pcb_edit_event_type:
|
|
245
|
-
edit_event_type:
|
|
246
|
-
pcb_component_id:
|
|
247
|
-
original_center:
|
|
248
|
-
new_center:
|
|
248
|
+
pcb_edit_event_type: z14.literal("edit_component_location").describe("deprecated"),
|
|
249
|
+
edit_event_type: z14.literal("edit_pcb_component_location"),
|
|
250
|
+
pcb_component_id: z14.string(),
|
|
251
|
+
original_center: z14.object({ x: z14.number(), y: z14.number() }),
|
|
252
|
+
new_center: z14.object({ x: z14.number(), y: z14.number() })
|
|
249
253
|
});
|
|
250
254
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
251
255
|
expectTypesMatch(true);
|
|
252
256
|
|
|
253
257
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
254
|
-
import { z as
|
|
258
|
+
import { z as z15 } from "zod";
|
|
255
259
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
256
|
-
pcb_edit_event_type:
|
|
257
|
-
edit_event_type:
|
|
258
|
-
pcb_port_id:
|
|
259
|
-
pcb_trace_hint_id:
|
|
260
|
-
route:
|
|
261
|
-
|
|
260
|
+
pcb_edit_event_type: z15.literal("edit_trace_hint").describe("deprecated"),
|
|
261
|
+
edit_event_type: z15.literal("edit_pcb_trace_hint").optional(),
|
|
262
|
+
pcb_port_id: z15.string(),
|
|
263
|
+
pcb_trace_hint_id: z15.string().optional(),
|
|
264
|
+
route: z15.array(
|
|
265
|
+
z15.object({ x: z15.number(), y: z15.number(), via: z15.boolean().optional() })
|
|
262
266
|
)
|
|
263
267
|
});
|
|
264
268
|
expectTypesMatch(
|
|
@@ -266,38 +270,38 @@ expectTypesMatch(
|
|
|
266
270
|
);
|
|
267
271
|
|
|
268
272
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
269
|
-
import { z as
|
|
273
|
+
import { z as z16 } from "zod";
|
|
270
274
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
271
|
-
edit_event_type:
|
|
272
|
-
schematic_component_id:
|
|
273
|
-
original_center:
|
|
274
|
-
new_center:
|
|
275
|
+
edit_event_type: z16.literal("edit_schematic_component_location"),
|
|
276
|
+
schematic_component_id: z16.string(),
|
|
277
|
+
original_center: z16.object({ x: z16.number(), y: z16.number() }),
|
|
278
|
+
new_center: z16.object({ x: z16.number(), y: z16.number() })
|
|
275
279
|
});
|
|
276
280
|
expectTypesMatch(true);
|
|
277
281
|
|
|
278
282
|
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
279
|
-
import { z as
|
|
283
|
+
import { z as z17 } from "zod";
|
|
280
284
|
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
281
|
-
edit_event_type:
|
|
282
|
-
pcb_group_id:
|
|
283
|
-
original_center:
|
|
284
|
-
new_center:
|
|
285
|
+
edit_event_type: z17.literal("edit_pcb_group_location"),
|
|
286
|
+
pcb_group_id: z17.string(),
|
|
287
|
+
original_center: z17.object({ x: z17.number(), y: z17.number() }),
|
|
288
|
+
new_center: z17.object({ x: z17.number(), y: z17.number() })
|
|
285
289
|
});
|
|
286
290
|
expectTypesMatch(true);
|
|
287
291
|
|
|
288
292
|
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
289
|
-
import { z as
|
|
293
|
+
import { z as z18 } from "zod";
|
|
290
294
|
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
291
|
-
edit_event_type:
|
|
292
|
-
schematic_group_id:
|
|
293
|
-
original_center:
|
|
294
|
-
new_center:
|
|
295
|
+
edit_event_type: z18.literal("edit_schematic_group_location"),
|
|
296
|
+
schematic_group_id: z18.string(),
|
|
297
|
+
original_center: z18.object({ x: z18.number(), y: z18.number() }),
|
|
298
|
+
new_center: z18.object({ x: z18.number(), y: z18.number() })
|
|
295
299
|
});
|
|
296
300
|
expectTypesMatch(true);
|
|
297
301
|
|
|
298
302
|
// lib/manual-edits/manual_edit_event.ts
|
|
299
|
-
import { z as
|
|
300
|
-
var manual_edit_event =
|
|
303
|
+
import { z as z19 } from "zod";
|
|
304
|
+
var manual_edit_event = z19.union([
|
|
301
305
|
edit_pcb_component_location_event,
|
|
302
306
|
edit_trace_hint_event,
|
|
303
307
|
edit_schematic_component_location_event
|
|
@@ -305,33 +309,33 @@ var manual_edit_event = z18.union([
|
|
|
305
309
|
expectTypesMatch(true);
|
|
306
310
|
|
|
307
311
|
// lib/manual-edits/manual_edits_file.ts
|
|
308
|
-
import { z as
|
|
312
|
+
import { z as z23 } from "zod";
|
|
309
313
|
|
|
310
314
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
311
|
-
import { z as
|
|
315
|
+
import { z as z20 } from "zod";
|
|
312
316
|
import { point as point2 } from "circuit-json";
|
|
313
|
-
var manual_pcb_placement =
|
|
314
|
-
selector:
|
|
315
|
-
relative_to:
|
|
317
|
+
var manual_pcb_placement = z20.object({
|
|
318
|
+
selector: z20.string(),
|
|
319
|
+
relative_to: z20.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
316
320
|
center: point2
|
|
317
321
|
});
|
|
318
322
|
expectTypesMatch(true);
|
|
319
323
|
|
|
320
324
|
// lib/manual-edits/manual_trace_hint.ts
|
|
321
|
-
import { z as
|
|
325
|
+
import { z as z21 } from "zod";
|
|
322
326
|
import { route_hint_point } from "circuit-json";
|
|
323
|
-
var manual_trace_hint =
|
|
324
|
-
pcb_port_selector:
|
|
325
|
-
offsets:
|
|
327
|
+
var manual_trace_hint = z21.object({
|
|
328
|
+
pcb_port_selector: z21.string(),
|
|
329
|
+
offsets: z21.array(route_hint_point)
|
|
326
330
|
});
|
|
327
331
|
expectTypesMatch(true);
|
|
328
332
|
|
|
329
333
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
330
|
-
import { z as
|
|
334
|
+
import { z as z22 } from "zod";
|
|
331
335
|
import { point as point4 } from "circuit-json";
|
|
332
|
-
var manual_schematic_placement =
|
|
333
|
-
selector:
|
|
334
|
-
relative_to:
|
|
336
|
+
var manual_schematic_placement = z22.object({
|
|
337
|
+
selector: z22.string(),
|
|
338
|
+
relative_to: z22.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
335
339
|
center: point4
|
|
336
340
|
});
|
|
337
341
|
expectTypesMatch(
|
|
@@ -339,30 +343,30 @@ expectTypesMatch(
|
|
|
339
343
|
);
|
|
340
344
|
|
|
341
345
|
// lib/manual-edits/manual_edits_file.ts
|
|
342
|
-
var manual_edits_file =
|
|
343
|
-
pcb_placements:
|
|
344
|
-
manual_trace_hints:
|
|
345
|
-
schematic_placements:
|
|
346
|
+
var manual_edits_file = z23.object({
|
|
347
|
+
pcb_placements: z23.array(manual_pcb_placement).optional(),
|
|
348
|
+
manual_trace_hints: z23.array(manual_trace_hint).optional(),
|
|
349
|
+
schematic_placements: z23.array(manual_schematic_placement).optional()
|
|
346
350
|
});
|
|
347
351
|
expectTypesMatch(true);
|
|
348
352
|
|
|
349
353
|
// lib/components/group.ts
|
|
350
|
-
var layoutConfig =
|
|
351
|
-
layoutMode:
|
|
352
|
-
position:
|
|
353
|
-
grid:
|
|
354
|
-
gridCols:
|
|
355
|
-
gridRows:
|
|
356
|
-
gridTemplateRows:
|
|
357
|
-
gridTemplateColumns:
|
|
358
|
-
gridTemplate:
|
|
359
|
-
gridGap:
|
|
360
|
-
gridRowGap:
|
|
361
|
-
gridColumnGap:
|
|
362
|
-
flex:
|
|
363
|
-
flexDirection:
|
|
364
|
-
alignItems:
|
|
365
|
-
justifyContent:
|
|
354
|
+
var layoutConfig = z24.object({
|
|
355
|
+
layoutMode: z24.enum(["grid", "flex", "match-adapt", "relative", "none"]).optional(),
|
|
356
|
+
position: z24.enum(["absolute", "relative"]).optional(),
|
|
357
|
+
grid: z24.boolean().optional(),
|
|
358
|
+
gridCols: z24.number().or(z24.string()).optional(),
|
|
359
|
+
gridRows: z24.number().or(z24.string()).optional(),
|
|
360
|
+
gridTemplateRows: z24.string().optional(),
|
|
361
|
+
gridTemplateColumns: z24.string().optional(),
|
|
362
|
+
gridTemplate: z24.string().optional(),
|
|
363
|
+
gridGap: z24.number().or(z24.string()).optional(),
|
|
364
|
+
gridRowGap: z24.number().or(z24.string()).optional(),
|
|
365
|
+
gridColumnGap: z24.number().or(z24.string()).optional(),
|
|
366
|
+
flex: z24.boolean().or(z24.string()).optional(),
|
|
367
|
+
flexDirection: z24.enum(["row", "column"]).optional(),
|
|
368
|
+
alignItems: z24.enum(["start", "center", "end", "stretch"]).optional(),
|
|
369
|
+
justifyContent: z24.enum([
|
|
366
370
|
"start",
|
|
367
371
|
"center",
|
|
368
372
|
"end",
|
|
@@ -371,84 +375,84 @@ var layoutConfig = z23.object({
|
|
|
371
375
|
"space-around",
|
|
372
376
|
"space-evenly"
|
|
373
377
|
]).optional(),
|
|
374
|
-
flexRow:
|
|
375
|
-
flexColumn:
|
|
376
|
-
gap:
|
|
377
|
-
pack:
|
|
378
|
-
packOrderStrategy:
|
|
378
|
+
flexRow: z24.boolean().optional(),
|
|
379
|
+
flexColumn: z24.boolean().optional(),
|
|
380
|
+
gap: z24.number().or(z24.string()).optional(),
|
|
381
|
+
pack: z24.boolean().optional().describe("Pack the contents of this group using a packing strategy"),
|
|
382
|
+
packOrderStrategy: z24.enum([
|
|
379
383
|
"largest_to_smallest",
|
|
380
384
|
"first_to_last",
|
|
381
385
|
"highest_to_lowest_pin_count"
|
|
382
386
|
]).optional(),
|
|
383
|
-
packPlacementStrategy:
|
|
384
|
-
padding:
|
|
385
|
-
paddingLeft:
|
|
386
|
-
paddingRight:
|
|
387
|
-
paddingTop:
|
|
388
|
-
paddingBottom:
|
|
389
|
-
paddingX:
|
|
390
|
-
paddingY:
|
|
391
|
-
width:
|
|
392
|
-
height:
|
|
393
|
-
matchAdapt:
|
|
394
|
-
matchAdaptTemplate:
|
|
395
|
-
});
|
|
396
|
-
expectTypesMatch(true);
|
|
397
|
-
var border =
|
|
398
|
-
strokeWidth:
|
|
399
|
-
dashed:
|
|
400
|
-
solid:
|
|
401
|
-
});
|
|
402
|
-
var autorouterConfig =
|
|
403
|
-
serverUrl:
|
|
404
|
-
inputFormat:
|
|
405
|
-
serverMode:
|
|
406
|
-
serverCacheEnabled:
|
|
407
|
-
cache:
|
|
408
|
-
traceClearance:
|
|
409
|
-
groupMode:
|
|
410
|
-
algorithmFn:
|
|
387
|
+
packPlacementStrategy: z24.enum(["shortest_connection_along_outline"]).optional(),
|
|
388
|
+
padding: length2.optional(),
|
|
389
|
+
paddingLeft: length2.optional(),
|
|
390
|
+
paddingRight: length2.optional(),
|
|
391
|
+
paddingTop: length2.optional(),
|
|
392
|
+
paddingBottom: length2.optional(),
|
|
393
|
+
paddingX: length2.optional(),
|
|
394
|
+
paddingY: length2.optional(),
|
|
395
|
+
width: length2.optional(),
|
|
396
|
+
height: length2.optional(),
|
|
397
|
+
matchAdapt: z24.boolean().optional(),
|
|
398
|
+
matchAdaptTemplate: z24.any().optional()
|
|
399
|
+
});
|
|
400
|
+
expectTypesMatch(true);
|
|
401
|
+
var border = z24.object({
|
|
402
|
+
strokeWidth: length2.optional(),
|
|
403
|
+
dashed: z24.boolean().optional(),
|
|
404
|
+
solid: z24.boolean().optional()
|
|
405
|
+
});
|
|
406
|
+
var autorouterConfig = z24.object({
|
|
407
|
+
serverUrl: z24.string().optional(),
|
|
408
|
+
inputFormat: z24.enum(["simplified", "circuit-json"]).optional(),
|
|
409
|
+
serverMode: z24.enum(["job", "solve-endpoint"]).optional(),
|
|
410
|
+
serverCacheEnabled: z24.boolean().optional(),
|
|
411
|
+
cache: z24.custom((v) => true).optional(),
|
|
412
|
+
traceClearance: length2.optional(),
|
|
413
|
+
groupMode: z24.enum(["sequential-trace", "subcircuit"]).optional(),
|
|
414
|
+
algorithmFn: z24.custom(
|
|
411
415
|
(v) => typeof v === "function" || v === void 0
|
|
412
416
|
).optional(),
|
|
413
|
-
preset:
|
|
417
|
+
preset: z24.enum([
|
|
414
418
|
"sequential-trace",
|
|
415
419
|
"subcircuit",
|
|
416
420
|
"auto",
|
|
417
421
|
"auto-local",
|
|
418
422
|
"auto-cloud"
|
|
419
423
|
]).optional(),
|
|
420
|
-
local:
|
|
424
|
+
local: z24.boolean().optional()
|
|
421
425
|
});
|
|
422
|
-
var autorouterProp =
|
|
426
|
+
var autorouterProp = z24.union([
|
|
423
427
|
autorouterConfig,
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
428
|
+
z24.literal("sequential-trace"),
|
|
429
|
+
z24.literal("subcircuit"),
|
|
430
|
+
z24.literal("auto"),
|
|
431
|
+
z24.literal("auto-local"),
|
|
432
|
+
z24.literal("auto-cloud")
|
|
429
433
|
]);
|
|
430
434
|
var baseGroupProps = commonLayoutProps.extend({
|
|
431
|
-
name:
|
|
432
|
-
children:
|
|
433
|
-
schTitle:
|
|
434
|
-
key:
|
|
435
|
+
name: z24.string().optional(),
|
|
436
|
+
children: z24.any().optional(),
|
|
437
|
+
schTitle: z24.string().optional(),
|
|
438
|
+
key: z24.any().optional(),
|
|
435
439
|
...layoutConfig.shape,
|
|
436
440
|
grid: layoutConfig.shape.grid.describe("@deprecated use pcbGrid"),
|
|
437
441
|
flex: layoutConfig.shape.flex.describe("@deprecated use pcbFlex"),
|
|
438
|
-
pcbGrid:
|
|
439
|
-
pcbGridCols:
|
|
440
|
-
pcbGridRows:
|
|
441
|
-
pcbGridTemplateRows:
|
|
442
|
-
pcbGridTemplateColumns:
|
|
443
|
-
pcbGridTemplate:
|
|
444
|
-
pcbGridGap:
|
|
445
|
-
pcbGridRowGap:
|
|
446
|
-
pcbGridColumnGap:
|
|
447
|
-
pcbFlex:
|
|
448
|
-
pcbFlexGap:
|
|
449
|
-
pcbFlexDirection:
|
|
450
|
-
pcbAlignItems:
|
|
451
|
-
pcbJustifyContent:
|
|
442
|
+
pcbGrid: z24.boolean().optional(),
|
|
443
|
+
pcbGridCols: z24.number().or(z24.string()).optional(),
|
|
444
|
+
pcbGridRows: z24.number().or(z24.string()).optional(),
|
|
445
|
+
pcbGridTemplateRows: z24.string().optional(),
|
|
446
|
+
pcbGridTemplateColumns: z24.string().optional(),
|
|
447
|
+
pcbGridTemplate: z24.string().optional(),
|
|
448
|
+
pcbGridGap: z24.number().or(z24.string()).optional(),
|
|
449
|
+
pcbGridRowGap: z24.number().or(z24.string()).optional(),
|
|
450
|
+
pcbGridColumnGap: z24.number().or(z24.string()).optional(),
|
|
451
|
+
pcbFlex: z24.boolean().or(z24.string()).optional(),
|
|
452
|
+
pcbFlexGap: z24.number().or(z24.string()).optional(),
|
|
453
|
+
pcbFlexDirection: z24.enum(["row", "column"]).optional(),
|
|
454
|
+
pcbAlignItems: z24.enum(["start", "center", "end", "stretch"]).optional(),
|
|
455
|
+
pcbJustifyContent: z24.enum([
|
|
452
456
|
"start",
|
|
453
457
|
"center",
|
|
454
458
|
"end",
|
|
@@ -457,24 +461,24 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
457
461
|
"space-around",
|
|
458
462
|
"space-evenly"
|
|
459
463
|
]).optional(),
|
|
460
|
-
pcbFlexRow:
|
|
461
|
-
pcbFlexColumn:
|
|
462
|
-
pcbGap:
|
|
463
|
-
pcbPack:
|
|
464
|
-
schGrid:
|
|
465
|
-
schGridCols:
|
|
466
|
-
schGridRows:
|
|
467
|
-
schGridTemplateRows:
|
|
468
|
-
schGridTemplateColumns:
|
|
469
|
-
schGridTemplate:
|
|
470
|
-
schGridGap:
|
|
471
|
-
schGridRowGap:
|
|
472
|
-
schGridColumnGap:
|
|
473
|
-
schFlex:
|
|
474
|
-
schFlexGap:
|
|
475
|
-
schFlexDirection:
|
|
476
|
-
schAlignItems:
|
|
477
|
-
schJustifyContent:
|
|
464
|
+
pcbFlexRow: z24.boolean().optional(),
|
|
465
|
+
pcbFlexColumn: z24.boolean().optional(),
|
|
466
|
+
pcbGap: z24.number().or(z24.string()).optional(),
|
|
467
|
+
pcbPack: z24.boolean().optional(),
|
|
468
|
+
schGrid: z24.boolean().optional(),
|
|
469
|
+
schGridCols: z24.number().or(z24.string()).optional(),
|
|
470
|
+
schGridRows: z24.number().or(z24.string()).optional(),
|
|
471
|
+
schGridTemplateRows: z24.string().optional(),
|
|
472
|
+
schGridTemplateColumns: z24.string().optional(),
|
|
473
|
+
schGridTemplate: z24.string().optional(),
|
|
474
|
+
schGridGap: z24.number().or(z24.string()).optional(),
|
|
475
|
+
schGridRowGap: z24.number().or(z24.string()).optional(),
|
|
476
|
+
schGridColumnGap: z24.number().or(z24.string()).optional(),
|
|
477
|
+
schFlex: z24.boolean().or(z24.string()).optional(),
|
|
478
|
+
schFlexGap: z24.number().or(z24.string()).optional(),
|
|
479
|
+
schFlexDirection: z24.enum(["row", "column"]).optional(),
|
|
480
|
+
schAlignItems: z24.enum(["start", "center", "end", "stretch"]).optional(),
|
|
481
|
+
schJustifyContent: z24.enum([
|
|
478
482
|
"start",
|
|
479
483
|
"center",
|
|
480
484
|
"end",
|
|
@@ -483,56 +487,56 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
483
487
|
"space-around",
|
|
484
488
|
"space-evenly"
|
|
485
489
|
]).optional(),
|
|
486
|
-
schFlexRow:
|
|
487
|
-
schFlexColumn:
|
|
488
|
-
schGap:
|
|
489
|
-
schPack:
|
|
490
|
-
schMatchAdapt:
|
|
491
|
-
pcbWidth:
|
|
492
|
-
pcbHeight:
|
|
493
|
-
schWidth:
|
|
494
|
-
schHeight:
|
|
490
|
+
schFlexRow: z24.boolean().optional(),
|
|
491
|
+
schFlexColumn: z24.boolean().optional(),
|
|
492
|
+
schGap: z24.number().or(z24.string()).optional(),
|
|
493
|
+
schPack: z24.boolean().optional(),
|
|
494
|
+
schMatchAdapt: z24.boolean().optional(),
|
|
495
|
+
pcbWidth: length2.optional(),
|
|
496
|
+
pcbHeight: length2.optional(),
|
|
497
|
+
schWidth: length2.optional(),
|
|
498
|
+
schHeight: length2.optional(),
|
|
495
499
|
pcbLayout: layoutConfig.optional(),
|
|
496
500
|
schLayout: layoutConfig.optional(),
|
|
497
501
|
cellBorder: border.nullable().optional(),
|
|
498
502
|
border: border.nullable().optional(),
|
|
499
|
-
schPadding:
|
|
500
|
-
schPaddingLeft:
|
|
501
|
-
schPaddingRight:
|
|
502
|
-
schPaddingTop:
|
|
503
|
-
schPaddingBottom:
|
|
504
|
-
pcbPadding:
|
|
505
|
-
pcbPaddingLeft:
|
|
506
|
-
pcbPaddingRight:
|
|
507
|
-
pcbPaddingTop:
|
|
508
|
-
pcbPaddingBottom:
|
|
509
|
-
});
|
|
510
|
-
var partsEngine =
|
|
503
|
+
schPadding: length2.optional(),
|
|
504
|
+
schPaddingLeft: length2.optional(),
|
|
505
|
+
schPaddingRight: length2.optional(),
|
|
506
|
+
schPaddingTop: length2.optional(),
|
|
507
|
+
schPaddingBottom: length2.optional(),
|
|
508
|
+
pcbPadding: length2.optional(),
|
|
509
|
+
pcbPaddingLeft: length2.optional(),
|
|
510
|
+
pcbPaddingRight: length2.optional(),
|
|
511
|
+
pcbPaddingTop: length2.optional(),
|
|
512
|
+
pcbPaddingBottom: length2.optional()
|
|
513
|
+
});
|
|
514
|
+
var partsEngine = z24.custom((v) => "findPart" in v);
|
|
511
515
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
512
516
|
manualEdits: manual_edits_file.optional(),
|
|
513
|
-
schAutoLayoutEnabled:
|
|
514
|
-
schTraceAutoLabelEnabled:
|
|
515
|
-
schMaxTraceDistance:
|
|
516
|
-
routingDisabled:
|
|
517
|
-
defaultTraceWidth:
|
|
518
|
-
minTraceWidth:
|
|
517
|
+
schAutoLayoutEnabled: z24.boolean().optional(),
|
|
518
|
+
schTraceAutoLabelEnabled: z24.boolean().optional(),
|
|
519
|
+
schMaxTraceDistance: distance6.optional(),
|
|
520
|
+
routingDisabled: z24.boolean().optional(),
|
|
521
|
+
defaultTraceWidth: length2.optional(),
|
|
522
|
+
minTraceWidth: length2.optional(),
|
|
519
523
|
partsEngine: partsEngine.optional(),
|
|
520
|
-
pcbRouteCache:
|
|
524
|
+
pcbRouteCache: z24.custom((v) => true).optional(),
|
|
521
525
|
autorouter: autorouterProp.optional(),
|
|
522
|
-
square:
|
|
523
|
-
emptyArea:
|
|
524
|
-
filledArea:
|
|
525
|
-
width:
|
|
526
|
-
height:
|
|
527
|
-
outline:
|
|
528
|
-
outlineOffsetX:
|
|
529
|
-
outlineOffsetY:
|
|
526
|
+
square: z24.boolean().optional(),
|
|
527
|
+
emptyArea: z24.string().optional(),
|
|
528
|
+
filledArea: z24.string().optional(),
|
|
529
|
+
width: distance6.optional(),
|
|
530
|
+
height: distance6.optional(),
|
|
531
|
+
outline: z24.array(point).optional(),
|
|
532
|
+
outlineOffsetX: distance6.optional(),
|
|
533
|
+
outlineOffsetY: distance6.optional()
|
|
530
534
|
});
|
|
531
535
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
532
|
-
subcircuit:
|
|
536
|
+
subcircuit: z24.literal(true)
|
|
533
537
|
});
|
|
534
|
-
var groupProps =
|
|
535
|
-
baseGroupProps.extend({ subcircuit:
|
|
538
|
+
var groupProps = z24.discriminatedUnion("subcircuit", [
|
|
539
|
+
baseGroupProps.extend({ subcircuit: z24.literal(false).optional() }),
|
|
536
540
|
subcircuitGroupPropsWithBool
|
|
537
541
|
]);
|
|
538
542
|
expectTypesMatch(true);
|
|
@@ -541,52 +545,53 @@ expectTypesMatch(true);
|
|
|
541
545
|
|
|
542
546
|
// lib/components/board.ts
|
|
543
547
|
var boardProps = subcircuitGroupProps.extend({
|
|
544
|
-
material:
|
|
545
|
-
layers:
|
|
548
|
+
material: z25.enum(["fr4", "fr1"]).default("fr4"),
|
|
549
|
+
layers: z25.union([z25.literal(2), z25.literal(4)]).default(2),
|
|
550
|
+
borderRadius: distance4.optional()
|
|
546
551
|
});
|
|
547
552
|
expectTypesMatch(true);
|
|
548
553
|
|
|
549
554
|
// lib/components/breakout.ts
|
|
550
|
-
import { distance as
|
|
555
|
+
import { distance as distance7 } from "circuit-json";
|
|
551
556
|
import "zod";
|
|
552
557
|
var breakoutProps = subcircuitGroupProps.extend({
|
|
553
|
-
padding:
|
|
554
|
-
paddingLeft:
|
|
555
|
-
paddingRight:
|
|
556
|
-
paddingTop:
|
|
557
|
-
paddingBottom:
|
|
558
|
+
padding: distance7.optional(),
|
|
559
|
+
paddingLeft: distance7.optional(),
|
|
560
|
+
paddingRight: distance7.optional(),
|
|
561
|
+
paddingTop: distance7.optional(),
|
|
562
|
+
paddingBottom: distance7.optional()
|
|
558
563
|
});
|
|
559
564
|
expectTypesMatch(true);
|
|
560
565
|
|
|
561
566
|
// lib/components/chip.ts
|
|
562
|
-
import { distance as
|
|
563
|
-
import { z as
|
|
564
|
-
var connectionTarget =
|
|
565
|
-
var connectionsProp =
|
|
566
|
-
var pinLabelsProp =
|
|
567
|
+
import { distance as distance8, supplier_name as supplier_name2 } from "circuit-json";
|
|
568
|
+
import { z as z27 } from "zod";
|
|
569
|
+
var connectionTarget = z27.string().or(z27.array(z27.string()).readonly()).or(z27.array(z27.string()));
|
|
570
|
+
var connectionsProp = z27.custom().pipe(z27.record(z27.string(), connectionTarget));
|
|
571
|
+
var pinLabelsProp = z27.record(
|
|
567
572
|
schematicPinLabel,
|
|
568
|
-
schematicPinLabel.or(
|
|
573
|
+
schematicPinLabel.or(z27.array(schematicPinLabel).readonly()).or(z27.array(schematicPinLabel))
|
|
569
574
|
);
|
|
570
575
|
expectTypesMatch(true);
|
|
571
|
-
var pinCompatibleVariant =
|
|
572
|
-
manufacturerPartNumber:
|
|
573
|
-
supplierPartNumber:
|
|
576
|
+
var pinCompatibleVariant = z27.object({
|
|
577
|
+
manufacturerPartNumber: z27.string().optional(),
|
|
578
|
+
supplierPartNumber: z27.record(supplier_name2, z27.array(z27.string())).optional()
|
|
574
579
|
});
|
|
575
580
|
var chipProps = commonComponentProps.extend({
|
|
576
|
-
manufacturerPartNumber:
|
|
581
|
+
manufacturerPartNumber: z27.string().optional(),
|
|
577
582
|
pinLabels: pinLabelsProp.optional(),
|
|
578
|
-
showPinAliases:
|
|
579
|
-
pcbPinLabels:
|
|
580
|
-
internallyConnectedPins:
|
|
581
|
-
externallyConnectedPins:
|
|
583
|
+
showPinAliases: z27.boolean().optional(),
|
|
584
|
+
pcbPinLabels: z27.record(z27.string(), z27.string()).optional(),
|
|
585
|
+
internallyConnectedPins: z27.array(z27.array(z27.union([z27.string(), z27.number()]))).optional(),
|
|
586
|
+
externallyConnectedPins: z27.array(z27.array(z27.string())).optional(),
|
|
582
587
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
583
588
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
584
|
-
pinCompatibleVariants:
|
|
589
|
+
pinCompatibleVariants: z27.array(pinCompatibleVariant).optional(),
|
|
585
590
|
schPinStyle: schematicPinStyle.optional(),
|
|
586
|
-
schPinSpacing:
|
|
587
|
-
schWidth:
|
|
588
|
-
schHeight:
|
|
589
|
-
noSchematicRepresentation:
|
|
591
|
+
schPinSpacing: distance8.optional(),
|
|
592
|
+
schWidth: distance8.optional(),
|
|
593
|
+
schHeight: distance8.optional(),
|
|
594
|
+
noSchematicRepresentation: z27.boolean().optional(),
|
|
590
595
|
connections: connectionsProp.optional()
|
|
591
596
|
});
|
|
592
597
|
var bugProps = chipProps;
|
|
@@ -597,145 +602,145 @@ var pinoutProps = chipProps;
|
|
|
597
602
|
expectTypesMatch(true);
|
|
598
603
|
|
|
599
604
|
// lib/components/jumper.ts
|
|
600
|
-
import { distance as
|
|
605
|
+
import { distance as distance9 } from "circuit-json";
|
|
601
606
|
|
|
602
607
|
// lib/common/connectionsProp.ts
|
|
603
|
-
import { z as
|
|
604
|
-
var connectionTarget2 =
|
|
608
|
+
import { z as z28 } from "zod";
|
|
609
|
+
var connectionTarget2 = z28.string().or(z28.array(z28.string()).readonly()).or(z28.array(z28.string()));
|
|
605
610
|
var createConnectionsProp = (labels) => {
|
|
606
|
-
return
|
|
611
|
+
return z28.record(z28.enum(labels), connectionTarget2);
|
|
607
612
|
};
|
|
608
613
|
|
|
609
614
|
// lib/components/jumper.ts
|
|
610
|
-
import { z as
|
|
615
|
+
import { z as z29 } from "zod";
|
|
611
616
|
var jumperProps = commonComponentProps.extend({
|
|
612
|
-
manufacturerPartNumber:
|
|
613
|
-
pinLabels:
|
|
614
|
-
|
|
615
|
-
schematicPinLabel.or(
|
|
617
|
+
manufacturerPartNumber: z29.string().optional(),
|
|
618
|
+
pinLabels: z29.record(
|
|
619
|
+
z29.number().or(schematicPinLabel),
|
|
620
|
+
schematicPinLabel.or(z29.array(schematicPinLabel))
|
|
616
621
|
).optional(),
|
|
617
622
|
schPinStyle: schematicPinStyle.optional(),
|
|
618
|
-
schPinSpacing:
|
|
619
|
-
schWidth:
|
|
620
|
-
schHeight:
|
|
621
|
-
schDirection:
|
|
623
|
+
schPinSpacing: distance9.optional(),
|
|
624
|
+
schWidth: distance9.optional(),
|
|
625
|
+
schHeight: distance9.optional(),
|
|
626
|
+
schDirection: z29.enum(["left", "right"]).optional(),
|
|
622
627
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
623
628
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
624
|
-
pcbPinLabels:
|
|
625
|
-
pinCount:
|
|
626
|
-
internallyConnectedPins:
|
|
627
|
-
connections:
|
|
629
|
+
pcbPinLabels: z29.record(z29.string(), z29.string()).optional(),
|
|
630
|
+
pinCount: z29.union([z29.literal(2), z29.literal(3)]).optional(),
|
|
631
|
+
internallyConnectedPins: z29.array(z29.array(z29.union([z29.string(), z29.number()]))).optional(),
|
|
632
|
+
connections: z29.custom().pipe(z29.record(z29.string(), connectionTarget2)).optional()
|
|
628
633
|
});
|
|
629
634
|
expectTypesMatch(true);
|
|
630
635
|
|
|
631
636
|
// lib/components/solderjumper.ts
|
|
632
|
-
import { z as
|
|
637
|
+
import { z as z30 } from "zod";
|
|
633
638
|
var solderjumperProps = jumperProps.extend({
|
|
634
|
-
bridgedPins:
|
|
635
|
-
bridged:
|
|
639
|
+
bridgedPins: z30.array(z30.array(z30.string())).optional(),
|
|
640
|
+
bridged: z30.boolean().optional()
|
|
636
641
|
});
|
|
637
642
|
expectTypesMatch(true);
|
|
638
643
|
|
|
639
644
|
// lib/components/connector.ts
|
|
640
|
-
import { distance as
|
|
641
|
-
import { z as
|
|
645
|
+
import { distance as distance10 } from "circuit-json";
|
|
646
|
+
import { z as z31 } from "zod";
|
|
642
647
|
var connectorProps = commonComponentProps.extend({
|
|
643
|
-
manufacturerPartNumber:
|
|
644
|
-
pinLabels:
|
|
645
|
-
|
|
646
|
-
schematicPinLabel.or(
|
|
648
|
+
manufacturerPartNumber: z31.string().optional(),
|
|
649
|
+
pinLabels: z31.record(
|
|
650
|
+
z31.number().or(schematicPinLabel),
|
|
651
|
+
schematicPinLabel.or(z31.array(schematicPinLabel))
|
|
647
652
|
).optional(),
|
|
648
653
|
schPinStyle: schematicPinStyle.optional(),
|
|
649
|
-
schPinSpacing:
|
|
650
|
-
schWidth:
|
|
651
|
-
schHeight:
|
|
652
|
-
schDirection:
|
|
654
|
+
schPinSpacing: distance10.optional(),
|
|
655
|
+
schWidth: distance10.optional(),
|
|
656
|
+
schHeight: distance10.optional(),
|
|
657
|
+
schDirection: z31.enum(["left", "right"]).optional(),
|
|
653
658
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
654
|
-
internallyConnectedPins:
|
|
655
|
-
standard:
|
|
659
|
+
internallyConnectedPins: z31.array(z31.array(z31.union([z31.string(), z31.number()]))).optional(),
|
|
660
|
+
standard: z31.enum(["usb_c", "m2"]).optional()
|
|
656
661
|
});
|
|
657
662
|
expectTypesMatch(true);
|
|
658
663
|
|
|
659
664
|
// lib/components/fuse.ts
|
|
660
|
-
import { z as
|
|
665
|
+
import { z as z32 } from "zod";
|
|
661
666
|
var fusePinLabels = ["pin1", "pin2"];
|
|
662
667
|
var fuseProps = commonComponentProps.extend({
|
|
663
|
-
currentRating:
|
|
664
|
-
voltageRating:
|
|
665
|
-
schShowRatings:
|
|
668
|
+
currentRating: z32.union([z32.number(), z32.string()]),
|
|
669
|
+
voltageRating: z32.union([z32.number(), z32.string()]).optional(),
|
|
670
|
+
schShowRatings: z32.boolean().optional(),
|
|
666
671
|
schOrientation: schematicOrientation.optional(),
|
|
667
|
-
connections:
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
672
|
+
connections: z32.record(
|
|
673
|
+
z32.string(),
|
|
674
|
+
z32.union([
|
|
675
|
+
z32.string(),
|
|
676
|
+
z32.array(z32.string()).readonly(),
|
|
677
|
+
z32.array(z32.string())
|
|
673
678
|
])
|
|
674
679
|
).optional()
|
|
675
680
|
});
|
|
676
681
|
|
|
677
682
|
// lib/components/platedhole.ts
|
|
678
|
-
import { distance as
|
|
679
|
-
import { z as
|
|
680
|
-
var distanceHiddenUndefined =
|
|
683
|
+
import { distance as distance11 } from "circuit-json";
|
|
684
|
+
import { z as z33 } from "zod";
|
|
685
|
+
var distanceHiddenUndefined = z33.custom().transform((a) => {
|
|
681
686
|
if (a === void 0) return void 0;
|
|
682
|
-
return
|
|
687
|
+
return distance11.parse(a);
|
|
683
688
|
});
|
|
684
|
-
var platedHoleProps =
|
|
689
|
+
var platedHoleProps = z33.discriminatedUnion("shape", [
|
|
685
690
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
686
|
-
name:
|
|
687
|
-
connectsTo:
|
|
688
|
-
shape:
|
|
689
|
-
holeDiameter:
|
|
690
|
-
outerDiameter:
|
|
691
|
+
name: z33.string().optional(),
|
|
692
|
+
connectsTo: z33.string().or(z33.array(z33.string())).optional(),
|
|
693
|
+
shape: z33.literal("circle"),
|
|
694
|
+
holeDiameter: distance11,
|
|
695
|
+
outerDiameter: distance11,
|
|
691
696
|
portHints: portHints.optional()
|
|
692
697
|
}),
|
|
693
698
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
694
|
-
name:
|
|
695
|
-
connectsTo:
|
|
696
|
-
shape:
|
|
697
|
-
outerWidth:
|
|
698
|
-
outerHeight:
|
|
699
|
+
name: z33.string().optional(),
|
|
700
|
+
connectsTo: z33.string().or(z33.array(z33.string())).optional(),
|
|
701
|
+
shape: z33.literal("oval"),
|
|
702
|
+
outerWidth: distance11,
|
|
703
|
+
outerHeight: distance11,
|
|
699
704
|
holeWidth: distanceHiddenUndefined,
|
|
700
705
|
holeHeight: distanceHiddenUndefined,
|
|
701
|
-
innerWidth:
|
|
702
|
-
innerHeight:
|
|
706
|
+
innerWidth: distance11.optional().describe("DEPRECATED use holeWidth"),
|
|
707
|
+
innerHeight: distance11.optional().describe("DEPRECATED use holeHeight"),
|
|
703
708
|
portHints: portHints.optional()
|
|
704
709
|
}),
|
|
705
710
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
706
|
-
name:
|
|
707
|
-
connectsTo:
|
|
708
|
-
shape:
|
|
709
|
-
rectPad:
|
|
710
|
-
outerWidth:
|
|
711
|
-
outerHeight:
|
|
711
|
+
name: z33.string().optional(),
|
|
712
|
+
connectsTo: z33.string().or(z33.array(z33.string())).optional(),
|
|
713
|
+
shape: z33.literal("pill"),
|
|
714
|
+
rectPad: z33.boolean().optional(),
|
|
715
|
+
outerWidth: distance11,
|
|
716
|
+
outerHeight: distance11,
|
|
712
717
|
holeWidth: distanceHiddenUndefined,
|
|
713
718
|
holeHeight: distanceHiddenUndefined,
|
|
714
|
-
innerWidth:
|
|
715
|
-
innerHeight:
|
|
719
|
+
innerWidth: distance11.optional().describe("DEPRECATED use holeWidth"),
|
|
720
|
+
innerHeight: distance11.optional().describe("DEPRECATED use holeHeight"),
|
|
716
721
|
portHints: portHints.optional()
|
|
717
722
|
}),
|
|
718
723
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
719
|
-
name:
|
|
720
|
-
connectsTo:
|
|
721
|
-
shape:
|
|
722
|
-
holeDiameter:
|
|
723
|
-
rectPadWidth:
|
|
724
|
-
rectPadHeight:
|
|
725
|
-
holeShape:
|
|
726
|
-
padShape:
|
|
724
|
+
name: z33.string().optional(),
|
|
725
|
+
connectsTo: z33.string().or(z33.array(z33.string())).optional(),
|
|
726
|
+
shape: z33.literal("circular_hole_with_rect_pad"),
|
|
727
|
+
holeDiameter: distance11,
|
|
728
|
+
rectPadWidth: distance11,
|
|
729
|
+
rectPadHeight: distance11,
|
|
730
|
+
holeShape: z33.literal("circle").optional(),
|
|
731
|
+
padShape: z33.literal("rect").optional(),
|
|
727
732
|
portHints: portHints.optional()
|
|
728
733
|
}),
|
|
729
734
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
730
|
-
name:
|
|
731
|
-
connectsTo:
|
|
732
|
-
shape:
|
|
733
|
-
holeShape:
|
|
734
|
-
padShape:
|
|
735
|
-
holeWidth:
|
|
736
|
-
holeHeight:
|
|
737
|
-
rectPadWidth:
|
|
738
|
-
rectPadHeight:
|
|
735
|
+
name: z33.string().optional(),
|
|
736
|
+
connectsTo: z33.string().or(z33.array(z33.string())).optional(),
|
|
737
|
+
shape: z33.literal("pill_hole_with_rect_pad"),
|
|
738
|
+
holeShape: z33.literal("pill"),
|
|
739
|
+
padShape: z33.literal("rect"),
|
|
740
|
+
holeWidth: distance11,
|
|
741
|
+
holeHeight: distance11,
|
|
742
|
+
rectPadWidth: distance11,
|
|
743
|
+
rectPadHeight: distance11,
|
|
739
744
|
portHints: portHints.optional()
|
|
740
745
|
})
|
|
741
746
|
]).refine((a) => {
|
|
@@ -751,14 +756,14 @@ expectTypesMatch(true);
|
|
|
751
756
|
|
|
752
757
|
// lib/components/resistor.ts
|
|
753
758
|
import { resistance } from "circuit-json";
|
|
754
|
-
import { z as
|
|
759
|
+
import { z as z34 } from "zod";
|
|
755
760
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
756
761
|
var resistorProps = commonComponentProps.extend({
|
|
757
762
|
resistance,
|
|
758
|
-
pullupFor:
|
|
759
|
-
pullupTo:
|
|
760
|
-
pulldownFor:
|
|
761
|
-
pulldownTo:
|
|
763
|
+
pullupFor: z34.string().optional(),
|
|
764
|
+
pullupTo: z34.string().optional(),
|
|
765
|
+
pulldownFor: z34.string().optional(),
|
|
766
|
+
pulldownTo: z34.string().optional(),
|
|
762
767
|
schOrientation: schematicOrientation.optional(),
|
|
763
768
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
764
769
|
});
|
|
@@ -767,23 +772,23 @@ expectTypesMatch(true);
|
|
|
767
772
|
|
|
768
773
|
// lib/components/potentiometer.ts
|
|
769
774
|
import { resistance as resistance2 } from "circuit-json";
|
|
770
|
-
import { z as
|
|
775
|
+
import { z as z35 } from "zod";
|
|
771
776
|
var potentiometerProps = commonComponentProps.extend({
|
|
772
777
|
maxResistance: resistance2,
|
|
773
|
-
pinVariant:
|
|
778
|
+
pinVariant: z35.enum(["two_pin", "three_pin"]).optional()
|
|
774
779
|
});
|
|
775
780
|
expectTypesMatch(true);
|
|
776
781
|
|
|
777
782
|
// lib/components/crystal.ts
|
|
778
783
|
import { frequency, capacitance } from "circuit-json";
|
|
779
|
-
import { z as
|
|
784
|
+
import { z as z36 } from "zod";
|
|
780
785
|
var crystalPins = lrPins;
|
|
781
786
|
var crystalProps = commonComponentProps.extend({
|
|
782
787
|
frequency,
|
|
783
788
|
loadCapacitance: capacitance,
|
|
784
|
-
manufacturerPartNumber:
|
|
785
|
-
mpn:
|
|
786
|
-
pinVariant:
|
|
789
|
+
manufacturerPartNumber: z36.string().optional(),
|
|
790
|
+
mpn: z36.string().optional(),
|
|
791
|
+
pinVariant: z36.enum(["two_pin", "four_pin"]).optional(),
|
|
787
792
|
schOrientation: schematicOrientation.optional(),
|
|
788
793
|
connections: createConnectionsProp(crystalPins).optional()
|
|
789
794
|
});
|
|
@@ -791,34 +796,34 @@ expectTypesMatch(true);
|
|
|
791
796
|
|
|
792
797
|
// lib/components/resonator.ts
|
|
793
798
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
794
|
-
import { z as
|
|
799
|
+
import { z as z37 } from "zod";
|
|
795
800
|
var resonatorProps = commonComponentProps.extend({
|
|
796
801
|
frequency: frequency2,
|
|
797
802
|
loadCapacitance: capacitance2,
|
|
798
|
-
pinVariant:
|
|
803
|
+
pinVariant: z37.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
799
804
|
});
|
|
800
805
|
expectTypesMatch(true);
|
|
801
806
|
|
|
802
807
|
// lib/components/stampboard.ts
|
|
803
|
-
import { distance as
|
|
804
|
-
import { z as
|
|
808
|
+
import { distance as distance12 } from "circuit-json";
|
|
809
|
+
import { z as z38 } from "zod";
|
|
805
810
|
var stampboardProps = boardProps.extend({
|
|
806
|
-
leftPinCount:
|
|
807
|
-
rightPinCount:
|
|
808
|
-
topPinCount:
|
|
809
|
-
bottomPinCount:
|
|
810
|
-
leftPins:
|
|
811
|
-
rightPins:
|
|
812
|
-
topPins:
|
|
813
|
-
bottomPins:
|
|
814
|
-
pinPitch:
|
|
815
|
-
innerHoles:
|
|
811
|
+
leftPinCount: z38.number().optional(),
|
|
812
|
+
rightPinCount: z38.number().optional(),
|
|
813
|
+
topPinCount: z38.number().optional(),
|
|
814
|
+
bottomPinCount: z38.number().optional(),
|
|
815
|
+
leftPins: z38.array(z38.string()).optional(),
|
|
816
|
+
rightPins: z38.array(z38.string()).optional(),
|
|
817
|
+
topPins: z38.array(z38.string()).optional(),
|
|
818
|
+
bottomPins: z38.array(z38.string()).optional(),
|
|
819
|
+
pinPitch: distance12.optional(),
|
|
820
|
+
innerHoles: z38.boolean().optional()
|
|
816
821
|
});
|
|
817
822
|
expectTypesMatch(true);
|
|
818
823
|
|
|
819
824
|
// lib/components/capacitor.ts
|
|
820
825
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
821
|
-
import { z as
|
|
826
|
+
import { z as z39 } from "zod";
|
|
822
827
|
var capacitorPinLabels = [
|
|
823
828
|
"pin1",
|
|
824
829
|
"pin2",
|
|
@@ -830,13 +835,13 @@ var capacitorPinLabels = [
|
|
|
830
835
|
var capacitorProps = commonComponentProps.extend({
|
|
831
836
|
capacitance: capacitance3,
|
|
832
837
|
maxVoltageRating: voltage.optional(),
|
|
833
|
-
schShowRatings:
|
|
834
|
-
polarized:
|
|
835
|
-
decouplingFor:
|
|
836
|
-
decouplingTo:
|
|
837
|
-
bypassFor:
|
|
838
|
-
bypassTo:
|
|
839
|
-
maxDecouplingTraceLength:
|
|
838
|
+
schShowRatings: z39.boolean().optional().default(false),
|
|
839
|
+
polarized: z39.boolean().optional().default(false),
|
|
840
|
+
decouplingFor: z39.string().optional(),
|
|
841
|
+
decouplingTo: z39.string().optional(),
|
|
842
|
+
bypassFor: z39.string().optional(),
|
|
843
|
+
bypassTo: z39.string().optional(),
|
|
844
|
+
maxDecouplingTraceLength: z39.number().optional(),
|
|
840
845
|
schOrientation: schematicOrientation.optional(),
|
|
841
846
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
842
847
|
});
|
|
@@ -844,31 +849,27 @@ var capacitorPins = lrPolarPins;
|
|
|
844
849
|
expectTypesMatch(true);
|
|
845
850
|
|
|
846
851
|
// lib/components/net.ts
|
|
847
|
-
import { z as
|
|
848
|
-
var netProps =
|
|
849
|
-
name:
|
|
850
|
-
connectsTo:
|
|
852
|
+
import { z as z40 } from "zod";
|
|
853
|
+
var netProps = z40.object({
|
|
854
|
+
name: z40.string(),
|
|
855
|
+
connectsTo: z40.string().or(z40.array(z40.string())).optional()
|
|
851
856
|
});
|
|
852
857
|
expectTypesMatch(true);
|
|
853
858
|
|
|
854
859
|
// lib/components/constrainedlayout.ts
|
|
855
|
-
import { z as
|
|
856
|
-
var constrainedLayoutProps =
|
|
857
|
-
name:
|
|
858
|
-
pcbOnly:
|
|
859
|
-
schOnly:
|
|
860
|
+
import { z as z41 } from "zod";
|
|
861
|
+
var constrainedLayoutProps = z41.object({
|
|
862
|
+
name: z41.string().optional(),
|
|
863
|
+
pcbOnly: z41.boolean().optional(),
|
|
864
|
+
schOnly: z41.boolean().optional()
|
|
860
865
|
});
|
|
861
866
|
expectTypesMatch(true);
|
|
862
867
|
|
|
863
|
-
// lib/common/distance.ts
|
|
864
|
-
import "zod";
|
|
865
|
-
import { distance as distance12, length as length2 } from "circuit-json";
|
|
866
|
-
|
|
867
868
|
// lib/components/constraint.ts
|
|
868
869
|
import { z as z42 } from "zod";
|
|
869
870
|
var pcbXDistConstraintProps = z42.object({
|
|
870
871
|
pcb: z42.literal(true).optional(),
|
|
871
|
-
xDist:
|
|
872
|
+
xDist: distance4,
|
|
872
873
|
left: z42.string(),
|
|
873
874
|
right: z42.string(),
|
|
874
875
|
edgeToEdge: z42.literal(true).optional(),
|
|
@@ -879,7 +880,7 @@ expectTypesMatch(
|
|
|
879
880
|
);
|
|
880
881
|
var pcbYDistConstraintProps = z42.object({
|
|
881
882
|
pcb: z42.literal(true).optional(),
|
|
882
|
-
yDist:
|
|
883
|
+
yDist: distance4,
|
|
883
884
|
top: z42.string(),
|
|
884
885
|
bottom: z42.string(),
|
|
885
886
|
edgeToEdge: z42.literal(true).optional(),
|
|
@@ -920,8 +921,8 @@ var rectCutoutProps = pcbLayoutProps.omit({
|
|
|
920
921
|
}).extend({
|
|
921
922
|
name: z43.string().optional(),
|
|
922
923
|
shape: z43.literal("rect"),
|
|
923
|
-
width:
|
|
924
|
-
height:
|
|
924
|
+
width: distance4,
|
|
925
|
+
height: distance4
|
|
925
926
|
});
|
|
926
927
|
expectTypesMatch(true);
|
|
927
928
|
var circleCutoutProps = pcbLayoutProps.omit({
|
|
@@ -930,7 +931,7 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
930
931
|
}).extend({
|
|
931
932
|
name: z43.string().optional(),
|
|
932
933
|
shape: z43.literal("circle"),
|
|
933
|
-
radius:
|
|
934
|
+
radius: distance4
|
|
934
935
|
});
|
|
935
936
|
expectTypesMatch(true);
|
|
936
937
|
var polygonCutoutProps = pcbLayoutProps.omit({
|
|
@@ -953,16 +954,16 @@ import { z as z44 } from "zod";
|
|
|
953
954
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
954
955
|
name: z44.string().optional(),
|
|
955
956
|
shape: z44.literal("rect"),
|
|
956
|
-
width:
|
|
957
|
-
height:
|
|
957
|
+
width: distance4,
|
|
958
|
+
height: distance4,
|
|
958
959
|
portHints: portHints.optional()
|
|
959
960
|
});
|
|
960
961
|
expectTypesMatch(true);
|
|
961
962
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
962
963
|
name: z44.string().optional(),
|
|
963
964
|
shape: z44.literal("rotated_rect"),
|
|
964
|
-
width:
|
|
965
|
-
height:
|
|
965
|
+
width: distance4,
|
|
966
|
+
height: distance4,
|
|
966
967
|
ccwRotation: z44.number(),
|
|
967
968
|
portHints: portHints.optional()
|
|
968
969
|
});
|
|
@@ -970,16 +971,16 @@ expectTypesMatch(true);
|
|
|
970
971
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
971
972
|
name: z44.string().optional(),
|
|
972
973
|
shape: z44.literal("circle"),
|
|
973
|
-
radius:
|
|
974
|
+
radius: distance4,
|
|
974
975
|
portHints: portHints.optional()
|
|
975
976
|
});
|
|
976
977
|
expectTypesMatch(true);
|
|
977
978
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
978
979
|
name: z44.string().optional(),
|
|
979
980
|
shape: z44.literal("pill"),
|
|
980
|
-
width:
|
|
981
|
-
height:
|
|
982
|
-
radius:
|
|
981
|
+
width: distance4,
|
|
982
|
+
height: distance4,
|
|
983
|
+
radius: distance4,
|
|
983
984
|
portHints: portHints.optional()
|
|
984
985
|
});
|
|
985
986
|
expectTypesMatch(true);
|
|
@@ -1003,13 +1004,13 @@ expectTypesMatch(true);
|
|
|
1003
1004
|
import { z as z45 } from "zod";
|
|
1004
1005
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1005
1006
|
shape: z45.literal("rect"),
|
|
1006
|
-
width:
|
|
1007
|
-
height:
|
|
1007
|
+
width: distance4,
|
|
1008
|
+
height: distance4
|
|
1008
1009
|
});
|
|
1009
1010
|
expectTypesMatch(true);
|
|
1010
1011
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1011
1012
|
shape: z45.literal("circle"),
|
|
1012
|
-
radius:
|
|
1013
|
+
radius: distance4
|
|
1013
1014
|
});
|
|
1014
1015
|
expectTypesMatch(true);
|
|
1015
1016
|
var solderPasteProps = z45.union([
|
|
@@ -1022,8 +1023,8 @@ expectTypesMatch(true);
|
|
|
1022
1023
|
import { z as z46 } from "zod";
|
|
1023
1024
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1024
1025
|
name: z46.string().optional(),
|
|
1025
|
-
diameter:
|
|
1026
|
-
radius:
|
|
1026
|
+
diameter: distance4.optional(),
|
|
1027
|
+
radius: distance4.optional()
|
|
1027
1028
|
}).transform((d) => ({
|
|
1028
1029
|
...d,
|
|
1029
1030
|
diameter: d.diameter ?? 2 * d.radius,
|
|
@@ -1130,8 +1131,8 @@ import { rotation as rotation2 } from "circuit-json";
|
|
|
1130
1131
|
var netAliasProps = z52.object({
|
|
1131
1132
|
net: z52.string().optional(),
|
|
1132
1133
|
connection: z52.string().optional(),
|
|
1133
|
-
schX:
|
|
1134
|
-
schY:
|
|
1134
|
+
schX: distance4.optional(),
|
|
1135
|
+
schY: distance4.optional(),
|
|
1135
1136
|
schRotation: rotation2.optional(),
|
|
1136
1137
|
anchorSide: z52.enum(["left", "top", "right", "bottom"]).optional()
|
|
1137
1138
|
});
|
|
@@ -1144,8 +1145,8 @@ var netLabelProps = z53.object({
|
|
|
1144
1145
|
net: z53.string().optional(),
|
|
1145
1146
|
connection: z53.string().optional(),
|
|
1146
1147
|
connectsTo: z53.string().or(z53.array(z53.string())).optional(),
|
|
1147
|
-
schX:
|
|
1148
|
-
schY:
|
|
1148
|
+
schX: distance4.optional(),
|
|
1149
|
+
schY: distance4.optional(),
|
|
1149
1150
|
schRotation: rotation3.optional(),
|
|
1150
1151
|
anchorSide: z53.enum(["left", "top", "right", "bottom"]).optional()
|
|
1151
1152
|
});
|