@tscircuit/props 0.0.436 → 0.0.438
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 +92 -7
- package/dist/index.d.ts +1179 -7
- package/dist/index.js +207 -172
- package/dist/index.js.map +1 -1
- package/lib/components/currentsource.ts +58 -0
- package/lib/components/group.ts +8 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -585,6 +585,7 @@ var autorouterConfig = z30.object({
|
|
|
585
585
|
"auto",
|
|
586
586
|
"auto_local",
|
|
587
587
|
"auto_cloud",
|
|
588
|
+
"tscircuit_beta",
|
|
588
589
|
"freerouting",
|
|
589
590
|
"laser_prefab",
|
|
590
591
|
"sequential-trace",
|
|
@@ -599,6 +600,7 @@ var autorouterPreset = z30.union([
|
|
|
599
600
|
z30.literal("auto"),
|
|
600
601
|
z30.literal("auto_local"),
|
|
601
602
|
z30.literal("auto_cloud"),
|
|
603
|
+
z30.literal("tscircuit_beta"),
|
|
602
604
|
z30.literal("freerouting"),
|
|
603
605
|
z30.literal("laser_prefab"),
|
|
604
606
|
// Prefabricated PCB with laser copper ablation
|
|
@@ -612,6 +614,7 @@ var autorouterProp = z30.union([
|
|
|
612
614
|
autorouterPreset,
|
|
613
615
|
autorouterString
|
|
614
616
|
]);
|
|
617
|
+
var autorouterEffortLevel = z30.enum(["1x", "2x", "5x", "10x", "100x"]);
|
|
615
618
|
var baseGroupProps = commonLayoutProps.extend({
|
|
616
619
|
name: z30.string().optional(),
|
|
617
620
|
children: z30.any().optional(),
|
|
@@ -713,6 +716,7 @@ var subcircuitGroupProps = baseGroupProps.extend({
|
|
|
713
716
|
partsEngine: partsEngine.optional(),
|
|
714
717
|
pcbRouteCache: z30.custom((v) => true).optional(),
|
|
715
718
|
autorouter: autorouterProp.optional(),
|
|
719
|
+
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
716
720
|
square: z30.boolean().optional(),
|
|
717
721
|
emptyArea: z30.string().optional(),
|
|
718
722
|
filledArea: z30.string().optional(),
|
|
@@ -1986,58 +1990,85 @@ var voltageSourceProps = commonComponentProps.extend({
|
|
|
1986
1990
|
var voltageSourcePins = lrPolarPins;
|
|
1987
1991
|
expectTypesMatch(true);
|
|
1988
1992
|
|
|
1989
|
-
// lib/components/
|
|
1993
|
+
// lib/components/currentsource.ts
|
|
1994
|
+
import { frequency as frequency5, rotation as rotation5, current } from "circuit-json";
|
|
1990
1995
|
import { z as z87 } from "zod";
|
|
1996
|
+
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
1997
|
+
var percentage2 = z87.union([z87.string(), z87.number()]).transform((val) => {
|
|
1998
|
+
if (typeof val === "string") {
|
|
1999
|
+
if (val.endsWith("%")) {
|
|
2000
|
+
return parseFloat(val.slice(0, -1)) / 100;
|
|
2001
|
+
}
|
|
2002
|
+
return parseFloat(val);
|
|
2003
|
+
}
|
|
2004
|
+
return val;
|
|
2005
|
+
}).pipe(
|
|
2006
|
+
z87.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2007
|
+
);
|
|
2008
|
+
var currentSourceProps = commonComponentProps.extend({
|
|
2009
|
+
current: current.optional(),
|
|
2010
|
+
frequency: frequency5.optional(),
|
|
2011
|
+
peakToPeakCurrent: current.optional(),
|
|
2012
|
+
waveShape: z87.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
2013
|
+
phase: rotation5.optional(),
|
|
2014
|
+
dutyCycle: percentage2.optional(),
|
|
2015
|
+
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
2016
|
+
});
|
|
2017
|
+
var currentSourcePins = lrPolarPins;
|
|
2018
|
+
expectTypesMatch(true);
|
|
2019
|
+
|
|
2020
|
+
// lib/components/voltageprobe.ts
|
|
2021
|
+
import { z as z88 } from "zod";
|
|
1991
2022
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
1992
|
-
name:
|
|
1993
|
-
connectsTo:
|
|
1994
|
-
referenceTo:
|
|
1995
|
-
color:
|
|
2023
|
+
name: z88.string().optional(),
|
|
2024
|
+
connectsTo: z88.string(),
|
|
2025
|
+
referenceTo: z88.string().optional(),
|
|
2026
|
+
color: z88.string().optional()
|
|
1996
2027
|
});
|
|
1997
2028
|
expectTypesMatch(true);
|
|
1998
2029
|
|
|
1999
2030
|
// lib/components/schematic-arc.ts
|
|
2000
|
-
import { distance as distance25, point as point5, rotation as
|
|
2001
|
-
import { z as
|
|
2002
|
-
var schematicArcProps =
|
|
2031
|
+
import { distance as distance25, point as point5, rotation as rotation6 } from "circuit-json";
|
|
2032
|
+
import { z as z89 } from "zod";
|
|
2033
|
+
var schematicArcProps = z89.object({
|
|
2003
2034
|
center: point5,
|
|
2004
2035
|
radius: distance25,
|
|
2005
|
-
startAngleDegrees:
|
|
2006
|
-
endAngleDegrees:
|
|
2007
|
-
direction:
|
|
2036
|
+
startAngleDegrees: rotation6,
|
|
2037
|
+
endAngleDegrees: rotation6,
|
|
2038
|
+
direction: z89.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
2008
2039
|
strokeWidth: distance25.optional(),
|
|
2009
|
-
color:
|
|
2010
|
-
isDashed:
|
|
2040
|
+
color: z89.string().optional(),
|
|
2041
|
+
isDashed: z89.boolean().optional().default(false)
|
|
2011
2042
|
});
|
|
2012
2043
|
expectTypesMatch(true);
|
|
2013
2044
|
|
|
2014
2045
|
// lib/components/toolingrail.ts
|
|
2015
|
-
import { z as
|
|
2016
|
-
var toolingrailProps =
|
|
2017
|
-
children:
|
|
2046
|
+
import { z as z90 } from "zod";
|
|
2047
|
+
var toolingrailProps = z90.object({
|
|
2048
|
+
children: z90.any().optional()
|
|
2018
2049
|
});
|
|
2019
2050
|
expectTypesMatch(true);
|
|
2020
2051
|
|
|
2021
2052
|
// lib/components/schematic-box.ts
|
|
2022
2053
|
import { distance as distance26 } from "circuit-json";
|
|
2023
|
-
import { z as
|
|
2024
|
-
var schematicBoxProps =
|
|
2054
|
+
import { z as z91 } from "zod";
|
|
2055
|
+
var schematicBoxProps = z91.object({
|
|
2025
2056
|
schX: distance26.optional(),
|
|
2026
2057
|
schY: distance26.optional(),
|
|
2027
2058
|
width: distance26.optional(),
|
|
2028
2059
|
height: distance26.optional(),
|
|
2029
|
-
overlay:
|
|
2060
|
+
overlay: z91.array(z91.string()).optional(),
|
|
2030
2061
|
padding: distance26.optional(),
|
|
2031
2062
|
paddingLeft: distance26.optional(),
|
|
2032
2063
|
paddingRight: distance26.optional(),
|
|
2033
2064
|
paddingTop: distance26.optional(),
|
|
2034
2065
|
paddingBottom: distance26.optional(),
|
|
2035
|
-
title:
|
|
2066
|
+
title: z91.string().optional(),
|
|
2036
2067
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
2037
|
-
titleColor:
|
|
2068
|
+
titleColor: z91.string().optional(),
|
|
2038
2069
|
titleFontSize: distance26.optional(),
|
|
2039
|
-
titleInside:
|
|
2040
|
-
strokeStyle:
|
|
2070
|
+
titleInside: z91.boolean().default(false),
|
|
2071
|
+
strokeStyle: z91.enum(["solid", "dashed"]).default("solid")
|
|
2041
2072
|
}).refine(
|
|
2042
2073
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
2043
2074
|
{
|
|
@@ -2053,59 +2084,59 @@ expectTypesMatch(true);
|
|
|
2053
2084
|
|
|
2054
2085
|
// lib/components/schematic-circle.ts
|
|
2055
2086
|
import { distance as distance27, point as point6 } from "circuit-json";
|
|
2056
|
-
import { z as
|
|
2057
|
-
var schematicCircleProps =
|
|
2087
|
+
import { z as z92 } from "zod";
|
|
2088
|
+
var schematicCircleProps = z92.object({
|
|
2058
2089
|
center: point6,
|
|
2059
2090
|
radius: distance27,
|
|
2060
2091
|
strokeWidth: distance27.optional(),
|
|
2061
|
-
color:
|
|
2062
|
-
isFilled:
|
|
2063
|
-
fillColor:
|
|
2064
|
-
isDashed:
|
|
2092
|
+
color: z92.string().optional(),
|
|
2093
|
+
isFilled: z92.boolean().optional().default(false),
|
|
2094
|
+
fillColor: z92.string().optional(),
|
|
2095
|
+
isDashed: z92.boolean().optional().default(false)
|
|
2065
2096
|
});
|
|
2066
2097
|
expectTypesMatch(
|
|
2067
2098
|
true
|
|
2068
2099
|
);
|
|
2069
2100
|
|
|
2070
2101
|
// lib/components/schematic-rect.ts
|
|
2071
|
-
import { distance as distance28, rotation as
|
|
2072
|
-
import { z as
|
|
2073
|
-
var schematicRectProps =
|
|
2102
|
+
import { distance as distance28, rotation as rotation7 } from "circuit-json";
|
|
2103
|
+
import { z as z93 } from "zod";
|
|
2104
|
+
var schematicRectProps = z93.object({
|
|
2074
2105
|
schX: distance28.optional(),
|
|
2075
2106
|
schY: distance28.optional(),
|
|
2076
2107
|
width: distance28,
|
|
2077
2108
|
height: distance28,
|
|
2078
|
-
rotation:
|
|
2109
|
+
rotation: rotation7.default(0),
|
|
2079
2110
|
strokeWidth: distance28.optional(),
|
|
2080
|
-
color:
|
|
2081
|
-
isFilled:
|
|
2082
|
-
fillColor:
|
|
2083
|
-
isDashed:
|
|
2111
|
+
color: z93.string().optional(),
|
|
2112
|
+
isFilled: z93.boolean().optional().default(false),
|
|
2113
|
+
fillColor: z93.string().optional(),
|
|
2114
|
+
isDashed: z93.boolean().optional().default(false),
|
|
2084
2115
|
cornerRadius: distance28.optional()
|
|
2085
2116
|
});
|
|
2086
2117
|
expectTypesMatch(true);
|
|
2087
2118
|
|
|
2088
2119
|
// lib/components/schematic-line.ts
|
|
2089
2120
|
import { distance as distance29 } from "circuit-json";
|
|
2090
|
-
import { z as
|
|
2091
|
-
var schematicLineProps =
|
|
2121
|
+
import { z as z94 } from "zod";
|
|
2122
|
+
var schematicLineProps = z94.object({
|
|
2092
2123
|
x1: distance29,
|
|
2093
2124
|
y1: distance29,
|
|
2094
2125
|
x2: distance29,
|
|
2095
2126
|
y2: distance29,
|
|
2096
2127
|
strokeWidth: distance29.optional(),
|
|
2097
|
-
color:
|
|
2098
|
-
isDashed:
|
|
2128
|
+
color: z94.string().optional(),
|
|
2129
|
+
isDashed: z94.boolean().optional().default(false)
|
|
2099
2130
|
});
|
|
2100
2131
|
expectTypesMatch(true);
|
|
2101
2132
|
|
|
2102
2133
|
// lib/components/schematic-text.ts
|
|
2103
|
-
import { distance as distance30, rotation as
|
|
2104
|
-
import { z as
|
|
2134
|
+
import { distance as distance30, rotation as rotation8 } from "circuit-json";
|
|
2135
|
+
import { z as z96 } from "zod";
|
|
2105
2136
|
|
|
2106
2137
|
// lib/common/fivePointAnchor.ts
|
|
2107
|
-
import { z as
|
|
2108
|
-
var fivePointAnchor =
|
|
2138
|
+
import { z as z95 } from "zod";
|
|
2139
|
+
var fivePointAnchor = z95.enum([
|
|
2109
2140
|
"center",
|
|
2110
2141
|
"left",
|
|
2111
2142
|
"right",
|
|
@@ -2114,34 +2145,34 @@ var fivePointAnchor = z94.enum([
|
|
|
2114
2145
|
]);
|
|
2115
2146
|
|
|
2116
2147
|
// lib/components/schematic-text.ts
|
|
2117
|
-
var schematicTextProps =
|
|
2148
|
+
var schematicTextProps = z96.object({
|
|
2118
2149
|
schX: distance30.optional(),
|
|
2119
2150
|
schY: distance30.optional(),
|
|
2120
|
-
text:
|
|
2121
|
-
fontSize:
|
|
2122
|
-
anchor:
|
|
2123
|
-
color:
|
|
2124
|
-
schRotation:
|
|
2151
|
+
text: z96.string(),
|
|
2152
|
+
fontSize: z96.number().default(1),
|
|
2153
|
+
anchor: z96.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
2154
|
+
color: z96.string().default("#000000"),
|
|
2155
|
+
schRotation: rotation8.default(0)
|
|
2125
2156
|
});
|
|
2126
2157
|
expectTypesMatch(true);
|
|
2127
2158
|
|
|
2128
2159
|
// lib/components/schematic-path.ts
|
|
2129
2160
|
import { point as point8 } from "circuit-json";
|
|
2130
|
-
import { z as
|
|
2131
|
-
var schematicPathProps =
|
|
2132
|
-
points:
|
|
2133
|
-
isFilled:
|
|
2134
|
-
fillColor:
|
|
2161
|
+
import { z as z97 } from "zod";
|
|
2162
|
+
var schematicPathProps = z97.object({
|
|
2163
|
+
points: z97.array(point8),
|
|
2164
|
+
isFilled: z97.boolean().optional().default(false),
|
|
2165
|
+
fillColor: z97.enum(["red", "blue"]).optional()
|
|
2135
2166
|
});
|
|
2136
2167
|
expectTypesMatch(true);
|
|
2137
2168
|
|
|
2138
2169
|
// lib/components/schematic-table.ts
|
|
2139
2170
|
import { distance as distance31 } from "circuit-json";
|
|
2140
|
-
import { z as
|
|
2141
|
-
var schematicTableProps =
|
|
2171
|
+
import { z as z98 } from "zod";
|
|
2172
|
+
var schematicTableProps = z98.object({
|
|
2142
2173
|
schX: distance31.optional(),
|
|
2143
2174
|
schY: distance31.optional(),
|
|
2144
|
-
children:
|
|
2175
|
+
children: z98.any().optional(),
|
|
2145
2176
|
cellPadding: distance31.optional(),
|
|
2146
2177
|
borderWidth: distance31.optional(),
|
|
2147
2178
|
anchor: ninePointAnchor.optional(),
|
|
@@ -2151,64 +2182,64 @@ expectTypesMatch(true);
|
|
|
2151
2182
|
|
|
2152
2183
|
// lib/components/schematic-row.ts
|
|
2153
2184
|
import { distance as distance32 } from "circuit-json";
|
|
2154
|
-
import { z as
|
|
2155
|
-
var schematicRowProps =
|
|
2156
|
-
children:
|
|
2185
|
+
import { z as z99 } from "zod";
|
|
2186
|
+
var schematicRowProps = z99.object({
|
|
2187
|
+
children: z99.any().optional(),
|
|
2157
2188
|
height: distance32.optional()
|
|
2158
2189
|
});
|
|
2159
2190
|
expectTypesMatch(true);
|
|
2160
2191
|
|
|
2161
2192
|
// lib/components/schematic-cell.ts
|
|
2162
2193
|
import { distance as distance33 } from "circuit-json";
|
|
2163
|
-
import { z as
|
|
2164
|
-
var schematicCellProps =
|
|
2165
|
-
children:
|
|
2166
|
-
horizontalAlign:
|
|
2167
|
-
verticalAlign:
|
|
2194
|
+
import { z as z100 } from "zod";
|
|
2195
|
+
var schematicCellProps = z100.object({
|
|
2196
|
+
children: z100.string().optional(),
|
|
2197
|
+
horizontalAlign: z100.enum(["left", "center", "right"]).optional(),
|
|
2198
|
+
verticalAlign: z100.enum(["top", "middle", "bottom"]).optional(),
|
|
2168
2199
|
fontSize: distance33.optional(),
|
|
2169
|
-
rowSpan:
|
|
2170
|
-
colSpan:
|
|
2200
|
+
rowSpan: z100.number().optional(),
|
|
2201
|
+
colSpan: z100.number().optional(),
|
|
2171
2202
|
width: distance33.optional(),
|
|
2172
|
-
text:
|
|
2203
|
+
text: z100.string().optional()
|
|
2173
2204
|
});
|
|
2174
2205
|
expectTypesMatch(true);
|
|
2175
2206
|
|
|
2176
2207
|
// lib/components/copper-text.ts
|
|
2177
2208
|
import { layer_ref as layer_ref8, length as length7 } from "circuit-json";
|
|
2178
|
-
import { z as
|
|
2209
|
+
import { z as z101 } from "zod";
|
|
2179
2210
|
var copperTextProps = pcbLayoutProps.extend({
|
|
2180
|
-
text:
|
|
2211
|
+
text: z101.string(),
|
|
2181
2212
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2182
|
-
font:
|
|
2213
|
+
font: z101.enum(["tscircuit2024"]).optional(),
|
|
2183
2214
|
fontSize: length7.optional(),
|
|
2184
|
-
layers:
|
|
2185
|
-
knockout:
|
|
2186
|
-
mirrored:
|
|
2215
|
+
layers: z101.array(layer_ref8).optional(),
|
|
2216
|
+
knockout: z101.boolean().optional(),
|
|
2217
|
+
mirrored: z101.boolean().optional()
|
|
2187
2218
|
});
|
|
2188
2219
|
|
|
2189
2220
|
// lib/components/silkscreen-text.ts
|
|
2190
2221
|
import { layer_ref as layer_ref9, length as length8 } from "circuit-json";
|
|
2191
|
-
import { z as
|
|
2222
|
+
import { z as z102 } from "zod";
|
|
2192
2223
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
2193
|
-
text:
|
|
2224
|
+
text: z102.string(),
|
|
2194
2225
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2195
|
-
font:
|
|
2226
|
+
font: z102.enum(["tscircuit2024"]).optional(),
|
|
2196
2227
|
fontSize: length8.optional(),
|
|
2197
2228
|
/**
|
|
2198
2229
|
* If true, text will knock out underlying silkscreen
|
|
2199
2230
|
*/
|
|
2200
|
-
isKnockout:
|
|
2231
|
+
isKnockout: z102.boolean().optional(),
|
|
2201
2232
|
knockoutPadding: length8.optional(),
|
|
2202
2233
|
knockoutPaddingLeft: length8.optional(),
|
|
2203
2234
|
knockoutPaddingRight: length8.optional(),
|
|
2204
2235
|
knockoutPaddingTop: length8.optional(),
|
|
2205
2236
|
knockoutPaddingBottom: length8.optional(),
|
|
2206
|
-
layers:
|
|
2237
|
+
layers: z102.array(layer_ref9).optional()
|
|
2207
2238
|
});
|
|
2208
2239
|
|
|
2209
2240
|
// lib/components/silkscreen-path.ts
|
|
2210
2241
|
import { length as length9, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
2211
|
-
import { z as
|
|
2242
|
+
import { z as z103 } from "zod";
|
|
2212
2243
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
2213
2244
|
pcbLeftEdgeX: true,
|
|
2214
2245
|
pcbRightEdgeX: true,
|
|
@@ -2220,7 +2251,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
2220
2251
|
pcbOffsetY: true,
|
|
2221
2252
|
pcbRotation: true
|
|
2222
2253
|
}).extend({
|
|
2223
|
-
route:
|
|
2254
|
+
route: z103.array(route_hint_point5),
|
|
2224
2255
|
strokeWidth: length9.optional()
|
|
2225
2256
|
});
|
|
2226
2257
|
|
|
@@ -2242,10 +2273,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
2242
2273
|
|
|
2243
2274
|
// lib/components/silkscreen-rect.ts
|
|
2244
2275
|
import { distance as distance35 } from "circuit-json";
|
|
2245
|
-
import { z as
|
|
2276
|
+
import { z as z104 } from "zod";
|
|
2246
2277
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2247
|
-
filled:
|
|
2248
|
-
stroke:
|
|
2278
|
+
filled: z104.boolean().default(true).optional(),
|
|
2279
|
+
stroke: z104.enum(["dashed", "solid", "none"]).optional(),
|
|
2249
2280
|
strokeWidth: distance35.optional(),
|
|
2250
2281
|
width: distance35,
|
|
2251
2282
|
height: distance35,
|
|
@@ -2254,66 +2285,66 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
2254
2285
|
|
|
2255
2286
|
// lib/components/silkscreen-circle.ts
|
|
2256
2287
|
import { distance as distance36 } from "circuit-json";
|
|
2257
|
-
import { z as
|
|
2288
|
+
import { z as z105 } from "zod";
|
|
2258
2289
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2259
|
-
isFilled:
|
|
2260
|
-
isOutline:
|
|
2290
|
+
isFilled: z105.boolean().optional(),
|
|
2291
|
+
isOutline: z105.boolean().optional(),
|
|
2261
2292
|
strokeWidth: distance36.optional(),
|
|
2262
2293
|
radius: distance36
|
|
2263
2294
|
});
|
|
2264
2295
|
|
|
2265
2296
|
// lib/components/trace-hint.ts
|
|
2266
2297
|
import { distance as distance37, layer_ref as layer_ref10, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
2267
|
-
import { z as
|
|
2268
|
-
var routeHintPointProps =
|
|
2298
|
+
import { z as z106 } from "zod";
|
|
2299
|
+
var routeHintPointProps = z106.object({
|
|
2269
2300
|
x: distance37,
|
|
2270
2301
|
y: distance37,
|
|
2271
|
-
via:
|
|
2302
|
+
via: z106.boolean().optional(),
|
|
2272
2303
|
toLayer: layer_ref10.optional()
|
|
2273
2304
|
});
|
|
2274
|
-
var traceHintProps =
|
|
2275
|
-
for:
|
|
2305
|
+
var traceHintProps = z106.object({
|
|
2306
|
+
for: z106.string().optional().describe(
|
|
2276
2307
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
2277
2308
|
),
|
|
2278
|
-
order:
|
|
2309
|
+
order: z106.number().optional(),
|
|
2279
2310
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
2280
|
-
offsets:
|
|
2281
|
-
traceWidth:
|
|
2311
|
+
offsets: z106.array(route_hint_point6).or(z106.array(routeHintPointProps)).optional(),
|
|
2312
|
+
traceWidth: z106.number().optional()
|
|
2282
2313
|
});
|
|
2283
2314
|
|
|
2284
2315
|
// lib/components/port.ts
|
|
2285
|
-
import { z as
|
|
2316
|
+
import { z as z107 } from "zod";
|
|
2286
2317
|
var portProps = commonLayoutProps.extend({
|
|
2287
|
-
name:
|
|
2288
|
-
pinNumber:
|
|
2289
|
-
aliases:
|
|
2318
|
+
name: z107.string(),
|
|
2319
|
+
pinNumber: z107.number().optional(),
|
|
2320
|
+
aliases: z107.array(z107.string()).optional(),
|
|
2290
2321
|
direction,
|
|
2291
|
-
connectsTo:
|
|
2322
|
+
connectsTo: z107.string().or(z107.array(z107.string())).optional()
|
|
2292
2323
|
});
|
|
2293
2324
|
|
|
2294
2325
|
// lib/components/pcb-note-text.ts
|
|
2295
2326
|
import { length as length10 } from "circuit-json";
|
|
2296
|
-
import { z as
|
|
2327
|
+
import { z as z108 } from "zod";
|
|
2297
2328
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
2298
|
-
text:
|
|
2299
|
-
anchorAlignment:
|
|
2300
|
-
font:
|
|
2329
|
+
text: z108.string(),
|
|
2330
|
+
anchorAlignment: z108.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2331
|
+
font: z108.enum(["tscircuit2024"]).optional(),
|
|
2301
2332
|
fontSize: length10.optional(),
|
|
2302
|
-
color:
|
|
2333
|
+
color: z108.string().optional()
|
|
2303
2334
|
});
|
|
2304
2335
|
expectTypesMatch(true);
|
|
2305
2336
|
|
|
2306
2337
|
// lib/components/pcb-note-rect.ts
|
|
2307
2338
|
import { distance as distance38 } from "circuit-json";
|
|
2308
|
-
import { z as
|
|
2339
|
+
import { z as z109 } from "zod";
|
|
2309
2340
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2310
2341
|
width: distance38,
|
|
2311
2342
|
height: distance38,
|
|
2312
2343
|
strokeWidth: distance38.optional(),
|
|
2313
|
-
isFilled:
|
|
2314
|
-
hasStroke:
|
|
2315
|
-
isStrokeDashed:
|
|
2316
|
-
color:
|
|
2344
|
+
isFilled: z109.boolean().optional(),
|
|
2345
|
+
hasStroke: z109.boolean().optional(),
|
|
2346
|
+
isStrokeDashed: z109.boolean().optional(),
|
|
2347
|
+
color: z109.string().optional(),
|
|
2317
2348
|
cornerRadius: distance38.optional()
|
|
2318
2349
|
});
|
|
2319
2350
|
expectTypesMatch(true);
|
|
@@ -2323,7 +2354,7 @@ import {
|
|
|
2323
2354
|
length as length11,
|
|
2324
2355
|
route_hint_point as route_hint_point7
|
|
2325
2356
|
} from "circuit-json";
|
|
2326
|
-
import { z as
|
|
2357
|
+
import { z as z110 } from "zod";
|
|
2327
2358
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
2328
2359
|
pcbLeftEdgeX: true,
|
|
2329
2360
|
pcbRightEdgeX: true,
|
|
@@ -2335,15 +2366,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
2335
2366
|
pcbOffsetY: true,
|
|
2336
2367
|
pcbRotation: true
|
|
2337
2368
|
}).extend({
|
|
2338
|
-
route:
|
|
2369
|
+
route: z110.array(route_hint_point7),
|
|
2339
2370
|
strokeWidth: length11.optional(),
|
|
2340
|
-
color:
|
|
2371
|
+
color: z110.string().optional()
|
|
2341
2372
|
});
|
|
2342
2373
|
expectTypesMatch(true);
|
|
2343
2374
|
|
|
2344
2375
|
// lib/components/pcb-note-line.ts
|
|
2345
2376
|
import { distance as distance39 } from "circuit-json";
|
|
2346
|
-
import { z as
|
|
2377
|
+
import { z as z111 } from "zod";
|
|
2347
2378
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
2348
2379
|
pcbLeftEdgeX: true,
|
|
2349
2380
|
pcbRightEdgeX: true,
|
|
@@ -2360,15 +2391,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
2360
2391
|
x2: distance39,
|
|
2361
2392
|
y2: distance39,
|
|
2362
2393
|
strokeWidth: distance39.optional(),
|
|
2363
|
-
color:
|
|
2364
|
-
isDashed:
|
|
2394
|
+
color: z111.string().optional(),
|
|
2395
|
+
isDashed: z111.boolean().optional()
|
|
2365
2396
|
});
|
|
2366
2397
|
expectTypesMatch(true);
|
|
2367
2398
|
|
|
2368
2399
|
// lib/components/pcb-note-dimension.ts
|
|
2369
2400
|
import { distance as distance40, length as length12 } from "circuit-json";
|
|
2370
|
-
import { z as
|
|
2371
|
-
var dimensionTarget2 =
|
|
2401
|
+
import { z as z112 } from "zod";
|
|
2402
|
+
var dimensionTarget2 = z112.union([z112.string(), point]);
|
|
2372
2403
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
2373
2404
|
pcbLeftEdgeX: true,
|
|
2374
2405
|
pcbRightEdgeX: true,
|
|
@@ -2382,93 +2413,93 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
2382
2413
|
}).extend({
|
|
2383
2414
|
from: dimensionTarget2,
|
|
2384
2415
|
to: dimensionTarget2,
|
|
2385
|
-
text:
|
|
2416
|
+
text: z112.string().optional(),
|
|
2386
2417
|
offset: distance40.optional(),
|
|
2387
|
-
font:
|
|
2418
|
+
font: z112.enum(["tscircuit2024"]).optional(),
|
|
2388
2419
|
fontSize: length12.optional(),
|
|
2389
|
-
color:
|
|
2420
|
+
color: z112.string().optional(),
|
|
2390
2421
|
arrowSize: distance40.optional(),
|
|
2391
|
-
units:
|
|
2392
|
-
outerEdgeToEdge:
|
|
2393
|
-
centerToCenter:
|
|
2394
|
-
innerEdgeToEdge:
|
|
2422
|
+
units: z112.enum(["in", "mm"]).optional(),
|
|
2423
|
+
outerEdgeToEdge: z112.literal(true).optional(),
|
|
2424
|
+
centerToCenter: z112.literal(true).optional(),
|
|
2425
|
+
innerEdgeToEdge: z112.literal(true).optional()
|
|
2395
2426
|
});
|
|
2396
2427
|
expectTypesMatch(
|
|
2397
2428
|
true
|
|
2398
2429
|
);
|
|
2399
2430
|
|
|
2400
2431
|
// lib/platformConfig.ts
|
|
2401
|
-
import { z as
|
|
2402
|
-
var unvalidatedCircuitJson =
|
|
2403
|
-
var footprintLibraryResult =
|
|
2404
|
-
footprintCircuitJson:
|
|
2432
|
+
import { z as z113 } from "zod";
|
|
2433
|
+
var unvalidatedCircuitJson = z113.array(z113.any()).describe("Circuit JSON");
|
|
2434
|
+
var footprintLibraryResult = z113.object({
|
|
2435
|
+
footprintCircuitJson: z113.array(z113.any()),
|
|
2405
2436
|
cadModel: cadModelProp.optional()
|
|
2406
2437
|
});
|
|
2407
|
-
var pathToCircuitJsonFn =
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
).returns(
|
|
2438
|
+
var pathToCircuitJsonFn = z113.function().args(z113.string()).returns(z113.promise(footprintLibraryResult)).or(
|
|
2439
|
+
z113.function().args(
|
|
2440
|
+
z113.string(),
|
|
2441
|
+
z113.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
2442
|
+
).returns(z113.promise(footprintLibraryResult))
|
|
2412
2443
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
2413
|
-
var footprintFileParserEntry =
|
|
2414
|
-
loadFromUrl:
|
|
2444
|
+
var footprintFileParserEntry = z113.object({
|
|
2445
|
+
loadFromUrl: z113.function().args(z113.string()).returns(z113.promise(footprintLibraryResult)).describe(
|
|
2415
2446
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
2416
2447
|
)
|
|
2417
2448
|
});
|
|
2418
|
-
var spiceEngineSimulationResult =
|
|
2419
|
-
engineVersionString:
|
|
2449
|
+
var spiceEngineSimulationResult = z113.object({
|
|
2450
|
+
engineVersionString: z113.string().optional(),
|
|
2420
2451
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
2421
2452
|
});
|
|
2422
|
-
var spiceEngineZod =
|
|
2423
|
-
simulate:
|
|
2453
|
+
var spiceEngineZod = z113.object({
|
|
2454
|
+
simulate: z113.function().args(z113.string()).returns(z113.promise(spiceEngineSimulationResult)).describe(
|
|
2424
2455
|
"A function that takes a SPICE string and returns a simulation result"
|
|
2425
2456
|
)
|
|
2426
2457
|
});
|
|
2427
|
-
var defaultSpiceEngine =
|
|
2458
|
+
var defaultSpiceEngine = z113.custom(
|
|
2428
2459
|
(value) => typeof value === "string"
|
|
2429
2460
|
);
|
|
2430
|
-
var autorouterInstance =
|
|
2431
|
-
run:
|
|
2432
|
-
getOutputSimpleRouteJson:
|
|
2461
|
+
var autorouterInstance = z113.object({
|
|
2462
|
+
run: z113.function().args().returns(z113.promise(z113.unknown())).describe("Run the autorouter"),
|
|
2463
|
+
getOutputSimpleRouteJson: z113.function().args().returns(z113.promise(z113.any())).describe("Get the resulting SimpleRouteJson")
|
|
2433
2464
|
});
|
|
2434
|
-
var autorouterDefinition =
|
|
2435
|
-
createAutorouter:
|
|
2465
|
+
var autorouterDefinition = z113.object({
|
|
2466
|
+
createAutorouter: z113.function().args(z113.any(), z113.any().optional()).returns(z113.union([autorouterInstance, z113.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
2436
2467
|
});
|
|
2437
|
-
var platformConfig =
|
|
2468
|
+
var platformConfig = z113.object({
|
|
2438
2469
|
partsEngine: partsEngine.optional(),
|
|
2439
2470
|
autorouter: autorouterProp.optional(),
|
|
2440
|
-
autorouterMap:
|
|
2441
|
-
registryApiUrl:
|
|
2442
|
-
cloudAutorouterUrl:
|
|
2443
|
-
projectName:
|
|
2444
|
-
projectBaseUrl:
|
|
2445
|
-
version:
|
|
2446
|
-
url:
|
|
2447
|
-
printBoardInformationToSilkscreen:
|
|
2448
|
-
includeBoardFiles:
|
|
2471
|
+
autorouterMap: z113.record(z113.string(), autorouterDefinition).optional(),
|
|
2472
|
+
registryApiUrl: z113.string().optional(),
|
|
2473
|
+
cloudAutorouterUrl: z113.string().optional(),
|
|
2474
|
+
projectName: z113.string().optional(),
|
|
2475
|
+
projectBaseUrl: z113.string().optional(),
|
|
2476
|
+
version: z113.string().optional(),
|
|
2477
|
+
url: z113.string().optional(),
|
|
2478
|
+
printBoardInformationToSilkscreen: z113.boolean().optional(),
|
|
2479
|
+
includeBoardFiles: z113.array(z113.string()).describe(
|
|
2449
2480
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
2450
2481
|
).optional(),
|
|
2451
|
-
snapshotsDir:
|
|
2482
|
+
snapshotsDir: z113.string().describe(
|
|
2452
2483
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
2453
2484
|
).optional(),
|
|
2454
2485
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
2455
|
-
localCacheEngine:
|
|
2456
|
-
pcbDisabled:
|
|
2457
|
-
schematicDisabled:
|
|
2458
|
-
partsEngineDisabled:
|
|
2459
|
-
spiceEngineMap:
|
|
2460
|
-
footprintLibraryMap:
|
|
2461
|
-
|
|
2462
|
-
|
|
2486
|
+
localCacheEngine: z113.any().optional(),
|
|
2487
|
+
pcbDisabled: z113.boolean().optional(),
|
|
2488
|
+
schematicDisabled: z113.boolean().optional(),
|
|
2489
|
+
partsEngineDisabled: z113.boolean().optional(),
|
|
2490
|
+
spiceEngineMap: z113.record(z113.string(), spiceEngineZod).optional(),
|
|
2491
|
+
footprintLibraryMap: z113.record(
|
|
2492
|
+
z113.string(),
|
|
2493
|
+
z113.union([
|
|
2463
2494
|
pathToCircuitJsonFn,
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2495
|
+
z113.record(
|
|
2496
|
+
z113.string(),
|
|
2497
|
+
z113.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
2467
2498
|
)
|
|
2468
2499
|
])
|
|
2469
2500
|
).optional(),
|
|
2470
|
-
footprintFileParserMap:
|
|
2471
|
-
resolveProjectStaticFileImportUrl:
|
|
2501
|
+
footprintFileParserMap: z113.record(z113.string(), footprintFileParserEntry).optional(),
|
|
2502
|
+
resolveProjectStaticFileImportUrl: z113.function().args(z113.string()).returns(z113.promise(z113.string())).describe(
|
|
2472
2503
|
"A function that returns a string URL for static files for the project"
|
|
2473
2504
|
).optional()
|
|
2474
2505
|
});
|
|
@@ -2491,6 +2522,7 @@ expectTypesMatch(true);
|
|
|
2491
2522
|
export {
|
|
2492
2523
|
analogSimulationProps,
|
|
2493
2524
|
autorouterConfig,
|
|
2525
|
+
autorouterEffortLevel,
|
|
2494
2526
|
autorouterPreset,
|
|
2495
2527
|
autorouterProp,
|
|
2496
2528
|
baseGroupProps,
|
|
@@ -2532,6 +2564,9 @@ export {
|
|
|
2532
2564
|
courtyardRectProps,
|
|
2533
2565
|
crystalPins,
|
|
2534
2566
|
crystalProps,
|
|
2567
|
+
currentSourcePinLabels,
|
|
2568
|
+
currentSourcePins,
|
|
2569
|
+
currentSourceProps,
|
|
2535
2570
|
cutoutProps,
|
|
2536
2571
|
diodePins,
|
|
2537
2572
|
diodeProps,
|