@tscircuit/props 0.0.6 → 0.0.8
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 +15 -15
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { ReactElement } from 'react';
|
|
3
3
|
import { LayoutBuilder } from '@tscircuit/layout';
|
|
4
4
|
|
|
5
|
+
declare const portHints: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
|
|
5
6
|
declare const direction: z.ZodEnum<["up", "down", "left", "right"]>;
|
|
6
7
|
declare const relativeDirection: z.ZodEnum<["top-to-bottom", "left-to-right", "bottom-to-top", "right-to-left"]>;
|
|
7
8
|
declare const explicitPinSideDefinition: z.ZodObject<{
|
|
@@ -895,14 +896,14 @@ declare const smtPadProps: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<Omit
|
|
|
895
896
|
}, "pcbRotation">, {
|
|
896
897
|
shape: z.ZodLiteral<"circle">;
|
|
897
898
|
radius: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
898
|
-
portHints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
899
|
+
portHints: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
899
900
|
}>, "strip", z.ZodTypeAny, {
|
|
900
901
|
pcbX: number;
|
|
901
902
|
pcbY: number;
|
|
902
903
|
shape: "circle";
|
|
903
904
|
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
904
905
|
radius?: number | undefined;
|
|
905
|
-
portHints?: string[] | undefined;
|
|
906
|
+
portHints?: (string | number)[] | undefined;
|
|
906
907
|
}, {
|
|
907
908
|
pcbX: string | number;
|
|
908
909
|
pcbY: string | number;
|
|
@@ -911,7 +912,7 @@ declare const smtPadProps: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<Omit
|
|
|
911
912
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
912
913
|
} | undefined;
|
|
913
914
|
radius?: string | number | undefined;
|
|
914
|
-
portHints?: string[] | undefined;
|
|
915
|
+
portHints?: (string | number)[] | undefined;
|
|
915
916
|
}>, z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
916
917
|
pcbX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
917
918
|
pcbY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
@@ -929,7 +930,7 @@ declare const smtPadProps: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<Omit
|
|
|
929
930
|
shape: z.ZodLiteral<"rect">;
|
|
930
931
|
width: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
931
932
|
height: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
932
|
-
portHints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
933
|
+
portHints: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
933
934
|
}>, "strip", z.ZodTypeAny, {
|
|
934
935
|
pcbX: number;
|
|
935
936
|
pcbY: number;
|
|
@@ -937,7 +938,7 @@ declare const smtPadProps: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<Omit
|
|
|
937
938
|
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
938
939
|
width?: number | undefined;
|
|
939
940
|
height?: number | undefined;
|
|
940
|
-
portHints?: string[] | undefined;
|
|
941
|
+
portHints?: (string | number)[] | undefined;
|
|
941
942
|
}, {
|
|
942
943
|
pcbX: string | number;
|
|
943
944
|
pcbY: string | number;
|
|
@@ -947,7 +948,7 @@ declare const smtPadProps: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<Omit
|
|
|
947
948
|
} | undefined;
|
|
948
949
|
width?: string | number | undefined;
|
|
949
950
|
height?: string | number | undefined;
|
|
950
|
-
portHints?: string[] | undefined;
|
|
951
|
+
portHints?: (string | number)[] | undefined;
|
|
951
952
|
}>]>;
|
|
952
953
|
type SmtPadProps = z.input<typeof smtPadProps>;
|
|
953
954
|
declare const platedHoleProps: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
@@ -966,16 +967,19 @@ declare const platedHoleProps: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
966
967
|
}, "pcbRotation" | "layer">, {
|
|
967
968
|
holeDiameter: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
968
969
|
outerDiameter: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
970
|
+
portHints: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
969
971
|
}>, "strip", z.ZodTypeAny, {
|
|
970
972
|
pcbX: number;
|
|
971
973
|
pcbY: number;
|
|
972
974
|
holeDiameter: number;
|
|
973
975
|
outerDiameter: number;
|
|
976
|
+
portHints?: (string | number)[] | undefined;
|
|
974
977
|
}, {
|
|
975
978
|
pcbX: string | number;
|
|
976
979
|
pcbY: string | number;
|
|
977
980
|
holeDiameter: string | number;
|
|
978
981
|
outerDiameter: string | number;
|
|
982
|
+
portHints?: (string | number)[] | undefined;
|
|
979
983
|
}>;
|
|
980
984
|
type PlatedHoleProps = z.input<typeof platedHoleProps>;
|
|
981
985
|
declare const holeProps: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
@@ -1090,14 +1094,14 @@ declare const constraintProps: z.ZodUnion<[z.ZodObject<{
|
|
|
1090
1094
|
left: z.ZodString;
|
|
1091
1095
|
right: z.ZodString;
|
|
1092
1096
|
}, "strip", z.ZodTypeAny, {
|
|
1097
|
+
type: "xdist";
|
|
1093
1098
|
left: string;
|
|
1094
1099
|
right: string;
|
|
1095
|
-
type: "xdist";
|
|
1096
1100
|
dist: number;
|
|
1097
1101
|
}, {
|
|
1102
|
+
type: "xdist";
|
|
1098
1103
|
left: string;
|
|
1099
1104
|
right: string;
|
|
1100
|
-
type: "xdist";
|
|
1101
1105
|
dist: string | number;
|
|
1102
1106
|
}>, z.ZodObject<{
|
|
1103
1107
|
type: z.ZodLiteral<"ydist">;
|
|
@@ -1433,7 +1437,7 @@ declare const silkscreenPathProps: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1433
1437
|
} | undefined;
|
|
1434
1438
|
}>;
|
|
1435
1439
|
type SilkscreenPathProps = z.input<typeof silkscreenPathProps>;
|
|
1436
|
-
declare const silkscreenLineProps: z.ZodObject<z.objectUtil.extendShape<{
|
|
1440
|
+
declare const silkscreenLineProps: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
1437
1441
|
pcbX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
1438
1442
|
pcbY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
1439
1443
|
pcbRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
@@ -1446,15 +1450,13 @@ declare const silkscreenLineProps: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1446
1450
|
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
1447
1451
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
1448
1452
|
}>>;
|
|
1449
|
-
}, {
|
|
1453
|
+
}, "pcbX" | "pcbY">, {
|
|
1450
1454
|
strokeWidth: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
1451
1455
|
x1: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
1452
1456
|
y1: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
1453
1457
|
x2: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
1454
1458
|
y2: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
1455
1459
|
}>, "strip", z.ZodTypeAny, {
|
|
1456
|
-
pcbX: number;
|
|
1457
|
-
pcbY: number;
|
|
1458
1460
|
x1: number;
|
|
1459
1461
|
y1: number;
|
|
1460
1462
|
x2: number;
|
|
@@ -1463,8 +1465,6 @@ declare const silkscreenLineProps: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1463
1465
|
pcbRotation?: number | undefined;
|
|
1464
1466
|
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
1465
1467
|
}, {
|
|
1466
|
-
pcbX: string | number;
|
|
1467
|
-
pcbY: string | number;
|
|
1468
1468
|
x1: string | number;
|
|
1469
1469
|
y1: string | number;
|
|
1470
1470
|
x2: string | number;
|
|
@@ -1702,4 +1702,4 @@ declare const pcbTraceProps: z.ZodObject<{
|
|
|
1702
1702
|
}>;
|
|
1703
1703
|
type PcbTraceProps = z.input<typeof pcbTraceProps>;
|
|
1704
1704
|
|
|
1705
|
-
export { type BoardProps, type BugProps, type CapacitorProps, type CommonComponentProps, type CommonLayoutProps, type ComponentProps, type ConstrainedLayoutProps, type ConstraintProps, type DiodeProps, type Footprint, type FootprintProps, type GroupProps, type HoleProps, type InductorProps, type LedProps, type NetAliasProps, type PcbTraceProps, type PlatedHoleProps, type PortProps, type PowerSourceProps, type ResistorProps, type SchematicBoxProps, type SchematicLineProps, type SchematicPathProps, type SchematicTextProps, type SilkscreenCircleProps, type SilkscreenLineProps, type SilkscreenPathProps, type SilkscreenRectProps, type SilkscreenTextProps, type SmtPadProps, type SupplierProps, type TraceHintProps, type TraceProps, type ViaProps, boardProps, bugProps, capacitorPins, capacitorProps, commonComponentProps, commonLayoutProps, componentProps, constrainedLayoutProps, constraintProps, diodePins, diodeProps, direction, explicitPinSideDefinition, footprintProps, groupProps, holeProps, inductorPins, inductorProps, ledPins, ledProps, lrPins, lrPolarPins, netAliasProps, pcbLayoutProps, pcbTraceProps, platedHoleProps, portProps, powerSourceProps, relativeDirection, resistorPins, resistorProps, schematicBoxProps, schematicLineProps, schematicPathProps, schematicTextProps, silkscreenCircleProps, silkscreenLineProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, supplierProps, traceHintProps, traceProps, viaProps };
|
|
1705
|
+
export { type BoardProps, type BugProps, type CapacitorProps, type CommonComponentProps, type CommonLayoutProps, type ComponentProps, type ConstrainedLayoutProps, type ConstraintProps, type DiodeProps, type Footprint, type FootprintProps, type GroupProps, type HoleProps, type InductorProps, type LedProps, type NetAliasProps, type PcbTraceProps, type PlatedHoleProps, type PortProps, type PowerSourceProps, type ResistorProps, type SchematicBoxProps, type SchematicLineProps, type SchematicPathProps, type SchematicTextProps, type SilkscreenCircleProps, type SilkscreenLineProps, type SilkscreenPathProps, type SilkscreenRectProps, type SilkscreenTextProps, type SmtPadProps, type SupplierProps, type TraceHintProps, type TraceProps, type ViaProps, boardProps, bugProps, capacitorPins, capacitorProps, commonComponentProps, commonLayoutProps, componentProps, constrainedLayoutProps, constraintProps, diodePins, diodeProps, direction, explicitPinSideDefinition, footprintProps, groupProps, holeProps, inductorPins, inductorProps, ledPins, ledProps, lrPins, lrPolarPins, netAliasProps, pcbLayoutProps, pcbTraceProps, platedHoleProps, portHints, portProps, powerSourceProps, relativeDirection, resistorPins, resistorProps, schematicBoxProps, schematicLineProps, schematicPathProps, schematicTextProps, silkscreenCircleProps, silkscreenLineProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, supplierProps, traceHintProps, traceProps, viaProps };
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ __export(lib_exports, {
|
|
|
46
46
|
pcbLayoutProps: () => pcbLayoutProps,
|
|
47
47
|
pcbTraceProps: () => pcbTraceProps,
|
|
48
48
|
platedHoleProps: () => platedHoleProps,
|
|
49
|
+
portHints: () => portHints,
|
|
49
50
|
portProps: () => portProps,
|
|
50
51
|
powerSourceProps: () => powerSourceProps,
|
|
51
52
|
relativeDirection: () => relativeDirection,
|
|
@@ -69,6 +70,7 @@ __export(lib_exports, {
|
|
|
69
70
|
module.exports = __toCommonJS(lib_exports);
|
|
70
71
|
var import_zod = require("zod");
|
|
71
72
|
var import_soup = require("@tscircuit/soup");
|
|
73
|
+
var portHints = import_zod.z.array(import_zod.z.string().or(import_zod.z.number()));
|
|
72
74
|
var direction = import_zod.z.enum(["up", "down", "left", "right"]);
|
|
73
75
|
var relativeDirection = import_zod.z.enum([
|
|
74
76
|
"top-to-bottom",
|
|
@@ -190,18 +192,19 @@ var smtPadProps = import_zod.z.union([
|
|
|
190
192
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
191
193
|
shape: import_zod.z.literal("circle"),
|
|
192
194
|
radius: import_soup.distance.optional(),
|
|
193
|
-
portHints:
|
|
195
|
+
portHints: portHints.optional()
|
|
194
196
|
}),
|
|
195
197
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
196
198
|
shape: import_zod.z.literal("rect"),
|
|
197
199
|
width: import_soup.distance.optional(),
|
|
198
200
|
height: import_soup.distance.optional(),
|
|
199
|
-
portHints:
|
|
201
|
+
portHints: portHints.optional()
|
|
200
202
|
})
|
|
201
203
|
]);
|
|
202
204
|
var platedHoleProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
203
205
|
holeDiameter: import_soup.distance,
|
|
204
|
-
outerDiameter: import_soup.distance
|
|
206
|
+
outerDiameter: import_soup.distance,
|
|
207
|
+
portHints: portHints.optional()
|
|
205
208
|
});
|
|
206
209
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
207
210
|
holeDiameter: import_soup.distance
|
|
@@ -268,7 +271,7 @@ var silkscreenTextProps = pcbLayoutProps.extend({
|
|
|
268
271
|
var silkscreenPathProps = pcbLayoutProps.extend({
|
|
269
272
|
route: import_zod.z.array(import_soup.route_hint_point)
|
|
270
273
|
});
|
|
271
|
-
var silkscreenLineProps = pcbLayoutProps.extend({
|
|
274
|
+
var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true }).extend({
|
|
272
275
|
strokeWidth: import_soup.distance,
|
|
273
276
|
x1: import_soup.distance,
|
|
274
277
|
y1: import_soup.distance,
|
|
@@ -327,6 +330,7 @@ var pcbTraceProps = import_zod.z.object({
|
|
|
327
330
|
pcbLayoutProps,
|
|
328
331
|
pcbTraceProps,
|
|
329
332
|
platedHoleProps,
|
|
333
|
+
portHints,
|
|
330
334
|
portProps,
|
|
331
335
|
powerSourceProps,
|
|
332
336
|
relativeDirection,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/index.ts"],"sourcesContent":["import { z } from \"zod\"\nimport {\n distance,\n rotation,\n layer_ref,\n supplier_name,\n resistance,\n capacitance,\n inductance,\n point,\n voltage,\n route_hint_point,\n} from \"@tscircuit/soup\"\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { LayoutBuilder } from \"@tscircuit/layout\"\n\nexport const direction = z.enum([\"up\", \"down\", \"left\", \"right\"])\n\nexport const relativeDirection = z.enum([\n \"top-to-bottom\",\n \"left-to-right\",\n \"bottom-to-top\",\n \"right-to-left\",\n])\n\nexport const explicitPinSideDefinition = z.object({\n pins: z.array(z.number()),\n direction: z.union([\n z.literal(\"top-to-bottom\"),\n z.literal(\"left-to-right\"),\n z.literal(\"bottom-to-top\"),\n z.literal(\"right-to-left\"),\n ]),\n})\n\nexport type Footprint = string | ReactElement\nexport const pcbLayoutProps = z.object({\n pcbX: distance,\n pcbY: distance,\n pcbRotation: rotation.optional(),\n layer: layer_ref.optional(),\n})\nexport const commonLayoutProps = z.object({\n pcbX: distance.optional(),\n pcbY: distance.optional(),\n pcbRotation: rotation.optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n layer: layer_ref.optional(),\n\n // TODO pull in literals from @tscircuit/footprint\n // TODO footprint can be a string or react child\n footprint: z.custom<Footprint>((v) => true).optional(),\n})\nexport type CommonLayoutProps = z.input<typeof commonLayoutProps>\n\nexport const supplierProps = z.object({\n supplierPartNumbers: z.record(supplier_name, z.array(z.string())).optional(),\n})\nexport type SupplierProps = z.input<typeof supplierProps>\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n name: z.string(),\n children: z.any().optional(),\n })\nexport type CommonComponentProps = z.input<typeof commonComponentProps>\n\nexport const lrPins = [\"pin1\", \"left\", \"pin2\", \"right\"] as const\nexport const lrPolarPins = [\n \"pin1\",\n \"left\",\n \"anode\",\n \"pos\",\n \"pin2\",\n \"right\",\n \"cathode\",\n \"neg\",\n] as const\n\nexport const resistorProps = commonComponentProps.extend({\n resistance,\n})\nexport const resistorPins = lrPins\nexport type ResistorProps = z.input<typeof resistorProps>\n\nexport const capacitorProps = commonComponentProps.extend({\n capacitance,\n})\nexport const capacitorPins = lrPolarPins\nexport type CapacitorProps = z.input<typeof capacitorProps>\n\nexport const inductorProps = commonComponentProps.extend({\n inductance,\n})\nexport const inductorPins = lrPins\nexport type InductorProps = z.input<typeof inductorProps>\n\nexport const diodeProps = commonComponentProps.extend({})\nexport const diodePins = lrPolarPins\nexport type DiodeProps = z.input<typeof diodeProps>\n\nexport const ledProps = commonComponentProps.extend({\n color: z.string().optional(),\n})\nexport const ledPins = lrPolarPins\nexport type LedProps = z.input<typeof ledProps>\n\nexport const boardProps = z.object({\n width: distance,\n height: distance,\n pcbCenterX: distance.optional().default(0),\n pcbCenterY: distance.optional().default(0),\n layout: z.any().optional(),\n children: z.any(),\n})\nexport type BoardProps = z.input<typeof boardProps>\n\nexport const bugProps = commonComponentProps.extend({\n pinLabels: z.record(z.number(), z.string()),\n schPortArrangement: z\n .object({\n leftSize: z.number().optional(),\n topSize: z.number().optional(),\n rightSize: z.number().optional(),\n bottomSize: z.number().optional(),\n })\n .or(\n z.object({\n leftSide: explicitPinSideDefinition.optional(),\n rightSide: explicitPinSideDefinition.optional(),\n topSide: explicitPinSideDefinition.optional(),\n bottomSide: explicitPinSideDefinition.optional(),\n })\n ),\n})\nexport type BugProps = z.input<typeof bugProps>\n\nexport const viaProps = commonLayoutProps.extend({\n fromLayer: layer_ref,\n toLayer: layer_ref,\n holeDiameter: distance,\n outerDiameter: distance,\n})\nexport type ViaProps = z.input<typeof viaProps>\n\nexport const netAliasProps = commonLayoutProps.extend({\n net: z.string().optional(),\n})\nexport type NetAliasProps = z.input<typeof netAliasProps>\n\nexport const traceProps = z\n .object({\n path: z.array(z.string()),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n })\n .or(\n z.object({\n from: z.string(),\n to: z.string(),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n })\n )\nexport type TraceProps = z.input<typeof traceProps>\n\nexport const smtPadProps = z.union([\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"circle\"),\n radius: distance.optional(),\n portHints: z.array(z.string()).optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"rect\"),\n width: distance.optional(),\n height: distance.optional(),\n portHints: z.array(z.string()).optional(),\n }),\n])\nexport type SmtPadProps = z.input<typeof smtPadProps>\n\nexport const platedHoleProps = pcbLayoutProps\n .omit({ pcbRotation: true, layer: true })\n .extend({\n holeDiameter: distance,\n outerDiameter: distance,\n })\nexport type PlatedHoleProps = z.input<typeof platedHoleProps>\n\nexport const holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({\n holeDiameter: distance,\n})\nexport type HoleProps = z.input<typeof holeProps>\n\nexport const schematicBoxProps = z.object({\n schX: distance,\n schY: distance,\n width: distance,\n height: distance,\n})\nexport type SchematicBoxProps = z.input<typeof schematicBoxProps>\n\nexport const schematicTextProps = z.object({\n schX: distance,\n schY: distance,\n text: z.string(),\n})\nexport type SchematicTextProps = z.input<typeof schematicTextProps>\n\nexport const schematicLineProps = z.object({\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n})\nexport type SchematicLineProps = z.input<typeof schematicLineProps>\n\nexport const schematicPathProps = z.object({\n points: z.array(point),\n isFilled: z.boolean().optional().default(false),\n fillColor: z.enum([\"red\", \"blue\"]).optional(),\n})\nexport type SchematicPathProps = z.input<typeof schematicPathProps>\n\nexport const constraintProps = z.union([\n z.object({\n type: z.literal(\"xdist\"),\n dist: distance,\n left: z.string(),\n right: z.string(),\n }),\n z.object({\n type: z.literal(\"ydist\"),\n dist: distance,\n top: z.string(),\n bottom: z.string(),\n }),\n])\nexport type ConstraintProps = z.input<typeof constraintProps>\n\nexport const constrainedLayoutProps = z.object({})\nexport type ConstrainedLayoutProps = z.input<typeof constrainedLayoutProps>\n\nexport const footprintProps = z.object({})\nexport type FootprintProps = z.input<typeof footprintProps>\n\nexport const componentProps = commonComponentProps\nexport type ComponentProps = z.input<typeof componentProps>\n\nexport const groupProps = commonLayoutProps.extend({\n name: z.string().optional(),\n layout: z.custom<LayoutBuilder>((v) => true).optional(),\n children: z.any().optional(),\n})\nexport type GroupProps = z.input<typeof groupProps>\n\nexport const powerSourceProps = commonComponentProps.extend({\n voltage,\n})\nexport type PowerSourceProps = z.input<typeof powerSourceProps>\n\nexport const portProps = commonLayoutProps.extend({\n name: z.string(),\n pinNumber: z.number().optional(),\n aliases: z.array(z.string()).optional(),\n direction: direction,\n})\nexport type PortProps = z.input<typeof portProps>\n\nexport const silkscreenTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: distance.optional(),\n})\nexport type SilkscreenTextProps = z.input<typeof silkscreenTextProps>\n\nexport const silkscreenPathProps = pcbLayoutProps.extend({\n route: z.array(route_hint_point),\n})\nexport type SilkscreenPathProps = z.input<typeof silkscreenPathProps>\n\nexport const silkscreenLineProps = pcbLayoutProps.extend({\n strokeWidth: distance,\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n})\nexport type SilkscreenLineProps = z.input<typeof silkscreenLineProps>\n\nexport const silkscreenRectProps = pcbLayoutProps.extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n width: distance,\n height: distance,\n})\nexport type SilkscreenRectProps = z.input<typeof silkscreenRectProps>\n\nexport const silkscreenCircleProps = pcbLayoutProps.extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n radius: distance,\n})\nexport type SilkscreenCircleProps = z.input<typeof silkscreenCircleProps>\n\nexport const traceHintProps = z.object({\n for: z.string(),\n order: z.number().optional(),\n offset: route_hint_point.optional(),\n offsets: z.array(route_hint_point).optional(),\n})\n\nexport type TraceHintProps = z.input<typeof traceHintProps>\n\nexport const pcbTraceProps = z.object({\n layer: z.string().optional(),\n thickness: distance.optional(),\n route: z.array(route_hint_point),\n})\nexport type PcbTraceProps = z.input<typeof pcbTraceProps>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AAO;AAAA,EACP,QAAQ;AACV,CAAC;AAGM,IAAM,wBAAwB,eAAe,OAAO;AAAA,EACzD,UAAU,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC/B,WAAW,aAAE,QAAQ,EAAE,SAAS;AAAA,EAChC,aAAa,qBAAS,SAAS;AAAA,EAC/B,QAAQ;AACV,CAAC;AAGM,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,KAAK,aAAE,OAAO;AAAA,EACd,OAAO,aAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,QAAQ,6BAAiB,SAAS;AAAA,EAClC,SAAS,aAAE,MAAM,4BAAgB,EAAE,SAAS;AAC9C,CAAC;AAIM,IAAM,gBAAgB,aAAE,OAAO;AAAA,EACpC,OAAO,aAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,WAAW,qBAAS,SAAS;AAAA,EAC7B,OAAO,aAAE,MAAM,4BAAgB;AACjC,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../lib/index.ts"],"sourcesContent":["import { z } from \"zod\"\nimport {\n distance,\n rotation,\n layer_ref,\n supplier_name,\n resistance,\n capacitance,\n inductance,\n point,\n voltage,\n route_hint_point,\n} from \"@tscircuit/soup\"\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { LayoutBuilder } from \"@tscircuit/layout\"\n\nexport const portHints = z.array(z.string().or(z.number()))\n\nexport const direction = z.enum([\"up\", \"down\", \"left\", \"right\"])\n\nexport const relativeDirection = z.enum([\n \"top-to-bottom\",\n \"left-to-right\",\n \"bottom-to-top\",\n \"right-to-left\",\n])\n\nexport const explicitPinSideDefinition = z.object({\n pins: z.array(z.number()),\n direction: z.union([\n z.literal(\"top-to-bottom\"),\n z.literal(\"left-to-right\"),\n z.literal(\"bottom-to-top\"),\n z.literal(\"right-to-left\"),\n ]),\n})\n\nexport type Footprint = string | ReactElement\nexport const pcbLayoutProps = z.object({\n pcbX: distance,\n pcbY: distance,\n pcbRotation: rotation.optional(),\n layer: layer_ref.optional(),\n})\nexport const commonLayoutProps = z.object({\n pcbX: distance.optional(),\n pcbY: distance.optional(),\n pcbRotation: rotation.optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n layer: layer_ref.optional(),\n\n // TODO pull in literals from @tscircuit/footprint\n // TODO footprint can be a string or react child\n footprint: z.custom<Footprint>((v) => true).optional(),\n})\nexport type CommonLayoutProps = z.input<typeof commonLayoutProps>\n\nexport const supplierProps = z.object({\n supplierPartNumbers: z.record(supplier_name, z.array(z.string())).optional(),\n})\nexport type SupplierProps = z.input<typeof supplierProps>\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n name: z.string(),\n children: z.any().optional(),\n })\nexport type CommonComponentProps = z.input<typeof commonComponentProps>\n\nexport const lrPins = [\"pin1\", \"left\", \"pin2\", \"right\"] as const\nexport const lrPolarPins = [\n \"pin1\",\n \"left\",\n \"anode\",\n \"pos\",\n \"pin2\",\n \"right\",\n \"cathode\",\n \"neg\",\n] as const\n\nexport const resistorProps = commonComponentProps.extend({\n resistance,\n})\nexport const resistorPins = lrPins\nexport type ResistorProps = z.input<typeof resistorProps>\n\nexport const capacitorProps = commonComponentProps.extend({\n capacitance,\n})\nexport const capacitorPins = lrPolarPins\nexport type CapacitorProps = z.input<typeof capacitorProps>\n\nexport const inductorProps = commonComponentProps.extend({\n inductance,\n})\nexport const inductorPins = lrPins\nexport type InductorProps = z.input<typeof inductorProps>\n\nexport const diodeProps = commonComponentProps.extend({})\nexport const diodePins = lrPolarPins\nexport type DiodeProps = z.input<typeof diodeProps>\n\nexport const ledProps = commonComponentProps.extend({\n color: z.string().optional(),\n})\nexport const ledPins = lrPolarPins\nexport type LedProps = z.input<typeof ledProps>\n\nexport const boardProps = z.object({\n width: distance,\n height: distance,\n pcbCenterX: distance.optional().default(0),\n pcbCenterY: distance.optional().default(0),\n layout: z.any().optional(),\n children: z.any(),\n})\nexport type BoardProps = z.input<typeof boardProps>\n\nexport const bugProps = commonComponentProps.extend({\n pinLabels: z.record(z.number(), z.string()),\n schPortArrangement: z\n .object({\n leftSize: z.number().optional(),\n topSize: z.number().optional(),\n rightSize: z.number().optional(),\n bottomSize: z.number().optional(),\n })\n .or(\n z.object({\n leftSide: explicitPinSideDefinition.optional(),\n rightSide: explicitPinSideDefinition.optional(),\n topSide: explicitPinSideDefinition.optional(),\n bottomSide: explicitPinSideDefinition.optional(),\n })\n ),\n})\nexport type BugProps = z.input<typeof bugProps>\n\nexport const viaProps = commonLayoutProps.extend({\n fromLayer: layer_ref,\n toLayer: layer_ref,\n holeDiameter: distance,\n outerDiameter: distance,\n})\nexport type ViaProps = z.input<typeof viaProps>\n\nexport const netAliasProps = commonLayoutProps.extend({\n net: z.string().optional(),\n})\nexport type NetAliasProps = z.input<typeof netAliasProps>\n\nexport const traceProps = z\n .object({\n path: z.array(z.string()),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n })\n .or(\n z.object({\n from: z.string(),\n to: z.string(),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n })\n )\nexport type TraceProps = z.input<typeof traceProps>\n\nexport const smtPadProps = z.union([\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"circle\"),\n radius: distance.optional(),\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"rect\"),\n width: distance.optional(),\n height: distance.optional(),\n portHints: portHints.optional(),\n }),\n])\nexport type SmtPadProps = z.input<typeof smtPadProps>\n\nexport const platedHoleProps = pcbLayoutProps\n .omit({ pcbRotation: true, layer: true })\n .extend({\n holeDiameter: distance,\n outerDiameter: distance,\n portHints: portHints.optional(),\n })\nexport type PlatedHoleProps = z.input<typeof platedHoleProps>\n\nexport const holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({\n holeDiameter: distance,\n})\nexport type HoleProps = z.input<typeof holeProps>\n\nexport const schematicBoxProps = z.object({\n schX: distance,\n schY: distance,\n width: distance,\n height: distance,\n})\nexport type SchematicBoxProps = z.input<typeof schematicBoxProps>\n\nexport const schematicTextProps = z.object({\n schX: distance,\n schY: distance,\n text: z.string(),\n})\nexport type SchematicTextProps = z.input<typeof schematicTextProps>\n\nexport const schematicLineProps = z.object({\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n})\nexport type SchematicLineProps = z.input<typeof schematicLineProps>\n\nexport const schematicPathProps = z.object({\n points: z.array(point),\n isFilled: z.boolean().optional().default(false),\n fillColor: z.enum([\"red\", \"blue\"]).optional(),\n})\nexport type SchematicPathProps = z.input<typeof schematicPathProps>\n\nexport const constraintProps = z.union([\n z.object({\n type: z.literal(\"xdist\"),\n dist: distance,\n left: z.string(),\n right: z.string(),\n }),\n z.object({\n type: z.literal(\"ydist\"),\n dist: distance,\n top: z.string(),\n bottom: z.string(),\n }),\n])\nexport type ConstraintProps = z.input<typeof constraintProps>\n\nexport const constrainedLayoutProps = z.object({})\nexport type ConstrainedLayoutProps = z.input<typeof constrainedLayoutProps>\n\nexport const footprintProps = z.object({})\nexport type FootprintProps = z.input<typeof footprintProps>\n\nexport const componentProps = commonComponentProps\nexport type ComponentProps = z.input<typeof componentProps>\n\nexport const groupProps = commonLayoutProps.extend({\n name: z.string().optional(),\n layout: z.custom<LayoutBuilder>((v) => true).optional(),\n children: z.any().optional(),\n})\nexport type GroupProps = z.input<typeof groupProps>\n\nexport const powerSourceProps = commonComponentProps.extend({\n voltage,\n})\nexport type PowerSourceProps = z.input<typeof powerSourceProps>\n\nexport const portProps = commonLayoutProps.extend({\n name: z.string(),\n pinNumber: z.number().optional(),\n aliases: z.array(z.string()).optional(),\n direction: direction,\n})\nexport type PortProps = z.input<typeof portProps>\n\nexport const silkscreenTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: distance.optional(),\n})\nexport type SilkscreenTextProps = z.input<typeof silkscreenTextProps>\n\nexport const silkscreenPathProps = pcbLayoutProps.extend({\n route: z.array(route_hint_point),\n})\nexport type SilkscreenPathProps = z.input<typeof silkscreenPathProps>\n\nexport const silkscreenLineProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true })\n .extend({\n strokeWidth: distance,\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n })\nexport type SilkscreenLineProps = z.input<typeof silkscreenLineProps>\n\nexport const silkscreenRectProps = pcbLayoutProps.extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n width: distance,\n height: distance,\n})\nexport type SilkscreenRectProps = z.input<typeof silkscreenRectProps>\n\nexport const silkscreenCircleProps = pcbLayoutProps.extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n radius: distance,\n})\nexport type SilkscreenCircleProps = z.input<typeof silkscreenCircleProps>\n\nexport const traceHintProps = z.object({\n for: z.string(),\n order: z.number().optional(),\n offset: route_hint_point.optional(),\n offsets: z.array(route_hint_point).optional(),\n})\n\nexport type TraceHintProps = z.input<typeof traceHintProps>\n\nexport const pcbTraceProps = z.object({\n layer: z.string().optional(),\n thickness: distance.optional(),\n route: z.array(route_hint_point),\n})\nexport type PcbTraceProps = z.input<typeof pcbTraceProps>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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