@tscircuit/props 0.0.207 → 0.0.208

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1134,18 +1134,34 @@ var viaProps = commonLayoutProps.extend({
1134
1134
  outerDiameter: distance15
1135
1135
  });
1136
1136
 
1137
- // lib/components/pcb-keepout.ts
1137
+ // lib/components/testpoint.ts
1138
1138
  import { distance as distance16 } from "circuit-json";
1139
1139
  import { z as z57 } from "zod";
1140
- var pcbKeepoutProps = z57.union([
1140
+ var testpointProps = commonComponentProps.extend({
1141
+ footprintVariant: z57.enum(["pad", "through_hole"]).optional().default("pad"),
1142
+ padShape: z57.enum(["rect", "circle"]).optional().default("circle"),
1143
+ padDiameter: distance16.optional(),
1144
+ holeDiameter: distance16.optional(),
1145
+ width: distance16.optional(),
1146
+ height: distance16.optional()
1147
+ }).refine(
1148
+ (props) => props.footprintVariant === "pad" || props.holeDiameter !== void 0,
1149
+ { message: "holeDiameter is required for through_hole testpoints" }
1150
+ );
1151
+ expectTypesMatch(true);
1152
+
1153
+ // lib/components/pcb-keepout.ts
1154
+ import { distance as distance17 } from "circuit-json";
1155
+ import { z as z58 } from "zod";
1156
+ var pcbKeepoutProps = z58.union([
1141
1157
  pcbLayoutProps.omit({ pcbRotation: true }).extend({
1142
- shape: z57.literal("circle"),
1143
- radius: distance16
1158
+ shape: z58.literal("circle"),
1159
+ radius: distance17
1144
1160
  }),
1145
1161
  pcbLayoutProps.extend({
1146
- shape: z57.literal("rect"),
1147
- width: distance16,
1148
- height: distance16
1162
+ shape: z58.literal("rect"),
1163
+ width: distance17,
1164
+ height: distance17
1149
1165
  })
1150
1166
  ]);
1151
1167
 
@@ -1156,12 +1172,12 @@ var powerSourceProps = commonComponentProps.extend({
1156
1172
  });
1157
1173
 
1158
1174
  // lib/components/schematic-box.ts
1159
- import { distance as distance17 } from "circuit-json";
1160
- import { z as z59 } from "zod";
1175
+ import { distance as distance18 } from "circuit-json";
1176
+ import { z as z60 } from "zod";
1161
1177
 
1162
1178
  // lib/common/nine_point_anchor.ts
1163
- import { z as z58 } from "zod";
1164
- var nine_point_anchor = z58.enum([
1179
+ import { z as z59 } from "zod";
1180
+ var nine_point_anchor = z59.enum([
1165
1181
  "top_left",
1166
1182
  "top_center",
1167
1183
  "top_right",
@@ -1174,23 +1190,23 @@ var nine_point_anchor = z58.enum([
1174
1190
  ]);
1175
1191
 
1176
1192
  // lib/components/schematic-box.ts
1177
- var schematicBoxProps = z59.object({
1178
- schX: distance17,
1179
- schY: distance17,
1180
- width: distance17.optional(),
1181
- height: distance17.optional(),
1182
- overlay: z59.array(z59.string()).optional(),
1183
- padding: distance17.optional(),
1184
- paddingLeft: distance17.optional(),
1185
- paddingRight: distance17.optional(),
1186
- paddingTop: distance17.optional(),
1187
- paddingBottom: distance17.optional(),
1188
- title: z59.string().optional(),
1193
+ var schematicBoxProps = z60.object({
1194
+ schX: distance18,
1195
+ schY: distance18,
1196
+ width: distance18.optional(),
1197
+ height: distance18.optional(),
1198
+ overlay: z60.array(z60.string()).optional(),
1199
+ padding: distance18.optional(),
1200
+ paddingLeft: distance18.optional(),
1201
+ paddingRight: distance18.optional(),
1202
+ paddingTop: distance18.optional(),
1203
+ paddingBottom: distance18.optional(),
1204
+ title: z60.string().optional(),
1189
1205
  titlePosition: nine_point_anchor.default("top_left"),
1190
- titleColor: z59.string().optional(),
1191
- titleFontSize: distance17.optional(),
1192
- titleInside: z59.boolean().default(false),
1193
- strokeStyle: z59.enum(["solid", "dashed"]).default("solid")
1206
+ titleColor: z60.string().optional(),
1207
+ titleFontSize: distance18.optional(),
1208
+ titleInside: z60.boolean().default(false),
1209
+ strokeStyle: z60.enum(["solid", "dashed"]).default("solid")
1194
1210
  }).refine(
1195
1211
  (elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
1196
1212
  {
@@ -1204,22 +1220,22 @@ var schematicBoxProps = z59.object({
1204
1220
  );
1205
1221
 
1206
1222
  // lib/components/schematic-line.ts
1207
- import { distance as distance18 } from "circuit-json";
1208
- import { z as z60 } from "zod";
1209
- var schematicLineProps = z60.object({
1210
- x1: distance18,
1211
- y1: distance18,
1212
- x2: distance18,
1213
- y2: distance18
1223
+ import { distance as distance19 } from "circuit-json";
1224
+ import { z as z61 } from "zod";
1225
+ var schematicLineProps = z61.object({
1226
+ x1: distance19,
1227
+ y1: distance19,
1228
+ x2: distance19,
1229
+ y2: distance19
1214
1230
  });
1215
1231
 
1216
1232
  // lib/components/schematic-text.ts
1217
- import { distance as distance19, rotation as rotation3 } from "circuit-json";
1218
- import { z as z62 } from "zod";
1233
+ import { distance as distance20, rotation as rotation3 } from "circuit-json";
1234
+ import { z as z63 } from "zod";
1219
1235
 
1220
1236
  // lib/common/five_point_anchor.ts
1221
- import { z as z61 } from "zod";
1222
- var five_point_anchor = z61.enum([
1237
+ import { z as z62 } from "zod";
1238
+ var five_point_anchor = z62.enum([
1223
1239
  "center",
1224
1240
  "left",
1225
1241
  "right",
@@ -1228,120 +1244,120 @@ var five_point_anchor = z61.enum([
1228
1244
  ]);
1229
1245
 
1230
1246
  // lib/components/schematic-text.ts
1231
- var schematicTextProps = z62.object({
1232
- schX: distance19,
1233
- schY: distance19,
1234
- text: z62.string(),
1235
- fontSize: z62.number().default(1),
1236
- anchor: z62.union([five_point_anchor.describe("legacy"), nine_point_anchor]).default("center"),
1237
- color: z62.string().default("#000000"),
1247
+ var schematicTextProps = z63.object({
1248
+ schX: distance20,
1249
+ schY: distance20,
1250
+ text: z63.string(),
1251
+ fontSize: z63.number().default(1),
1252
+ anchor: z63.union([five_point_anchor.describe("legacy"), nine_point_anchor]).default("center"),
1253
+ color: z63.string().default("#000000"),
1238
1254
  schRotation: rotation3.default(0)
1239
1255
  });
1240
1256
 
1241
1257
  // lib/components/schematic-path.ts
1242
1258
  import { point as point5 } from "circuit-json";
1243
- import { z as z63 } from "zod";
1244
- var schematicPathProps = z63.object({
1245
- points: z63.array(point5),
1246
- isFilled: z63.boolean().optional().default(false),
1247
- fillColor: z63.enum(["red", "blue"]).optional()
1259
+ import { z as z64 } from "zod";
1260
+ var schematicPathProps = z64.object({
1261
+ points: z64.array(point5),
1262
+ isFilled: z64.boolean().optional().default(false),
1263
+ fillColor: z64.enum(["red", "blue"]).optional()
1248
1264
  });
1249
1265
 
1250
1266
  // lib/components/silkscreen-text.ts
1251
1267
  import { length as length5 } from "circuit-json";
1252
- import { z as z64 } from "zod";
1268
+ import { z as z65 } from "zod";
1253
1269
  var silkscreenTextProps = pcbLayoutProps.extend({
1254
- text: z64.string(),
1270
+ text: z65.string(),
1255
1271
  anchorAlignment: nine_point_anchor.default("center"),
1256
- font: z64.enum(["tscircuit2024"]).optional(),
1272
+ font: z65.enum(["tscircuit2024"]).optional(),
1257
1273
  fontSize: length5.optional()
1258
1274
  });
1259
1275
 
1260
1276
  // lib/components/silkscreen-path.ts
1261
1277
  import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
1262
- import { z as z65 } from "zod";
1278
+ import { z as z66 } from "zod";
1263
1279
  var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
1264
- route: z65.array(route_hint_point5),
1280
+ route: z66.array(route_hint_point5),
1265
1281
  strokeWidth: length6.optional()
1266
1282
  });
1267
1283
 
1268
1284
  // lib/components/silkscreen-line.ts
1269
- import { distance as distance20 } from "circuit-json";
1285
+ import { distance as distance21 } from "circuit-json";
1270
1286
  var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
1271
- strokeWidth: distance20,
1272
- x1: distance20,
1273
- y1: distance20,
1274
- x2: distance20,
1275
- y2: distance20
1287
+ strokeWidth: distance21,
1288
+ x1: distance21,
1289
+ y1: distance21,
1290
+ x2: distance21,
1291
+ y2: distance21
1276
1292
  });
1277
1293
 
1278
1294
  // lib/components/silkscreen-rect.ts
1279
- import { distance as distance21 } from "circuit-json";
1280
- import { z as z66 } from "zod";
1295
+ import { distance as distance22 } from "circuit-json";
1296
+ import { z as z67 } from "zod";
1281
1297
  var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
1282
- filled: z66.boolean().default(true).optional(),
1283
- stroke: z66.enum(["dashed", "solid", "none"]).optional(),
1284
- strokeWidth: distance21.optional(),
1285
- width: distance21,
1286
- height: distance21
1298
+ filled: z67.boolean().default(true).optional(),
1299
+ stroke: z67.enum(["dashed", "solid", "none"]).optional(),
1300
+ strokeWidth: distance22.optional(),
1301
+ width: distance22,
1302
+ height: distance22
1287
1303
  });
1288
1304
 
1289
1305
  // lib/components/silkscreen-circle.ts
1290
- import { distance as distance22 } from "circuit-json";
1291
- import { z as z67 } from "zod";
1306
+ import { distance as distance23 } from "circuit-json";
1307
+ import { z as z68 } from "zod";
1292
1308
  var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
1293
- isFilled: z67.boolean().optional(),
1294
- isOutline: z67.boolean().optional(),
1295
- strokeWidth: distance22.optional(),
1296
- radius: distance22
1309
+ isFilled: z68.boolean().optional(),
1310
+ isOutline: z68.boolean().optional(),
1311
+ strokeWidth: distance23.optional(),
1312
+ radius: distance23
1297
1313
  });
1298
1314
 
1299
1315
  // lib/components/trace-hint.ts
1300
- import { distance as distance23, layer_ref as layer_ref6, route_hint_point as route_hint_point6 } from "circuit-json";
1301
- import { z as z68 } from "zod";
1302
- var routeHintPointProps = z68.object({
1303
- x: distance23,
1304
- y: distance23,
1305
- via: z68.boolean().optional(),
1316
+ import { distance as distance24, layer_ref as layer_ref6, route_hint_point as route_hint_point6 } from "circuit-json";
1317
+ import { z as z69 } from "zod";
1318
+ var routeHintPointProps = z69.object({
1319
+ x: distance24,
1320
+ y: distance24,
1321
+ via: z69.boolean().optional(),
1306
1322
  toLayer: layer_ref6.optional()
1307
1323
  });
1308
- var traceHintProps = z68.object({
1309
- for: z68.string().optional().describe(
1324
+ var traceHintProps = z69.object({
1325
+ for: z69.string().optional().describe(
1310
1326
  "Selector for the port you're targeting, not required if you're inside a trace"
1311
1327
  ),
1312
- order: z68.number().optional(),
1328
+ order: z69.number().optional(),
1313
1329
  offset: route_hint_point6.or(routeHintPointProps).optional(),
1314
- offsets: z68.array(route_hint_point6).or(z68.array(routeHintPointProps)).optional(),
1315
- traceWidth: z68.number().optional()
1330
+ offsets: z69.array(route_hint_point6).or(z69.array(routeHintPointProps)).optional(),
1331
+ traceWidth: z69.number().optional()
1316
1332
  });
1317
1333
 
1318
1334
  // lib/components/port.ts
1319
- import { z as z69 } from "zod";
1335
+ import { z as z70 } from "zod";
1320
1336
  var portProps = commonLayoutProps.extend({
1321
- name: z69.string(),
1322
- pinNumber: z69.number().optional(),
1323
- aliases: z69.array(z69.string()).optional(),
1337
+ name: z70.string(),
1338
+ pinNumber: z70.number().optional(),
1339
+ aliases: z70.array(z70.string()).optional(),
1324
1340
  direction
1325
1341
  });
1326
1342
 
1327
1343
  // lib/platformConfig.ts
1328
- import { z as z70 } from "zod";
1329
- var unvalidatedCircuitJson = z70.array(z70.any()).describe("Circuit JSON");
1330
- var pathToCircuitJsonFn = z70.function().args(z70.string()).returns(z70.promise(z70.object({ footprintCircuitJson: z70.array(z70.any()) }))).describe("A function that takes a path and returns Circuit JSON");
1331
- var platformConfig = z70.object({
1344
+ import { z as z71 } from "zod";
1345
+ var unvalidatedCircuitJson = z71.array(z71.any()).describe("Circuit JSON");
1346
+ var pathToCircuitJsonFn = z71.function().args(z71.string()).returns(z71.promise(z71.object({ footprintCircuitJson: z71.array(z71.any()) }))).describe("A function that takes a path and returns Circuit JSON");
1347
+ var platformConfig = z71.object({
1332
1348
  partsEngine: partsEngine.optional(),
1333
1349
  autorouter: autorouterProp.optional(),
1334
- registryApiUrl: z70.string().optional(),
1335
- cloudAutorouterUrl: z70.string().optional(),
1336
- localCacheEngine: z70.any().optional(),
1337
- pcbDisabled: z70.boolean().optional(),
1338
- schematicDisabled: z70.boolean().optional(),
1339
- partsEngineDisabled: z70.boolean().optional(),
1340
- footprintLibraryMap: z70.record(
1341
- z70.string(),
1342
- z70.record(
1343
- z70.string(),
1344
- z70.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
1350
+ registryApiUrl: z71.string().optional(),
1351
+ cloudAutorouterUrl: z71.string().optional(),
1352
+ localCacheEngine: z71.any().optional(),
1353
+ pcbDisabled: z71.boolean().optional(),
1354
+ schematicDisabled: z71.boolean().optional(),
1355
+ partsEngineDisabled: z71.boolean().optional(),
1356
+ footprintLibraryMap: z71.record(
1357
+ z71.string(),
1358
+ z71.record(
1359
+ z71.string(),
1360
+ z71.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
1345
1361
  )
1346
1362
  ).optional()
1347
1363
  });
@@ -1466,6 +1482,7 @@ export {
1466
1482
  subcircuitProps,
1467
1483
  supplierProps,
1468
1484
  switchProps,
1485
+ testpointProps,
1469
1486
  traceHintProps,
1470
1487
  traceProps,
1471
1488
  transistorPins,