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