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