@tscircuit/props 0.0.536 → 0.0.538
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 +12 -0
- package/dist/index.d.ts +58 -3
- package/dist/index.js +773 -757
- package/dist/index.js.map +1 -1
- package/lib/components/drc-check.ts +16 -0
- package/lib/customDrc.ts +78 -0
- package/lib/generated/jlcpcb-autocomplete.ts +2 -3
- package/lib/index.ts +2 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -16054,9 +16054,15 @@ var kicadPinMetadata = z22.object({
|
|
|
16054
16054
|
});
|
|
16055
16055
|
expectTypesMatch(true);
|
|
16056
16056
|
|
|
16057
|
-
// lib/
|
|
16057
|
+
// lib/customDrc.ts
|
|
16058
16058
|
import { z as z23 } from "zod";
|
|
16059
|
-
var
|
|
16059
|
+
var customDrcCheckFn = z23.custom(
|
|
16060
|
+
(value) => typeof value === "function"
|
|
16061
|
+
);
|
|
16062
|
+
|
|
16063
|
+
// lib/common/ninePointAnchor.ts
|
|
16064
|
+
import { z as z24 } from "zod";
|
|
16065
|
+
var ninePointAnchor = z24.enum([
|
|
16060
16066
|
"top_left",
|
|
16061
16067
|
"top_center",
|
|
16062
16068
|
"top_right",
|
|
@@ -16069,47 +16075,47 @@ var ninePointAnchor = z23.enum([
|
|
|
16069
16075
|
]);
|
|
16070
16076
|
|
|
16071
16077
|
// lib/components/board.ts
|
|
16072
|
-
import { z as
|
|
16078
|
+
import { z as z38 } from "zod";
|
|
16073
16079
|
|
|
16074
16080
|
// lib/components/group.ts
|
|
16075
16081
|
import {
|
|
16076
16082
|
length as length3,
|
|
16077
16083
|
distance as distance11
|
|
16078
16084
|
} from "circuit-json";
|
|
16079
|
-
import { z as
|
|
16085
|
+
import { z as z37 } from "zod";
|
|
16080
16086
|
|
|
16081
16087
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
16082
|
-
import { z as
|
|
16083
|
-
var base_manual_edit_event =
|
|
16084
|
-
edit_event_id:
|
|
16085
|
-
in_progress:
|
|
16086
|
-
created_at:
|
|
16088
|
+
import { z as z25 } from "zod";
|
|
16089
|
+
var base_manual_edit_event = z25.object({
|
|
16090
|
+
edit_event_id: z25.string(),
|
|
16091
|
+
in_progress: z25.boolean().optional(),
|
|
16092
|
+
created_at: z25.number()
|
|
16087
16093
|
});
|
|
16088
16094
|
expectTypesMatch(
|
|
16089
16095
|
true
|
|
16090
16096
|
);
|
|
16091
16097
|
|
|
16092
16098
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
16093
|
-
import { z as
|
|
16099
|
+
import { z as z26 } from "zod";
|
|
16094
16100
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
16095
|
-
pcb_edit_event_type:
|
|
16096
|
-
edit_event_type:
|
|
16097
|
-
pcb_component_id:
|
|
16098
|
-
original_center:
|
|
16099
|
-
new_center:
|
|
16101
|
+
pcb_edit_event_type: z26.literal("edit_component_location").describe("deprecated"),
|
|
16102
|
+
edit_event_type: z26.literal("edit_pcb_component_location"),
|
|
16103
|
+
pcb_component_id: z26.string(),
|
|
16104
|
+
original_center: z26.object({ x: z26.number(), y: z26.number() }),
|
|
16105
|
+
new_center: z26.object({ x: z26.number(), y: z26.number() })
|
|
16100
16106
|
});
|
|
16101
16107
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
16102
16108
|
expectTypesMatch(true);
|
|
16103
16109
|
|
|
16104
16110
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
16105
|
-
import { z as
|
|
16111
|
+
import { z as z27 } from "zod";
|
|
16106
16112
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
16107
|
-
pcb_edit_event_type:
|
|
16108
|
-
edit_event_type:
|
|
16109
|
-
pcb_port_id:
|
|
16110
|
-
pcb_trace_hint_id:
|
|
16111
|
-
route:
|
|
16112
|
-
|
|
16113
|
+
pcb_edit_event_type: z27.literal("edit_trace_hint").describe("deprecated"),
|
|
16114
|
+
edit_event_type: z27.literal("edit_pcb_trace_hint").optional(),
|
|
16115
|
+
pcb_port_id: z27.string(),
|
|
16116
|
+
pcb_trace_hint_id: z27.string().optional(),
|
|
16117
|
+
route: z27.array(
|
|
16118
|
+
z27.object({ x: z27.number(), y: z27.number(), via: z27.boolean().optional() })
|
|
16113
16119
|
)
|
|
16114
16120
|
});
|
|
16115
16121
|
expectTypesMatch(
|
|
@@ -16117,38 +16123,38 @@ expectTypesMatch(
|
|
|
16117
16123
|
);
|
|
16118
16124
|
|
|
16119
16125
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
16120
|
-
import { z as
|
|
16126
|
+
import { z as z28 } from "zod";
|
|
16121
16127
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
16122
|
-
edit_event_type:
|
|
16123
|
-
schematic_component_id:
|
|
16124
|
-
original_center:
|
|
16125
|
-
new_center:
|
|
16128
|
+
edit_event_type: z28.literal("edit_schematic_component_location"),
|
|
16129
|
+
schematic_component_id: z28.string(),
|
|
16130
|
+
original_center: z28.object({ x: z28.number(), y: z28.number() }),
|
|
16131
|
+
new_center: z28.object({ x: z28.number(), y: z28.number() })
|
|
16126
16132
|
});
|
|
16127
16133
|
expectTypesMatch(true);
|
|
16128
16134
|
|
|
16129
16135
|
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
16130
|
-
import { z as
|
|
16136
|
+
import { z as z29 } from "zod";
|
|
16131
16137
|
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
16132
|
-
edit_event_type:
|
|
16133
|
-
pcb_group_id:
|
|
16134
|
-
original_center:
|
|
16135
|
-
new_center:
|
|
16138
|
+
edit_event_type: z29.literal("edit_pcb_group_location"),
|
|
16139
|
+
pcb_group_id: z29.string(),
|
|
16140
|
+
original_center: z29.object({ x: z29.number(), y: z29.number() }),
|
|
16141
|
+
new_center: z29.object({ x: z29.number(), y: z29.number() })
|
|
16136
16142
|
});
|
|
16137
16143
|
expectTypesMatch(true);
|
|
16138
16144
|
|
|
16139
16145
|
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
16140
|
-
import { z as
|
|
16146
|
+
import { z as z30 } from "zod";
|
|
16141
16147
|
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
16142
|
-
edit_event_type:
|
|
16143
|
-
schematic_group_id:
|
|
16144
|
-
original_center:
|
|
16145
|
-
new_center:
|
|
16148
|
+
edit_event_type: z30.literal("edit_schematic_group_location"),
|
|
16149
|
+
schematic_group_id: z30.string(),
|
|
16150
|
+
original_center: z30.object({ x: z30.number(), y: z30.number() }),
|
|
16151
|
+
new_center: z30.object({ x: z30.number(), y: z30.number() })
|
|
16146
16152
|
});
|
|
16147
16153
|
expectTypesMatch(true);
|
|
16148
16154
|
|
|
16149
16155
|
// lib/manual-edits/manual_edit_event.ts
|
|
16150
|
-
import { z as
|
|
16151
|
-
var manual_edit_event =
|
|
16156
|
+
import { z as z31 } from "zod";
|
|
16157
|
+
var manual_edit_event = z31.union([
|
|
16152
16158
|
edit_pcb_component_location_event,
|
|
16153
16159
|
edit_trace_hint_event,
|
|
16154
16160
|
edit_schematic_component_location_event
|
|
@@ -16156,33 +16162,33 @@ var manual_edit_event = z30.union([
|
|
|
16156
16162
|
expectTypesMatch(true);
|
|
16157
16163
|
|
|
16158
16164
|
// lib/manual-edits/manual_edits_file.ts
|
|
16159
|
-
import { z as
|
|
16165
|
+
import { z as z35 } from "zod";
|
|
16160
16166
|
|
|
16161
16167
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
16162
|
-
import { z as
|
|
16168
|
+
import { z as z32 } from "zod";
|
|
16163
16169
|
import { point as point2 } from "circuit-json";
|
|
16164
|
-
var manual_pcb_placement =
|
|
16165
|
-
selector:
|
|
16166
|
-
relative_to:
|
|
16170
|
+
var manual_pcb_placement = z32.object({
|
|
16171
|
+
selector: z32.string(),
|
|
16172
|
+
relative_to: z32.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
16167
16173
|
center: point2
|
|
16168
16174
|
});
|
|
16169
16175
|
expectTypesMatch(true);
|
|
16170
16176
|
|
|
16171
16177
|
// lib/manual-edits/manual_trace_hint.ts
|
|
16172
|
-
import { z as
|
|
16178
|
+
import { z as z33 } from "zod";
|
|
16173
16179
|
import { route_hint_point } from "circuit-json";
|
|
16174
|
-
var manual_trace_hint =
|
|
16175
|
-
pcb_port_selector:
|
|
16176
|
-
offsets:
|
|
16180
|
+
var manual_trace_hint = z33.object({
|
|
16181
|
+
pcb_port_selector: z33.string(),
|
|
16182
|
+
offsets: z33.array(route_hint_point)
|
|
16177
16183
|
});
|
|
16178
16184
|
expectTypesMatch(true);
|
|
16179
16185
|
|
|
16180
16186
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
16181
|
-
import { z as
|
|
16187
|
+
import { z as z34 } from "zod";
|
|
16182
16188
|
import { point as point4 } from "circuit-json";
|
|
16183
|
-
var manual_schematic_placement =
|
|
16184
|
-
selector:
|
|
16185
|
-
relative_to:
|
|
16189
|
+
var manual_schematic_placement = z34.object({
|
|
16190
|
+
selector: z34.string(),
|
|
16191
|
+
relative_to: z34.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
16186
16192
|
center: point4
|
|
16187
16193
|
});
|
|
16188
16194
|
expectTypesMatch(
|
|
@@ -16190,37 +16196,37 @@ expectTypesMatch(
|
|
|
16190
16196
|
);
|
|
16191
16197
|
|
|
16192
16198
|
// lib/manual-edits/manual_edits_file.ts
|
|
16193
|
-
var manual_edits_file =
|
|
16194
|
-
pcb_placements:
|
|
16195
|
-
manual_trace_hints:
|
|
16196
|
-
schematic_placements:
|
|
16199
|
+
var manual_edits_file = z35.object({
|
|
16200
|
+
pcb_placements: z35.array(manual_pcb_placement).optional(),
|
|
16201
|
+
manual_trace_hints: z35.array(manual_trace_hint).optional(),
|
|
16202
|
+
schematic_placements: z35.array(manual_schematic_placement).optional()
|
|
16197
16203
|
});
|
|
16198
16204
|
expectTypesMatch(true);
|
|
16199
16205
|
|
|
16200
16206
|
// lib/common/connectionsProp.ts
|
|
16201
|
-
import { z as
|
|
16202
|
-
var connectionTarget =
|
|
16207
|
+
import { z as z36 } from "zod";
|
|
16208
|
+
var connectionTarget = z36.string().or(z36.array(z36.string()).readonly()).or(z36.array(z36.string()));
|
|
16203
16209
|
var createConnectionsProp = (labels) => {
|
|
16204
|
-
return
|
|
16210
|
+
return z36.record(z36.enum(labels), connectionTarget);
|
|
16205
16211
|
};
|
|
16206
16212
|
|
|
16207
16213
|
// lib/components/group.ts
|
|
16208
|
-
var layoutConfig =
|
|
16209
|
-
layoutMode:
|
|
16210
|
-
position:
|
|
16211
|
-
grid:
|
|
16212
|
-
gridCols:
|
|
16213
|
-
gridRows:
|
|
16214
|
-
gridTemplateRows:
|
|
16215
|
-
gridTemplateColumns:
|
|
16216
|
-
gridTemplate:
|
|
16217
|
-
gridGap:
|
|
16218
|
-
gridRowGap:
|
|
16219
|
-
gridColumnGap:
|
|
16220
|
-
flex:
|
|
16221
|
-
flexDirection:
|
|
16222
|
-
alignItems:
|
|
16223
|
-
justifyContent:
|
|
16214
|
+
var layoutConfig = z37.object({
|
|
16215
|
+
layoutMode: z37.enum(["grid", "flex", "match-adapt", "relative", "none"]).optional(),
|
|
16216
|
+
position: z37.enum(["absolute", "relative"]).optional(),
|
|
16217
|
+
grid: z37.boolean().optional(),
|
|
16218
|
+
gridCols: z37.number().or(z37.string()).optional(),
|
|
16219
|
+
gridRows: z37.number().or(z37.string()).optional(),
|
|
16220
|
+
gridTemplateRows: z37.string().optional(),
|
|
16221
|
+
gridTemplateColumns: z37.string().optional(),
|
|
16222
|
+
gridTemplate: z37.string().optional(),
|
|
16223
|
+
gridGap: z37.number().or(z37.string()).optional(),
|
|
16224
|
+
gridRowGap: z37.number().or(z37.string()).optional(),
|
|
16225
|
+
gridColumnGap: z37.number().or(z37.string()).optional(),
|
|
16226
|
+
flex: z37.boolean().or(z37.string()).optional(),
|
|
16227
|
+
flexDirection: z37.enum(["row", "column"]).optional(),
|
|
16228
|
+
alignItems: z37.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16229
|
+
justifyContent: z37.enum([
|
|
16224
16230
|
"start",
|
|
16225
16231
|
"center",
|
|
16226
16232
|
"end",
|
|
@@ -16229,16 +16235,16 @@ var layoutConfig = z36.object({
|
|
|
16229
16235
|
"space-around",
|
|
16230
16236
|
"space-evenly"
|
|
16231
16237
|
]).optional(),
|
|
16232
|
-
flexRow:
|
|
16233
|
-
flexColumn:
|
|
16234
|
-
gap:
|
|
16235
|
-
pack:
|
|
16236
|
-
packOrderStrategy:
|
|
16238
|
+
flexRow: z37.boolean().optional(),
|
|
16239
|
+
flexColumn: z37.boolean().optional(),
|
|
16240
|
+
gap: z37.number().or(z37.string()).optional(),
|
|
16241
|
+
pack: z37.boolean().optional().describe("Pack the contents of this group using a packing strategy"),
|
|
16242
|
+
packOrderStrategy: z37.enum([
|
|
16237
16243
|
"largest_to_smallest",
|
|
16238
16244
|
"first_to_last",
|
|
16239
16245
|
"highest_to_lowest_pin_count"
|
|
16240
16246
|
]).optional(),
|
|
16241
|
-
packPlacementStrategy:
|
|
16247
|
+
packPlacementStrategy: z37.enum(["shortest_connection_along_outline"]).optional(),
|
|
16242
16248
|
padding: length3.optional(),
|
|
16243
16249
|
paddingLeft: length3.optional(),
|
|
16244
16250
|
paddingRight: length3.optional(),
|
|
@@ -16248,17 +16254,17 @@ var layoutConfig = z36.object({
|
|
|
16248
16254
|
paddingY: length3.optional(),
|
|
16249
16255
|
width: length3.optional(),
|
|
16250
16256
|
height: length3.optional(),
|
|
16251
|
-
matchAdapt:
|
|
16252
|
-
matchAdaptTemplate:
|
|
16257
|
+
matchAdapt: z37.boolean().optional(),
|
|
16258
|
+
matchAdaptTemplate: z37.any().optional()
|
|
16253
16259
|
});
|
|
16254
16260
|
expectTypesMatch(true);
|
|
16255
|
-
var border =
|
|
16261
|
+
var border = z37.object({
|
|
16256
16262
|
strokeWidth: length3.optional(),
|
|
16257
|
-
dashed:
|
|
16258
|
-
solid:
|
|
16263
|
+
dashed: z37.boolean().optional(),
|
|
16264
|
+
solid: z37.boolean().optional()
|
|
16259
16265
|
});
|
|
16260
|
-
var pcbAnchorAlignmentAutocomplete =
|
|
16261
|
-
var routingTolerances =
|
|
16266
|
+
var pcbAnchorAlignmentAutocomplete = z37.custom((value) => typeof value === "string");
|
|
16267
|
+
var routingTolerances = z37.object({
|
|
16262
16268
|
minTraceWidth: length3.optional(),
|
|
16263
16269
|
minViaHoleEdgeToViaHoleEdgeClearance: length3.optional(),
|
|
16264
16270
|
minViaEdgeToPadEdgeClearance: length3.optional(),
|
|
@@ -16269,19 +16275,19 @@ var routingTolerances = z36.object({
|
|
|
16269
16275
|
minViaHoleDiameter: length3.optional(),
|
|
16270
16276
|
minViaPadDiameter: length3.optional()
|
|
16271
16277
|
});
|
|
16272
|
-
var autorouterConfig =
|
|
16278
|
+
var autorouterConfig = z37.object({
|
|
16273
16279
|
serverUrl: url.optional(),
|
|
16274
|
-
inputFormat:
|
|
16275
|
-
serverMode:
|
|
16276
|
-
serverCacheEnabled:
|
|
16277
|
-
cache:
|
|
16280
|
+
inputFormat: z37.enum(["simplified", "circuit-json"]).optional(),
|
|
16281
|
+
serverMode: z37.enum(["job", "solve-endpoint"]).optional(),
|
|
16282
|
+
serverCacheEnabled: z37.boolean().optional(),
|
|
16283
|
+
cache: z37.custom((v) => true).optional(),
|
|
16278
16284
|
traceClearance: length3.optional(),
|
|
16279
|
-
availableJumperTypes:
|
|
16280
|
-
groupMode:
|
|
16281
|
-
algorithmFn:
|
|
16285
|
+
availableJumperTypes: z37.array(z37.enum(["1206x4", "0603"])).optional(),
|
|
16286
|
+
groupMode: z37.enum(["sequential_trace", "subcircuit", "sequential-trace"]).optional(),
|
|
16287
|
+
algorithmFn: z37.custom(
|
|
16282
16288
|
(v) => typeof v === "function" || v === void 0
|
|
16283
16289
|
).optional(),
|
|
16284
|
-
preset:
|
|
16290
|
+
preset: z37.enum([
|
|
16285
16291
|
"sequential_trace",
|
|
16286
16292
|
"subcircuit",
|
|
16287
16293
|
"auto",
|
|
@@ -16297,59 +16303,59 @@ var autorouterConfig = z36.object({
|
|
|
16297
16303
|
"auto-local",
|
|
16298
16304
|
"auto-cloud"
|
|
16299
16305
|
]).optional(),
|
|
16300
|
-
local:
|
|
16306
|
+
local: z37.boolean().optional()
|
|
16301
16307
|
});
|
|
16302
|
-
var autorouterPreset =
|
|
16303
|
-
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
|
|
16309
|
-
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
|
|
16308
|
+
var autorouterPreset = z37.union([
|
|
16309
|
+
z37.literal("sequential_trace"),
|
|
16310
|
+
z37.literal("subcircuit"),
|
|
16311
|
+
z37.literal("auto"),
|
|
16312
|
+
z37.literal("auto_local"),
|
|
16313
|
+
z37.literal("auto_cloud"),
|
|
16314
|
+
z37.literal("auto_jumper"),
|
|
16315
|
+
z37.literal("tscircuit_beta"),
|
|
16316
|
+
z37.literal("krt"),
|
|
16317
|
+
z37.literal("freerouting"),
|
|
16318
|
+
z37.literal("laser_prefab"),
|
|
16313
16319
|
// Prefabricated PCB with laser copper ablation
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16320
|
+
z37.literal("auto-jumper"),
|
|
16321
|
+
z37.literal("sequential-trace"),
|
|
16322
|
+
z37.literal("auto-local"),
|
|
16323
|
+
z37.literal("auto-cloud")
|
|
16318
16324
|
]);
|
|
16319
|
-
var autorouterString =
|
|
16320
|
-
var autorouterProp =
|
|
16325
|
+
var autorouterString = z37.string();
|
|
16326
|
+
var autorouterProp = z37.union([
|
|
16321
16327
|
autorouterConfig,
|
|
16322
16328
|
autorouterPreset,
|
|
16323
16329
|
autorouterString
|
|
16324
16330
|
]);
|
|
16325
|
-
var autorouterEffortLevel =
|
|
16331
|
+
var autorouterEffortLevel = z37.enum(["1x", "2x", "5x", "10x", "100x"]);
|
|
16326
16332
|
var baseGroupProps = commonLayoutProps.extend({
|
|
16327
|
-
name:
|
|
16328
|
-
children:
|
|
16329
|
-
schTitle:
|
|
16330
|
-
key:
|
|
16331
|
-
showAsSchematicBox:
|
|
16332
|
-
connections:
|
|
16333
|
+
name: z37.string().optional(),
|
|
16334
|
+
children: z37.any().optional(),
|
|
16335
|
+
schTitle: z37.string().optional(),
|
|
16336
|
+
key: z37.any().optional(),
|
|
16337
|
+
showAsSchematicBox: z37.boolean().optional(),
|
|
16338
|
+
connections: z37.record(z37.string(), connectionTarget.optional()).optional(),
|
|
16333
16339
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
16334
16340
|
schPinSpacing: length3.optional(),
|
|
16335
16341
|
schPinStyle: schematicPinStyle.optional(),
|
|
16336
16342
|
...layoutConfig.shape,
|
|
16337
16343
|
grid: layoutConfig.shape.grid.describe("@deprecated use pcbGrid"),
|
|
16338
16344
|
flex: layoutConfig.shape.flex.describe("@deprecated use pcbFlex"),
|
|
16339
|
-
pcbGrid:
|
|
16340
|
-
pcbGridCols:
|
|
16341
|
-
pcbGridRows:
|
|
16342
|
-
pcbGridTemplateRows:
|
|
16343
|
-
pcbGridTemplateColumns:
|
|
16344
|
-
pcbGridTemplate:
|
|
16345
|
-
pcbGridGap:
|
|
16346
|
-
pcbGridRowGap:
|
|
16347
|
-
pcbGridColumnGap:
|
|
16348
|
-
pcbFlex:
|
|
16349
|
-
pcbFlexGap:
|
|
16350
|
-
pcbFlexDirection:
|
|
16351
|
-
pcbAlignItems:
|
|
16352
|
-
pcbJustifyContent:
|
|
16345
|
+
pcbGrid: z37.boolean().optional(),
|
|
16346
|
+
pcbGridCols: z37.number().or(z37.string()).optional(),
|
|
16347
|
+
pcbGridRows: z37.number().or(z37.string()).optional(),
|
|
16348
|
+
pcbGridTemplateRows: z37.string().optional(),
|
|
16349
|
+
pcbGridTemplateColumns: z37.string().optional(),
|
|
16350
|
+
pcbGridTemplate: z37.string().optional(),
|
|
16351
|
+
pcbGridGap: z37.number().or(z37.string()).optional(),
|
|
16352
|
+
pcbGridRowGap: z37.number().or(z37.string()).optional(),
|
|
16353
|
+
pcbGridColumnGap: z37.number().or(z37.string()).optional(),
|
|
16354
|
+
pcbFlex: z37.boolean().or(z37.string()).optional(),
|
|
16355
|
+
pcbFlexGap: z37.number().or(z37.string()).optional(),
|
|
16356
|
+
pcbFlexDirection: z37.enum(["row", "column"]).optional(),
|
|
16357
|
+
pcbAlignItems: z37.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16358
|
+
pcbJustifyContent: z37.enum([
|
|
16353
16359
|
"start",
|
|
16354
16360
|
"center",
|
|
16355
16361
|
"end",
|
|
@@ -16358,25 +16364,25 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16358
16364
|
"space-around",
|
|
16359
16365
|
"space-evenly"
|
|
16360
16366
|
]).optional(),
|
|
16361
|
-
pcbFlexRow:
|
|
16362
|
-
pcbFlexColumn:
|
|
16363
|
-
pcbGap:
|
|
16364
|
-
pcbPack:
|
|
16365
|
-
pcbPackGap:
|
|
16366
|
-
schGrid:
|
|
16367
|
-
schGridCols:
|
|
16368
|
-
schGridRows:
|
|
16369
|
-
schGridTemplateRows:
|
|
16370
|
-
schGridTemplateColumns:
|
|
16371
|
-
schGridTemplate:
|
|
16372
|
-
schGridGap:
|
|
16373
|
-
schGridRowGap:
|
|
16374
|
-
schGridColumnGap:
|
|
16375
|
-
schFlex:
|
|
16376
|
-
schFlexGap:
|
|
16377
|
-
schFlexDirection:
|
|
16378
|
-
schAlignItems:
|
|
16379
|
-
schJustifyContent:
|
|
16367
|
+
pcbFlexRow: z37.boolean().optional(),
|
|
16368
|
+
pcbFlexColumn: z37.boolean().optional(),
|
|
16369
|
+
pcbGap: z37.number().or(z37.string()).optional(),
|
|
16370
|
+
pcbPack: z37.boolean().optional(),
|
|
16371
|
+
pcbPackGap: z37.number().or(z37.string()).optional(),
|
|
16372
|
+
schGrid: z37.boolean().optional(),
|
|
16373
|
+
schGridCols: z37.number().or(z37.string()).optional(),
|
|
16374
|
+
schGridRows: z37.number().or(z37.string()).optional(),
|
|
16375
|
+
schGridTemplateRows: z37.string().optional(),
|
|
16376
|
+
schGridTemplateColumns: z37.string().optional(),
|
|
16377
|
+
schGridTemplate: z37.string().optional(),
|
|
16378
|
+
schGridGap: z37.number().or(z37.string()).optional(),
|
|
16379
|
+
schGridRowGap: z37.number().or(z37.string()).optional(),
|
|
16380
|
+
schGridColumnGap: z37.number().or(z37.string()).optional(),
|
|
16381
|
+
schFlex: z37.boolean().or(z37.string()).optional(),
|
|
16382
|
+
schFlexGap: z37.number().or(z37.string()).optional(),
|
|
16383
|
+
schFlexDirection: z37.enum(["row", "column"]).optional(),
|
|
16384
|
+
schAlignItems: z37.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16385
|
+
schJustifyContent: z37.enum([
|
|
16380
16386
|
"start",
|
|
16381
16387
|
"center",
|
|
16382
16388
|
"end",
|
|
@@ -16385,11 +16391,11 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16385
16391
|
"space-around",
|
|
16386
16392
|
"space-evenly"
|
|
16387
16393
|
]).optional(),
|
|
16388
|
-
schFlexRow:
|
|
16389
|
-
schFlexColumn:
|
|
16390
|
-
schGap:
|
|
16391
|
-
schPack:
|
|
16392
|
-
schMatchAdapt:
|
|
16394
|
+
schFlexRow: z37.boolean().optional(),
|
|
16395
|
+
schFlexColumn: z37.boolean().optional(),
|
|
16396
|
+
schGap: z37.number().or(z37.string()).optional(),
|
|
16397
|
+
schPack: z37.boolean().optional(),
|
|
16398
|
+
schMatchAdapt: z37.boolean().optional(),
|
|
16393
16399
|
pcbWidth: length3.optional(),
|
|
16394
16400
|
pcbHeight: length3.optional(),
|
|
16395
16401
|
minTraceWidth: length3.optional(),
|
|
@@ -16412,38 +16418,38 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16412
16418
|
pcbPaddingBottom: length3.optional(),
|
|
16413
16419
|
pcbAnchorAlignment: pcbAnchorAlignmentAutocomplete.optional()
|
|
16414
16420
|
});
|
|
16415
|
-
var partsEngine =
|
|
16421
|
+
var partsEngine = z37.custom((v) => "findPart" in v);
|
|
16416
16422
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
16417
16423
|
manualEdits: manual_edits_file.optional(),
|
|
16418
|
-
schAutoLayoutEnabled:
|
|
16419
|
-
schTraceAutoLabelEnabled:
|
|
16424
|
+
schAutoLayoutEnabled: z37.boolean().optional(),
|
|
16425
|
+
schTraceAutoLabelEnabled: z37.boolean().optional(),
|
|
16420
16426
|
schMaxTraceDistance: distance11.optional(),
|
|
16421
|
-
routingDisabled:
|
|
16422
|
-
bomDisabled:
|
|
16427
|
+
routingDisabled: z37.boolean().optional(),
|
|
16428
|
+
bomDisabled: z37.boolean().optional(),
|
|
16423
16429
|
defaultTraceWidth: length3.optional(),
|
|
16424
16430
|
...routingTolerances.shape,
|
|
16425
16431
|
nominalTraceWidth: length3.optional(),
|
|
16426
16432
|
partsEngine: partsEngine.optional(),
|
|
16427
|
-
_subcircuitCachingEnabled:
|
|
16428
|
-
pcbRouteCache:
|
|
16433
|
+
_subcircuitCachingEnabled: z37.boolean().optional(),
|
|
16434
|
+
pcbRouteCache: z37.custom((v) => true).optional(),
|
|
16429
16435
|
autorouter: autorouterProp.optional(),
|
|
16430
16436
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
16431
|
-
autorouterVersion:
|
|
16432
|
-
square:
|
|
16433
|
-
emptyArea:
|
|
16434
|
-
filledArea:
|
|
16437
|
+
autorouterVersion: z37.enum(["v1", "v2", "v3", "v4", "v5", "latest"]).optional(),
|
|
16438
|
+
square: z37.boolean().optional(),
|
|
16439
|
+
emptyArea: z37.string().optional(),
|
|
16440
|
+
filledArea: z37.string().optional(),
|
|
16435
16441
|
width: distance11.optional(),
|
|
16436
16442
|
height: distance11.optional(),
|
|
16437
|
-
outline:
|
|
16443
|
+
outline: z37.array(point).optional(),
|
|
16438
16444
|
outlineOffsetX: distance11.optional(),
|
|
16439
16445
|
outlineOffsetY: distance11.optional(),
|
|
16440
|
-
circuitJson:
|
|
16446
|
+
circuitJson: z37.array(z37.any()).optional()
|
|
16441
16447
|
});
|
|
16442
16448
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
16443
|
-
subcircuit:
|
|
16449
|
+
subcircuit: z37.literal(true)
|
|
16444
16450
|
});
|
|
16445
|
-
var groupProps =
|
|
16446
|
-
baseGroupProps.extend({ subcircuit:
|
|
16451
|
+
var groupProps = z37.discriminatedUnion("subcircuit", [
|
|
16452
|
+
baseGroupProps.extend({ subcircuit: z37.literal(false).optional() }),
|
|
16447
16453
|
subcircuitGroupPropsWithBool
|
|
16448
16454
|
]);
|
|
16449
16455
|
expectTypesMatch(true);
|
|
@@ -16453,35 +16459,35 @@ expectTypesMatch(true);
|
|
|
16453
16459
|
expectTypesMatch(true);
|
|
16454
16460
|
|
|
16455
16461
|
// lib/components/board.ts
|
|
16456
|
-
var boardColor =
|
|
16462
|
+
var boardColor = z38.custom((value) => typeof value === "string");
|
|
16457
16463
|
var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
16458
|
-
material:
|
|
16459
|
-
layers:
|
|
16460
|
-
|
|
16461
|
-
|
|
16462
|
-
|
|
16463
|
-
|
|
16464
|
-
|
|
16464
|
+
material: z38.enum(["fr4", "fr1", "flex"]).default("fr4"),
|
|
16465
|
+
layers: z38.union([
|
|
16466
|
+
z38.literal(1),
|
|
16467
|
+
z38.literal(2),
|
|
16468
|
+
z38.literal(4),
|
|
16469
|
+
z38.literal(6),
|
|
16470
|
+
z38.literal(8)
|
|
16465
16471
|
]).default(2),
|
|
16466
16472
|
borderRadius: distance.optional(),
|
|
16467
16473
|
thickness: distance.optional(),
|
|
16468
16474
|
boardAnchorPosition: point.optional(),
|
|
16469
16475
|
anchorAlignment: ninePointAnchor.optional(),
|
|
16470
16476
|
boardAnchorAlignment: ninePointAnchor.optional().describe("Prefer using anchorAlignment when possible"),
|
|
16471
|
-
title:
|
|
16477
|
+
title: z38.string().optional(),
|
|
16472
16478
|
solderMaskColor: boardColor.optional(),
|
|
16473
16479
|
topSolderMaskColor: boardColor.optional(),
|
|
16474
16480
|
bottomSolderMaskColor: boardColor.optional(),
|
|
16475
16481
|
silkscreenColor: boardColor.optional(),
|
|
16476
16482
|
topSilkscreenColor: boardColor.optional(),
|
|
16477
16483
|
bottomSilkscreenColor: boardColor.optional(),
|
|
16478
|
-
doubleSidedAssembly:
|
|
16479
|
-
schematicDisabled:
|
|
16484
|
+
doubleSidedAssembly: z38.boolean().optional().default(false),
|
|
16485
|
+
schematicDisabled: z38.boolean().optional()
|
|
16480
16486
|
});
|
|
16481
16487
|
expectTypesMatch(true);
|
|
16482
16488
|
|
|
16483
16489
|
// lib/components/panel.ts
|
|
16484
|
-
import { z as
|
|
16490
|
+
import { z as z39 } from "zod";
|
|
16485
16491
|
var panelProps = baseGroupProps.omit({
|
|
16486
16492
|
width: true,
|
|
16487
16493
|
height: true,
|
|
@@ -16490,25 +16496,25 @@ var panelProps = baseGroupProps.omit({
|
|
|
16490
16496
|
}).extend({
|
|
16491
16497
|
width: distance.optional(),
|
|
16492
16498
|
height: distance.optional(),
|
|
16493
|
-
children:
|
|
16499
|
+
children: z39.any().optional(),
|
|
16494
16500
|
anchorAlignment: ninePointAnchor.optional(),
|
|
16495
|
-
noSolderMask:
|
|
16496
|
-
panelizationMethod:
|
|
16501
|
+
noSolderMask: z39.boolean().optional(),
|
|
16502
|
+
panelizationMethod: z39.enum(["tab-routing", "none"]).optional(),
|
|
16497
16503
|
boardGap: distance.optional(),
|
|
16498
|
-
layoutMode:
|
|
16499
|
-
row:
|
|
16500
|
-
col:
|
|
16504
|
+
layoutMode: z39.enum(["grid", "pack", "none"]).optional(),
|
|
16505
|
+
row: z39.number().optional(),
|
|
16506
|
+
col: z39.number().optional(),
|
|
16501
16507
|
cellWidth: distance.optional(),
|
|
16502
16508
|
cellHeight: distance.optional(),
|
|
16503
16509
|
tabWidth: distance.optional(),
|
|
16504
16510
|
tabLength: distance.optional(),
|
|
16505
|
-
mouseBites:
|
|
16511
|
+
mouseBites: z39.boolean().optional(),
|
|
16506
16512
|
edgePadding: distance.optional(),
|
|
16507
16513
|
edgePaddingLeft: distance.optional(),
|
|
16508
16514
|
edgePaddingRight: distance.optional(),
|
|
16509
16515
|
edgePaddingTop: distance.optional(),
|
|
16510
16516
|
edgePaddingBottom: distance.optional(),
|
|
16511
|
-
_subcircuitCachingEnabled:
|
|
16517
|
+
_subcircuitCachingEnabled: z39.boolean().optional()
|
|
16512
16518
|
});
|
|
16513
16519
|
expectTypesMatch(true);
|
|
16514
16520
|
|
|
@@ -16531,34 +16537,34 @@ expectTypesMatch(true);
|
|
|
16531
16537
|
|
|
16532
16538
|
// lib/components/chip.ts
|
|
16533
16539
|
import { distance as distance13, supplier_name as supplier_name2 } from "circuit-json";
|
|
16534
|
-
import { z as
|
|
16535
|
-
var connectionTarget2 =
|
|
16536
|
-
var noConnectProp =
|
|
16537
|
-
var connectionsProp =
|
|
16538
|
-
var pinLabelsProp =
|
|
16540
|
+
import { z as z42 } from "zod";
|
|
16541
|
+
var connectionTarget2 = z42.string().or(z42.array(z42.string()).readonly()).or(z42.array(z42.string()));
|
|
16542
|
+
var noConnectProp = z42.array(schematicPinLabel).readonly().or(z42.array(schematicPinLabel));
|
|
16543
|
+
var connectionsProp = z42.custom().pipe(z42.record(z42.string(), connectionTarget2));
|
|
16544
|
+
var pinLabelsProp = z42.record(
|
|
16539
16545
|
schematicPinLabel,
|
|
16540
|
-
schematicPinLabel.or(
|
|
16546
|
+
schematicPinLabel.or(z42.array(schematicPinLabel).readonly()).or(z42.array(schematicPinLabel))
|
|
16541
16547
|
);
|
|
16542
16548
|
expectTypesMatch(true);
|
|
16543
|
-
var pinCompatibleVariant =
|
|
16544
|
-
manufacturerPartNumber:
|
|
16545
|
-
supplierPartNumber:
|
|
16549
|
+
var pinCompatibleVariant = z42.object({
|
|
16550
|
+
manufacturerPartNumber: z42.string().optional(),
|
|
16551
|
+
supplierPartNumber: z42.record(supplier_name2, z42.array(z42.string())).optional()
|
|
16546
16552
|
});
|
|
16547
16553
|
var chipProps = commonComponentProps.extend({
|
|
16548
|
-
manufacturerPartNumber:
|
|
16554
|
+
manufacturerPartNumber: z42.string().optional(),
|
|
16549
16555
|
pinLabels: pinLabelsProp.optional(),
|
|
16550
|
-
showPinAliases:
|
|
16551
|
-
pcbPinLabels:
|
|
16552
|
-
internallyConnectedPins:
|
|
16553
|
-
externallyConnectedPins:
|
|
16556
|
+
showPinAliases: z42.boolean().optional(),
|
|
16557
|
+
pcbPinLabels: z42.record(z42.string(), z42.string()).optional(),
|
|
16558
|
+
internallyConnectedPins: z42.array(z42.array(z42.union([z42.string(), z42.number()]))).optional(),
|
|
16559
|
+
externallyConnectedPins: z42.array(z42.array(z42.string())).optional(),
|
|
16554
16560
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
16555
16561
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
16556
|
-
pinCompatibleVariants:
|
|
16562
|
+
pinCompatibleVariants: z42.array(pinCompatibleVariant).optional(),
|
|
16557
16563
|
schPinStyle: schematicPinStyle.optional(),
|
|
16558
16564
|
schPinSpacing: distance13.optional(),
|
|
16559
16565
|
schWidth: distance13.optional(),
|
|
16560
16566
|
schHeight: distance13.optional(),
|
|
16561
|
-
noSchematicRepresentation:
|
|
16567
|
+
noSchematicRepresentation: z42.boolean().optional(),
|
|
16562
16568
|
noConnect: noConnectProp.optional(),
|
|
16563
16569
|
connections: connectionsProp.optional()
|
|
16564
16570
|
});
|
|
@@ -16571,75 +16577,75 @@ expectTypesMatch(true);
|
|
|
16571
16577
|
|
|
16572
16578
|
// lib/components/jumper.ts
|
|
16573
16579
|
import { distance as distance14 } from "circuit-json";
|
|
16574
|
-
import { z as
|
|
16580
|
+
import { z as z43 } from "zod";
|
|
16575
16581
|
var jumperProps = commonComponentProps.extend({
|
|
16576
|
-
manufacturerPartNumber:
|
|
16577
|
-
pinLabels:
|
|
16578
|
-
|
|
16579
|
-
schematicPinLabel.or(
|
|
16582
|
+
manufacturerPartNumber: z43.string().optional(),
|
|
16583
|
+
pinLabels: z43.record(
|
|
16584
|
+
z43.number().or(schematicPinLabel),
|
|
16585
|
+
schematicPinLabel.or(z43.array(schematicPinLabel))
|
|
16580
16586
|
).optional(),
|
|
16581
16587
|
schPinStyle: schematicPinStyle.optional(),
|
|
16582
16588
|
schPinSpacing: distance14.optional(),
|
|
16583
16589
|
schWidth: distance14.optional(),
|
|
16584
16590
|
schHeight: distance14.optional(),
|
|
16585
|
-
schDirection:
|
|
16591
|
+
schDirection: z43.enum(["left", "right"]).optional(),
|
|
16586
16592
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
16587
16593
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
16588
|
-
pcbPinLabels:
|
|
16589
|
-
pinCount:
|
|
16590
|
-
internallyConnectedPins:
|
|
16591
|
-
connections:
|
|
16594
|
+
pcbPinLabels: z43.record(z43.string(), z43.string()).optional(),
|
|
16595
|
+
pinCount: z43.union([z43.literal(2), z43.literal(3)]).optional(),
|
|
16596
|
+
internallyConnectedPins: z43.array(z43.array(z43.union([z43.string(), z43.number()]))).optional(),
|
|
16597
|
+
connections: z43.custom().pipe(z43.record(z43.string(), connectionTarget)).optional()
|
|
16592
16598
|
});
|
|
16593
16599
|
expectTypesMatch(true);
|
|
16594
16600
|
|
|
16595
16601
|
// lib/components/solderjumper.ts
|
|
16596
|
-
import { z as
|
|
16602
|
+
import { z as z44 } from "zod";
|
|
16597
16603
|
var solderjumperProps = jumperProps.extend({
|
|
16598
|
-
bridgedPins:
|
|
16599
|
-
bridged:
|
|
16604
|
+
bridgedPins: z44.array(z44.array(z44.string())).optional(),
|
|
16605
|
+
bridged: z44.boolean().optional()
|
|
16600
16606
|
});
|
|
16601
16607
|
expectTypesMatch(true);
|
|
16602
16608
|
|
|
16603
16609
|
// lib/components/connector.ts
|
|
16604
|
-
import { z as
|
|
16610
|
+
import { z as z45 } from "zod";
|
|
16605
16611
|
var connectorProps = chipProps.extend({
|
|
16606
|
-
standard:
|
|
16612
|
+
standard: z45.enum(["usb_c", "m2"]).optional()
|
|
16607
16613
|
});
|
|
16608
16614
|
expectTypesMatch(true);
|
|
16609
16615
|
|
|
16610
16616
|
// lib/components/interconnect.ts
|
|
16611
|
-
import { z as
|
|
16617
|
+
import { z as z46 } from "zod";
|
|
16612
16618
|
var interconnectProps = commonComponentProps.extend({
|
|
16613
|
-
standard:
|
|
16614
|
-
pinLabels:
|
|
16615
|
-
|
|
16616
|
-
schematicPinLabel.or(
|
|
16619
|
+
standard: z46.enum(["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]).optional(),
|
|
16620
|
+
pinLabels: z46.record(
|
|
16621
|
+
z46.number().or(schematicPinLabel),
|
|
16622
|
+
schematicPinLabel.or(z46.array(schematicPinLabel))
|
|
16617
16623
|
).optional(),
|
|
16618
|
-
internallyConnectedPins:
|
|
16624
|
+
internallyConnectedPins: z46.array(z46.array(z46.union([z46.string(), z46.number()]))).optional()
|
|
16619
16625
|
});
|
|
16620
16626
|
expectTypesMatch(true);
|
|
16621
16627
|
|
|
16622
16628
|
// lib/components/fuse.ts
|
|
16623
|
-
import { z as
|
|
16629
|
+
import { z as z47 } from "zod";
|
|
16624
16630
|
var fusePinLabels = ["pin1", "pin2"];
|
|
16625
16631
|
var fuseProps = commonComponentProps.extend({
|
|
16626
|
-
currentRating:
|
|
16627
|
-
voltageRating:
|
|
16628
|
-
schShowRatings:
|
|
16632
|
+
currentRating: z47.union([z47.number(), z47.string()]),
|
|
16633
|
+
voltageRating: z47.union([z47.number(), z47.string()]).optional(),
|
|
16634
|
+
schShowRatings: z47.boolean().optional(),
|
|
16629
16635
|
schOrientation: schematicOrientation.optional(),
|
|
16630
|
-
connections:
|
|
16631
|
-
|
|
16632
|
-
|
|
16633
|
-
|
|
16634
|
-
|
|
16635
|
-
|
|
16636
|
+
connections: z47.record(
|
|
16637
|
+
z47.string(),
|
|
16638
|
+
z47.union([
|
|
16639
|
+
z47.string(),
|
|
16640
|
+
z47.array(z47.string()).readonly(),
|
|
16641
|
+
z47.array(z47.string())
|
|
16636
16642
|
])
|
|
16637
16643
|
).optional()
|
|
16638
16644
|
});
|
|
16639
16645
|
|
|
16640
16646
|
// lib/components/platedhole.ts
|
|
16641
16647
|
import { distance as distance15 } from "circuit-json";
|
|
16642
|
-
import { z as
|
|
16648
|
+
import { z as z48 } from "zod";
|
|
16643
16649
|
var DEFAULT_PIN_HEADER_HOLE_DIAMETER = "0.04in";
|
|
16644
16650
|
var DEFAULT_PIN_HEADER_OUTER_DIAMETER = "0.1in";
|
|
16645
16651
|
var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
@@ -16671,26 +16677,26 @@ var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
|
16671
16677
|
props.outerDiameter = DEFAULT_PIN_HEADER_OUTER_DIAMETER;
|
|
16672
16678
|
return props;
|
|
16673
16679
|
};
|
|
16674
|
-
var distanceHiddenUndefined =
|
|
16680
|
+
var distanceHiddenUndefined = z48.custom().transform((a) => {
|
|
16675
16681
|
if (a === void 0) return void 0;
|
|
16676
16682
|
return distance15.parse(a);
|
|
16677
16683
|
});
|
|
16678
|
-
var platedHolePropsByShape =
|
|
16684
|
+
var platedHolePropsByShape = z48.discriminatedUnion("shape", [
|
|
16679
16685
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
16680
|
-
name:
|
|
16681
|
-
connectsTo:
|
|
16682
|
-
shape:
|
|
16686
|
+
name: z48.string().optional(),
|
|
16687
|
+
connectsTo: z48.string().or(z48.array(z48.string())).optional(),
|
|
16688
|
+
shape: z48.literal("circle"),
|
|
16683
16689
|
holeDiameter: distance15,
|
|
16684
16690
|
outerDiameter: distance15,
|
|
16685
16691
|
padDiameter: distance15.optional().describe("Diameter of the copper pad"),
|
|
16686
16692
|
portHints: portHints.optional(),
|
|
16687
16693
|
solderMaskMargin: distance15.optional(),
|
|
16688
|
-
coveredWithSolderMask:
|
|
16694
|
+
coveredWithSolderMask: z48.boolean().optional()
|
|
16689
16695
|
}),
|
|
16690
16696
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16691
|
-
name:
|
|
16692
|
-
connectsTo:
|
|
16693
|
-
shape:
|
|
16697
|
+
name: z48.string().optional(),
|
|
16698
|
+
connectsTo: z48.string().or(z48.array(z48.string())).optional(),
|
|
16699
|
+
shape: z48.literal("oval"),
|
|
16694
16700
|
outerWidth: distance15,
|
|
16695
16701
|
outerHeight: distance15,
|
|
16696
16702
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -16699,13 +16705,13 @@ var platedHolePropsByShape = z47.discriminatedUnion("shape", [
|
|
|
16699
16705
|
innerHeight: distance15.optional().describe("DEPRECATED use holeHeight"),
|
|
16700
16706
|
portHints: portHints.optional(),
|
|
16701
16707
|
solderMaskMargin: distance15.optional(),
|
|
16702
|
-
coveredWithSolderMask:
|
|
16708
|
+
coveredWithSolderMask: z48.boolean().optional()
|
|
16703
16709
|
}),
|
|
16704
16710
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16705
|
-
name:
|
|
16706
|
-
connectsTo:
|
|
16707
|
-
shape:
|
|
16708
|
-
rectPad:
|
|
16711
|
+
name: z48.string().optional(),
|
|
16712
|
+
connectsTo: z48.string().or(z48.array(z48.string())).optional(),
|
|
16713
|
+
shape: z48.literal("pill"),
|
|
16714
|
+
rectPad: z48.boolean().optional(),
|
|
16709
16715
|
outerWidth: distance15,
|
|
16710
16716
|
outerHeight: distance15,
|
|
16711
16717
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -16716,30 +16722,30 @@ var platedHolePropsByShape = z47.discriminatedUnion("shape", [
|
|
|
16716
16722
|
holeOffsetX: distance15.optional(),
|
|
16717
16723
|
holeOffsetY: distance15.optional(),
|
|
16718
16724
|
solderMaskMargin: distance15.optional(),
|
|
16719
|
-
coveredWithSolderMask:
|
|
16725
|
+
coveredWithSolderMask: z48.boolean().optional()
|
|
16720
16726
|
}),
|
|
16721
16727
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16722
|
-
name:
|
|
16723
|
-
connectsTo:
|
|
16724
|
-
shape:
|
|
16728
|
+
name: z48.string().optional(),
|
|
16729
|
+
connectsTo: z48.string().or(z48.array(z48.string())).optional(),
|
|
16730
|
+
shape: z48.literal("circular_hole_with_rect_pad"),
|
|
16725
16731
|
holeDiameter: distance15,
|
|
16726
16732
|
rectPadWidth: distance15,
|
|
16727
16733
|
rectPadHeight: distance15,
|
|
16728
16734
|
rectBorderRadius: distance15.optional(),
|
|
16729
|
-
holeShape:
|
|
16730
|
-
padShape:
|
|
16735
|
+
holeShape: z48.literal("circle").optional(),
|
|
16736
|
+
padShape: z48.literal("rect").optional(),
|
|
16731
16737
|
portHints: portHints.optional(),
|
|
16732
16738
|
holeOffsetX: distance15.optional(),
|
|
16733
16739
|
holeOffsetY: distance15.optional(),
|
|
16734
16740
|
solderMaskMargin: distance15.optional(),
|
|
16735
|
-
coveredWithSolderMask:
|
|
16741
|
+
coveredWithSolderMask: z48.boolean().optional()
|
|
16736
16742
|
}),
|
|
16737
16743
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16738
|
-
name:
|
|
16739
|
-
connectsTo:
|
|
16740
|
-
shape:
|
|
16741
|
-
holeShape:
|
|
16742
|
-
padShape:
|
|
16744
|
+
name: z48.string().optional(),
|
|
16745
|
+
connectsTo: z48.string().or(z48.array(z48.string())).optional(),
|
|
16746
|
+
shape: z48.literal("pill_hole_with_rect_pad"),
|
|
16747
|
+
holeShape: z48.literal("pill").optional(),
|
|
16748
|
+
padShape: z48.literal("rect").optional(),
|
|
16743
16749
|
holeWidth: distance15,
|
|
16744
16750
|
holeHeight: distance15,
|
|
16745
16751
|
rectPadWidth: distance15,
|
|
@@ -16749,22 +16755,22 @@ var platedHolePropsByShape = z47.discriminatedUnion("shape", [
|
|
|
16749
16755
|
holeOffsetX: distance15.optional(),
|
|
16750
16756
|
holeOffsetY: distance15.optional(),
|
|
16751
16757
|
solderMaskMargin: distance15.optional(),
|
|
16752
|
-
coveredWithSolderMask:
|
|
16758
|
+
coveredWithSolderMask: z48.boolean().optional()
|
|
16753
16759
|
}),
|
|
16754
16760
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
16755
|
-
name:
|
|
16756
|
-
connectsTo:
|
|
16757
|
-
shape:
|
|
16758
|
-
holeShape:
|
|
16761
|
+
name: z48.string().optional(),
|
|
16762
|
+
connectsTo: z48.string().or(z48.array(z48.string())).optional(),
|
|
16763
|
+
shape: z48.literal("hole_with_polygon_pad"),
|
|
16764
|
+
holeShape: z48.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
16759
16765
|
holeDiameter: distance15.optional(),
|
|
16760
16766
|
holeWidth: distance15.optional(),
|
|
16761
16767
|
holeHeight: distance15.optional(),
|
|
16762
|
-
padOutline:
|
|
16768
|
+
padOutline: z48.array(point),
|
|
16763
16769
|
holeOffsetX: distance15,
|
|
16764
16770
|
holeOffsetY: distance15,
|
|
16765
16771
|
portHints: portHints.optional(),
|
|
16766
16772
|
solderMaskMargin: distance15.optional(),
|
|
16767
|
-
coveredWithSolderMask:
|
|
16773
|
+
coveredWithSolderMask: z48.boolean().optional()
|
|
16768
16774
|
})
|
|
16769
16775
|
]).transform((a) => {
|
|
16770
16776
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -16775,7 +16781,7 @@ var platedHolePropsByShape = z47.discriminatedUnion("shape", [
|
|
|
16775
16781
|
}
|
|
16776
16782
|
return a;
|
|
16777
16783
|
});
|
|
16778
|
-
var platedHoleProps =
|
|
16784
|
+
var platedHoleProps = z48.preprocess(
|
|
16779
16785
|
inferPlatedHoleShapeAndDefaults,
|
|
16780
16786
|
platedHolePropsByShape
|
|
16781
16787
|
);
|
|
@@ -16783,7 +16789,7 @@ expectTypesMatch(true);
|
|
|
16783
16789
|
|
|
16784
16790
|
// lib/components/resistor.ts
|
|
16785
16791
|
import { resistance } from "circuit-json";
|
|
16786
|
-
import { z as
|
|
16792
|
+
import { z as z49 } from "zod";
|
|
16787
16793
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
16788
16794
|
var resistorImperialFootprintNames = /* @__PURE__ */ new Set([
|
|
16789
16795
|
"01005",
|
|
@@ -16807,7 +16813,7 @@ var resistorFootprintProp = footprintProp.optional().transform(mapResistorFootpr
|
|
|
16807
16813
|
var resistorProps = commonComponentProps.extend({
|
|
16808
16814
|
footprint: resistorFootprintProp,
|
|
16809
16815
|
resistance,
|
|
16810
|
-
tolerance:
|
|
16816
|
+
tolerance: z49.union([z49.string(), z49.number()]).transform((val) => {
|
|
16811
16817
|
if (typeof val === "string") {
|
|
16812
16818
|
if (val.endsWith("%")) {
|
|
16813
16819
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -16816,12 +16822,12 @@ var resistorProps = commonComponentProps.extend({
|
|
|
16816
16822
|
}
|
|
16817
16823
|
return val;
|
|
16818
16824
|
}).pipe(
|
|
16819
|
-
|
|
16825
|
+
z49.number().min(0, "Tolerance must be non-negative").max(1, "Tolerance cannot be greater than 100%")
|
|
16820
16826
|
).optional(),
|
|
16821
|
-
pullupFor:
|
|
16822
|
-
pullupTo:
|
|
16823
|
-
pulldownFor:
|
|
16824
|
-
pulldownTo:
|
|
16827
|
+
pullupFor: z49.string().optional(),
|
|
16828
|
+
pullupTo: z49.string().optional(),
|
|
16829
|
+
pulldownFor: z49.string().optional(),
|
|
16830
|
+
pulldownTo: z49.string().optional(),
|
|
16825
16831
|
schOrientation: schematicOrientation.optional(),
|
|
16826
16832
|
schSize: schematicSymbolSize.optional(),
|
|
16827
16833
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
@@ -16831,25 +16837,25 @@ expectTypesMatch(true);
|
|
|
16831
16837
|
|
|
16832
16838
|
// lib/components/potentiometer.ts
|
|
16833
16839
|
import { resistance as resistance2 } from "circuit-json";
|
|
16834
|
-
import { z as
|
|
16840
|
+
import { z as z50 } from "zod";
|
|
16835
16841
|
var potentiometerPinLabels = ["pin1", "pin2", "pin3"];
|
|
16836
16842
|
var potentiometerProps = commonComponentProps.extend({
|
|
16837
16843
|
maxResistance: resistance2,
|
|
16838
|
-
pinVariant:
|
|
16844
|
+
pinVariant: z50.enum(["two_pin", "three_pin"]).optional(),
|
|
16839
16845
|
connections: createConnectionsProp(potentiometerPinLabels).optional()
|
|
16840
16846
|
});
|
|
16841
16847
|
expectTypesMatch(true);
|
|
16842
16848
|
|
|
16843
16849
|
// lib/components/crystal.ts
|
|
16844
16850
|
import { frequency, capacitance } from "circuit-json";
|
|
16845
|
-
import { z as
|
|
16851
|
+
import { z as z51 } from "zod";
|
|
16846
16852
|
var crystalPins = lrPins;
|
|
16847
16853
|
var crystalProps = commonComponentProps.extend({
|
|
16848
16854
|
frequency,
|
|
16849
16855
|
loadCapacitance: capacitance,
|
|
16850
|
-
manufacturerPartNumber:
|
|
16851
|
-
mpn:
|
|
16852
|
-
pinVariant:
|
|
16856
|
+
manufacturerPartNumber: z51.string().optional(),
|
|
16857
|
+
mpn: z51.string().optional(),
|
|
16858
|
+
pinVariant: z51.enum(["two_pin", "four_pin"]).optional(),
|
|
16853
16859
|
schOrientation: schematicOrientation.optional(),
|
|
16854
16860
|
connections: createConnectionsProp(crystalPins).optional()
|
|
16855
16861
|
});
|
|
@@ -16857,34 +16863,34 @@ expectTypesMatch(true);
|
|
|
16857
16863
|
|
|
16858
16864
|
// lib/components/resonator.ts
|
|
16859
16865
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
16860
|
-
import { z as
|
|
16866
|
+
import { z as z52 } from "zod";
|
|
16861
16867
|
var resonatorProps = commonComponentProps.extend({
|
|
16862
16868
|
frequency: frequency2,
|
|
16863
16869
|
loadCapacitance: capacitance2,
|
|
16864
|
-
pinVariant:
|
|
16870
|
+
pinVariant: z52.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
16865
16871
|
});
|
|
16866
16872
|
expectTypesMatch(true);
|
|
16867
16873
|
|
|
16868
16874
|
// lib/components/stampboard.ts
|
|
16869
16875
|
import { distance as distance16 } from "circuit-json";
|
|
16870
|
-
import { z as
|
|
16876
|
+
import { z as z53 } from "zod";
|
|
16871
16877
|
var stampboardProps = boardProps.extend({
|
|
16872
|
-
leftPinCount:
|
|
16873
|
-
rightPinCount:
|
|
16874
|
-
topPinCount:
|
|
16875
|
-
bottomPinCount:
|
|
16876
|
-
leftPins:
|
|
16877
|
-
rightPins:
|
|
16878
|
-
topPins:
|
|
16879
|
-
bottomPins:
|
|
16878
|
+
leftPinCount: z53.number().optional(),
|
|
16879
|
+
rightPinCount: z53.number().optional(),
|
|
16880
|
+
topPinCount: z53.number().optional(),
|
|
16881
|
+
bottomPinCount: z53.number().optional(),
|
|
16882
|
+
leftPins: z53.array(z53.string()).optional(),
|
|
16883
|
+
rightPins: z53.array(z53.string()).optional(),
|
|
16884
|
+
topPins: z53.array(z53.string()).optional(),
|
|
16885
|
+
bottomPins: z53.array(z53.string()).optional(),
|
|
16880
16886
|
pinPitch: distance16.optional(),
|
|
16881
|
-
innerHoles:
|
|
16887
|
+
innerHoles: z53.boolean().optional()
|
|
16882
16888
|
});
|
|
16883
16889
|
expectTypesMatch(true);
|
|
16884
16890
|
|
|
16885
16891
|
// lib/components/capacitor.ts
|
|
16886
16892
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
16887
|
-
import { z as
|
|
16893
|
+
import { z as z54 } from "zod";
|
|
16888
16894
|
var capacitorPinLabels = [
|
|
16889
16895
|
"pin1",
|
|
16890
16896
|
"pin2",
|
|
@@ -16896,13 +16902,13 @@ var capacitorPinLabels = [
|
|
|
16896
16902
|
var capacitorProps = commonComponentProps.extend({
|
|
16897
16903
|
capacitance: capacitance3,
|
|
16898
16904
|
maxVoltageRating: voltage.optional(),
|
|
16899
|
-
schShowRatings:
|
|
16900
|
-
polarized:
|
|
16901
|
-
decouplingFor:
|
|
16902
|
-
decouplingTo:
|
|
16903
|
-
bypassFor:
|
|
16904
|
-
bypassTo:
|
|
16905
|
-
maxDecouplingTraceLength:
|
|
16905
|
+
schShowRatings: z54.boolean().optional().default(false),
|
|
16906
|
+
polarized: z54.boolean().optional().default(false),
|
|
16907
|
+
decouplingFor: z54.string().optional(),
|
|
16908
|
+
decouplingTo: z54.string().optional(),
|
|
16909
|
+
bypassFor: z54.string().optional(),
|
|
16910
|
+
bypassTo: z54.string().optional(),
|
|
16911
|
+
maxDecouplingTraceLength: z54.number().optional(),
|
|
16906
16912
|
schOrientation: schematicOrientation.optional(),
|
|
16907
16913
|
schSize: schematicSymbolSize.optional(),
|
|
16908
16914
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
@@ -16912,14 +16918,14 @@ expectTypesMatch(true);
|
|
|
16912
16918
|
|
|
16913
16919
|
// lib/components/net.ts
|
|
16914
16920
|
import { distance as distance17 } from "circuit-json";
|
|
16915
|
-
import { z as
|
|
16916
|
-
var netProps =
|
|
16917
|
-
name:
|
|
16918
|
-
connectsTo:
|
|
16919
|
-
routingPhaseIndex:
|
|
16920
|
-
highlightColor:
|
|
16921
|
-
isPowerNet:
|
|
16922
|
-
isGroundNet:
|
|
16921
|
+
import { z as z55 } from "zod";
|
|
16922
|
+
var netProps = z55.object({
|
|
16923
|
+
name: z55.string(),
|
|
16924
|
+
connectsTo: z55.string().or(z55.array(z55.string())).optional(),
|
|
16925
|
+
routingPhaseIndex: z55.number().nullable().optional(),
|
|
16926
|
+
highlightColor: z55.string().optional(),
|
|
16927
|
+
isPowerNet: z55.boolean().optional(),
|
|
16928
|
+
isGroundNet: z55.boolean().optional(),
|
|
16923
16929
|
nominalTraceWidth: distance17.optional()
|
|
16924
16930
|
});
|
|
16925
16931
|
expectTypesMatch(true);
|
|
@@ -16933,55 +16939,55 @@ var fiducialProps = commonComponentProps.extend({
|
|
|
16933
16939
|
expectTypesMatch(true);
|
|
16934
16940
|
|
|
16935
16941
|
// lib/components/constrainedlayout.ts
|
|
16936
|
-
import { z as
|
|
16937
|
-
var constrainedLayoutProps =
|
|
16938
|
-
name:
|
|
16939
|
-
pcbOnly:
|
|
16940
|
-
schOnly:
|
|
16942
|
+
import { z as z57 } from "zod";
|
|
16943
|
+
var constrainedLayoutProps = z57.object({
|
|
16944
|
+
name: z57.string().optional(),
|
|
16945
|
+
pcbOnly: z57.boolean().optional(),
|
|
16946
|
+
schOnly: z57.boolean().optional()
|
|
16941
16947
|
});
|
|
16942
16948
|
expectTypesMatch(true);
|
|
16943
16949
|
|
|
16944
16950
|
// lib/components/constraint.ts
|
|
16945
|
-
import { z as
|
|
16946
|
-
var pcbXDistConstraintProps =
|
|
16947
|
-
pcb:
|
|
16951
|
+
import { z as z58 } from "zod";
|
|
16952
|
+
var pcbXDistConstraintProps = z58.object({
|
|
16953
|
+
pcb: z58.literal(true).optional(),
|
|
16948
16954
|
xDist: distance,
|
|
16949
|
-
left:
|
|
16950
|
-
right:
|
|
16951
|
-
edgeToEdge:
|
|
16952
|
-
centerToCenter:
|
|
16955
|
+
left: z58.string(),
|
|
16956
|
+
right: z58.string(),
|
|
16957
|
+
edgeToEdge: z58.literal(true).optional(),
|
|
16958
|
+
centerToCenter: z58.literal(true).optional()
|
|
16953
16959
|
});
|
|
16954
16960
|
expectTypesMatch(
|
|
16955
16961
|
true
|
|
16956
16962
|
);
|
|
16957
|
-
var pcbYDistConstraintProps =
|
|
16958
|
-
pcb:
|
|
16963
|
+
var pcbYDistConstraintProps = z58.object({
|
|
16964
|
+
pcb: z58.literal(true).optional(),
|
|
16959
16965
|
yDist: distance,
|
|
16960
|
-
top:
|
|
16961
|
-
bottom:
|
|
16962
|
-
edgeToEdge:
|
|
16963
|
-
centerToCenter:
|
|
16966
|
+
top: z58.string(),
|
|
16967
|
+
bottom: z58.string(),
|
|
16968
|
+
edgeToEdge: z58.literal(true).optional(),
|
|
16969
|
+
centerToCenter: z58.literal(true).optional()
|
|
16964
16970
|
});
|
|
16965
16971
|
expectTypesMatch(
|
|
16966
16972
|
true
|
|
16967
16973
|
);
|
|
16968
|
-
var pcbSameYConstraintProps =
|
|
16969
|
-
pcb:
|
|
16970
|
-
sameY:
|
|
16971
|
-
for:
|
|
16974
|
+
var pcbSameYConstraintProps = z58.object({
|
|
16975
|
+
pcb: z58.literal(true).optional(),
|
|
16976
|
+
sameY: z58.literal(true).optional(),
|
|
16977
|
+
for: z58.array(z58.string())
|
|
16972
16978
|
});
|
|
16973
16979
|
expectTypesMatch(
|
|
16974
16980
|
true
|
|
16975
16981
|
);
|
|
16976
|
-
var pcbSameXConstraintProps =
|
|
16977
|
-
pcb:
|
|
16978
|
-
sameX:
|
|
16979
|
-
for:
|
|
16982
|
+
var pcbSameXConstraintProps = z58.object({
|
|
16983
|
+
pcb: z58.literal(true).optional(),
|
|
16984
|
+
sameX: z58.literal(true).optional(),
|
|
16985
|
+
for: z58.array(z58.string())
|
|
16980
16986
|
});
|
|
16981
16987
|
expectTypesMatch(
|
|
16982
16988
|
true
|
|
16983
16989
|
);
|
|
16984
|
-
var constraintProps =
|
|
16990
|
+
var constraintProps = z58.union([
|
|
16985
16991
|
pcbXDistConstraintProps,
|
|
16986
16992
|
pcbYDistConstraintProps,
|
|
16987
16993
|
pcbSameYConstraintProps,
|
|
@@ -16990,13 +16996,13 @@ var constraintProps = z57.union([
|
|
|
16990
16996
|
expectTypesMatch(true);
|
|
16991
16997
|
|
|
16992
16998
|
// lib/components/cutout.ts
|
|
16993
|
-
import { z as
|
|
16999
|
+
import { z as z59 } from "zod";
|
|
16994
17000
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
16995
17001
|
layer: true,
|
|
16996
17002
|
pcbRotation: true
|
|
16997
17003
|
}).extend({
|
|
16998
|
-
name:
|
|
16999
|
-
shape:
|
|
17004
|
+
name: z59.string().optional(),
|
|
17005
|
+
shape: z59.literal("rect"),
|
|
17000
17006
|
width: distance,
|
|
17001
17007
|
height: distance
|
|
17002
17008
|
});
|
|
@@ -17005,8 +17011,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
17005
17011
|
layer: true,
|
|
17006
17012
|
pcbRotation: true
|
|
17007
17013
|
}).extend({
|
|
17008
|
-
name:
|
|
17009
|
-
shape:
|
|
17014
|
+
name: z59.string().optional(),
|
|
17015
|
+
shape: z59.literal("circle"),
|
|
17010
17016
|
radius: distance
|
|
17011
17017
|
});
|
|
17012
17018
|
expectTypesMatch(true);
|
|
@@ -17014,28 +17020,36 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
17014
17020
|
layer: true,
|
|
17015
17021
|
pcbRotation: true
|
|
17016
17022
|
}).extend({
|
|
17017
|
-
name:
|
|
17018
|
-
shape:
|
|
17019
|
-
points:
|
|
17023
|
+
name: z59.string().optional(),
|
|
17024
|
+
shape: z59.literal("polygon"),
|
|
17025
|
+
points: z59.array(point)
|
|
17020
17026
|
});
|
|
17021
17027
|
expectTypesMatch(true);
|
|
17022
|
-
var cutoutProps =
|
|
17028
|
+
var cutoutProps = z59.discriminatedUnion("shape", [
|
|
17023
17029
|
rectCutoutProps,
|
|
17024
17030
|
circleCutoutProps,
|
|
17025
17031
|
polygonCutoutProps
|
|
17026
17032
|
]);
|
|
17027
17033
|
|
|
17034
|
+
// lib/components/drc-check.ts
|
|
17035
|
+
import { z as z60 } from "zod";
|
|
17036
|
+
var drcCheckProps = z60.object({
|
|
17037
|
+
name: z60.string().optional(),
|
|
17038
|
+
checkFn: customDrcCheckFn
|
|
17039
|
+
});
|
|
17040
|
+
expectTypesMatch(true);
|
|
17041
|
+
|
|
17028
17042
|
// lib/components/smtpad.ts
|
|
17029
|
-
import { z as
|
|
17043
|
+
import { z as z61 } from "zod";
|
|
17030
17044
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17031
|
-
name:
|
|
17032
|
-
shape:
|
|
17045
|
+
name: z61.string().optional(),
|
|
17046
|
+
shape: z61.literal("rect"),
|
|
17033
17047
|
width: distance,
|
|
17034
17048
|
height: distance,
|
|
17035
17049
|
rectBorderRadius: distance.optional(),
|
|
17036
17050
|
cornerRadius: distance.optional(),
|
|
17037
17051
|
portHints: portHints.optional(),
|
|
17038
|
-
coveredWithSolderMask:
|
|
17052
|
+
coveredWithSolderMask: z61.boolean().optional(),
|
|
17039
17053
|
solderMaskMargin: distance.optional(),
|
|
17040
17054
|
solderMaskMarginLeft: distance.optional(),
|
|
17041
17055
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17044,14 +17058,14 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17044
17058
|
});
|
|
17045
17059
|
expectTypesMatch(true);
|
|
17046
17060
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17047
|
-
name:
|
|
17048
|
-
shape:
|
|
17061
|
+
name: z61.string().optional(),
|
|
17062
|
+
shape: z61.literal("rotated_rect"),
|
|
17049
17063
|
width: distance,
|
|
17050
17064
|
height: distance,
|
|
17051
|
-
ccwRotation:
|
|
17065
|
+
ccwRotation: z61.number(),
|
|
17052
17066
|
cornerRadius: distance.optional(),
|
|
17053
17067
|
portHints: portHints.optional(),
|
|
17054
|
-
coveredWithSolderMask:
|
|
17068
|
+
coveredWithSolderMask: z61.boolean().optional(),
|
|
17055
17069
|
solderMaskMargin: distance.optional(),
|
|
17056
17070
|
solderMaskMarginLeft: distance.optional(),
|
|
17057
17071
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17060,35 +17074,35 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17060
17074
|
});
|
|
17061
17075
|
expectTypesMatch(true);
|
|
17062
17076
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17063
|
-
name:
|
|
17064
|
-
shape:
|
|
17077
|
+
name: z61.string().optional(),
|
|
17078
|
+
shape: z61.literal("circle"),
|
|
17065
17079
|
radius: distance,
|
|
17066
17080
|
portHints: portHints.optional(),
|
|
17067
|
-
coveredWithSolderMask:
|
|
17081
|
+
coveredWithSolderMask: z61.boolean().optional(),
|
|
17068
17082
|
solderMaskMargin: distance.optional()
|
|
17069
17083
|
});
|
|
17070
17084
|
expectTypesMatch(true);
|
|
17071
17085
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17072
|
-
name:
|
|
17073
|
-
shape:
|
|
17086
|
+
name: z61.string().optional(),
|
|
17087
|
+
shape: z61.literal("pill"),
|
|
17074
17088
|
width: distance,
|
|
17075
17089
|
height: distance,
|
|
17076
17090
|
radius: distance,
|
|
17077
17091
|
portHints: portHints.optional(),
|
|
17078
|
-
coveredWithSolderMask:
|
|
17092
|
+
coveredWithSolderMask: z61.boolean().optional(),
|
|
17079
17093
|
solderMaskMargin: distance.optional()
|
|
17080
17094
|
});
|
|
17081
17095
|
expectTypesMatch(true);
|
|
17082
17096
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17083
|
-
name:
|
|
17084
|
-
shape:
|
|
17085
|
-
points:
|
|
17097
|
+
name: z61.string().optional(),
|
|
17098
|
+
shape: z61.literal("polygon"),
|
|
17099
|
+
points: z61.array(point),
|
|
17086
17100
|
portHints: portHints.optional(),
|
|
17087
|
-
coveredWithSolderMask:
|
|
17101
|
+
coveredWithSolderMask: z61.boolean().optional(),
|
|
17088
17102
|
solderMaskMargin: distance.optional()
|
|
17089
17103
|
});
|
|
17090
17104
|
expectTypesMatch(true);
|
|
17091
|
-
var smtPadProps =
|
|
17105
|
+
var smtPadProps = z61.discriminatedUnion("shape", [
|
|
17092
17106
|
circleSmtPadProps,
|
|
17093
17107
|
rectSmtPadProps,
|
|
17094
17108
|
rotatedRectSmtPadProps,
|
|
@@ -17098,55 +17112,55 @@ var smtPadProps = z59.discriminatedUnion("shape", [
|
|
|
17098
17112
|
expectTypesMatch(true);
|
|
17099
17113
|
|
|
17100
17114
|
// lib/components/solderpaste.ts
|
|
17101
|
-
import { z as
|
|
17115
|
+
import { z as z62 } from "zod";
|
|
17102
17116
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17103
|
-
shape:
|
|
17117
|
+
shape: z62.literal("rect"),
|
|
17104
17118
|
width: distance,
|
|
17105
17119
|
height: distance
|
|
17106
17120
|
});
|
|
17107
17121
|
expectTypesMatch(true);
|
|
17108
17122
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17109
|
-
shape:
|
|
17123
|
+
shape: z62.literal("circle"),
|
|
17110
17124
|
radius: distance
|
|
17111
17125
|
});
|
|
17112
17126
|
expectTypesMatch(true);
|
|
17113
|
-
var solderPasteProps =
|
|
17127
|
+
var solderPasteProps = z62.union([
|
|
17114
17128
|
circleSolderPasteProps,
|
|
17115
17129
|
rectSolderPasteProps
|
|
17116
17130
|
]);
|
|
17117
17131
|
expectTypesMatch(true);
|
|
17118
17132
|
|
|
17119
17133
|
// lib/components/hole.ts
|
|
17120
|
-
import { z as
|
|
17134
|
+
import { z as z63 } from "zod";
|
|
17121
17135
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
17122
|
-
name:
|
|
17123
|
-
shape:
|
|
17136
|
+
name: z63.string().optional(),
|
|
17137
|
+
shape: z63.literal("circle").optional(),
|
|
17124
17138
|
diameter: distance.optional(),
|
|
17125
17139
|
radius: distance.optional(),
|
|
17126
17140
|
solderMaskMargin: distance.optional(),
|
|
17127
|
-
coveredWithSolderMask:
|
|
17141
|
+
coveredWithSolderMask: z63.boolean().optional()
|
|
17128
17142
|
}).transform((d) => ({
|
|
17129
17143
|
...d,
|
|
17130
17144
|
diameter: d.diameter ?? 2 * d.radius,
|
|
17131
17145
|
radius: d.radius ?? d.diameter / 2
|
|
17132
17146
|
}));
|
|
17133
17147
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
17134
|
-
name:
|
|
17135
|
-
shape:
|
|
17148
|
+
name: z63.string().optional(),
|
|
17149
|
+
shape: z63.literal("pill"),
|
|
17136
17150
|
width: distance,
|
|
17137
17151
|
height: distance,
|
|
17138
17152
|
solderMaskMargin: distance.optional(),
|
|
17139
|
-
coveredWithSolderMask:
|
|
17153
|
+
coveredWithSolderMask: z63.boolean().optional()
|
|
17140
17154
|
});
|
|
17141
17155
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
17142
|
-
name:
|
|
17143
|
-
shape:
|
|
17156
|
+
name: z63.string().optional(),
|
|
17157
|
+
shape: z63.literal("rect"),
|
|
17144
17158
|
width: distance,
|
|
17145
17159
|
height: distance,
|
|
17146
17160
|
solderMaskMargin: distance.optional(),
|
|
17147
|
-
coveredWithSolderMask:
|
|
17161
|
+
coveredWithSolderMask: z63.boolean().optional()
|
|
17148
17162
|
});
|
|
17149
|
-
var holeProps =
|
|
17163
|
+
var holeProps = z63.union([
|
|
17150
17164
|
circleHoleProps,
|
|
17151
17165
|
pillHoleProps,
|
|
17152
17166
|
rectHoleProps
|
|
@@ -17155,55 +17169,55 @@ expectTypesMatch(true);
|
|
|
17155
17169
|
|
|
17156
17170
|
// lib/components/trace.ts
|
|
17157
17171
|
import { distance as distance18, layer_ref as layer_ref4, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
17158
|
-
import { z as
|
|
17159
|
-
var portRef =
|
|
17160
|
-
|
|
17161
|
-
|
|
17172
|
+
import { z as z64 } from "zod";
|
|
17173
|
+
var portRef = z64.union([
|
|
17174
|
+
z64.string(),
|
|
17175
|
+
z64.custom(
|
|
17162
17176
|
(v) => typeof v === "object" && v !== null && "getPortSelector" in v && typeof v.getPortSelector === "function"
|
|
17163
17177
|
)
|
|
17164
17178
|
]);
|
|
17165
17179
|
var pcbPathPoint = point.extend({
|
|
17166
|
-
via:
|
|
17180
|
+
via: z64.boolean().optional(),
|
|
17167
17181
|
fromLayer: layer_ref4.optional(),
|
|
17168
17182
|
toLayer: layer_ref4.optional()
|
|
17169
17183
|
}).superRefine((value, ctx) => {
|
|
17170
17184
|
if (value.via) {
|
|
17171
17185
|
if (!value.toLayer) {
|
|
17172
17186
|
ctx.addIssue({
|
|
17173
|
-
code:
|
|
17187
|
+
code: z64.ZodIssueCode.custom,
|
|
17174
17188
|
message: "toLayer is required when via is true",
|
|
17175
17189
|
path: ["toLayer"]
|
|
17176
17190
|
});
|
|
17177
17191
|
}
|
|
17178
17192
|
} else if (value.fromLayer || value.toLayer) {
|
|
17179
17193
|
ctx.addIssue({
|
|
17180
|
-
code:
|
|
17194
|
+
code: z64.ZodIssueCode.custom,
|
|
17181
17195
|
message: "fromLayer/toLayer are only allowed when via is true",
|
|
17182
17196
|
path: ["via"]
|
|
17183
17197
|
});
|
|
17184
17198
|
}
|
|
17185
17199
|
});
|
|
17186
|
-
var pcbPath =
|
|
17187
|
-
var baseTraceProps =
|
|
17188
|
-
key:
|
|
17200
|
+
var pcbPath = z64.array(z64.union([pcbPathPoint, z64.string()]));
|
|
17201
|
+
var baseTraceProps = z64.object({
|
|
17202
|
+
key: z64.string().optional(),
|
|
17189
17203
|
thickness: distance18.optional(),
|
|
17190
17204
|
width: distance18.optional().describe("Alias for trace thickness"),
|
|
17191
|
-
schematicRouteHints:
|
|
17192
|
-
pcbRouteHints:
|
|
17193
|
-
pcbPathRelativeTo:
|
|
17205
|
+
schematicRouteHints: z64.array(point).optional(),
|
|
17206
|
+
pcbRouteHints: z64.array(route_hint_point2).optional(),
|
|
17207
|
+
pcbPathRelativeTo: z64.string().optional(),
|
|
17194
17208
|
pcbPath: pcbPath.optional(),
|
|
17195
|
-
pcbPaths:
|
|
17196
|
-
routingPhaseIndex:
|
|
17197
|
-
pcbStraightLine:
|
|
17198
|
-
schDisplayLabel:
|
|
17199
|
-
schStroke:
|
|
17200
|
-
highlightColor:
|
|
17209
|
+
pcbPaths: z64.array(pcbPath).optional(),
|
|
17210
|
+
routingPhaseIndex: z64.number().nullable().optional(),
|
|
17211
|
+
pcbStraightLine: z64.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
17212
|
+
schDisplayLabel: z64.string().optional(),
|
|
17213
|
+
schStroke: z64.string().optional(),
|
|
17214
|
+
highlightColor: z64.string().optional(),
|
|
17201
17215
|
maxLength: distance18.optional(),
|
|
17202
|
-
connectsTo:
|
|
17216
|
+
connectsTo: z64.string().or(z64.array(z64.string())).optional()
|
|
17203
17217
|
});
|
|
17204
|
-
var traceProps =
|
|
17218
|
+
var traceProps = z64.union([
|
|
17205
17219
|
baseTraceProps.extend({
|
|
17206
|
-
path:
|
|
17220
|
+
path: z64.array(portRef)
|
|
17207
17221
|
}),
|
|
17208
17222
|
baseTraceProps.extend({
|
|
17209
17223
|
from: portRef,
|
|
@@ -17217,8 +17231,8 @@ var traceProps = z62.union([
|
|
|
17217
17231
|
|
|
17218
17232
|
// lib/components/footprint.ts
|
|
17219
17233
|
import { layer_ref as layer_ref5 } from "circuit-json";
|
|
17220
|
-
import { z as
|
|
17221
|
-
var footprintInsertionDirection =
|
|
17234
|
+
import { z as z65 } from "zod";
|
|
17235
|
+
var footprintInsertionDirection = z65.enum([
|
|
17222
17236
|
"from_above",
|
|
17223
17237
|
"from_left",
|
|
17224
17238
|
"from_right",
|
|
@@ -17226,10 +17240,10 @@ var footprintInsertionDirection = z63.enum([
|
|
|
17226
17240
|
"from_back"
|
|
17227
17241
|
]);
|
|
17228
17242
|
expectTypesMatch(true);
|
|
17229
|
-
var footprintProps =
|
|
17230
|
-
children:
|
|
17243
|
+
var footprintProps = z65.object({
|
|
17244
|
+
children: z65.any().optional(),
|
|
17231
17245
|
originalLayer: layer_ref5.default("top").optional(),
|
|
17232
|
-
circuitJson:
|
|
17246
|
+
circuitJson: z65.array(z65.any()).optional(),
|
|
17233
17247
|
src: footprintProp.describe("Can be a footprint or kicad string").optional(),
|
|
17234
17248
|
insertionDirection: footprintInsertionDirection.optional().describe(
|
|
17235
17249
|
"Direction a cable or mating part is inserted into this footprint in its unrotated orientation."
|
|
@@ -17238,19 +17252,19 @@ var footprintProps = z63.object({
|
|
|
17238
17252
|
expectTypesMatch(true);
|
|
17239
17253
|
|
|
17240
17254
|
// lib/components/symbol.ts
|
|
17241
|
-
import { z as
|
|
17242
|
-
var symbolProps =
|
|
17243
|
-
originalFacingDirection:
|
|
17255
|
+
import { z as z66 } from "zod";
|
|
17256
|
+
var symbolProps = z66.object({
|
|
17257
|
+
originalFacingDirection: z66.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
17244
17258
|
width: distance.optional(),
|
|
17245
17259
|
height: distance.optional(),
|
|
17246
|
-
name:
|
|
17260
|
+
name: z66.string().optional()
|
|
17247
17261
|
});
|
|
17248
17262
|
expectTypesMatch(true);
|
|
17249
17263
|
|
|
17250
17264
|
// lib/components/battery.ts
|
|
17251
17265
|
import { voltage as voltage2 } from "circuit-json";
|
|
17252
|
-
import { z as
|
|
17253
|
-
var capacity =
|
|
17266
|
+
import { z as z67 } from "zod";
|
|
17267
|
+
var capacity = z67.number().or(z67.string().endsWith("mAh")).transform((v) => {
|
|
17254
17268
|
if (typeof v === "string") {
|
|
17255
17269
|
const valString = v.replace("mAh", "");
|
|
17256
17270
|
const num = Number.parseFloat(valString);
|
|
@@ -17264,14 +17278,14 @@ var capacity = z65.number().or(z65.string().endsWith("mAh")).transform((v) => {
|
|
|
17264
17278
|
var batteryProps = commonComponentProps.extend({
|
|
17265
17279
|
capacity: capacity.optional(),
|
|
17266
17280
|
voltage: voltage2.optional(),
|
|
17267
|
-
standard:
|
|
17281
|
+
standard: z67.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
17268
17282
|
schOrientation: schematicOrientation.optional()
|
|
17269
17283
|
});
|
|
17270
17284
|
var batteryPins = lrPolarPins;
|
|
17271
17285
|
expectTypesMatch(true);
|
|
17272
17286
|
|
|
17273
17287
|
// lib/components/mountedboard.ts
|
|
17274
|
-
import { z as
|
|
17288
|
+
import { z as z68 } from "zod";
|
|
17275
17289
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
17276
17290
|
manufacturerPartNumber: chipProps.shape.manufacturerPartNumber,
|
|
17277
17291
|
pinLabels: chipProps.shape.pinLabels,
|
|
@@ -17283,7 +17297,7 @@ var mountedboardProps = subcircuitGroupProps.extend({
|
|
|
17283
17297
|
internallyConnectedPins: chipProps.shape.internallyConnectedPins,
|
|
17284
17298
|
externallyConnectedPins: chipProps.shape.externallyConnectedPins,
|
|
17285
17299
|
boardToBoardDistance: distance.optional(),
|
|
17286
|
-
mountOrientation:
|
|
17300
|
+
mountOrientation: z68.enum(["faceDown", "faceUp"]).optional()
|
|
17287
17301
|
});
|
|
17288
17302
|
expectTypesMatch(true);
|
|
17289
17303
|
|
|
@@ -17291,29 +17305,29 @@ expectTypesMatch(true);
|
|
|
17291
17305
|
import { distance as distance19 } from "circuit-json";
|
|
17292
17306
|
|
|
17293
17307
|
// lib/common/pcbOrientation.ts
|
|
17294
|
-
import { z as
|
|
17295
|
-
var pcbOrientation =
|
|
17308
|
+
import { z as z69 } from "zod";
|
|
17309
|
+
var pcbOrientation = z69.enum(["vertical", "horizontal"]).describe(
|
|
17296
17310
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
17297
17311
|
);
|
|
17298
17312
|
expectTypesMatch(true);
|
|
17299
17313
|
|
|
17300
17314
|
// lib/components/pin-header.ts
|
|
17301
|
-
import { z as
|
|
17315
|
+
import { z as z70 } from "zod";
|
|
17302
17316
|
var pinHeaderProps = commonComponentProps.extend({
|
|
17303
|
-
pinCount:
|
|
17317
|
+
pinCount: z70.number(),
|
|
17304
17318
|
pitch: distance19.optional(),
|
|
17305
|
-
schFacingDirection:
|
|
17306
|
-
gender:
|
|
17307
|
-
showSilkscreenPinLabels:
|
|
17308
|
-
pcbPinLabels:
|
|
17309
|
-
doubleRow:
|
|
17310
|
-
rightAngle:
|
|
17319
|
+
schFacingDirection: z70.enum(["up", "down", "left", "right"]).optional(),
|
|
17320
|
+
gender: z70.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
17321
|
+
showSilkscreenPinLabels: z70.boolean().optional(),
|
|
17322
|
+
pcbPinLabels: z70.record(z70.string(), z70.string()).optional(),
|
|
17323
|
+
doubleRow: z70.boolean().optional(),
|
|
17324
|
+
rightAngle: z70.boolean().optional(),
|
|
17311
17325
|
pcbOrientation: pcbOrientation.optional(),
|
|
17312
17326
|
holeDiameter: distance19.optional(),
|
|
17313
17327
|
platedDiameter: distance19.optional(),
|
|
17314
|
-
pinLabels:
|
|
17315
|
-
connections:
|
|
17316
|
-
facingDirection:
|
|
17328
|
+
pinLabels: z70.record(z70.string(), schematicPinLabel).or(z70.array(schematicPinLabel)).optional(),
|
|
17329
|
+
connections: z70.custom().pipe(z70.record(z70.string(), connectionTarget)).optional(),
|
|
17330
|
+
facingDirection: z70.enum(["left", "right"]).optional(),
|
|
17317
17331
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
17318
17332
|
schPinStyle: schematicPinStyle.optional(),
|
|
17319
17333
|
schPinSpacing: distance19.optional(),
|
|
@@ -17323,29 +17337,29 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
17323
17337
|
expectTypesMatch(true);
|
|
17324
17338
|
|
|
17325
17339
|
// lib/components/netalias.ts
|
|
17326
|
-
import { z as
|
|
17340
|
+
import { z as z71 } from "zod";
|
|
17327
17341
|
import { rotation as rotation3 } from "circuit-json";
|
|
17328
|
-
var netAliasProps =
|
|
17329
|
-
net:
|
|
17330
|
-
connection:
|
|
17342
|
+
var netAliasProps = z71.object({
|
|
17343
|
+
net: z71.string().optional(),
|
|
17344
|
+
connection: z71.string().optional(),
|
|
17331
17345
|
schX: distance.optional(),
|
|
17332
17346
|
schY: distance.optional(),
|
|
17333
17347
|
schRotation: rotation3.optional(),
|
|
17334
|
-
anchorSide:
|
|
17348
|
+
anchorSide: z71.enum(["left", "top", "right", "bottom"]).optional()
|
|
17335
17349
|
});
|
|
17336
17350
|
expectTypesMatch(true);
|
|
17337
17351
|
|
|
17338
17352
|
// lib/components/netlabel.ts
|
|
17339
|
-
import { z as
|
|
17353
|
+
import { z as z72 } from "zod";
|
|
17340
17354
|
import { rotation as rotation4 } from "circuit-json";
|
|
17341
|
-
var netLabelProps =
|
|
17342
|
-
net:
|
|
17343
|
-
connection:
|
|
17344
|
-
connectsTo:
|
|
17355
|
+
var netLabelProps = z72.object({
|
|
17356
|
+
net: z72.string().optional(),
|
|
17357
|
+
connection: z72.string().optional(),
|
|
17358
|
+
connectsTo: z72.string().or(z72.array(z72.string())).optional(),
|
|
17345
17359
|
schX: distance.optional(),
|
|
17346
17360
|
schY: distance.optional(),
|
|
17347
17361
|
schRotation: rotation4.optional(),
|
|
17348
|
-
anchorSide:
|
|
17362
|
+
anchorSide: z72.enum(["left", "top", "right", "bottom"]).optional()
|
|
17349
17363
|
});
|
|
17350
17364
|
expectTypesMatch(true);
|
|
17351
17365
|
|
|
@@ -17360,12 +17374,12 @@ expectTypesMatch(true);
|
|
|
17360
17374
|
|
|
17361
17375
|
// lib/components/analogsimulation.ts
|
|
17362
17376
|
import { ms } from "circuit-json";
|
|
17363
|
-
import { z as
|
|
17364
|
-
var spiceEngine =
|
|
17377
|
+
import { z as z74 } from "zod";
|
|
17378
|
+
var spiceEngine = z74.custom(
|
|
17365
17379
|
(value) => typeof value === "string"
|
|
17366
17380
|
);
|
|
17367
|
-
var analogSimulationProps =
|
|
17368
|
-
simulationType:
|
|
17381
|
+
var analogSimulationProps = z74.object({
|
|
17382
|
+
simulationType: z74.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
17369
17383
|
duration: ms.optional(),
|
|
17370
17384
|
timePerStep: ms.optional(),
|
|
17371
17385
|
spiceEngine: spiceEngine.optional()
|
|
@@ -17375,26 +17389,26 @@ expectTypesMatch(
|
|
|
17375
17389
|
);
|
|
17376
17390
|
|
|
17377
17391
|
// lib/components/autoroutingphase.ts
|
|
17378
|
-
import { z as
|
|
17379
|
-
var autoroutingPhaseProps =
|
|
17380
|
-
key:
|
|
17392
|
+
import { z as z75 } from "zod";
|
|
17393
|
+
var autoroutingPhaseProps = z75.object({
|
|
17394
|
+
key: z75.any().optional(),
|
|
17381
17395
|
autorouter: autorouterProp.optional(),
|
|
17382
|
-
phaseIndex:
|
|
17396
|
+
phaseIndex: z75.number().optional(),
|
|
17383
17397
|
...routingTolerances.shape,
|
|
17384
|
-
region:
|
|
17385
|
-
shape:
|
|
17386
|
-
minX:
|
|
17387
|
-
maxX:
|
|
17388
|
-
minY:
|
|
17389
|
-
maxY:
|
|
17398
|
+
region: z75.object({
|
|
17399
|
+
shape: z75.literal("rect").optional(),
|
|
17400
|
+
minX: z75.number(),
|
|
17401
|
+
maxX: z75.number(),
|
|
17402
|
+
minY: z75.number(),
|
|
17403
|
+
maxY: z75.number()
|
|
17390
17404
|
}).optional(),
|
|
17391
|
-
connection:
|
|
17392
|
-
connections:
|
|
17393
|
-
reroute:
|
|
17405
|
+
connection: z75.string().optional(),
|
|
17406
|
+
connections: z75.array(z75.string()).optional(),
|
|
17407
|
+
reroute: z75.boolean().optional()
|
|
17394
17408
|
}).superRefine((value, ctx) => {
|
|
17395
17409
|
if (value.reroute !== void 0 && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
17396
17410
|
ctx.addIssue({
|
|
17397
|
-
code:
|
|
17411
|
+
code: z75.ZodIssueCode.custom,
|
|
17398
17412
|
message: "region, connection, or connections is required when reroute is provided",
|
|
17399
17413
|
path: ["region"]
|
|
17400
17414
|
});
|
|
@@ -17403,7 +17417,7 @@ var autoroutingPhaseProps = z73.object({
|
|
|
17403
17417
|
expectTypesMatch(true);
|
|
17404
17418
|
|
|
17405
17419
|
// lib/components/transistor.ts
|
|
17406
|
-
import { z as
|
|
17420
|
+
import { z as z76 } from "zod";
|
|
17407
17421
|
var transistorPinsLabels = [
|
|
17408
17422
|
"pin1",
|
|
17409
17423
|
"pin2",
|
|
@@ -17416,7 +17430,7 @@ var transistorPinsLabels = [
|
|
|
17416
17430
|
"drain"
|
|
17417
17431
|
];
|
|
17418
17432
|
var transistorProps = commonComponentProps.extend({
|
|
17419
|
-
type:
|
|
17433
|
+
type: z76.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
17420
17434
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
17421
17435
|
});
|
|
17422
17436
|
var transistorPins = [
|
|
@@ -17430,10 +17444,10 @@ var transistorPins = [
|
|
|
17430
17444
|
expectTypesMatch(true);
|
|
17431
17445
|
|
|
17432
17446
|
// lib/components/mosfet.ts
|
|
17433
|
-
import { z as
|
|
17447
|
+
import { z as z77 } from "zod";
|
|
17434
17448
|
var mosfetProps = commonComponentProps.extend({
|
|
17435
|
-
channelType:
|
|
17436
|
-
mosfetMode:
|
|
17449
|
+
channelType: z77.enum(["n", "p"]),
|
|
17450
|
+
mosfetMode: z77.enum(["enhancement", "depletion"])
|
|
17437
17451
|
});
|
|
17438
17452
|
var mosfetPins = [
|
|
17439
17453
|
"pin1",
|
|
@@ -17462,19 +17476,19 @@ expectTypesMatch(true);
|
|
|
17462
17476
|
|
|
17463
17477
|
// lib/components/inductor.ts
|
|
17464
17478
|
import { inductance } from "circuit-json";
|
|
17465
|
-
import { z as
|
|
17479
|
+
import { z as z79 } from "zod";
|
|
17466
17480
|
var inductorPins = lrPins;
|
|
17467
17481
|
var inductorProps = commonComponentProps.extend({
|
|
17468
17482
|
inductance,
|
|
17469
|
-
maxCurrentRating:
|
|
17483
|
+
maxCurrentRating: z79.union([z79.string(), z79.number()]).optional(),
|
|
17470
17484
|
schOrientation: schematicOrientation.optional(),
|
|
17471
17485
|
connections: createConnectionsProp(inductorPins).optional()
|
|
17472
17486
|
});
|
|
17473
17487
|
expectTypesMatch(true);
|
|
17474
17488
|
|
|
17475
17489
|
// lib/components/diode.ts
|
|
17476
|
-
import { z as
|
|
17477
|
-
var diodeConnectionKeys =
|
|
17490
|
+
import { z as z80 } from "zod";
|
|
17491
|
+
var diodeConnectionKeys = z80.enum([
|
|
17478
17492
|
"anode",
|
|
17479
17493
|
"cathode",
|
|
17480
17494
|
"pin1",
|
|
@@ -17482,9 +17496,9 @@ var diodeConnectionKeys = z78.enum([
|
|
|
17482
17496
|
"pos",
|
|
17483
17497
|
"neg"
|
|
17484
17498
|
]);
|
|
17485
|
-
var connectionTarget3 =
|
|
17486
|
-
var connectionsProp2 =
|
|
17487
|
-
var diodeVariant =
|
|
17499
|
+
var connectionTarget3 = z80.string().or(z80.array(z80.string()).readonly()).or(z80.array(z80.string()));
|
|
17500
|
+
var connectionsProp2 = z80.record(diodeConnectionKeys, connectionTarget3);
|
|
17501
|
+
var diodeVariant = z80.enum([
|
|
17488
17502
|
"standard",
|
|
17489
17503
|
"schottky",
|
|
17490
17504
|
"zener",
|
|
@@ -17495,12 +17509,12 @@ var diodeVariant = z78.enum([
|
|
|
17495
17509
|
var diodeProps = commonComponentProps.extend({
|
|
17496
17510
|
connections: connectionsProp2.optional(),
|
|
17497
17511
|
variant: diodeVariant.optional().default("standard"),
|
|
17498
|
-
standard:
|
|
17499
|
-
schottky:
|
|
17500
|
-
zener:
|
|
17501
|
-
avalanche:
|
|
17502
|
-
photo:
|
|
17503
|
-
tvs:
|
|
17512
|
+
standard: z80.boolean().optional(),
|
|
17513
|
+
schottky: z80.boolean().optional(),
|
|
17514
|
+
zener: z80.boolean().optional(),
|
|
17515
|
+
avalanche: z80.boolean().optional(),
|
|
17516
|
+
photo: z80.boolean().optional(),
|
|
17517
|
+
tvs: z80.boolean().optional(),
|
|
17504
17518
|
schOrientation: schematicOrientation.optional()
|
|
17505
17519
|
}).superRefine((data, ctx) => {
|
|
17506
17520
|
const enabledFlags = [
|
|
@@ -17513,11 +17527,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17513
17527
|
].filter(Boolean).length;
|
|
17514
17528
|
if (enabledFlags > 1) {
|
|
17515
17529
|
ctx.addIssue({
|
|
17516
|
-
code:
|
|
17530
|
+
code: z80.ZodIssueCode.custom,
|
|
17517
17531
|
message: "Exactly one diode variant must be enabled",
|
|
17518
17532
|
path: []
|
|
17519
17533
|
});
|
|
17520
|
-
return
|
|
17534
|
+
return z80.INVALID;
|
|
17521
17535
|
}
|
|
17522
17536
|
}).transform((data) => {
|
|
17523
17537
|
const result = {
|
|
@@ -17564,33 +17578,33 @@ var diodePins = lrPolarPins;
|
|
|
17564
17578
|
expectTypesMatch(true);
|
|
17565
17579
|
|
|
17566
17580
|
// lib/components/led.ts
|
|
17567
|
-
import { z as
|
|
17581
|
+
import { z as z81 } from "zod";
|
|
17568
17582
|
var ledProps = commonComponentProps.extend({
|
|
17569
|
-
color:
|
|
17570
|
-
wavelength:
|
|
17571
|
-
schDisplayValue:
|
|
17583
|
+
color: z81.string().optional(),
|
|
17584
|
+
wavelength: z81.string().optional(),
|
|
17585
|
+
schDisplayValue: z81.string().optional(),
|
|
17572
17586
|
schOrientation: schematicOrientation.optional(),
|
|
17573
17587
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
17574
|
-
laser:
|
|
17588
|
+
laser: z81.boolean().optional()
|
|
17575
17589
|
});
|
|
17576
17590
|
var ledPins = lrPolarPins;
|
|
17577
17591
|
|
|
17578
17592
|
// lib/components/switch.ts
|
|
17579
17593
|
import { ms as ms2, frequency as frequency3 } from "circuit-json";
|
|
17580
|
-
import { z as
|
|
17594
|
+
import { z as z82 } from "zod";
|
|
17581
17595
|
var switchProps = commonComponentProps.extend({
|
|
17582
|
-
type:
|
|
17583
|
-
isNormallyClosed:
|
|
17584
|
-
spst:
|
|
17585
|
-
spdt:
|
|
17586
|
-
dpst:
|
|
17587
|
-
dpdt:
|
|
17596
|
+
type: z82.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
17597
|
+
isNormallyClosed: z82.boolean().optional().default(false),
|
|
17598
|
+
spst: z82.boolean().optional(),
|
|
17599
|
+
spdt: z82.boolean().optional(),
|
|
17600
|
+
dpst: z82.boolean().optional(),
|
|
17601
|
+
dpdt: z82.boolean().optional(),
|
|
17588
17602
|
simSwitchFrequency: frequency3.optional(),
|
|
17589
17603
|
simCloseAt: ms2.optional(),
|
|
17590
17604
|
simOpenAt: ms2.optional(),
|
|
17591
|
-
simStartClosed:
|
|
17592
|
-
simStartOpen:
|
|
17593
|
-
connections:
|
|
17605
|
+
simStartClosed: z82.boolean().optional(),
|
|
17606
|
+
simStartOpen: z82.boolean().optional(),
|
|
17607
|
+
connections: z82.custom().pipe(z82.record(z82.string(), connectionTarget)).optional()
|
|
17594
17608
|
}).transform((props) => {
|
|
17595
17609
|
const updatedProps = { ...props };
|
|
17596
17610
|
if (updatedProps.dpdt) {
|
|
@@ -17622,33 +17636,33 @@ expectTypesMatch(true);
|
|
|
17622
17636
|
|
|
17623
17637
|
// lib/components/fabrication-note-text.ts
|
|
17624
17638
|
import { length as length4 } from "circuit-json";
|
|
17625
|
-
import { z as
|
|
17639
|
+
import { z as z83 } from "zod";
|
|
17626
17640
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
17627
|
-
text:
|
|
17628
|
-
anchorAlignment:
|
|
17629
|
-
font:
|
|
17641
|
+
text: z83.string(),
|
|
17642
|
+
anchorAlignment: z83.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
17643
|
+
font: z83.enum(["tscircuit2024"]).optional(),
|
|
17630
17644
|
fontSize: length4.optional(),
|
|
17631
|
-
color:
|
|
17645
|
+
color: z83.string().optional()
|
|
17632
17646
|
});
|
|
17633
17647
|
expectTypesMatch(true);
|
|
17634
17648
|
|
|
17635
17649
|
// lib/components/fabrication-note-rect.ts
|
|
17636
17650
|
import { distance as distance20 } from "circuit-json";
|
|
17637
|
-
import { z as
|
|
17651
|
+
import { z as z84 } from "zod";
|
|
17638
17652
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17639
17653
|
width: distance20,
|
|
17640
17654
|
height: distance20,
|
|
17641
17655
|
strokeWidth: distance20.optional(),
|
|
17642
|
-
isFilled:
|
|
17643
|
-
hasStroke:
|
|
17644
|
-
isStrokeDashed:
|
|
17645
|
-
color:
|
|
17656
|
+
isFilled: z84.boolean().optional(),
|
|
17657
|
+
hasStroke: z84.boolean().optional(),
|
|
17658
|
+
isStrokeDashed: z84.boolean().optional(),
|
|
17659
|
+
color: z84.string().optional(),
|
|
17646
17660
|
cornerRadius: distance20.optional()
|
|
17647
17661
|
});
|
|
17648
17662
|
|
|
17649
17663
|
// lib/components/fabrication-note-path.ts
|
|
17650
17664
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
17651
|
-
import { z as
|
|
17665
|
+
import { z as z85 } from "zod";
|
|
17652
17666
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
17653
17667
|
pcbLeftEdgeX: true,
|
|
17654
17668
|
pcbRightEdgeX: true,
|
|
@@ -17660,15 +17674,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
17660
17674
|
pcbOffsetY: true,
|
|
17661
17675
|
pcbRotation: true
|
|
17662
17676
|
}).extend({
|
|
17663
|
-
route:
|
|
17677
|
+
route: z85.array(route_hint_point3),
|
|
17664
17678
|
strokeWidth: length5.optional(),
|
|
17665
|
-
color:
|
|
17679
|
+
color: z85.string().optional()
|
|
17666
17680
|
});
|
|
17667
17681
|
|
|
17668
17682
|
// lib/components/fabrication-note-dimension.ts
|
|
17669
17683
|
import { distance as distance21, length as length6 } from "circuit-json";
|
|
17670
|
-
import { z as
|
|
17671
|
-
var dimensionTarget =
|
|
17684
|
+
import { z as z86 } from "zod";
|
|
17685
|
+
var dimensionTarget = z86.union([z86.string(), point]);
|
|
17672
17686
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
17673
17687
|
pcbLeftEdgeX: true,
|
|
17674
17688
|
pcbRightEdgeX: true,
|
|
@@ -17682,54 +17696,54 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
17682
17696
|
}).extend({
|
|
17683
17697
|
from: dimensionTarget,
|
|
17684
17698
|
to: dimensionTarget,
|
|
17685
|
-
text:
|
|
17699
|
+
text: z86.string().optional(),
|
|
17686
17700
|
offset: distance21.optional(),
|
|
17687
|
-
font:
|
|
17701
|
+
font: z86.enum(["tscircuit2024"]).optional(),
|
|
17688
17702
|
fontSize: length6.optional(),
|
|
17689
|
-
color:
|
|
17703
|
+
color: z86.string().optional(),
|
|
17690
17704
|
arrowSize: distance21.optional(),
|
|
17691
|
-
units:
|
|
17692
|
-
outerEdgeToEdge:
|
|
17693
|
-
centerToCenter:
|
|
17694
|
-
innerEdgeToEdge:
|
|
17705
|
+
units: z86.enum(["in", "mm"]).optional(),
|
|
17706
|
+
outerEdgeToEdge: z86.literal(true).optional(),
|
|
17707
|
+
centerToCenter: z86.literal(true).optional(),
|
|
17708
|
+
innerEdgeToEdge: z86.literal(true).optional()
|
|
17695
17709
|
});
|
|
17696
17710
|
expectTypesMatch(true);
|
|
17697
17711
|
|
|
17698
17712
|
// lib/components/pcb-trace.ts
|
|
17699
17713
|
import { distance as distance22, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
17700
|
-
import { z as
|
|
17701
|
-
var pcbTraceProps =
|
|
17702
|
-
layer:
|
|
17714
|
+
import { z as z87 } from "zod";
|
|
17715
|
+
var pcbTraceProps = z87.object({
|
|
17716
|
+
layer: z87.string().optional(),
|
|
17703
17717
|
thickness: distance22.optional(),
|
|
17704
|
-
route:
|
|
17718
|
+
route: z87.array(route_hint_point4)
|
|
17705
17719
|
});
|
|
17706
17720
|
|
|
17707
17721
|
// lib/components/via.ts
|
|
17708
17722
|
import { distance as distance23, layer_ref as layer_ref6 } from "circuit-json";
|
|
17709
|
-
import { z as
|
|
17723
|
+
import { z as z88 } from "zod";
|
|
17710
17724
|
var viaProps = commonLayoutProps.extend({
|
|
17711
|
-
name:
|
|
17725
|
+
name: z88.string().optional(),
|
|
17712
17726
|
fromLayer: layer_ref6.optional(),
|
|
17713
17727
|
toLayer: layer_ref6.optional(),
|
|
17714
17728
|
holeDiameter: distance23.optional(),
|
|
17715
17729
|
outerDiameter: distance23.optional(),
|
|
17716
|
-
layers:
|
|
17717
|
-
connectsTo:
|
|
17718
|
-
netIsAssignable:
|
|
17730
|
+
layers: z88.array(layer_ref6).optional(),
|
|
17731
|
+
connectsTo: z88.string().or(z88.array(z88.string())).optional(),
|
|
17732
|
+
netIsAssignable: z88.boolean().optional()
|
|
17719
17733
|
});
|
|
17720
17734
|
expectTypesMatch(true);
|
|
17721
17735
|
|
|
17722
17736
|
// lib/components/testpoint.ts
|
|
17723
17737
|
import { distance as distance24 } from "circuit-json";
|
|
17724
|
-
import { z as
|
|
17738
|
+
import { z as z89 } from "zod";
|
|
17725
17739
|
var testpointPins = ["pin1"];
|
|
17726
|
-
var testpointConnectionsProp =
|
|
17740
|
+
var testpointConnectionsProp = z89.object({
|
|
17727
17741
|
pin1: connectionTarget
|
|
17728
17742
|
}).strict();
|
|
17729
17743
|
var testpointProps = commonComponentProps.extend({
|
|
17730
17744
|
connections: testpointConnectionsProp.optional(),
|
|
17731
|
-
footprintVariant:
|
|
17732
|
-
padShape:
|
|
17745
|
+
footprintVariant: z89.enum(["pad", "through_hole"]).optional(),
|
|
17746
|
+
padShape: z89.enum(["rect", "circle"]).optional().default("circle"),
|
|
17733
17747
|
padDiameter: distance24.optional(),
|
|
17734
17748
|
holeDiameter: distance24.optional(),
|
|
17735
17749
|
width: distance24.optional(),
|
|
@@ -17741,45 +17755,45 @@ var testpointProps = commonComponentProps.extend({
|
|
|
17741
17755
|
expectTypesMatch(true);
|
|
17742
17756
|
|
|
17743
17757
|
// lib/components/breakoutpoint.ts
|
|
17744
|
-
import { z as
|
|
17758
|
+
import { z as z90 } from "zod";
|
|
17745
17759
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17746
|
-
connection:
|
|
17760
|
+
connection: z90.string()
|
|
17747
17761
|
});
|
|
17748
17762
|
expectTypesMatch(true);
|
|
17749
17763
|
|
|
17750
17764
|
// lib/components/pcb-keepout.ts
|
|
17751
17765
|
import { distance as distance25, layer_ref as layer_ref7 } from "circuit-json";
|
|
17752
|
-
import { z as
|
|
17753
|
-
var pcbKeepoutProps =
|
|
17766
|
+
import { z as z91 } from "zod";
|
|
17767
|
+
var pcbKeepoutProps = z91.union([
|
|
17754
17768
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17755
|
-
shape:
|
|
17769
|
+
shape: z91.literal("circle"),
|
|
17756
17770
|
radius: distance25,
|
|
17757
|
-
layers:
|
|
17771
|
+
layers: z91.array(layer_ref7).optional()
|
|
17758
17772
|
}),
|
|
17759
17773
|
pcbLayoutProps.extend({
|
|
17760
|
-
shape:
|
|
17774
|
+
shape: z91.literal("rect"),
|
|
17761
17775
|
width: distance25,
|
|
17762
17776
|
height: distance25,
|
|
17763
|
-
layers:
|
|
17777
|
+
layers: z91.array(layer_ref7).optional()
|
|
17764
17778
|
})
|
|
17765
17779
|
]);
|
|
17766
17780
|
|
|
17767
17781
|
// lib/components/courtyard-rect.ts
|
|
17768
17782
|
import { distance as distance26 } from "circuit-json";
|
|
17769
|
-
import { z as
|
|
17783
|
+
import { z as z92 } from "zod";
|
|
17770
17784
|
var courtyardRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17771
17785
|
width: distance26,
|
|
17772
17786
|
height: distance26,
|
|
17773
17787
|
strokeWidth: distance26.optional(),
|
|
17774
|
-
isFilled:
|
|
17775
|
-
hasStroke:
|
|
17776
|
-
isStrokeDashed:
|
|
17777
|
-
color:
|
|
17788
|
+
isFilled: z92.boolean().optional(),
|
|
17789
|
+
hasStroke: z92.boolean().optional(),
|
|
17790
|
+
isStrokeDashed: z92.boolean().optional(),
|
|
17791
|
+
color: z92.string().optional()
|
|
17778
17792
|
});
|
|
17779
17793
|
|
|
17780
17794
|
// lib/components/courtyard-outline.ts
|
|
17781
17795
|
import { length as length7 } from "circuit-json";
|
|
17782
|
-
import { z as
|
|
17796
|
+
import { z as z93 } from "zod";
|
|
17783
17797
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
17784
17798
|
pcbLeftEdgeX: true,
|
|
17785
17799
|
pcbRightEdgeX: true,
|
|
@@ -17791,11 +17805,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
17791
17805
|
pcbOffsetY: true,
|
|
17792
17806
|
pcbRotation: true
|
|
17793
17807
|
}).extend({
|
|
17794
|
-
outline:
|
|
17808
|
+
outline: z93.array(point),
|
|
17795
17809
|
strokeWidth: length7.optional(),
|
|
17796
|
-
isClosed:
|
|
17797
|
-
isStrokeDashed:
|
|
17798
|
-
color:
|
|
17810
|
+
isClosed: z93.boolean().optional(),
|
|
17811
|
+
isStrokeDashed: z93.boolean().optional(),
|
|
17812
|
+
color: z93.string().optional()
|
|
17799
17813
|
});
|
|
17800
17814
|
|
|
17801
17815
|
// lib/components/courtyard-circle.ts
|
|
@@ -17815,35 +17829,35 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17815
17829
|
});
|
|
17816
17830
|
|
|
17817
17831
|
// lib/components/copper-pour.ts
|
|
17818
|
-
import { z as
|
|
17832
|
+
import { z as z96 } from "zod";
|
|
17819
17833
|
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
17820
|
-
var copperPourProps =
|
|
17821
|
-
name:
|
|
17834
|
+
var copperPourProps = z96.object({
|
|
17835
|
+
name: z96.string().optional(),
|
|
17822
17836
|
layer: layer_ref8,
|
|
17823
|
-
connectsTo:
|
|
17824
|
-
unbroken:
|
|
17837
|
+
connectsTo: z96.string(),
|
|
17838
|
+
unbroken: z96.boolean().optional(),
|
|
17825
17839
|
padMargin: distance.optional(),
|
|
17826
17840
|
traceMargin: distance.optional(),
|
|
17827
17841
|
clearance: distance.optional(),
|
|
17828
17842
|
boardEdgeMargin: distance.optional(),
|
|
17829
17843
|
cutoutMargin: distance.optional(),
|
|
17830
|
-
outline:
|
|
17831
|
-
coveredWithSolderMask:
|
|
17844
|
+
outline: z96.array(point).optional(),
|
|
17845
|
+
coveredWithSolderMask: z96.boolean().optional().default(true)
|
|
17832
17846
|
});
|
|
17833
17847
|
expectTypesMatch(true);
|
|
17834
17848
|
|
|
17835
17849
|
// lib/components/cadassembly.ts
|
|
17836
17850
|
import { layer_ref as layer_ref9 } from "circuit-json";
|
|
17837
|
-
import { z as
|
|
17838
|
-
var cadassemblyProps =
|
|
17851
|
+
import { z as z97 } from "zod";
|
|
17852
|
+
var cadassemblyProps = z97.object({
|
|
17839
17853
|
originalLayer: layer_ref9.default("top").optional(),
|
|
17840
|
-
children:
|
|
17854
|
+
children: z97.any().optional()
|
|
17841
17855
|
});
|
|
17842
17856
|
expectTypesMatch(true);
|
|
17843
17857
|
|
|
17844
17858
|
// lib/components/cadmodel.ts
|
|
17845
|
-
import { z as
|
|
17846
|
-
var pcbPosition =
|
|
17859
|
+
import { z as z98 } from "zod";
|
|
17860
|
+
var pcbPosition = z98.object({
|
|
17847
17861
|
pcbX: pcbCoordinate.optional(),
|
|
17848
17862
|
pcbY: pcbCoordinate.optional(),
|
|
17849
17863
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -17860,7 +17874,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
17860
17874
|
});
|
|
17861
17875
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
17862
17876
|
expectTypesMatch(true);
|
|
17863
|
-
var cadmodelProps =
|
|
17877
|
+
var cadmodelProps = z98.union([z98.null(), url, cadModelObject]);
|
|
17864
17878
|
|
|
17865
17879
|
// lib/components/power-source.ts
|
|
17866
17880
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -17870,9 +17884,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
17870
17884
|
|
|
17871
17885
|
// lib/components/voltagesource.ts
|
|
17872
17886
|
import { frequency as frequency4, rotation as rotation5, voltage as voltage4 } from "circuit-json";
|
|
17873
|
-
import { z as
|
|
17887
|
+
import { z as z99 } from "zod";
|
|
17874
17888
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17875
|
-
var percentage =
|
|
17889
|
+
var percentage = z99.union([z99.string(), z99.number()]).transform((val) => {
|
|
17876
17890
|
if (typeof val === "string") {
|
|
17877
17891
|
if (val.endsWith("%")) {
|
|
17878
17892
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17881,13 +17895,13 @@ var percentage = z97.union([z97.string(), z97.number()]).transform((val) => {
|
|
|
17881
17895
|
}
|
|
17882
17896
|
return val;
|
|
17883
17897
|
}).pipe(
|
|
17884
|
-
|
|
17898
|
+
z99.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
17885
17899
|
);
|
|
17886
17900
|
var voltageSourceProps = commonComponentProps.extend({
|
|
17887
17901
|
voltage: voltage4.optional(),
|
|
17888
17902
|
frequency: frequency4.optional(),
|
|
17889
17903
|
peakToPeakVoltage: voltage4.optional(),
|
|
17890
|
-
waveShape:
|
|
17904
|
+
waveShape: z99.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
17891
17905
|
phase: rotation5.optional(),
|
|
17892
17906
|
dutyCycle: percentage.optional(),
|
|
17893
17907
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -17897,9 +17911,9 @@ expectTypesMatch(true);
|
|
|
17897
17911
|
|
|
17898
17912
|
// lib/components/currentsource.ts
|
|
17899
17913
|
import { frequency as frequency5, rotation as rotation6, current } from "circuit-json";
|
|
17900
|
-
import { z as
|
|
17914
|
+
import { z as z100 } from "zod";
|
|
17901
17915
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17902
|
-
var percentage2 =
|
|
17916
|
+
var percentage2 = z100.union([z100.string(), z100.number()]).transform((val) => {
|
|
17903
17917
|
if (typeof val === "string") {
|
|
17904
17918
|
if (val.endsWith("%")) {
|
|
17905
17919
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17908,13 +17922,13 @@ var percentage2 = z98.union([z98.string(), z98.number()]).transform((val) => {
|
|
|
17908
17922
|
}
|
|
17909
17923
|
return val;
|
|
17910
17924
|
}).pipe(
|
|
17911
|
-
|
|
17925
|
+
z100.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
17912
17926
|
);
|
|
17913
17927
|
var currentSourceProps = commonComponentProps.extend({
|
|
17914
17928
|
current: current.optional(),
|
|
17915
17929
|
frequency: frequency5.optional(),
|
|
17916
17930
|
peakToPeakCurrent: current.optional(),
|
|
17917
|
-
waveShape:
|
|
17931
|
+
waveShape: z100.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
17918
17932
|
phase: rotation6.optional(),
|
|
17919
17933
|
dutyCycle: percentage2.optional(),
|
|
17920
17934
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
@@ -17923,57 +17937,57 @@ var currentSourcePins = lrPolarPins;
|
|
|
17923
17937
|
expectTypesMatch(true);
|
|
17924
17938
|
|
|
17925
17939
|
// lib/components/voltageprobe.ts
|
|
17926
|
-
import { z as
|
|
17940
|
+
import { z as z101 } from "zod";
|
|
17927
17941
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
17928
|
-
name:
|
|
17929
|
-
connectsTo:
|
|
17930
|
-
referenceTo:
|
|
17931
|
-
color:
|
|
17942
|
+
name: z101.string().optional(),
|
|
17943
|
+
connectsTo: z101.string(),
|
|
17944
|
+
referenceTo: z101.string().optional(),
|
|
17945
|
+
color: z101.string().optional()
|
|
17932
17946
|
});
|
|
17933
17947
|
expectTypesMatch(true);
|
|
17934
17948
|
|
|
17935
17949
|
// lib/components/schematic-arc.ts
|
|
17936
17950
|
import { distance as distance29, point as point5, rotation as rotation7 } from "circuit-json";
|
|
17937
|
-
import { z as
|
|
17938
|
-
var schematicArcProps =
|
|
17951
|
+
import { z as z102 } from "zod";
|
|
17952
|
+
var schematicArcProps = z102.object({
|
|
17939
17953
|
center: point5,
|
|
17940
17954
|
radius: distance29,
|
|
17941
17955
|
startAngleDegrees: rotation7,
|
|
17942
17956
|
endAngleDegrees: rotation7,
|
|
17943
|
-
direction:
|
|
17957
|
+
direction: z102.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
17944
17958
|
strokeWidth: distance29.optional(),
|
|
17945
|
-
color:
|
|
17946
|
-
isDashed:
|
|
17959
|
+
color: z102.string().optional(),
|
|
17960
|
+
isDashed: z102.boolean().optional().default(false)
|
|
17947
17961
|
});
|
|
17948
17962
|
expectTypesMatch(true);
|
|
17949
17963
|
|
|
17950
17964
|
// lib/components/toolingrail.ts
|
|
17951
|
-
import { z as
|
|
17952
|
-
var toolingrailProps =
|
|
17953
|
-
children:
|
|
17965
|
+
import { z as z103 } from "zod";
|
|
17966
|
+
var toolingrailProps = z103.object({
|
|
17967
|
+
children: z103.any().optional()
|
|
17954
17968
|
});
|
|
17955
17969
|
expectTypesMatch(true);
|
|
17956
17970
|
|
|
17957
17971
|
// lib/components/schematic-box.ts
|
|
17958
17972
|
import { distance as distance30 } from "circuit-json";
|
|
17959
|
-
import { z as
|
|
17960
|
-
var schematicBoxProps =
|
|
17973
|
+
import { z as z104 } from "zod";
|
|
17974
|
+
var schematicBoxProps = z104.object({
|
|
17961
17975
|
schX: distance30.optional(),
|
|
17962
17976
|
schY: distance30.optional(),
|
|
17963
17977
|
width: distance30.optional(),
|
|
17964
17978
|
height: distance30.optional(),
|
|
17965
|
-
overlay:
|
|
17979
|
+
overlay: z104.array(z104.string()).optional(),
|
|
17966
17980
|
padding: distance30.optional(),
|
|
17967
17981
|
paddingLeft: distance30.optional(),
|
|
17968
17982
|
paddingRight: distance30.optional(),
|
|
17969
17983
|
paddingTop: distance30.optional(),
|
|
17970
17984
|
paddingBottom: distance30.optional(),
|
|
17971
|
-
title:
|
|
17985
|
+
title: z104.string().optional(),
|
|
17972
17986
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
17973
|
-
titleColor:
|
|
17987
|
+
titleColor: z104.string().optional(),
|
|
17974
17988
|
titleFontSize: distance30.optional(),
|
|
17975
|
-
titleInside:
|
|
17976
|
-
strokeStyle:
|
|
17989
|
+
titleInside: z104.boolean().default(false),
|
|
17990
|
+
strokeStyle: z104.enum(["solid", "dashed"]).default("solid")
|
|
17977
17991
|
}).refine(
|
|
17978
17992
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
17979
17993
|
{
|
|
@@ -17989,15 +18003,15 @@ expectTypesMatch(true);
|
|
|
17989
18003
|
|
|
17990
18004
|
// lib/components/schematic-circle.ts
|
|
17991
18005
|
import { distance as distance31, point as point6 } from "circuit-json";
|
|
17992
|
-
import { z as
|
|
17993
|
-
var schematicCircleProps =
|
|
18006
|
+
import { z as z105 } from "zod";
|
|
18007
|
+
var schematicCircleProps = z105.object({
|
|
17994
18008
|
center: point6,
|
|
17995
18009
|
radius: distance31,
|
|
17996
18010
|
strokeWidth: distance31.optional(),
|
|
17997
|
-
color:
|
|
17998
|
-
isFilled:
|
|
17999
|
-
fillColor:
|
|
18000
|
-
isDashed:
|
|
18011
|
+
color: z105.string().optional(),
|
|
18012
|
+
isFilled: z105.boolean().optional().default(false),
|
|
18013
|
+
fillColor: z105.string().optional(),
|
|
18014
|
+
isDashed: z105.boolean().optional().default(false)
|
|
18001
18015
|
});
|
|
18002
18016
|
expectTypesMatch(
|
|
18003
18017
|
true
|
|
@@ -18005,43 +18019,43 @@ expectTypesMatch(
|
|
|
18005
18019
|
|
|
18006
18020
|
// lib/components/schematic-rect.ts
|
|
18007
18021
|
import { distance as distance32, rotation as rotation8 } from "circuit-json";
|
|
18008
|
-
import { z as
|
|
18009
|
-
var schematicRectProps =
|
|
18022
|
+
import { z as z106 } from "zod";
|
|
18023
|
+
var schematicRectProps = z106.object({
|
|
18010
18024
|
schX: distance32.optional(),
|
|
18011
18025
|
schY: distance32.optional(),
|
|
18012
18026
|
width: distance32,
|
|
18013
18027
|
height: distance32,
|
|
18014
18028
|
rotation: rotation8.default(0),
|
|
18015
18029
|
strokeWidth: distance32.optional(),
|
|
18016
|
-
color:
|
|
18017
|
-
isFilled:
|
|
18018
|
-
fillColor:
|
|
18019
|
-
isDashed:
|
|
18030
|
+
color: z106.string().optional(),
|
|
18031
|
+
isFilled: z106.boolean().optional().default(false),
|
|
18032
|
+
fillColor: z106.string().optional(),
|
|
18033
|
+
isDashed: z106.boolean().optional().default(false),
|
|
18020
18034
|
cornerRadius: distance32.optional()
|
|
18021
18035
|
});
|
|
18022
18036
|
expectTypesMatch(true);
|
|
18023
18037
|
|
|
18024
18038
|
// lib/components/schematic-line.ts
|
|
18025
18039
|
import { distance as distance33 } from "circuit-json";
|
|
18026
|
-
import { z as
|
|
18027
|
-
var schematicLineProps =
|
|
18040
|
+
import { z as z107 } from "zod";
|
|
18041
|
+
var schematicLineProps = z107.object({
|
|
18028
18042
|
x1: distance33,
|
|
18029
18043
|
y1: distance33,
|
|
18030
18044
|
x2: distance33,
|
|
18031
18045
|
y2: distance33,
|
|
18032
18046
|
strokeWidth: distance33.optional(),
|
|
18033
|
-
color:
|
|
18034
|
-
isDashed:
|
|
18047
|
+
color: z107.string().optional(),
|
|
18048
|
+
isDashed: z107.boolean().optional().default(false)
|
|
18035
18049
|
});
|
|
18036
18050
|
expectTypesMatch(true);
|
|
18037
18051
|
|
|
18038
18052
|
// lib/components/schematic-text.ts
|
|
18039
18053
|
import { distance as distance34, rotation as rotation9 } from "circuit-json";
|
|
18040
|
-
import { z as
|
|
18054
|
+
import { z as z109 } from "zod";
|
|
18041
18055
|
|
|
18042
18056
|
// lib/common/fivePointAnchor.ts
|
|
18043
|
-
import { z as
|
|
18044
|
-
var fivePointAnchor =
|
|
18057
|
+
import { z as z108 } from "zod";
|
|
18058
|
+
var fivePointAnchor = z108.enum([
|
|
18045
18059
|
"center",
|
|
18046
18060
|
"left",
|
|
18047
18061
|
"right",
|
|
@@ -18050,37 +18064,37 @@ var fivePointAnchor = z106.enum([
|
|
|
18050
18064
|
]);
|
|
18051
18065
|
|
|
18052
18066
|
// lib/components/schematic-text.ts
|
|
18053
|
-
var schematicTextProps =
|
|
18067
|
+
var schematicTextProps = z109.object({
|
|
18054
18068
|
schX: distance34.optional(),
|
|
18055
18069
|
schY: distance34.optional(),
|
|
18056
|
-
text:
|
|
18057
|
-
fontSize:
|
|
18058
|
-
anchor:
|
|
18059
|
-
color:
|
|
18070
|
+
text: z109.string(),
|
|
18071
|
+
fontSize: z109.number().default(1),
|
|
18072
|
+
anchor: z109.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
18073
|
+
color: z109.string().default("#000000"),
|
|
18060
18074
|
schRotation: rotation9.default(0)
|
|
18061
18075
|
});
|
|
18062
18076
|
expectTypesMatch(true);
|
|
18063
18077
|
|
|
18064
18078
|
// lib/components/schematic-path.ts
|
|
18065
18079
|
import { distance as distance35, point as point8 } from "circuit-json";
|
|
18066
|
-
import { z as
|
|
18067
|
-
var schematicPathProps =
|
|
18068
|
-
points:
|
|
18069
|
-
svgPath:
|
|
18080
|
+
import { z as z110 } from "zod";
|
|
18081
|
+
var schematicPathProps = z110.object({
|
|
18082
|
+
points: z110.array(point8).optional(),
|
|
18083
|
+
svgPath: z110.string().optional(),
|
|
18070
18084
|
strokeWidth: distance35.optional(),
|
|
18071
|
-
strokeColor:
|
|
18072
|
-
isFilled:
|
|
18073
|
-
fillColor:
|
|
18085
|
+
strokeColor: z110.string().optional(),
|
|
18086
|
+
isFilled: z110.boolean().optional().default(false),
|
|
18087
|
+
fillColor: z110.string().optional()
|
|
18074
18088
|
});
|
|
18075
18089
|
expectTypesMatch(true);
|
|
18076
18090
|
|
|
18077
18091
|
// lib/components/schematic-table.ts
|
|
18078
18092
|
import { distance as distance36 } from "circuit-json";
|
|
18079
|
-
import { z as
|
|
18080
|
-
var schematicTableProps =
|
|
18093
|
+
import { z as z111 } from "zod";
|
|
18094
|
+
var schematicTableProps = z111.object({
|
|
18081
18095
|
schX: distance36.optional(),
|
|
18082
18096
|
schY: distance36.optional(),
|
|
18083
|
-
children:
|
|
18097
|
+
children: z111.any().optional(),
|
|
18084
18098
|
cellPadding: distance36.optional(),
|
|
18085
18099
|
borderWidth: distance36.optional(),
|
|
18086
18100
|
anchor: ninePointAnchor.optional(),
|
|
@@ -18090,33 +18104,33 @@ expectTypesMatch(true);
|
|
|
18090
18104
|
|
|
18091
18105
|
// lib/components/schematic-row.ts
|
|
18092
18106
|
import { distance as distance37 } from "circuit-json";
|
|
18093
|
-
import { z as
|
|
18094
|
-
var schematicRowProps =
|
|
18095
|
-
children:
|
|
18107
|
+
import { z as z112 } from "zod";
|
|
18108
|
+
var schematicRowProps = z112.object({
|
|
18109
|
+
children: z112.any().optional(),
|
|
18096
18110
|
height: distance37.optional()
|
|
18097
18111
|
});
|
|
18098
18112
|
expectTypesMatch(true);
|
|
18099
18113
|
|
|
18100
18114
|
// lib/components/schematic-cell.ts
|
|
18101
18115
|
import { distance as distance38 } from "circuit-json";
|
|
18102
|
-
import { z as
|
|
18103
|
-
var schematicCellProps =
|
|
18104
|
-
children:
|
|
18105
|
-
horizontalAlign:
|
|
18106
|
-
verticalAlign:
|
|
18116
|
+
import { z as z113 } from "zod";
|
|
18117
|
+
var schematicCellProps = z113.object({
|
|
18118
|
+
children: z113.string().optional(),
|
|
18119
|
+
horizontalAlign: z113.enum(["left", "center", "right"]).optional(),
|
|
18120
|
+
verticalAlign: z113.enum(["top", "middle", "bottom"]).optional(),
|
|
18107
18121
|
fontSize: distance38.optional(),
|
|
18108
|
-
rowSpan:
|
|
18109
|
-
colSpan:
|
|
18122
|
+
rowSpan: z113.number().optional(),
|
|
18123
|
+
colSpan: z113.number().optional(),
|
|
18110
18124
|
width: distance38.optional(),
|
|
18111
|
-
text:
|
|
18125
|
+
text: z113.string().optional()
|
|
18112
18126
|
});
|
|
18113
18127
|
expectTypesMatch(true);
|
|
18114
18128
|
|
|
18115
18129
|
// lib/components/schematic-section.ts
|
|
18116
|
-
import { z as
|
|
18117
|
-
var schematicSectionProps =
|
|
18118
|
-
displayName:
|
|
18119
|
-
name:
|
|
18130
|
+
import { z as z114 } from "zod";
|
|
18131
|
+
var schematicSectionProps = z114.object({
|
|
18132
|
+
displayName: z114.string().optional(),
|
|
18133
|
+
name: z114.string()
|
|
18120
18134
|
});
|
|
18121
18135
|
expectTypesMatch(
|
|
18122
18136
|
true
|
|
@@ -18124,40 +18138,40 @@ expectTypesMatch(
|
|
|
18124
18138
|
|
|
18125
18139
|
// lib/components/copper-text.ts
|
|
18126
18140
|
import { layer_ref as layer_ref10, length as length8 } from "circuit-json";
|
|
18127
|
-
import { z as
|
|
18141
|
+
import { z as z115 } from "zod";
|
|
18128
18142
|
var copperTextProps = pcbLayoutProps.extend({
|
|
18129
|
-
text:
|
|
18143
|
+
text: z115.string(),
|
|
18130
18144
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18131
|
-
font:
|
|
18145
|
+
font: z115.enum(["tscircuit2024"]).optional(),
|
|
18132
18146
|
fontSize: length8.optional(),
|
|
18133
|
-
layers:
|
|
18134
|
-
knockout:
|
|
18135
|
-
mirrored:
|
|
18147
|
+
layers: z115.array(layer_ref10).optional(),
|
|
18148
|
+
knockout: z115.boolean().optional(),
|
|
18149
|
+
mirrored: z115.boolean().optional()
|
|
18136
18150
|
});
|
|
18137
18151
|
|
|
18138
18152
|
// lib/components/silkscreen-text.ts
|
|
18139
18153
|
import { layer_ref as layer_ref11, length as length9 } from "circuit-json";
|
|
18140
|
-
import { z as
|
|
18154
|
+
import { z as z116 } from "zod";
|
|
18141
18155
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
18142
|
-
text:
|
|
18156
|
+
text: z116.string(),
|
|
18143
18157
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18144
|
-
font:
|
|
18158
|
+
font: z116.enum(["tscircuit2024"]).optional(),
|
|
18145
18159
|
fontSize: length9.optional(),
|
|
18146
18160
|
/**
|
|
18147
18161
|
* If true, text will knock out underlying silkscreen
|
|
18148
18162
|
*/
|
|
18149
|
-
isKnockout:
|
|
18163
|
+
isKnockout: z116.boolean().optional(),
|
|
18150
18164
|
knockoutPadding: length9.optional(),
|
|
18151
18165
|
knockoutPaddingLeft: length9.optional(),
|
|
18152
18166
|
knockoutPaddingRight: length9.optional(),
|
|
18153
18167
|
knockoutPaddingTop: length9.optional(),
|
|
18154
18168
|
knockoutPaddingBottom: length9.optional(),
|
|
18155
|
-
layers:
|
|
18169
|
+
layers: z116.array(layer_ref11).optional()
|
|
18156
18170
|
});
|
|
18157
18171
|
|
|
18158
18172
|
// lib/components/silkscreen-path.ts
|
|
18159
18173
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
18160
|
-
import { z as
|
|
18174
|
+
import { z as z117 } from "zod";
|
|
18161
18175
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
18162
18176
|
pcbLeftEdgeX: true,
|
|
18163
18177
|
pcbRightEdgeX: true,
|
|
@@ -18169,7 +18183,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
18169
18183
|
pcbOffsetY: true,
|
|
18170
18184
|
pcbRotation: true
|
|
18171
18185
|
}).extend({
|
|
18172
|
-
route:
|
|
18186
|
+
route: z117.array(route_hint_point5),
|
|
18173
18187
|
strokeWidth: length10.optional()
|
|
18174
18188
|
});
|
|
18175
18189
|
|
|
@@ -18191,10 +18205,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
18191
18205
|
|
|
18192
18206
|
// lib/components/silkscreen-rect.ts
|
|
18193
18207
|
import { distance as distance40 } from "circuit-json";
|
|
18194
|
-
import { z as
|
|
18208
|
+
import { z as z118 } from "zod";
|
|
18195
18209
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18196
|
-
filled:
|
|
18197
|
-
stroke:
|
|
18210
|
+
filled: z118.boolean().default(true).optional(),
|
|
18211
|
+
stroke: z118.enum(["dashed", "solid", "none"]).optional(),
|
|
18198
18212
|
strokeWidth: distance40.optional(),
|
|
18199
18213
|
width: distance40,
|
|
18200
18214
|
height: distance40,
|
|
@@ -18203,73 +18217,73 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
18203
18217
|
|
|
18204
18218
|
// lib/components/silkscreen-circle.ts
|
|
18205
18219
|
import { distance as distance41 } from "circuit-json";
|
|
18206
|
-
import { z as
|
|
18220
|
+
import { z as z119 } from "zod";
|
|
18207
18221
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18208
|
-
isFilled:
|
|
18209
|
-
isOutline:
|
|
18222
|
+
isFilled: z119.boolean().optional(),
|
|
18223
|
+
isOutline: z119.boolean().optional(),
|
|
18210
18224
|
strokeWidth: distance41.optional(),
|
|
18211
18225
|
radius: distance41
|
|
18212
18226
|
});
|
|
18213
18227
|
|
|
18214
18228
|
// lib/components/trace-hint.ts
|
|
18215
18229
|
import { distance as distance42, layer_ref as layer_ref12, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
18216
|
-
import { z as
|
|
18217
|
-
var routeHintPointProps =
|
|
18230
|
+
import { z as z120 } from "zod";
|
|
18231
|
+
var routeHintPointProps = z120.object({
|
|
18218
18232
|
x: distance42,
|
|
18219
18233
|
y: distance42,
|
|
18220
|
-
via:
|
|
18234
|
+
via: z120.boolean().optional(),
|
|
18221
18235
|
toLayer: layer_ref12.optional()
|
|
18222
18236
|
});
|
|
18223
|
-
var traceHintProps =
|
|
18224
|
-
for:
|
|
18237
|
+
var traceHintProps = z120.object({
|
|
18238
|
+
for: z120.string().optional().describe(
|
|
18225
18239
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
18226
18240
|
),
|
|
18227
|
-
order:
|
|
18241
|
+
order: z120.number().optional(),
|
|
18228
18242
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
18229
|
-
offsets:
|
|
18230
|
-
traceWidth:
|
|
18243
|
+
offsets: z120.array(route_hint_point6).or(z120.array(routeHintPointProps)).optional(),
|
|
18244
|
+
traceWidth: z120.number().optional()
|
|
18231
18245
|
});
|
|
18232
18246
|
|
|
18233
18247
|
// lib/components/port.ts
|
|
18234
|
-
import { z as
|
|
18248
|
+
import { z as z121 } from "zod";
|
|
18235
18249
|
var portProps = commonLayoutProps.extend({
|
|
18236
|
-
name:
|
|
18237
|
-
pinNumber:
|
|
18238
|
-
schStemLength:
|
|
18239
|
-
aliases:
|
|
18240
|
-
layer:
|
|
18241
|
-
layers:
|
|
18242
|
-
schX:
|
|
18243
|
-
schY:
|
|
18250
|
+
name: z121.string().optional(),
|
|
18251
|
+
pinNumber: z121.number().optional(),
|
|
18252
|
+
schStemLength: z121.number().optional(),
|
|
18253
|
+
aliases: z121.array(z121.string()).optional(),
|
|
18254
|
+
layer: z121.string().optional(),
|
|
18255
|
+
layers: z121.array(z121.string()).optional(),
|
|
18256
|
+
schX: z121.number().optional(),
|
|
18257
|
+
schY: z121.number().optional(),
|
|
18244
18258
|
direction: direction.optional(),
|
|
18245
|
-
connectsTo:
|
|
18259
|
+
connectsTo: z121.string().or(z121.array(z121.string())).optional(),
|
|
18246
18260
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
18247
|
-
hasInversionCircle:
|
|
18261
|
+
hasInversionCircle: z121.boolean().optional()
|
|
18248
18262
|
});
|
|
18249
18263
|
|
|
18250
18264
|
// lib/components/pcb-note-text.ts
|
|
18251
18265
|
import { length as length11 } from "circuit-json";
|
|
18252
|
-
import { z as
|
|
18266
|
+
import { z as z122 } from "zod";
|
|
18253
18267
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
18254
|
-
text:
|
|
18255
|
-
anchorAlignment:
|
|
18256
|
-
font:
|
|
18268
|
+
text: z122.string(),
|
|
18269
|
+
anchorAlignment: z122.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18270
|
+
font: z122.enum(["tscircuit2024"]).optional(),
|
|
18257
18271
|
fontSize: length11.optional(),
|
|
18258
|
-
color:
|
|
18272
|
+
color: z122.string().optional()
|
|
18259
18273
|
});
|
|
18260
18274
|
expectTypesMatch(true);
|
|
18261
18275
|
|
|
18262
18276
|
// lib/components/pcb-note-rect.ts
|
|
18263
18277
|
import { distance as distance43 } from "circuit-json";
|
|
18264
|
-
import { z as
|
|
18278
|
+
import { z as z123 } from "zod";
|
|
18265
18279
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18266
18280
|
width: distance43,
|
|
18267
18281
|
height: distance43,
|
|
18268
18282
|
strokeWidth: distance43.optional(),
|
|
18269
|
-
isFilled:
|
|
18270
|
-
hasStroke:
|
|
18271
|
-
isStrokeDashed:
|
|
18272
|
-
color:
|
|
18283
|
+
isFilled: z123.boolean().optional(),
|
|
18284
|
+
hasStroke: z123.boolean().optional(),
|
|
18285
|
+
isStrokeDashed: z123.boolean().optional(),
|
|
18286
|
+
color: z123.string().optional(),
|
|
18273
18287
|
cornerRadius: distance43.optional()
|
|
18274
18288
|
});
|
|
18275
18289
|
expectTypesMatch(true);
|
|
@@ -18279,7 +18293,7 @@ import {
|
|
|
18279
18293
|
length as length12,
|
|
18280
18294
|
route_hint_point as route_hint_point7
|
|
18281
18295
|
} from "circuit-json";
|
|
18282
|
-
import { z as
|
|
18296
|
+
import { z as z124 } from "zod";
|
|
18283
18297
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
18284
18298
|
pcbLeftEdgeX: true,
|
|
18285
18299
|
pcbRightEdgeX: true,
|
|
@@ -18291,15 +18305,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
18291
18305
|
pcbOffsetY: true,
|
|
18292
18306
|
pcbRotation: true
|
|
18293
18307
|
}).extend({
|
|
18294
|
-
route:
|
|
18308
|
+
route: z124.array(route_hint_point7),
|
|
18295
18309
|
strokeWidth: length12.optional(),
|
|
18296
|
-
color:
|
|
18310
|
+
color: z124.string().optional()
|
|
18297
18311
|
});
|
|
18298
18312
|
expectTypesMatch(true);
|
|
18299
18313
|
|
|
18300
18314
|
// lib/components/pcb-note-line.ts
|
|
18301
18315
|
import { distance as distance44 } from "circuit-json";
|
|
18302
|
-
import { z as
|
|
18316
|
+
import { z as z125 } from "zod";
|
|
18303
18317
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
18304
18318
|
pcbLeftEdgeX: true,
|
|
18305
18319
|
pcbRightEdgeX: true,
|
|
@@ -18316,15 +18330,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
18316
18330
|
x2: distance44,
|
|
18317
18331
|
y2: distance44,
|
|
18318
18332
|
strokeWidth: distance44.optional(),
|
|
18319
|
-
color:
|
|
18320
|
-
isDashed:
|
|
18333
|
+
color: z125.string().optional(),
|
|
18334
|
+
isDashed: z125.boolean().optional()
|
|
18321
18335
|
});
|
|
18322
18336
|
expectTypesMatch(true);
|
|
18323
18337
|
|
|
18324
18338
|
// lib/components/pcb-note-dimension.ts
|
|
18325
18339
|
import { distance as distance45, length as length13 } from "circuit-json";
|
|
18326
|
-
import { z as
|
|
18327
|
-
var dimensionTarget2 =
|
|
18340
|
+
import { z as z126 } from "zod";
|
|
18341
|
+
var dimensionTarget2 = z126.union([z126.string(), point]);
|
|
18328
18342
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
18329
18343
|
pcbLeftEdgeX: true,
|
|
18330
18344
|
pcbRightEdgeX: true,
|
|
@@ -18338,101 +18352,101 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18338
18352
|
}).extend({
|
|
18339
18353
|
from: dimensionTarget2,
|
|
18340
18354
|
to: dimensionTarget2,
|
|
18341
|
-
text:
|
|
18355
|
+
text: z126.string().optional(),
|
|
18342
18356
|
offset: distance45.optional(),
|
|
18343
|
-
font:
|
|
18357
|
+
font: z126.enum(["tscircuit2024"]).optional(),
|
|
18344
18358
|
fontSize: length13.optional(),
|
|
18345
|
-
color:
|
|
18359
|
+
color: z126.string().optional(),
|
|
18346
18360
|
arrowSize: distance45.optional(),
|
|
18347
|
-
units:
|
|
18348
|
-
outerEdgeToEdge:
|
|
18349
|
-
centerToCenter:
|
|
18350
|
-
innerEdgeToEdge:
|
|
18361
|
+
units: z126.enum(["in", "mm"]).optional(),
|
|
18362
|
+
outerEdgeToEdge: z126.literal(true).optional(),
|
|
18363
|
+
centerToCenter: z126.literal(true).optional(),
|
|
18364
|
+
innerEdgeToEdge: z126.literal(true).optional()
|
|
18351
18365
|
});
|
|
18352
18366
|
expectTypesMatch(
|
|
18353
18367
|
true
|
|
18354
18368
|
);
|
|
18355
18369
|
|
|
18356
18370
|
// lib/platformConfig.ts
|
|
18357
|
-
import { z as
|
|
18358
|
-
var unvalidatedCircuitJson =
|
|
18359
|
-
var footprintLibraryResult =
|
|
18360
|
-
footprintCircuitJson:
|
|
18371
|
+
import { z as z127 } from "zod";
|
|
18372
|
+
var unvalidatedCircuitJson = z127.array(z127.any()).describe("Circuit JSON");
|
|
18373
|
+
var footprintLibraryResult = z127.object({
|
|
18374
|
+
footprintCircuitJson: z127.array(z127.any()),
|
|
18361
18375
|
cadModel: cadModelProp.optional()
|
|
18362
18376
|
});
|
|
18363
|
-
var pathToCircuitJsonFn =
|
|
18364
|
-
|
|
18365
|
-
|
|
18366
|
-
|
|
18367
|
-
).returns(
|
|
18377
|
+
var pathToCircuitJsonFn = z127.function().args(z127.string()).returns(z127.promise(footprintLibraryResult)).or(
|
|
18378
|
+
z127.function().args(
|
|
18379
|
+
z127.string(),
|
|
18380
|
+
z127.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
18381
|
+
).returns(z127.promise(footprintLibraryResult))
|
|
18368
18382
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
18369
|
-
var footprintFileParserEntry =
|
|
18370
|
-
loadFromUrl:
|
|
18383
|
+
var footprintFileParserEntry = z127.object({
|
|
18384
|
+
loadFromUrl: z127.function().args(z127.string()).returns(z127.promise(footprintLibraryResult)).describe(
|
|
18371
18385
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
18372
18386
|
)
|
|
18373
18387
|
});
|
|
18374
|
-
var spiceEngineSimulationResult =
|
|
18375
|
-
engineVersionString:
|
|
18388
|
+
var spiceEngineSimulationResult = z127.object({
|
|
18389
|
+
engineVersionString: z127.string().optional(),
|
|
18376
18390
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
18377
18391
|
});
|
|
18378
|
-
var spiceEngineZod =
|
|
18379
|
-
simulate:
|
|
18392
|
+
var spiceEngineZod = z127.object({
|
|
18393
|
+
simulate: z127.function().args(z127.string()).returns(z127.promise(spiceEngineSimulationResult)).describe(
|
|
18380
18394
|
"A function that takes a SPICE string and returns a simulation result"
|
|
18381
18395
|
)
|
|
18382
18396
|
});
|
|
18383
|
-
var defaultSpiceEngine =
|
|
18397
|
+
var defaultSpiceEngine = z127.custom(
|
|
18384
18398
|
(value) => typeof value === "string"
|
|
18385
18399
|
);
|
|
18386
|
-
var autorouterInstance =
|
|
18387
|
-
run:
|
|
18388
|
-
getOutputSimpleRouteJson:
|
|
18400
|
+
var autorouterInstance = z127.object({
|
|
18401
|
+
run: z127.function().args().returns(z127.promise(z127.unknown())).describe("Run the autorouter"),
|
|
18402
|
+
getOutputSimpleRouteJson: z127.function().args().returns(z127.promise(z127.any())).describe("Get the resulting SimpleRouteJson")
|
|
18389
18403
|
});
|
|
18390
|
-
var autorouterDefinition =
|
|
18391
|
-
createAutorouter:
|
|
18404
|
+
var autorouterDefinition = z127.object({
|
|
18405
|
+
createAutorouter: z127.function().args(z127.any(), z127.any().optional()).returns(z127.union([autorouterInstance, z127.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
18392
18406
|
});
|
|
18393
|
-
var platformFetch =
|
|
18394
|
-
var platformConfig =
|
|
18407
|
+
var platformFetch = z127.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
18408
|
+
var platformConfig = z127.object({
|
|
18395
18409
|
partsEngine: partsEngine.optional(),
|
|
18396
18410
|
autorouter: autorouterProp.optional(),
|
|
18397
|
-
autorouterMap:
|
|
18411
|
+
autorouterMap: z127.record(z127.string(), autorouterDefinition).optional(),
|
|
18398
18412
|
registryApiUrl: url.optional(),
|
|
18399
18413
|
cloudAutorouterUrl: url.optional(),
|
|
18400
|
-
projectName:
|
|
18414
|
+
projectName: z127.string().optional(),
|
|
18401
18415
|
projectBaseUrl: url.optional(),
|
|
18402
|
-
version:
|
|
18416
|
+
version: z127.string().optional(),
|
|
18403
18417
|
url: url.optional(),
|
|
18404
|
-
printBoardInformationToSilkscreen:
|
|
18405
|
-
includeBoardFiles:
|
|
18418
|
+
printBoardInformationToSilkscreen: z127.boolean().optional(),
|
|
18419
|
+
includeBoardFiles: z127.array(z127.string()).describe(
|
|
18406
18420
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
18407
18421
|
).optional(),
|
|
18408
|
-
snapshotsDir:
|
|
18422
|
+
snapshotsDir: z127.string().describe(
|
|
18409
18423
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
18410
18424
|
).optional(),
|
|
18411
18425
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
18412
|
-
unitPreference:
|
|
18413
|
-
localCacheEngine:
|
|
18414
|
-
pcbDisabled:
|
|
18415
|
-
routingDisabled:
|
|
18416
|
-
schematicDisabled:
|
|
18417
|
-
partsEngineDisabled:
|
|
18418
|
-
drcChecksDisabled:
|
|
18419
|
-
netlistDrcChecksDisabled:
|
|
18420
|
-
routingDrcChecksDisabled:
|
|
18421
|
-
placementDrcChecksDisabled:
|
|
18422
|
-
pinSpecificationDrcChecksDisabled:
|
|
18423
|
-
spiceEngineMap:
|
|
18424
|
-
footprintLibraryMap:
|
|
18425
|
-
|
|
18426
|
-
|
|
18426
|
+
unitPreference: z127.enum(["mm", "in", "mil"]).optional(),
|
|
18427
|
+
localCacheEngine: z127.any().optional(),
|
|
18428
|
+
pcbDisabled: z127.boolean().optional(),
|
|
18429
|
+
routingDisabled: z127.boolean().optional(),
|
|
18430
|
+
schematicDisabled: z127.boolean().optional(),
|
|
18431
|
+
partsEngineDisabled: z127.boolean().optional(),
|
|
18432
|
+
drcChecksDisabled: z127.boolean().optional(),
|
|
18433
|
+
netlistDrcChecksDisabled: z127.boolean().optional(),
|
|
18434
|
+
routingDrcChecksDisabled: z127.boolean().optional(),
|
|
18435
|
+
placementDrcChecksDisabled: z127.boolean().optional(),
|
|
18436
|
+
pinSpecificationDrcChecksDisabled: z127.boolean().optional(),
|
|
18437
|
+
spiceEngineMap: z127.record(z127.string(), spiceEngineZod).optional(),
|
|
18438
|
+
footprintLibraryMap: z127.record(
|
|
18439
|
+
z127.string(),
|
|
18440
|
+
z127.union([
|
|
18427
18441
|
pathToCircuitJsonFn,
|
|
18428
|
-
|
|
18429
|
-
|
|
18430
|
-
|
|
18442
|
+
z127.record(
|
|
18443
|
+
z127.string(),
|
|
18444
|
+
z127.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
18431
18445
|
)
|
|
18432
18446
|
])
|
|
18433
18447
|
).optional(),
|
|
18434
|
-
footprintFileParserMap:
|
|
18435
|
-
resolveProjectStaticFileImportUrl:
|
|
18448
|
+
footprintFileParserMap: z127.record(z127.string(), footprintFileParserEntry).optional(),
|
|
18449
|
+
resolveProjectStaticFileImportUrl: z127.function().args(z127.string()).returns(z127.promise(z127.string())).describe(
|
|
18436
18450
|
"A function that returns a string URL for static files for the project"
|
|
18437
18451
|
).optional(),
|
|
18438
18452
|
platformFetch: platformFetch.optional()
|
|
@@ -18506,12 +18520,14 @@ export {
|
|
|
18506
18520
|
currentSourcePinLabels,
|
|
18507
18521
|
currentSourcePins,
|
|
18508
18522
|
currentSourceProps,
|
|
18523
|
+
customDrcCheckFn,
|
|
18509
18524
|
cutoutProps,
|
|
18510
18525
|
diodePins,
|
|
18511
18526
|
diodeProps,
|
|
18512
18527
|
direction,
|
|
18513
18528
|
directionAlongEdge,
|
|
18514
18529
|
distanceOrMultiplier,
|
|
18530
|
+
drcCheckProps,
|
|
18515
18531
|
edit_component_location_event,
|
|
18516
18532
|
edit_pcb_component_location_event,
|
|
18517
18533
|
edit_pcb_group_location_event,
|