@tscircuit/props 0.0.108 → 0.0.109
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.js +371 -473
- package/dist/index.js.map +1 -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 z30 } 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,187 @@ 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";
|
|
436
335
|
var crystalProps = commonComponentProps.extend({
|
|
437
|
-
frequency
|
|
438
|
-
loadCapacitance:
|
|
336
|
+
frequency,
|
|
337
|
+
loadCapacitance: capacitance
|
|
439
338
|
});
|
|
440
339
|
var crystalPins = lrPins;
|
|
441
340
|
expectTypesMatch(true);
|
|
442
341
|
|
|
443
342
|
// lib/components/capacitor.ts
|
|
444
|
-
|
|
445
|
-
|
|
343
|
+
import { capacitance as capacitance2 } from "circuit-json";
|
|
344
|
+
import { z as z16 } from "zod";
|
|
446
345
|
var capacitorProps = commonComponentProps.extend({
|
|
447
|
-
capacitance:
|
|
448
|
-
polarized:
|
|
449
|
-
decouplingFor:
|
|
450
|
-
decouplingTo:
|
|
451
|
-
bypassFor:
|
|
452
|
-
bypassTo:
|
|
346
|
+
capacitance: capacitance2,
|
|
347
|
+
polarized: z16.boolean().optional().default(false),
|
|
348
|
+
decouplingFor: z16.string().optional(),
|
|
349
|
+
decouplingTo: z16.string().optional(),
|
|
350
|
+
bypassFor: z16.string().optional(),
|
|
351
|
+
bypassTo: z16.string().optional()
|
|
453
352
|
});
|
|
454
353
|
var capacitorPins = lrPolarPins;
|
|
455
354
|
expectTypesMatch(true);
|
|
456
355
|
|
|
457
356
|
// lib/components/net.ts
|
|
458
|
-
|
|
459
|
-
var netProps =
|
|
460
|
-
name:
|
|
357
|
+
import { z as z17 } from "zod";
|
|
358
|
+
var netProps = z17.object({
|
|
359
|
+
name: z17.string()
|
|
461
360
|
});
|
|
462
361
|
expectTypesMatch(true);
|
|
463
362
|
|
|
464
363
|
// lib/components/constrainedlayout.ts
|
|
465
|
-
|
|
466
|
-
var constrainedLayoutProps =
|
|
467
|
-
name:
|
|
468
|
-
pcbOnly:
|
|
469
|
-
schOnly:
|
|
364
|
+
import { z as z18 } from "zod";
|
|
365
|
+
var constrainedLayoutProps = z18.object({
|
|
366
|
+
name: z18.string().optional(),
|
|
367
|
+
pcbOnly: z18.boolean().optional(),
|
|
368
|
+
schOnly: z18.boolean().optional()
|
|
470
369
|
});
|
|
471
370
|
expectTypesMatch(true);
|
|
472
371
|
|
|
473
372
|
// lib/common/distance.ts
|
|
474
|
-
|
|
475
|
-
|
|
373
|
+
import "zod";
|
|
374
|
+
import { distance as distance9, length as length2 } from "circuit-json";
|
|
476
375
|
|
|
477
376
|
// lib/components/constraint.ts
|
|
478
|
-
|
|
479
|
-
var pcbXDistConstraintProps =
|
|
480
|
-
pcb:
|
|
481
|
-
xDist:
|
|
482
|
-
left:
|
|
483
|
-
right:
|
|
484
|
-
edgeToEdge:
|
|
485
|
-
centerToCenter:
|
|
377
|
+
import { z as z20 } from "zod";
|
|
378
|
+
var pcbXDistConstraintProps = z20.object({
|
|
379
|
+
pcb: z20.literal(true).optional(),
|
|
380
|
+
xDist: distance9,
|
|
381
|
+
left: z20.string(),
|
|
382
|
+
right: z20.string(),
|
|
383
|
+
edgeToEdge: z20.literal(true).optional(),
|
|
384
|
+
centerToCenter: z20.literal(true).optional()
|
|
486
385
|
});
|
|
487
386
|
expectTypesMatch(
|
|
488
387
|
true
|
|
489
388
|
);
|
|
490
|
-
var pcbYDistConstraintProps =
|
|
491
|
-
pcb:
|
|
492
|
-
yDist:
|
|
493
|
-
top:
|
|
494
|
-
bottom:
|
|
495
|
-
edgeToEdge:
|
|
496
|
-
centerToCenter:
|
|
389
|
+
var pcbYDistConstraintProps = z20.object({
|
|
390
|
+
pcb: z20.literal(true).optional(),
|
|
391
|
+
yDist: distance9,
|
|
392
|
+
top: z20.string(),
|
|
393
|
+
bottom: z20.string(),
|
|
394
|
+
edgeToEdge: z20.literal(true).optional(),
|
|
395
|
+
centerToCenter: z20.literal(true).optional()
|
|
497
396
|
});
|
|
498
397
|
expectTypesMatch(
|
|
499
398
|
true
|
|
500
399
|
);
|
|
501
|
-
var pcbSameYConstraintProps =
|
|
502
|
-
pcb:
|
|
503
|
-
sameY:
|
|
504
|
-
for:
|
|
400
|
+
var pcbSameYConstraintProps = z20.object({
|
|
401
|
+
pcb: z20.literal(true).optional(),
|
|
402
|
+
sameY: z20.literal(true).optional(),
|
|
403
|
+
for: z20.array(z20.string())
|
|
505
404
|
});
|
|
506
405
|
expectTypesMatch(
|
|
507
406
|
true
|
|
508
407
|
);
|
|
509
|
-
var pcbSameXConstraintProps =
|
|
510
|
-
pcb:
|
|
511
|
-
sameX:
|
|
512
|
-
for:
|
|
408
|
+
var pcbSameXConstraintProps = z20.object({
|
|
409
|
+
pcb: z20.literal(true).optional(),
|
|
410
|
+
sameX: z20.literal(true).optional(),
|
|
411
|
+
for: z20.array(z20.string())
|
|
513
412
|
});
|
|
514
413
|
expectTypesMatch(
|
|
515
414
|
true
|
|
516
415
|
);
|
|
517
|
-
var constraintProps =
|
|
416
|
+
var constraintProps = z20.union([
|
|
518
417
|
pcbXDistConstraintProps,
|
|
519
418
|
pcbYDistConstraintProps,
|
|
520
419
|
pcbSameYConstraintProps,
|
|
@@ -523,29 +422,29 @@ var constraintProps = import_zod20.z.union([
|
|
|
523
422
|
expectTypesMatch(true);
|
|
524
423
|
|
|
525
424
|
// lib/components/smtpad.ts
|
|
526
|
-
|
|
425
|
+
import { z as z21 } from "zod";
|
|
527
426
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
528
|
-
shape:
|
|
529
|
-
width:
|
|
530
|
-
height:
|
|
427
|
+
shape: z21.literal("rect"),
|
|
428
|
+
width: distance9,
|
|
429
|
+
height: distance9,
|
|
531
430
|
portHints: portHints.optional()
|
|
532
431
|
});
|
|
533
432
|
expectTypesMatch(true);
|
|
534
433
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
535
|
-
shape:
|
|
536
|
-
width:
|
|
537
|
-
height:
|
|
538
|
-
ccwRotation:
|
|
434
|
+
shape: z21.literal("rotated_rect"),
|
|
435
|
+
width: distance9,
|
|
436
|
+
height: distance9,
|
|
437
|
+
ccwRotation: z21.number(),
|
|
539
438
|
portHints: portHints.optional()
|
|
540
439
|
});
|
|
541
440
|
expectTypesMatch(true);
|
|
542
441
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
543
|
-
shape:
|
|
544
|
-
radius:
|
|
442
|
+
shape: z21.literal("circle"),
|
|
443
|
+
radius: distance9,
|
|
545
444
|
portHints: portHints.optional()
|
|
546
445
|
});
|
|
547
446
|
expectTypesMatch(true);
|
|
548
|
-
var smtPadProps =
|
|
447
|
+
var smtPadProps = z21.union([
|
|
549
448
|
circleSmtPadProps,
|
|
550
449
|
rectSmtPadProps,
|
|
551
450
|
rotatedRectSmtPadProps
|
|
@@ -553,30 +452,30 @@ var smtPadProps = import_zod21.z.union([
|
|
|
553
452
|
expectTypesMatch(true);
|
|
554
453
|
|
|
555
454
|
// lib/components/solderpaste.ts
|
|
556
|
-
|
|
455
|
+
import { z as z22 } from "zod";
|
|
557
456
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
558
|
-
shape:
|
|
559
|
-
width:
|
|
560
|
-
height:
|
|
457
|
+
shape: z22.literal("rect"),
|
|
458
|
+
width: distance9,
|
|
459
|
+
height: distance9
|
|
561
460
|
});
|
|
562
461
|
expectTypesMatch(true);
|
|
563
462
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
564
|
-
shape:
|
|
565
|
-
radius:
|
|
463
|
+
shape: z22.literal("circle"),
|
|
464
|
+
radius: distance9
|
|
566
465
|
});
|
|
567
466
|
expectTypesMatch(true);
|
|
568
|
-
var solderPasteProps =
|
|
467
|
+
var solderPasteProps = z22.union([
|
|
569
468
|
circleSolderPasteProps,
|
|
570
469
|
rectSolderPasteProps
|
|
571
470
|
]);
|
|
572
471
|
expectTypesMatch(true);
|
|
573
472
|
|
|
574
473
|
// lib/components/hole.ts
|
|
575
|
-
|
|
474
|
+
import { z as z23 } from "zod";
|
|
576
475
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
577
|
-
name:
|
|
578
|
-
diameter:
|
|
579
|
-
radius:
|
|
476
|
+
name: z23.string().optional(),
|
|
477
|
+
diameter: distance9.optional(),
|
|
478
|
+
radius: distance9.optional()
|
|
580
479
|
}).transform((d) => ({
|
|
581
480
|
...d,
|
|
582
481
|
diameter: d.diameter ?? 2 * d.radius,
|
|
@@ -585,24 +484,24 @@ var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
585
484
|
expectTypesMatch(true);
|
|
586
485
|
|
|
587
486
|
// lib/components/trace.ts
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
var portRef =
|
|
591
|
-
|
|
592
|
-
|
|
487
|
+
import { distance as distance10, route_hint_point } from "circuit-json";
|
|
488
|
+
import { z as z24 } from "zod";
|
|
489
|
+
var portRef = z24.union([
|
|
490
|
+
z24.string(),
|
|
491
|
+
z24.custom(
|
|
593
492
|
(v) => Boolean(v.getPortSelector)
|
|
594
493
|
)
|
|
595
494
|
]);
|
|
596
|
-
var baseTraceProps =
|
|
597
|
-
key:
|
|
598
|
-
thickness:
|
|
599
|
-
schematicRouteHints:
|
|
600
|
-
pcbRouteHints:
|
|
601
|
-
schDisplayLabel:
|
|
602
|
-
});
|
|
603
|
-
var traceProps =
|
|
495
|
+
var baseTraceProps = z24.object({
|
|
496
|
+
key: z24.string().optional(),
|
|
497
|
+
thickness: distance10.optional(),
|
|
498
|
+
schematicRouteHints: z24.array(point).optional(),
|
|
499
|
+
pcbRouteHints: z24.array(route_hint_point).optional(),
|
|
500
|
+
schDisplayLabel: z24.string().optional()
|
|
501
|
+
});
|
|
502
|
+
var traceProps = z24.union([
|
|
604
503
|
baseTraceProps.extend({
|
|
605
|
-
path:
|
|
504
|
+
path: z24.array(portRef)
|
|
606
505
|
}),
|
|
607
506
|
baseTraceProps.extend({
|
|
608
507
|
from: portRef,
|
|
@@ -611,16 +510,16 @@ var traceProps = import_zod24.z.union([
|
|
|
611
510
|
]);
|
|
612
511
|
|
|
613
512
|
// lib/components/footprint.ts
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
var footprintProps =
|
|
617
|
-
originalLayer:
|
|
513
|
+
import { layer_ref as layer_ref2 } from "circuit-json";
|
|
514
|
+
import { z as z25 } from "zod";
|
|
515
|
+
var footprintProps = z25.object({
|
|
516
|
+
originalLayer: layer_ref2.default("top").optional()
|
|
618
517
|
});
|
|
619
518
|
expectTypesMatch(true);
|
|
620
519
|
|
|
621
520
|
// lib/components/battery.ts
|
|
622
|
-
|
|
623
|
-
var capacity =
|
|
521
|
+
import { z as z26 } from "zod";
|
|
522
|
+
var capacity = z26.number().or(z26.string().endsWith("mAh")).transform((v) => {
|
|
624
523
|
if (typeof v === "string") {
|
|
625
524
|
const valString = v.replace("mAh", "");
|
|
626
525
|
const num = Number.parseFloat(valString);
|
|
@@ -638,35 +537,35 @@ var batteryPins = lrPolarPins;
|
|
|
638
537
|
expectTypesMatch(true);
|
|
639
538
|
|
|
640
539
|
// lib/components/pin-header.ts
|
|
641
|
-
|
|
642
|
-
|
|
540
|
+
import { distance as distance11 } from "circuit-json";
|
|
541
|
+
import { z as z27 } from "zod";
|
|
643
542
|
var pinHeaderProps = commonComponentProps.extend({
|
|
644
|
-
pinCount:
|
|
645
|
-
pitch:
|
|
646
|
-
gender:
|
|
647
|
-
showSilkscreenPinLabels:
|
|
648
|
-
doubleRow:
|
|
649
|
-
holeDiameter:
|
|
650
|
-
platedDiameter:
|
|
651
|
-
pinLabels:
|
|
652
|
-
facingDirection:
|
|
543
|
+
pinCount: z27.number(),
|
|
544
|
+
pitch: distance11.optional(),
|
|
545
|
+
gender: z27.enum(["male", "female"]).optional().default("male"),
|
|
546
|
+
showSilkscreenPinLabels: z27.boolean().optional(),
|
|
547
|
+
doubleRow: z27.boolean().optional(),
|
|
548
|
+
holeDiameter: distance11.optional(),
|
|
549
|
+
platedDiameter: distance11.optional(),
|
|
550
|
+
pinLabels: z27.array(z27.string()).optional(),
|
|
551
|
+
facingDirection: z27.enum(["left", "right"]).optional()
|
|
653
552
|
});
|
|
654
553
|
expectTypesMatch(true);
|
|
655
554
|
|
|
656
555
|
// lib/components/netalias.ts
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
var netAliasProps =
|
|
660
|
-
net:
|
|
661
|
-
schX:
|
|
662
|
-
schY:
|
|
663
|
-
schRotation:
|
|
664
|
-
anchorSide:
|
|
556
|
+
import { z as z28 } from "zod";
|
|
557
|
+
import { rotation as rotation2 } from "circuit-json";
|
|
558
|
+
var netAliasProps = z28.object({
|
|
559
|
+
net: z28.string().optional(),
|
|
560
|
+
schX: distance9.optional(),
|
|
561
|
+
schY: distance9.optional(),
|
|
562
|
+
schRotation: rotation2.optional(),
|
|
563
|
+
anchorSide: z28.enum(["left", "up", "right", "down"]).optional()
|
|
665
564
|
});
|
|
666
565
|
expectTypesMatch(true);
|
|
667
566
|
|
|
668
567
|
// lib/components/push-button.ts
|
|
669
|
-
|
|
568
|
+
import "zod";
|
|
670
569
|
var pushButtonProps = commonComponentProps.extend({});
|
|
671
570
|
|
|
672
571
|
// lib/components/subcircuit.ts
|
|
@@ -675,134 +574,133 @@ expectTypesMatch(true);
|
|
|
675
574
|
|
|
676
575
|
// lib/index.ts
|
|
677
576
|
var inductorProps = commonComponentProps.extend({
|
|
678
|
-
inductance
|
|
577
|
+
inductance
|
|
679
578
|
});
|
|
680
579
|
var inductorPins = lrPins;
|
|
681
580
|
var diodeProps = commonComponentProps.extend({});
|
|
682
581
|
var diodePins = lrPolarPins;
|
|
683
582
|
var ledProps = commonComponentProps.extend({
|
|
684
|
-
color:
|
|
583
|
+
color: z30.string().optional()
|
|
685
584
|
});
|
|
686
585
|
var ledPins = lrPolarPins;
|
|
687
586
|
var switchProps = commonComponentProps.extend({
|
|
688
|
-
ftype:
|
|
689
|
-
switchType:
|
|
690
|
-
isNormallyClosed:
|
|
587
|
+
ftype: z30.literal("switch"),
|
|
588
|
+
switchType: z30.enum(["spst"]).default("spst"),
|
|
589
|
+
isNormallyClosed: z30.boolean().default(false)
|
|
691
590
|
});
|
|
692
|
-
var distanceOrMultiplier2 =
|
|
591
|
+
var distanceOrMultiplier2 = distance12.or(z30.enum(["2x", "3x", "4x"]));
|
|
693
592
|
var viaProps = commonLayoutProps.extend({
|
|
694
|
-
fromLayer:
|
|
695
|
-
toLayer:
|
|
696
|
-
holeDiameter:
|
|
697
|
-
outerDiameter:
|
|
593
|
+
fromLayer: layer_ref3,
|
|
594
|
+
toLayer: layer_ref3,
|
|
595
|
+
holeDiameter: distance12,
|
|
596
|
+
outerDiameter: distance12
|
|
698
597
|
});
|
|
699
|
-
var pcbKeepoutProps =
|
|
598
|
+
var pcbKeepoutProps = z30.union([
|
|
700
599
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
701
|
-
shape:
|
|
702
|
-
radius:
|
|
600
|
+
shape: z30.literal("circle"),
|
|
601
|
+
radius: distance12
|
|
703
602
|
}),
|
|
704
603
|
pcbLayoutProps.extend({
|
|
705
|
-
shape:
|
|
706
|
-
width:
|
|
707
|
-
height:
|
|
604
|
+
shape: z30.literal("rect"),
|
|
605
|
+
width: distance12,
|
|
606
|
+
height: distance12
|
|
708
607
|
})
|
|
709
608
|
]);
|
|
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:
|
|
609
|
+
var schematicBoxProps = z30.object({
|
|
610
|
+
schX: distance12,
|
|
611
|
+
schY: distance12,
|
|
612
|
+
width: distance12,
|
|
613
|
+
height: distance12
|
|
614
|
+
});
|
|
615
|
+
var schematicTextProps = z30.object({
|
|
616
|
+
schX: distance12,
|
|
617
|
+
schY: distance12,
|
|
618
|
+
text: z30.string()
|
|
619
|
+
});
|
|
620
|
+
var schematicLineProps = z30.object({
|
|
621
|
+
x1: distance12,
|
|
622
|
+
y1: distance12,
|
|
623
|
+
x2: distance12,
|
|
624
|
+
y2: distance12
|
|
625
|
+
});
|
|
626
|
+
var schematicPathProps = z30.object({
|
|
627
|
+
points: z30.array(point2),
|
|
628
|
+
isFilled: z30.boolean().optional().default(false),
|
|
629
|
+
fillColor: z30.enum(["red", "blue"]).optional()
|
|
731
630
|
});
|
|
732
631
|
var componentProps = commonComponentProps;
|
|
733
632
|
var powerSourceProps = commonComponentProps.extend({
|
|
734
|
-
voltage
|
|
633
|
+
voltage
|
|
735
634
|
});
|
|
736
635
|
var portProps = commonLayoutProps.extend({
|
|
737
|
-
name:
|
|
738
|
-
pinNumber:
|
|
739
|
-
aliases:
|
|
636
|
+
name: z30.string(),
|
|
637
|
+
pinNumber: z30.number().optional(),
|
|
638
|
+
aliases: z30.array(z30.string()).optional(),
|
|
740
639
|
direction
|
|
741
640
|
});
|
|
742
641
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
743
|
-
text:
|
|
744
|
-
anchorAlignment:
|
|
745
|
-
font:
|
|
746
|
-
fontSize:
|
|
642
|
+
text: z30.string(),
|
|
643
|
+
anchorAlignment: z30.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
644
|
+
font: z30.enum(["tscircuit2024"]).optional(),
|
|
645
|
+
fontSize: length3.optional()
|
|
747
646
|
});
|
|
748
647
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
749
|
-
route:
|
|
750
|
-
strokeWidth:
|
|
648
|
+
route: z30.array(route_hint_point2),
|
|
649
|
+
strokeWidth: length3.optional()
|
|
751
650
|
});
|
|
752
651
|
var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
753
|
-
strokeWidth:
|
|
754
|
-
x1:
|
|
755
|
-
y1:
|
|
756
|
-
x2:
|
|
757
|
-
y2:
|
|
652
|
+
strokeWidth: distance12,
|
|
653
|
+
x1: distance12,
|
|
654
|
+
y1: distance12,
|
|
655
|
+
x2: distance12,
|
|
656
|
+
y2: distance12
|
|
758
657
|
});
|
|
759
658
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
760
|
-
isFilled:
|
|
761
|
-
isOutline:
|
|
762
|
-
strokeWidth:
|
|
763
|
-
width:
|
|
764
|
-
height:
|
|
659
|
+
isFilled: z30.boolean().optional(),
|
|
660
|
+
isOutline: z30.boolean().optional(),
|
|
661
|
+
strokeWidth: distance12.optional(),
|
|
662
|
+
width: distance12,
|
|
663
|
+
height: distance12
|
|
765
664
|
});
|
|
766
665
|
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:
|
|
666
|
+
isFilled: z30.boolean().optional(),
|
|
667
|
+
isOutline: z30.boolean().optional(),
|
|
668
|
+
strokeWidth: distance12.optional(),
|
|
669
|
+
radius: distance12
|
|
670
|
+
});
|
|
671
|
+
var routeHintPointProps = z30.object({
|
|
672
|
+
x: distance12,
|
|
673
|
+
y: distance12,
|
|
674
|
+
via: z30.boolean().optional(),
|
|
675
|
+
toLayer: layer_ref3.optional()
|
|
676
|
+
});
|
|
677
|
+
var traceHintProps = z30.object({
|
|
678
|
+
for: z30.string().optional().describe(
|
|
780
679
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
781
680
|
),
|
|
782
|
-
order:
|
|
783
|
-
offset:
|
|
784
|
-
offsets:
|
|
785
|
-
traceWidth:
|
|
681
|
+
order: z30.number().optional(),
|
|
682
|
+
offset: route_hint_point2.or(routeHintPointProps).optional(),
|
|
683
|
+
offsets: z30.array(route_hint_point2).or(z30.array(routeHintPointProps)).optional(),
|
|
684
|
+
traceWidth: z30.number().optional()
|
|
786
685
|
});
|
|
787
|
-
var pcbTraceProps =
|
|
788
|
-
layer:
|
|
789
|
-
thickness:
|
|
790
|
-
route:
|
|
686
|
+
var pcbTraceProps = z30.object({
|
|
687
|
+
layer: z30.string().optional(),
|
|
688
|
+
thickness: distance12.optional(),
|
|
689
|
+
route: z30.array(route_hint_point2)
|
|
791
690
|
});
|
|
792
691
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
793
|
-
text:
|
|
794
|
-
anchorAlignment:
|
|
795
|
-
font:
|
|
796
|
-
fontSize:
|
|
797
|
-
color:
|
|
692
|
+
text: z30.string(),
|
|
693
|
+
anchorAlignment: z30.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
694
|
+
font: z30.enum(["tscircuit2024"]).optional(),
|
|
695
|
+
fontSize: length3.optional(),
|
|
696
|
+
color: z30.string().optional()
|
|
798
697
|
});
|
|
799
698
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
800
|
-
route:
|
|
801
|
-
strokeWidth:
|
|
802
|
-
color:
|
|
699
|
+
route: z30.array(route_hint_point2),
|
|
700
|
+
strokeWidth: length3.optional(),
|
|
701
|
+
color: z30.string().optional()
|
|
803
702
|
});
|
|
804
|
-
|
|
805
|
-
0 && (module.exports = {
|
|
703
|
+
export {
|
|
806
704
|
autorouterConfig,
|
|
807
705
|
autorouterProp,
|
|
808
706
|
baseGroupProps,
|
|
@@ -831,7 +729,7 @@ var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcb
|
|
|
831
729
|
diodeProps,
|
|
832
730
|
direction,
|
|
833
731
|
directionAlongEdge,
|
|
834
|
-
distanceOrMultiplier,
|
|
732
|
+
distanceOrMultiplier2 as distanceOrMultiplier,
|
|
835
733
|
explicitPinSideDefinition,
|
|
836
734
|
fabricationNotePathProps,
|
|
837
735
|
fabricationNoteTextProps,
|
|
@@ -894,5 +792,5 @@ var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcb
|
|
|
894
792
|
traceHintProps,
|
|
895
793
|
traceProps,
|
|
896
794
|
viaProps
|
|
897
|
-
}
|
|
795
|
+
};
|
|
898
796
|
//# sourceMappingURL=index.js.map
|