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