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