@tscircuit/props 0.0.448 → 0.0.450
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 +75130 -19574
- package/dist/index.js +1065 -1009
- package/dist/index.js.map +1 -1
- package/lib/common/kicadSymbolMetadata.ts +115 -0
- package/lib/common/layout.ts +8 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ expectTypesMatch(true);
|
|
|
25
25
|
|
|
26
26
|
// lib/common/layout.ts
|
|
27
27
|
import {
|
|
28
|
-
distance as
|
|
28
|
+
distance as distance8,
|
|
29
29
|
layer_ref,
|
|
30
30
|
rotation as rotation2,
|
|
31
31
|
supplier_name
|
|
@@ -39,7 +39,7 @@ var distance = baseDistance;
|
|
|
39
39
|
var pcbCoordinate = calcString.or(baseDistance);
|
|
40
40
|
|
|
41
41
|
// lib/common/layout.ts
|
|
42
|
-
import { z as
|
|
42
|
+
import { z as z13 } from "zod";
|
|
43
43
|
|
|
44
44
|
// lib/common/cadModel.ts
|
|
45
45
|
import { z as z5 } from "zod";
|
|
@@ -195,143 +195,193 @@ var kicadFootprintMetadata = z8.object({
|
|
|
195
195
|
});
|
|
196
196
|
expectTypesMatch(true);
|
|
197
197
|
|
|
198
|
-
// lib/common/
|
|
198
|
+
// lib/common/kicadSymbolMetadata.ts
|
|
199
199
|
import { distance as distance5 } from "circuit-json";
|
|
200
200
|
import { z as z9 } from "zod";
|
|
201
|
-
var
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
201
|
+
var kicadSymbolPinNumbers = z9.object({
|
|
202
|
+
hide: z9.boolean().optional()
|
|
203
|
+
});
|
|
204
|
+
expectTypesMatch(true);
|
|
205
|
+
var kicadSymbolPinNames = z9.object({
|
|
206
|
+
offset: distance5.optional(),
|
|
207
|
+
hide: z9.boolean().optional()
|
|
208
|
+
});
|
|
209
|
+
expectTypesMatch(true);
|
|
210
|
+
var kicadSymbolEffects = z9.object({
|
|
211
|
+
font: kicadFont.optional(),
|
|
212
|
+
justify: z9.union([z9.string(), z9.array(z9.string())]).optional(),
|
|
213
|
+
hide: z9.boolean().optional()
|
|
214
|
+
});
|
|
215
|
+
expectTypesMatch(true);
|
|
216
|
+
var kicadSymbolProperty = z9.object({
|
|
217
|
+
value: z9.string(),
|
|
218
|
+
id: z9.union([z9.number(), z9.string()]).optional(),
|
|
219
|
+
at: kicadAt.optional(),
|
|
220
|
+
effects: kicadSymbolEffects.optional()
|
|
221
|
+
});
|
|
222
|
+
expectTypesMatch(true);
|
|
223
|
+
var kicadSymbolProperties = z9.object({
|
|
224
|
+
Reference: kicadSymbolProperty.optional(),
|
|
225
|
+
Value: kicadSymbolProperty.optional(),
|
|
226
|
+
Footprint: kicadSymbolProperty.optional(),
|
|
227
|
+
Datasheet: kicadSymbolProperty.optional(),
|
|
228
|
+
Description: kicadSymbolProperty.optional(),
|
|
229
|
+
ki_keywords: kicadSymbolProperty.optional(),
|
|
230
|
+
ki_fp_filters: kicadSymbolProperty.optional()
|
|
231
|
+
});
|
|
232
|
+
expectTypesMatch(true);
|
|
233
|
+
var kicadSymbolMetadata = z9.object({
|
|
234
|
+
symbolName: z9.string().optional(),
|
|
235
|
+
extends: z9.string().optional(),
|
|
236
|
+
pinNumbers: kicadSymbolPinNumbers.optional(),
|
|
237
|
+
pinNames: kicadSymbolPinNames.optional(),
|
|
238
|
+
excludeFromSim: z9.boolean().optional(),
|
|
239
|
+
inBom: z9.boolean().optional(),
|
|
240
|
+
onBoard: z9.boolean().optional(),
|
|
241
|
+
properties: kicadSymbolProperties.optional(),
|
|
242
|
+
embeddedFonts: z9.boolean().optional()
|
|
243
|
+
});
|
|
244
|
+
expectTypesMatch(true);
|
|
245
|
+
|
|
246
|
+
// lib/common/pcbStyle.ts
|
|
247
|
+
import { distance as distance6 } from "circuit-json";
|
|
248
|
+
import { z as z10 } from "zod";
|
|
249
|
+
var pcbStyle = z10.object({
|
|
250
|
+
silkscreenFontSize: distance6.optional(),
|
|
251
|
+
viaPadDiameter: distance6.optional(),
|
|
252
|
+
viaHoleDiameter: distance6.optional(),
|
|
253
|
+
silkscreenTextPosition: z10.union([
|
|
254
|
+
z10.enum(["centered", "outside", "none"]),
|
|
255
|
+
z10.object({
|
|
256
|
+
offsetX: z10.number(),
|
|
257
|
+
offsetY: z10.number()
|
|
210
258
|
})
|
|
211
259
|
]).optional(),
|
|
212
|
-
silkscreenTextVisibility:
|
|
260
|
+
silkscreenTextVisibility: z10.enum(["hidden", "visible", "inherit"]).optional()
|
|
213
261
|
});
|
|
214
262
|
expectTypesMatch(true);
|
|
215
263
|
|
|
216
264
|
// lib/common/schStyle.ts
|
|
217
|
-
import { distance as
|
|
218
|
-
import { z as
|
|
219
|
-
var schStyle =
|
|
220
|
-
defaultPassiveSize:
|
|
221
|
-
defaultCapacitorOrientation:
|
|
265
|
+
import { distance as distance7 } from "circuit-json";
|
|
266
|
+
import { z as z11 } from "zod";
|
|
267
|
+
var schStyle = z11.object({
|
|
268
|
+
defaultPassiveSize: z11.union([z11.enum(["xs", "sm", "md"]), distance7]).optional(),
|
|
269
|
+
defaultCapacitorOrientation: z11.enum(["vertical", "none"]).optional()
|
|
222
270
|
});
|
|
223
271
|
expectTypesMatch(true);
|
|
224
272
|
|
|
225
273
|
// lib/common/symbolProp.ts
|
|
226
|
-
import { z as
|
|
227
|
-
var symbolProp =
|
|
274
|
+
import { z as z12 } from "zod";
|
|
275
|
+
var symbolProp = z12.custom((v) => true);
|
|
228
276
|
|
|
229
277
|
// lib/common/layout.ts
|
|
230
|
-
var pcbLayoutProps =
|
|
278
|
+
var pcbLayoutProps = z13.object({
|
|
231
279
|
pcbX: pcbCoordinate.optional(),
|
|
232
280
|
pcbY: pcbCoordinate.optional(),
|
|
233
281
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
234
282
|
pcbRightEdgeX: pcbCoordinate.optional(),
|
|
235
283
|
pcbTopEdgeY: pcbCoordinate.optional(),
|
|
236
284
|
pcbBottomEdgeY: pcbCoordinate.optional(),
|
|
237
|
-
pcbOffsetX:
|
|
238
|
-
pcbOffsetY:
|
|
285
|
+
pcbOffsetX: distance8.optional(),
|
|
286
|
+
pcbOffsetY: distance8.optional(),
|
|
239
287
|
pcbRotation: rotation2.optional(),
|
|
240
|
-
pcbPositionAnchor:
|
|
241
|
-
pcbPositionMode:
|
|
288
|
+
pcbPositionAnchor: z13.string().optional(),
|
|
289
|
+
pcbPositionMode: z13.enum([
|
|
242
290
|
"relative_to_group_anchor",
|
|
243
291
|
"auto",
|
|
244
292
|
"relative_to_board_anchor",
|
|
245
293
|
"relative_to_component_anchor"
|
|
246
294
|
]).optional(),
|
|
247
295
|
layer: layer_ref.optional(),
|
|
248
|
-
pcbMarginTop:
|
|
249
|
-
pcbMarginRight:
|
|
250
|
-
pcbMarginBottom:
|
|
251
|
-
pcbMarginLeft:
|
|
252
|
-
pcbMarginX:
|
|
253
|
-
pcbMarginY:
|
|
296
|
+
pcbMarginTop: distance8.optional(),
|
|
297
|
+
pcbMarginRight: distance8.optional(),
|
|
298
|
+
pcbMarginBottom: distance8.optional(),
|
|
299
|
+
pcbMarginLeft: distance8.optional(),
|
|
300
|
+
pcbMarginX: distance8.optional(),
|
|
301
|
+
pcbMarginY: distance8.optional(),
|
|
254
302
|
pcbStyle: pcbStyle.optional(),
|
|
255
|
-
pcbRelative:
|
|
256
|
-
relative:
|
|
303
|
+
pcbRelative: z13.boolean().optional(),
|
|
304
|
+
relative: z13.boolean().optional()
|
|
257
305
|
});
|
|
258
306
|
expectTypesMatch(true);
|
|
259
|
-
var commonLayoutProps =
|
|
307
|
+
var commonLayoutProps = z13.object({
|
|
260
308
|
pcbX: pcbCoordinate.optional(),
|
|
261
309
|
pcbY: pcbCoordinate.optional(),
|
|
262
310
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
263
311
|
pcbRightEdgeX: pcbCoordinate.optional(),
|
|
264
312
|
pcbTopEdgeY: pcbCoordinate.optional(),
|
|
265
313
|
pcbBottomEdgeY: pcbCoordinate.optional(),
|
|
266
|
-
pcbOffsetX:
|
|
267
|
-
pcbOffsetY:
|
|
314
|
+
pcbOffsetX: distance8.optional(),
|
|
315
|
+
pcbOffsetY: distance8.optional(),
|
|
268
316
|
pcbRotation: rotation2.optional(),
|
|
269
|
-
pcbPositionAnchor:
|
|
270
|
-
pcbPositionMode:
|
|
317
|
+
pcbPositionAnchor: z13.string().optional(),
|
|
318
|
+
pcbPositionMode: z13.enum([
|
|
271
319
|
"relative_to_group_anchor",
|
|
272
320
|
"auto",
|
|
273
321
|
"relative_to_board_anchor",
|
|
274
322
|
"relative_to_component_anchor"
|
|
275
323
|
]).optional(),
|
|
276
|
-
pcbMarginTop:
|
|
277
|
-
pcbMarginRight:
|
|
278
|
-
pcbMarginBottom:
|
|
279
|
-
pcbMarginLeft:
|
|
280
|
-
pcbMarginX:
|
|
281
|
-
pcbMarginY:
|
|
324
|
+
pcbMarginTop: distance8.optional(),
|
|
325
|
+
pcbMarginRight: distance8.optional(),
|
|
326
|
+
pcbMarginBottom: distance8.optional(),
|
|
327
|
+
pcbMarginLeft: distance8.optional(),
|
|
328
|
+
pcbMarginX: distance8.optional(),
|
|
329
|
+
pcbMarginY: distance8.optional(),
|
|
282
330
|
pcbStyle: pcbStyle.optional(),
|
|
283
|
-
schMarginTop:
|
|
284
|
-
schMarginRight:
|
|
285
|
-
schMarginBottom:
|
|
286
|
-
schMarginLeft:
|
|
287
|
-
schMarginX:
|
|
288
|
-
schMarginY:
|
|
289
|
-
schX:
|
|
290
|
-
schY:
|
|
331
|
+
schMarginTop: distance8.optional(),
|
|
332
|
+
schMarginRight: distance8.optional(),
|
|
333
|
+
schMarginBottom: distance8.optional(),
|
|
334
|
+
schMarginLeft: distance8.optional(),
|
|
335
|
+
schMarginX: distance8.optional(),
|
|
336
|
+
schMarginY: distance8.optional(),
|
|
337
|
+
schX: distance8.optional(),
|
|
338
|
+
schY: distance8.optional(),
|
|
291
339
|
schRotation: rotation2.optional(),
|
|
292
340
|
layer: layer_ref.optional(),
|
|
293
341
|
footprint: footprintProp.optional(),
|
|
294
342
|
symbol: symbolProp.optional(),
|
|
295
343
|
schStyle: schStyle.optional(),
|
|
296
|
-
relative:
|
|
297
|
-
schRelative:
|
|
298
|
-
pcbRelative:
|
|
344
|
+
relative: z13.boolean().optional(),
|
|
345
|
+
schRelative: z13.boolean().optional(),
|
|
346
|
+
pcbRelative: z13.boolean().optional()
|
|
299
347
|
});
|
|
300
348
|
expectTypesMatch(true);
|
|
301
|
-
var supplierProps =
|
|
302
|
-
supplierPartNumbers:
|
|
349
|
+
var supplierProps = z13.object({
|
|
350
|
+
supplierPartNumbers: z13.record(supplier_name, z13.array(z13.string())).optional()
|
|
303
351
|
});
|
|
304
352
|
expectTypesMatch(true);
|
|
305
|
-
var pinAttributeMap =
|
|
306
|
-
providesPower:
|
|
307
|
-
requiresPower:
|
|
308
|
-
providesGround:
|
|
309
|
-
requiresGround:
|
|
310
|
-
providesVoltage:
|
|
311
|
-
requiresVoltage:
|
|
312
|
-
doNotConnect:
|
|
313
|
-
includeInBoardPinout:
|
|
314
|
-
highlightColor:
|
|
315
|
-
mustBeConnected:
|
|
353
|
+
var pinAttributeMap = z13.object({
|
|
354
|
+
providesPower: z13.boolean().optional(),
|
|
355
|
+
requiresPower: z13.boolean().optional(),
|
|
356
|
+
providesGround: z13.boolean().optional(),
|
|
357
|
+
requiresGround: z13.boolean().optional(),
|
|
358
|
+
providesVoltage: z13.union([z13.string(), z13.number()]).optional(),
|
|
359
|
+
requiresVoltage: z13.union([z13.string(), z13.number()]).optional(),
|
|
360
|
+
doNotConnect: z13.boolean().optional(),
|
|
361
|
+
includeInBoardPinout: z13.boolean().optional(),
|
|
362
|
+
highlightColor: z13.string().optional(),
|
|
363
|
+
mustBeConnected: z13.boolean().optional()
|
|
316
364
|
});
|
|
317
365
|
expectTypesMatch(true);
|
|
318
366
|
var commonComponentProps = commonLayoutProps.merge(supplierProps).extend({
|
|
319
|
-
key:
|
|
320
|
-
name:
|
|
321
|
-
displayName:
|
|
322
|
-
datasheetUrl:
|
|
367
|
+
key: z13.any().optional(),
|
|
368
|
+
name: z13.string(),
|
|
369
|
+
displayName: z13.string().optional(),
|
|
370
|
+
datasheetUrl: z13.string().optional(),
|
|
323
371
|
cadModel: cadModelProp.optional(),
|
|
324
372
|
kicadFootprintMetadata: kicadFootprintMetadata.optional(),
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
373
|
+
kicadSymbolMetadata: kicadSymbolMetadata.optional(),
|
|
374
|
+
children: z13.any().optional(),
|
|
375
|
+
symbolName: z13.string().optional(),
|
|
376
|
+
doNotPlace: z13.boolean().optional(),
|
|
377
|
+
obstructsWithinBounds: z13.boolean().optional().describe(
|
|
329
378
|
"Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath"
|
|
330
379
|
),
|
|
331
|
-
showAsTranslucentModel:
|
|
380
|
+
showAsTranslucentModel: z13.boolean().optional().describe(
|
|
332
381
|
"Whether to show this component's CAD model as translucent in the 3D viewer."
|
|
333
382
|
),
|
|
334
|
-
pinAttributes:
|
|
383
|
+
pinAttributes: z13.record(z13.string(), pinAttributeMap).optional(),
|
|
384
|
+
mfn: z13.string().describe("Manufacturer Part Number").optional()
|
|
335
385
|
});
|
|
336
386
|
expectTypesMatch(true);
|
|
337
387
|
var componentProps = commonComponentProps;
|
|
@@ -346,7 +396,7 @@ var lrPolarPins = [
|
|
|
346
396
|
"cathode",
|
|
347
397
|
"neg"
|
|
348
398
|
];
|
|
349
|
-
var distanceOrMultiplier =
|
|
399
|
+
var distanceOrMultiplier = distance8.or(z13.enum(["2x", "3x", "4x"]));
|
|
350
400
|
|
|
351
401
|
// lib/generated/footprinter-autocomplete.ts
|
|
352
402
|
var footprinterStringExamples = [
|
|
@@ -375,8 +425,8 @@ var footprinterStringExamples = [
|
|
|
375
425
|
];
|
|
376
426
|
|
|
377
427
|
// lib/common/schematicOrientation.ts
|
|
378
|
-
import { z as
|
|
379
|
-
var schematicOrientation =
|
|
428
|
+
import { z as z14 } from "zod";
|
|
429
|
+
var schematicOrientation = z14.enum([
|
|
380
430
|
"vertical",
|
|
381
431
|
"horizontal",
|
|
382
432
|
"pos_top",
|
|
@@ -395,25 +445,25 @@ expectTypesMatch(
|
|
|
395
445
|
);
|
|
396
446
|
|
|
397
447
|
// lib/common/schematicPinDefinitions.ts
|
|
398
|
-
import { z as
|
|
399
|
-
var explicitPinSideDefinition =
|
|
400
|
-
pins:
|
|
401
|
-
direction:
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
448
|
+
import { z as z15 } from "zod";
|
|
449
|
+
var explicitPinSideDefinition = z15.object({
|
|
450
|
+
pins: z15.array(z15.union([z15.number(), z15.string()])),
|
|
451
|
+
direction: z15.union([
|
|
452
|
+
z15.literal("top-to-bottom"),
|
|
453
|
+
z15.literal("left-to-right"),
|
|
454
|
+
z15.literal("bottom-to-top"),
|
|
455
|
+
z15.literal("right-to-left")
|
|
406
456
|
])
|
|
407
457
|
});
|
|
408
|
-
var schematicPortArrangement =
|
|
409
|
-
leftSize:
|
|
410
|
-
topSize:
|
|
411
|
-
rightSize:
|
|
412
|
-
bottomSize:
|
|
413
|
-
leftPinCount:
|
|
414
|
-
rightPinCount:
|
|
415
|
-
topPinCount:
|
|
416
|
-
bottomPinCount:
|
|
458
|
+
var schematicPortArrangement = z15.object({
|
|
459
|
+
leftSize: z15.number().optional().describe("@deprecated, use leftPinCount"),
|
|
460
|
+
topSize: z15.number().optional().describe("@deprecated, use topPinCount"),
|
|
461
|
+
rightSize: z15.number().optional().describe("@deprecated, use rightPinCount"),
|
|
462
|
+
bottomSize: z15.number().optional().describe("@deprecated, use bottomPinCount"),
|
|
463
|
+
leftPinCount: z15.number().optional(),
|
|
464
|
+
rightPinCount: z15.number().optional(),
|
|
465
|
+
topPinCount: z15.number().optional(),
|
|
466
|
+
bottomPinCount: z15.number().optional(),
|
|
417
467
|
leftSide: explicitPinSideDefinition.optional(),
|
|
418
468
|
rightSide: explicitPinSideDefinition.optional(),
|
|
419
469
|
topSide: explicitPinSideDefinition.optional(),
|
|
@@ -423,34 +473,34 @@ var schematicPinArrangement = schematicPortArrangement;
|
|
|
423
473
|
expectTypesMatch(true);
|
|
424
474
|
|
|
425
475
|
// lib/common/schematicPinStyle.ts
|
|
426
|
-
import { distance as
|
|
427
|
-
import { z as
|
|
428
|
-
var schematicPinStyle =
|
|
429
|
-
|
|
430
|
-
marginLeft:
|
|
431
|
-
marginRight:
|
|
432
|
-
marginTop:
|
|
433
|
-
marginBottom:
|
|
434
|
-
leftMargin:
|
|
435
|
-
rightMargin:
|
|
436
|
-
topMargin:
|
|
437
|
-
bottomMargin:
|
|
476
|
+
import { distance as distance9 } from "circuit-json";
|
|
477
|
+
import { z as z16 } from "zod";
|
|
478
|
+
var schematicPinStyle = z16.record(
|
|
479
|
+
z16.object({
|
|
480
|
+
marginLeft: distance9.optional(),
|
|
481
|
+
marginRight: distance9.optional(),
|
|
482
|
+
marginTop: distance9.optional(),
|
|
483
|
+
marginBottom: distance9.optional(),
|
|
484
|
+
leftMargin: distance9.optional(),
|
|
485
|
+
rightMargin: distance9.optional(),
|
|
486
|
+
topMargin: distance9.optional(),
|
|
487
|
+
bottomMargin: distance9.optional()
|
|
438
488
|
})
|
|
439
489
|
);
|
|
440
490
|
expectTypesMatch(true);
|
|
441
491
|
|
|
442
492
|
// lib/common/schematicPinLabel.ts
|
|
443
|
-
import { z as
|
|
444
|
-
var schematicPinLabel =
|
|
493
|
+
import { z as z17 } from "zod";
|
|
494
|
+
var schematicPinLabel = z17.string().regex(/^[A-Za-z0-9_]+$/);
|
|
445
495
|
|
|
446
496
|
// lib/common/schematicSize.ts
|
|
447
|
-
import { distance as
|
|
448
|
-
import { z as
|
|
449
|
-
var schematicSymbolSize =
|
|
497
|
+
import { distance as distance10 } from "circuit-json";
|
|
498
|
+
import { z as z18 } from "zod";
|
|
499
|
+
var schematicSymbolSize = distance10.or(z18.enum(["xs", "sm", "default", "md"])).describe("distance between pin1 and pin2 of the schematic symbol");
|
|
450
500
|
|
|
451
501
|
// lib/common/ninePointAnchor.ts
|
|
452
|
-
import { z as
|
|
453
|
-
var ninePointAnchor =
|
|
502
|
+
import { z as z19 } from "zod";
|
|
503
|
+
var ninePointAnchor = z19.enum([
|
|
454
504
|
"top_left",
|
|
455
505
|
"top_center",
|
|
456
506
|
"top_right",
|
|
@@ -463,44 +513,44 @@ var ninePointAnchor = z18.enum([
|
|
|
463
513
|
]);
|
|
464
514
|
|
|
465
515
|
// lib/components/board.ts
|
|
466
|
-
import { z as
|
|
516
|
+
import { z as z33 } from "zod";
|
|
467
517
|
|
|
468
518
|
// lib/components/group.ts
|
|
469
|
-
import { length as length2, distance as
|
|
470
|
-
import { z as
|
|
519
|
+
import { length as length2, distance as distance11 } from "circuit-json";
|
|
520
|
+
import { z as z32 } from "zod";
|
|
471
521
|
|
|
472
522
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
473
|
-
import { z as
|
|
474
|
-
var base_manual_edit_event =
|
|
475
|
-
edit_event_id:
|
|
476
|
-
in_progress:
|
|
477
|
-
created_at:
|
|
523
|
+
import { z as z20 } from "zod";
|
|
524
|
+
var base_manual_edit_event = z20.object({
|
|
525
|
+
edit_event_id: z20.string(),
|
|
526
|
+
in_progress: z20.boolean().optional(),
|
|
527
|
+
created_at: z20.number()
|
|
478
528
|
});
|
|
479
529
|
expectTypesMatch(
|
|
480
530
|
true
|
|
481
531
|
);
|
|
482
532
|
|
|
483
533
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
484
|
-
import { z as
|
|
534
|
+
import { z as z21 } from "zod";
|
|
485
535
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
486
|
-
pcb_edit_event_type:
|
|
487
|
-
edit_event_type:
|
|
488
|
-
pcb_component_id:
|
|
489
|
-
original_center:
|
|
490
|
-
new_center:
|
|
536
|
+
pcb_edit_event_type: z21.literal("edit_component_location").describe("deprecated"),
|
|
537
|
+
edit_event_type: z21.literal("edit_pcb_component_location"),
|
|
538
|
+
pcb_component_id: z21.string(),
|
|
539
|
+
original_center: z21.object({ x: z21.number(), y: z21.number() }),
|
|
540
|
+
new_center: z21.object({ x: z21.number(), y: z21.number() })
|
|
491
541
|
});
|
|
492
542
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
493
543
|
expectTypesMatch(true);
|
|
494
544
|
|
|
495
545
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
496
|
-
import { z as
|
|
546
|
+
import { z as z22 } from "zod";
|
|
497
547
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
498
|
-
pcb_edit_event_type:
|
|
499
|
-
edit_event_type:
|
|
500
|
-
pcb_port_id:
|
|
501
|
-
pcb_trace_hint_id:
|
|
502
|
-
route:
|
|
503
|
-
|
|
548
|
+
pcb_edit_event_type: z22.literal("edit_trace_hint").describe("deprecated"),
|
|
549
|
+
edit_event_type: z22.literal("edit_pcb_trace_hint").optional(),
|
|
550
|
+
pcb_port_id: z22.string(),
|
|
551
|
+
pcb_trace_hint_id: z22.string().optional(),
|
|
552
|
+
route: z22.array(
|
|
553
|
+
z22.object({ x: z22.number(), y: z22.number(), via: z22.boolean().optional() })
|
|
504
554
|
)
|
|
505
555
|
});
|
|
506
556
|
expectTypesMatch(
|
|
@@ -508,38 +558,38 @@ expectTypesMatch(
|
|
|
508
558
|
);
|
|
509
559
|
|
|
510
560
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
511
|
-
import { z as
|
|
561
|
+
import { z as z23 } from "zod";
|
|
512
562
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
513
|
-
edit_event_type:
|
|
514
|
-
schematic_component_id:
|
|
515
|
-
original_center:
|
|
516
|
-
new_center:
|
|
563
|
+
edit_event_type: z23.literal("edit_schematic_component_location"),
|
|
564
|
+
schematic_component_id: z23.string(),
|
|
565
|
+
original_center: z23.object({ x: z23.number(), y: z23.number() }),
|
|
566
|
+
new_center: z23.object({ x: z23.number(), y: z23.number() })
|
|
517
567
|
});
|
|
518
568
|
expectTypesMatch(true);
|
|
519
569
|
|
|
520
570
|
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
521
|
-
import { z as
|
|
571
|
+
import { z as z24 } from "zod";
|
|
522
572
|
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
523
|
-
edit_event_type:
|
|
524
|
-
pcb_group_id:
|
|
525
|
-
original_center:
|
|
526
|
-
new_center:
|
|
573
|
+
edit_event_type: z24.literal("edit_pcb_group_location"),
|
|
574
|
+
pcb_group_id: z24.string(),
|
|
575
|
+
original_center: z24.object({ x: z24.number(), y: z24.number() }),
|
|
576
|
+
new_center: z24.object({ x: z24.number(), y: z24.number() })
|
|
527
577
|
});
|
|
528
578
|
expectTypesMatch(true);
|
|
529
579
|
|
|
530
580
|
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
531
|
-
import { z as
|
|
581
|
+
import { z as z25 } from "zod";
|
|
532
582
|
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
533
|
-
edit_event_type:
|
|
534
|
-
schematic_group_id:
|
|
535
|
-
original_center:
|
|
536
|
-
new_center:
|
|
583
|
+
edit_event_type: z25.literal("edit_schematic_group_location"),
|
|
584
|
+
schematic_group_id: z25.string(),
|
|
585
|
+
original_center: z25.object({ x: z25.number(), y: z25.number() }),
|
|
586
|
+
new_center: z25.object({ x: z25.number(), y: z25.number() })
|
|
537
587
|
});
|
|
538
588
|
expectTypesMatch(true);
|
|
539
589
|
|
|
540
590
|
// lib/manual-edits/manual_edit_event.ts
|
|
541
|
-
import { z as
|
|
542
|
-
var manual_edit_event =
|
|
591
|
+
import { z as z26 } from "zod";
|
|
592
|
+
var manual_edit_event = z26.union([
|
|
543
593
|
edit_pcb_component_location_event,
|
|
544
594
|
edit_trace_hint_event,
|
|
545
595
|
edit_schematic_component_location_event
|
|
@@ -547,33 +597,33 @@ var manual_edit_event = z25.union([
|
|
|
547
597
|
expectTypesMatch(true);
|
|
548
598
|
|
|
549
599
|
// lib/manual-edits/manual_edits_file.ts
|
|
550
|
-
import { z as
|
|
600
|
+
import { z as z30 } from "zod";
|
|
551
601
|
|
|
552
602
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
553
|
-
import { z as
|
|
603
|
+
import { z as z27 } from "zod";
|
|
554
604
|
import { point as point2 } from "circuit-json";
|
|
555
|
-
var manual_pcb_placement =
|
|
556
|
-
selector:
|
|
557
|
-
relative_to:
|
|
605
|
+
var manual_pcb_placement = z27.object({
|
|
606
|
+
selector: z27.string(),
|
|
607
|
+
relative_to: z27.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
558
608
|
center: point2
|
|
559
609
|
});
|
|
560
610
|
expectTypesMatch(true);
|
|
561
611
|
|
|
562
612
|
// lib/manual-edits/manual_trace_hint.ts
|
|
563
|
-
import { z as
|
|
613
|
+
import { z as z28 } from "zod";
|
|
564
614
|
import { route_hint_point } from "circuit-json";
|
|
565
|
-
var manual_trace_hint =
|
|
566
|
-
pcb_port_selector:
|
|
567
|
-
offsets:
|
|
615
|
+
var manual_trace_hint = z28.object({
|
|
616
|
+
pcb_port_selector: z28.string(),
|
|
617
|
+
offsets: z28.array(route_hint_point)
|
|
568
618
|
});
|
|
569
619
|
expectTypesMatch(true);
|
|
570
620
|
|
|
571
621
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
572
|
-
import { z as
|
|
622
|
+
import { z as z29 } from "zod";
|
|
573
623
|
import { point as point4 } from "circuit-json";
|
|
574
|
-
var manual_schematic_placement =
|
|
575
|
-
selector:
|
|
576
|
-
relative_to:
|
|
624
|
+
var manual_schematic_placement = z29.object({
|
|
625
|
+
selector: z29.string(),
|
|
626
|
+
relative_to: z29.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
577
627
|
center: point4
|
|
578
628
|
});
|
|
579
629
|
expectTypesMatch(
|
|
@@ -581,37 +631,37 @@ expectTypesMatch(
|
|
|
581
631
|
);
|
|
582
632
|
|
|
583
633
|
// lib/manual-edits/manual_edits_file.ts
|
|
584
|
-
var manual_edits_file =
|
|
585
|
-
pcb_placements:
|
|
586
|
-
manual_trace_hints:
|
|
587
|
-
schematic_placements:
|
|
634
|
+
var manual_edits_file = z30.object({
|
|
635
|
+
pcb_placements: z30.array(manual_pcb_placement).optional(),
|
|
636
|
+
manual_trace_hints: z30.array(manual_trace_hint).optional(),
|
|
637
|
+
schematic_placements: z30.array(manual_schematic_placement).optional()
|
|
588
638
|
});
|
|
589
639
|
expectTypesMatch(true);
|
|
590
640
|
|
|
591
641
|
// lib/common/connectionsProp.ts
|
|
592
|
-
import { z as
|
|
593
|
-
var connectionTarget =
|
|
642
|
+
import { z as z31 } from "zod";
|
|
643
|
+
var connectionTarget = z31.string().or(z31.array(z31.string()).readonly()).or(z31.array(z31.string()));
|
|
594
644
|
var createConnectionsProp = (labels) => {
|
|
595
|
-
return
|
|
645
|
+
return z31.record(z31.enum(labels), connectionTarget);
|
|
596
646
|
};
|
|
597
647
|
|
|
598
648
|
// lib/components/group.ts
|
|
599
|
-
var layoutConfig =
|
|
600
|
-
layoutMode:
|
|
601
|
-
position:
|
|
602
|
-
grid:
|
|
603
|
-
gridCols:
|
|
604
|
-
gridRows:
|
|
605
|
-
gridTemplateRows:
|
|
606
|
-
gridTemplateColumns:
|
|
607
|
-
gridTemplate:
|
|
608
|
-
gridGap:
|
|
609
|
-
gridRowGap:
|
|
610
|
-
gridColumnGap:
|
|
611
|
-
flex:
|
|
612
|
-
flexDirection:
|
|
613
|
-
alignItems:
|
|
614
|
-
justifyContent:
|
|
649
|
+
var layoutConfig = z32.object({
|
|
650
|
+
layoutMode: z32.enum(["grid", "flex", "match-adapt", "relative", "none"]).optional(),
|
|
651
|
+
position: z32.enum(["absolute", "relative"]).optional(),
|
|
652
|
+
grid: z32.boolean().optional(),
|
|
653
|
+
gridCols: z32.number().or(z32.string()).optional(),
|
|
654
|
+
gridRows: z32.number().or(z32.string()).optional(),
|
|
655
|
+
gridTemplateRows: z32.string().optional(),
|
|
656
|
+
gridTemplateColumns: z32.string().optional(),
|
|
657
|
+
gridTemplate: z32.string().optional(),
|
|
658
|
+
gridGap: z32.number().or(z32.string()).optional(),
|
|
659
|
+
gridRowGap: z32.number().or(z32.string()).optional(),
|
|
660
|
+
gridColumnGap: z32.number().or(z32.string()).optional(),
|
|
661
|
+
flex: z32.boolean().or(z32.string()).optional(),
|
|
662
|
+
flexDirection: z32.enum(["row", "column"]).optional(),
|
|
663
|
+
alignItems: z32.enum(["start", "center", "end", "stretch"]).optional(),
|
|
664
|
+
justifyContent: z32.enum([
|
|
615
665
|
"start",
|
|
616
666
|
"center",
|
|
617
667
|
"end",
|
|
@@ -620,16 +670,16 @@ var layoutConfig = z31.object({
|
|
|
620
670
|
"space-around",
|
|
621
671
|
"space-evenly"
|
|
622
672
|
]).optional(),
|
|
623
|
-
flexRow:
|
|
624
|
-
flexColumn:
|
|
625
|
-
gap:
|
|
626
|
-
pack:
|
|
627
|
-
packOrderStrategy:
|
|
673
|
+
flexRow: z32.boolean().optional(),
|
|
674
|
+
flexColumn: z32.boolean().optional(),
|
|
675
|
+
gap: z32.number().or(z32.string()).optional(),
|
|
676
|
+
pack: z32.boolean().optional().describe("Pack the contents of this group using a packing strategy"),
|
|
677
|
+
packOrderStrategy: z32.enum([
|
|
628
678
|
"largest_to_smallest",
|
|
629
679
|
"first_to_last",
|
|
630
680
|
"highest_to_lowest_pin_count"
|
|
631
681
|
]).optional(),
|
|
632
|
-
packPlacementStrategy:
|
|
682
|
+
packPlacementStrategy: z32.enum(["shortest_connection_along_outline"]).optional(),
|
|
633
683
|
padding: length2.optional(),
|
|
634
684
|
paddingLeft: length2.optional(),
|
|
635
685
|
paddingRight: length2.optional(),
|
|
@@ -639,29 +689,29 @@ var layoutConfig = z31.object({
|
|
|
639
689
|
paddingY: length2.optional(),
|
|
640
690
|
width: length2.optional(),
|
|
641
691
|
height: length2.optional(),
|
|
642
|
-
matchAdapt:
|
|
643
|
-
matchAdaptTemplate:
|
|
692
|
+
matchAdapt: z32.boolean().optional(),
|
|
693
|
+
matchAdaptTemplate: z32.any().optional()
|
|
644
694
|
});
|
|
645
695
|
expectTypesMatch(true);
|
|
646
|
-
var border =
|
|
696
|
+
var border = z32.object({
|
|
647
697
|
strokeWidth: length2.optional(),
|
|
648
|
-
dashed:
|
|
649
|
-
solid:
|
|
650
|
-
});
|
|
651
|
-
var pcbAnchorAlignmentAutocomplete =
|
|
652
|
-
var autorouterConfig =
|
|
653
|
-
serverUrl:
|
|
654
|
-
inputFormat:
|
|
655
|
-
serverMode:
|
|
656
|
-
serverCacheEnabled:
|
|
657
|
-
cache:
|
|
698
|
+
dashed: z32.boolean().optional(),
|
|
699
|
+
solid: z32.boolean().optional()
|
|
700
|
+
});
|
|
701
|
+
var pcbAnchorAlignmentAutocomplete = z32.custom((value) => typeof value === "string");
|
|
702
|
+
var autorouterConfig = z32.object({
|
|
703
|
+
serverUrl: z32.string().optional(),
|
|
704
|
+
inputFormat: z32.enum(["simplified", "circuit-json"]).optional(),
|
|
705
|
+
serverMode: z32.enum(["job", "solve-endpoint"]).optional(),
|
|
706
|
+
serverCacheEnabled: z32.boolean().optional(),
|
|
707
|
+
cache: z32.custom((v) => true).optional(),
|
|
658
708
|
traceClearance: length2.optional(),
|
|
659
|
-
availableJumperTypes:
|
|
660
|
-
groupMode:
|
|
661
|
-
algorithmFn:
|
|
709
|
+
availableJumperTypes: z32.array(z32.enum(["1206x4", "0603"])).optional(),
|
|
710
|
+
groupMode: z32.enum(["sequential_trace", "subcircuit", "sequential-trace"]).optional(),
|
|
711
|
+
algorithmFn: z32.custom(
|
|
662
712
|
(v) => typeof v === "function" || v === void 0
|
|
663
713
|
).optional(),
|
|
664
|
-
preset:
|
|
714
|
+
preset: z32.enum([
|
|
665
715
|
"sequential_trace",
|
|
666
716
|
"subcircuit",
|
|
667
717
|
"auto",
|
|
@@ -676,58 +726,58 @@ var autorouterConfig = z31.object({
|
|
|
676
726
|
"auto-local",
|
|
677
727
|
"auto-cloud"
|
|
678
728
|
]).optional(),
|
|
679
|
-
local:
|
|
680
|
-
});
|
|
681
|
-
var autorouterPreset =
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
729
|
+
local: z32.boolean().optional()
|
|
730
|
+
});
|
|
731
|
+
var autorouterPreset = z32.union([
|
|
732
|
+
z32.literal("sequential_trace"),
|
|
733
|
+
z32.literal("subcircuit"),
|
|
734
|
+
z32.literal("auto"),
|
|
735
|
+
z32.literal("auto_local"),
|
|
736
|
+
z32.literal("auto_cloud"),
|
|
737
|
+
z32.literal("auto_jumper"),
|
|
738
|
+
z32.literal("tscircuit_beta"),
|
|
739
|
+
z32.literal("freerouting"),
|
|
740
|
+
z32.literal("laser_prefab"),
|
|
691
741
|
// Prefabricated PCB with laser copper ablation
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
742
|
+
z32.literal("auto-jumper"),
|
|
743
|
+
z32.literal("sequential-trace"),
|
|
744
|
+
z32.literal("auto-local"),
|
|
745
|
+
z32.literal("auto-cloud")
|
|
696
746
|
]);
|
|
697
|
-
var autorouterString =
|
|
698
|
-
var autorouterProp =
|
|
747
|
+
var autorouterString = z32.string();
|
|
748
|
+
var autorouterProp = z32.union([
|
|
699
749
|
autorouterConfig,
|
|
700
750
|
autorouterPreset,
|
|
701
751
|
autorouterString
|
|
702
752
|
]);
|
|
703
|
-
var autorouterEffortLevel =
|
|
753
|
+
var autorouterEffortLevel = z32.enum(["1x", "2x", "5x", "10x", "100x"]);
|
|
704
754
|
var baseGroupProps = commonLayoutProps.extend({
|
|
705
|
-
name:
|
|
706
|
-
children:
|
|
707
|
-
schTitle:
|
|
708
|
-
key:
|
|
709
|
-
showAsSchematicBox:
|
|
710
|
-
connections:
|
|
755
|
+
name: z32.string().optional(),
|
|
756
|
+
children: z32.any().optional(),
|
|
757
|
+
schTitle: z32.string().optional(),
|
|
758
|
+
key: z32.any().optional(),
|
|
759
|
+
showAsSchematicBox: z32.boolean().optional(),
|
|
760
|
+
connections: z32.record(z32.string(), connectionTarget.optional()).optional(),
|
|
711
761
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
712
762
|
schPinSpacing: length2.optional(),
|
|
713
763
|
schPinStyle: schematicPinStyle.optional(),
|
|
714
764
|
...layoutConfig.shape,
|
|
715
765
|
grid: layoutConfig.shape.grid.describe("@deprecated use pcbGrid"),
|
|
716
766
|
flex: layoutConfig.shape.flex.describe("@deprecated use pcbFlex"),
|
|
717
|
-
pcbGrid:
|
|
718
|
-
pcbGridCols:
|
|
719
|
-
pcbGridRows:
|
|
720
|
-
pcbGridTemplateRows:
|
|
721
|
-
pcbGridTemplateColumns:
|
|
722
|
-
pcbGridTemplate:
|
|
723
|
-
pcbGridGap:
|
|
724
|
-
pcbGridRowGap:
|
|
725
|
-
pcbGridColumnGap:
|
|
726
|
-
pcbFlex:
|
|
727
|
-
pcbFlexGap:
|
|
728
|
-
pcbFlexDirection:
|
|
729
|
-
pcbAlignItems:
|
|
730
|
-
pcbJustifyContent:
|
|
767
|
+
pcbGrid: z32.boolean().optional(),
|
|
768
|
+
pcbGridCols: z32.number().or(z32.string()).optional(),
|
|
769
|
+
pcbGridRows: z32.number().or(z32.string()).optional(),
|
|
770
|
+
pcbGridTemplateRows: z32.string().optional(),
|
|
771
|
+
pcbGridTemplateColumns: z32.string().optional(),
|
|
772
|
+
pcbGridTemplate: z32.string().optional(),
|
|
773
|
+
pcbGridGap: z32.number().or(z32.string()).optional(),
|
|
774
|
+
pcbGridRowGap: z32.number().or(z32.string()).optional(),
|
|
775
|
+
pcbGridColumnGap: z32.number().or(z32.string()).optional(),
|
|
776
|
+
pcbFlex: z32.boolean().or(z32.string()).optional(),
|
|
777
|
+
pcbFlexGap: z32.number().or(z32.string()).optional(),
|
|
778
|
+
pcbFlexDirection: z32.enum(["row", "column"]).optional(),
|
|
779
|
+
pcbAlignItems: z32.enum(["start", "center", "end", "stretch"]).optional(),
|
|
780
|
+
pcbJustifyContent: z32.enum([
|
|
731
781
|
"start",
|
|
732
782
|
"center",
|
|
733
783
|
"end",
|
|
@@ -736,25 +786,25 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
736
786
|
"space-around",
|
|
737
787
|
"space-evenly"
|
|
738
788
|
]).optional(),
|
|
739
|
-
pcbFlexRow:
|
|
740
|
-
pcbFlexColumn:
|
|
741
|
-
pcbGap:
|
|
742
|
-
pcbPack:
|
|
743
|
-
pcbPackGap:
|
|
744
|
-
schGrid:
|
|
745
|
-
schGridCols:
|
|
746
|
-
schGridRows:
|
|
747
|
-
schGridTemplateRows:
|
|
748
|
-
schGridTemplateColumns:
|
|
749
|
-
schGridTemplate:
|
|
750
|
-
schGridGap:
|
|
751
|
-
schGridRowGap:
|
|
752
|
-
schGridColumnGap:
|
|
753
|
-
schFlex:
|
|
754
|
-
schFlexGap:
|
|
755
|
-
schFlexDirection:
|
|
756
|
-
schAlignItems:
|
|
757
|
-
schJustifyContent:
|
|
789
|
+
pcbFlexRow: z32.boolean().optional(),
|
|
790
|
+
pcbFlexColumn: z32.boolean().optional(),
|
|
791
|
+
pcbGap: z32.number().or(z32.string()).optional(),
|
|
792
|
+
pcbPack: z32.boolean().optional(),
|
|
793
|
+
pcbPackGap: z32.number().or(z32.string()).optional(),
|
|
794
|
+
schGrid: z32.boolean().optional(),
|
|
795
|
+
schGridCols: z32.number().or(z32.string()).optional(),
|
|
796
|
+
schGridRows: z32.number().or(z32.string()).optional(),
|
|
797
|
+
schGridTemplateRows: z32.string().optional(),
|
|
798
|
+
schGridTemplateColumns: z32.string().optional(),
|
|
799
|
+
schGridTemplate: z32.string().optional(),
|
|
800
|
+
schGridGap: z32.number().or(z32.string()).optional(),
|
|
801
|
+
schGridRowGap: z32.number().or(z32.string()).optional(),
|
|
802
|
+
schGridColumnGap: z32.number().or(z32.string()).optional(),
|
|
803
|
+
schFlex: z32.boolean().or(z32.string()).optional(),
|
|
804
|
+
schFlexGap: z32.number().or(z32.string()).optional(),
|
|
805
|
+
schFlexDirection: z32.enum(["row", "column"]).optional(),
|
|
806
|
+
schAlignItems: z32.enum(["start", "center", "end", "stretch"]).optional(),
|
|
807
|
+
schJustifyContent: z32.enum([
|
|
758
808
|
"start",
|
|
759
809
|
"center",
|
|
760
810
|
"end",
|
|
@@ -763,11 +813,11 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
763
813
|
"space-around",
|
|
764
814
|
"space-evenly"
|
|
765
815
|
]).optional(),
|
|
766
|
-
schFlexRow:
|
|
767
|
-
schFlexColumn:
|
|
768
|
-
schGap:
|
|
769
|
-
schPack:
|
|
770
|
-
schMatchAdapt:
|
|
816
|
+
schFlexRow: z32.boolean().optional(),
|
|
817
|
+
schFlexColumn: z32.boolean().optional(),
|
|
818
|
+
schGap: z32.number().or(z32.string()).optional(),
|
|
819
|
+
schPack: z32.boolean().optional(),
|
|
820
|
+
schMatchAdapt: z32.boolean().optional(),
|
|
771
821
|
pcbWidth: length2.optional(),
|
|
772
822
|
pcbHeight: length2.optional(),
|
|
773
823
|
minTraceWidth: length2.optional(),
|
|
@@ -790,37 +840,37 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
790
840
|
pcbPaddingBottom: length2.optional(),
|
|
791
841
|
pcbAnchorAlignment: pcbAnchorAlignmentAutocomplete.optional()
|
|
792
842
|
});
|
|
793
|
-
var partsEngine =
|
|
843
|
+
var partsEngine = z32.custom((v) => "findPart" in v);
|
|
794
844
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
795
845
|
manualEdits: manual_edits_file.optional(),
|
|
796
|
-
schAutoLayoutEnabled:
|
|
797
|
-
schTraceAutoLabelEnabled:
|
|
798
|
-
schMaxTraceDistance:
|
|
799
|
-
routingDisabled:
|
|
800
|
-
bomDisabled:
|
|
846
|
+
schAutoLayoutEnabled: z32.boolean().optional(),
|
|
847
|
+
schTraceAutoLabelEnabled: z32.boolean().optional(),
|
|
848
|
+
schMaxTraceDistance: distance11.optional(),
|
|
849
|
+
routingDisabled: z32.boolean().optional(),
|
|
850
|
+
bomDisabled: z32.boolean().optional(),
|
|
801
851
|
defaultTraceWidth: length2.optional(),
|
|
802
852
|
minTraceWidth: length2.optional(),
|
|
803
853
|
nominalTraceWidth: length2.optional(),
|
|
804
854
|
partsEngine: partsEngine.optional(),
|
|
805
|
-
pcbRouteCache:
|
|
855
|
+
pcbRouteCache: z32.custom((v) => true).optional(),
|
|
806
856
|
autorouter: autorouterProp.optional(),
|
|
807
857
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
808
|
-
autorouterVersion:
|
|
809
|
-
square:
|
|
810
|
-
emptyArea:
|
|
811
|
-
filledArea:
|
|
812
|
-
width:
|
|
813
|
-
height:
|
|
814
|
-
outline:
|
|
815
|
-
outlineOffsetX:
|
|
816
|
-
outlineOffsetY:
|
|
817
|
-
circuitJson:
|
|
858
|
+
autorouterVersion: z32.enum(["v1", "v2", "latest"]).optional(),
|
|
859
|
+
square: z32.boolean().optional(),
|
|
860
|
+
emptyArea: z32.string().optional(),
|
|
861
|
+
filledArea: z32.string().optional(),
|
|
862
|
+
width: distance11.optional(),
|
|
863
|
+
height: distance11.optional(),
|
|
864
|
+
outline: z32.array(point).optional(),
|
|
865
|
+
outlineOffsetX: distance11.optional(),
|
|
866
|
+
outlineOffsetY: distance11.optional(),
|
|
867
|
+
circuitJson: z32.array(z32.any()).optional()
|
|
818
868
|
});
|
|
819
869
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
820
|
-
subcircuit:
|
|
870
|
+
subcircuit: z32.literal(true)
|
|
821
871
|
});
|
|
822
|
-
var groupProps =
|
|
823
|
-
baseGroupProps.extend({ subcircuit:
|
|
872
|
+
var groupProps = z32.discriminatedUnion("subcircuit", [
|
|
873
|
+
baseGroupProps.extend({ subcircuit: z32.literal(false).optional() }),
|
|
824
874
|
subcircuitGroupPropsWithBool
|
|
825
875
|
]);
|
|
826
876
|
expectTypesMatch(true);
|
|
@@ -829,35 +879,35 @@ expectTypesMatch(true);
|
|
|
829
879
|
expectTypesMatch(true);
|
|
830
880
|
|
|
831
881
|
// lib/components/board.ts
|
|
832
|
-
var boardColor =
|
|
882
|
+
var boardColor = z33.custom((value) => typeof value === "string");
|
|
833
883
|
var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
834
|
-
material:
|
|
835
|
-
layers:
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
884
|
+
material: z33.enum(["fr4", "fr1"]).default("fr4"),
|
|
885
|
+
layers: z33.union([
|
|
886
|
+
z33.literal(1),
|
|
887
|
+
z33.literal(2),
|
|
888
|
+
z33.literal(4),
|
|
889
|
+
z33.literal(6),
|
|
890
|
+
z33.literal(8)
|
|
841
891
|
]).default(2),
|
|
842
892
|
borderRadius: distance.optional(),
|
|
843
893
|
thickness: distance.optional(),
|
|
844
894
|
boardAnchorPosition: point.optional(),
|
|
845
895
|
anchorAlignment: ninePointAnchor.optional(),
|
|
846
896
|
boardAnchorAlignment: ninePointAnchor.optional().describe("Prefer using anchorAlignment when possible"),
|
|
847
|
-
title:
|
|
897
|
+
title: z33.string().optional(),
|
|
848
898
|
solderMaskColor: boardColor.optional(),
|
|
849
899
|
topSolderMaskColor: boardColor.optional(),
|
|
850
900
|
bottomSolderMaskColor: boardColor.optional(),
|
|
851
901
|
silkscreenColor: boardColor.optional(),
|
|
852
902
|
topSilkscreenColor: boardColor.optional(),
|
|
853
903
|
bottomSilkscreenColor: boardColor.optional(),
|
|
854
|
-
doubleSidedAssembly:
|
|
855
|
-
schematicDisabled:
|
|
904
|
+
doubleSidedAssembly: z33.boolean().optional().default(false),
|
|
905
|
+
schematicDisabled: z33.boolean().optional()
|
|
856
906
|
});
|
|
857
907
|
expectTypesMatch(true);
|
|
858
908
|
|
|
859
909
|
// lib/components/panel.ts
|
|
860
|
-
import { z as
|
|
910
|
+
import { z as z34 } from "zod";
|
|
861
911
|
var panelProps = baseGroupProps.omit({
|
|
862
912
|
width: true,
|
|
863
913
|
height: true,
|
|
@@ -866,19 +916,19 @@ var panelProps = baseGroupProps.omit({
|
|
|
866
916
|
}).extend({
|
|
867
917
|
width: distance.optional(),
|
|
868
918
|
height: distance.optional(),
|
|
869
|
-
children:
|
|
919
|
+
children: z34.any().optional(),
|
|
870
920
|
anchorAlignment: ninePointAnchor.optional(),
|
|
871
|
-
noSolderMask:
|
|
872
|
-
panelizationMethod:
|
|
921
|
+
noSolderMask: z34.boolean().optional(),
|
|
922
|
+
panelizationMethod: z34.enum(["tab-routing", "none"]).optional(),
|
|
873
923
|
boardGap: distance.optional(),
|
|
874
|
-
layoutMode:
|
|
875
|
-
row:
|
|
876
|
-
col:
|
|
924
|
+
layoutMode: z34.enum(["grid", "pack", "none"]).optional(),
|
|
925
|
+
row: z34.number().optional(),
|
|
926
|
+
col: z34.number().optional(),
|
|
877
927
|
cellWidth: distance.optional(),
|
|
878
928
|
cellHeight: distance.optional(),
|
|
879
929
|
tabWidth: distance.optional(),
|
|
880
930
|
tabLength: distance.optional(),
|
|
881
|
-
mouseBites:
|
|
931
|
+
mouseBites: z34.boolean().optional(),
|
|
882
932
|
edgePadding: distance.optional(),
|
|
883
933
|
edgePaddingLeft: distance.optional(),
|
|
884
934
|
edgePaddingRight: distance.optional(),
|
|
@@ -893,46 +943,46 @@ var subpanelProps = panelProps;
|
|
|
893
943
|
expectTypesMatch(true);
|
|
894
944
|
|
|
895
945
|
// lib/components/breakout.ts
|
|
896
|
-
import { distance as
|
|
946
|
+
import { distance as distance12 } from "circuit-json";
|
|
897
947
|
import "zod";
|
|
898
948
|
var breakoutProps = subcircuitGroupProps.extend({
|
|
899
|
-
padding:
|
|
900
|
-
paddingLeft:
|
|
901
|
-
paddingRight:
|
|
902
|
-
paddingTop:
|
|
903
|
-
paddingBottom:
|
|
949
|
+
padding: distance12.optional(),
|
|
950
|
+
paddingLeft: distance12.optional(),
|
|
951
|
+
paddingRight: distance12.optional(),
|
|
952
|
+
paddingTop: distance12.optional(),
|
|
953
|
+
paddingBottom: distance12.optional()
|
|
904
954
|
});
|
|
905
955
|
expectTypesMatch(true);
|
|
906
956
|
|
|
907
957
|
// lib/components/chip.ts
|
|
908
|
-
import { distance as
|
|
909
|
-
import { z as
|
|
910
|
-
var connectionTarget2 =
|
|
911
|
-
var connectionsProp =
|
|
912
|
-
var pinLabelsProp =
|
|
958
|
+
import { distance as distance13, supplier_name as supplier_name2 } from "circuit-json";
|
|
959
|
+
import { z as z37 } from "zod";
|
|
960
|
+
var connectionTarget2 = z37.string().or(z37.array(z37.string()).readonly()).or(z37.array(z37.string()));
|
|
961
|
+
var connectionsProp = z37.custom().pipe(z37.record(z37.string(), connectionTarget2));
|
|
962
|
+
var pinLabelsProp = z37.record(
|
|
913
963
|
schematicPinLabel,
|
|
914
|
-
schematicPinLabel.or(
|
|
964
|
+
schematicPinLabel.or(z37.array(schematicPinLabel).readonly()).or(z37.array(schematicPinLabel))
|
|
915
965
|
);
|
|
916
966
|
expectTypesMatch(true);
|
|
917
|
-
var pinCompatibleVariant =
|
|
918
|
-
manufacturerPartNumber:
|
|
919
|
-
supplierPartNumber:
|
|
967
|
+
var pinCompatibleVariant = z37.object({
|
|
968
|
+
manufacturerPartNumber: z37.string().optional(),
|
|
969
|
+
supplierPartNumber: z37.record(supplier_name2, z37.array(z37.string())).optional()
|
|
920
970
|
});
|
|
921
971
|
var chipProps = commonComponentProps.extend({
|
|
922
|
-
manufacturerPartNumber:
|
|
972
|
+
manufacturerPartNumber: z37.string().optional(),
|
|
923
973
|
pinLabels: pinLabelsProp.optional(),
|
|
924
|
-
showPinAliases:
|
|
925
|
-
pcbPinLabels:
|
|
926
|
-
internallyConnectedPins:
|
|
927
|
-
externallyConnectedPins:
|
|
974
|
+
showPinAliases: z37.boolean().optional(),
|
|
975
|
+
pcbPinLabels: z37.record(z37.string(), z37.string()).optional(),
|
|
976
|
+
internallyConnectedPins: z37.array(z37.array(z37.union([z37.string(), z37.number()]))).optional(),
|
|
977
|
+
externallyConnectedPins: z37.array(z37.array(z37.string())).optional(),
|
|
928
978
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
929
979
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
930
|
-
pinCompatibleVariants:
|
|
980
|
+
pinCompatibleVariants: z37.array(pinCompatibleVariant).optional(),
|
|
931
981
|
schPinStyle: schematicPinStyle.optional(),
|
|
932
|
-
schPinSpacing:
|
|
933
|
-
schWidth:
|
|
934
|
-
schHeight:
|
|
935
|
-
noSchematicRepresentation:
|
|
982
|
+
schPinSpacing: distance13.optional(),
|
|
983
|
+
schWidth: distance13.optional(),
|
|
984
|
+
schHeight: distance13.optional(),
|
|
985
|
+
noSchematicRepresentation: z37.boolean().optional(),
|
|
936
986
|
connections: connectionsProp.optional()
|
|
937
987
|
});
|
|
938
988
|
var bugProps = chipProps;
|
|
@@ -943,182 +993,182 @@ var pinoutProps = chipProps;
|
|
|
943
993
|
expectTypesMatch(true);
|
|
944
994
|
|
|
945
995
|
// lib/components/jumper.ts
|
|
946
|
-
import { distance as
|
|
947
|
-
import { z as
|
|
996
|
+
import { distance as distance14 } from "circuit-json";
|
|
997
|
+
import { z as z38 } from "zod";
|
|
948
998
|
var jumperProps = commonComponentProps.extend({
|
|
949
|
-
manufacturerPartNumber:
|
|
950
|
-
pinLabels:
|
|
951
|
-
|
|
952
|
-
schematicPinLabel.or(
|
|
999
|
+
manufacturerPartNumber: z38.string().optional(),
|
|
1000
|
+
pinLabels: z38.record(
|
|
1001
|
+
z38.number().or(schematicPinLabel),
|
|
1002
|
+
schematicPinLabel.or(z38.array(schematicPinLabel))
|
|
953
1003
|
).optional(),
|
|
954
1004
|
schPinStyle: schematicPinStyle.optional(),
|
|
955
|
-
schPinSpacing:
|
|
956
|
-
schWidth:
|
|
957
|
-
schHeight:
|
|
958
|
-
schDirection:
|
|
1005
|
+
schPinSpacing: distance14.optional(),
|
|
1006
|
+
schWidth: distance14.optional(),
|
|
1007
|
+
schHeight: distance14.optional(),
|
|
1008
|
+
schDirection: z38.enum(["left", "right"]).optional(),
|
|
959
1009
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
960
1010
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
961
|
-
pcbPinLabels:
|
|
962
|
-
pinCount:
|
|
963
|
-
internallyConnectedPins:
|
|
964
|
-
connections:
|
|
1011
|
+
pcbPinLabels: z38.record(z38.string(), z38.string()).optional(),
|
|
1012
|
+
pinCount: z38.union([z38.literal(2), z38.literal(3)]).optional(),
|
|
1013
|
+
internallyConnectedPins: z38.array(z38.array(z38.union([z38.string(), z38.number()]))).optional(),
|
|
1014
|
+
connections: z38.custom().pipe(z38.record(z38.string(), connectionTarget)).optional()
|
|
965
1015
|
});
|
|
966
1016
|
expectTypesMatch(true);
|
|
967
1017
|
|
|
968
1018
|
// lib/components/solderjumper.ts
|
|
969
|
-
import { z as
|
|
1019
|
+
import { z as z39 } from "zod";
|
|
970
1020
|
var solderjumperProps = jumperProps.extend({
|
|
971
|
-
bridgedPins:
|
|
972
|
-
bridged:
|
|
1021
|
+
bridgedPins: z39.array(z39.array(z39.string())).optional(),
|
|
1022
|
+
bridged: z39.boolean().optional()
|
|
973
1023
|
});
|
|
974
1024
|
expectTypesMatch(true);
|
|
975
1025
|
|
|
976
1026
|
// lib/components/connector.ts
|
|
977
|
-
import { distance as
|
|
978
|
-
import { z as
|
|
1027
|
+
import { distance as distance15 } from "circuit-json";
|
|
1028
|
+
import { z as z40 } from "zod";
|
|
979
1029
|
var connectorProps = commonComponentProps.extend({
|
|
980
|
-
manufacturerPartNumber:
|
|
981
|
-
pinLabels:
|
|
982
|
-
|
|
983
|
-
schematicPinLabel.or(
|
|
1030
|
+
manufacturerPartNumber: z40.string().optional(),
|
|
1031
|
+
pinLabels: z40.record(
|
|
1032
|
+
z40.number().or(schematicPinLabel),
|
|
1033
|
+
schematicPinLabel.or(z40.array(schematicPinLabel))
|
|
984
1034
|
).optional(),
|
|
985
1035
|
schPinStyle: schematicPinStyle.optional(),
|
|
986
|
-
schPinSpacing:
|
|
987
|
-
schWidth:
|
|
988
|
-
schHeight:
|
|
989
|
-
schDirection:
|
|
1036
|
+
schPinSpacing: distance15.optional(),
|
|
1037
|
+
schWidth: distance15.optional(),
|
|
1038
|
+
schHeight: distance15.optional(),
|
|
1039
|
+
schDirection: z40.enum(["left", "right"]).optional(),
|
|
990
1040
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
991
|
-
internallyConnectedPins:
|
|
992
|
-
standard:
|
|
1041
|
+
internallyConnectedPins: z40.array(z40.array(z40.union([z40.string(), z40.number()]))).optional(),
|
|
1042
|
+
standard: z40.enum(["usb_c", "m2"]).optional()
|
|
993
1043
|
});
|
|
994
1044
|
expectTypesMatch(true);
|
|
995
1045
|
|
|
996
1046
|
// lib/components/interconnect.ts
|
|
997
|
-
import { z as
|
|
1047
|
+
import { z as z41 } from "zod";
|
|
998
1048
|
var interconnectProps = commonComponentProps.extend({
|
|
999
|
-
standard:
|
|
1000
|
-
pinLabels:
|
|
1001
|
-
|
|
1002
|
-
schematicPinLabel.or(
|
|
1049
|
+
standard: z41.enum(["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]).optional(),
|
|
1050
|
+
pinLabels: z41.record(
|
|
1051
|
+
z41.number().or(schematicPinLabel),
|
|
1052
|
+
schematicPinLabel.or(z41.array(schematicPinLabel))
|
|
1003
1053
|
).optional(),
|
|
1004
|
-
internallyConnectedPins:
|
|
1054
|
+
internallyConnectedPins: z41.array(z41.array(z41.union([z41.string(), z41.number()]))).optional()
|
|
1005
1055
|
});
|
|
1006
1056
|
expectTypesMatch(true);
|
|
1007
1057
|
|
|
1008
1058
|
// lib/components/fuse.ts
|
|
1009
|
-
import { z as
|
|
1059
|
+
import { z as z42 } from "zod";
|
|
1010
1060
|
var fusePinLabels = ["pin1", "pin2"];
|
|
1011
1061
|
var fuseProps = commonComponentProps.extend({
|
|
1012
|
-
currentRating:
|
|
1013
|
-
voltageRating:
|
|
1014
|
-
schShowRatings:
|
|
1062
|
+
currentRating: z42.union([z42.number(), z42.string()]),
|
|
1063
|
+
voltageRating: z42.union([z42.number(), z42.string()]).optional(),
|
|
1064
|
+
schShowRatings: z42.boolean().optional(),
|
|
1015
1065
|
schOrientation: schematicOrientation.optional(),
|
|
1016
|
-
connections:
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1066
|
+
connections: z42.record(
|
|
1067
|
+
z42.string(),
|
|
1068
|
+
z42.union([
|
|
1069
|
+
z42.string(),
|
|
1070
|
+
z42.array(z42.string()).readonly(),
|
|
1071
|
+
z42.array(z42.string())
|
|
1022
1072
|
])
|
|
1023
1073
|
).optional()
|
|
1024
1074
|
});
|
|
1025
1075
|
|
|
1026
1076
|
// lib/components/platedhole.ts
|
|
1027
|
-
import { distance as
|
|
1028
|
-
import { z as
|
|
1029
|
-
var distanceHiddenUndefined =
|
|
1077
|
+
import { distance as distance16 } from "circuit-json";
|
|
1078
|
+
import { z as z43 } from "zod";
|
|
1079
|
+
var distanceHiddenUndefined = z43.custom().transform((a) => {
|
|
1030
1080
|
if (a === void 0) return void 0;
|
|
1031
|
-
return
|
|
1081
|
+
return distance16.parse(a);
|
|
1032
1082
|
});
|
|
1033
|
-
var platedHoleProps =
|
|
1083
|
+
var platedHoleProps = z43.discriminatedUnion("shape", [
|
|
1034
1084
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1035
|
-
name:
|
|
1036
|
-
connectsTo:
|
|
1037
|
-
shape:
|
|
1038
|
-
holeDiameter:
|
|
1039
|
-
outerDiameter:
|
|
1040
|
-
padDiameter:
|
|
1085
|
+
name: z43.string().optional(),
|
|
1086
|
+
connectsTo: z43.string().or(z43.array(z43.string())).optional(),
|
|
1087
|
+
shape: z43.literal("circle"),
|
|
1088
|
+
holeDiameter: distance16,
|
|
1089
|
+
outerDiameter: distance16,
|
|
1090
|
+
padDiameter: distance16.optional().describe("Diameter of the copper pad"),
|
|
1041
1091
|
portHints: portHints.optional(),
|
|
1042
|
-
solderMaskMargin:
|
|
1043
|
-
coveredWithSolderMask:
|
|
1092
|
+
solderMaskMargin: distance16.optional(),
|
|
1093
|
+
coveredWithSolderMask: z43.boolean().optional()
|
|
1044
1094
|
}),
|
|
1045
1095
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1046
|
-
name:
|
|
1047
|
-
connectsTo:
|
|
1048
|
-
shape:
|
|
1049
|
-
outerWidth:
|
|
1050
|
-
outerHeight:
|
|
1096
|
+
name: z43.string().optional(),
|
|
1097
|
+
connectsTo: z43.string().or(z43.array(z43.string())).optional(),
|
|
1098
|
+
shape: z43.literal("oval"),
|
|
1099
|
+
outerWidth: distance16,
|
|
1100
|
+
outerHeight: distance16,
|
|
1051
1101
|
holeWidth: distanceHiddenUndefined,
|
|
1052
1102
|
holeHeight: distanceHiddenUndefined,
|
|
1053
|
-
innerWidth:
|
|
1054
|
-
innerHeight:
|
|
1103
|
+
innerWidth: distance16.optional().describe("DEPRECATED use holeWidth"),
|
|
1104
|
+
innerHeight: distance16.optional().describe("DEPRECATED use holeHeight"),
|
|
1055
1105
|
portHints: portHints.optional(),
|
|
1056
|
-
solderMaskMargin:
|
|
1057
|
-
coveredWithSolderMask:
|
|
1106
|
+
solderMaskMargin: distance16.optional(),
|
|
1107
|
+
coveredWithSolderMask: z43.boolean().optional()
|
|
1058
1108
|
}),
|
|
1059
1109
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1060
|
-
name:
|
|
1061
|
-
connectsTo:
|
|
1062
|
-
shape:
|
|
1063
|
-
rectPad:
|
|
1064
|
-
outerWidth:
|
|
1065
|
-
outerHeight:
|
|
1110
|
+
name: z43.string().optional(),
|
|
1111
|
+
connectsTo: z43.string().or(z43.array(z43.string())).optional(),
|
|
1112
|
+
shape: z43.literal("pill"),
|
|
1113
|
+
rectPad: z43.boolean().optional(),
|
|
1114
|
+
outerWidth: distance16,
|
|
1115
|
+
outerHeight: distance16,
|
|
1066
1116
|
holeWidth: distanceHiddenUndefined,
|
|
1067
1117
|
holeHeight: distanceHiddenUndefined,
|
|
1068
|
-
innerWidth:
|
|
1069
|
-
innerHeight:
|
|
1118
|
+
innerWidth: distance16.optional().describe("DEPRECATED use holeWidth"),
|
|
1119
|
+
innerHeight: distance16.optional().describe("DEPRECATED use holeHeight"),
|
|
1070
1120
|
portHints: portHints.optional(),
|
|
1071
|
-
holeOffsetX:
|
|
1072
|
-
holeOffsetY:
|
|
1073
|
-
solderMaskMargin:
|
|
1074
|
-
coveredWithSolderMask:
|
|
1121
|
+
holeOffsetX: distance16.optional(),
|
|
1122
|
+
holeOffsetY: distance16.optional(),
|
|
1123
|
+
solderMaskMargin: distance16.optional(),
|
|
1124
|
+
coveredWithSolderMask: z43.boolean().optional()
|
|
1075
1125
|
}),
|
|
1076
1126
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1077
|
-
name:
|
|
1078
|
-
connectsTo:
|
|
1079
|
-
shape:
|
|
1080
|
-
holeDiameter:
|
|
1081
|
-
rectPadWidth:
|
|
1082
|
-
rectPadHeight:
|
|
1083
|
-
rectBorderRadius:
|
|
1084
|
-
holeShape:
|
|
1085
|
-
padShape:
|
|
1127
|
+
name: z43.string().optional(),
|
|
1128
|
+
connectsTo: z43.string().or(z43.array(z43.string())).optional(),
|
|
1129
|
+
shape: z43.literal("circular_hole_with_rect_pad"),
|
|
1130
|
+
holeDiameter: distance16,
|
|
1131
|
+
rectPadWidth: distance16,
|
|
1132
|
+
rectPadHeight: distance16,
|
|
1133
|
+
rectBorderRadius: distance16.optional(),
|
|
1134
|
+
holeShape: z43.literal("circle").optional(),
|
|
1135
|
+
padShape: z43.literal("rect").optional(),
|
|
1086
1136
|
portHints: portHints.optional(),
|
|
1087
|
-
holeOffsetX:
|
|
1088
|
-
holeOffsetY:
|
|
1089
|
-
solderMaskMargin:
|
|
1090
|
-
coveredWithSolderMask:
|
|
1137
|
+
holeOffsetX: distance16.optional(),
|
|
1138
|
+
holeOffsetY: distance16.optional(),
|
|
1139
|
+
solderMaskMargin: distance16.optional(),
|
|
1140
|
+
coveredWithSolderMask: z43.boolean().optional()
|
|
1091
1141
|
}),
|
|
1092
1142
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1093
|
-
name:
|
|
1094
|
-
connectsTo:
|
|
1095
|
-
shape:
|
|
1096
|
-
holeShape:
|
|
1097
|
-
padShape:
|
|
1098
|
-
holeWidth:
|
|
1099
|
-
holeHeight:
|
|
1100
|
-
rectPadWidth:
|
|
1101
|
-
rectPadHeight:
|
|
1143
|
+
name: z43.string().optional(),
|
|
1144
|
+
connectsTo: z43.string().or(z43.array(z43.string())).optional(),
|
|
1145
|
+
shape: z43.literal("pill_hole_with_rect_pad"),
|
|
1146
|
+
holeShape: z43.literal("pill").optional(),
|
|
1147
|
+
padShape: z43.literal("rect").optional(),
|
|
1148
|
+
holeWidth: distance16,
|
|
1149
|
+
holeHeight: distance16,
|
|
1150
|
+
rectPadWidth: distance16,
|
|
1151
|
+
rectPadHeight: distance16,
|
|
1102
1152
|
portHints: portHints.optional(),
|
|
1103
|
-
holeOffsetX:
|
|
1104
|
-
holeOffsetY:
|
|
1105
|
-
solderMaskMargin:
|
|
1106
|
-
coveredWithSolderMask:
|
|
1153
|
+
holeOffsetX: distance16.optional(),
|
|
1154
|
+
holeOffsetY: distance16.optional(),
|
|
1155
|
+
solderMaskMargin: distance16.optional(),
|
|
1156
|
+
coveredWithSolderMask: z43.boolean().optional()
|
|
1107
1157
|
}),
|
|
1108
1158
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1109
|
-
name:
|
|
1110
|
-
connectsTo:
|
|
1111
|
-
shape:
|
|
1112
|
-
holeShape:
|
|
1113
|
-
holeDiameter:
|
|
1114
|
-
holeWidth:
|
|
1115
|
-
holeHeight:
|
|
1116
|
-
padOutline:
|
|
1117
|
-
holeOffsetX:
|
|
1118
|
-
holeOffsetY:
|
|
1159
|
+
name: z43.string().optional(),
|
|
1160
|
+
connectsTo: z43.string().or(z43.array(z43.string())).optional(),
|
|
1161
|
+
shape: z43.literal("hole_with_polygon_pad"),
|
|
1162
|
+
holeShape: z43.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
1163
|
+
holeDiameter: distance16.optional(),
|
|
1164
|
+
holeWidth: distance16.optional(),
|
|
1165
|
+
holeHeight: distance16.optional(),
|
|
1166
|
+
padOutline: z43.array(point),
|
|
1167
|
+
holeOffsetX: distance16,
|
|
1168
|
+
holeOffsetY: distance16,
|
|
1119
1169
|
portHints: portHints.optional(),
|
|
1120
|
-
solderMaskMargin:
|
|
1121
|
-
coveredWithSolderMask:
|
|
1170
|
+
solderMaskMargin: distance16.optional(),
|
|
1171
|
+
coveredWithSolderMask: z43.boolean().optional()
|
|
1122
1172
|
})
|
|
1123
1173
|
]).refine((a) => {
|
|
1124
1174
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -1133,14 +1183,14 @@ expectTypesMatch(true);
|
|
|
1133
1183
|
|
|
1134
1184
|
// lib/components/resistor.ts
|
|
1135
1185
|
import { resistance } from "circuit-json";
|
|
1136
|
-
import { z as
|
|
1186
|
+
import { z as z44 } from "zod";
|
|
1137
1187
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
1138
1188
|
var resistorProps = commonComponentProps.extend({
|
|
1139
1189
|
resistance,
|
|
1140
|
-
pullupFor:
|
|
1141
|
-
pullupTo:
|
|
1142
|
-
pulldownFor:
|
|
1143
|
-
pulldownTo:
|
|
1190
|
+
pullupFor: z44.string().optional(),
|
|
1191
|
+
pullupTo: z44.string().optional(),
|
|
1192
|
+
pulldownFor: z44.string().optional(),
|
|
1193
|
+
pulldownTo: z44.string().optional(),
|
|
1144
1194
|
schOrientation: schematicOrientation.optional(),
|
|
1145
1195
|
schSize: schematicSymbolSize.optional(),
|
|
1146
1196
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
@@ -1150,23 +1200,23 @@ expectTypesMatch(true);
|
|
|
1150
1200
|
|
|
1151
1201
|
// lib/components/potentiometer.ts
|
|
1152
1202
|
import { resistance as resistance2 } from "circuit-json";
|
|
1153
|
-
import { z as
|
|
1203
|
+
import { z as z45 } from "zod";
|
|
1154
1204
|
var potentiometerProps = commonComponentProps.extend({
|
|
1155
1205
|
maxResistance: resistance2,
|
|
1156
|
-
pinVariant:
|
|
1206
|
+
pinVariant: z45.enum(["two_pin", "three_pin"]).optional()
|
|
1157
1207
|
});
|
|
1158
1208
|
expectTypesMatch(true);
|
|
1159
1209
|
|
|
1160
1210
|
// lib/components/crystal.ts
|
|
1161
1211
|
import { frequency, capacitance } from "circuit-json";
|
|
1162
|
-
import { z as
|
|
1212
|
+
import { z as z46 } from "zod";
|
|
1163
1213
|
var crystalPins = lrPins;
|
|
1164
1214
|
var crystalProps = commonComponentProps.extend({
|
|
1165
1215
|
frequency,
|
|
1166
1216
|
loadCapacitance: capacitance,
|
|
1167
|
-
manufacturerPartNumber:
|
|
1168
|
-
mpn:
|
|
1169
|
-
pinVariant:
|
|
1217
|
+
manufacturerPartNumber: z46.string().optional(),
|
|
1218
|
+
mpn: z46.string().optional(),
|
|
1219
|
+
pinVariant: z46.enum(["two_pin", "four_pin"]).optional(),
|
|
1170
1220
|
schOrientation: schematicOrientation.optional(),
|
|
1171
1221
|
connections: createConnectionsProp(crystalPins).optional()
|
|
1172
1222
|
});
|
|
@@ -1174,34 +1224,34 @@ expectTypesMatch(true);
|
|
|
1174
1224
|
|
|
1175
1225
|
// lib/components/resonator.ts
|
|
1176
1226
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
1177
|
-
import { z as
|
|
1227
|
+
import { z as z47 } from "zod";
|
|
1178
1228
|
var resonatorProps = commonComponentProps.extend({
|
|
1179
1229
|
frequency: frequency2,
|
|
1180
1230
|
loadCapacitance: capacitance2,
|
|
1181
|
-
pinVariant:
|
|
1231
|
+
pinVariant: z47.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
1182
1232
|
});
|
|
1183
1233
|
expectTypesMatch(true);
|
|
1184
1234
|
|
|
1185
1235
|
// lib/components/stampboard.ts
|
|
1186
|
-
import { distance as
|
|
1187
|
-
import { z as
|
|
1236
|
+
import { distance as distance17 } from "circuit-json";
|
|
1237
|
+
import { z as z48 } from "zod";
|
|
1188
1238
|
var stampboardProps = boardProps.extend({
|
|
1189
|
-
leftPinCount:
|
|
1190
|
-
rightPinCount:
|
|
1191
|
-
topPinCount:
|
|
1192
|
-
bottomPinCount:
|
|
1193
|
-
leftPins:
|
|
1194
|
-
rightPins:
|
|
1195
|
-
topPins:
|
|
1196
|
-
bottomPins:
|
|
1197
|
-
pinPitch:
|
|
1198
|
-
innerHoles:
|
|
1239
|
+
leftPinCount: z48.number().optional(),
|
|
1240
|
+
rightPinCount: z48.number().optional(),
|
|
1241
|
+
topPinCount: z48.number().optional(),
|
|
1242
|
+
bottomPinCount: z48.number().optional(),
|
|
1243
|
+
leftPins: z48.array(z48.string()).optional(),
|
|
1244
|
+
rightPins: z48.array(z48.string()).optional(),
|
|
1245
|
+
topPins: z48.array(z48.string()).optional(),
|
|
1246
|
+
bottomPins: z48.array(z48.string()).optional(),
|
|
1247
|
+
pinPitch: distance17.optional(),
|
|
1248
|
+
innerHoles: z48.boolean().optional()
|
|
1199
1249
|
});
|
|
1200
1250
|
expectTypesMatch(true);
|
|
1201
1251
|
|
|
1202
1252
|
// lib/components/capacitor.ts
|
|
1203
1253
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
1204
|
-
import { z as
|
|
1254
|
+
import { z as z49 } from "zod";
|
|
1205
1255
|
var capacitorPinLabels = [
|
|
1206
1256
|
"pin1",
|
|
1207
1257
|
"pin2",
|
|
@@ -1213,13 +1263,13 @@ var capacitorPinLabels = [
|
|
|
1213
1263
|
var capacitorProps = commonComponentProps.extend({
|
|
1214
1264
|
capacitance: capacitance3,
|
|
1215
1265
|
maxVoltageRating: voltage.optional(),
|
|
1216
|
-
schShowRatings:
|
|
1217
|
-
polarized:
|
|
1218
|
-
decouplingFor:
|
|
1219
|
-
decouplingTo:
|
|
1220
|
-
bypassFor:
|
|
1221
|
-
bypassTo:
|
|
1222
|
-
maxDecouplingTraceLength:
|
|
1266
|
+
schShowRatings: z49.boolean().optional().default(false),
|
|
1267
|
+
polarized: z49.boolean().optional().default(false),
|
|
1268
|
+
decouplingFor: z49.string().optional(),
|
|
1269
|
+
decouplingTo: z49.string().optional(),
|
|
1270
|
+
bypassFor: z49.string().optional(),
|
|
1271
|
+
bypassTo: z49.string().optional(),
|
|
1272
|
+
maxDecouplingTraceLength: z49.number().optional(),
|
|
1223
1273
|
schOrientation: schematicOrientation.optional(),
|
|
1224
1274
|
schSize: schematicSymbolSize.optional(),
|
|
1225
1275
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
@@ -1228,13 +1278,13 @@ var capacitorPins = lrPolarPins;
|
|
|
1228
1278
|
expectTypesMatch(true);
|
|
1229
1279
|
|
|
1230
1280
|
// lib/components/net.ts
|
|
1231
|
-
import { z as
|
|
1232
|
-
var netProps =
|
|
1233
|
-
name:
|
|
1234
|
-
connectsTo:
|
|
1235
|
-
highlightColor:
|
|
1236
|
-
isPowerNet:
|
|
1237
|
-
isGroundNet:
|
|
1281
|
+
import { z as z50 } from "zod";
|
|
1282
|
+
var netProps = z50.object({
|
|
1283
|
+
name: z50.string(),
|
|
1284
|
+
connectsTo: z50.string().or(z50.array(z50.string())).optional(),
|
|
1285
|
+
highlightColor: z50.string().optional(),
|
|
1286
|
+
isPowerNet: z50.boolean().optional(),
|
|
1287
|
+
isGroundNet: z50.boolean().optional()
|
|
1238
1288
|
});
|
|
1239
1289
|
expectTypesMatch(true);
|
|
1240
1290
|
|
|
@@ -1247,55 +1297,55 @@ var fiducialProps = commonComponentProps.extend({
|
|
|
1247
1297
|
expectTypesMatch(true);
|
|
1248
1298
|
|
|
1249
1299
|
// lib/components/constrainedlayout.ts
|
|
1250
|
-
import { z as
|
|
1251
|
-
var constrainedLayoutProps =
|
|
1252
|
-
name:
|
|
1253
|
-
pcbOnly:
|
|
1254
|
-
schOnly:
|
|
1300
|
+
import { z as z52 } from "zod";
|
|
1301
|
+
var constrainedLayoutProps = z52.object({
|
|
1302
|
+
name: z52.string().optional(),
|
|
1303
|
+
pcbOnly: z52.boolean().optional(),
|
|
1304
|
+
schOnly: z52.boolean().optional()
|
|
1255
1305
|
});
|
|
1256
1306
|
expectTypesMatch(true);
|
|
1257
1307
|
|
|
1258
1308
|
// lib/components/constraint.ts
|
|
1259
|
-
import { z as
|
|
1260
|
-
var pcbXDistConstraintProps =
|
|
1261
|
-
pcb:
|
|
1309
|
+
import { z as z53 } from "zod";
|
|
1310
|
+
var pcbXDistConstraintProps = z53.object({
|
|
1311
|
+
pcb: z53.literal(true).optional(),
|
|
1262
1312
|
xDist: distance,
|
|
1263
|
-
left:
|
|
1264
|
-
right:
|
|
1265
|
-
edgeToEdge:
|
|
1266
|
-
centerToCenter:
|
|
1313
|
+
left: z53.string(),
|
|
1314
|
+
right: z53.string(),
|
|
1315
|
+
edgeToEdge: z53.literal(true).optional(),
|
|
1316
|
+
centerToCenter: z53.literal(true).optional()
|
|
1267
1317
|
});
|
|
1268
1318
|
expectTypesMatch(
|
|
1269
1319
|
true
|
|
1270
1320
|
);
|
|
1271
|
-
var pcbYDistConstraintProps =
|
|
1272
|
-
pcb:
|
|
1321
|
+
var pcbYDistConstraintProps = z53.object({
|
|
1322
|
+
pcb: z53.literal(true).optional(),
|
|
1273
1323
|
yDist: distance,
|
|
1274
|
-
top:
|
|
1275
|
-
bottom:
|
|
1276
|
-
edgeToEdge:
|
|
1277
|
-
centerToCenter:
|
|
1324
|
+
top: z53.string(),
|
|
1325
|
+
bottom: z53.string(),
|
|
1326
|
+
edgeToEdge: z53.literal(true).optional(),
|
|
1327
|
+
centerToCenter: z53.literal(true).optional()
|
|
1278
1328
|
});
|
|
1279
1329
|
expectTypesMatch(
|
|
1280
1330
|
true
|
|
1281
1331
|
);
|
|
1282
|
-
var pcbSameYConstraintProps =
|
|
1283
|
-
pcb:
|
|
1284
|
-
sameY:
|
|
1285
|
-
for:
|
|
1332
|
+
var pcbSameYConstraintProps = z53.object({
|
|
1333
|
+
pcb: z53.literal(true).optional(),
|
|
1334
|
+
sameY: z53.literal(true).optional(),
|
|
1335
|
+
for: z53.array(z53.string())
|
|
1286
1336
|
});
|
|
1287
1337
|
expectTypesMatch(
|
|
1288
1338
|
true
|
|
1289
1339
|
);
|
|
1290
|
-
var pcbSameXConstraintProps =
|
|
1291
|
-
pcb:
|
|
1292
|
-
sameX:
|
|
1293
|
-
for:
|
|
1340
|
+
var pcbSameXConstraintProps = z53.object({
|
|
1341
|
+
pcb: z53.literal(true).optional(),
|
|
1342
|
+
sameX: z53.literal(true).optional(),
|
|
1343
|
+
for: z53.array(z53.string())
|
|
1294
1344
|
});
|
|
1295
1345
|
expectTypesMatch(
|
|
1296
1346
|
true
|
|
1297
1347
|
);
|
|
1298
|
-
var constraintProps =
|
|
1348
|
+
var constraintProps = z53.union([
|
|
1299
1349
|
pcbXDistConstraintProps,
|
|
1300
1350
|
pcbYDistConstraintProps,
|
|
1301
1351
|
pcbSameYConstraintProps,
|
|
@@ -1304,13 +1354,13 @@ var constraintProps = z52.union([
|
|
|
1304
1354
|
expectTypesMatch(true);
|
|
1305
1355
|
|
|
1306
1356
|
// lib/components/cutout.ts
|
|
1307
|
-
import { z as
|
|
1357
|
+
import { z as z54 } from "zod";
|
|
1308
1358
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
1309
1359
|
layer: true,
|
|
1310
1360
|
pcbRotation: true
|
|
1311
1361
|
}).extend({
|
|
1312
|
-
name:
|
|
1313
|
-
shape:
|
|
1362
|
+
name: z54.string().optional(),
|
|
1363
|
+
shape: z54.literal("rect"),
|
|
1314
1364
|
width: distance,
|
|
1315
1365
|
height: distance
|
|
1316
1366
|
});
|
|
@@ -1319,8 +1369,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
1319
1369
|
layer: true,
|
|
1320
1370
|
pcbRotation: true
|
|
1321
1371
|
}).extend({
|
|
1322
|
-
name:
|
|
1323
|
-
shape:
|
|
1372
|
+
name: z54.string().optional(),
|
|
1373
|
+
shape: z54.literal("circle"),
|
|
1324
1374
|
radius: distance
|
|
1325
1375
|
});
|
|
1326
1376
|
expectTypesMatch(true);
|
|
@@ -1328,28 +1378,28 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
1328
1378
|
layer: true,
|
|
1329
1379
|
pcbRotation: true
|
|
1330
1380
|
}).extend({
|
|
1331
|
-
name:
|
|
1332
|
-
shape:
|
|
1333
|
-
points:
|
|
1381
|
+
name: z54.string().optional(),
|
|
1382
|
+
shape: z54.literal("polygon"),
|
|
1383
|
+
points: z54.array(point)
|
|
1334
1384
|
});
|
|
1335
1385
|
expectTypesMatch(true);
|
|
1336
|
-
var cutoutProps =
|
|
1386
|
+
var cutoutProps = z54.discriminatedUnion("shape", [
|
|
1337
1387
|
rectCutoutProps,
|
|
1338
1388
|
circleCutoutProps,
|
|
1339
1389
|
polygonCutoutProps
|
|
1340
1390
|
]);
|
|
1341
1391
|
|
|
1342
1392
|
// lib/components/smtpad.ts
|
|
1343
|
-
import { z as
|
|
1393
|
+
import { z as z55 } from "zod";
|
|
1344
1394
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1345
|
-
name:
|
|
1346
|
-
shape:
|
|
1395
|
+
name: z55.string().optional(),
|
|
1396
|
+
shape: z55.literal("rect"),
|
|
1347
1397
|
width: distance,
|
|
1348
1398
|
height: distance,
|
|
1349
1399
|
rectBorderRadius: distance.optional(),
|
|
1350
1400
|
cornerRadius: distance.optional(),
|
|
1351
1401
|
portHints: portHints.optional(),
|
|
1352
|
-
coveredWithSolderMask:
|
|
1402
|
+
coveredWithSolderMask: z55.boolean().optional(),
|
|
1353
1403
|
solderMaskMargin: distance.optional(),
|
|
1354
1404
|
solderMaskMarginLeft: distance.optional(),
|
|
1355
1405
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -1358,14 +1408,14 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1358
1408
|
});
|
|
1359
1409
|
expectTypesMatch(true);
|
|
1360
1410
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1361
|
-
name:
|
|
1362
|
-
shape:
|
|
1411
|
+
name: z55.string().optional(),
|
|
1412
|
+
shape: z55.literal("rotated_rect"),
|
|
1363
1413
|
width: distance,
|
|
1364
1414
|
height: distance,
|
|
1365
|
-
ccwRotation:
|
|
1415
|
+
ccwRotation: z55.number(),
|
|
1366
1416
|
cornerRadius: distance.optional(),
|
|
1367
1417
|
portHints: portHints.optional(),
|
|
1368
|
-
coveredWithSolderMask:
|
|
1418
|
+
coveredWithSolderMask: z55.boolean().optional(),
|
|
1369
1419
|
solderMaskMargin: distance.optional(),
|
|
1370
1420
|
solderMaskMarginLeft: distance.optional(),
|
|
1371
1421
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -1374,35 +1424,35 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1374
1424
|
});
|
|
1375
1425
|
expectTypesMatch(true);
|
|
1376
1426
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1377
|
-
name:
|
|
1378
|
-
shape:
|
|
1427
|
+
name: z55.string().optional(),
|
|
1428
|
+
shape: z55.literal("circle"),
|
|
1379
1429
|
radius: distance,
|
|
1380
1430
|
portHints: portHints.optional(),
|
|
1381
|
-
coveredWithSolderMask:
|
|
1431
|
+
coveredWithSolderMask: z55.boolean().optional(),
|
|
1382
1432
|
solderMaskMargin: distance.optional()
|
|
1383
1433
|
});
|
|
1384
1434
|
expectTypesMatch(true);
|
|
1385
1435
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1386
|
-
name:
|
|
1387
|
-
shape:
|
|
1436
|
+
name: z55.string().optional(),
|
|
1437
|
+
shape: z55.literal("pill"),
|
|
1388
1438
|
width: distance,
|
|
1389
1439
|
height: distance,
|
|
1390
1440
|
radius: distance,
|
|
1391
1441
|
portHints: portHints.optional(),
|
|
1392
|
-
coveredWithSolderMask:
|
|
1442
|
+
coveredWithSolderMask: z55.boolean().optional(),
|
|
1393
1443
|
solderMaskMargin: distance.optional()
|
|
1394
1444
|
});
|
|
1395
1445
|
expectTypesMatch(true);
|
|
1396
1446
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1397
|
-
name:
|
|
1398
|
-
shape:
|
|
1399
|
-
points:
|
|
1447
|
+
name: z55.string().optional(),
|
|
1448
|
+
shape: z55.literal("polygon"),
|
|
1449
|
+
points: z55.array(point),
|
|
1400
1450
|
portHints: portHints.optional(),
|
|
1401
|
-
coveredWithSolderMask:
|
|
1451
|
+
coveredWithSolderMask: z55.boolean().optional(),
|
|
1402
1452
|
solderMaskMargin: distance.optional()
|
|
1403
1453
|
});
|
|
1404
1454
|
expectTypesMatch(true);
|
|
1405
|
-
var smtPadProps =
|
|
1455
|
+
var smtPadProps = z55.discriminatedUnion("shape", [
|
|
1406
1456
|
circleSmtPadProps,
|
|
1407
1457
|
rectSmtPadProps,
|
|
1408
1458
|
rotatedRectSmtPadProps,
|
|
@@ -1412,55 +1462,55 @@ var smtPadProps = z54.discriminatedUnion("shape", [
|
|
|
1412
1462
|
expectTypesMatch(true);
|
|
1413
1463
|
|
|
1414
1464
|
// lib/components/solderpaste.ts
|
|
1415
|
-
import { z as
|
|
1465
|
+
import { z as z56 } from "zod";
|
|
1416
1466
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1417
|
-
shape:
|
|
1467
|
+
shape: z56.literal("rect"),
|
|
1418
1468
|
width: distance,
|
|
1419
1469
|
height: distance
|
|
1420
1470
|
});
|
|
1421
1471
|
expectTypesMatch(true);
|
|
1422
1472
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1423
|
-
shape:
|
|
1473
|
+
shape: z56.literal("circle"),
|
|
1424
1474
|
radius: distance
|
|
1425
1475
|
});
|
|
1426
1476
|
expectTypesMatch(true);
|
|
1427
|
-
var solderPasteProps =
|
|
1477
|
+
var solderPasteProps = z56.union([
|
|
1428
1478
|
circleSolderPasteProps,
|
|
1429
1479
|
rectSolderPasteProps
|
|
1430
1480
|
]);
|
|
1431
1481
|
expectTypesMatch(true);
|
|
1432
1482
|
|
|
1433
1483
|
// lib/components/hole.ts
|
|
1434
|
-
import { z as
|
|
1484
|
+
import { z as z57 } from "zod";
|
|
1435
1485
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
1436
|
-
name:
|
|
1437
|
-
shape:
|
|
1486
|
+
name: z57.string().optional(),
|
|
1487
|
+
shape: z57.literal("circle").optional(),
|
|
1438
1488
|
diameter: distance.optional(),
|
|
1439
1489
|
radius: distance.optional(),
|
|
1440
1490
|
solderMaskMargin: distance.optional(),
|
|
1441
|
-
coveredWithSolderMask:
|
|
1491
|
+
coveredWithSolderMask: z57.boolean().optional()
|
|
1442
1492
|
}).transform((d) => ({
|
|
1443
1493
|
...d,
|
|
1444
1494
|
diameter: d.diameter ?? 2 * d.radius,
|
|
1445
1495
|
radius: d.radius ?? d.diameter / 2
|
|
1446
1496
|
}));
|
|
1447
1497
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
1448
|
-
name:
|
|
1449
|
-
shape:
|
|
1498
|
+
name: z57.string().optional(),
|
|
1499
|
+
shape: z57.literal("pill"),
|
|
1450
1500
|
width: distance,
|
|
1451
1501
|
height: distance,
|
|
1452
1502
|
solderMaskMargin: distance.optional(),
|
|
1453
|
-
coveredWithSolderMask:
|
|
1503
|
+
coveredWithSolderMask: z57.boolean().optional()
|
|
1454
1504
|
});
|
|
1455
1505
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
1456
|
-
name:
|
|
1457
|
-
shape:
|
|
1506
|
+
name: z57.string().optional(),
|
|
1507
|
+
shape: z57.literal("rect"),
|
|
1458
1508
|
width: distance,
|
|
1459
1509
|
height: distance,
|
|
1460
1510
|
solderMaskMargin: distance.optional(),
|
|
1461
|
-
coveredWithSolderMask:
|
|
1511
|
+
coveredWithSolderMask: z57.boolean().optional()
|
|
1462
1512
|
});
|
|
1463
|
-
var holeProps =
|
|
1513
|
+
var holeProps = z57.union([
|
|
1464
1514
|
circleHoleProps,
|
|
1465
1515
|
pillHoleProps,
|
|
1466
1516
|
rectHoleProps
|
|
@@ -1468,34 +1518,34 @@ var holeProps = z56.union([
|
|
|
1468
1518
|
expectTypesMatch(true);
|
|
1469
1519
|
|
|
1470
1520
|
// lib/components/trace.ts
|
|
1471
|
-
import { distance as
|
|
1472
|
-
import { z as
|
|
1473
|
-
var portRef =
|
|
1474
|
-
|
|
1475
|
-
|
|
1521
|
+
import { distance as distance18, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
1522
|
+
import { z as z58 } from "zod";
|
|
1523
|
+
var portRef = z58.union([
|
|
1524
|
+
z58.string(),
|
|
1525
|
+
z58.custom(
|
|
1476
1526
|
(v) => Boolean(v.getPortSelector)
|
|
1477
1527
|
)
|
|
1478
1528
|
]);
|
|
1479
|
-
var pcbPath =
|
|
1480
|
-
var baseTraceProps =
|
|
1481
|
-
key:
|
|
1482
|
-
thickness:
|
|
1483
|
-
width:
|
|
1484
|
-
schematicRouteHints:
|
|
1485
|
-
pcbRouteHints:
|
|
1486
|
-
pcbPathRelativeTo:
|
|
1529
|
+
var pcbPath = z58.array(z58.union([point, z58.string()]));
|
|
1530
|
+
var baseTraceProps = z58.object({
|
|
1531
|
+
key: z58.string().optional(),
|
|
1532
|
+
thickness: distance18.optional(),
|
|
1533
|
+
width: distance18.optional().describe("Alias for trace thickness"),
|
|
1534
|
+
schematicRouteHints: z58.array(point).optional(),
|
|
1535
|
+
pcbRouteHints: z58.array(route_hint_point2).optional(),
|
|
1536
|
+
pcbPathRelativeTo: z58.string().optional(),
|
|
1487
1537
|
pcbPath: pcbPath.optional(),
|
|
1488
|
-
pcbPaths:
|
|
1489
|
-
pcbStraightLine:
|
|
1490
|
-
schDisplayLabel:
|
|
1491
|
-
schStroke:
|
|
1492
|
-
highlightColor:
|
|
1493
|
-
maxLength:
|
|
1494
|
-
connectsTo:
|
|
1495
|
-
});
|
|
1496
|
-
var traceProps =
|
|
1538
|
+
pcbPaths: z58.array(pcbPath).optional(),
|
|
1539
|
+
pcbStraightLine: z58.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
1540
|
+
schDisplayLabel: z58.string().optional(),
|
|
1541
|
+
schStroke: z58.string().optional(),
|
|
1542
|
+
highlightColor: z58.string().optional(),
|
|
1543
|
+
maxLength: distance18.optional(),
|
|
1544
|
+
connectsTo: z58.string().or(z58.array(z58.string())).optional()
|
|
1545
|
+
});
|
|
1546
|
+
var traceProps = z58.union([
|
|
1497
1547
|
baseTraceProps.extend({
|
|
1498
|
-
path:
|
|
1548
|
+
path: z58.array(portRef)
|
|
1499
1549
|
}),
|
|
1500
1550
|
baseTraceProps.extend({
|
|
1501
1551
|
from: portRef,
|
|
@@ -1505,25 +1555,25 @@ var traceProps = z57.union([
|
|
|
1505
1555
|
|
|
1506
1556
|
// lib/components/footprint.ts
|
|
1507
1557
|
import { layer_ref as layer_ref4 } from "circuit-json";
|
|
1508
|
-
import { z as
|
|
1509
|
-
var footprintProps =
|
|
1510
|
-
children:
|
|
1558
|
+
import { z as z59 } from "zod";
|
|
1559
|
+
var footprintProps = z59.object({
|
|
1560
|
+
children: z59.any().optional(),
|
|
1511
1561
|
originalLayer: layer_ref4.default("top").optional(),
|
|
1512
|
-
circuitJson:
|
|
1562
|
+
circuitJson: z59.array(z59.any()).optional()
|
|
1513
1563
|
});
|
|
1514
1564
|
expectTypesMatch(true);
|
|
1515
1565
|
|
|
1516
1566
|
// lib/components/symbol.ts
|
|
1517
|
-
import { z as
|
|
1518
|
-
var symbolProps =
|
|
1519
|
-
originalFacingDirection:
|
|
1567
|
+
import { z as z60 } from "zod";
|
|
1568
|
+
var symbolProps = z60.object({
|
|
1569
|
+
originalFacingDirection: z60.enum(["up", "down", "left", "right"]).default("right").optional()
|
|
1520
1570
|
});
|
|
1521
1571
|
expectTypesMatch(true);
|
|
1522
1572
|
|
|
1523
1573
|
// lib/components/battery.ts
|
|
1524
1574
|
import { voltage as voltage2 } from "circuit-json";
|
|
1525
|
-
import { z as
|
|
1526
|
-
var capacity =
|
|
1575
|
+
import { z as z61 } from "zod";
|
|
1576
|
+
var capacity = z61.number().or(z61.string().endsWith("mAh")).transform((v) => {
|
|
1527
1577
|
if (typeof v === "string") {
|
|
1528
1578
|
const valString = v.replace("mAh", "");
|
|
1529
1579
|
const num = Number.parseFloat(valString);
|
|
@@ -1537,71 +1587,71 @@ var capacity = z60.number().or(z60.string().endsWith("mAh")).transform((v) => {
|
|
|
1537
1587
|
var batteryProps = commonComponentProps.extend({
|
|
1538
1588
|
capacity: capacity.optional(),
|
|
1539
1589
|
voltage: voltage2.optional(),
|
|
1540
|
-
standard:
|
|
1590
|
+
standard: z61.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
1541
1591
|
schOrientation: schematicOrientation.optional()
|
|
1542
1592
|
});
|
|
1543
1593
|
var batteryPins = lrPolarPins;
|
|
1544
1594
|
expectTypesMatch(true);
|
|
1545
1595
|
|
|
1546
1596
|
// lib/components/pin-header.ts
|
|
1547
|
-
import { distance as
|
|
1597
|
+
import { distance as distance19 } from "circuit-json";
|
|
1548
1598
|
|
|
1549
1599
|
// lib/common/pcbOrientation.ts
|
|
1550
|
-
import { z as
|
|
1551
|
-
var pcbOrientation =
|
|
1600
|
+
import { z as z62 } from "zod";
|
|
1601
|
+
var pcbOrientation = z62.enum(["vertical", "horizontal"]).describe(
|
|
1552
1602
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
1553
1603
|
);
|
|
1554
1604
|
expectTypesMatch(true);
|
|
1555
1605
|
|
|
1556
1606
|
// lib/components/pin-header.ts
|
|
1557
|
-
import { z as
|
|
1607
|
+
import { z as z63 } from "zod";
|
|
1558
1608
|
var pinHeaderProps = commonComponentProps.extend({
|
|
1559
|
-
pinCount:
|
|
1560
|
-
pitch:
|
|
1561
|
-
schFacingDirection:
|
|
1562
|
-
gender:
|
|
1563
|
-
showSilkscreenPinLabels:
|
|
1564
|
-
pcbPinLabels:
|
|
1565
|
-
doubleRow:
|
|
1566
|
-
rightAngle:
|
|
1609
|
+
pinCount: z63.number(),
|
|
1610
|
+
pitch: distance19.optional(),
|
|
1611
|
+
schFacingDirection: z63.enum(["up", "down", "left", "right"]).optional(),
|
|
1612
|
+
gender: z63.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
1613
|
+
showSilkscreenPinLabels: z63.boolean().optional(),
|
|
1614
|
+
pcbPinLabels: z63.record(z63.string(), z63.string()).optional(),
|
|
1615
|
+
doubleRow: z63.boolean().optional(),
|
|
1616
|
+
rightAngle: z63.boolean().optional(),
|
|
1567
1617
|
pcbOrientation: pcbOrientation.optional(),
|
|
1568
|
-
holeDiameter:
|
|
1569
|
-
platedDiameter:
|
|
1570
|
-
pinLabels:
|
|
1571
|
-
connections:
|
|
1572
|
-
facingDirection:
|
|
1618
|
+
holeDiameter: distance19.optional(),
|
|
1619
|
+
platedDiameter: distance19.optional(),
|
|
1620
|
+
pinLabels: z63.record(z63.string(), schematicPinLabel).or(z63.array(schematicPinLabel)).optional(),
|
|
1621
|
+
connections: z63.custom().pipe(z63.record(z63.string(), connectionTarget)).optional(),
|
|
1622
|
+
facingDirection: z63.enum(["left", "right"]).optional(),
|
|
1573
1623
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
1574
1624
|
schPinStyle: schematicPinStyle.optional(),
|
|
1575
|
-
schPinSpacing:
|
|
1576
|
-
schWidth:
|
|
1577
|
-
schHeight:
|
|
1625
|
+
schPinSpacing: distance19.optional(),
|
|
1626
|
+
schWidth: distance19.optional(),
|
|
1627
|
+
schHeight: distance19.optional()
|
|
1578
1628
|
});
|
|
1579
1629
|
expectTypesMatch(true);
|
|
1580
1630
|
|
|
1581
1631
|
// lib/components/netalias.ts
|
|
1582
|
-
import { z as
|
|
1632
|
+
import { z as z64 } from "zod";
|
|
1583
1633
|
import { rotation as rotation3 } from "circuit-json";
|
|
1584
|
-
var netAliasProps =
|
|
1585
|
-
net:
|
|
1586
|
-
connection:
|
|
1634
|
+
var netAliasProps = z64.object({
|
|
1635
|
+
net: z64.string().optional(),
|
|
1636
|
+
connection: z64.string().optional(),
|
|
1587
1637
|
schX: distance.optional(),
|
|
1588
1638
|
schY: distance.optional(),
|
|
1589
1639
|
schRotation: rotation3.optional(),
|
|
1590
|
-
anchorSide:
|
|
1640
|
+
anchorSide: z64.enum(["left", "top", "right", "bottom"]).optional()
|
|
1591
1641
|
});
|
|
1592
1642
|
expectTypesMatch(true);
|
|
1593
1643
|
|
|
1594
1644
|
// lib/components/netlabel.ts
|
|
1595
|
-
import { z as
|
|
1645
|
+
import { z as z65 } from "zod";
|
|
1596
1646
|
import { rotation as rotation4 } from "circuit-json";
|
|
1597
|
-
var netLabelProps =
|
|
1598
|
-
net:
|
|
1599
|
-
connection:
|
|
1600
|
-
connectsTo:
|
|
1647
|
+
var netLabelProps = z65.object({
|
|
1648
|
+
net: z65.string().optional(),
|
|
1649
|
+
connection: z65.string().optional(),
|
|
1650
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
1601
1651
|
schX: distance.optional(),
|
|
1602
1652
|
schY: distance.optional(),
|
|
1603
1653
|
schRotation: rotation4.optional(),
|
|
1604
|
-
anchorSide:
|
|
1654
|
+
anchorSide: z65.enum(["left", "top", "right", "bottom"]).optional()
|
|
1605
1655
|
});
|
|
1606
1656
|
expectTypesMatch(true);
|
|
1607
1657
|
|
|
@@ -1616,12 +1666,12 @@ expectTypesMatch(true);
|
|
|
1616
1666
|
|
|
1617
1667
|
// lib/components/analogsimulation.ts
|
|
1618
1668
|
import { ms } from "circuit-json";
|
|
1619
|
-
import { z as
|
|
1620
|
-
var spiceEngine =
|
|
1669
|
+
import { z as z67 } from "zod";
|
|
1670
|
+
var spiceEngine = z67.custom(
|
|
1621
1671
|
(value) => typeof value === "string"
|
|
1622
1672
|
);
|
|
1623
|
-
var analogSimulationProps =
|
|
1624
|
-
simulationType:
|
|
1673
|
+
var analogSimulationProps = z67.object({
|
|
1674
|
+
simulationType: z67.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
1625
1675
|
duration: ms.optional(),
|
|
1626
1676
|
timePerStep: ms.optional(),
|
|
1627
1677
|
spiceEngine: spiceEngine.optional()
|
|
@@ -1631,7 +1681,7 @@ expectTypesMatch(
|
|
|
1631
1681
|
);
|
|
1632
1682
|
|
|
1633
1683
|
// lib/components/transistor.ts
|
|
1634
|
-
import { z as
|
|
1684
|
+
import { z as z68 } from "zod";
|
|
1635
1685
|
var transistorPinsLabels = [
|
|
1636
1686
|
"pin1",
|
|
1637
1687
|
"pin2",
|
|
@@ -1644,7 +1694,7 @@ var transistorPinsLabels = [
|
|
|
1644
1694
|
"drain"
|
|
1645
1695
|
];
|
|
1646
1696
|
var transistorProps = commonComponentProps.extend({
|
|
1647
|
-
type:
|
|
1697
|
+
type: z68.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
1648
1698
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
1649
1699
|
});
|
|
1650
1700
|
var transistorPins = [
|
|
@@ -1658,10 +1708,10 @@ var transistorPins = [
|
|
|
1658
1708
|
expectTypesMatch(true);
|
|
1659
1709
|
|
|
1660
1710
|
// lib/components/mosfet.ts
|
|
1661
|
-
import { z as
|
|
1711
|
+
import { z as z69 } from "zod";
|
|
1662
1712
|
var mosfetProps = commonComponentProps.extend({
|
|
1663
|
-
channelType:
|
|
1664
|
-
mosfetMode:
|
|
1713
|
+
channelType: z69.enum(["n", "p"]),
|
|
1714
|
+
mosfetMode: z69.enum(["enhancement", "depletion"])
|
|
1665
1715
|
});
|
|
1666
1716
|
var mosfetPins = [
|
|
1667
1717
|
"pin1",
|
|
@@ -1690,19 +1740,19 @@ expectTypesMatch(true);
|
|
|
1690
1740
|
|
|
1691
1741
|
// lib/components/inductor.ts
|
|
1692
1742
|
import { inductance } from "circuit-json";
|
|
1693
|
-
import { z as
|
|
1743
|
+
import { z as z71 } from "zod";
|
|
1694
1744
|
var inductorPins = lrPins;
|
|
1695
1745
|
var inductorProps = commonComponentProps.extend({
|
|
1696
1746
|
inductance,
|
|
1697
|
-
maxCurrentRating:
|
|
1747
|
+
maxCurrentRating: z71.union([z71.string(), z71.number()]).optional(),
|
|
1698
1748
|
schOrientation: schematicOrientation.optional(),
|
|
1699
1749
|
connections: createConnectionsProp(inductorPins).optional()
|
|
1700
1750
|
});
|
|
1701
1751
|
expectTypesMatch(true);
|
|
1702
1752
|
|
|
1703
1753
|
// lib/components/diode.ts
|
|
1704
|
-
import { z as
|
|
1705
|
-
var diodeConnectionKeys =
|
|
1754
|
+
import { z as z72 } from "zod";
|
|
1755
|
+
var diodeConnectionKeys = z72.enum([
|
|
1706
1756
|
"anode",
|
|
1707
1757
|
"cathode",
|
|
1708
1758
|
"pin1",
|
|
@@ -1710,9 +1760,9 @@ var diodeConnectionKeys = z71.enum([
|
|
|
1710
1760
|
"pos",
|
|
1711
1761
|
"neg"
|
|
1712
1762
|
]);
|
|
1713
|
-
var connectionTarget3 =
|
|
1714
|
-
var connectionsProp2 =
|
|
1715
|
-
var diodeVariant =
|
|
1763
|
+
var connectionTarget3 = z72.string().or(z72.array(z72.string()).readonly()).or(z72.array(z72.string()));
|
|
1764
|
+
var connectionsProp2 = z72.record(diodeConnectionKeys, connectionTarget3);
|
|
1765
|
+
var diodeVariant = z72.enum([
|
|
1716
1766
|
"standard",
|
|
1717
1767
|
"schottky",
|
|
1718
1768
|
"zener",
|
|
@@ -1723,12 +1773,12 @@ var diodeVariant = z71.enum([
|
|
|
1723
1773
|
var diodeProps = commonComponentProps.extend({
|
|
1724
1774
|
connections: connectionsProp2.optional(),
|
|
1725
1775
|
variant: diodeVariant.optional().default("standard"),
|
|
1726
|
-
standard:
|
|
1727
|
-
schottky:
|
|
1728
|
-
zener:
|
|
1729
|
-
avalanche:
|
|
1730
|
-
photo:
|
|
1731
|
-
tvs:
|
|
1776
|
+
standard: z72.boolean().optional(),
|
|
1777
|
+
schottky: z72.boolean().optional(),
|
|
1778
|
+
zener: z72.boolean().optional(),
|
|
1779
|
+
avalanche: z72.boolean().optional(),
|
|
1780
|
+
photo: z72.boolean().optional(),
|
|
1781
|
+
tvs: z72.boolean().optional(),
|
|
1732
1782
|
schOrientation: schematicOrientation.optional()
|
|
1733
1783
|
}).superRefine((data, ctx) => {
|
|
1734
1784
|
const enabledFlags = [
|
|
@@ -1741,11 +1791,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
1741
1791
|
].filter(Boolean).length;
|
|
1742
1792
|
if (enabledFlags > 1) {
|
|
1743
1793
|
ctx.addIssue({
|
|
1744
|
-
code:
|
|
1794
|
+
code: z72.ZodIssueCode.custom,
|
|
1745
1795
|
message: "Exactly one diode variant must be enabled",
|
|
1746
1796
|
path: []
|
|
1747
1797
|
});
|
|
1748
|
-
return
|
|
1798
|
+
return z72.INVALID;
|
|
1749
1799
|
}
|
|
1750
1800
|
}).transform((data) => {
|
|
1751
1801
|
const result = {
|
|
@@ -1792,33 +1842,33 @@ var diodePins = lrPolarPins;
|
|
|
1792
1842
|
expectTypesMatch(true);
|
|
1793
1843
|
|
|
1794
1844
|
// lib/components/led.ts
|
|
1795
|
-
import { z as
|
|
1845
|
+
import { z as z73 } from "zod";
|
|
1796
1846
|
var ledProps = commonComponentProps.extend({
|
|
1797
|
-
color:
|
|
1798
|
-
wavelength:
|
|
1799
|
-
schDisplayValue:
|
|
1847
|
+
color: z73.string().optional(),
|
|
1848
|
+
wavelength: z73.string().optional(),
|
|
1849
|
+
schDisplayValue: z73.string().optional(),
|
|
1800
1850
|
schOrientation: schematicOrientation.optional(),
|
|
1801
1851
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
1802
|
-
laser:
|
|
1852
|
+
laser: z73.boolean().optional()
|
|
1803
1853
|
});
|
|
1804
1854
|
var ledPins = lrPolarPins;
|
|
1805
1855
|
|
|
1806
1856
|
// lib/components/switch.ts
|
|
1807
1857
|
import { ms as ms2, frequency as frequency3 } from "circuit-json";
|
|
1808
|
-
import { z as
|
|
1858
|
+
import { z as z74 } from "zod";
|
|
1809
1859
|
var switchProps = commonComponentProps.extend({
|
|
1810
|
-
type:
|
|
1811
|
-
isNormallyClosed:
|
|
1812
|
-
spst:
|
|
1813
|
-
spdt:
|
|
1814
|
-
dpst:
|
|
1815
|
-
dpdt:
|
|
1860
|
+
type: z74.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
1861
|
+
isNormallyClosed: z74.boolean().optional().default(false),
|
|
1862
|
+
spst: z74.boolean().optional(),
|
|
1863
|
+
spdt: z74.boolean().optional(),
|
|
1864
|
+
dpst: z74.boolean().optional(),
|
|
1865
|
+
dpdt: z74.boolean().optional(),
|
|
1816
1866
|
simSwitchFrequency: frequency3.optional(),
|
|
1817
1867
|
simCloseAt: ms2.optional(),
|
|
1818
1868
|
simOpenAt: ms2.optional(),
|
|
1819
|
-
simStartClosed:
|
|
1820
|
-
simStartOpen:
|
|
1821
|
-
connections:
|
|
1869
|
+
simStartClosed: z74.boolean().optional(),
|
|
1870
|
+
simStartOpen: z74.boolean().optional(),
|
|
1871
|
+
connections: z74.custom().pipe(z74.record(z74.string(), connectionTarget)).optional()
|
|
1822
1872
|
}).transform((props) => {
|
|
1823
1873
|
const updatedProps = { ...props };
|
|
1824
1874
|
if (updatedProps.dpdt) {
|
|
@@ -1850,33 +1900,33 @@ expectTypesMatch(true);
|
|
|
1850
1900
|
|
|
1851
1901
|
// lib/components/fabrication-note-text.ts
|
|
1852
1902
|
import { length as length3 } from "circuit-json";
|
|
1853
|
-
import { z as
|
|
1903
|
+
import { z as z75 } from "zod";
|
|
1854
1904
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
1855
|
-
text:
|
|
1856
|
-
anchorAlignment:
|
|
1857
|
-
font:
|
|
1905
|
+
text: z75.string(),
|
|
1906
|
+
anchorAlignment: z75.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1907
|
+
font: z75.enum(["tscircuit2024"]).optional(),
|
|
1858
1908
|
fontSize: length3.optional(),
|
|
1859
|
-
color:
|
|
1909
|
+
color: z75.string().optional()
|
|
1860
1910
|
});
|
|
1861
1911
|
expectTypesMatch(true);
|
|
1862
1912
|
|
|
1863
1913
|
// lib/components/fabrication-note-rect.ts
|
|
1864
|
-
import { distance as
|
|
1865
|
-
import { z as
|
|
1914
|
+
import { distance as distance20 } from "circuit-json";
|
|
1915
|
+
import { z as z76 } from "zod";
|
|
1866
1916
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1867
|
-
width:
|
|
1868
|
-
height:
|
|
1869
|
-
strokeWidth:
|
|
1870
|
-
isFilled:
|
|
1871
|
-
hasStroke:
|
|
1872
|
-
isStrokeDashed:
|
|
1873
|
-
color:
|
|
1874
|
-
cornerRadius:
|
|
1917
|
+
width: distance20,
|
|
1918
|
+
height: distance20,
|
|
1919
|
+
strokeWidth: distance20.optional(),
|
|
1920
|
+
isFilled: z76.boolean().optional(),
|
|
1921
|
+
hasStroke: z76.boolean().optional(),
|
|
1922
|
+
isStrokeDashed: z76.boolean().optional(),
|
|
1923
|
+
color: z76.string().optional(),
|
|
1924
|
+
cornerRadius: distance20.optional()
|
|
1875
1925
|
});
|
|
1876
1926
|
|
|
1877
1927
|
// lib/components/fabrication-note-path.ts
|
|
1878
1928
|
import { length as length4, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
1879
|
-
import { z as
|
|
1929
|
+
import { z as z77 } from "zod";
|
|
1880
1930
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
1881
1931
|
pcbLeftEdgeX: true,
|
|
1882
1932
|
pcbRightEdgeX: true,
|
|
@@ -1888,15 +1938,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
1888
1938
|
pcbOffsetY: true,
|
|
1889
1939
|
pcbRotation: true
|
|
1890
1940
|
}).extend({
|
|
1891
|
-
route:
|
|
1941
|
+
route: z77.array(route_hint_point3),
|
|
1892
1942
|
strokeWidth: length4.optional(),
|
|
1893
|
-
color:
|
|
1943
|
+
color: z77.string().optional()
|
|
1894
1944
|
});
|
|
1895
1945
|
|
|
1896
1946
|
// lib/components/fabrication-note-dimension.ts
|
|
1897
|
-
import { distance as
|
|
1898
|
-
import { z as
|
|
1899
|
-
var dimensionTarget =
|
|
1947
|
+
import { distance as distance21, length as length5 } from "circuit-json";
|
|
1948
|
+
import { z as z78 } from "zod";
|
|
1949
|
+
var dimensionTarget = z78.union([z78.string(), point]);
|
|
1900
1950
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
1901
1951
|
pcbLeftEdgeX: true,
|
|
1902
1952
|
pcbRightEdgeX: true,
|
|
@@ -1910,57 +1960,57 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
1910
1960
|
}).extend({
|
|
1911
1961
|
from: dimensionTarget,
|
|
1912
1962
|
to: dimensionTarget,
|
|
1913
|
-
text:
|
|
1914
|
-
offset:
|
|
1915
|
-
font:
|
|
1963
|
+
text: z78.string().optional(),
|
|
1964
|
+
offset: distance21.optional(),
|
|
1965
|
+
font: z78.enum(["tscircuit2024"]).optional(),
|
|
1916
1966
|
fontSize: length5.optional(),
|
|
1917
|
-
color:
|
|
1918
|
-
arrowSize:
|
|
1919
|
-
units:
|
|
1920
|
-
outerEdgeToEdge:
|
|
1921
|
-
centerToCenter:
|
|
1922
|
-
innerEdgeToEdge:
|
|
1967
|
+
color: z78.string().optional(),
|
|
1968
|
+
arrowSize: distance21.optional(),
|
|
1969
|
+
units: z78.enum(["in", "mm"]).optional(),
|
|
1970
|
+
outerEdgeToEdge: z78.literal(true).optional(),
|
|
1971
|
+
centerToCenter: z78.literal(true).optional(),
|
|
1972
|
+
innerEdgeToEdge: z78.literal(true).optional()
|
|
1923
1973
|
});
|
|
1924
1974
|
expectTypesMatch(true);
|
|
1925
1975
|
|
|
1926
1976
|
// lib/components/pcb-trace.ts
|
|
1927
|
-
import { distance as
|
|
1928
|
-
import { z as
|
|
1929
|
-
var pcbTraceProps =
|
|
1930
|
-
layer:
|
|
1931
|
-
thickness:
|
|
1932
|
-
route:
|
|
1977
|
+
import { distance as distance22, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
1978
|
+
import { z as z79 } from "zod";
|
|
1979
|
+
var pcbTraceProps = z79.object({
|
|
1980
|
+
layer: z79.string().optional(),
|
|
1981
|
+
thickness: distance22.optional(),
|
|
1982
|
+
route: z79.array(route_hint_point4)
|
|
1933
1983
|
});
|
|
1934
1984
|
|
|
1935
1985
|
// lib/components/via.ts
|
|
1936
|
-
import { distance as
|
|
1937
|
-
import { z as
|
|
1986
|
+
import { distance as distance23, layer_ref as layer_ref5 } from "circuit-json";
|
|
1987
|
+
import { z as z80 } from "zod";
|
|
1938
1988
|
var viaProps = commonLayoutProps.extend({
|
|
1939
|
-
name:
|
|
1989
|
+
name: z80.string().optional(),
|
|
1940
1990
|
fromLayer: layer_ref5,
|
|
1941
1991
|
toLayer: layer_ref5,
|
|
1942
|
-
holeDiameter:
|
|
1943
|
-
outerDiameter:
|
|
1944
|
-
connectsTo:
|
|
1945
|
-
netIsAssignable:
|
|
1992
|
+
holeDiameter: distance23.optional(),
|
|
1993
|
+
outerDiameter: distance23.optional(),
|
|
1994
|
+
connectsTo: z80.string().or(z80.array(z80.string())).optional(),
|
|
1995
|
+
netIsAssignable: z80.boolean().optional()
|
|
1946
1996
|
});
|
|
1947
1997
|
expectTypesMatch(true);
|
|
1948
1998
|
|
|
1949
1999
|
// lib/components/testpoint.ts
|
|
1950
|
-
import { distance as
|
|
1951
|
-
import { z as
|
|
2000
|
+
import { distance as distance24 } from "circuit-json";
|
|
2001
|
+
import { z as z81 } from "zod";
|
|
1952
2002
|
var testpointPins = ["pin1"];
|
|
1953
|
-
var testpointConnectionsProp =
|
|
2003
|
+
var testpointConnectionsProp = z81.object({
|
|
1954
2004
|
pin1: connectionTarget
|
|
1955
2005
|
}).strict();
|
|
1956
2006
|
var testpointProps = commonComponentProps.extend({
|
|
1957
2007
|
connections: testpointConnectionsProp.optional(),
|
|
1958
|
-
footprintVariant:
|
|
1959
|
-
padShape:
|
|
1960
|
-
padDiameter:
|
|
1961
|
-
holeDiameter:
|
|
1962
|
-
width:
|
|
1963
|
-
height:
|
|
2008
|
+
footprintVariant: z81.enum(["pad", "through_hole"]).optional(),
|
|
2009
|
+
padShape: z81.enum(["rect", "circle"]).optional().default("circle"),
|
|
2010
|
+
padDiameter: distance24.optional(),
|
|
2011
|
+
holeDiameter: distance24.optional(),
|
|
2012
|
+
width: distance24.optional(),
|
|
2013
|
+
height: distance24.optional()
|
|
1964
2014
|
}).refine(
|
|
1965
2015
|
(props) => props.footprintVariant !== "through_hole" || props.holeDiameter !== void 0,
|
|
1966
2016
|
{ message: "holeDiameter is required for through_hole testpoints" }
|
|
@@ -1968,43 +2018,43 @@ var testpointProps = commonComponentProps.extend({
|
|
|
1968
2018
|
expectTypesMatch(true);
|
|
1969
2019
|
|
|
1970
2020
|
// lib/components/breakoutpoint.ts
|
|
1971
|
-
import { z as
|
|
2021
|
+
import { z as z82 } from "zod";
|
|
1972
2022
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1973
|
-
connection:
|
|
2023
|
+
connection: z82.string()
|
|
1974
2024
|
});
|
|
1975
2025
|
expectTypesMatch(true);
|
|
1976
2026
|
|
|
1977
2027
|
// lib/components/pcb-keepout.ts
|
|
1978
|
-
import { distance as
|
|
1979
|
-
import { z as
|
|
1980
|
-
var pcbKeepoutProps =
|
|
2028
|
+
import { distance as distance25 } from "circuit-json";
|
|
2029
|
+
import { z as z83 } from "zod";
|
|
2030
|
+
var pcbKeepoutProps = z83.union([
|
|
1981
2031
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1982
|
-
shape:
|
|
1983
|
-
radius:
|
|
2032
|
+
shape: z83.literal("circle"),
|
|
2033
|
+
radius: distance25
|
|
1984
2034
|
}),
|
|
1985
2035
|
pcbLayoutProps.extend({
|
|
1986
|
-
shape:
|
|
1987
|
-
width:
|
|
1988
|
-
height:
|
|
2036
|
+
shape: z83.literal("rect"),
|
|
2037
|
+
width: distance25,
|
|
2038
|
+
height: distance25
|
|
1989
2039
|
})
|
|
1990
2040
|
]);
|
|
1991
2041
|
|
|
1992
2042
|
// lib/components/courtyard-rect.ts
|
|
1993
|
-
import { distance as
|
|
1994
|
-
import { z as
|
|
2043
|
+
import { distance as distance26 } from "circuit-json";
|
|
2044
|
+
import { z as z84 } from "zod";
|
|
1995
2045
|
var courtyardRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1996
|
-
width:
|
|
1997
|
-
height:
|
|
1998
|
-
strokeWidth:
|
|
1999
|
-
isFilled:
|
|
2000
|
-
hasStroke:
|
|
2001
|
-
isStrokeDashed:
|
|
2002
|
-
color:
|
|
2046
|
+
width: distance26,
|
|
2047
|
+
height: distance26,
|
|
2048
|
+
strokeWidth: distance26.optional(),
|
|
2049
|
+
isFilled: z84.boolean().optional(),
|
|
2050
|
+
hasStroke: z84.boolean().optional(),
|
|
2051
|
+
isStrokeDashed: z84.boolean().optional(),
|
|
2052
|
+
color: z84.string().optional()
|
|
2003
2053
|
});
|
|
2004
2054
|
|
|
2005
2055
|
// lib/components/courtyard-outline.ts
|
|
2006
2056
|
import { length as length6 } from "circuit-json";
|
|
2007
|
-
import { z as
|
|
2057
|
+
import { z as z85 } from "zod";
|
|
2008
2058
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
2009
2059
|
pcbLeftEdgeX: true,
|
|
2010
2060
|
pcbRightEdgeX: true,
|
|
@@ -2016,42 +2066,42 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
2016
2066
|
pcbOffsetY: true,
|
|
2017
2067
|
pcbRotation: true
|
|
2018
2068
|
}).extend({
|
|
2019
|
-
outline:
|
|
2069
|
+
outline: z85.array(point),
|
|
2020
2070
|
strokeWidth: length6.optional(),
|
|
2021
|
-
isClosed:
|
|
2022
|
-
isStrokeDashed:
|
|
2023
|
-
color:
|
|
2071
|
+
isClosed: z85.boolean().optional(),
|
|
2072
|
+
isStrokeDashed: z85.boolean().optional(),
|
|
2073
|
+
color: z85.string().optional()
|
|
2024
2074
|
});
|
|
2025
2075
|
|
|
2026
2076
|
// lib/components/copper-pour.ts
|
|
2027
|
-
import { z as
|
|
2077
|
+
import { z as z86 } from "zod";
|
|
2028
2078
|
import { layer_ref as layer_ref6 } from "circuit-json";
|
|
2029
|
-
var copperPourProps =
|
|
2030
|
-
name:
|
|
2079
|
+
var copperPourProps = z86.object({
|
|
2080
|
+
name: z86.string().optional(),
|
|
2031
2081
|
layer: layer_ref6,
|
|
2032
|
-
connectsTo:
|
|
2082
|
+
connectsTo: z86.string(),
|
|
2033
2083
|
padMargin: distance.optional(),
|
|
2034
2084
|
traceMargin: distance.optional(),
|
|
2035
2085
|
clearance: distance.optional(),
|
|
2036
2086
|
boardEdgeMargin: distance.optional(),
|
|
2037
2087
|
cutoutMargin: distance.optional(),
|
|
2038
|
-
outline:
|
|
2039
|
-
coveredWithSolderMask:
|
|
2088
|
+
outline: z86.array(point).optional(),
|
|
2089
|
+
coveredWithSolderMask: z86.boolean().optional().default(true)
|
|
2040
2090
|
});
|
|
2041
2091
|
expectTypesMatch(true);
|
|
2042
2092
|
|
|
2043
2093
|
// lib/components/cadassembly.ts
|
|
2044
2094
|
import { layer_ref as layer_ref7 } from "circuit-json";
|
|
2045
|
-
import { z as
|
|
2046
|
-
var cadassemblyProps =
|
|
2095
|
+
import { z as z87 } from "zod";
|
|
2096
|
+
var cadassemblyProps = z87.object({
|
|
2047
2097
|
originalLayer: layer_ref7.default("top").optional(),
|
|
2048
|
-
children:
|
|
2098
|
+
children: z87.any().optional()
|
|
2049
2099
|
});
|
|
2050
2100
|
expectTypesMatch(true);
|
|
2051
2101
|
|
|
2052
2102
|
// lib/components/cadmodel.ts
|
|
2053
|
-
import { z as
|
|
2054
|
-
var pcbPosition =
|
|
2103
|
+
import { z as z88 } from "zod";
|
|
2104
|
+
var pcbPosition = z88.object({
|
|
2055
2105
|
pcbX: pcbCoordinate.optional(),
|
|
2056
2106
|
pcbY: pcbCoordinate.optional(),
|
|
2057
2107
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -2063,12 +2113,12 @@ var pcbPosition = z87.object({
|
|
|
2063
2113
|
pcbZ: distance.optional()
|
|
2064
2114
|
});
|
|
2065
2115
|
var cadModelBaseWithUrl = cadModelBase.extend({
|
|
2066
|
-
modelUrl:
|
|
2067
|
-
stepUrl:
|
|
2116
|
+
modelUrl: z88.string(),
|
|
2117
|
+
stepUrl: z88.string().optional()
|
|
2068
2118
|
});
|
|
2069
2119
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
2070
2120
|
expectTypesMatch(true);
|
|
2071
|
-
var cadmodelProps =
|
|
2121
|
+
var cadmodelProps = z88.union([z88.null(), z88.string(), cadModelObject]);
|
|
2072
2122
|
|
|
2073
2123
|
// lib/components/power-source.ts
|
|
2074
2124
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -2078,9 +2128,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
2078
2128
|
|
|
2079
2129
|
// lib/components/voltagesource.ts
|
|
2080
2130
|
import { frequency as frequency4, rotation as rotation5, voltage as voltage4 } from "circuit-json";
|
|
2081
|
-
import { z as
|
|
2131
|
+
import { z as z89 } from "zod";
|
|
2082
2132
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
2083
|
-
var percentage =
|
|
2133
|
+
var percentage = z89.union([z89.string(), z89.number()]).transform((val) => {
|
|
2084
2134
|
if (typeof val === "string") {
|
|
2085
2135
|
if (val.endsWith("%")) {
|
|
2086
2136
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -2089,13 +2139,13 @@ var percentage = z88.union([z88.string(), z88.number()]).transform((val) => {
|
|
|
2089
2139
|
}
|
|
2090
2140
|
return val;
|
|
2091
2141
|
}).pipe(
|
|
2092
|
-
|
|
2142
|
+
z89.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2093
2143
|
);
|
|
2094
2144
|
var voltageSourceProps = commonComponentProps.extend({
|
|
2095
2145
|
voltage: voltage4.optional(),
|
|
2096
2146
|
frequency: frequency4.optional(),
|
|
2097
2147
|
peakToPeakVoltage: voltage4.optional(),
|
|
2098
|
-
waveShape:
|
|
2148
|
+
waveShape: z89.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
2099
2149
|
phase: rotation5.optional(),
|
|
2100
2150
|
dutyCycle: percentage.optional(),
|
|
2101
2151
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -2105,9 +2155,9 @@ expectTypesMatch(true);
|
|
|
2105
2155
|
|
|
2106
2156
|
// lib/components/currentsource.ts
|
|
2107
2157
|
import { frequency as frequency5, rotation as rotation6, current } from "circuit-json";
|
|
2108
|
-
import { z as
|
|
2158
|
+
import { z as z90 } from "zod";
|
|
2109
2159
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
2110
|
-
var percentage2 =
|
|
2160
|
+
var percentage2 = z90.union([z90.string(), z90.number()]).transform((val) => {
|
|
2111
2161
|
if (typeof val === "string") {
|
|
2112
2162
|
if (val.endsWith("%")) {
|
|
2113
2163
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -2116,13 +2166,13 @@ var percentage2 = z89.union([z89.string(), z89.number()]).transform((val) => {
|
|
|
2116
2166
|
}
|
|
2117
2167
|
return val;
|
|
2118
2168
|
}).pipe(
|
|
2119
|
-
|
|
2169
|
+
z90.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2120
2170
|
);
|
|
2121
2171
|
var currentSourceProps = commonComponentProps.extend({
|
|
2122
2172
|
current: current.optional(),
|
|
2123
2173
|
frequency: frequency5.optional(),
|
|
2124
2174
|
peakToPeakCurrent: current.optional(),
|
|
2125
|
-
waveShape:
|
|
2175
|
+
waveShape: z90.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
2126
2176
|
phase: rotation6.optional(),
|
|
2127
2177
|
dutyCycle: percentage2.optional(),
|
|
2128
2178
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
@@ -2131,57 +2181,57 @@ var currentSourcePins = lrPolarPins;
|
|
|
2131
2181
|
expectTypesMatch(true);
|
|
2132
2182
|
|
|
2133
2183
|
// lib/components/voltageprobe.ts
|
|
2134
|
-
import { z as
|
|
2184
|
+
import { z as z91 } from "zod";
|
|
2135
2185
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
2136
|
-
name:
|
|
2137
|
-
connectsTo:
|
|
2138
|
-
referenceTo:
|
|
2139
|
-
color:
|
|
2186
|
+
name: z91.string().optional(),
|
|
2187
|
+
connectsTo: z91.string(),
|
|
2188
|
+
referenceTo: z91.string().optional(),
|
|
2189
|
+
color: z91.string().optional()
|
|
2140
2190
|
});
|
|
2141
2191
|
expectTypesMatch(true);
|
|
2142
2192
|
|
|
2143
2193
|
// lib/components/schematic-arc.ts
|
|
2144
|
-
import { distance as
|
|
2145
|
-
import { z as
|
|
2146
|
-
var schematicArcProps =
|
|
2194
|
+
import { distance as distance27, point as point5, rotation as rotation7 } from "circuit-json";
|
|
2195
|
+
import { z as z92 } from "zod";
|
|
2196
|
+
var schematicArcProps = z92.object({
|
|
2147
2197
|
center: point5,
|
|
2148
|
-
radius:
|
|
2198
|
+
radius: distance27,
|
|
2149
2199
|
startAngleDegrees: rotation7,
|
|
2150
2200
|
endAngleDegrees: rotation7,
|
|
2151
|
-
direction:
|
|
2152
|
-
strokeWidth:
|
|
2153
|
-
color:
|
|
2154
|
-
isDashed:
|
|
2201
|
+
direction: z92.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
2202
|
+
strokeWidth: distance27.optional(),
|
|
2203
|
+
color: z92.string().optional(),
|
|
2204
|
+
isDashed: z92.boolean().optional().default(false)
|
|
2155
2205
|
});
|
|
2156
2206
|
expectTypesMatch(true);
|
|
2157
2207
|
|
|
2158
2208
|
// lib/components/toolingrail.ts
|
|
2159
|
-
import { z as
|
|
2160
|
-
var toolingrailProps =
|
|
2161
|
-
children:
|
|
2209
|
+
import { z as z93 } from "zod";
|
|
2210
|
+
var toolingrailProps = z93.object({
|
|
2211
|
+
children: z93.any().optional()
|
|
2162
2212
|
});
|
|
2163
2213
|
expectTypesMatch(true);
|
|
2164
2214
|
|
|
2165
2215
|
// lib/components/schematic-box.ts
|
|
2166
|
-
import { distance as
|
|
2167
|
-
import { z as
|
|
2168
|
-
var schematicBoxProps =
|
|
2169
|
-
schX:
|
|
2170
|
-
schY:
|
|
2171
|
-
width:
|
|
2172
|
-
height:
|
|
2173
|
-
overlay:
|
|
2174
|
-
padding:
|
|
2175
|
-
paddingLeft:
|
|
2176
|
-
paddingRight:
|
|
2177
|
-
paddingTop:
|
|
2178
|
-
paddingBottom:
|
|
2179
|
-
title:
|
|
2216
|
+
import { distance as distance28 } from "circuit-json";
|
|
2217
|
+
import { z as z94 } from "zod";
|
|
2218
|
+
var schematicBoxProps = z94.object({
|
|
2219
|
+
schX: distance28.optional(),
|
|
2220
|
+
schY: distance28.optional(),
|
|
2221
|
+
width: distance28.optional(),
|
|
2222
|
+
height: distance28.optional(),
|
|
2223
|
+
overlay: z94.array(z94.string()).optional(),
|
|
2224
|
+
padding: distance28.optional(),
|
|
2225
|
+
paddingLeft: distance28.optional(),
|
|
2226
|
+
paddingRight: distance28.optional(),
|
|
2227
|
+
paddingTop: distance28.optional(),
|
|
2228
|
+
paddingBottom: distance28.optional(),
|
|
2229
|
+
title: z94.string().optional(),
|
|
2180
2230
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
2181
|
-
titleColor:
|
|
2182
|
-
titleFontSize:
|
|
2183
|
-
titleInside:
|
|
2184
|
-
strokeStyle:
|
|
2231
|
+
titleColor: z94.string().optional(),
|
|
2232
|
+
titleFontSize: distance28.optional(),
|
|
2233
|
+
titleInside: z94.boolean().default(false),
|
|
2234
|
+
strokeStyle: z94.enum(["solid", "dashed"]).default("solid")
|
|
2185
2235
|
}).refine(
|
|
2186
2236
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
2187
2237
|
{
|
|
@@ -2196,60 +2246,60 @@ var schematicBoxProps = z93.object({
|
|
|
2196
2246
|
expectTypesMatch(true);
|
|
2197
2247
|
|
|
2198
2248
|
// lib/components/schematic-circle.ts
|
|
2199
|
-
import { distance as
|
|
2200
|
-
import { z as
|
|
2201
|
-
var schematicCircleProps =
|
|
2249
|
+
import { distance as distance29, point as point6 } from "circuit-json";
|
|
2250
|
+
import { z as z95 } from "zod";
|
|
2251
|
+
var schematicCircleProps = z95.object({
|
|
2202
2252
|
center: point6,
|
|
2203
|
-
radius:
|
|
2204
|
-
strokeWidth:
|
|
2205
|
-
color:
|
|
2206
|
-
isFilled:
|
|
2207
|
-
fillColor:
|
|
2208
|
-
isDashed:
|
|
2253
|
+
radius: distance29,
|
|
2254
|
+
strokeWidth: distance29.optional(),
|
|
2255
|
+
color: z95.string().optional(),
|
|
2256
|
+
isFilled: z95.boolean().optional().default(false),
|
|
2257
|
+
fillColor: z95.string().optional(),
|
|
2258
|
+
isDashed: z95.boolean().optional().default(false)
|
|
2209
2259
|
});
|
|
2210
2260
|
expectTypesMatch(
|
|
2211
2261
|
true
|
|
2212
2262
|
);
|
|
2213
2263
|
|
|
2214
2264
|
// lib/components/schematic-rect.ts
|
|
2215
|
-
import { distance as
|
|
2216
|
-
import { z as
|
|
2217
|
-
var schematicRectProps =
|
|
2218
|
-
schX:
|
|
2219
|
-
schY:
|
|
2220
|
-
width:
|
|
2221
|
-
height:
|
|
2265
|
+
import { distance as distance30, rotation as rotation8 } from "circuit-json";
|
|
2266
|
+
import { z as z96 } from "zod";
|
|
2267
|
+
var schematicRectProps = z96.object({
|
|
2268
|
+
schX: distance30.optional(),
|
|
2269
|
+
schY: distance30.optional(),
|
|
2270
|
+
width: distance30,
|
|
2271
|
+
height: distance30,
|
|
2222
2272
|
rotation: rotation8.default(0),
|
|
2223
|
-
strokeWidth:
|
|
2224
|
-
color:
|
|
2225
|
-
isFilled:
|
|
2226
|
-
fillColor:
|
|
2227
|
-
isDashed:
|
|
2228
|
-
cornerRadius:
|
|
2273
|
+
strokeWidth: distance30.optional(),
|
|
2274
|
+
color: z96.string().optional(),
|
|
2275
|
+
isFilled: z96.boolean().optional().default(false),
|
|
2276
|
+
fillColor: z96.string().optional(),
|
|
2277
|
+
isDashed: z96.boolean().optional().default(false),
|
|
2278
|
+
cornerRadius: distance30.optional()
|
|
2229
2279
|
});
|
|
2230
2280
|
expectTypesMatch(true);
|
|
2231
2281
|
|
|
2232
2282
|
// lib/components/schematic-line.ts
|
|
2233
|
-
import { distance as
|
|
2234
|
-
import { z as
|
|
2235
|
-
var schematicLineProps =
|
|
2236
|
-
x1:
|
|
2237
|
-
y1:
|
|
2238
|
-
x2:
|
|
2239
|
-
y2:
|
|
2240
|
-
strokeWidth:
|
|
2241
|
-
color:
|
|
2242
|
-
isDashed:
|
|
2283
|
+
import { distance as distance31 } from "circuit-json";
|
|
2284
|
+
import { z as z97 } from "zod";
|
|
2285
|
+
var schematicLineProps = z97.object({
|
|
2286
|
+
x1: distance31,
|
|
2287
|
+
y1: distance31,
|
|
2288
|
+
x2: distance31,
|
|
2289
|
+
y2: distance31,
|
|
2290
|
+
strokeWidth: distance31.optional(),
|
|
2291
|
+
color: z97.string().optional(),
|
|
2292
|
+
isDashed: z97.boolean().optional().default(false)
|
|
2243
2293
|
});
|
|
2244
2294
|
expectTypesMatch(true);
|
|
2245
2295
|
|
|
2246
2296
|
// lib/components/schematic-text.ts
|
|
2247
|
-
import { distance as
|
|
2248
|
-
import { z as
|
|
2297
|
+
import { distance as distance32, rotation as rotation9 } from "circuit-json";
|
|
2298
|
+
import { z as z99 } from "zod";
|
|
2249
2299
|
|
|
2250
2300
|
// lib/common/fivePointAnchor.ts
|
|
2251
|
-
import { z as
|
|
2252
|
-
var fivePointAnchor =
|
|
2301
|
+
import { z as z98 } from "zod";
|
|
2302
|
+
var fivePointAnchor = z98.enum([
|
|
2253
2303
|
"center",
|
|
2254
2304
|
"left",
|
|
2255
2305
|
"right",
|
|
@@ -2258,101 +2308,101 @@ var fivePointAnchor = z97.enum([
|
|
|
2258
2308
|
]);
|
|
2259
2309
|
|
|
2260
2310
|
// lib/components/schematic-text.ts
|
|
2261
|
-
var schematicTextProps =
|
|
2262
|
-
schX:
|
|
2263
|
-
schY:
|
|
2264
|
-
text:
|
|
2265
|
-
fontSize:
|
|
2266
|
-
anchor:
|
|
2267
|
-
color:
|
|
2311
|
+
var schematicTextProps = z99.object({
|
|
2312
|
+
schX: distance32.optional(),
|
|
2313
|
+
schY: distance32.optional(),
|
|
2314
|
+
text: z99.string(),
|
|
2315
|
+
fontSize: z99.number().default(1),
|
|
2316
|
+
anchor: z99.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
2317
|
+
color: z99.string().default("#000000"),
|
|
2268
2318
|
schRotation: rotation9.default(0)
|
|
2269
2319
|
});
|
|
2270
2320
|
expectTypesMatch(true);
|
|
2271
2321
|
|
|
2272
2322
|
// lib/components/schematic-path.ts
|
|
2273
2323
|
import { point as point8 } from "circuit-json";
|
|
2274
|
-
import { z as
|
|
2275
|
-
var schematicPathProps =
|
|
2276
|
-
points:
|
|
2277
|
-
isFilled:
|
|
2278
|
-
fillColor:
|
|
2324
|
+
import { z as z100 } from "zod";
|
|
2325
|
+
var schematicPathProps = z100.object({
|
|
2326
|
+
points: z100.array(point8),
|
|
2327
|
+
isFilled: z100.boolean().optional().default(false),
|
|
2328
|
+
fillColor: z100.enum(["red", "blue"]).optional()
|
|
2279
2329
|
});
|
|
2280
2330
|
expectTypesMatch(true);
|
|
2281
2331
|
|
|
2282
2332
|
// lib/components/schematic-table.ts
|
|
2283
|
-
import { distance as
|
|
2284
|
-
import { z as
|
|
2285
|
-
var schematicTableProps =
|
|
2286
|
-
schX:
|
|
2287
|
-
schY:
|
|
2288
|
-
children:
|
|
2289
|
-
cellPadding:
|
|
2290
|
-
borderWidth:
|
|
2333
|
+
import { distance as distance33 } from "circuit-json";
|
|
2334
|
+
import { z as z101 } from "zod";
|
|
2335
|
+
var schematicTableProps = z101.object({
|
|
2336
|
+
schX: distance33.optional(),
|
|
2337
|
+
schY: distance33.optional(),
|
|
2338
|
+
children: z101.any().optional(),
|
|
2339
|
+
cellPadding: distance33.optional(),
|
|
2340
|
+
borderWidth: distance33.optional(),
|
|
2291
2341
|
anchor: ninePointAnchor.optional(),
|
|
2292
|
-
fontSize:
|
|
2342
|
+
fontSize: distance33.optional()
|
|
2293
2343
|
});
|
|
2294
2344
|
expectTypesMatch(true);
|
|
2295
2345
|
|
|
2296
2346
|
// lib/components/schematic-row.ts
|
|
2297
|
-
import { distance as
|
|
2298
|
-
import { z as
|
|
2299
|
-
var schematicRowProps =
|
|
2300
|
-
children:
|
|
2301
|
-
height:
|
|
2347
|
+
import { distance as distance34 } from "circuit-json";
|
|
2348
|
+
import { z as z102 } from "zod";
|
|
2349
|
+
var schematicRowProps = z102.object({
|
|
2350
|
+
children: z102.any().optional(),
|
|
2351
|
+
height: distance34.optional()
|
|
2302
2352
|
});
|
|
2303
2353
|
expectTypesMatch(true);
|
|
2304
2354
|
|
|
2305
2355
|
// lib/components/schematic-cell.ts
|
|
2306
|
-
import { distance as
|
|
2307
|
-
import { z as
|
|
2308
|
-
var schematicCellProps =
|
|
2309
|
-
children:
|
|
2310
|
-
horizontalAlign:
|
|
2311
|
-
verticalAlign:
|
|
2312
|
-
fontSize:
|
|
2313
|
-
rowSpan:
|
|
2314
|
-
colSpan:
|
|
2315
|
-
width:
|
|
2316
|
-
text:
|
|
2356
|
+
import { distance as distance35 } from "circuit-json";
|
|
2357
|
+
import { z as z103 } from "zod";
|
|
2358
|
+
var schematicCellProps = z103.object({
|
|
2359
|
+
children: z103.string().optional(),
|
|
2360
|
+
horizontalAlign: z103.enum(["left", "center", "right"]).optional(),
|
|
2361
|
+
verticalAlign: z103.enum(["top", "middle", "bottom"]).optional(),
|
|
2362
|
+
fontSize: distance35.optional(),
|
|
2363
|
+
rowSpan: z103.number().optional(),
|
|
2364
|
+
colSpan: z103.number().optional(),
|
|
2365
|
+
width: distance35.optional(),
|
|
2366
|
+
text: z103.string().optional()
|
|
2317
2367
|
});
|
|
2318
2368
|
expectTypesMatch(true);
|
|
2319
2369
|
|
|
2320
2370
|
// lib/components/copper-text.ts
|
|
2321
2371
|
import { layer_ref as layer_ref8, length as length7 } from "circuit-json";
|
|
2322
|
-
import { z as
|
|
2372
|
+
import { z as z104 } from "zod";
|
|
2323
2373
|
var copperTextProps = pcbLayoutProps.extend({
|
|
2324
|
-
text:
|
|
2374
|
+
text: z104.string(),
|
|
2325
2375
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2326
|
-
font:
|
|
2376
|
+
font: z104.enum(["tscircuit2024"]).optional(),
|
|
2327
2377
|
fontSize: length7.optional(),
|
|
2328
|
-
layers:
|
|
2329
|
-
knockout:
|
|
2330
|
-
mirrored:
|
|
2378
|
+
layers: z104.array(layer_ref8).optional(),
|
|
2379
|
+
knockout: z104.boolean().optional(),
|
|
2380
|
+
mirrored: z104.boolean().optional()
|
|
2331
2381
|
});
|
|
2332
2382
|
|
|
2333
2383
|
// lib/components/silkscreen-text.ts
|
|
2334
2384
|
import { layer_ref as layer_ref9, length as length8 } from "circuit-json";
|
|
2335
|
-
import { z as
|
|
2385
|
+
import { z as z105 } from "zod";
|
|
2336
2386
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
2337
|
-
text:
|
|
2387
|
+
text: z105.string(),
|
|
2338
2388
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2339
|
-
font:
|
|
2389
|
+
font: z105.enum(["tscircuit2024"]).optional(),
|
|
2340
2390
|
fontSize: length8.optional(),
|
|
2341
2391
|
/**
|
|
2342
2392
|
* If true, text will knock out underlying silkscreen
|
|
2343
2393
|
*/
|
|
2344
|
-
isKnockout:
|
|
2394
|
+
isKnockout: z105.boolean().optional(),
|
|
2345
2395
|
knockoutPadding: length8.optional(),
|
|
2346
2396
|
knockoutPaddingLeft: length8.optional(),
|
|
2347
2397
|
knockoutPaddingRight: length8.optional(),
|
|
2348
2398
|
knockoutPaddingTop: length8.optional(),
|
|
2349
2399
|
knockoutPaddingBottom: length8.optional(),
|
|
2350
|
-
layers:
|
|
2400
|
+
layers: z105.array(layer_ref9).optional()
|
|
2351
2401
|
});
|
|
2352
2402
|
|
|
2353
2403
|
// lib/components/silkscreen-path.ts
|
|
2354
2404
|
import { length as length9, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
2355
|
-
import { z as
|
|
2405
|
+
import { z as z106 } from "zod";
|
|
2356
2406
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
2357
2407
|
pcbLeftEdgeX: true,
|
|
2358
2408
|
pcbRightEdgeX: true,
|
|
@@ -2364,12 +2414,12 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
2364
2414
|
pcbOffsetY: true,
|
|
2365
2415
|
pcbRotation: true
|
|
2366
2416
|
}).extend({
|
|
2367
|
-
route:
|
|
2417
|
+
route: z106.array(route_hint_point5),
|
|
2368
2418
|
strokeWidth: length9.optional()
|
|
2369
2419
|
});
|
|
2370
2420
|
|
|
2371
2421
|
// lib/components/silkscreen-line.ts
|
|
2372
|
-
import { distance as
|
|
2422
|
+
import { distance as distance36 } from "circuit-json";
|
|
2373
2423
|
var silkscreenLineProps = pcbLayoutProps.omit({
|
|
2374
2424
|
pcbX: true,
|
|
2375
2425
|
pcbY: true,
|
|
@@ -2377,88 +2427,88 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
2377
2427
|
pcbOffsetY: true,
|
|
2378
2428
|
pcbRotation: true
|
|
2379
2429
|
}).extend({
|
|
2380
|
-
strokeWidth:
|
|
2381
|
-
x1:
|
|
2382
|
-
y1:
|
|
2383
|
-
x2:
|
|
2384
|
-
y2:
|
|
2430
|
+
strokeWidth: distance36,
|
|
2431
|
+
x1: distance36,
|
|
2432
|
+
y1: distance36,
|
|
2433
|
+
x2: distance36,
|
|
2434
|
+
y2: distance36
|
|
2385
2435
|
});
|
|
2386
2436
|
|
|
2387
2437
|
// lib/components/silkscreen-rect.ts
|
|
2388
|
-
import { distance as
|
|
2389
|
-
import { z as
|
|
2438
|
+
import { distance as distance37 } from "circuit-json";
|
|
2439
|
+
import { z as z107 } from "zod";
|
|
2390
2440
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2391
|
-
filled:
|
|
2392
|
-
stroke:
|
|
2393
|
-
strokeWidth:
|
|
2394
|
-
width:
|
|
2395
|
-
height:
|
|
2396
|
-
cornerRadius:
|
|
2441
|
+
filled: z107.boolean().default(true).optional(),
|
|
2442
|
+
stroke: z107.enum(["dashed", "solid", "none"]).optional(),
|
|
2443
|
+
strokeWidth: distance37.optional(),
|
|
2444
|
+
width: distance37,
|
|
2445
|
+
height: distance37,
|
|
2446
|
+
cornerRadius: distance37.optional()
|
|
2397
2447
|
});
|
|
2398
2448
|
|
|
2399
2449
|
// lib/components/silkscreen-circle.ts
|
|
2400
|
-
import { distance as
|
|
2401
|
-
import { z as
|
|
2450
|
+
import { distance as distance38 } from "circuit-json";
|
|
2451
|
+
import { z as z108 } from "zod";
|
|
2402
2452
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2403
|
-
isFilled:
|
|
2404
|
-
isOutline:
|
|
2405
|
-
strokeWidth:
|
|
2406
|
-
radius:
|
|
2453
|
+
isFilled: z108.boolean().optional(),
|
|
2454
|
+
isOutline: z108.boolean().optional(),
|
|
2455
|
+
strokeWidth: distance38.optional(),
|
|
2456
|
+
radius: distance38
|
|
2407
2457
|
});
|
|
2408
2458
|
|
|
2409
2459
|
// lib/components/trace-hint.ts
|
|
2410
|
-
import { distance as
|
|
2411
|
-
import { z as
|
|
2412
|
-
var routeHintPointProps =
|
|
2413
|
-
x:
|
|
2414
|
-
y:
|
|
2415
|
-
via:
|
|
2460
|
+
import { distance as distance39, layer_ref as layer_ref10, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
2461
|
+
import { z as z109 } from "zod";
|
|
2462
|
+
var routeHintPointProps = z109.object({
|
|
2463
|
+
x: distance39,
|
|
2464
|
+
y: distance39,
|
|
2465
|
+
via: z109.boolean().optional(),
|
|
2416
2466
|
toLayer: layer_ref10.optional()
|
|
2417
2467
|
});
|
|
2418
|
-
var traceHintProps =
|
|
2419
|
-
for:
|
|
2468
|
+
var traceHintProps = z109.object({
|
|
2469
|
+
for: z109.string().optional().describe(
|
|
2420
2470
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
2421
2471
|
),
|
|
2422
|
-
order:
|
|
2472
|
+
order: z109.number().optional(),
|
|
2423
2473
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
2424
|
-
offsets:
|
|
2425
|
-
traceWidth:
|
|
2474
|
+
offsets: z109.array(route_hint_point6).or(z109.array(routeHintPointProps)).optional(),
|
|
2475
|
+
traceWidth: z109.number().optional()
|
|
2426
2476
|
});
|
|
2427
2477
|
|
|
2428
2478
|
// lib/components/port.ts
|
|
2429
|
-
import { z as
|
|
2479
|
+
import { z as z110 } from "zod";
|
|
2430
2480
|
var portProps = commonLayoutProps.extend({
|
|
2431
|
-
name:
|
|
2432
|
-
pinNumber:
|
|
2433
|
-
aliases:
|
|
2481
|
+
name: z110.string(),
|
|
2482
|
+
pinNumber: z110.number().optional(),
|
|
2483
|
+
aliases: z110.array(z110.string()).optional(),
|
|
2434
2484
|
direction,
|
|
2435
|
-
connectsTo:
|
|
2485
|
+
connectsTo: z110.string().or(z110.array(z110.string())).optional()
|
|
2436
2486
|
});
|
|
2437
2487
|
|
|
2438
2488
|
// lib/components/pcb-note-text.ts
|
|
2439
2489
|
import { length as length10 } from "circuit-json";
|
|
2440
|
-
import { z as
|
|
2490
|
+
import { z as z111 } from "zod";
|
|
2441
2491
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
2442
|
-
text:
|
|
2443
|
-
anchorAlignment:
|
|
2444
|
-
font:
|
|
2492
|
+
text: z111.string(),
|
|
2493
|
+
anchorAlignment: z111.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2494
|
+
font: z111.enum(["tscircuit2024"]).optional(),
|
|
2445
2495
|
fontSize: length10.optional(),
|
|
2446
|
-
color:
|
|
2496
|
+
color: z111.string().optional()
|
|
2447
2497
|
});
|
|
2448
2498
|
expectTypesMatch(true);
|
|
2449
2499
|
|
|
2450
2500
|
// lib/components/pcb-note-rect.ts
|
|
2451
|
-
import { distance as
|
|
2452
|
-
import { z as
|
|
2501
|
+
import { distance as distance40 } from "circuit-json";
|
|
2502
|
+
import { z as z112 } from "zod";
|
|
2453
2503
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2454
|
-
width:
|
|
2455
|
-
height:
|
|
2456
|
-
strokeWidth:
|
|
2457
|
-
isFilled:
|
|
2458
|
-
hasStroke:
|
|
2459
|
-
isStrokeDashed:
|
|
2460
|
-
color:
|
|
2461
|
-
cornerRadius:
|
|
2504
|
+
width: distance40,
|
|
2505
|
+
height: distance40,
|
|
2506
|
+
strokeWidth: distance40.optional(),
|
|
2507
|
+
isFilled: z112.boolean().optional(),
|
|
2508
|
+
hasStroke: z112.boolean().optional(),
|
|
2509
|
+
isStrokeDashed: z112.boolean().optional(),
|
|
2510
|
+
color: z112.string().optional(),
|
|
2511
|
+
cornerRadius: distance40.optional()
|
|
2462
2512
|
});
|
|
2463
2513
|
expectTypesMatch(true);
|
|
2464
2514
|
|
|
@@ -2467,7 +2517,7 @@ import {
|
|
|
2467
2517
|
length as length11,
|
|
2468
2518
|
route_hint_point as route_hint_point7
|
|
2469
2519
|
} from "circuit-json";
|
|
2470
|
-
import { z as
|
|
2520
|
+
import { z as z113 } from "zod";
|
|
2471
2521
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
2472
2522
|
pcbLeftEdgeX: true,
|
|
2473
2523
|
pcbRightEdgeX: true,
|
|
@@ -2479,15 +2529,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
2479
2529
|
pcbOffsetY: true,
|
|
2480
2530
|
pcbRotation: true
|
|
2481
2531
|
}).extend({
|
|
2482
|
-
route:
|
|
2532
|
+
route: z113.array(route_hint_point7),
|
|
2483
2533
|
strokeWidth: length11.optional(),
|
|
2484
|
-
color:
|
|
2534
|
+
color: z113.string().optional()
|
|
2485
2535
|
});
|
|
2486
2536
|
expectTypesMatch(true);
|
|
2487
2537
|
|
|
2488
2538
|
// lib/components/pcb-note-line.ts
|
|
2489
|
-
import { distance as
|
|
2490
|
-
import { z as
|
|
2539
|
+
import { distance as distance41 } from "circuit-json";
|
|
2540
|
+
import { z as z114 } from "zod";
|
|
2491
2541
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
2492
2542
|
pcbLeftEdgeX: true,
|
|
2493
2543
|
pcbRightEdgeX: true,
|
|
@@ -2499,20 +2549,20 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
2499
2549
|
pcbOffsetY: true,
|
|
2500
2550
|
pcbRotation: true
|
|
2501
2551
|
}).extend({
|
|
2502
|
-
x1:
|
|
2503
|
-
y1:
|
|
2504
|
-
x2:
|
|
2505
|
-
y2:
|
|
2506
|
-
strokeWidth:
|
|
2507
|
-
color:
|
|
2508
|
-
isDashed:
|
|
2552
|
+
x1: distance41,
|
|
2553
|
+
y1: distance41,
|
|
2554
|
+
x2: distance41,
|
|
2555
|
+
y2: distance41,
|
|
2556
|
+
strokeWidth: distance41.optional(),
|
|
2557
|
+
color: z114.string().optional(),
|
|
2558
|
+
isDashed: z114.boolean().optional()
|
|
2509
2559
|
});
|
|
2510
2560
|
expectTypesMatch(true);
|
|
2511
2561
|
|
|
2512
2562
|
// lib/components/pcb-note-dimension.ts
|
|
2513
|
-
import { distance as
|
|
2514
|
-
import { z as
|
|
2515
|
-
var dimensionTarget2 =
|
|
2563
|
+
import { distance as distance42, length as length12 } from "circuit-json";
|
|
2564
|
+
import { z as z115 } from "zod";
|
|
2565
|
+
var dimensionTarget2 = z115.union([z115.string(), point]);
|
|
2516
2566
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
2517
2567
|
pcbLeftEdgeX: true,
|
|
2518
2568
|
pcbRightEdgeX: true,
|
|
@@ -2526,93 +2576,93 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
2526
2576
|
}).extend({
|
|
2527
2577
|
from: dimensionTarget2,
|
|
2528
2578
|
to: dimensionTarget2,
|
|
2529
|
-
text:
|
|
2530
|
-
offset:
|
|
2531
|
-
font:
|
|
2579
|
+
text: z115.string().optional(),
|
|
2580
|
+
offset: distance42.optional(),
|
|
2581
|
+
font: z115.enum(["tscircuit2024"]).optional(),
|
|
2532
2582
|
fontSize: length12.optional(),
|
|
2533
|
-
color:
|
|
2534
|
-
arrowSize:
|
|
2535
|
-
units:
|
|
2536
|
-
outerEdgeToEdge:
|
|
2537
|
-
centerToCenter:
|
|
2538
|
-
innerEdgeToEdge:
|
|
2583
|
+
color: z115.string().optional(),
|
|
2584
|
+
arrowSize: distance42.optional(),
|
|
2585
|
+
units: z115.enum(["in", "mm"]).optional(),
|
|
2586
|
+
outerEdgeToEdge: z115.literal(true).optional(),
|
|
2587
|
+
centerToCenter: z115.literal(true).optional(),
|
|
2588
|
+
innerEdgeToEdge: z115.literal(true).optional()
|
|
2539
2589
|
});
|
|
2540
2590
|
expectTypesMatch(
|
|
2541
2591
|
true
|
|
2542
2592
|
);
|
|
2543
2593
|
|
|
2544
2594
|
// lib/platformConfig.ts
|
|
2545
|
-
import { z as
|
|
2546
|
-
var unvalidatedCircuitJson =
|
|
2547
|
-
var footprintLibraryResult =
|
|
2548
|
-
footprintCircuitJson:
|
|
2595
|
+
import { z as z116 } from "zod";
|
|
2596
|
+
var unvalidatedCircuitJson = z116.array(z116.any()).describe("Circuit JSON");
|
|
2597
|
+
var footprintLibraryResult = z116.object({
|
|
2598
|
+
footprintCircuitJson: z116.array(z116.any()),
|
|
2549
2599
|
cadModel: cadModelProp.optional()
|
|
2550
2600
|
});
|
|
2551
|
-
var pathToCircuitJsonFn =
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
).returns(
|
|
2601
|
+
var pathToCircuitJsonFn = z116.function().args(z116.string()).returns(z116.promise(footprintLibraryResult)).or(
|
|
2602
|
+
z116.function().args(
|
|
2603
|
+
z116.string(),
|
|
2604
|
+
z116.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
2605
|
+
).returns(z116.promise(footprintLibraryResult))
|
|
2556
2606
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
2557
|
-
var footprintFileParserEntry =
|
|
2558
|
-
loadFromUrl:
|
|
2607
|
+
var footprintFileParserEntry = z116.object({
|
|
2608
|
+
loadFromUrl: z116.function().args(z116.string()).returns(z116.promise(footprintLibraryResult)).describe(
|
|
2559
2609
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
2560
2610
|
)
|
|
2561
2611
|
});
|
|
2562
|
-
var spiceEngineSimulationResult =
|
|
2563
|
-
engineVersionString:
|
|
2612
|
+
var spiceEngineSimulationResult = z116.object({
|
|
2613
|
+
engineVersionString: z116.string().optional(),
|
|
2564
2614
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
2565
2615
|
});
|
|
2566
|
-
var spiceEngineZod =
|
|
2567
|
-
simulate:
|
|
2616
|
+
var spiceEngineZod = z116.object({
|
|
2617
|
+
simulate: z116.function().args(z116.string()).returns(z116.promise(spiceEngineSimulationResult)).describe(
|
|
2568
2618
|
"A function that takes a SPICE string and returns a simulation result"
|
|
2569
2619
|
)
|
|
2570
2620
|
});
|
|
2571
|
-
var defaultSpiceEngine =
|
|
2621
|
+
var defaultSpiceEngine = z116.custom(
|
|
2572
2622
|
(value) => typeof value === "string"
|
|
2573
2623
|
);
|
|
2574
|
-
var autorouterInstance =
|
|
2575
|
-
run:
|
|
2576
|
-
getOutputSimpleRouteJson:
|
|
2624
|
+
var autorouterInstance = z116.object({
|
|
2625
|
+
run: z116.function().args().returns(z116.promise(z116.unknown())).describe("Run the autorouter"),
|
|
2626
|
+
getOutputSimpleRouteJson: z116.function().args().returns(z116.promise(z116.any())).describe("Get the resulting SimpleRouteJson")
|
|
2577
2627
|
});
|
|
2578
|
-
var autorouterDefinition =
|
|
2579
|
-
createAutorouter:
|
|
2628
|
+
var autorouterDefinition = z116.object({
|
|
2629
|
+
createAutorouter: z116.function().args(z116.any(), z116.any().optional()).returns(z116.union([autorouterInstance, z116.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
2580
2630
|
});
|
|
2581
|
-
var platformConfig =
|
|
2631
|
+
var platformConfig = z116.object({
|
|
2582
2632
|
partsEngine: partsEngine.optional(),
|
|
2583
2633
|
autorouter: autorouterProp.optional(),
|
|
2584
|
-
autorouterMap:
|
|
2585
|
-
registryApiUrl:
|
|
2586
|
-
cloudAutorouterUrl:
|
|
2587
|
-
projectName:
|
|
2588
|
-
projectBaseUrl:
|
|
2589
|
-
version:
|
|
2590
|
-
url:
|
|
2591
|
-
printBoardInformationToSilkscreen:
|
|
2592
|
-
includeBoardFiles:
|
|
2634
|
+
autorouterMap: z116.record(z116.string(), autorouterDefinition).optional(),
|
|
2635
|
+
registryApiUrl: z116.string().optional(),
|
|
2636
|
+
cloudAutorouterUrl: z116.string().optional(),
|
|
2637
|
+
projectName: z116.string().optional(),
|
|
2638
|
+
projectBaseUrl: z116.string().optional(),
|
|
2639
|
+
version: z116.string().optional(),
|
|
2640
|
+
url: z116.string().optional(),
|
|
2641
|
+
printBoardInformationToSilkscreen: z116.boolean().optional(),
|
|
2642
|
+
includeBoardFiles: z116.array(z116.string()).describe(
|
|
2593
2643
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
2594
2644
|
).optional(),
|
|
2595
|
-
snapshotsDir:
|
|
2645
|
+
snapshotsDir: z116.string().describe(
|
|
2596
2646
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
2597
2647
|
).optional(),
|
|
2598
2648
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
2599
|
-
localCacheEngine:
|
|
2600
|
-
pcbDisabled:
|
|
2601
|
-
schematicDisabled:
|
|
2602
|
-
partsEngineDisabled:
|
|
2603
|
-
spiceEngineMap:
|
|
2604
|
-
footprintLibraryMap:
|
|
2605
|
-
|
|
2606
|
-
|
|
2649
|
+
localCacheEngine: z116.any().optional(),
|
|
2650
|
+
pcbDisabled: z116.boolean().optional(),
|
|
2651
|
+
schematicDisabled: z116.boolean().optional(),
|
|
2652
|
+
partsEngineDisabled: z116.boolean().optional(),
|
|
2653
|
+
spiceEngineMap: z116.record(z116.string(), spiceEngineZod).optional(),
|
|
2654
|
+
footprintLibraryMap: z116.record(
|
|
2655
|
+
z116.string(),
|
|
2656
|
+
z116.union([
|
|
2607
2657
|
pathToCircuitJsonFn,
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2658
|
+
z116.record(
|
|
2659
|
+
z116.string(),
|
|
2660
|
+
z116.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
2611
2661
|
)
|
|
2612
2662
|
])
|
|
2613
2663
|
).optional(),
|
|
2614
|
-
footprintFileParserMap:
|
|
2615
|
-
resolveProjectStaticFileImportUrl:
|
|
2664
|
+
footprintFileParserMap: z116.record(z116.string(), footprintFileParserEntry).optional(),
|
|
2665
|
+
resolveProjectStaticFileImportUrl: z116.function().args(z116.string()).returns(z116.promise(z116.string())).describe(
|
|
2616
2666
|
"A function that returns a string URL for static files for the project"
|
|
2617
2667
|
).optional()
|
|
2618
2668
|
});
|
|
@@ -2718,6 +2768,12 @@ export {
|
|
|
2718
2768
|
kicadFootprintPad,
|
|
2719
2769
|
kicadFootprintProperties,
|
|
2720
2770
|
kicadProperty,
|
|
2771
|
+
kicadSymbolEffects,
|
|
2772
|
+
kicadSymbolMetadata,
|
|
2773
|
+
kicadSymbolPinNames,
|
|
2774
|
+
kicadSymbolPinNumbers,
|
|
2775
|
+
kicadSymbolProperties,
|
|
2776
|
+
kicadSymbolProperty,
|
|
2721
2777
|
layoutConfig,
|
|
2722
2778
|
ledPins,
|
|
2723
2779
|
ledProps,
|