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