@tscircuit/props 0.0.217 → 0.0.219
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 +18 -0
- package/dist/index.d.ts +42 -1
- package/dist/index.js +133 -117
- package/dist/index.js.map +1 -1
- package/lib/common/{five_point_anchor.ts → fivePointAnchor.ts} +1 -1
- package/lib/common/{nine_point_anchor.ts → ninePointAnchor.ts} +1 -1
- package/lib/components/netalias.ts +6 -0
- package/lib/components/netlabel.ts +25 -0
- package/lib/components/schematic-box.ts +2 -2
- package/lib/components/schematic-text.ts +3 -3
- package/lib/components/silkscreen-text.ts +2 -2
- package/lib/index.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@ resistorProps.parse({ resistance: "10k" } as ResistorPropsInput)
|
|
|
38
38
|
| `<mosfet />` | [`MosfetProps`](#mosfetprops-mosfet) |
|
|
39
39
|
| `<net />` | [`NetProps`](#netprops-net) |
|
|
40
40
|
| `<netalias />` | [`NetAliasProps`](#netaliasprops-netalias) |
|
|
41
|
+
| `<netlabel />` | [`NetLabelProps`](#netlabelprops-netlabel) |
|
|
41
42
|
| `<pinheader />` | [`PinHeaderProps`](#pinheaderprops-pinheader) |
|
|
42
43
|
| `<platedhole />` | [`CirclePlatedHoleProps`](#circleplatedholeprops-platedhole) |
|
|
43
44
|
| `<potentiometer />` | [`PotentiometerProps`](#potentiometerprops-potentiometer) |
|
|
@@ -461,6 +462,7 @@ export interface NetProps {
|
|
|
461
462
|
```ts
|
|
462
463
|
export interface NetAliasProps {
|
|
463
464
|
net?: string
|
|
465
|
+
connection?: string
|
|
464
466
|
schX?: number | string
|
|
465
467
|
schY?: number | string
|
|
466
468
|
schRotation?: number | string
|
|
@@ -471,6 +473,22 @@ export interface NetAliasProps {
|
|
|
471
473
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/netalias.ts)
|
|
472
474
|
|
|
473
475
|
|
|
476
|
+
### NetLabelProps `<netlabel />`
|
|
477
|
+
|
|
478
|
+
```ts
|
|
479
|
+
export interface NetLabelProps {
|
|
480
|
+
net?: string
|
|
481
|
+
connection?: string
|
|
482
|
+
schX?: number | string
|
|
483
|
+
schY?: number | string
|
|
484
|
+
schRotation?: number | string
|
|
485
|
+
anchorSide?: "left" | "up" | "right" | "down"
|
|
486
|
+
}
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
[Source](https://github.com/tscircuit/props/blob/main/lib/components/netlabel.ts)
|
|
490
|
+
|
|
491
|
+
|
|
474
492
|
### PinHeaderProps `<pinheader />`
|
|
475
493
|
|
|
476
494
|
```ts
|
package/dist/index.d.ts
CHANGED
|
@@ -16500,15 +16500,52 @@ declare const pinHeaderProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.
|
|
|
16500
16500
|
facingDirection?: "left" | "right" | undefined;
|
|
16501
16501
|
}>;
|
|
16502
16502
|
|
|
16503
|
+
/**
|
|
16504
|
+
* @deprecated Use NetLabelProps instead.
|
|
16505
|
+
*/
|
|
16503
16506
|
interface NetAliasProps {
|
|
16504
16507
|
net?: string;
|
|
16508
|
+
connection?: string;
|
|
16505
16509
|
schX?: number | string;
|
|
16506
16510
|
schY?: number | string;
|
|
16507
16511
|
schRotation?: number | string;
|
|
16508
16512
|
anchorSide?: "left" | "up" | "right" | "down";
|
|
16509
16513
|
}
|
|
16514
|
+
/** @deprecated Use netLabelProps instead. */
|
|
16510
16515
|
declare const netAliasProps: z.ZodObject<{
|
|
16511
16516
|
net: z.ZodOptional<z.ZodString>;
|
|
16517
|
+
connection: z.ZodOptional<z.ZodString>;
|
|
16518
|
+
schX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
16519
|
+
schY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
16520
|
+
schRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
16521
|
+
anchorSide: z.ZodOptional<z.ZodEnum<["left", "up", "right", "down"]>>;
|
|
16522
|
+
}, "strip", z.ZodTypeAny, {
|
|
16523
|
+
schX?: number | undefined;
|
|
16524
|
+
schY?: number | undefined;
|
|
16525
|
+
schRotation?: number | undefined;
|
|
16526
|
+
net?: string | undefined;
|
|
16527
|
+
connection?: string | undefined;
|
|
16528
|
+
anchorSide?: "up" | "down" | "left" | "right" | undefined;
|
|
16529
|
+
}, {
|
|
16530
|
+
schX?: string | number | undefined;
|
|
16531
|
+
schY?: string | number | undefined;
|
|
16532
|
+
schRotation?: string | number | undefined;
|
|
16533
|
+
net?: string | undefined;
|
|
16534
|
+
connection?: string | undefined;
|
|
16535
|
+
anchorSide?: "up" | "down" | "left" | "right" | undefined;
|
|
16536
|
+
}>;
|
|
16537
|
+
|
|
16538
|
+
interface NetLabelProps {
|
|
16539
|
+
net?: string;
|
|
16540
|
+
connection?: string;
|
|
16541
|
+
schX?: number | string;
|
|
16542
|
+
schY?: number | string;
|
|
16543
|
+
schRotation?: number | string;
|
|
16544
|
+
anchorSide?: "left" | "up" | "right" | "down";
|
|
16545
|
+
}
|
|
16546
|
+
declare const netLabelProps: z.ZodObject<{
|
|
16547
|
+
net: z.ZodOptional<z.ZodString>;
|
|
16548
|
+
connection: z.ZodOptional<z.ZodString>;
|
|
16512
16549
|
schX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
16513
16550
|
schY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
16514
16551
|
schRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
@@ -16518,12 +16555,14 @@ declare const netAliasProps: z.ZodObject<{
|
|
|
16518
16555
|
schY?: number | undefined;
|
|
16519
16556
|
schRotation?: number | undefined;
|
|
16520
16557
|
net?: string | undefined;
|
|
16558
|
+
connection?: string | undefined;
|
|
16521
16559
|
anchorSide?: "up" | "down" | "left" | "right" | undefined;
|
|
16522
16560
|
}, {
|
|
16523
16561
|
schX?: string | number | undefined;
|
|
16524
16562
|
schY?: string | number | undefined;
|
|
16525
16563
|
schRotation?: string | number | undefined;
|
|
16526
16564
|
net?: string | undefined;
|
|
16565
|
+
connection?: string | undefined;
|
|
16527
16566
|
anchorSide?: "up" | "down" | "left" | "right" | undefined;
|
|
16528
16567
|
}>;
|
|
16529
16568
|
|
|
@@ -22869,4 +22908,6 @@ interface PlatformConfig {
|
|
|
22869
22908
|
}
|
|
22870
22909
|
declare const platformConfig: z.ZodType<PlatformConfig>;
|
|
22871
22910
|
|
|
22872
|
-
|
|
22911
|
+
declare const ninePointAnchor: z.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>;
|
|
22912
|
+
|
|
22913
|
+
export { type AutorouterConfig, type AutorouterProp, type BaseGroupProps, type BaseManualEditEvent, type BaseManualEditEventInput, type BatteryProps, type BoardProps, type BreakoutPointProps, type BreakoutProps, type CadModelBase, type CadModelJscad, type CadModelObj, type CadModelProp, type CadModelStl, type CapacitorPinLabels, type CapacitorProps, type ChipConnections, type ChipPinLabels, type ChipProps, type ChipPropsSU, type CircleCutoutProps, type CirclePlatedHoleProps, type CircleSmtPadProps, type CircleSolderPasteProps, type CircularHoleWithRectPlatedProps, type CommonComponentProps, type CommonLayoutProps, type ComponentProps, type ConnectionTarget, type Connections, type ConnectorProps, type ConstrainedLayoutProps, type ConstraintProps, type CrystalProps, type CutoutProps, type CutoutPropsInput, type DiodeProps, type Direction, type DirectionAlongEdge, type EditPcbComponentLocationEvent, type EditPcbComponentLocationEventInput, type EditPcbGroupLocationEvent, type EditPcbGroupLocationEventInput, type EditSchematicComponentLocationEvent, type EditSchematicComponentLocationEventInput, type EditSchematicGroupLocationEvent, type EditSchematicGroupLocationEventInput, type EditTraceHintEvent, type EditTraceHintEventInput, type FabricationNotePathProps, type FabricationNoteTextProps, type Footprint, type FootprintProps, type FootprintPropsInput, type FootprintSoupElements, type FusePinLabels, type FuseProps, type GroupProps, type HoleProps, type InductorProps, type InferredChipProps, type InferredConstrainedLayoutProps, type InferredDiodeProps, type InferredFuseProps, type InferredHoleProps, type InferredSmtPadProps, type InferredSolderPasteProps, type InferredSwitchProps, type InferredTestpointProps, type JumperProps, type LayoutConfig, type LedProps, type ManualEditEvent, type ManualEditEventInput, type ManualEditsFile, type ManualEditsFileInput, type ManualPcbPlacement, type ManualPcbPlacementInput, type ManualSchematicPlacement, type ManualSchematicPlacementInput, type ManualTraceHint, type ManualTraceHintInput, type MosfetProps, type NetAliasProps, type NetLabelProps, type NetProps, type NonSubcircuitGroupProps, type OvalPlatedHoleProps, type PartsEngine, type PcbKeepoutProps, type PcbLayoutProps, type PcbRouteCache, type PcbSameXConstraint, type PcbSameYConstraint, type PcbTraceProps, type PcbXDistConstraint, type PcbYDistConstraint, type PillPlatedHoleProps, type PillSmtPadProps, type PillWithRectPadPlatedHoleProps, type PinCompatibleVariant, type PinHeaderProps, type PinLabelFromPinLabelMap, type PinLabelsProp, type PinSideDefinition, type PinVariant, type PlatedHoleProps, type PlatformConfig, type PolygonCutoutProps, type PolygonSmtPadProps, type PortHints, type PortProps, type PotentiometerPinVariant, type PotentiometerProps, type PowerSourceProps, type PushButtonProps, type RectCutoutProps, type RectSmtPadProps, type RectSolderPasteProps, type ResistorPinLabels, type ResistorProps, type ResonatorPinVariant, type ResonatorProps, type RotatedRectSmtPadProps, type SchematicBoxProps, type SchematicLineProps, type SchematicPathProps, type SchematicPinArrangement, type SchematicPinArrangementWithPinCounts, type SchematicPinArrangementWithSides, type SchematicPinArrangementWithSizes, type SchematicPinStyle, type SchematicPortArrangement, type SchematicPortArrangementWithPinCounts, type SchematicPortArrangementWithSides, type SchematicPortArrangementWithSizes, type SchematicTextProps, type Selectors, type SilkscreenCircleProps, type SilkscreenLineProps, type SilkscreenPathProps, type SilkscreenRectProps, type SilkscreenTextProps, type SmtPadProps, type SolderJumperProps, type SolderPasteProps, type StampboardProps, type SubcircuitGroupProps, type SubcircuitGroupPropsWithBool, type SubcircuitProps, type SupplierName, type SupplierPartNumbers, type SupplierProps, type SwitchProps, type TestpointProps, type TraceHintProps, type TraceProps, type TransistorProps, type ViaProps, autorouterConfig, autorouterProp, baseGroupProps, base_manual_edit_event, batteryPins, batteryProps, boardProps, breakoutPointProps, breakoutProps, bugProps, cadModelBase, cadModelJscad, cadModelObj, cadModelProp, cadModelStl, capacitorPinLabels, capacitorPins, capacitorProps, chipProps, circleCutoutProps, circleSmtPadProps, circleSolderPasteProps, commonComponentProps, commonLayoutProps, componentProps, connectorProps, constrainedLayoutProps, constraintProps, crystalPins, crystalProps, cutoutProps, diodePins, diodeProps, direction, directionAlongEdge, distanceOrMultiplier, edit_component_location_event, edit_pcb_component_location_event, edit_pcb_group_location_event, edit_schematic_component_location_event, edit_schematic_group_location_event, edit_trace_hint_event, explicitPinSideDefinition, fabricationNotePathProps, fabricationNoteTextProps, footprintProp, footprintProps, fusePinLabels, fuseProps, groupProps, holeProps, inductorPins, inductorProps, jumperProps, layoutConfig, ledPins, ledProps, lrPins, lrPolarPins, manual_edit_event, manual_edits_file, manual_pcb_placement, manual_schematic_placement, manual_trace_hint, mosfetPins, mosfetProps, netAliasProps, netLabelProps, netProps, ninePointAnchor, partsEngine, pcbKeepoutProps, pcbLayoutProps, pcbSameXConstraintProps, pcbSameYConstraintProps, pcbTraceProps, pcbXDistConstraintProps, pcbYDistConstraintProps, pillSmtPadProps, pinCompatibleVariant, pinHeaderProps, pinLabelsProp, platedHoleProps, platformConfig, point3, polygonCutoutProps, polygonSmtPadProps, portHints, portProps, portRef, potentiometerProps, powerSourceProps, pushButtonProps, rectCutoutProps, rectSmtPadProps, rectSolderPasteProps, resistorPinLabels, resistorPins, resistorProps, resonatorProps, rotatedRectSmtPadProps, rotationPoint3, routeHintPointProps, schematicBoxProps, schematicLineProps, schematicPathProps, schematicPinArrangement, schematicPinStyle, schematicPortArrangement, schematicTextProps, silkscreenCircleProps, silkscreenLineProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, solderPasteProps, solderjumperProps, stampboardProps, subcircuitGroupProps, subcircuitGroupPropsWithBool, subcircuitProps, supplierProps, switchProps, testpointProps, traceHintProps, traceProps, transistorPins, transistorProps, viaProps };
|
package/dist/index.js
CHANGED
|
@@ -935,6 +935,7 @@ import { z as z49 } from "zod";
|
|
|
935
935
|
import { rotation as rotation2 } from "circuit-json";
|
|
936
936
|
var netAliasProps = z49.object({
|
|
937
937
|
net: z49.string().optional(),
|
|
938
|
+
connection: z49.string().optional(),
|
|
938
939
|
schX: distance12.optional(),
|
|
939
940
|
schY: distance12.optional(),
|
|
940
941
|
schRotation: rotation2.optional(),
|
|
@@ -942,6 +943,19 @@ var netAliasProps = z49.object({
|
|
|
942
943
|
});
|
|
943
944
|
expectTypesMatch(true);
|
|
944
945
|
|
|
946
|
+
// lib/components/netlabel.ts
|
|
947
|
+
import { z as z50 } from "zod";
|
|
948
|
+
import { rotation as rotation3 } from "circuit-json";
|
|
949
|
+
var netLabelProps = z50.object({
|
|
950
|
+
net: z50.string().optional(),
|
|
951
|
+
connection: z50.string().optional(),
|
|
952
|
+
schX: distance12.optional(),
|
|
953
|
+
schY: distance12.optional(),
|
|
954
|
+
schRotation: rotation3.optional(),
|
|
955
|
+
anchorSide: z50.enum(["left", "up", "right", "down"]).optional()
|
|
956
|
+
});
|
|
957
|
+
expectTypesMatch(true);
|
|
958
|
+
|
|
945
959
|
// lib/components/push-button.ts
|
|
946
960
|
import "zod";
|
|
947
961
|
var pushButtonProps = chipProps.extend({});
|
|
@@ -952,9 +966,9 @@ var subcircuitProps = subcircuitGroupProps;
|
|
|
952
966
|
expectTypesMatch(true);
|
|
953
967
|
|
|
954
968
|
// lib/components/transistor.ts
|
|
955
|
-
import { z as
|
|
969
|
+
import { z as z52 } from "zod";
|
|
956
970
|
var transistorProps = commonComponentProps.extend({
|
|
957
|
-
type:
|
|
971
|
+
type: z52.enum(["npn", "pnp", "bjt", "jfet", "mosfet"])
|
|
958
972
|
});
|
|
959
973
|
var transistorPins = [
|
|
960
974
|
"pin1",
|
|
@@ -967,10 +981,10 @@ var transistorPins = [
|
|
|
967
981
|
expectTypesMatch(true);
|
|
968
982
|
|
|
969
983
|
// lib/components/mosfet.ts
|
|
970
|
-
import { z as
|
|
984
|
+
import { z as z53 } from "zod";
|
|
971
985
|
var mosfetProps = commonComponentProps.extend({
|
|
972
|
-
channelType:
|
|
973
|
-
mosfetMode:
|
|
986
|
+
channelType: z53.enum(["n", "p"]),
|
|
987
|
+
mosfetMode: z53.enum(["enhancement", "depletion"])
|
|
974
988
|
});
|
|
975
989
|
var mosfetPins = [
|
|
976
990
|
"pin1",
|
|
@@ -990,8 +1004,8 @@ var inductorProps = commonComponentProps.extend({
|
|
|
990
1004
|
var inductorPins = lrPins;
|
|
991
1005
|
|
|
992
1006
|
// lib/components/diode.ts
|
|
993
|
-
import { z as
|
|
994
|
-
var diodeConnectionKeys =
|
|
1007
|
+
import { z as z54 } from "zod";
|
|
1008
|
+
var diodeConnectionKeys = z54.enum([
|
|
995
1009
|
"anode",
|
|
996
1010
|
"cathode",
|
|
997
1011
|
"pin1",
|
|
@@ -999,17 +1013,17 @@ var diodeConnectionKeys = z53.enum([
|
|
|
999
1013
|
"pos",
|
|
1000
1014
|
"neg"
|
|
1001
1015
|
]);
|
|
1002
|
-
var connectionTarget3 =
|
|
1003
|
-
var connectionsProp2 =
|
|
1004
|
-
var diodeVariant =
|
|
1016
|
+
var connectionTarget3 = z54.string().or(z54.array(z54.string()).readonly()).or(z54.array(z54.string()));
|
|
1017
|
+
var connectionsProp2 = z54.record(diodeConnectionKeys, connectionTarget3);
|
|
1018
|
+
var diodeVariant = z54.enum(["standard", "schottky", "zener", "photo", "tvs"]);
|
|
1005
1019
|
var diodeProps = commonComponentProps.extend({
|
|
1006
1020
|
connections: connectionsProp2.optional(),
|
|
1007
1021
|
variant: diodeVariant.optional().default("standard"),
|
|
1008
|
-
standard:
|
|
1009
|
-
schottky:
|
|
1010
|
-
zener:
|
|
1011
|
-
photo:
|
|
1012
|
-
tvs:
|
|
1022
|
+
standard: z54.boolean().optional(),
|
|
1023
|
+
schottky: z54.boolean().optional(),
|
|
1024
|
+
zener: z54.boolean().optional(),
|
|
1025
|
+
photo: z54.boolean().optional(),
|
|
1026
|
+
tvs: z54.boolean().optional()
|
|
1013
1027
|
}).superRefine((data, ctx) => {
|
|
1014
1028
|
const enabledFlags = [
|
|
1015
1029
|
data.standard,
|
|
@@ -1020,11 +1034,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
1020
1034
|
].filter(Boolean).length;
|
|
1021
1035
|
if (enabledFlags > 1) {
|
|
1022
1036
|
ctx.addIssue({
|
|
1023
|
-
code:
|
|
1037
|
+
code: z54.ZodIssueCode.custom,
|
|
1024
1038
|
message: "Exactly one diode variant must be enabled",
|
|
1025
1039
|
path: []
|
|
1026
1040
|
});
|
|
1027
|
-
return
|
|
1041
|
+
return z54.INVALID;
|
|
1028
1042
|
}
|
|
1029
1043
|
}).transform((data) => {
|
|
1030
1044
|
const result = {
|
|
@@ -1072,23 +1086,23 @@ var diodePins = lrPolarPins;
|
|
|
1072
1086
|
expectTypesMatch(true);
|
|
1073
1087
|
|
|
1074
1088
|
// lib/components/led.ts
|
|
1075
|
-
import { z as
|
|
1089
|
+
import { z as z55 } from "zod";
|
|
1076
1090
|
var ledProps = commonComponentProps.extend({
|
|
1077
|
-
color:
|
|
1078
|
-
wavelength:
|
|
1079
|
-
schDisplayValue:
|
|
1091
|
+
color: z55.string().optional(),
|
|
1092
|
+
wavelength: z55.string().optional(),
|
|
1093
|
+
schDisplayValue: z55.string().optional()
|
|
1080
1094
|
});
|
|
1081
1095
|
var ledPins = lrPolarPins;
|
|
1082
1096
|
|
|
1083
1097
|
// lib/components/switch.ts
|
|
1084
|
-
import { z as
|
|
1098
|
+
import { z as z56 } from "zod";
|
|
1085
1099
|
var switchProps = commonComponentProps.extend({
|
|
1086
|
-
type:
|
|
1087
|
-
isNormallyClosed:
|
|
1088
|
-
spst:
|
|
1089
|
-
spdt:
|
|
1090
|
-
dpst:
|
|
1091
|
-
dpdt:
|
|
1100
|
+
type: z56.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
1101
|
+
isNormallyClosed: z56.boolean().optional().default(false),
|
|
1102
|
+
spst: z56.boolean().optional(),
|
|
1103
|
+
spdt: z56.boolean().optional(),
|
|
1104
|
+
dpst: z56.boolean().optional(),
|
|
1105
|
+
dpdt: z56.boolean().optional()
|
|
1092
1106
|
}).transform((props) => {
|
|
1093
1107
|
const updatedProps = { ...props };
|
|
1094
1108
|
if (updatedProps.dpdt) {
|
|
@@ -1120,31 +1134,31 @@ expectTypesMatch(true);
|
|
|
1120
1134
|
|
|
1121
1135
|
// lib/components/fabrication-note-text.ts
|
|
1122
1136
|
import { length as length3 } from "circuit-json";
|
|
1123
|
-
import { z as
|
|
1137
|
+
import { z as z57 } from "zod";
|
|
1124
1138
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
1125
|
-
text:
|
|
1126
|
-
anchorAlignment:
|
|
1127
|
-
font:
|
|
1139
|
+
text: z57.string(),
|
|
1140
|
+
anchorAlignment: z57.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1141
|
+
font: z57.enum(["tscircuit2024"]).optional(),
|
|
1128
1142
|
fontSize: length3.optional(),
|
|
1129
|
-
color:
|
|
1143
|
+
color: z57.string().optional()
|
|
1130
1144
|
});
|
|
1131
1145
|
|
|
1132
1146
|
// lib/components/fabrication-note-path.ts
|
|
1133
1147
|
import { length as length4, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
1134
|
-
import { z as
|
|
1148
|
+
import { z as z58 } from "zod";
|
|
1135
1149
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1136
|
-
route:
|
|
1150
|
+
route: z58.array(route_hint_point3),
|
|
1137
1151
|
strokeWidth: length4.optional(),
|
|
1138
|
-
color:
|
|
1152
|
+
color: z58.string().optional()
|
|
1139
1153
|
});
|
|
1140
1154
|
|
|
1141
1155
|
// lib/components/pcb-trace.ts
|
|
1142
1156
|
import { distance as distance15, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
1143
|
-
import { z as
|
|
1144
|
-
var pcbTraceProps =
|
|
1145
|
-
layer:
|
|
1157
|
+
import { z as z59 } from "zod";
|
|
1158
|
+
var pcbTraceProps = z59.object({
|
|
1159
|
+
layer: z59.string().optional(),
|
|
1146
1160
|
thickness: distance15.optional(),
|
|
1147
|
-
route:
|
|
1161
|
+
route: z59.array(route_hint_point4)
|
|
1148
1162
|
});
|
|
1149
1163
|
|
|
1150
1164
|
// lib/components/via.ts
|
|
@@ -1158,10 +1172,10 @@ var viaProps = commonLayoutProps.extend({
|
|
|
1158
1172
|
|
|
1159
1173
|
// lib/components/testpoint.ts
|
|
1160
1174
|
import { distance as distance17 } from "circuit-json";
|
|
1161
|
-
import { z as
|
|
1175
|
+
import { z as z60 } from "zod";
|
|
1162
1176
|
var testpointProps = commonComponentProps.extend({
|
|
1163
|
-
footprintVariant:
|
|
1164
|
-
padShape:
|
|
1177
|
+
footprintVariant: z60.enum(["pad", "through_hole"]).optional().default("pad"),
|
|
1178
|
+
padShape: z60.enum(["rect", "circle"]).optional().default("circle"),
|
|
1165
1179
|
padDiameter: distance17.optional(),
|
|
1166
1180
|
holeDiameter: distance17.optional(),
|
|
1167
1181
|
width: distance17.optional(),
|
|
@@ -1173,22 +1187,22 @@ var testpointProps = commonComponentProps.extend({
|
|
|
1173
1187
|
expectTypesMatch(true);
|
|
1174
1188
|
|
|
1175
1189
|
// lib/components/breakoutpoint.ts
|
|
1176
|
-
import { z as
|
|
1190
|
+
import { z as z61 } from "zod";
|
|
1177
1191
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1178
|
-
connection:
|
|
1192
|
+
connection: z61.string()
|
|
1179
1193
|
});
|
|
1180
1194
|
expectTypesMatch(true);
|
|
1181
1195
|
|
|
1182
1196
|
// lib/components/pcb-keepout.ts
|
|
1183
1197
|
import { distance as distance18 } from "circuit-json";
|
|
1184
|
-
import { z as
|
|
1185
|
-
var pcbKeepoutProps =
|
|
1198
|
+
import { z as z62 } from "zod";
|
|
1199
|
+
var pcbKeepoutProps = z62.union([
|
|
1186
1200
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1187
|
-
shape:
|
|
1201
|
+
shape: z62.literal("circle"),
|
|
1188
1202
|
radius: distance18
|
|
1189
1203
|
}),
|
|
1190
1204
|
pcbLayoutProps.extend({
|
|
1191
|
-
shape:
|
|
1205
|
+
shape: z62.literal("rect"),
|
|
1192
1206
|
width: distance18,
|
|
1193
1207
|
height: distance18
|
|
1194
1208
|
})
|
|
@@ -1202,11 +1216,11 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
1202
1216
|
|
|
1203
1217
|
// lib/components/schematic-box.ts
|
|
1204
1218
|
import { distance as distance19 } from "circuit-json";
|
|
1205
|
-
import { z as
|
|
1219
|
+
import { z as z64 } from "zod";
|
|
1206
1220
|
|
|
1207
|
-
// lib/common/
|
|
1208
|
-
import { z as
|
|
1209
|
-
var
|
|
1221
|
+
// lib/common/ninePointAnchor.ts
|
|
1222
|
+
import { z as z63 } from "zod";
|
|
1223
|
+
var ninePointAnchor = z63.enum([
|
|
1210
1224
|
"top_left",
|
|
1211
1225
|
"top_center",
|
|
1212
1226
|
"top_right",
|
|
@@ -1219,23 +1233,23 @@ var nine_point_anchor = z62.enum([
|
|
|
1219
1233
|
]);
|
|
1220
1234
|
|
|
1221
1235
|
// lib/components/schematic-box.ts
|
|
1222
|
-
var schematicBoxProps =
|
|
1236
|
+
var schematicBoxProps = z64.object({
|
|
1223
1237
|
schX: distance19,
|
|
1224
1238
|
schY: distance19,
|
|
1225
1239
|
width: distance19.optional(),
|
|
1226
1240
|
height: distance19.optional(),
|
|
1227
|
-
overlay:
|
|
1241
|
+
overlay: z64.array(z64.string()).optional(),
|
|
1228
1242
|
padding: distance19.optional(),
|
|
1229
1243
|
paddingLeft: distance19.optional(),
|
|
1230
1244
|
paddingRight: distance19.optional(),
|
|
1231
1245
|
paddingTop: distance19.optional(),
|
|
1232
1246
|
paddingBottom: distance19.optional(),
|
|
1233
|
-
title:
|
|
1234
|
-
titleAlignment:
|
|
1235
|
-
titleColor:
|
|
1247
|
+
title: z64.string().optional(),
|
|
1248
|
+
titleAlignment: ninePointAnchor.default("center"),
|
|
1249
|
+
titleColor: z64.string().optional(),
|
|
1236
1250
|
titleFontSize: distance19.optional(),
|
|
1237
|
-
titleInside:
|
|
1238
|
-
strokeStyle:
|
|
1251
|
+
titleInside: z64.boolean().default(false),
|
|
1252
|
+
strokeStyle: z64.enum(["solid", "dashed"]).default("solid")
|
|
1239
1253
|
}).refine(
|
|
1240
1254
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
1241
1255
|
{
|
|
@@ -1250,8 +1264,8 @@ var schematicBoxProps = z63.object({
|
|
|
1250
1264
|
|
|
1251
1265
|
// lib/components/schematic-line.ts
|
|
1252
1266
|
import { distance as distance20 } from "circuit-json";
|
|
1253
|
-
import { z as
|
|
1254
|
-
var schematicLineProps =
|
|
1267
|
+
import { z as z65 } from "zod";
|
|
1268
|
+
var schematicLineProps = z65.object({
|
|
1255
1269
|
x1: distance20,
|
|
1256
1270
|
y1: distance20,
|
|
1257
1271
|
x2: distance20,
|
|
@@ -1259,12 +1273,12 @@ var schematicLineProps = z64.object({
|
|
|
1259
1273
|
});
|
|
1260
1274
|
|
|
1261
1275
|
// lib/components/schematic-text.ts
|
|
1262
|
-
import { distance as distance21, rotation as
|
|
1263
|
-
import { z as
|
|
1276
|
+
import { distance as distance21, rotation as rotation4 } from "circuit-json";
|
|
1277
|
+
import { z as z67 } from "zod";
|
|
1264
1278
|
|
|
1265
|
-
// lib/common/
|
|
1266
|
-
import { z as
|
|
1267
|
-
var
|
|
1279
|
+
// lib/common/fivePointAnchor.ts
|
|
1280
|
+
import { z as z66 } from "zod";
|
|
1281
|
+
var fivePointAnchor = z66.enum([
|
|
1268
1282
|
"center",
|
|
1269
1283
|
"left",
|
|
1270
1284
|
"right",
|
|
@@ -1273,40 +1287,40 @@ var five_point_anchor = z65.enum([
|
|
|
1273
1287
|
]);
|
|
1274
1288
|
|
|
1275
1289
|
// lib/components/schematic-text.ts
|
|
1276
|
-
var schematicTextProps =
|
|
1290
|
+
var schematicTextProps = z67.object({
|
|
1277
1291
|
schX: distance21,
|
|
1278
1292
|
schY: distance21,
|
|
1279
|
-
text:
|
|
1280
|
-
fontSize:
|
|
1281
|
-
anchor:
|
|
1282
|
-
color:
|
|
1283
|
-
schRotation:
|
|
1293
|
+
text: z67.string(),
|
|
1294
|
+
fontSize: z67.number().default(1),
|
|
1295
|
+
anchor: z67.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
1296
|
+
color: z67.string().default("#000000"),
|
|
1297
|
+
schRotation: rotation4.default(0)
|
|
1284
1298
|
});
|
|
1285
1299
|
|
|
1286
1300
|
// lib/components/schematic-path.ts
|
|
1287
1301
|
import { point as point5 } from "circuit-json";
|
|
1288
|
-
import { z as
|
|
1289
|
-
var schematicPathProps =
|
|
1290
|
-
points:
|
|
1291
|
-
isFilled:
|
|
1292
|
-
fillColor:
|
|
1302
|
+
import { z as z68 } from "zod";
|
|
1303
|
+
var schematicPathProps = z68.object({
|
|
1304
|
+
points: z68.array(point5),
|
|
1305
|
+
isFilled: z68.boolean().optional().default(false),
|
|
1306
|
+
fillColor: z68.enum(["red", "blue"]).optional()
|
|
1293
1307
|
});
|
|
1294
1308
|
|
|
1295
1309
|
// lib/components/silkscreen-text.ts
|
|
1296
1310
|
import { length as length5 } from "circuit-json";
|
|
1297
|
-
import { z as
|
|
1311
|
+
import { z as z69 } from "zod";
|
|
1298
1312
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
1299
|
-
text:
|
|
1300
|
-
anchorAlignment:
|
|
1301
|
-
font:
|
|
1313
|
+
text: z69.string(),
|
|
1314
|
+
anchorAlignment: ninePointAnchor.default("center"),
|
|
1315
|
+
font: z69.enum(["tscircuit2024"]).optional(),
|
|
1302
1316
|
fontSize: length5.optional()
|
|
1303
1317
|
});
|
|
1304
1318
|
|
|
1305
1319
|
// lib/components/silkscreen-path.ts
|
|
1306
1320
|
import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
1307
|
-
import { z as
|
|
1321
|
+
import { z as z70 } from "zod";
|
|
1308
1322
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1309
|
-
route:
|
|
1323
|
+
route: z70.array(route_hint_point5),
|
|
1310
1324
|
strokeWidth: length6.optional()
|
|
1311
1325
|
});
|
|
1312
1326
|
|
|
@@ -1322,10 +1336,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
|
|
|
1322
1336
|
|
|
1323
1337
|
// lib/components/silkscreen-rect.ts
|
|
1324
1338
|
import { distance as distance23 } from "circuit-json";
|
|
1325
|
-
import { z as
|
|
1339
|
+
import { z as z71 } from "zod";
|
|
1326
1340
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1327
|
-
filled:
|
|
1328
|
-
stroke:
|
|
1341
|
+
filled: z71.boolean().default(true).optional(),
|
|
1342
|
+
stroke: z71.enum(["dashed", "solid", "none"]).optional(),
|
|
1329
1343
|
strokeWidth: distance23.optional(),
|
|
1330
1344
|
width: distance23,
|
|
1331
1345
|
height: distance23
|
|
@@ -1333,60 +1347,60 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1333
1347
|
|
|
1334
1348
|
// lib/components/silkscreen-circle.ts
|
|
1335
1349
|
import { distance as distance24 } from "circuit-json";
|
|
1336
|
-
import { z as
|
|
1350
|
+
import { z as z72 } from "zod";
|
|
1337
1351
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1338
|
-
isFilled:
|
|
1339
|
-
isOutline:
|
|
1352
|
+
isFilled: z72.boolean().optional(),
|
|
1353
|
+
isOutline: z72.boolean().optional(),
|
|
1340
1354
|
strokeWidth: distance24.optional(),
|
|
1341
1355
|
radius: distance24
|
|
1342
1356
|
});
|
|
1343
1357
|
|
|
1344
1358
|
// lib/components/trace-hint.ts
|
|
1345
1359
|
import { distance as distance25, layer_ref as layer_ref6, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
1346
|
-
import { z as
|
|
1347
|
-
var routeHintPointProps =
|
|
1360
|
+
import { z as z73 } from "zod";
|
|
1361
|
+
var routeHintPointProps = z73.object({
|
|
1348
1362
|
x: distance25,
|
|
1349
1363
|
y: distance25,
|
|
1350
|
-
via:
|
|
1364
|
+
via: z73.boolean().optional(),
|
|
1351
1365
|
toLayer: layer_ref6.optional()
|
|
1352
1366
|
});
|
|
1353
|
-
var traceHintProps =
|
|
1354
|
-
for:
|
|
1367
|
+
var traceHintProps = z73.object({
|
|
1368
|
+
for: z73.string().optional().describe(
|
|
1355
1369
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
1356
1370
|
),
|
|
1357
|
-
order:
|
|
1371
|
+
order: z73.number().optional(),
|
|
1358
1372
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
1359
|
-
offsets:
|
|
1360
|
-
traceWidth:
|
|
1373
|
+
offsets: z73.array(route_hint_point6).or(z73.array(routeHintPointProps)).optional(),
|
|
1374
|
+
traceWidth: z73.number().optional()
|
|
1361
1375
|
});
|
|
1362
1376
|
|
|
1363
1377
|
// lib/components/port.ts
|
|
1364
|
-
import { z as
|
|
1378
|
+
import { z as z74 } from "zod";
|
|
1365
1379
|
var portProps = commonLayoutProps.extend({
|
|
1366
|
-
name:
|
|
1367
|
-
pinNumber:
|
|
1368
|
-
aliases:
|
|
1380
|
+
name: z74.string(),
|
|
1381
|
+
pinNumber: z74.number().optional(),
|
|
1382
|
+
aliases: z74.array(z74.string()).optional(),
|
|
1369
1383
|
direction
|
|
1370
1384
|
});
|
|
1371
1385
|
|
|
1372
1386
|
// lib/platformConfig.ts
|
|
1373
|
-
import { z as
|
|
1374
|
-
var unvalidatedCircuitJson =
|
|
1375
|
-
var pathToCircuitJsonFn =
|
|
1376
|
-
var platformConfig =
|
|
1387
|
+
import { z as z75 } from "zod";
|
|
1388
|
+
var unvalidatedCircuitJson = z75.array(z75.any()).describe("Circuit JSON");
|
|
1389
|
+
var pathToCircuitJsonFn = z75.function().args(z75.string()).returns(z75.promise(z75.object({ footprintCircuitJson: z75.array(z75.any()) }))).describe("A function that takes a path and returns Circuit JSON");
|
|
1390
|
+
var platformConfig = z75.object({
|
|
1377
1391
|
partsEngine: partsEngine.optional(),
|
|
1378
1392
|
autorouter: autorouterProp.optional(),
|
|
1379
|
-
registryApiUrl:
|
|
1380
|
-
cloudAutorouterUrl:
|
|
1381
|
-
localCacheEngine:
|
|
1382
|
-
pcbDisabled:
|
|
1383
|
-
schematicDisabled:
|
|
1384
|
-
partsEngineDisabled:
|
|
1385
|
-
footprintLibraryMap:
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1393
|
+
registryApiUrl: z75.string().optional(),
|
|
1394
|
+
cloudAutorouterUrl: z75.string().optional(),
|
|
1395
|
+
localCacheEngine: z75.any().optional(),
|
|
1396
|
+
pcbDisabled: z75.boolean().optional(),
|
|
1397
|
+
schematicDisabled: z75.boolean().optional(),
|
|
1398
|
+
partsEngineDisabled: z75.boolean().optional(),
|
|
1399
|
+
footprintLibraryMap: z75.record(
|
|
1400
|
+
z75.string(),
|
|
1401
|
+
z75.record(
|
|
1402
|
+
z75.string(),
|
|
1403
|
+
z75.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
1390
1404
|
)
|
|
1391
1405
|
).optional()
|
|
1392
1406
|
});
|
|
@@ -1459,7 +1473,9 @@ export {
|
|
|
1459
1473
|
mosfetPins,
|
|
1460
1474
|
mosfetProps,
|
|
1461
1475
|
netAliasProps,
|
|
1476
|
+
netLabelProps,
|
|
1462
1477
|
netProps,
|
|
1478
|
+
ninePointAnchor,
|
|
1463
1479
|
partsEngine,
|
|
1464
1480
|
pcbKeepoutProps,
|
|
1465
1481
|
pcbLayoutProps,
|