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