@tscircuit/props 0.0.239 → 0.0.240
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.d.ts +51 -2
- package/dist/index.js +81 -72
- package/dist/index.js.map +1 -1
- package/lib/components/smtpad.ts +10 -0
- package/lib/components/via.ts +17 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -819,6 +819,7 @@ var cutoutProps = z42.discriminatedUnion("shape", [
|
|
|
819
819
|
// lib/components/smtpad.ts
|
|
820
820
|
import { z as z43 } from "zod";
|
|
821
821
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
822
|
+
name: z43.string().optional(),
|
|
822
823
|
shape: z43.literal("rect"),
|
|
823
824
|
width: distance12,
|
|
824
825
|
height: distance12,
|
|
@@ -826,6 +827,7 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
826
827
|
});
|
|
827
828
|
expectTypesMatch(true);
|
|
828
829
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
830
|
+
name: z43.string().optional(),
|
|
829
831
|
shape: z43.literal("rotated_rect"),
|
|
830
832
|
width: distance12,
|
|
831
833
|
height: distance12,
|
|
@@ -834,12 +836,14 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
834
836
|
});
|
|
835
837
|
expectTypesMatch(true);
|
|
836
838
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
839
|
+
name: z43.string().optional(),
|
|
837
840
|
shape: z43.literal("circle"),
|
|
838
841
|
radius: distance12,
|
|
839
842
|
portHints: portHints.optional()
|
|
840
843
|
});
|
|
841
844
|
expectTypesMatch(true);
|
|
842
845
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
846
|
+
name: z43.string().optional(),
|
|
843
847
|
shape: z43.literal("pill"),
|
|
844
848
|
width: distance12,
|
|
845
849
|
height: distance12,
|
|
@@ -848,6 +852,7 @@ var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
848
852
|
});
|
|
849
853
|
expectTypesMatch(true);
|
|
850
854
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
855
|
+
name: z43.string().optional(),
|
|
851
856
|
shape: z43.literal("polygon"),
|
|
852
857
|
points: z43.array(point),
|
|
853
858
|
portHints: portHints.optional()
|
|
@@ -1212,19 +1217,23 @@ var pcbTraceProps = z61.object({
|
|
|
1212
1217
|
|
|
1213
1218
|
// lib/components/via.ts
|
|
1214
1219
|
import { distance as distance16, layer_ref as layer_ref5 } from "circuit-json";
|
|
1220
|
+
import { z as z62 } from "zod";
|
|
1215
1221
|
var viaProps = commonLayoutProps.extend({
|
|
1222
|
+
name: z62.string().optional(),
|
|
1216
1223
|
fromLayer: layer_ref5,
|
|
1217
1224
|
toLayer: layer_ref5,
|
|
1218
1225
|
holeDiameter: distance16,
|
|
1219
|
-
outerDiameter: distance16
|
|
1226
|
+
outerDiameter: distance16,
|
|
1227
|
+
connectsTo: z62.string().or(z62.array(z62.string())).optional()
|
|
1220
1228
|
});
|
|
1229
|
+
expectTypesMatch(true);
|
|
1221
1230
|
|
|
1222
1231
|
// lib/components/testpoint.ts
|
|
1223
1232
|
import { distance as distance17 } from "circuit-json";
|
|
1224
|
-
import { z as
|
|
1233
|
+
import { z as z63 } from "zod";
|
|
1225
1234
|
var testpointProps = commonComponentProps.extend({
|
|
1226
|
-
footprintVariant:
|
|
1227
|
-
padShape:
|
|
1235
|
+
footprintVariant: z63.enum(["pad", "through_hole"]).optional(),
|
|
1236
|
+
padShape: z63.enum(["rect", "circle"]).optional().default("circle"),
|
|
1228
1237
|
padDiameter: distance17.optional(),
|
|
1229
1238
|
holeDiameter: distance17.optional(),
|
|
1230
1239
|
width: distance17.optional(),
|
|
@@ -1236,22 +1245,22 @@ var testpointProps = commonComponentProps.extend({
|
|
|
1236
1245
|
expectTypesMatch(true);
|
|
1237
1246
|
|
|
1238
1247
|
// lib/components/breakoutpoint.ts
|
|
1239
|
-
import { z as
|
|
1248
|
+
import { z as z64 } from "zod";
|
|
1240
1249
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1241
|
-
connection:
|
|
1250
|
+
connection: z64.string()
|
|
1242
1251
|
});
|
|
1243
1252
|
expectTypesMatch(true);
|
|
1244
1253
|
|
|
1245
1254
|
// lib/components/pcb-keepout.ts
|
|
1246
1255
|
import { distance as distance18 } from "circuit-json";
|
|
1247
|
-
import { z as
|
|
1248
|
-
var pcbKeepoutProps =
|
|
1256
|
+
import { z as z65 } from "zod";
|
|
1257
|
+
var pcbKeepoutProps = z65.union([
|
|
1249
1258
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1250
|
-
shape:
|
|
1259
|
+
shape: z65.literal("circle"),
|
|
1251
1260
|
radius: distance18
|
|
1252
1261
|
}),
|
|
1253
1262
|
pcbLayoutProps.extend({
|
|
1254
|
-
shape:
|
|
1263
|
+
shape: z65.literal("rect"),
|
|
1255
1264
|
width: distance18,
|
|
1256
1265
|
height: distance18
|
|
1257
1266
|
})
|
|
@@ -1265,11 +1274,11 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
1265
1274
|
|
|
1266
1275
|
// lib/components/schematic-box.ts
|
|
1267
1276
|
import { distance as distance19 } from "circuit-json";
|
|
1268
|
-
import { z as
|
|
1277
|
+
import { z as z67 } from "zod";
|
|
1269
1278
|
|
|
1270
1279
|
// lib/common/ninePointAnchor.ts
|
|
1271
|
-
import { z as
|
|
1272
|
-
var ninePointAnchor =
|
|
1280
|
+
import { z as z66 } from "zod";
|
|
1281
|
+
var ninePointAnchor = z66.enum([
|
|
1273
1282
|
"top_left",
|
|
1274
1283
|
"top_center",
|
|
1275
1284
|
"top_right",
|
|
@@ -1282,23 +1291,23 @@ var ninePointAnchor = z65.enum([
|
|
|
1282
1291
|
]);
|
|
1283
1292
|
|
|
1284
1293
|
// lib/components/schematic-box.ts
|
|
1285
|
-
var schematicBoxProps =
|
|
1294
|
+
var schematicBoxProps = z67.object({
|
|
1286
1295
|
schX: distance19.optional(),
|
|
1287
1296
|
schY: distance19.optional(),
|
|
1288
1297
|
width: distance19.optional(),
|
|
1289
1298
|
height: distance19.optional(),
|
|
1290
|
-
overlay:
|
|
1299
|
+
overlay: z67.array(z67.string()).optional(),
|
|
1291
1300
|
padding: distance19.optional(),
|
|
1292
1301
|
paddingLeft: distance19.optional(),
|
|
1293
1302
|
paddingRight: distance19.optional(),
|
|
1294
1303
|
paddingTop: distance19.optional(),
|
|
1295
1304
|
paddingBottom: distance19.optional(),
|
|
1296
|
-
title:
|
|
1305
|
+
title: z67.string().optional(),
|
|
1297
1306
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
1298
|
-
titleColor:
|
|
1307
|
+
titleColor: z67.string().optional(),
|
|
1299
1308
|
titleFontSize: distance19.optional(),
|
|
1300
|
-
titleInside:
|
|
1301
|
-
strokeStyle:
|
|
1309
|
+
titleInside: z67.boolean().default(false),
|
|
1310
|
+
strokeStyle: z67.enum(["solid", "dashed"]).default("solid")
|
|
1302
1311
|
}).refine(
|
|
1303
1312
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
1304
1313
|
{
|
|
@@ -1313,8 +1322,8 @@ var schematicBoxProps = z66.object({
|
|
|
1313
1322
|
|
|
1314
1323
|
// lib/components/schematic-line.ts
|
|
1315
1324
|
import { distance as distance20 } from "circuit-json";
|
|
1316
|
-
import { z as
|
|
1317
|
-
var schematicLineProps =
|
|
1325
|
+
import { z as z68 } from "zod";
|
|
1326
|
+
var schematicLineProps = z68.object({
|
|
1318
1327
|
x1: distance20,
|
|
1319
1328
|
y1: distance20,
|
|
1320
1329
|
x2: distance20,
|
|
@@ -1323,11 +1332,11 @@ var schematicLineProps = z67.object({
|
|
|
1323
1332
|
|
|
1324
1333
|
// lib/components/schematic-text.ts
|
|
1325
1334
|
import { distance as distance21, rotation as rotation4 } from "circuit-json";
|
|
1326
|
-
import { z as
|
|
1335
|
+
import { z as z70 } from "zod";
|
|
1327
1336
|
|
|
1328
1337
|
// lib/common/fivePointAnchor.ts
|
|
1329
|
-
import { z as
|
|
1330
|
-
var fivePointAnchor =
|
|
1338
|
+
import { z as z69 } from "zod";
|
|
1339
|
+
var fivePointAnchor = z69.enum([
|
|
1331
1340
|
"center",
|
|
1332
1341
|
"left",
|
|
1333
1342
|
"right",
|
|
@@ -1336,40 +1345,40 @@ var fivePointAnchor = z68.enum([
|
|
|
1336
1345
|
]);
|
|
1337
1346
|
|
|
1338
1347
|
// lib/components/schematic-text.ts
|
|
1339
|
-
var schematicTextProps =
|
|
1348
|
+
var schematicTextProps = z70.object({
|
|
1340
1349
|
schX: distance21.optional(),
|
|
1341
1350
|
schY: distance21.optional(),
|
|
1342
|
-
text:
|
|
1343
|
-
fontSize:
|
|
1344
|
-
anchor:
|
|
1345
|
-
color:
|
|
1351
|
+
text: z70.string(),
|
|
1352
|
+
fontSize: z70.number().default(1),
|
|
1353
|
+
anchor: z70.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
1354
|
+
color: z70.string().default("#000000"),
|
|
1346
1355
|
schRotation: rotation4.default(0)
|
|
1347
1356
|
});
|
|
1348
1357
|
|
|
1349
1358
|
// lib/components/schematic-path.ts
|
|
1350
1359
|
import { point as point5 } from "circuit-json";
|
|
1351
|
-
import { z as
|
|
1352
|
-
var schematicPathProps =
|
|
1353
|
-
points:
|
|
1354
|
-
isFilled:
|
|
1355
|
-
fillColor:
|
|
1360
|
+
import { z as z71 } from "zod";
|
|
1361
|
+
var schematicPathProps = z71.object({
|
|
1362
|
+
points: z71.array(point5),
|
|
1363
|
+
isFilled: z71.boolean().optional().default(false),
|
|
1364
|
+
fillColor: z71.enum(["red", "blue"]).optional()
|
|
1356
1365
|
});
|
|
1357
1366
|
|
|
1358
1367
|
// lib/components/silkscreen-text.ts
|
|
1359
1368
|
import { length as length5 } from "circuit-json";
|
|
1360
|
-
import { z as
|
|
1369
|
+
import { z as z72 } from "zod";
|
|
1361
1370
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
1362
|
-
text:
|
|
1371
|
+
text: z72.string(),
|
|
1363
1372
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
1364
|
-
font:
|
|
1373
|
+
font: z72.enum(["tscircuit2024"]).optional(),
|
|
1365
1374
|
fontSize: length5.optional()
|
|
1366
1375
|
});
|
|
1367
1376
|
|
|
1368
1377
|
// lib/components/silkscreen-path.ts
|
|
1369
1378
|
import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
1370
|
-
import { z as
|
|
1379
|
+
import { z as z73 } from "zod";
|
|
1371
1380
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1372
|
-
route:
|
|
1381
|
+
route: z73.array(route_hint_point5),
|
|
1373
1382
|
strokeWidth: length6.optional()
|
|
1374
1383
|
});
|
|
1375
1384
|
|
|
@@ -1385,10 +1394,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
|
|
|
1385
1394
|
|
|
1386
1395
|
// lib/components/silkscreen-rect.ts
|
|
1387
1396
|
import { distance as distance23 } from "circuit-json";
|
|
1388
|
-
import { z as
|
|
1397
|
+
import { z as z74 } from "zod";
|
|
1389
1398
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1390
|
-
filled:
|
|
1391
|
-
stroke:
|
|
1399
|
+
filled: z74.boolean().default(true).optional(),
|
|
1400
|
+
stroke: z74.enum(["dashed", "solid", "none"]).optional(),
|
|
1392
1401
|
strokeWidth: distance23.optional(),
|
|
1393
1402
|
width: distance23,
|
|
1394
1403
|
height: distance23
|
|
@@ -1396,60 +1405,60 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1396
1405
|
|
|
1397
1406
|
// lib/components/silkscreen-circle.ts
|
|
1398
1407
|
import { distance as distance24 } from "circuit-json";
|
|
1399
|
-
import { z as
|
|
1408
|
+
import { z as z75 } from "zod";
|
|
1400
1409
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1401
|
-
isFilled:
|
|
1402
|
-
isOutline:
|
|
1410
|
+
isFilled: z75.boolean().optional(),
|
|
1411
|
+
isOutline: z75.boolean().optional(),
|
|
1403
1412
|
strokeWidth: distance24.optional(),
|
|
1404
1413
|
radius: distance24
|
|
1405
1414
|
});
|
|
1406
1415
|
|
|
1407
1416
|
// lib/components/trace-hint.ts
|
|
1408
1417
|
import { distance as distance25, layer_ref as layer_ref6, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
1409
|
-
import { z as
|
|
1410
|
-
var routeHintPointProps =
|
|
1418
|
+
import { z as z76 } from "zod";
|
|
1419
|
+
var routeHintPointProps = z76.object({
|
|
1411
1420
|
x: distance25,
|
|
1412
1421
|
y: distance25,
|
|
1413
|
-
via:
|
|
1422
|
+
via: z76.boolean().optional(),
|
|
1414
1423
|
toLayer: layer_ref6.optional()
|
|
1415
1424
|
});
|
|
1416
|
-
var traceHintProps =
|
|
1417
|
-
for:
|
|
1425
|
+
var traceHintProps = z76.object({
|
|
1426
|
+
for: z76.string().optional().describe(
|
|
1418
1427
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
1419
1428
|
),
|
|
1420
|
-
order:
|
|
1429
|
+
order: z76.number().optional(),
|
|
1421
1430
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
1422
|
-
offsets:
|
|
1423
|
-
traceWidth:
|
|
1431
|
+
offsets: z76.array(route_hint_point6).or(z76.array(routeHintPointProps)).optional(),
|
|
1432
|
+
traceWidth: z76.number().optional()
|
|
1424
1433
|
});
|
|
1425
1434
|
|
|
1426
1435
|
// lib/components/port.ts
|
|
1427
|
-
import { z as
|
|
1436
|
+
import { z as z77 } from "zod";
|
|
1428
1437
|
var portProps = commonLayoutProps.extend({
|
|
1429
|
-
name:
|
|
1430
|
-
pinNumber:
|
|
1431
|
-
aliases:
|
|
1438
|
+
name: z77.string(),
|
|
1439
|
+
pinNumber: z77.number().optional(),
|
|
1440
|
+
aliases: z77.array(z77.string()).optional(),
|
|
1432
1441
|
direction
|
|
1433
1442
|
});
|
|
1434
1443
|
|
|
1435
1444
|
// lib/platformConfig.ts
|
|
1436
|
-
import { z as
|
|
1437
|
-
var unvalidatedCircuitJson =
|
|
1438
|
-
var pathToCircuitJsonFn =
|
|
1439
|
-
var platformConfig =
|
|
1445
|
+
import { z as z78 } from "zod";
|
|
1446
|
+
var unvalidatedCircuitJson = z78.array(z78.any()).describe("Circuit JSON");
|
|
1447
|
+
var pathToCircuitJsonFn = z78.function().args(z78.string()).returns(z78.promise(z78.object({ footprintCircuitJson: z78.array(z78.any()) }))).describe("A function that takes a path and returns Circuit JSON");
|
|
1448
|
+
var platformConfig = z78.object({
|
|
1440
1449
|
partsEngine: partsEngine.optional(),
|
|
1441
1450
|
autorouter: autorouterProp.optional(),
|
|
1442
|
-
registryApiUrl:
|
|
1443
|
-
cloudAutorouterUrl:
|
|
1444
|
-
localCacheEngine:
|
|
1445
|
-
pcbDisabled:
|
|
1446
|
-
schematicDisabled:
|
|
1447
|
-
partsEngineDisabled:
|
|
1448
|
-
footprintLibraryMap:
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1451
|
+
registryApiUrl: z78.string().optional(),
|
|
1452
|
+
cloudAutorouterUrl: z78.string().optional(),
|
|
1453
|
+
localCacheEngine: z78.any().optional(),
|
|
1454
|
+
pcbDisabled: z78.boolean().optional(),
|
|
1455
|
+
schematicDisabled: z78.boolean().optional(),
|
|
1456
|
+
partsEngineDisabled: z78.boolean().optional(),
|
|
1457
|
+
footprintLibraryMap: z78.record(
|
|
1458
|
+
z78.string(),
|
|
1459
|
+
z78.record(
|
|
1460
|
+
z78.string(),
|
|
1461
|
+
z78.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
1453
1462
|
)
|
|
1454
1463
|
).optional()
|
|
1455
1464
|
});
|