@tscircuit/props 0.0.108 → 0.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -1
- package/dist/index.js +373 -473
- package/dist/index.js.map +1 -1
- package/lib/components/crystal.ts +5 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,120 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
1
|
// lib/index.ts
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
cadModelJscad: () => cadModelJscad,
|
|
32
|
-
cadModelObj: () => cadModelObj,
|
|
33
|
-
cadModelProp: () => cadModelProp,
|
|
34
|
-
cadModelStl: () => cadModelStl,
|
|
35
|
-
capacitorPins: () => capacitorPins,
|
|
36
|
-
capacitorProps: () => capacitorProps,
|
|
37
|
-
chipProps: () => chipProps,
|
|
38
|
-
circleSmtPadProps: () => circleSmtPadProps,
|
|
39
|
-
circleSolderPasteProps: () => circleSolderPasteProps,
|
|
40
|
-
commonComponentProps: () => commonComponentProps,
|
|
41
|
-
commonLayoutProps: () => commonLayoutProps,
|
|
42
|
-
componentProps: () => componentProps,
|
|
43
|
-
constrainedLayoutProps: () => constrainedLayoutProps,
|
|
44
|
-
constraintProps: () => constraintProps,
|
|
45
|
-
crystalPins: () => crystalPins,
|
|
46
|
-
crystalProps: () => crystalProps,
|
|
47
|
-
diodePins: () => diodePins,
|
|
48
|
-
diodeProps: () => diodeProps,
|
|
49
|
-
direction: () => direction,
|
|
50
|
-
directionAlongEdge: () => directionAlongEdge,
|
|
51
|
-
distanceOrMultiplier: () => distanceOrMultiplier2,
|
|
52
|
-
explicitPinSideDefinition: () => explicitPinSideDefinition,
|
|
53
|
-
fabricationNotePathProps: () => fabricationNotePathProps,
|
|
54
|
-
fabricationNoteTextProps: () => fabricationNoteTextProps,
|
|
55
|
-
footprintProp: () => footprintProp,
|
|
56
|
-
footprintProps: () => footprintProps,
|
|
57
|
-
groupProps: () => groupProps,
|
|
58
|
-
holeProps: () => holeProps,
|
|
59
|
-
inductorPins: () => inductorPins,
|
|
60
|
-
inductorProps: () => inductorProps,
|
|
61
|
-
jumperProps: () => jumperProps,
|
|
62
|
-
ledPins: () => ledPins,
|
|
63
|
-
ledProps: () => ledProps,
|
|
64
|
-
lrPins: () => lrPins,
|
|
65
|
-
lrPolarPins: () => lrPolarPins,
|
|
66
|
-
netAliasProps: () => netAliasProps,
|
|
67
|
-
netProps: () => netProps,
|
|
68
|
-
pcbKeepoutProps: () => pcbKeepoutProps,
|
|
69
|
-
pcbLayoutProps: () => pcbLayoutProps,
|
|
70
|
-
pcbSameXConstraintProps: () => pcbSameXConstraintProps,
|
|
71
|
-
pcbSameYConstraintProps: () => pcbSameYConstraintProps,
|
|
72
|
-
pcbTraceProps: () => pcbTraceProps,
|
|
73
|
-
pcbXDistConstraintProps: () => pcbXDistConstraintProps,
|
|
74
|
-
pcbYDistConstraintProps: () => pcbYDistConstraintProps,
|
|
75
|
-
pinHeaderProps: () => pinHeaderProps,
|
|
76
|
-
pinLabelsProp: () => pinLabelsProp,
|
|
77
|
-
platedHoleProps: () => platedHoleProps,
|
|
78
|
-
point3: () => point3,
|
|
79
|
-
portHints: () => portHints,
|
|
80
|
-
portProps: () => portProps,
|
|
81
|
-
portRef: () => portRef,
|
|
82
|
-
potentiometerPins: () => potentiometerPins,
|
|
83
|
-
potentiometerProps: () => potentiometerProps,
|
|
84
|
-
powerSourceProps: () => powerSourceProps,
|
|
85
|
-
pushButtonProps: () => pushButtonProps,
|
|
86
|
-
rectSmtPadProps: () => rectSmtPadProps,
|
|
87
|
-
rectSolderPasteProps: () => rectSolderPasteProps,
|
|
88
|
-
resistorPins: () => resistorPins,
|
|
89
|
-
resistorProps: () => resistorProps,
|
|
90
|
-
rotatedRectSmtPadProps: () => rotatedRectSmtPadProps,
|
|
91
|
-
rotationPoint3: () => rotationPoint3,
|
|
92
|
-
routeHintPointProps: () => routeHintPointProps,
|
|
93
|
-
schematicBoxProps: () => schematicBoxProps,
|
|
94
|
-
schematicLineProps: () => schematicLineProps,
|
|
95
|
-
schematicPathProps: () => schematicPathProps,
|
|
96
|
-
schematicPinStyle: () => schematicPinStyle,
|
|
97
|
-
schematicPortArrangement: () => schematicPortArrangement,
|
|
98
|
-
schematicTextProps: () => schematicTextProps,
|
|
99
|
-
silkscreenCircleProps: () => silkscreenCircleProps,
|
|
100
|
-
silkscreenLineProps: () => silkscreenLineProps,
|
|
101
|
-
silkscreenPathProps: () => silkscreenPathProps,
|
|
102
|
-
silkscreenRectProps: () => silkscreenRectProps,
|
|
103
|
-
silkscreenTextProps: () => silkscreenTextProps,
|
|
104
|
-
smtPadProps: () => smtPadProps,
|
|
105
|
-
solderPasteProps: () => solderPasteProps,
|
|
106
|
-
subcircuitGroupProps: () => subcircuitGroupProps,
|
|
107
|
-
subcircuitGroupPropsWithBool: () => subcircuitGroupPropsWithBool,
|
|
108
|
-
subcircuitProps: () => subcircuitProps,
|
|
109
|
-
supplierProps: () => supplierProps,
|
|
110
|
-
switchProps: () => switchProps,
|
|
111
|
-
traceHintProps: () => traceHintProps,
|
|
112
|
-
traceProps: () => traceProps,
|
|
113
|
-
viaProps: () => viaProps
|
|
114
|
-
});
|
|
115
|
-
module.exports = __toCommonJS(lib_exports);
|
|
116
|
-
var import_circuit_json19 = require("circuit-json");
|
|
117
|
-
var import_zod30 = require("zod");
|
|
2
|
+
import {
|
|
3
|
+
distance as distance12,
|
|
4
|
+
inductance,
|
|
5
|
+
layer_ref as layer_ref3,
|
|
6
|
+
length as length3,
|
|
7
|
+
point as point2,
|
|
8
|
+
route_hint_point as route_hint_point2,
|
|
9
|
+
voltage
|
|
10
|
+
} from "circuit-json";
|
|
11
|
+
import { z as z31 } from "zod";
|
|
118
12
|
|
|
119
13
|
// lib/typecheck.ts
|
|
120
14
|
var expectTypesMatch = (shouldBe) => {
|
|
@@ -125,9 +19,9 @@ expectTypesMatch(true);
|
|
|
125
19
|
expectTypesMatch("property a has mismatched types");
|
|
126
20
|
|
|
127
21
|
// lib/common/direction.ts
|
|
128
|
-
|
|
129
|
-
var direction =
|
|
130
|
-
var directionAlongEdge =
|
|
22
|
+
import { z } from "zod";
|
|
23
|
+
var direction = z.enum(["up", "down", "left", "right"]);
|
|
24
|
+
var directionAlongEdge = z.enum([
|
|
131
25
|
"top-to-bottom",
|
|
132
26
|
"left-to-right",
|
|
133
27
|
"bottom-to-top",
|
|
@@ -137,50 +31,55 @@ expectTypesMatch(true);
|
|
|
137
31
|
expectTypesMatch(true);
|
|
138
32
|
|
|
139
33
|
// lib/common/portHints.ts
|
|
140
|
-
|
|
141
|
-
var portHints =
|
|
34
|
+
import { z as z2 } from "zod";
|
|
35
|
+
var portHints = z2.array(z2.string().or(z2.number()));
|
|
142
36
|
expectTypesMatch(true);
|
|
143
37
|
|
|
144
38
|
// lib/common/layout.ts
|
|
145
|
-
|
|
146
|
-
|
|
39
|
+
import {
|
|
40
|
+
distance as distance2,
|
|
41
|
+
layer_ref,
|
|
42
|
+
rotation,
|
|
43
|
+
supplier_name
|
|
44
|
+
} from "circuit-json";
|
|
45
|
+
import { z as z6 } from "zod";
|
|
147
46
|
|
|
148
47
|
// lib/common/cadModel.ts
|
|
149
|
-
|
|
48
|
+
import { z as z4 } from "zod";
|
|
150
49
|
|
|
151
50
|
// lib/common/point3.ts
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
var point3 =
|
|
155
|
-
x:
|
|
156
|
-
y:
|
|
157
|
-
z:
|
|
51
|
+
import { distance } from "circuit-json";
|
|
52
|
+
import { z as z3 } from "zod";
|
|
53
|
+
var point3 = z3.object({
|
|
54
|
+
x: distance,
|
|
55
|
+
y: distance,
|
|
56
|
+
z: distance
|
|
158
57
|
});
|
|
159
58
|
|
|
160
59
|
// lib/common/cadModel.ts
|
|
161
|
-
var rotationPoint3 =
|
|
162
|
-
x:
|
|
163
|
-
y:
|
|
164
|
-
z:
|
|
60
|
+
var rotationPoint3 = z4.object({
|
|
61
|
+
x: z4.union([z4.number(), z4.string()]),
|
|
62
|
+
y: z4.union([z4.number(), z4.string()]),
|
|
63
|
+
z: z4.union([z4.number(), z4.string()])
|
|
165
64
|
});
|
|
166
|
-
var cadModelBase =
|
|
167
|
-
rotationOffset:
|
|
65
|
+
var cadModelBase = z4.object({
|
|
66
|
+
rotationOffset: z4.number().or(rotationPoint3).optional(),
|
|
168
67
|
positionOffset: point3.optional(),
|
|
169
68
|
size: point3.optional()
|
|
170
69
|
});
|
|
171
70
|
expectTypesMatch(true);
|
|
172
71
|
var cadModelStl = cadModelBase.extend({
|
|
173
|
-
stlUrl:
|
|
72
|
+
stlUrl: z4.string()
|
|
174
73
|
});
|
|
175
74
|
var cadModelObj = cadModelBase.extend({
|
|
176
|
-
objUrl:
|
|
177
|
-
mtlUrl:
|
|
75
|
+
objUrl: z4.string(),
|
|
76
|
+
mtlUrl: z4.string().optional()
|
|
178
77
|
});
|
|
179
78
|
var cadModelJscad = cadModelBase.extend({
|
|
180
|
-
jscad:
|
|
79
|
+
jscad: z4.record(z4.any())
|
|
181
80
|
});
|
|
182
|
-
var cadModelProp =
|
|
183
|
-
|
|
81
|
+
var cadModelProp = z4.union([
|
|
82
|
+
z4.string(),
|
|
184
83
|
cadModelStl,
|
|
185
84
|
cadModelObj,
|
|
186
85
|
cadModelJscad
|
|
@@ -188,38 +87,38 @@ var cadModelProp = import_zod4.z.union([
|
|
|
188
87
|
expectTypesMatch(true);
|
|
189
88
|
|
|
190
89
|
// lib/common/footprintProp.ts
|
|
191
|
-
|
|
192
|
-
var footprintProp =
|
|
90
|
+
import { z as z5 } from "zod";
|
|
91
|
+
var footprintProp = z5.custom((v) => true);
|
|
193
92
|
|
|
194
93
|
// lib/common/layout.ts
|
|
195
|
-
var pcbLayoutProps =
|
|
196
|
-
pcbX:
|
|
197
|
-
pcbY:
|
|
198
|
-
pcbRotation:
|
|
199
|
-
layer:
|
|
200
|
-
});
|
|
201
|
-
expectTypesMatch(true);
|
|
202
|
-
var commonLayoutProps =
|
|
203
|
-
pcbX:
|
|
204
|
-
pcbY:
|
|
205
|
-
pcbRotation:
|
|
206
|
-
schX:
|
|
207
|
-
schY:
|
|
208
|
-
schRotation:
|
|
209
|
-
layer:
|
|
94
|
+
var pcbLayoutProps = z6.object({
|
|
95
|
+
pcbX: distance2.optional(),
|
|
96
|
+
pcbY: distance2.optional(),
|
|
97
|
+
pcbRotation: rotation.optional(),
|
|
98
|
+
layer: layer_ref.optional()
|
|
99
|
+
});
|
|
100
|
+
expectTypesMatch(true);
|
|
101
|
+
var commonLayoutProps = z6.object({
|
|
102
|
+
pcbX: distance2.optional(),
|
|
103
|
+
pcbY: distance2.optional(),
|
|
104
|
+
pcbRotation: rotation.optional(),
|
|
105
|
+
schX: distance2.optional(),
|
|
106
|
+
schY: distance2.optional(),
|
|
107
|
+
schRotation: rotation.optional(),
|
|
108
|
+
layer: layer_ref.optional(),
|
|
210
109
|
footprint: footprintProp.optional()
|
|
211
110
|
});
|
|
212
111
|
expectTypesMatch(true);
|
|
213
|
-
var supplierProps =
|
|
214
|
-
supplierPartNumbers:
|
|
112
|
+
var supplierProps = z6.object({
|
|
113
|
+
supplierPartNumbers: z6.record(supplier_name, z6.array(z6.string())).optional()
|
|
215
114
|
});
|
|
216
115
|
expectTypesMatch(true);
|
|
217
116
|
var commonComponentProps = commonLayoutProps.merge(supplierProps).extend({
|
|
218
|
-
key:
|
|
219
|
-
name:
|
|
117
|
+
key: z6.any().optional(),
|
|
118
|
+
name: z6.string(),
|
|
220
119
|
cadModel: cadModelProp.optional(),
|
|
221
|
-
children:
|
|
222
|
-
symbolName:
|
|
120
|
+
children: z6.any().optional(),
|
|
121
|
+
symbolName: z6.string().optional()
|
|
223
122
|
});
|
|
224
123
|
expectTypesMatch(true);
|
|
225
124
|
var lrPins = ["pin1", "left", "pin2", "right"];
|
|
@@ -233,28 +132,28 @@ var lrPolarPins = [
|
|
|
233
132
|
"cathode",
|
|
234
133
|
"neg"
|
|
235
134
|
];
|
|
236
|
-
var distanceOrMultiplier =
|
|
135
|
+
var distanceOrMultiplier = distance2.or(z6.enum(["2x", "3x", "4x"]));
|
|
237
136
|
|
|
238
137
|
// lib/common/schematicPinDefinitions.ts
|
|
239
|
-
|
|
240
|
-
var explicitPinSideDefinition =
|
|
241
|
-
pins:
|
|
242
|
-
direction:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
138
|
+
import { z as z7 } from "zod";
|
|
139
|
+
var explicitPinSideDefinition = z7.object({
|
|
140
|
+
pins: z7.array(z7.union([z7.number(), z7.string()])),
|
|
141
|
+
direction: z7.union([
|
|
142
|
+
z7.literal("top-to-bottom"),
|
|
143
|
+
z7.literal("left-to-right"),
|
|
144
|
+
z7.literal("bottom-to-top"),
|
|
145
|
+
z7.literal("right-to-left")
|
|
247
146
|
])
|
|
248
147
|
});
|
|
249
|
-
var schematicPortArrangement =
|
|
250
|
-
leftSize:
|
|
251
|
-
topSize:
|
|
252
|
-
rightSize:
|
|
253
|
-
bottomSize:
|
|
254
|
-
leftPinCount:
|
|
255
|
-
rightPinCount:
|
|
256
|
-
topPinCount:
|
|
257
|
-
bottomPinCount:
|
|
148
|
+
var schematicPortArrangement = z7.object({
|
|
149
|
+
leftSize: z7.number().optional().describe("@deprecated, use leftPinCount"),
|
|
150
|
+
topSize: z7.number().optional().describe("@deprecated, use topPinCount"),
|
|
151
|
+
rightSize: z7.number().optional().describe("@deprecated, use rightPinCount"),
|
|
152
|
+
bottomSize: z7.number().optional().describe("@deprecated, use bottomPinCount"),
|
|
153
|
+
leftPinCount: z7.number().optional(),
|
|
154
|
+
rightPinCount: z7.number().optional(),
|
|
155
|
+
topPinCount: z7.number().optional(),
|
|
156
|
+
bottomPinCount: z7.number().optional(),
|
|
258
157
|
leftSide: explicitPinSideDefinition.optional(),
|
|
259
158
|
rightSide: explicitPinSideDefinition.optional(),
|
|
260
159
|
topSide: explicitPinSideDefinition.optional(),
|
|
@@ -263,69 +162,69 @@ var schematicPortArrangement = import_zod7.z.object({
|
|
|
263
162
|
expectTypesMatch(true);
|
|
264
163
|
|
|
265
164
|
// lib/common/schematicPinStyle.ts
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
var schematicPinStyle =
|
|
269
|
-
|
|
270
|
-
leftMargin:
|
|
271
|
-
rightMargin:
|
|
272
|
-
topMargin:
|
|
273
|
-
bottomMargin:
|
|
165
|
+
import { distance as distance3 } from "circuit-json";
|
|
166
|
+
import { z as z8 } from "zod";
|
|
167
|
+
var schematicPinStyle = z8.record(
|
|
168
|
+
z8.object({
|
|
169
|
+
leftMargin: distance3.optional(),
|
|
170
|
+
rightMargin: distance3.optional(),
|
|
171
|
+
topMargin: distance3.optional(),
|
|
172
|
+
bottomMargin: distance3.optional()
|
|
274
173
|
})
|
|
275
174
|
);
|
|
276
175
|
expectTypesMatch(true);
|
|
277
176
|
|
|
278
177
|
// lib/components/board.ts
|
|
279
|
-
|
|
178
|
+
import { distance as distance5 } from "circuit-json";
|
|
280
179
|
|
|
281
180
|
// lib/common/point.ts
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
var point =
|
|
285
|
-
x:
|
|
286
|
-
y:
|
|
181
|
+
import { distance as distance4 } from "circuit-json";
|
|
182
|
+
import { z as z9 } from "zod";
|
|
183
|
+
var point = z9.object({
|
|
184
|
+
x: distance4,
|
|
185
|
+
y: distance4
|
|
287
186
|
});
|
|
288
187
|
|
|
289
188
|
// lib/components/board.ts
|
|
290
|
-
|
|
189
|
+
import { z as z11 } from "zod";
|
|
291
190
|
|
|
292
191
|
// lib/components/group.ts
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
var autorouterConfig =
|
|
296
|
-
serverUrl:
|
|
297
|
-
inputFormat:
|
|
298
|
-
serverMode:
|
|
299
|
-
cache:
|
|
300
|
-
});
|
|
301
|
-
var autorouterProp =
|
|
192
|
+
import { length } from "circuit-json";
|
|
193
|
+
import { z as z10 } from "zod";
|
|
194
|
+
var autorouterConfig = z10.object({
|
|
195
|
+
serverUrl: z10.string().optional(),
|
|
196
|
+
inputFormat: z10.enum(["simplified", "circuit-json"]).optional(),
|
|
197
|
+
serverMode: z10.enum(["job", "solve-endpoint"]).optional(),
|
|
198
|
+
cache: z10.custom((v) => true).optional()
|
|
199
|
+
});
|
|
200
|
+
var autorouterProp = z10.union([
|
|
302
201
|
autorouterConfig,
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
202
|
+
z10.literal("sequential-trace"),
|
|
203
|
+
z10.literal("subcircuit"),
|
|
204
|
+
z10.literal("auto"),
|
|
205
|
+
z10.literal("auto-local"),
|
|
206
|
+
z10.literal("auto-cloud")
|
|
308
207
|
]);
|
|
309
208
|
var baseGroupProps = commonLayoutProps.extend({
|
|
310
|
-
name:
|
|
311
|
-
children:
|
|
209
|
+
name: z10.string().optional(),
|
|
210
|
+
children: z10.any().optional()
|
|
312
211
|
});
|
|
313
212
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
314
|
-
layout:
|
|
315
|
-
manualEdits:
|
|
316
|
-
schAutoLayoutEnabled:
|
|
317
|
-
routingDisabled:
|
|
318
|
-
defaultTraceWidth:
|
|
319
|
-
minTraceWidth:
|
|
320
|
-
partsEngine:
|
|
321
|
-
pcbRouteCache:
|
|
213
|
+
layout: z10.custom((v) => true).optional(),
|
|
214
|
+
manualEdits: z10.custom((v) => true).optional(),
|
|
215
|
+
schAutoLayoutEnabled: z10.boolean().optional(),
|
|
216
|
+
routingDisabled: z10.boolean().optional(),
|
|
217
|
+
defaultTraceWidth: length.optional(),
|
|
218
|
+
minTraceWidth: length.optional(),
|
|
219
|
+
partsEngine: z10.custom((v) => "findPart" in v).optional(),
|
|
220
|
+
pcbRouteCache: z10.custom((v) => true).optional(),
|
|
322
221
|
autorouter: autorouterProp.optional()
|
|
323
222
|
});
|
|
324
223
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
325
|
-
subcircuit:
|
|
224
|
+
subcircuit: z10.literal(true)
|
|
326
225
|
});
|
|
327
|
-
var groupProps =
|
|
328
|
-
baseGroupProps.extend({ subcircuit:
|
|
226
|
+
var groupProps = z10.discriminatedUnion("subcircuit", [
|
|
227
|
+
baseGroupProps.extend({ subcircuit: z10.literal(false).optional() }),
|
|
329
228
|
subcircuitGroupPropsWithBool
|
|
330
229
|
]);
|
|
331
230
|
expectTypesMatch(true);
|
|
@@ -334,187 +233,189 @@ expectTypesMatch(true);
|
|
|
334
233
|
|
|
335
234
|
// lib/components/board.ts
|
|
336
235
|
var boardProps = subcircuitGroupProps.extend({
|
|
337
|
-
width:
|
|
338
|
-
height:
|
|
339
|
-
outline:
|
|
236
|
+
width: distance5.optional(),
|
|
237
|
+
height: distance5.optional(),
|
|
238
|
+
outline: z11.array(point).optional()
|
|
340
239
|
});
|
|
341
240
|
expectTypesMatch(true);
|
|
342
241
|
|
|
343
242
|
// lib/components/chip.ts
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
var pinLabelsProp =
|
|
347
|
-
|
|
348
|
-
|
|
243
|
+
import { distance as distance6 } from "circuit-json";
|
|
244
|
+
import { z as z12 } from "zod";
|
|
245
|
+
var pinLabelsProp = z12.record(
|
|
246
|
+
z12.number().or(z12.string()),
|
|
247
|
+
z12.string().or(z12.array(z12.string()).readonly()).or(z12.array(z12.string()))
|
|
349
248
|
);
|
|
350
249
|
expectTypesMatch(true);
|
|
351
250
|
var chipProps = commonComponentProps.extend({
|
|
352
|
-
manufacturerPartNumber:
|
|
353
|
-
pinLabels:
|
|
354
|
-
|
|
355
|
-
|
|
251
|
+
manufacturerPartNumber: z12.string().optional(),
|
|
252
|
+
pinLabels: z12.record(
|
|
253
|
+
z12.number().or(z12.string()),
|
|
254
|
+
z12.string().or(z12.array(z12.string()).readonly())
|
|
356
255
|
).optional(),
|
|
357
256
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
358
257
|
schPinStyle: schematicPinStyle.optional(),
|
|
359
|
-
schPinSpacing:
|
|
360
|
-
schWidth:
|
|
361
|
-
schHeight:
|
|
258
|
+
schPinSpacing: distance6.optional(),
|
|
259
|
+
schWidth: distance6.optional(),
|
|
260
|
+
schHeight: distance6.optional()
|
|
362
261
|
});
|
|
363
262
|
var bugProps = chipProps;
|
|
364
263
|
expectTypesMatch(true);
|
|
365
264
|
|
|
366
265
|
// lib/components/jumper.ts
|
|
367
|
-
|
|
368
|
-
|
|
266
|
+
import { distance as distance7 } from "circuit-json";
|
|
267
|
+
import { z as z13 } from "zod";
|
|
369
268
|
var jumperProps = commonComponentProps.extend({
|
|
370
|
-
manufacturerPartNumber:
|
|
371
|
-
pinLabels:
|
|
269
|
+
manufacturerPartNumber: z13.string().optional(),
|
|
270
|
+
pinLabels: z13.record(z13.number().or(z13.string()), z13.string().or(z13.array(z13.string()))).optional(),
|
|
372
271
|
schPinStyle: schematicPinStyle.optional(),
|
|
373
|
-
schPinSpacing:
|
|
374
|
-
schWidth:
|
|
375
|
-
schHeight:
|
|
376
|
-
schDirection:
|
|
272
|
+
schPinSpacing: distance7.optional(),
|
|
273
|
+
schWidth: distance7.optional(),
|
|
274
|
+
schHeight: distance7.optional(),
|
|
275
|
+
schDirection: z13.enum(["left", "right"]).optional(),
|
|
377
276
|
schPortArrangement: schematicPortArrangement.optional()
|
|
378
277
|
});
|
|
379
278
|
expectTypesMatch(true);
|
|
380
279
|
|
|
381
280
|
// lib/components/platedhole.ts
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
var platedHoleProps =
|
|
281
|
+
import { distance as distance8 } from "circuit-json";
|
|
282
|
+
import { z as z14 } from "zod";
|
|
283
|
+
var platedHoleProps = z14.discriminatedUnion("shape", [
|
|
385
284
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
386
|
-
name:
|
|
387
|
-
shape:
|
|
388
|
-
holeDiameter:
|
|
389
|
-
outerDiameter:
|
|
285
|
+
name: z14.string().optional(),
|
|
286
|
+
shape: z14.literal("circle"),
|
|
287
|
+
holeDiameter: distance8,
|
|
288
|
+
outerDiameter: distance8,
|
|
390
289
|
portHints: portHints.optional()
|
|
391
290
|
}),
|
|
392
291
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
393
|
-
name:
|
|
394
|
-
shape:
|
|
395
|
-
outerWidth:
|
|
396
|
-
outerHeight:
|
|
397
|
-
innerWidth:
|
|
398
|
-
innerHeight:
|
|
292
|
+
name: z14.string().optional(),
|
|
293
|
+
shape: z14.literal("oval"),
|
|
294
|
+
outerWidth: distance8,
|
|
295
|
+
outerHeight: distance8,
|
|
296
|
+
innerWidth: distance8,
|
|
297
|
+
innerHeight: distance8,
|
|
399
298
|
portHints: portHints.optional()
|
|
400
299
|
}),
|
|
401
300
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
402
|
-
name:
|
|
403
|
-
shape:
|
|
404
|
-
outerWidth:
|
|
405
|
-
outerHeight:
|
|
406
|
-
innerWidth:
|
|
407
|
-
innerHeight:
|
|
301
|
+
name: z14.string().optional(),
|
|
302
|
+
shape: z14.literal("pill"),
|
|
303
|
+
outerWidth: distance8,
|
|
304
|
+
outerHeight: distance8,
|
|
305
|
+
innerWidth: distance8,
|
|
306
|
+
innerHeight: distance8,
|
|
408
307
|
portHints: portHints.optional()
|
|
409
308
|
})
|
|
410
309
|
]);
|
|
411
310
|
expectTypesMatch(true);
|
|
412
311
|
|
|
413
312
|
// lib/components/resistor.ts
|
|
414
|
-
|
|
415
|
-
|
|
313
|
+
import { resistance } from "circuit-json";
|
|
314
|
+
import { z as z15 } from "zod";
|
|
416
315
|
var resistorProps = commonComponentProps.extend({
|
|
417
|
-
resistance
|
|
418
|
-
pullupFor:
|
|
419
|
-
pullupTo:
|
|
420
|
-
pulldownFor:
|
|
421
|
-
pulldownTo:
|
|
316
|
+
resistance,
|
|
317
|
+
pullupFor: z15.string().optional(),
|
|
318
|
+
pullupTo: z15.string().optional(),
|
|
319
|
+
pulldownFor: z15.string().optional(),
|
|
320
|
+
pulldownTo: z15.string().optional()
|
|
422
321
|
});
|
|
423
322
|
var resistorPins = lrPins;
|
|
424
323
|
expectTypesMatch(true);
|
|
425
324
|
|
|
426
325
|
// lib/components/potentiometer.ts
|
|
427
|
-
|
|
326
|
+
import { resistance as resistance2 } from "circuit-json";
|
|
428
327
|
var potentiometerProps = commonComponentProps.extend({
|
|
429
|
-
maxResistance:
|
|
328
|
+
maxResistance: resistance2
|
|
430
329
|
});
|
|
431
330
|
var potentiometerPins = lrPins;
|
|
432
331
|
expectTypesMatch(true);
|
|
433
332
|
|
|
434
333
|
// lib/components/crystal.ts
|
|
435
|
-
|
|
334
|
+
import { frequency, capacitance } from "circuit-json";
|
|
335
|
+
import { z as z16 } from "zod";
|
|
436
336
|
var crystalProps = commonComponentProps.extend({
|
|
437
|
-
frequency
|
|
438
|
-
loadCapacitance:
|
|
337
|
+
frequency,
|
|
338
|
+
loadCapacitance: capacitance,
|
|
339
|
+
pinVariant: z16.enum(["2pin", "4pin"]).optional()
|
|
439
340
|
});
|
|
440
341
|
var crystalPins = lrPins;
|
|
441
342
|
expectTypesMatch(true);
|
|
442
343
|
|
|
443
344
|
// lib/components/capacitor.ts
|
|
444
|
-
|
|
445
|
-
|
|
345
|
+
import { capacitance as capacitance2 } from "circuit-json";
|
|
346
|
+
import { z as z17 } from "zod";
|
|
446
347
|
var capacitorProps = commonComponentProps.extend({
|
|
447
|
-
capacitance:
|
|
448
|
-
polarized:
|
|
449
|
-
decouplingFor:
|
|
450
|
-
decouplingTo:
|
|
451
|
-
bypassFor:
|
|
452
|
-
bypassTo:
|
|
348
|
+
capacitance: capacitance2,
|
|
349
|
+
polarized: z17.boolean().optional().default(false),
|
|
350
|
+
decouplingFor: z17.string().optional(),
|
|
351
|
+
decouplingTo: z17.string().optional(),
|
|
352
|
+
bypassFor: z17.string().optional(),
|
|
353
|
+
bypassTo: z17.string().optional()
|
|
453
354
|
});
|
|
454
355
|
var capacitorPins = lrPolarPins;
|
|
455
356
|
expectTypesMatch(true);
|
|
456
357
|
|
|
457
358
|
// lib/components/net.ts
|
|
458
|
-
|
|
459
|
-
var netProps =
|
|
460
|
-
name:
|
|
359
|
+
import { z as z18 } from "zod";
|
|
360
|
+
var netProps = z18.object({
|
|
361
|
+
name: z18.string()
|
|
461
362
|
});
|
|
462
363
|
expectTypesMatch(true);
|
|
463
364
|
|
|
464
365
|
// lib/components/constrainedlayout.ts
|
|
465
|
-
|
|
466
|
-
var constrainedLayoutProps =
|
|
467
|
-
name:
|
|
468
|
-
pcbOnly:
|
|
469
|
-
schOnly:
|
|
366
|
+
import { z as z19 } from "zod";
|
|
367
|
+
var constrainedLayoutProps = z19.object({
|
|
368
|
+
name: z19.string().optional(),
|
|
369
|
+
pcbOnly: z19.boolean().optional(),
|
|
370
|
+
schOnly: z19.boolean().optional()
|
|
470
371
|
});
|
|
471
372
|
expectTypesMatch(true);
|
|
472
373
|
|
|
473
374
|
// lib/common/distance.ts
|
|
474
|
-
|
|
475
|
-
|
|
375
|
+
import "zod";
|
|
376
|
+
import { distance as distance9, length as length2 } from "circuit-json";
|
|
476
377
|
|
|
477
378
|
// lib/components/constraint.ts
|
|
478
|
-
|
|
479
|
-
var pcbXDistConstraintProps =
|
|
480
|
-
pcb:
|
|
481
|
-
xDist:
|
|
482
|
-
left:
|
|
483
|
-
right:
|
|
484
|
-
edgeToEdge:
|
|
485
|
-
centerToCenter:
|
|
379
|
+
import { z as z21 } from "zod";
|
|
380
|
+
var pcbXDistConstraintProps = z21.object({
|
|
381
|
+
pcb: z21.literal(true).optional(),
|
|
382
|
+
xDist: distance9,
|
|
383
|
+
left: z21.string(),
|
|
384
|
+
right: z21.string(),
|
|
385
|
+
edgeToEdge: z21.literal(true).optional(),
|
|
386
|
+
centerToCenter: z21.literal(true).optional()
|
|
486
387
|
});
|
|
487
388
|
expectTypesMatch(
|
|
488
389
|
true
|
|
489
390
|
);
|
|
490
|
-
var pcbYDistConstraintProps =
|
|
491
|
-
pcb:
|
|
492
|
-
yDist:
|
|
493
|
-
top:
|
|
494
|
-
bottom:
|
|
495
|
-
edgeToEdge:
|
|
496
|
-
centerToCenter:
|
|
391
|
+
var pcbYDistConstraintProps = z21.object({
|
|
392
|
+
pcb: z21.literal(true).optional(),
|
|
393
|
+
yDist: distance9,
|
|
394
|
+
top: z21.string(),
|
|
395
|
+
bottom: z21.string(),
|
|
396
|
+
edgeToEdge: z21.literal(true).optional(),
|
|
397
|
+
centerToCenter: z21.literal(true).optional()
|
|
497
398
|
});
|
|
498
399
|
expectTypesMatch(
|
|
499
400
|
true
|
|
500
401
|
);
|
|
501
|
-
var pcbSameYConstraintProps =
|
|
502
|
-
pcb:
|
|
503
|
-
sameY:
|
|
504
|
-
for:
|
|
402
|
+
var pcbSameYConstraintProps = z21.object({
|
|
403
|
+
pcb: z21.literal(true).optional(),
|
|
404
|
+
sameY: z21.literal(true).optional(),
|
|
405
|
+
for: z21.array(z21.string())
|
|
505
406
|
});
|
|
506
407
|
expectTypesMatch(
|
|
507
408
|
true
|
|
508
409
|
);
|
|
509
|
-
var pcbSameXConstraintProps =
|
|
510
|
-
pcb:
|
|
511
|
-
sameX:
|
|
512
|
-
for:
|
|
410
|
+
var pcbSameXConstraintProps = z21.object({
|
|
411
|
+
pcb: z21.literal(true).optional(),
|
|
412
|
+
sameX: z21.literal(true).optional(),
|
|
413
|
+
for: z21.array(z21.string())
|
|
513
414
|
});
|
|
514
415
|
expectTypesMatch(
|
|
515
416
|
true
|
|
516
417
|
);
|
|
517
|
-
var constraintProps =
|
|
418
|
+
var constraintProps = z21.union([
|
|
518
419
|
pcbXDistConstraintProps,
|
|
519
420
|
pcbYDistConstraintProps,
|
|
520
421
|
pcbSameYConstraintProps,
|
|
@@ -523,29 +424,29 @@ var constraintProps = import_zod20.z.union([
|
|
|
523
424
|
expectTypesMatch(true);
|
|
524
425
|
|
|
525
426
|
// lib/components/smtpad.ts
|
|
526
|
-
|
|
427
|
+
import { z as z22 } from "zod";
|
|
527
428
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
528
|
-
shape:
|
|
529
|
-
width:
|
|
530
|
-
height:
|
|
429
|
+
shape: z22.literal("rect"),
|
|
430
|
+
width: distance9,
|
|
431
|
+
height: distance9,
|
|
531
432
|
portHints: portHints.optional()
|
|
532
433
|
});
|
|
533
434
|
expectTypesMatch(true);
|
|
534
435
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
535
|
-
shape:
|
|
536
|
-
width:
|
|
537
|
-
height:
|
|
538
|
-
ccwRotation:
|
|
436
|
+
shape: z22.literal("rotated_rect"),
|
|
437
|
+
width: distance9,
|
|
438
|
+
height: distance9,
|
|
439
|
+
ccwRotation: z22.number(),
|
|
539
440
|
portHints: portHints.optional()
|
|
540
441
|
});
|
|
541
442
|
expectTypesMatch(true);
|
|
542
443
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
543
|
-
shape:
|
|
544
|
-
radius:
|
|
444
|
+
shape: z22.literal("circle"),
|
|
445
|
+
radius: distance9,
|
|
545
446
|
portHints: portHints.optional()
|
|
546
447
|
});
|
|
547
448
|
expectTypesMatch(true);
|
|
548
|
-
var smtPadProps =
|
|
449
|
+
var smtPadProps = z22.union([
|
|
549
450
|
circleSmtPadProps,
|
|
550
451
|
rectSmtPadProps,
|
|
551
452
|
rotatedRectSmtPadProps
|
|
@@ -553,30 +454,30 @@ var smtPadProps = import_zod21.z.union([
|
|
|
553
454
|
expectTypesMatch(true);
|
|
554
455
|
|
|
555
456
|
// lib/components/solderpaste.ts
|
|
556
|
-
|
|
457
|
+
import { z as z23 } from "zod";
|
|
557
458
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
558
|
-
shape:
|
|
559
|
-
width:
|
|
560
|
-
height:
|
|
459
|
+
shape: z23.literal("rect"),
|
|
460
|
+
width: distance9,
|
|
461
|
+
height: distance9
|
|
561
462
|
});
|
|
562
463
|
expectTypesMatch(true);
|
|
563
464
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
564
|
-
shape:
|
|
565
|
-
radius:
|
|
465
|
+
shape: z23.literal("circle"),
|
|
466
|
+
radius: distance9
|
|
566
467
|
});
|
|
567
468
|
expectTypesMatch(true);
|
|
568
|
-
var solderPasteProps =
|
|
469
|
+
var solderPasteProps = z23.union([
|
|
569
470
|
circleSolderPasteProps,
|
|
570
471
|
rectSolderPasteProps
|
|
571
472
|
]);
|
|
572
473
|
expectTypesMatch(true);
|
|
573
474
|
|
|
574
475
|
// lib/components/hole.ts
|
|
575
|
-
|
|
476
|
+
import { z as z24 } from "zod";
|
|
576
477
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
577
|
-
name:
|
|
578
|
-
diameter:
|
|
579
|
-
radius:
|
|
478
|
+
name: z24.string().optional(),
|
|
479
|
+
diameter: distance9.optional(),
|
|
480
|
+
radius: distance9.optional()
|
|
580
481
|
}).transform((d) => ({
|
|
581
482
|
...d,
|
|
582
483
|
diameter: d.diameter ?? 2 * d.radius,
|
|
@@ -585,24 +486,24 @@ var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
585
486
|
expectTypesMatch(true);
|
|
586
487
|
|
|
587
488
|
// lib/components/trace.ts
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
var portRef =
|
|
591
|
-
|
|
592
|
-
|
|
489
|
+
import { distance as distance10, route_hint_point } from "circuit-json";
|
|
490
|
+
import { z as z25 } from "zod";
|
|
491
|
+
var portRef = z25.union([
|
|
492
|
+
z25.string(),
|
|
493
|
+
z25.custom(
|
|
593
494
|
(v) => Boolean(v.getPortSelector)
|
|
594
495
|
)
|
|
595
496
|
]);
|
|
596
|
-
var baseTraceProps =
|
|
597
|
-
key:
|
|
598
|
-
thickness:
|
|
599
|
-
schematicRouteHints:
|
|
600
|
-
pcbRouteHints:
|
|
601
|
-
schDisplayLabel:
|
|
602
|
-
});
|
|
603
|
-
var traceProps =
|
|
497
|
+
var baseTraceProps = z25.object({
|
|
498
|
+
key: z25.string().optional(),
|
|
499
|
+
thickness: distance10.optional(),
|
|
500
|
+
schematicRouteHints: z25.array(point).optional(),
|
|
501
|
+
pcbRouteHints: z25.array(route_hint_point).optional(),
|
|
502
|
+
schDisplayLabel: z25.string().optional()
|
|
503
|
+
});
|
|
504
|
+
var traceProps = z25.union([
|
|
604
505
|
baseTraceProps.extend({
|
|
605
|
-
path:
|
|
506
|
+
path: z25.array(portRef)
|
|
606
507
|
}),
|
|
607
508
|
baseTraceProps.extend({
|
|
608
509
|
from: portRef,
|
|
@@ -611,16 +512,16 @@ var traceProps = import_zod24.z.union([
|
|
|
611
512
|
]);
|
|
612
513
|
|
|
613
514
|
// lib/components/footprint.ts
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
var footprintProps =
|
|
617
|
-
originalLayer:
|
|
515
|
+
import { layer_ref as layer_ref2 } from "circuit-json";
|
|
516
|
+
import { z as z26 } from "zod";
|
|
517
|
+
var footprintProps = z26.object({
|
|
518
|
+
originalLayer: layer_ref2.default("top").optional()
|
|
618
519
|
});
|
|
619
520
|
expectTypesMatch(true);
|
|
620
521
|
|
|
621
522
|
// lib/components/battery.ts
|
|
622
|
-
|
|
623
|
-
var capacity =
|
|
523
|
+
import { z as z27 } from "zod";
|
|
524
|
+
var capacity = z27.number().or(z27.string().endsWith("mAh")).transform((v) => {
|
|
624
525
|
if (typeof v === "string") {
|
|
625
526
|
const valString = v.replace("mAh", "");
|
|
626
527
|
const num = Number.parseFloat(valString);
|
|
@@ -638,35 +539,35 @@ var batteryPins = lrPolarPins;
|
|
|
638
539
|
expectTypesMatch(true);
|
|
639
540
|
|
|
640
541
|
// lib/components/pin-header.ts
|
|
641
|
-
|
|
642
|
-
|
|
542
|
+
import { distance as distance11 } from "circuit-json";
|
|
543
|
+
import { z as z28 } from "zod";
|
|
643
544
|
var pinHeaderProps = commonComponentProps.extend({
|
|
644
|
-
pinCount:
|
|
645
|
-
pitch:
|
|
646
|
-
gender:
|
|
647
|
-
showSilkscreenPinLabels:
|
|
648
|
-
doubleRow:
|
|
649
|
-
holeDiameter:
|
|
650
|
-
platedDiameter:
|
|
651
|
-
pinLabels:
|
|
652
|
-
facingDirection:
|
|
545
|
+
pinCount: z28.number(),
|
|
546
|
+
pitch: distance11.optional(),
|
|
547
|
+
gender: z28.enum(["male", "female"]).optional().default("male"),
|
|
548
|
+
showSilkscreenPinLabels: z28.boolean().optional(),
|
|
549
|
+
doubleRow: z28.boolean().optional(),
|
|
550
|
+
holeDiameter: distance11.optional(),
|
|
551
|
+
platedDiameter: distance11.optional(),
|
|
552
|
+
pinLabels: z28.array(z28.string()).optional(),
|
|
553
|
+
facingDirection: z28.enum(["left", "right"]).optional()
|
|
653
554
|
});
|
|
654
555
|
expectTypesMatch(true);
|
|
655
556
|
|
|
656
557
|
// lib/components/netalias.ts
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
var netAliasProps =
|
|
660
|
-
net:
|
|
661
|
-
schX:
|
|
662
|
-
schY:
|
|
663
|
-
schRotation:
|
|
664
|
-
anchorSide:
|
|
558
|
+
import { z as z29 } from "zod";
|
|
559
|
+
import { rotation as rotation2 } from "circuit-json";
|
|
560
|
+
var netAliasProps = z29.object({
|
|
561
|
+
net: z29.string().optional(),
|
|
562
|
+
schX: distance9.optional(),
|
|
563
|
+
schY: distance9.optional(),
|
|
564
|
+
schRotation: rotation2.optional(),
|
|
565
|
+
anchorSide: z29.enum(["left", "up", "right", "down"]).optional()
|
|
665
566
|
});
|
|
666
567
|
expectTypesMatch(true);
|
|
667
568
|
|
|
668
569
|
// lib/components/push-button.ts
|
|
669
|
-
|
|
570
|
+
import "zod";
|
|
670
571
|
var pushButtonProps = commonComponentProps.extend({});
|
|
671
572
|
|
|
672
573
|
// lib/components/subcircuit.ts
|
|
@@ -675,134 +576,133 @@ expectTypesMatch(true);
|
|
|
675
576
|
|
|
676
577
|
// lib/index.ts
|
|
677
578
|
var inductorProps = commonComponentProps.extend({
|
|
678
|
-
inductance
|
|
579
|
+
inductance
|
|
679
580
|
});
|
|
680
581
|
var inductorPins = lrPins;
|
|
681
582
|
var diodeProps = commonComponentProps.extend({});
|
|
682
583
|
var diodePins = lrPolarPins;
|
|
683
584
|
var ledProps = commonComponentProps.extend({
|
|
684
|
-
color:
|
|
585
|
+
color: z31.string().optional()
|
|
685
586
|
});
|
|
686
587
|
var ledPins = lrPolarPins;
|
|
687
588
|
var switchProps = commonComponentProps.extend({
|
|
688
|
-
ftype:
|
|
689
|
-
switchType:
|
|
690
|
-
isNormallyClosed:
|
|
589
|
+
ftype: z31.literal("switch"),
|
|
590
|
+
switchType: z31.enum(["spst"]).default("spst"),
|
|
591
|
+
isNormallyClosed: z31.boolean().default(false)
|
|
691
592
|
});
|
|
692
|
-
var distanceOrMultiplier2 =
|
|
593
|
+
var distanceOrMultiplier2 = distance12.or(z31.enum(["2x", "3x", "4x"]));
|
|
693
594
|
var viaProps = commonLayoutProps.extend({
|
|
694
|
-
fromLayer:
|
|
695
|
-
toLayer:
|
|
696
|
-
holeDiameter:
|
|
697
|
-
outerDiameter:
|
|
595
|
+
fromLayer: layer_ref3,
|
|
596
|
+
toLayer: layer_ref3,
|
|
597
|
+
holeDiameter: distance12,
|
|
598
|
+
outerDiameter: distance12
|
|
698
599
|
});
|
|
699
|
-
var pcbKeepoutProps =
|
|
600
|
+
var pcbKeepoutProps = z31.union([
|
|
700
601
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
701
|
-
shape:
|
|
702
|
-
radius:
|
|
602
|
+
shape: z31.literal("circle"),
|
|
603
|
+
radius: distance12
|
|
703
604
|
}),
|
|
704
605
|
pcbLayoutProps.extend({
|
|
705
|
-
shape:
|
|
706
|
-
width:
|
|
707
|
-
height:
|
|
606
|
+
shape: z31.literal("rect"),
|
|
607
|
+
width: distance12,
|
|
608
|
+
height: distance12
|
|
708
609
|
})
|
|
709
610
|
]);
|
|
710
|
-
var schematicBoxProps =
|
|
711
|
-
schX:
|
|
712
|
-
schY:
|
|
713
|
-
width:
|
|
714
|
-
height:
|
|
715
|
-
});
|
|
716
|
-
var schematicTextProps =
|
|
717
|
-
schX:
|
|
718
|
-
schY:
|
|
719
|
-
text:
|
|
720
|
-
});
|
|
721
|
-
var schematicLineProps =
|
|
722
|
-
x1:
|
|
723
|
-
y1:
|
|
724
|
-
x2:
|
|
725
|
-
y2:
|
|
726
|
-
});
|
|
727
|
-
var schematicPathProps =
|
|
728
|
-
points:
|
|
729
|
-
isFilled:
|
|
730
|
-
fillColor:
|
|
611
|
+
var schematicBoxProps = z31.object({
|
|
612
|
+
schX: distance12,
|
|
613
|
+
schY: distance12,
|
|
614
|
+
width: distance12,
|
|
615
|
+
height: distance12
|
|
616
|
+
});
|
|
617
|
+
var schematicTextProps = z31.object({
|
|
618
|
+
schX: distance12,
|
|
619
|
+
schY: distance12,
|
|
620
|
+
text: z31.string()
|
|
621
|
+
});
|
|
622
|
+
var schematicLineProps = z31.object({
|
|
623
|
+
x1: distance12,
|
|
624
|
+
y1: distance12,
|
|
625
|
+
x2: distance12,
|
|
626
|
+
y2: distance12
|
|
627
|
+
});
|
|
628
|
+
var schematicPathProps = z31.object({
|
|
629
|
+
points: z31.array(point2),
|
|
630
|
+
isFilled: z31.boolean().optional().default(false),
|
|
631
|
+
fillColor: z31.enum(["red", "blue"]).optional()
|
|
731
632
|
});
|
|
732
633
|
var componentProps = commonComponentProps;
|
|
733
634
|
var powerSourceProps = commonComponentProps.extend({
|
|
734
|
-
voltage
|
|
635
|
+
voltage
|
|
735
636
|
});
|
|
736
637
|
var portProps = commonLayoutProps.extend({
|
|
737
|
-
name:
|
|
738
|
-
pinNumber:
|
|
739
|
-
aliases:
|
|
638
|
+
name: z31.string(),
|
|
639
|
+
pinNumber: z31.number().optional(),
|
|
640
|
+
aliases: z31.array(z31.string()).optional(),
|
|
740
641
|
direction
|
|
741
642
|
});
|
|
742
643
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
743
|
-
text:
|
|
744
|
-
anchorAlignment:
|
|
745
|
-
font:
|
|
746
|
-
fontSize:
|
|
644
|
+
text: z31.string(),
|
|
645
|
+
anchorAlignment: z31.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
646
|
+
font: z31.enum(["tscircuit2024"]).optional(),
|
|
647
|
+
fontSize: length3.optional()
|
|
747
648
|
});
|
|
748
649
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
749
|
-
route:
|
|
750
|
-
strokeWidth:
|
|
650
|
+
route: z31.array(route_hint_point2),
|
|
651
|
+
strokeWidth: length3.optional()
|
|
751
652
|
});
|
|
752
653
|
var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
753
|
-
strokeWidth:
|
|
754
|
-
x1:
|
|
755
|
-
y1:
|
|
756
|
-
x2:
|
|
757
|
-
y2:
|
|
654
|
+
strokeWidth: distance12,
|
|
655
|
+
x1: distance12,
|
|
656
|
+
y1: distance12,
|
|
657
|
+
x2: distance12,
|
|
658
|
+
y2: distance12
|
|
758
659
|
});
|
|
759
660
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
760
|
-
isFilled:
|
|
761
|
-
isOutline:
|
|
762
|
-
strokeWidth:
|
|
763
|
-
width:
|
|
764
|
-
height:
|
|
661
|
+
isFilled: z31.boolean().optional(),
|
|
662
|
+
isOutline: z31.boolean().optional(),
|
|
663
|
+
strokeWidth: distance12.optional(),
|
|
664
|
+
width: distance12,
|
|
665
|
+
height: distance12
|
|
765
666
|
});
|
|
766
667
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
767
|
-
isFilled:
|
|
768
|
-
isOutline:
|
|
769
|
-
strokeWidth:
|
|
770
|
-
radius:
|
|
771
|
-
});
|
|
772
|
-
var routeHintPointProps =
|
|
773
|
-
x:
|
|
774
|
-
y:
|
|
775
|
-
via:
|
|
776
|
-
toLayer:
|
|
777
|
-
});
|
|
778
|
-
var traceHintProps =
|
|
779
|
-
for:
|
|
668
|
+
isFilled: z31.boolean().optional(),
|
|
669
|
+
isOutline: z31.boolean().optional(),
|
|
670
|
+
strokeWidth: distance12.optional(),
|
|
671
|
+
radius: distance12
|
|
672
|
+
});
|
|
673
|
+
var routeHintPointProps = z31.object({
|
|
674
|
+
x: distance12,
|
|
675
|
+
y: distance12,
|
|
676
|
+
via: z31.boolean().optional(),
|
|
677
|
+
toLayer: layer_ref3.optional()
|
|
678
|
+
});
|
|
679
|
+
var traceHintProps = z31.object({
|
|
680
|
+
for: z31.string().optional().describe(
|
|
780
681
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
781
682
|
),
|
|
782
|
-
order:
|
|
783
|
-
offset:
|
|
784
|
-
offsets:
|
|
785
|
-
traceWidth:
|
|
683
|
+
order: z31.number().optional(),
|
|
684
|
+
offset: route_hint_point2.or(routeHintPointProps).optional(),
|
|
685
|
+
offsets: z31.array(route_hint_point2).or(z31.array(routeHintPointProps)).optional(),
|
|
686
|
+
traceWidth: z31.number().optional()
|
|
786
687
|
});
|
|
787
|
-
var pcbTraceProps =
|
|
788
|
-
layer:
|
|
789
|
-
thickness:
|
|
790
|
-
route:
|
|
688
|
+
var pcbTraceProps = z31.object({
|
|
689
|
+
layer: z31.string().optional(),
|
|
690
|
+
thickness: distance12.optional(),
|
|
691
|
+
route: z31.array(route_hint_point2)
|
|
791
692
|
});
|
|
792
693
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
793
|
-
text:
|
|
794
|
-
anchorAlignment:
|
|
795
|
-
font:
|
|
796
|
-
fontSize:
|
|
797
|
-
color:
|
|
694
|
+
text: z31.string(),
|
|
695
|
+
anchorAlignment: z31.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
696
|
+
font: z31.enum(["tscircuit2024"]).optional(),
|
|
697
|
+
fontSize: length3.optional(),
|
|
698
|
+
color: z31.string().optional()
|
|
798
699
|
});
|
|
799
700
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
800
|
-
route:
|
|
801
|
-
strokeWidth:
|
|
802
|
-
color:
|
|
701
|
+
route: z31.array(route_hint_point2),
|
|
702
|
+
strokeWidth: length3.optional(),
|
|
703
|
+
color: z31.string().optional()
|
|
803
704
|
});
|
|
804
|
-
|
|
805
|
-
0 && (module.exports = {
|
|
705
|
+
export {
|
|
806
706
|
autorouterConfig,
|
|
807
707
|
autorouterProp,
|
|
808
708
|
baseGroupProps,
|
|
@@ -831,7 +731,7 @@ var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcb
|
|
|
831
731
|
diodeProps,
|
|
832
732
|
direction,
|
|
833
733
|
directionAlongEdge,
|
|
834
|
-
distanceOrMultiplier,
|
|
734
|
+
distanceOrMultiplier2 as distanceOrMultiplier,
|
|
835
735
|
explicitPinSideDefinition,
|
|
836
736
|
fabricationNotePathProps,
|
|
837
737
|
fabricationNoteTextProps,
|
|
@@ -894,5 +794,5 @@ var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcb
|
|
|
894
794
|
traceHintProps,
|
|
895
795
|
traceProps,
|
|
896
796
|
viaProps
|
|
897
|
-
}
|
|
797
|
+
};
|
|
898
798
|
//# sourceMappingURL=index.js.map
|