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