@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/README.md +35 -0
- package/dist/index.d.ts +594 -1
- package/dist/index.js +121 -104
- package/dist/index.js.map +1 -1
- package/lib/components/testpoint.ts +52 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1134,18 +1134,34 @@ var viaProps = commonLayoutProps.extend({
|
|
|
1134
1134
|
outerDiameter: distance15
|
|
1135
1135
|
});
|
|
1136
1136
|
|
|
1137
|
-
// lib/components/
|
|
1137
|
+
// lib/components/testpoint.ts
|
|
1138
1138
|
import { distance as distance16 } from "circuit-json";
|
|
1139
1139
|
import { z as z57 } from "zod";
|
|
1140
|
-
var
|
|
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:
|
|
1143
|
-
radius:
|
|
1158
|
+
shape: z58.literal("circle"),
|
|
1159
|
+
radius: distance17
|
|
1144
1160
|
}),
|
|
1145
1161
|
pcbLayoutProps.extend({
|
|
1146
|
-
shape:
|
|
1147
|
-
width:
|
|
1148
|
-
height:
|
|
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
|
|
1160
|
-
import { z as
|
|
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
|
|
1164
|
-
var nine_point_anchor =
|
|
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 =
|
|
1178
|
-
schX:
|
|
1179
|
-
schY:
|
|
1180
|
-
width:
|
|
1181
|
-
height:
|
|
1182
|
-
overlay:
|
|
1183
|
-
padding:
|
|
1184
|
-
paddingLeft:
|
|
1185
|
-
paddingRight:
|
|
1186
|
-
paddingTop:
|
|
1187
|
-
paddingBottom:
|
|
1188
|
-
title:
|
|
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:
|
|
1191
|
-
titleFontSize:
|
|
1192
|
-
titleInside:
|
|
1193
|
-
strokeStyle:
|
|
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
|
|
1208
|
-
import { z as
|
|
1209
|
-
var schematicLineProps =
|
|
1210
|
-
x1:
|
|
1211
|
-
y1:
|
|
1212
|
-
x2:
|
|
1213
|
-
y2:
|
|
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
|
|
1218
|
-
import { z as
|
|
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
|
|
1222
|
-
var five_point_anchor =
|
|
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 =
|
|
1232
|
-
schX:
|
|
1233
|
-
schY:
|
|
1234
|
-
text:
|
|
1235
|
-
fontSize:
|
|
1236
|
-
anchor:
|
|
1237
|
-
color:
|
|
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
|
|
1244
|
-
var schematicPathProps =
|
|
1245
|
-
points:
|
|
1246
|
-
isFilled:
|
|
1247
|
-
fillColor:
|
|
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
|
|
1268
|
+
import { z as z65 } from "zod";
|
|
1253
1269
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
1254
|
-
text:
|
|
1270
|
+
text: z65.string(),
|
|
1255
1271
|
anchorAlignment: nine_point_anchor.default("center"),
|
|
1256
|
-
font:
|
|
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
|
|
1278
|
+
import { z as z66 } from "zod";
|
|
1263
1279
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1264
|
-
route:
|
|
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
|
|
1285
|
+
import { distance as distance21 } from "circuit-json";
|
|
1270
1286
|
var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1271
|
-
strokeWidth:
|
|
1272
|
-
x1:
|
|
1273
|
-
y1:
|
|
1274
|
-
x2:
|
|
1275
|
-
y2:
|
|
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
|
|
1280
|
-
import { z as
|
|
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:
|
|
1283
|
-
stroke:
|
|
1284
|
-
strokeWidth:
|
|
1285
|
-
width:
|
|
1286
|
-
height:
|
|
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
|
|
1291
|
-
import { z as
|
|
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:
|
|
1294
|
-
isOutline:
|
|
1295
|
-
strokeWidth:
|
|
1296
|
-
radius:
|
|
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
|
|
1301
|
-
import { z as
|
|
1302
|
-
var routeHintPointProps =
|
|
1303
|
-
x:
|
|
1304
|
-
y:
|
|
1305
|
-
via:
|
|
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 =
|
|
1309
|
-
for:
|
|
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:
|
|
1328
|
+
order: z69.number().optional(),
|
|
1313
1329
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
1314
|
-
offsets:
|
|
1315
|
-
traceWidth:
|
|
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
|
|
1335
|
+
import { z as z70 } from "zod";
|
|
1320
1336
|
var portProps = commonLayoutProps.extend({
|
|
1321
|
-
name:
|
|
1322
|
-
pinNumber:
|
|
1323
|
-
aliases:
|
|
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
|
|
1329
|
-
var unvalidatedCircuitJson =
|
|
1330
|
-
var pathToCircuitJsonFn =
|
|
1331
|
-
var platformConfig =
|
|
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:
|
|
1335
|
-
cloudAutorouterUrl:
|
|
1336
|
-
localCacheEngine:
|
|
1337
|
-
pcbDisabled:
|
|
1338
|
-
schematicDisabled:
|
|
1339
|
-
partsEngineDisabled:
|
|
1340
|
-
footprintLibraryMap:
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
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,
|