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