@tscircuit/props 0.0.543 → 0.0.545
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 +45 -0
- package/dist/index.d.ts +318 -3
- package/dist/index.js +114 -93
- package/dist/index.js.map +1 -1
- package/lib/components/hole.ts +24 -1
- package/lib/components/silkscreen-graphic.ts +56 -0
- package/lib/index.ts +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -17156,6 +17156,14 @@ var pillHoleProps = pcbLayoutProps.extend({
|
|
|
17156
17156
|
solderMaskMargin: distance.optional(),
|
|
17157
17157
|
coveredWithSolderMask: z63.boolean().optional()
|
|
17158
17158
|
});
|
|
17159
|
+
var ovalHoleProps = pcbLayoutProps.extend({
|
|
17160
|
+
name: z63.string().optional(),
|
|
17161
|
+
shape: z63.literal("oval"),
|
|
17162
|
+
width: distance,
|
|
17163
|
+
height: distance,
|
|
17164
|
+
solderMaskMargin: distance.optional(),
|
|
17165
|
+
coveredWithSolderMask: z63.boolean().optional()
|
|
17166
|
+
});
|
|
17159
17167
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
17160
17168
|
name: z63.string().optional(),
|
|
17161
17169
|
shape: z63.literal("rect"),
|
|
@@ -17167,6 +17175,7 @@ var rectHoleProps = pcbLayoutProps.extend({
|
|
|
17167
17175
|
var holeProps = z63.union([
|
|
17168
17176
|
circleHoleProps,
|
|
17169
17177
|
pillHoleProps,
|
|
17178
|
+
ovalHoleProps,
|
|
17170
17179
|
rectHoleProps
|
|
17171
17180
|
]);
|
|
17172
17181
|
expectTypesMatch(true);
|
|
@@ -18242,65 +18251,76 @@ var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
18242
18251
|
radius: distance42
|
|
18243
18252
|
});
|
|
18244
18253
|
|
|
18254
|
+
// lib/components/silkscreen-graphic.ts
|
|
18255
|
+
import { visible_layer } from "circuit-json";
|
|
18256
|
+
import "zod";
|
|
18257
|
+
var silkscreenGraphicProps = pcbLayoutProps.omit({ layer: true, pcbStyle: true, pcbSx: true }).extend({
|
|
18258
|
+
imageUrl: url,
|
|
18259
|
+
width: distance,
|
|
18260
|
+
height: distance,
|
|
18261
|
+
layer: visible_layer.optional()
|
|
18262
|
+
});
|
|
18263
|
+
expectTypesMatch(true);
|
|
18264
|
+
|
|
18245
18265
|
// lib/components/trace-hint.ts
|
|
18246
18266
|
import { distance as distance43, layer_ref as layer_ref12, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
18247
|
-
import { z as
|
|
18248
|
-
var routeHintPointProps =
|
|
18267
|
+
import { z as z122 } from "zod";
|
|
18268
|
+
var routeHintPointProps = z122.object({
|
|
18249
18269
|
x: distance43,
|
|
18250
18270
|
y: distance43,
|
|
18251
|
-
via:
|
|
18271
|
+
via: z122.boolean().optional(),
|
|
18252
18272
|
toLayer: layer_ref12.optional()
|
|
18253
18273
|
});
|
|
18254
|
-
var traceHintProps =
|
|
18255
|
-
for:
|
|
18274
|
+
var traceHintProps = z122.object({
|
|
18275
|
+
for: z122.string().optional().describe(
|
|
18256
18276
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
18257
18277
|
),
|
|
18258
|
-
order:
|
|
18278
|
+
order: z122.number().optional(),
|
|
18259
18279
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
18260
|
-
offsets:
|
|
18261
|
-
traceWidth:
|
|
18280
|
+
offsets: z122.array(route_hint_point6).or(z122.array(routeHintPointProps)).optional(),
|
|
18281
|
+
traceWidth: z122.number().optional()
|
|
18262
18282
|
});
|
|
18263
18283
|
|
|
18264
18284
|
// lib/components/port.ts
|
|
18265
|
-
import { z as
|
|
18285
|
+
import { z as z123 } from "zod";
|
|
18266
18286
|
var portProps = commonLayoutProps.extend({
|
|
18267
|
-
name:
|
|
18268
|
-
pinNumber:
|
|
18269
|
-
schStemLength:
|
|
18270
|
-
aliases:
|
|
18271
|
-
layer:
|
|
18272
|
-
layers:
|
|
18273
|
-
schX:
|
|
18274
|
-
schY:
|
|
18287
|
+
name: z123.string().optional(),
|
|
18288
|
+
pinNumber: z123.number().optional(),
|
|
18289
|
+
schStemLength: z123.number().optional(),
|
|
18290
|
+
aliases: z123.array(z123.string()).optional(),
|
|
18291
|
+
layer: z123.string().optional(),
|
|
18292
|
+
layers: z123.array(z123.string()).optional(),
|
|
18293
|
+
schX: z123.number().optional(),
|
|
18294
|
+
schY: z123.number().optional(),
|
|
18275
18295
|
direction: direction.optional(),
|
|
18276
|
-
connectsTo:
|
|
18296
|
+
connectsTo: z123.string().or(z123.array(z123.string())).optional(),
|
|
18277
18297
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
18278
|
-
hasInversionCircle:
|
|
18298
|
+
hasInversionCircle: z123.boolean().optional()
|
|
18279
18299
|
});
|
|
18280
18300
|
|
|
18281
18301
|
// lib/components/pcb-note-text.ts
|
|
18282
18302
|
import { length as length11 } from "circuit-json";
|
|
18283
|
-
import { z as
|
|
18303
|
+
import { z as z124 } from "zod";
|
|
18284
18304
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
18285
|
-
text:
|
|
18286
|
-
anchorAlignment:
|
|
18287
|
-
font:
|
|
18305
|
+
text: z124.string(),
|
|
18306
|
+
anchorAlignment: z124.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18307
|
+
font: z124.enum(["tscircuit2024"]).optional(),
|
|
18288
18308
|
fontSize: length11.optional(),
|
|
18289
|
-
color:
|
|
18309
|
+
color: z124.string().optional()
|
|
18290
18310
|
});
|
|
18291
18311
|
expectTypesMatch(true);
|
|
18292
18312
|
|
|
18293
18313
|
// lib/components/pcb-note-rect.ts
|
|
18294
18314
|
import { distance as distance44 } from "circuit-json";
|
|
18295
|
-
import { z as
|
|
18315
|
+
import { z as z125 } from "zod";
|
|
18296
18316
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18297
18317
|
width: distance44,
|
|
18298
18318
|
height: distance44,
|
|
18299
18319
|
strokeWidth: distance44.optional(),
|
|
18300
|
-
isFilled:
|
|
18301
|
-
hasStroke:
|
|
18302
|
-
isStrokeDashed:
|
|
18303
|
-
color:
|
|
18320
|
+
isFilled: z125.boolean().optional(),
|
|
18321
|
+
hasStroke: z125.boolean().optional(),
|
|
18322
|
+
isStrokeDashed: z125.boolean().optional(),
|
|
18323
|
+
color: z125.string().optional(),
|
|
18304
18324
|
cornerRadius: distance44.optional()
|
|
18305
18325
|
});
|
|
18306
18326
|
expectTypesMatch(true);
|
|
@@ -18310,7 +18330,7 @@ import {
|
|
|
18310
18330
|
length as length12,
|
|
18311
18331
|
route_hint_point as route_hint_point7
|
|
18312
18332
|
} from "circuit-json";
|
|
18313
|
-
import { z as
|
|
18333
|
+
import { z as z126 } from "zod";
|
|
18314
18334
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
18315
18335
|
pcbLeftEdgeX: true,
|
|
18316
18336
|
pcbRightEdgeX: true,
|
|
@@ -18322,15 +18342,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
18322
18342
|
pcbOffsetY: true,
|
|
18323
18343
|
pcbRotation: true
|
|
18324
18344
|
}).extend({
|
|
18325
|
-
route:
|
|
18345
|
+
route: z126.array(route_hint_point7),
|
|
18326
18346
|
strokeWidth: length12.optional(),
|
|
18327
|
-
color:
|
|
18347
|
+
color: z126.string().optional()
|
|
18328
18348
|
});
|
|
18329
18349
|
expectTypesMatch(true);
|
|
18330
18350
|
|
|
18331
18351
|
// lib/components/pcb-note-line.ts
|
|
18332
18352
|
import { distance as distance45 } from "circuit-json";
|
|
18333
|
-
import { z as
|
|
18353
|
+
import { z as z127 } from "zod";
|
|
18334
18354
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
18335
18355
|
pcbLeftEdgeX: true,
|
|
18336
18356
|
pcbRightEdgeX: true,
|
|
@@ -18347,15 +18367,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
18347
18367
|
x2: distance45,
|
|
18348
18368
|
y2: distance45,
|
|
18349
18369
|
strokeWidth: distance45.optional(),
|
|
18350
|
-
color:
|
|
18351
|
-
isDashed:
|
|
18370
|
+
color: z127.string().optional(),
|
|
18371
|
+
isDashed: z127.boolean().optional()
|
|
18352
18372
|
});
|
|
18353
18373
|
expectTypesMatch(true);
|
|
18354
18374
|
|
|
18355
18375
|
// lib/components/pcb-note-dimension.ts
|
|
18356
18376
|
import { distance as distance46, length as length13 } from "circuit-json";
|
|
18357
|
-
import { z as
|
|
18358
|
-
var dimensionTarget2 =
|
|
18377
|
+
import { z as z128 } from "zod";
|
|
18378
|
+
var dimensionTarget2 = z128.union([z128.string(), point]);
|
|
18359
18379
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
18360
18380
|
pcbLeftEdgeX: true,
|
|
18361
18381
|
pcbRightEdgeX: true,
|
|
@@ -18369,101 +18389,101 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18369
18389
|
}).extend({
|
|
18370
18390
|
from: dimensionTarget2,
|
|
18371
18391
|
to: dimensionTarget2,
|
|
18372
|
-
text:
|
|
18392
|
+
text: z128.string().optional(),
|
|
18373
18393
|
offset: distance46.optional(),
|
|
18374
|
-
font:
|
|
18394
|
+
font: z128.enum(["tscircuit2024"]).optional(),
|
|
18375
18395
|
fontSize: length13.optional(),
|
|
18376
|
-
color:
|
|
18396
|
+
color: z128.string().optional(),
|
|
18377
18397
|
arrowSize: distance46.optional(),
|
|
18378
|
-
units:
|
|
18379
|
-
outerEdgeToEdge:
|
|
18380
|
-
centerToCenter:
|
|
18381
|
-
innerEdgeToEdge:
|
|
18398
|
+
units: z128.enum(["in", "mm"]).optional(),
|
|
18399
|
+
outerEdgeToEdge: z128.literal(true).optional(),
|
|
18400
|
+
centerToCenter: z128.literal(true).optional(),
|
|
18401
|
+
innerEdgeToEdge: z128.literal(true).optional()
|
|
18382
18402
|
});
|
|
18383
18403
|
expectTypesMatch(
|
|
18384
18404
|
true
|
|
18385
18405
|
);
|
|
18386
18406
|
|
|
18387
18407
|
// lib/platformConfig.ts
|
|
18388
|
-
import { z as
|
|
18389
|
-
var unvalidatedCircuitJson =
|
|
18390
|
-
var footprintLibraryResult =
|
|
18391
|
-
footprintCircuitJson:
|
|
18408
|
+
import { z as z129 } from "zod";
|
|
18409
|
+
var unvalidatedCircuitJson = z129.array(z129.any()).describe("Circuit JSON");
|
|
18410
|
+
var footprintLibraryResult = z129.object({
|
|
18411
|
+
footprintCircuitJson: z129.array(z129.any()),
|
|
18392
18412
|
cadModel: cadModelProp.optional()
|
|
18393
18413
|
});
|
|
18394
|
-
var pathToCircuitJsonFn =
|
|
18395
|
-
|
|
18396
|
-
|
|
18397
|
-
|
|
18398
|
-
).returns(
|
|
18414
|
+
var pathToCircuitJsonFn = z129.function().args(z129.string()).returns(z129.promise(footprintLibraryResult)).or(
|
|
18415
|
+
z129.function().args(
|
|
18416
|
+
z129.string(),
|
|
18417
|
+
z129.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
18418
|
+
).returns(z129.promise(footprintLibraryResult))
|
|
18399
18419
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
18400
|
-
var footprintFileParserEntry =
|
|
18401
|
-
loadFromUrl:
|
|
18420
|
+
var footprintFileParserEntry = z129.object({
|
|
18421
|
+
loadFromUrl: z129.function().args(z129.string()).returns(z129.promise(footprintLibraryResult)).describe(
|
|
18402
18422
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
18403
18423
|
)
|
|
18404
18424
|
});
|
|
18405
|
-
var spiceEngineSimulationResult =
|
|
18406
|
-
engineVersionString:
|
|
18425
|
+
var spiceEngineSimulationResult = z129.object({
|
|
18426
|
+
engineVersionString: z129.string().optional(),
|
|
18407
18427
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
18408
18428
|
});
|
|
18409
|
-
var spiceEngineZod =
|
|
18410
|
-
simulate:
|
|
18429
|
+
var spiceEngineZod = z129.object({
|
|
18430
|
+
simulate: z129.function().args(z129.string()).returns(z129.promise(spiceEngineSimulationResult)).describe(
|
|
18411
18431
|
"A function that takes a SPICE string and returns a simulation result"
|
|
18412
18432
|
)
|
|
18413
18433
|
});
|
|
18414
|
-
var defaultSpiceEngine =
|
|
18434
|
+
var defaultSpiceEngine = z129.custom(
|
|
18415
18435
|
(value) => typeof value === "string"
|
|
18416
18436
|
);
|
|
18417
|
-
var autorouterInstance =
|
|
18418
|
-
run:
|
|
18419
|
-
getOutputSimpleRouteJson:
|
|
18437
|
+
var autorouterInstance = z129.object({
|
|
18438
|
+
run: z129.function().args().returns(z129.promise(z129.unknown())).describe("Run the autorouter"),
|
|
18439
|
+
getOutputSimpleRouteJson: z129.function().args().returns(z129.promise(z129.any())).describe("Get the resulting SimpleRouteJson")
|
|
18420
18440
|
});
|
|
18421
|
-
var autorouterDefinition =
|
|
18422
|
-
createAutorouter:
|
|
18441
|
+
var autorouterDefinition = z129.object({
|
|
18442
|
+
createAutorouter: z129.function().args(z129.any(), z129.any().optional()).returns(z129.union([autorouterInstance, z129.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
18423
18443
|
});
|
|
18424
|
-
var platformFetch =
|
|
18425
|
-
var platformConfig =
|
|
18444
|
+
var platformFetch = z129.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
18445
|
+
var platformConfig = z129.object({
|
|
18426
18446
|
partsEngine: partsEngine.optional(),
|
|
18427
18447
|
autorouter: autorouterProp.optional(),
|
|
18428
|
-
autorouterMap:
|
|
18448
|
+
autorouterMap: z129.record(z129.string(), autorouterDefinition).optional(),
|
|
18429
18449
|
registryApiUrl: url.optional(),
|
|
18430
18450
|
cloudAutorouterUrl: url.optional(),
|
|
18431
|
-
projectName:
|
|
18451
|
+
projectName: z129.string().optional(),
|
|
18432
18452
|
projectBaseUrl: url.optional(),
|
|
18433
|
-
version:
|
|
18453
|
+
version: z129.string().optional(),
|
|
18434
18454
|
url: url.optional(),
|
|
18435
|
-
printBoardInformationToSilkscreen:
|
|
18436
|
-
includeBoardFiles:
|
|
18455
|
+
printBoardInformationToSilkscreen: z129.boolean().optional(),
|
|
18456
|
+
includeBoardFiles: z129.array(z129.string()).describe(
|
|
18437
18457
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
18438
18458
|
).optional(),
|
|
18439
|
-
snapshotsDir:
|
|
18459
|
+
snapshotsDir: z129.string().describe(
|
|
18440
18460
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
18441
18461
|
).optional(),
|
|
18442
18462
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
18443
|
-
unitPreference:
|
|
18444
|
-
localCacheEngine:
|
|
18445
|
-
pcbDisabled:
|
|
18446
|
-
routingDisabled:
|
|
18447
|
-
schematicDisabled:
|
|
18448
|
-
partsEngineDisabled:
|
|
18449
|
-
drcChecksDisabled:
|
|
18450
|
-
netlistDrcChecksDisabled:
|
|
18451
|
-
routingDrcChecksDisabled:
|
|
18452
|
-
placementDrcChecksDisabled:
|
|
18453
|
-
pinSpecificationDrcChecksDisabled:
|
|
18454
|
-
spiceEngineMap:
|
|
18455
|
-
footprintLibraryMap:
|
|
18456
|
-
|
|
18457
|
-
|
|
18463
|
+
unitPreference: z129.enum(["mm", "in", "mil"]).optional(),
|
|
18464
|
+
localCacheEngine: z129.any().optional(),
|
|
18465
|
+
pcbDisabled: z129.boolean().optional(),
|
|
18466
|
+
routingDisabled: z129.boolean().optional(),
|
|
18467
|
+
schematicDisabled: z129.boolean().optional(),
|
|
18468
|
+
partsEngineDisabled: z129.boolean().optional(),
|
|
18469
|
+
drcChecksDisabled: z129.boolean().optional(),
|
|
18470
|
+
netlistDrcChecksDisabled: z129.boolean().optional(),
|
|
18471
|
+
routingDrcChecksDisabled: z129.boolean().optional(),
|
|
18472
|
+
placementDrcChecksDisabled: z129.boolean().optional(),
|
|
18473
|
+
pinSpecificationDrcChecksDisabled: z129.boolean().optional(),
|
|
18474
|
+
spiceEngineMap: z129.record(z129.string(), spiceEngineZod).optional(),
|
|
18475
|
+
footprintLibraryMap: z129.record(
|
|
18476
|
+
z129.string(),
|
|
18477
|
+
z129.union([
|
|
18458
18478
|
pathToCircuitJsonFn,
|
|
18459
|
-
|
|
18460
|
-
|
|
18461
|
-
|
|
18479
|
+
z129.record(
|
|
18480
|
+
z129.string(),
|
|
18481
|
+
z129.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
18462
18482
|
)
|
|
18463
18483
|
])
|
|
18464
18484
|
).optional(),
|
|
18465
|
-
footprintFileParserMap:
|
|
18466
|
-
resolveProjectStaticFileImportUrl:
|
|
18485
|
+
footprintFileParserMap: z129.record(z129.string(), footprintFileParserEntry).optional(),
|
|
18486
|
+
resolveProjectStaticFileImportUrl: z129.function().args(z129.string()).returns(z129.promise(z129.string())).describe(
|
|
18467
18487
|
"A function that returns a string URL for static files for the project"
|
|
18468
18488
|
).optional(),
|
|
18469
18489
|
platformFetch: platformFetch.optional()
|
|
@@ -18676,6 +18696,7 @@ export {
|
|
|
18676
18696
|
schematicTableProps,
|
|
18677
18697
|
schematicTextProps,
|
|
18678
18698
|
silkscreenCircleProps,
|
|
18699
|
+
silkscreenGraphicProps,
|
|
18679
18700
|
silkscreenLineProps,
|
|
18680
18701
|
silkscreenPathProps,
|
|
18681
18702
|
silkscreenRectProps,
|