@tscircuit/props 0.0.48 → 0.0.50
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 +261 -58
- package/dist/index.js +81 -74
- package/dist/index.js.map +1 -1
- package/lib/common/schematicPinDefinitions.ts +47 -0
- package/lib/components/group.ts +21 -0
- package/lib/components/jumper.ts +8 -0
- package/lib/index.ts +1 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LayoutBuilder } from '@tscircuit/layout';
|
|
2
1
|
import { z } from 'zod';
|
|
3
2
|
import { LayerRef, LayerRefInput } from '@tscircuit/soup';
|
|
4
3
|
import { ReactElement } from 'react';
|
|
4
|
+
import { LayoutBuilder } from '@tscircuit/layout';
|
|
5
5
|
|
|
6
6
|
declare const direction: z.ZodEnum<["up", "down", "left", "right"]>;
|
|
7
7
|
type Direction = "up" | "down" | "left" | "right";
|
|
@@ -560,6 +560,35 @@ declare const point3: z.ZodObject<{
|
|
|
560
560
|
z: string | number;
|
|
561
561
|
}>;
|
|
562
562
|
|
|
563
|
+
/**
|
|
564
|
+
* @deprecated Use SchematicPortArrangementWithPinCounts instead.
|
|
565
|
+
*/
|
|
566
|
+
interface SchematicPortArrangementWithSizes {
|
|
567
|
+
leftSize?: number;
|
|
568
|
+
topSize?: number;
|
|
569
|
+
rightSize?: number;
|
|
570
|
+
bottomSize?: number;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Specifies the number of pins on each side of the schematic box component.
|
|
574
|
+
*/
|
|
575
|
+
interface SchematicPortArrangementWithPinCounts {
|
|
576
|
+
leftPinCount?: number;
|
|
577
|
+
topPinCount?: number;
|
|
578
|
+
rightPinCount?: number;
|
|
579
|
+
bottomPinCount?: number;
|
|
580
|
+
}
|
|
581
|
+
interface PinSideDefinition {
|
|
582
|
+
pins: number[];
|
|
583
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
584
|
+
}
|
|
585
|
+
interface SchematicPortArrangementWithSides {
|
|
586
|
+
leftSide?: PinSideDefinition;
|
|
587
|
+
topSide?: PinSideDefinition;
|
|
588
|
+
rightSide?: PinSideDefinition;
|
|
589
|
+
bottomSide?: PinSideDefinition;
|
|
590
|
+
}
|
|
591
|
+
type SchematicPortArrangement = SchematicPortArrangementWithSizes | SchematicPortArrangementWithSides | SchematicPortArrangementWithPinCounts;
|
|
563
592
|
declare const explicitPinSideDefinition: z.ZodObject<{
|
|
564
593
|
pins: z.ZodArray<z.ZodNumber, "many">;
|
|
565
594
|
direction: z.ZodUnion<[z.ZodLiteral<"top-to-bottom">, z.ZodLiteral<"left-to-right">, z.ZodLiteral<"bottom-to-top">, z.ZodLiteral<"right-to-left">]>;
|
|
@@ -716,24 +745,24 @@ declare const boardProps: z.ZodObject<{
|
|
|
716
745
|
children?: any;
|
|
717
746
|
width?: number | undefined;
|
|
718
747
|
height?: number | undefined;
|
|
719
|
-
layout?: any;
|
|
720
|
-
routingDisabled?: boolean | undefined;
|
|
721
748
|
outline?: {
|
|
722
749
|
x: number;
|
|
723
750
|
y: number;
|
|
724
751
|
}[] | undefined;
|
|
752
|
+
layout?: any;
|
|
753
|
+
routingDisabled?: boolean | undefined;
|
|
725
754
|
}, {
|
|
726
755
|
pcbX?: string | number | undefined;
|
|
727
756
|
pcbY?: string | number | undefined;
|
|
728
757
|
children?: any;
|
|
729
758
|
width?: string | number | undefined;
|
|
730
759
|
height?: string | number | undefined;
|
|
731
|
-
layout?: any;
|
|
732
|
-
routingDisabled?: boolean | undefined;
|
|
733
760
|
outline?: {
|
|
734
761
|
x: string | number;
|
|
735
762
|
y: string | number;
|
|
736
763
|
}[] | undefined;
|
|
764
|
+
layout?: any;
|
|
765
|
+
routingDisabled?: boolean | undefined;
|
|
737
766
|
}>;
|
|
738
767
|
|
|
739
768
|
declare const chipProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
@@ -1954,6 +1983,8 @@ interface JumperProps extends CommonComponentProps {
|
|
|
1954
1983
|
schPinSpacing?: number | string;
|
|
1955
1984
|
schWidth?: number | string;
|
|
1956
1985
|
schHeight?: number | string;
|
|
1986
|
+
schDirection?: "left" | "right";
|
|
1987
|
+
schPortArrangement?: SchematicPortArrangement;
|
|
1957
1988
|
}
|
|
1958
1989
|
declare const jumperProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
1959
1990
|
pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
@@ -2232,6 +2263,113 @@ declare const jumperProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.ext
|
|
|
2232
2263
|
schPinSpacing: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
2233
2264
|
schWidth: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
2234
2265
|
schHeight: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
2266
|
+
schDirection: z.ZodOptional<z.ZodEnum<["left", "right"]>>;
|
|
2267
|
+
schPortArrangement: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
2268
|
+
leftSize: z.ZodOptional<z.ZodNumber>;
|
|
2269
|
+
topSize: z.ZodOptional<z.ZodNumber>;
|
|
2270
|
+
rightSize: z.ZodOptional<z.ZodNumber>;
|
|
2271
|
+
bottomSize: z.ZodOptional<z.ZodNumber>;
|
|
2272
|
+
}, "strip", z.ZodTypeAny, {
|
|
2273
|
+
leftSize?: number | undefined;
|
|
2274
|
+
topSize?: number | undefined;
|
|
2275
|
+
rightSize?: number | undefined;
|
|
2276
|
+
bottomSize?: number | undefined;
|
|
2277
|
+
}, {
|
|
2278
|
+
leftSize?: number | undefined;
|
|
2279
|
+
topSize?: number | undefined;
|
|
2280
|
+
rightSize?: number | undefined;
|
|
2281
|
+
bottomSize?: number | undefined;
|
|
2282
|
+
}>, z.ZodObject<{
|
|
2283
|
+
leftPinCount: z.ZodOptional<z.ZodNumber>;
|
|
2284
|
+
rightPinCount: z.ZodOptional<z.ZodNumber>;
|
|
2285
|
+
topPinCount: z.ZodOptional<z.ZodNumber>;
|
|
2286
|
+
bottomPinCount: z.ZodOptional<z.ZodNumber>;
|
|
2287
|
+
}, "strip", z.ZodTypeAny, {
|
|
2288
|
+
leftPinCount?: number | undefined;
|
|
2289
|
+
rightPinCount?: number | undefined;
|
|
2290
|
+
topPinCount?: number | undefined;
|
|
2291
|
+
bottomPinCount?: number | undefined;
|
|
2292
|
+
}, {
|
|
2293
|
+
leftPinCount?: number | undefined;
|
|
2294
|
+
rightPinCount?: number | undefined;
|
|
2295
|
+
topPinCount?: number | undefined;
|
|
2296
|
+
bottomPinCount?: number | undefined;
|
|
2297
|
+
}>]>, z.ZodObject<{
|
|
2298
|
+
leftSide: z.ZodOptional<z.ZodObject<{
|
|
2299
|
+
pins: z.ZodArray<z.ZodNumber, "many">;
|
|
2300
|
+
direction: z.ZodUnion<[z.ZodLiteral<"top-to-bottom">, z.ZodLiteral<"left-to-right">, z.ZodLiteral<"bottom-to-top">, z.ZodLiteral<"right-to-left">]>;
|
|
2301
|
+
}, "strip", z.ZodTypeAny, {
|
|
2302
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2303
|
+
pins: number[];
|
|
2304
|
+
}, {
|
|
2305
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2306
|
+
pins: number[];
|
|
2307
|
+
}>>;
|
|
2308
|
+
rightSide: z.ZodOptional<z.ZodObject<{
|
|
2309
|
+
pins: z.ZodArray<z.ZodNumber, "many">;
|
|
2310
|
+
direction: z.ZodUnion<[z.ZodLiteral<"top-to-bottom">, z.ZodLiteral<"left-to-right">, z.ZodLiteral<"bottom-to-top">, z.ZodLiteral<"right-to-left">]>;
|
|
2311
|
+
}, "strip", z.ZodTypeAny, {
|
|
2312
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2313
|
+
pins: number[];
|
|
2314
|
+
}, {
|
|
2315
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2316
|
+
pins: number[];
|
|
2317
|
+
}>>;
|
|
2318
|
+
topSide: z.ZodOptional<z.ZodObject<{
|
|
2319
|
+
pins: z.ZodArray<z.ZodNumber, "many">;
|
|
2320
|
+
direction: z.ZodUnion<[z.ZodLiteral<"top-to-bottom">, z.ZodLiteral<"left-to-right">, z.ZodLiteral<"bottom-to-top">, z.ZodLiteral<"right-to-left">]>;
|
|
2321
|
+
}, "strip", z.ZodTypeAny, {
|
|
2322
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2323
|
+
pins: number[];
|
|
2324
|
+
}, {
|
|
2325
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2326
|
+
pins: number[];
|
|
2327
|
+
}>>;
|
|
2328
|
+
bottomSide: z.ZodOptional<z.ZodObject<{
|
|
2329
|
+
pins: z.ZodArray<z.ZodNumber, "many">;
|
|
2330
|
+
direction: z.ZodUnion<[z.ZodLiteral<"top-to-bottom">, z.ZodLiteral<"left-to-right">, z.ZodLiteral<"bottom-to-top">, z.ZodLiteral<"right-to-left">]>;
|
|
2331
|
+
}, "strip", z.ZodTypeAny, {
|
|
2332
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2333
|
+
pins: number[];
|
|
2334
|
+
}, {
|
|
2335
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2336
|
+
pins: number[];
|
|
2337
|
+
}>>;
|
|
2338
|
+
}, "strip", z.ZodTypeAny, {
|
|
2339
|
+
leftSide?: {
|
|
2340
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2341
|
+
pins: number[];
|
|
2342
|
+
} | undefined;
|
|
2343
|
+
rightSide?: {
|
|
2344
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2345
|
+
pins: number[];
|
|
2346
|
+
} | undefined;
|
|
2347
|
+
topSide?: {
|
|
2348
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2349
|
+
pins: number[];
|
|
2350
|
+
} | undefined;
|
|
2351
|
+
bottomSide?: {
|
|
2352
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2353
|
+
pins: number[];
|
|
2354
|
+
} | undefined;
|
|
2355
|
+
}, {
|
|
2356
|
+
leftSide?: {
|
|
2357
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2358
|
+
pins: number[];
|
|
2359
|
+
} | undefined;
|
|
2360
|
+
rightSide?: {
|
|
2361
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2362
|
+
pins: number[];
|
|
2363
|
+
} | undefined;
|
|
2364
|
+
topSide?: {
|
|
2365
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2366
|
+
pins: number[];
|
|
2367
|
+
} | undefined;
|
|
2368
|
+
bottomSide?: {
|
|
2369
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2370
|
+
pins: number[];
|
|
2371
|
+
} | undefined;
|
|
2372
|
+
}>]>>;
|
|
2235
2373
|
}>, "strip", z.ZodTypeAny, {
|
|
2236
2374
|
name: string;
|
|
2237
2375
|
pcbX?: number | undefined;
|
|
@@ -2300,6 +2438,34 @@ declare const jumperProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.ext
|
|
|
2300
2438
|
symbolName?: string | undefined;
|
|
2301
2439
|
manufacturerPartNumber?: string | undefined;
|
|
2302
2440
|
pinLabels?: Record<string | number, string> | undefined;
|
|
2441
|
+
schPortArrangement?: {
|
|
2442
|
+
leftSize?: number | undefined;
|
|
2443
|
+
topSize?: number | undefined;
|
|
2444
|
+
rightSize?: number | undefined;
|
|
2445
|
+
bottomSize?: number | undefined;
|
|
2446
|
+
} | {
|
|
2447
|
+
leftPinCount?: number | undefined;
|
|
2448
|
+
rightPinCount?: number | undefined;
|
|
2449
|
+
topPinCount?: number | undefined;
|
|
2450
|
+
bottomPinCount?: number | undefined;
|
|
2451
|
+
} | {
|
|
2452
|
+
leftSide?: {
|
|
2453
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2454
|
+
pins: number[];
|
|
2455
|
+
} | undefined;
|
|
2456
|
+
rightSide?: {
|
|
2457
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2458
|
+
pins: number[];
|
|
2459
|
+
} | undefined;
|
|
2460
|
+
topSide?: {
|
|
2461
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2462
|
+
pins: number[];
|
|
2463
|
+
} | undefined;
|
|
2464
|
+
bottomSide?: {
|
|
2465
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2466
|
+
pins: number[];
|
|
2467
|
+
} | undefined;
|
|
2468
|
+
} | undefined;
|
|
2303
2469
|
schPinStyle?: Record<string, {
|
|
2304
2470
|
leftMargin?: number | undefined;
|
|
2305
2471
|
rightMargin?: number | undefined;
|
|
@@ -2309,6 +2475,7 @@ declare const jumperProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.ext
|
|
|
2309
2475
|
schPinSpacing?: number | undefined;
|
|
2310
2476
|
schWidth?: number | undefined;
|
|
2311
2477
|
schHeight?: number | undefined;
|
|
2478
|
+
schDirection?: "left" | "right" | undefined;
|
|
2312
2479
|
}, {
|
|
2313
2480
|
name: string;
|
|
2314
2481
|
pcbX?: string | number | undefined;
|
|
@@ -2379,6 +2546,34 @@ declare const jumperProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.ext
|
|
|
2379
2546
|
symbolName?: string | undefined;
|
|
2380
2547
|
manufacturerPartNumber?: string | undefined;
|
|
2381
2548
|
pinLabels?: Record<string | number, string> | undefined;
|
|
2549
|
+
schPortArrangement?: {
|
|
2550
|
+
leftSize?: number | undefined;
|
|
2551
|
+
topSize?: number | undefined;
|
|
2552
|
+
rightSize?: number | undefined;
|
|
2553
|
+
bottomSize?: number | undefined;
|
|
2554
|
+
} | {
|
|
2555
|
+
leftPinCount?: number | undefined;
|
|
2556
|
+
rightPinCount?: number | undefined;
|
|
2557
|
+
topPinCount?: number | undefined;
|
|
2558
|
+
bottomPinCount?: number | undefined;
|
|
2559
|
+
} | {
|
|
2560
|
+
leftSide?: {
|
|
2561
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2562
|
+
pins: number[];
|
|
2563
|
+
} | undefined;
|
|
2564
|
+
rightSide?: {
|
|
2565
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2566
|
+
pins: number[];
|
|
2567
|
+
} | undefined;
|
|
2568
|
+
topSide?: {
|
|
2569
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2570
|
+
pins: number[];
|
|
2571
|
+
} | undefined;
|
|
2572
|
+
bottomSide?: {
|
|
2573
|
+
direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
|
|
2574
|
+
pins: number[];
|
|
2575
|
+
} | undefined;
|
|
2576
|
+
} | undefined;
|
|
2382
2577
|
schPinStyle?: Record<string, {
|
|
2383
2578
|
leftMargin?: string | number | undefined;
|
|
2384
2579
|
rightMargin?: string | number | undefined;
|
|
@@ -2388,6 +2583,7 @@ declare const jumperProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.ext
|
|
|
2388
2583
|
schPinSpacing?: string | number | undefined;
|
|
2389
2584
|
schWidth?: string | number | undefined;
|
|
2390
2585
|
schHeight?: string | number | undefined;
|
|
2586
|
+
schDirection?: "left" | "right" | undefined;
|
|
2391
2587
|
}>;
|
|
2392
2588
|
|
|
2393
2589
|
interface ResistorProps extends CommonComponentProps {
|
|
@@ -3220,6 +3416,65 @@ declare const capacitorProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.
|
|
|
3220
3416
|
}>;
|
|
3221
3417
|
declare const capacitorPins: readonly ["pin1", "left", "anode", "pos", "pin2", "right", "cathode", "neg"];
|
|
3222
3418
|
|
|
3419
|
+
interface GroupProps extends CommonLayoutProps {
|
|
3420
|
+
name?: string;
|
|
3421
|
+
layout?: LayoutBuilder;
|
|
3422
|
+
children?: any;
|
|
3423
|
+
routingDisabled?: boolean;
|
|
3424
|
+
}
|
|
3425
|
+
declare const groupProps: z.ZodObject<z.objectUtil.extendShape<{
|
|
3426
|
+
pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
3427
|
+
pcbY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
3428
|
+
pcbRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
3429
|
+
schX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
3430
|
+
schY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
3431
|
+
schRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
3432
|
+
layer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
|
|
3433
|
+
name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
3434
|
+
}, "strip", z.ZodTypeAny, {
|
|
3435
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3436
|
+
}, {
|
|
3437
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3438
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
3439
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3440
|
+
}>>;
|
|
3441
|
+
footprint: z.ZodOptional<z.ZodType<Footprint, z.ZodTypeDef, Footprint>>;
|
|
3442
|
+
}, {
|
|
3443
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3444
|
+
layout: z.ZodOptional<z.ZodType<LayoutBuilder, z.ZodTypeDef, LayoutBuilder>>;
|
|
3445
|
+
children: z.ZodOptional<z.ZodAny>;
|
|
3446
|
+
routingDisabled: z.ZodOptional<z.ZodBoolean>;
|
|
3447
|
+
}>, "strip", z.ZodTypeAny, {
|
|
3448
|
+
pcbX?: number | undefined;
|
|
3449
|
+
pcbY?: number | undefined;
|
|
3450
|
+
pcbRotation?: number | undefined;
|
|
3451
|
+
schX?: number | undefined;
|
|
3452
|
+
schY?: number | undefined;
|
|
3453
|
+
schRotation?: number | undefined;
|
|
3454
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
3455
|
+
footprint?: Footprint | undefined;
|
|
3456
|
+
name?: string | undefined;
|
|
3457
|
+
children?: any;
|
|
3458
|
+
layout?: LayoutBuilder | undefined;
|
|
3459
|
+
routingDisabled?: boolean | undefined;
|
|
3460
|
+
}, {
|
|
3461
|
+
pcbX?: string | number | undefined;
|
|
3462
|
+
pcbY?: string | number | undefined;
|
|
3463
|
+
pcbRotation?: string | number | undefined;
|
|
3464
|
+
schX?: string | number | undefined;
|
|
3465
|
+
schY?: string | number | undefined;
|
|
3466
|
+
schRotation?: string | number | undefined;
|
|
3467
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
3468
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3469
|
+
} | undefined;
|
|
3470
|
+
footprint?: Footprint | undefined;
|
|
3471
|
+
name?: string | undefined;
|
|
3472
|
+
children?: any;
|
|
3473
|
+
layout?: LayoutBuilder | undefined;
|
|
3474
|
+
routingDisabled?: boolean | undefined;
|
|
3475
|
+
}>;
|
|
3476
|
+
type InferredGroupProps = z.input<typeof groupProps>;
|
|
3477
|
+
|
|
3223
3478
|
declare const inductorProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
3224
3479
|
pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
3225
3480
|
pcbY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
@@ -5775,58 +6030,6 @@ declare const componentProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.
|
|
|
5775
6030
|
symbolName?: string | undefined;
|
|
5776
6031
|
}>;
|
|
5777
6032
|
type ComponentProps = z.input<typeof componentProps>;
|
|
5778
|
-
declare const groupProps: z.ZodObject<z.objectUtil.extendShape<{
|
|
5779
|
-
pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5780
|
-
pcbY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5781
|
-
pcbRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5782
|
-
schX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5783
|
-
schY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5784
|
-
schRotation: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5785
|
-
layer: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, z.ZodObject<{
|
|
5786
|
-
name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
5787
|
-
}, "strip", z.ZodTypeAny, {
|
|
5788
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5789
|
-
}, {
|
|
5790
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5791
|
-
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
5792
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5793
|
-
}>>;
|
|
5794
|
-
footprint: z.ZodOptional<z.ZodType<Footprint, z.ZodTypeDef, Footprint>>;
|
|
5795
|
-
}, {
|
|
5796
|
-
name: z.ZodOptional<z.ZodString>;
|
|
5797
|
-
layout: z.ZodOptional<z.ZodType<LayoutBuilder, z.ZodTypeDef, LayoutBuilder>>;
|
|
5798
|
-
children: z.ZodOptional<z.ZodAny>;
|
|
5799
|
-
routingDisabled: z.ZodOptional<z.ZodBoolean>;
|
|
5800
|
-
}>, "strip", z.ZodTypeAny, {
|
|
5801
|
-
pcbX?: number | undefined;
|
|
5802
|
-
pcbY?: number | undefined;
|
|
5803
|
-
pcbRotation?: number | undefined;
|
|
5804
|
-
schX?: number | undefined;
|
|
5805
|
-
schY?: number | undefined;
|
|
5806
|
-
schRotation?: number | undefined;
|
|
5807
|
-
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
5808
|
-
footprint?: Footprint | undefined;
|
|
5809
|
-
name?: string | undefined;
|
|
5810
|
-
children?: any;
|
|
5811
|
-
layout?: LayoutBuilder | undefined;
|
|
5812
|
-
routingDisabled?: boolean | undefined;
|
|
5813
|
-
}, {
|
|
5814
|
-
pcbX?: string | number | undefined;
|
|
5815
|
-
pcbY?: string | number | undefined;
|
|
5816
|
-
pcbRotation?: string | number | undefined;
|
|
5817
|
-
schX?: string | number | undefined;
|
|
5818
|
-
schY?: string | number | undefined;
|
|
5819
|
-
schRotation?: string | number | undefined;
|
|
5820
|
-
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
5821
|
-
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5822
|
-
} | undefined;
|
|
5823
|
-
footprint?: Footprint | undefined;
|
|
5824
|
-
name?: string | undefined;
|
|
5825
|
-
children?: any;
|
|
5826
|
-
layout?: LayoutBuilder | undefined;
|
|
5827
|
-
routingDisabled?: boolean | undefined;
|
|
5828
|
-
}>;
|
|
5829
|
-
type GroupProps = z.input<typeof groupProps>;
|
|
5830
6033
|
declare const powerSourceProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
5831
6034
|
pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
5832
6035
|
pcbY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
@@ -6871,4 +7074,4 @@ declare const fabricationNotePathProps: z.ZodObject<z.objectUtil.extendShape<Omi
|
|
|
6871
7074
|
}>;
|
|
6872
7075
|
type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>;
|
|
6873
7076
|
|
|
6874
|
-
export { type BoardProps, type CapacitorProps, type ChipProps, type CommonComponentProps, type CommonLayoutProps, type ComponentProps, type ConstrainedLayoutProps, type ConstraintProps, type DiodeProps, type Direction, type DirectionAlongEdge, type FabricationNotePathProps, type FabricationNoteTextProps, type Footprint, type FootprintProps, type FootprintSoupElements, type GroupProps, type HoleProps, type InductorProps, type JumperProps, type LedProps, type NetAliasProps, type PcbTraceProps, type PlatedHoleProps, type PortHints, type PortProps, type PowerSourceProps, type ResistorProps, type SchematicBoxProps, type SchematicLineProps, type SchematicPathProps, type SchematicPinStyle$1 as SchematicPinStyle, type SchematicPinStyles, type SchematicTextProps, type SilkscreenCircleProps, type SilkscreenLineProps, type SilkscreenPathProps, type SilkscreenRectProps, type SilkscreenTextProps, type SmtPadProps, type SupplierName, type SupplierProps, type SwitchProps, type TraceHintProps, type TraceProps, type ViaProps, boardProps, bugProps, capacitorPins, capacitorProps, chipProps, commonComponentProps, commonLayoutProps, componentProps, constrainedLayoutProps, constraintProps, diodePins, diodeProps, direction, directionAlongEdge, distanceOrMultiplier, explicitPinSideDefinition, fabricationNotePathProps, fabricationNoteTextProps, footprintProp, footprintProps, groupProps, holeProps, inductorPins, inductorProps, jumperProps, ledPins, ledProps, lrPins, lrPolarPins, netAliasProps, pcbLayoutProps, pcbTraceProps, platedHoleProps, point3, portHints, portProps, portRef, powerSourceProps, resistorPins, resistorProps, routeHintPointProps, schematicBoxProps, schematicLineProps, schematicPathProps, schematicPortArrangement, schematicTextProps, silkscreenCircleProps, silkscreenLineProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, supplierProps, switchProps, traceHintProps, traceProps, viaProps };
|
|
7077
|
+
export { type BoardProps, type CapacitorProps, type ChipProps, type CommonComponentProps, type CommonLayoutProps, type ComponentProps, type ConstrainedLayoutProps, type ConstraintProps, type DiodeProps, type Direction, type DirectionAlongEdge, type FabricationNotePathProps, type FabricationNoteTextProps, type Footprint, type FootprintProps, type FootprintSoupElements, type GroupProps, type HoleProps, type InductorProps, type InferredGroupProps, type JumperProps, type LedProps, type NetAliasProps, type PcbTraceProps, type PinSideDefinition, type PlatedHoleProps, type PortHints, type PortProps, type PowerSourceProps, type ResistorProps, type SchematicBoxProps, type SchematicLineProps, type SchematicPathProps, type SchematicPinStyle$1 as SchematicPinStyle, type SchematicPinStyles, type SchematicPortArrangement, type SchematicPortArrangementWithPinCounts, type SchematicPortArrangementWithSides, type SchematicPortArrangementWithSizes, type SchematicTextProps, type SilkscreenCircleProps, type SilkscreenLineProps, type SilkscreenPathProps, type SilkscreenRectProps, type SilkscreenTextProps, type SmtPadProps, type SupplierName, type SupplierProps, type SwitchProps, type TraceHintProps, type TraceProps, type ViaProps, boardProps, bugProps, capacitorPins, capacitorProps, chipProps, commonComponentProps, commonLayoutProps, componentProps, constrainedLayoutProps, constraintProps, diodePins, diodeProps, direction, directionAlongEdge, distanceOrMultiplier, explicitPinSideDefinition, fabricationNotePathProps, fabricationNoteTextProps, footprintProp, footprintProps, groupProps, holeProps, inductorPins, inductorProps, jumperProps, ledPins, ledProps, lrPins, lrPolarPins, netAliasProps, pcbLayoutProps, pcbTraceProps, platedHoleProps, point3, portHints, portProps, portRef, powerSourceProps, resistorPins, resistorProps, routeHintPointProps, schematicBoxProps, schematicLineProps, schematicPathProps, schematicPortArrangement, schematicTextProps, silkscreenCircleProps, silkscreenLineProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, supplierProps, switchProps, traceHintProps, traceProps, viaProps };
|
package/dist/index.js
CHANGED
|
@@ -80,7 +80,7 @@ __export(lib_exports, {
|
|
|
80
80
|
});
|
|
81
81
|
module.exports = __toCommonJS(lib_exports);
|
|
82
82
|
var import_soup10 = require("@tscircuit/soup");
|
|
83
|
-
var
|
|
83
|
+
var import_zod16 = require("zod");
|
|
84
84
|
|
|
85
85
|
// lib/typecheck.ts
|
|
86
86
|
var expectTypesMatch = (shouldBe) => {
|
|
@@ -224,6 +224,7 @@ var schematicPortArrangement = import_zod7.z.object({
|
|
|
224
224
|
bottomSide: explicitPinSideDefinition.optional()
|
|
225
225
|
})
|
|
226
226
|
);
|
|
227
|
+
expectTypesMatch(true);
|
|
227
228
|
|
|
228
229
|
// lib/components/board.ts
|
|
229
230
|
var import_zod9 = require("zod");
|
|
@@ -288,7 +289,9 @@ var jumperProps = commonComponentProps.extend({
|
|
|
288
289
|
schPinStyle: schematicPinStyle.optional(),
|
|
289
290
|
schPinSpacing: import_soup7.distance.optional(),
|
|
290
291
|
schWidth: import_soup7.distance.optional(),
|
|
291
|
-
schHeight: import_soup7.distance.optional()
|
|
292
|
+
schHeight: import_soup7.distance.optional(),
|
|
293
|
+
schDirection: import_zod12.z.enum(["left", "right"]).optional(),
|
|
294
|
+
schPortArrangement: schematicPortArrangement.optional()
|
|
292
295
|
});
|
|
293
296
|
expectTypesMatch(true);
|
|
294
297
|
|
|
@@ -318,6 +321,16 @@ var capacitorProps = commonComponentProps.extend({
|
|
|
318
321
|
var capacitorPins = lrPolarPins;
|
|
319
322
|
expectTypesMatch(true);
|
|
320
323
|
|
|
324
|
+
// lib/components/group.ts
|
|
325
|
+
var import_zod15 = require("zod");
|
|
326
|
+
var groupProps = commonLayoutProps.extend({
|
|
327
|
+
name: import_zod15.z.string().optional(),
|
|
328
|
+
layout: import_zod15.z.custom((v) => true).optional(),
|
|
329
|
+
children: import_zod15.z.any().optional(),
|
|
330
|
+
routingDisabled: import_zod15.z.boolean().optional()
|
|
331
|
+
});
|
|
332
|
+
expectTypesMatch(true);
|
|
333
|
+
|
|
321
334
|
// lib/index.ts
|
|
322
335
|
var inductorProps = commonComponentProps.extend({
|
|
323
336
|
inductance: import_soup10.inductance
|
|
@@ -326,15 +339,15 @@ var inductorPins = lrPins;
|
|
|
326
339
|
var diodeProps = commonComponentProps.extend({});
|
|
327
340
|
var diodePins = lrPolarPins;
|
|
328
341
|
var ledProps = commonComponentProps.extend({
|
|
329
|
-
color:
|
|
342
|
+
color: import_zod16.z.string().optional()
|
|
330
343
|
});
|
|
331
344
|
var ledPins = lrPolarPins;
|
|
332
345
|
var switchProps = commonComponentProps.extend({
|
|
333
|
-
ftype:
|
|
334
|
-
switchType:
|
|
335
|
-
isNormallyClosed:
|
|
346
|
+
ftype: import_zod16.z.literal("switch"),
|
|
347
|
+
switchType: import_zod16.z.enum(["spst"]).default("spst"),
|
|
348
|
+
isNormallyClosed: import_zod16.z.boolean().default(false)
|
|
336
349
|
});
|
|
337
|
-
var distanceOrMultiplier2 = import_soup10.distance.or(
|
|
350
|
+
var distanceOrMultiplier2 = import_soup10.distance.or(import_zod16.z.enum(["2x", "3x", "4x"]));
|
|
338
351
|
var viaProps = commonLayoutProps.extend({
|
|
339
352
|
fromLayer: import_soup10.layer_ref,
|
|
340
353
|
toLayer: import_soup10.layer_ref,
|
|
@@ -342,50 +355,50 @@ var viaProps = commonLayoutProps.extend({
|
|
|
342
355
|
outerDiameter: import_soup10.distance
|
|
343
356
|
});
|
|
344
357
|
var netAliasProps = commonLayoutProps.extend({
|
|
345
|
-
net:
|
|
358
|
+
net: import_zod16.z.string().optional()
|
|
346
359
|
});
|
|
347
|
-
var portRef =
|
|
348
|
-
|
|
349
|
-
|
|
360
|
+
var portRef = import_zod16.z.union([
|
|
361
|
+
import_zod16.z.string(),
|
|
362
|
+
import_zod16.z.custom(
|
|
350
363
|
(v) => Boolean(v.getPortSelector)
|
|
351
364
|
)
|
|
352
365
|
]);
|
|
353
|
-
var traceProps =
|
|
354
|
-
path:
|
|
366
|
+
var traceProps = import_zod16.z.object({
|
|
367
|
+
path: import_zod16.z.array(portRef),
|
|
355
368
|
thickness: import_soup10.distance.optional(),
|
|
356
|
-
schematicRouteHints:
|
|
357
|
-
pcbRouteHints:
|
|
369
|
+
schematicRouteHints: import_zod16.z.array(import_soup10.point).optional(),
|
|
370
|
+
pcbRouteHints: import_zod16.z.array(import_soup10.route_hint_point).optional()
|
|
358
371
|
}).or(
|
|
359
|
-
|
|
372
|
+
import_zod16.z.object({
|
|
360
373
|
from: portRef,
|
|
361
374
|
to: portRef,
|
|
362
375
|
thickness: import_soup10.distance.optional(),
|
|
363
|
-
schematicRouteHints:
|
|
364
|
-
pcbRouteHints:
|
|
376
|
+
schematicRouteHints: import_zod16.z.array(import_soup10.point).optional(),
|
|
377
|
+
pcbRouteHints: import_zod16.z.array(import_soup10.route_hint_point).optional()
|
|
365
378
|
})
|
|
366
379
|
);
|
|
367
|
-
var smtPadProps =
|
|
380
|
+
var smtPadProps = import_zod16.z.union([
|
|
368
381
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
369
|
-
shape:
|
|
382
|
+
shape: import_zod16.z.literal("circle"),
|
|
370
383
|
radius: import_soup10.distance.optional(),
|
|
371
384
|
portHints: portHints.optional()
|
|
372
385
|
}),
|
|
373
386
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
374
|
-
shape:
|
|
387
|
+
shape: import_zod16.z.literal("rect"),
|
|
375
388
|
width: import_soup10.distance.optional(),
|
|
376
389
|
height: import_soup10.distance.optional(),
|
|
377
390
|
portHints: portHints.optional()
|
|
378
391
|
})
|
|
379
392
|
]);
|
|
380
|
-
var platedHoleProps =
|
|
393
|
+
var platedHoleProps = import_zod16.z.union([
|
|
381
394
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
382
|
-
shape:
|
|
395
|
+
shape: import_zod16.z.literal("circle"),
|
|
383
396
|
holeDiameter: import_soup10.distance,
|
|
384
397
|
outerDiameter: import_soup10.distance,
|
|
385
398
|
portHints: portHints.optional()
|
|
386
399
|
}),
|
|
387
400
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
388
|
-
shape:
|
|
401
|
+
shape: import_zod16.z.literal("oval"),
|
|
389
402
|
outerWidth: import_soup10.distance,
|
|
390
403
|
outerHeight: import_soup10.distance,
|
|
391
404
|
innerWidth: import_soup10.distance,
|
|
@@ -396,68 +409,62 @@ var platedHoleProps = import_zod15.z.union([
|
|
|
396
409
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
397
410
|
holeDiameter: import_soup10.distance
|
|
398
411
|
});
|
|
399
|
-
var schematicBoxProps =
|
|
412
|
+
var schematicBoxProps = import_zod16.z.object({
|
|
400
413
|
schX: import_soup10.distance,
|
|
401
414
|
schY: import_soup10.distance,
|
|
402
415
|
width: import_soup10.distance,
|
|
403
416
|
height: import_soup10.distance
|
|
404
417
|
});
|
|
405
|
-
var schematicTextProps =
|
|
418
|
+
var schematicTextProps = import_zod16.z.object({
|
|
406
419
|
schX: import_soup10.distance,
|
|
407
420
|
schY: import_soup10.distance,
|
|
408
|
-
text:
|
|
421
|
+
text: import_zod16.z.string()
|
|
409
422
|
});
|
|
410
|
-
var schematicLineProps =
|
|
423
|
+
var schematicLineProps = import_zod16.z.object({
|
|
411
424
|
x1: import_soup10.distance,
|
|
412
425
|
y1: import_soup10.distance,
|
|
413
426
|
x2: import_soup10.distance,
|
|
414
427
|
y2: import_soup10.distance
|
|
415
428
|
});
|
|
416
|
-
var schematicPathProps =
|
|
417
|
-
points:
|
|
418
|
-
isFilled:
|
|
419
|
-
fillColor:
|
|
429
|
+
var schematicPathProps = import_zod16.z.object({
|
|
430
|
+
points: import_zod16.z.array(import_soup10.point),
|
|
431
|
+
isFilled: import_zod16.z.boolean().optional().default(false),
|
|
432
|
+
fillColor: import_zod16.z.enum(["red", "blue"]).optional()
|
|
420
433
|
});
|
|
421
|
-
var constraintProps =
|
|
422
|
-
|
|
423
|
-
type:
|
|
434
|
+
var constraintProps = import_zod16.z.union([
|
|
435
|
+
import_zod16.z.object({
|
|
436
|
+
type: import_zod16.z.literal("xdist"),
|
|
424
437
|
dist: import_soup10.distance,
|
|
425
|
-
left:
|
|
426
|
-
right:
|
|
438
|
+
left: import_zod16.z.string(),
|
|
439
|
+
right: import_zod16.z.string()
|
|
427
440
|
}),
|
|
428
|
-
|
|
429
|
-
type:
|
|
441
|
+
import_zod16.z.object({
|
|
442
|
+
type: import_zod16.z.literal("ydist"),
|
|
430
443
|
dist: import_soup10.distance,
|
|
431
|
-
top:
|
|
432
|
-
bottom:
|
|
444
|
+
top: import_zod16.z.string(),
|
|
445
|
+
bottom: import_zod16.z.string()
|
|
433
446
|
})
|
|
434
447
|
]);
|
|
435
|
-
var constrainedLayoutProps =
|
|
436
|
-
var footprintProps =
|
|
448
|
+
var constrainedLayoutProps = import_zod16.z.object({});
|
|
449
|
+
var footprintProps = import_zod16.z.object({});
|
|
437
450
|
var componentProps = commonComponentProps;
|
|
438
|
-
var groupProps = commonLayoutProps.extend({
|
|
439
|
-
name: import_zod15.z.string().optional(),
|
|
440
|
-
layout: import_zod15.z.custom((v) => true).optional(),
|
|
441
|
-
children: import_zod15.z.any().optional(),
|
|
442
|
-
routingDisabled: import_zod15.z.boolean().optional()
|
|
443
|
-
});
|
|
444
451
|
var powerSourceProps = commonComponentProps.extend({
|
|
445
452
|
voltage: import_soup10.voltage
|
|
446
453
|
});
|
|
447
454
|
var portProps = commonLayoutProps.extend({
|
|
448
|
-
name:
|
|
449
|
-
pinNumber:
|
|
450
|
-
aliases:
|
|
455
|
+
name: import_zod16.z.string(),
|
|
456
|
+
pinNumber: import_zod16.z.number().optional(),
|
|
457
|
+
aliases: import_zod16.z.array(import_zod16.z.string()).optional(),
|
|
451
458
|
direction
|
|
452
459
|
});
|
|
453
460
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
454
|
-
text:
|
|
455
|
-
anchorAlignment:
|
|
456
|
-
font:
|
|
461
|
+
text: import_zod16.z.string(),
|
|
462
|
+
anchorAlignment: import_zod16.z.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
463
|
+
font: import_zod16.z.enum(["tscircuit2024"]).optional(),
|
|
457
464
|
fontSize: import_soup10.length.optional()
|
|
458
465
|
});
|
|
459
466
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
460
|
-
route:
|
|
467
|
+
route: import_zod16.z.array(import_soup10.route_hint_point),
|
|
461
468
|
strokeWidth: import_soup10.length.optional()
|
|
462
469
|
});
|
|
463
470
|
var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
@@ -468,46 +475,46 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
|
|
|
468
475
|
y2: import_soup10.distance
|
|
469
476
|
});
|
|
470
477
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
471
|
-
isFilled:
|
|
472
|
-
isOutline:
|
|
478
|
+
isFilled: import_zod16.z.boolean().optional(),
|
|
479
|
+
isOutline: import_zod16.z.boolean().optional(),
|
|
473
480
|
strokeWidth: import_soup10.distance.optional(),
|
|
474
481
|
width: import_soup10.distance,
|
|
475
482
|
height: import_soup10.distance
|
|
476
483
|
});
|
|
477
484
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
478
|
-
isFilled:
|
|
479
|
-
isOutline:
|
|
485
|
+
isFilled: import_zod16.z.boolean().optional(),
|
|
486
|
+
isOutline: import_zod16.z.boolean().optional(),
|
|
480
487
|
strokeWidth: import_soup10.distance.optional(),
|
|
481
488
|
radius: import_soup10.distance
|
|
482
489
|
});
|
|
483
|
-
var routeHintPointProps =
|
|
490
|
+
var routeHintPointProps = import_zod16.z.object({
|
|
484
491
|
x: import_soup10.distance,
|
|
485
492
|
y: import_soup10.distance,
|
|
486
|
-
via:
|
|
493
|
+
via: import_zod16.z.boolean().optional(),
|
|
487
494
|
toLayer: import_soup10.layer_ref.optional()
|
|
488
495
|
});
|
|
489
|
-
var traceHintProps =
|
|
490
|
-
for:
|
|
496
|
+
var traceHintProps = import_zod16.z.object({
|
|
497
|
+
for: import_zod16.z.string().optional().describe(
|
|
491
498
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
492
499
|
),
|
|
493
|
-
order:
|
|
500
|
+
order: import_zod16.z.number().optional(),
|
|
494
501
|
offset: import_soup10.route_hint_point.or(routeHintPointProps).optional(),
|
|
495
|
-
offsets:
|
|
496
|
-
traceWidth:
|
|
502
|
+
offsets: import_zod16.z.array(import_soup10.route_hint_point).or(import_zod16.z.array(routeHintPointProps)).optional(),
|
|
503
|
+
traceWidth: import_zod16.z.number().optional()
|
|
497
504
|
});
|
|
498
|
-
var pcbTraceProps =
|
|
499
|
-
layer:
|
|
505
|
+
var pcbTraceProps = import_zod16.z.object({
|
|
506
|
+
layer: import_zod16.z.string().optional(),
|
|
500
507
|
thickness: import_soup10.distance.optional(),
|
|
501
|
-
route:
|
|
508
|
+
route: import_zod16.z.array(import_soup10.route_hint_point)
|
|
502
509
|
});
|
|
503
510
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
504
|
-
text:
|
|
505
|
-
anchorAlignment:
|
|
506
|
-
font:
|
|
511
|
+
text: import_zod16.z.string(),
|
|
512
|
+
anchorAlignment: import_zod16.z.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
513
|
+
font: import_zod16.z.enum(["tscircuit2024"]).optional(),
|
|
507
514
|
fontSize: import_soup10.length.optional()
|
|
508
515
|
});
|
|
509
516
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
510
|
-
route:
|
|
517
|
+
route: import_zod16.z.array(import_soup10.route_hint_point),
|
|
511
518
|
strokeWidth: import_soup10.length.optional()
|
|
512
519
|
});
|
|
513
520
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/index.ts","../lib/typecheck.ts","../lib/common/direction.ts","../lib/common/portHints.ts","../lib/common/layout.ts","../lib/common/point3.ts","../lib/common/cadModel.ts","../lib/common/footprintProp.ts","../lib/common/schematicPinDefinitions.ts","../lib/components/board.ts","../lib/common/point.ts","../lib/components/chip.ts","../lib/common/schematicPinStyle.ts","../lib/components/jumper.ts","../lib/components/resistor.ts","../lib/components/capacitor.ts"],"sourcesContent":["/**\n * THINKING ABOUT ADDING SOMETHING TO THIS FILE?\n *\n * THINK AGAIN!\n *\n * This file is TOO BIG! Create files using the pattern in the surrounding\n * directories, then export from this file.\n */\nimport type { LayoutBuilder } from \"@tscircuit/layout\"\nimport {\n type AnySoupElementInput,\n capacitance,\n distance,\n inductance,\n layer_ref,\n length,\n type PCBPlatedHoleInput,\n type PCBSMTPadInput,\n point,\n resistance,\n rotation,\n route_hint_point,\n supplier_name,\n voltage,\n} from \"@tscircuit/soup\"\nimport type { ReactElement } from \"react\"\nimport { z } from \"zod\"\nimport { direction } from \"./common/direction\"\nimport { portHints } from \"./common/portHints\"\nimport {\n commonComponentProps,\n commonLayoutProps,\n lrPins,\n lrPolarPins,\n pcbLayoutProps,\n} from \"./common/layout\"\nimport { explicitPinSideDefinition } from \"./common/schematicPinDefinitions\"\n\nexport * from \"./common/direction\"\nexport * from \"./common/portHints\"\nexport * from \"./common/layout\"\nexport * from \"./common/point3\"\nexport * from \"./common/portHints\"\nexport * from \"./common/footprintProp\"\nexport * from \"./common/schematicPinDefinitions\"\n\nexport * from \"./components/board\"\nexport * from \"./components/chip\"\nexport * from \"./components/jumper\"\n\nexport * from \"./components/resistor\"\nexport * from \"./components/capacitor\"\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 switchProps = commonComponentProps.extend({\n ftype: z.literal(\"switch\"),\n switchType: z.enum([\"spst\"]).default(\"spst\"),\n isNormallyClosed: z.boolean().default(false),\n})\nexport type SwitchProps = z.input<typeof switchProps>\n\nexport const distanceOrMultiplier = distance.or(z.enum([\"2x\", \"3x\", \"4x\"]))\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 portRef = z.union([\n z.string(),\n z.custom<{ getPortSelector: () => string }>((v) =>\n Boolean(v.getPortSelector),\n ),\n])\n\nexport const traceProps = z\n .object({\n path: z.array(portRef),\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: portRef,\n to: portRef,\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 = z.union([\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n shape: z.literal(\"circle\"),\n holeDiameter: distance,\n outerDiameter: distance,\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n shape: z.literal(\"oval\"),\n outerWidth: distance,\n outerHeight: distance,\n innerWidth: distance,\n innerHeight: distance,\n portHints: portHints.optional(),\n }),\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 routingDisabled: z.boolean().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: length.optional(),\n})\nexport type SilkscreenTextProps = z.input<typeof silkscreenTextProps>\n\nexport const silkscreenPathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type SilkscreenPathProps = z.input<typeof silkscreenPathProps>\n\nexport const silkscreenLineProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: 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\n .omit({ pcbRotation: true })\n .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\n .omit({ pcbRotation: true })\n .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 routeHintPointProps = z.object({\n x: distance,\n y: distance,\n via: z.boolean().optional(),\n toLayer: layer_ref.optional(),\n})\n\nexport const traceHintProps = z.object({\n for: z\n .string()\n .optional()\n .describe(\n \"Selector for the port you're targeting, not required if you're inside a trace\",\n ),\n order: z.number().optional(),\n offset: route_hint_point.or(routeHintPointProps).optional(),\n offsets: z\n .array(route_hint_point)\n .or(z.array(routeHintPointProps))\n .optional(),\n traceWidth: z.number().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\nexport const fabricationNoteTextProps = 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: length.optional(),\n})\nexport type FabricationNoteTextProps = z.input<typeof fabricationNoteTextProps>\n\nexport const fabricationNotePathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>\n","import type { TypeEqual } from \"ts-expect\"\n\nexport const expectTypesMatch = <const T1, const T2>(\n shouldBe: TypeEqual<T1, T2>,\n): void => {}\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nexport const direction = z.enum([\"up\", \"down\", \"left\", \"right\"])\nexport type Direction = \"up\" | \"down\" | \"left\" | \"right\"\n\nexport type DirectionAlongEdge =\n | \"top-to-bottom\"\n | \"left-to-right\"\n | \"bottom-to-top\"\n | \"right-to-left\"\n\nexport const directionAlongEdge = z.enum([\n \"top-to-bottom\",\n \"left-to-right\",\n \"bottom-to-top\",\n \"right-to-left\",\n])\n\nexpectTypesMatch<Direction, z.infer<typeof direction>>(true)\nexpectTypesMatch<DirectionAlongEdge, z.infer<typeof directionAlongEdge>>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const portHints = z.array(z.string().or(z.number()))\nexport type PortHints = (string | number)[]\n\nexpectTypesMatch<PortHints, z.infer<typeof portHints>>(true)\n","import { z } from \"zod\"\nimport {\n type AnySoupElementInput,\n distance,\n layer_ref,\n type LayerRef,\n type LayerRefInput,\n rotation,\n supplier_name,\n} from \"@tscircuit/soup\"\nimport { point3 } from \"./point3\"\nimport {\n cadModelJscad,\n cadModelObj,\n cadModelProp,\n cadModelStl,\n type CadModelJscad,\n type CadModelObj,\n type CadModelProp,\n type CadModelStl,\n} from \"./cadModel\"\nimport { footprintProp, type Footprint } from \"./footprintProp\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const pcbLayoutProps = z.object({\n pcbX: distance,\n pcbY: distance,\n pcbRotation: rotation.optional(),\n layer: layer_ref.optional(),\n})\n\nexport interface CommonLayoutProps {\n pcbX?: string | number\n pcbY?: string | number\n pcbRotation?: string | number\n\n schX?: string | number\n schY?: string | number\n schRotation?: string | number\n\n layer?: LayerRefInput\n footprint?: Footprint\n}\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 footprint: footprintProp.optional(),\n})\n\ntype InferredCommonLayoutProps = z.input<typeof commonLayoutProps>\nexpectTypesMatch<CommonLayoutProps, InferredCommonLayoutProps>(true)\n\nexport type SupplierName =\n | \"jlcpcb\"\n | \"macrofab\"\n | \"pcbway\"\n | \"digikey\"\n | \"mouser\"\n | \"lcsc\"\nexport interface SupplierProps {\n supplierPartNumbers?: { [k in SupplierName]?: string[] }\n}\nexport const supplierProps = z.object({\n supplierPartNumbers: z.record(supplier_name, z.array(z.string())).optional(),\n})\n\nexpectTypesMatch<SupplierProps, z.input<typeof supplierProps>>(true)\n\nexport interface CommonComponentProps extends CommonLayoutProps {\n name: string\n supplierPartNumbers?: SupplierProps[\"supplierPartNumbers\"]\n cadModel?: CadModelProp\n children?: any\n symbolName?: string\n}\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n name: z.string(),\n cadModel: cadModelProp.optional(),\n children: z.any().optional(),\n symbolName: z.string().optional(),\n })\n\ntype InferredCommonComponentProps = z.input<typeof commonComponentProps>\nexpectTypesMatch<CommonComponentProps, InferredCommonComponentProps>(true)\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 distanceOrMultiplier = distance.or(z.enum([\"2x\", \"3x\", \"4x\"]))\n","import { distance } from \"@tscircuit/soup\"\nimport { z } from \"zod\"\n\nexport const point3 = z.object({\n x: distance,\n y: distance,\n z: distance,\n})\n","import { z } from \"zod\"\nimport { point3 } from \"./point3\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const rotationPoint3 = z.object({\n x: z.union([z.number(), z.string()]),\n y: z.union([z.number(), z.string()]),\n z: z.union([z.number(), z.string()]),\n})\n\nexport interface CadModelBase {\n rotationOffset?:\n | number\n | { x: number | string; y: number | string; z: number | string }\n positionOffset?: {\n x: number | string\n y: number | string\n z: number | string\n }\n size?: { x: number | string; y: number | string; z: number | string }\n}\n\nexport const cadModelBase = z.object({\n rotationOffset: z.number().or(rotationPoint3).optional(),\n positionOffset: point3.optional(),\n size: point3.optional(),\n})\n\nexpectTypesMatch<CadModelBase, z.input<typeof cadModelBase>>(true)\n\nexport interface CadModelStl extends CadModelBase {\n stlUrl: string\n}\nexport const cadModelStl = cadModelBase.extend({\n stlUrl: z.string(),\n})\n\nexport interface CadModelObj extends CadModelBase {\n objUrl: string\n mtlUrl?: string\n}\nexport const cadModelObj = cadModelBase.extend({\n objUrl: z.string(),\n mtlUrl: z.string().optional(),\n})\n\nexport interface CadModelJscad extends CadModelBase {\n jscad: Record<string, any>\n}\nexport const cadModelJscad = cadModelBase.extend({\n jscad: z.record(z.any()),\n})\n\nexport type CadModelProp = string | CadModelStl | CadModelObj | CadModelJscad\n\nexport const cadModelProp = z.union([\n z.string(),\n cadModelStl,\n cadModelObj,\n cadModelJscad,\n])\n\ntype InferredCadModelProp = z.input<typeof cadModelProp>\nexpectTypesMatch<CadModelProp, InferredCadModelProp>(true)\n","import type { LayerRef } from \"@tscircuit/soup\"\nimport type { ReactElement } from \"react\"\nimport { z } from \"zod\"\n\n/**\n * This is an abbreviated definition of the soup elements that you can find here:\n * https://docs.tscircuit.com/api-reference/advanced/soup#pcb-smtpad\n */\nexport type FootprintSoupElements = {\n type: \"pcb_smtpad\" | \"pcb_plated_hole\"\n x: string | number\n y: string | number\n layer?: LayerRef\n holeDiameter?: string | number\n outerDiameter?: string | number\n shape?: \"circle\" | \"rect\"\n width?: string | number\n height?: string | number\n portHints?: string[]\n}\n\nexport type Footprint = string | ReactElement | FootprintSoupElements[]\nexport const footprintProp = z.custom<Footprint>((v) => true)\n","import { z } from \"zod\"\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 const schematicPortArrangement = z\n .object({\n leftSize: z.number().optional().describe(\"@deprecated, use leftPinCount\"),\n topSize: z.number().optional().describe(\"@deprecated, use topPinCount\"),\n rightSize: z.number().optional().describe(\"@deprecated, use rightPinCount\"),\n bottomSize: z\n .number()\n .optional()\n .describe(\"@deprecated, use bottomPinCount\"),\n })\n .or(\n z.object({\n leftPinCount: z.number().optional(),\n rightPinCount: z.number().optional(),\n topPinCount: z.number().optional(),\n bottomPinCount: z.number().optional(),\n }),\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","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport { point, type Point } from \"lib/common/point\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface BoardProps {\n width?: number | string\n height?: number | string\n outline?: Point[]\n pcbX?: number | string\n pcbY?: number | string\n layout?: any\n routingDisabled?: boolean\n children?: any\n}\n\nexport const boardProps = z.object({\n width: distance.optional(),\n height: distance.optional(),\n outline: z.array(point).optional(),\n pcbX: distance.optional().default(0),\n pcbY: distance.optional().default(0),\n layout: z.any().optional(),\n routingDisabled: z.boolean().optional(),\n children: z.any(),\n})\n\nexpectTypesMatch<BoardProps, z.input<typeof boardProps>>(true)\n","import { distance } from \"@tscircuit/soup\"\nimport { z } from \"zod\"\n\nexport const point = z.object({\n x: distance,\n y: distance,\n})\n\nexport type Point = { x: number | string; y: number | string }\n","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport { commonComponentProps } from \"lib/common/layout\"\nimport { schematicPortArrangement } from \"lib/common/schematicPinDefinitions\"\nimport { schematicPinStyle } from \"lib/common/schematicPinStyle\"\n\nexport const chipProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z.record(z.number().or(z.string()), z.string()).optional(),\n\n schPortArrangement: schematicPortArrangement.optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n})\n\nexport type SchematicPinStyle = {\n leftMargin?: number | string\n rightMargin?: number | string\n topMargin?: number | string\n bottomMargin?: number | string\n}\nexport type SchematicPinStyles = Record<string, SchematicPinStyle>\n\n/**\n * @deprecated Use ChipProps instead.\n */\nexport const bugProps = chipProps\nexport type ChipProps = z.input<typeof chipProps>\n","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport type SchematicPinStyle = Record<\n string,\n {\n leftMargin?: number | string\n rightMargin?: number | string\n topMargin?: number | string\n bottomMargin?: number | string\n }\n>\n\nexport const schematicPinStyle = z.record(\n z.object({\n leftMargin: distance.optional(),\n rightMargin: distance.optional(),\n topMargin: distance.optional(),\n bottomMargin: distance.optional(),\n }),\n)\n\nexpectTypesMatch<SchematicPinStyle, z.input<typeof schematicPinStyle>>(true)\n","import { z } from \"zod\"\nimport {\n commonComponentProps,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicPinStyle,\n type SchematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { distance } from \"@tscircuit/soup\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface JumperProps extends CommonComponentProps {\n manufacturerPartNumber?: string\n pinLabels?: Record<number | string, string>\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: number | string\n schWidth?: number | string\n schHeight?: number | string\n}\n\nexport const jumperProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z.record(z.number().or(z.string()), z.string()).optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n})\n\ntype InferredJumperProps = z.input<typeof jumperProps>\nexpectTypesMatch<JumperProps, InferredJumperProps>(true)\n","import { z } from \"zod\"\nimport { resistance } from \"@tscircuit/soup\"\nimport {\n commonComponentProps,\n lrPins,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface ResistorProps extends CommonComponentProps {\n resistance: number | string\n pullupFor?: string\n pullupTo?: string\n pulldownFor?: string\n pulldownTo?: string\n}\n\nexport const resistorProps = commonComponentProps.extend({\n resistance,\n\n pullupFor: z.string().optional(),\n pullupTo: z.string().optional(),\n\n pulldownFor: z.string().optional(),\n pulldownTo: z.string().optional(),\n})\nexport const resistorPins = lrPins\n\ntype InferredResistorProps = z.input<typeof resistorProps>\nexpectTypesMatch<ResistorProps, InferredResistorProps>(true)\n","import { z } from \"zod\"\nimport { capacitance } from \"@tscircuit/soup\"\nimport {\n commonComponentProps,\n lrPins,\n lrPolarPins,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface CapacitorProps extends CommonComponentProps {\n capacitance: number | string\n\n decouplingFor?: string\n decouplingTo?: string\n\n bypassFor?: string\n bypassTo?: string\n}\n\nexport const capacitorProps = commonComponentProps.extend({\n capacitance,\n\n decouplingFor: z.string().optional(),\n decouplingTo: z.string().optional(),\n\n bypassFor: z.string().optional(),\n bypassTo: z.string().optional(),\n})\nexport const capacitorPins = lrPolarPins\n\nexpectTypesMatch<CapacitorProps, z.input<typeof capacitorProps>>(true)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAAA;AAAA,EAAA;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;AASA,IAAAC,gBAeO;AAEP,IAAAC,eAAkB;;;ACxBX,IAAM,mBAAmB,CAC9B,aACS;AAAC;;;ACHZ,iBAAkB;AACX,IAAM,YAAY,aAAE,KAAK,CAAC,MAAM,QAAQ,QAAQ,OAAO,CAAC;AASxD,IAAM,qBAAqB,aAAE,KAAK;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,iBAAuD,IAAI;AAC3D,iBAAyE,IAAI;;;ACnB7E,IAAAC,cAAkB;AAGX,IAAM,YAAY,cAAE,MAAM,cAAE,OAAO,EAAE,GAAG,cAAE,OAAO,CAAC,CAAC;AAG1D,iBAAuD,IAAI;;;ACN3D,IAAAC,cAAkB;AAClB,IAAAC,eAQO;;;ACTP,kBAAyB;AACzB,IAAAC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AAC,UAAU,YAAY,aAAa,eAAe,cAAc,CAAC,EACvE,QAAQ,QAAQ;AAAA,EACnB,MAAM,eAAE,KAAK,CAAC,eAAe,CAAC,EAAE,SAAS;AAAA,EACzC,UAAU,qBAAO,SAAS;AAC5B,CAAC;AAGM,IAAM,2BAA2B,eACrC,KAAK,EAAE,MAAM,MAAM,MAAM,MAAM,aAAa,KAAK,CAAC,EAClD,OAAO;AAAA,EACN,OAAO,eAAE,MAAM,8BAAgB;AAAA,EAC/B,aAAa,qBAAO,SAAS;AAC/B,CAAC;","names":["distanceOrMultiplier","import_soup","import_zod","import_zod","import_zod","import_soup","import_zod","import_zod","import_zod","import_zod","import_zod","import_soup","import_soup","import_zod","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","distanceOrMultiplier"]}
|
|
1
|
+
{"version":3,"sources":["../lib/index.ts","../lib/typecheck.ts","../lib/common/direction.ts","../lib/common/portHints.ts","../lib/common/layout.ts","../lib/common/point3.ts","../lib/common/cadModel.ts","../lib/common/footprintProp.ts","../lib/common/schematicPinDefinitions.ts","../lib/components/board.ts","../lib/common/point.ts","../lib/components/chip.ts","../lib/common/schematicPinStyle.ts","../lib/components/jumper.ts","../lib/components/resistor.ts","../lib/components/capacitor.ts","../lib/components/group.ts"],"sourcesContent":["/**\n * THINKING ABOUT ADDING SOMETHING TO THIS FILE?\n *\n * THINK AGAIN!\n *\n * This file is TOO BIG! Create files using the pattern in the surrounding\n * directories, then export from this file.\n */\nimport type { LayoutBuilder } from \"@tscircuit/layout\"\nimport {\n type AnySoupElementInput,\n capacitance,\n distance,\n inductance,\n layer_ref,\n length,\n type PCBPlatedHoleInput,\n type PCBSMTPadInput,\n point,\n resistance,\n rotation,\n route_hint_point,\n supplier_name,\n voltage,\n} from \"@tscircuit/soup\"\nimport type { ReactElement } from \"react\"\nimport { z } from \"zod\"\nimport { direction } from \"./common/direction\"\nimport { portHints } from \"./common/portHints\"\nimport {\n commonComponentProps,\n commonLayoutProps,\n lrPins,\n lrPolarPins,\n pcbLayoutProps,\n} from \"./common/layout\"\nimport { explicitPinSideDefinition } from \"./common/schematicPinDefinitions\"\n\nexport * from \"./common/direction\"\nexport * from \"./common/portHints\"\nexport * from \"./common/layout\"\nexport * from \"./common/point3\"\nexport * from \"./common/portHints\"\nexport * from \"./common/footprintProp\"\nexport * from \"./common/schematicPinDefinitions\"\n\nexport * from \"./components/board\"\nexport * from \"./components/chip\"\nexport * from \"./components/jumper\"\n\nexport * from \"./components/resistor\"\nexport * from \"./components/capacitor\"\nexport * from \"./components/group\"\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 switchProps = commonComponentProps.extend({\n ftype: z.literal(\"switch\"),\n switchType: z.enum([\"spst\"]).default(\"spst\"),\n isNormallyClosed: z.boolean().default(false),\n})\nexport type SwitchProps = z.input<typeof switchProps>\n\nexport const distanceOrMultiplier = distance.or(z.enum([\"2x\", \"3x\", \"4x\"]))\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 portRef = z.union([\n z.string(),\n z.custom<{ getPortSelector: () => string }>((v) =>\n Boolean(v.getPortSelector),\n ),\n])\n\nexport const traceProps = z\n .object({\n path: z.array(portRef),\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: portRef,\n to: portRef,\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 = z.union([\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n shape: z.literal(\"circle\"),\n holeDiameter: distance,\n outerDiameter: distance,\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n shape: z.literal(\"oval\"),\n outerWidth: distance,\n outerHeight: distance,\n innerWidth: distance,\n innerHeight: distance,\n portHints: portHints.optional(),\n }),\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 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: length.optional(),\n})\nexport type SilkscreenTextProps = z.input<typeof silkscreenTextProps>\n\nexport const silkscreenPathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type SilkscreenPathProps = z.input<typeof silkscreenPathProps>\n\nexport const silkscreenLineProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: 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\n .omit({ pcbRotation: true })\n .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\n .omit({ pcbRotation: true })\n .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 routeHintPointProps = z.object({\n x: distance,\n y: distance,\n via: z.boolean().optional(),\n toLayer: layer_ref.optional(),\n})\n\nexport const traceHintProps = z.object({\n for: z\n .string()\n .optional()\n .describe(\n \"Selector for the port you're targeting, not required if you're inside a trace\",\n ),\n order: z.number().optional(),\n offset: route_hint_point.or(routeHintPointProps).optional(),\n offsets: z\n .array(route_hint_point)\n .or(z.array(routeHintPointProps))\n .optional(),\n traceWidth: z.number().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\nexport const fabricationNoteTextProps = 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: length.optional(),\n})\nexport type FabricationNoteTextProps = z.input<typeof fabricationNoteTextProps>\n\nexport const fabricationNotePathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>\n","import type { TypeEqual } from \"ts-expect\"\n\nexport const expectTypesMatch = <const T1, const T2>(\n shouldBe: TypeEqual<T1, T2>,\n): void => {}\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nexport const direction = z.enum([\"up\", \"down\", \"left\", \"right\"])\nexport type Direction = \"up\" | \"down\" | \"left\" | \"right\"\n\nexport type DirectionAlongEdge =\n | \"top-to-bottom\"\n | \"left-to-right\"\n | \"bottom-to-top\"\n | \"right-to-left\"\n\nexport const directionAlongEdge = z.enum([\n \"top-to-bottom\",\n \"left-to-right\",\n \"bottom-to-top\",\n \"right-to-left\",\n])\n\nexpectTypesMatch<Direction, z.infer<typeof direction>>(true)\nexpectTypesMatch<DirectionAlongEdge, z.infer<typeof directionAlongEdge>>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const portHints = z.array(z.string().or(z.number()))\nexport type PortHints = (string | number)[]\n\nexpectTypesMatch<PortHints, z.infer<typeof portHints>>(true)\n","import { z } from \"zod\"\nimport {\n type AnySoupElementInput,\n distance,\n layer_ref,\n type LayerRef,\n type LayerRefInput,\n rotation,\n supplier_name,\n} from \"@tscircuit/soup\"\nimport { point3 } from \"./point3\"\nimport {\n cadModelJscad,\n cadModelObj,\n cadModelProp,\n cadModelStl,\n type CadModelJscad,\n type CadModelObj,\n type CadModelProp,\n type CadModelStl,\n} from \"./cadModel\"\nimport { footprintProp, type Footprint } from \"./footprintProp\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const pcbLayoutProps = z.object({\n pcbX: distance,\n pcbY: distance,\n pcbRotation: rotation.optional(),\n layer: layer_ref.optional(),\n})\n\nexport interface CommonLayoutProps {\n pcbX?: string | number\n pcbY?: string | number\n pcbRotation?: string | number\n\n schX?: string | number\n schY?: string | number\n schRotation?: string | number\n\n layer?: LayerRefInput\n footprint?: Footprint\n}\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 footprint: footprintProp.optional(),\n})\n\ntype InferredCommonLayoutProps = z.input<typeof commonLayoutProps>\nexpectTypesMatch<CommonLayoutProps, InferredCommonLayoutProps>(true)\n\nexport type SupplierName =\n | \"jlcpcb\"\n | \"macrofab\"\n | \"pcbway\"\n | \"digikey\"\n | \"mouser\"\n | \"lcsc\"\nexport interface SupplierProps {\n supplierPartNumbers?: { [k in SupplierName]?: string[] }\n}\nexport const supplierProps = z.object({\n supplierPartNumbers: z.record(supplier_name, z.array(z.string())).optional(),\n})\n\nexpectTypesMatch<SupplierProps, z.input<typeof supplierProps>>(true)\n\nexport interface CommonComponentProps extends CommonLayoutProps {\n name: string\n supplierPartNumbers?: SupplierProps[\"supplierPartNumbers\"]\n cadModel?: CadModelProp\n children?: any\n symbolName?: string\n}\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n name: z.string(),\n cadModel: cadModelProp.optional(),\n children: z.any().optional(),\n symbolName: z.string().optional(),\n })\n\ntype InferredCommonComponentProps = z.input<typeof commonComponentProps>\nexpectTypesMatch<CommonComponentProps, InferredCommonComponentProps>(true)\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 distanceOrMultiplier = distance.or(z.enum([\"2x\", \"3x\", \"4x\"]))\n","import { distance } from \"@tscircuit/soup\"\nimport { z } from \"zod\"\n\nexport const point3 = z.object({\n x: distance,\n y: distance,\n z: distance,\n})\n","import { z } from \"zod\"\nimport { point3 } from \"./point3\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const rotationPoint3 = z.object({\n x: z.union([z.number(), z.string()]),\n y: z.union([z.number(), z.string()]),\n z: z.union([z.number(), z.string()]),\n})\n\nexport interface CadModelBase {\n rotationOffset?:\n | number\n | { x: number | string; y: number | string; z: number | string }\n positionOffset?: {\n x: number | string\n y: number | string\n z: number | string\n }\n size?: { x: number | string; y: number | string; z: number | string }\n}\n\nexport const cadModelBase = z.object({\n rotationOffset: z.number().or(rotationPoint3).optional(),\n positionOffset: point3.optional(),\n size: point3.optional(),\n})\n\nexpectTypesMatch<CadModelBase, z.input<typeof cadModelBase>>(true)\n\nexport interface CadModelStl extends CadModelBase {\n stlUrl: string\n}\nexport const cadModelStl = cadModelBase.extend({\n stlUrl: z.string(),\n})\n\nexport interface CadModelObj extends CadModelBase {\n objUrl: string\n mtlUrl?: string\n}\nexport const cadModelObj = cadModelBase.extend({\n objUrl: z.string(),\n mtlUrl: z.string().optional(),\n})\n\nexport interface CadModelJscad extends CadModelBase {\n jscad: Record<string, any>\n}\nexport const cadModelJscad = cadModelBase.extend({\n jscad: z.record(z.any()),\n})\n\nexport type CadModelProp = string | CadModelStl | CadModelObj | CadModelJscad\n\nexport const cadModelProp = z.union([\n z.string(),\n cadModelStl,\n cadModelObj,\n cadModelJscad,\n])\n\ntype InferredCadModelProp = z.input<typeof cadModelProp>\nexpectTypesMatch<CadModelProp, InferredCadModelProp>(true)\n","import type { LayerRef } from \"@tscircuit/soup\"\nimport type { ReactElement } from \"react\"\nimport { z } from \"zod\"\n\n/**\n * This is an abbreviated definition of the soup elements that you can find here:\n * https://docs.tscircuit.com/api-reference/advanced/soup#pcb-smtpad\n */\nexport type FootprintSoupElements = {\n type: \"pcb_smtpad\" | \"pcb_plated_hole\"\n x: string | number\n y: string | number\n layer?: LayerRef\n holeDiameter?: string | number\n outerDiameter?: string | number\n shape?: \"circle\" | \"rect\"\n width?: string | number\n height?: string | number\n portHints?: string[]\n}\n\nexport type Footprint = string | ReactElement | FootprintSoupElements[]\nexport const footprintProp = z.custom<Footprint>((v) => true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\n/**\n * @deprecated Use SchematicPortArrangementWithPinCounts instead.\n */\nexport interface SchematicPortArrangementWithSizes {\n leftSize?: number\n topSize?: number\n rightSize?: number\n bottomSize?: number\n}\n\n/**\n * Specifies the number of pins on each side of the schematic box component.\n */\nexport interface SchematicPortArrangementWithPinCounts {\n leftPinCount?: number\n topPinCount?: number\n rightPinCount?: number\n bottomPinCount?: number\n}\n\nexport interface PinSideDefinition {\n pins: number[]\n direction:\n | \"top-to-bottom\"\n | \"left-to-right\"\n | \"bottom-to-top\"\n | \"right-to-left\"\n}\n\nexport interface SchematicPortArrangementWithSides {\n leftSide?: PinSideDefinition\n topSide?: PinSideDefinition\n rightSide?: PinSideDefinition\n bottomSide?: PinSideDefinition\n}\n\nexport type SchematicPortArrangement =\n | SchematicPortArrangementWithSizes\n | SchematicPortArrangementWithSides\n | SchematicPortArrangementWithPinCounts\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 const schematicPortArrangement = z\n .object({\n leftSize: z.number().optional().describe(\"@deprecated, use leftPinCount\"),\n topSize: z.number().optional().describe(\"@deprecated, use topPinCount\"),\n rightSize: z.number().optional().describe(\"@deprecated, use rightPinCount\"),\n bottomSize: z\n .number()\n .optional()\n .describe(\"@deprecated, use bottomPinCount\"),\n })\n .or(\n z.object({\n leftPinCount: z.number().optional(),\n rightPinCount: z.number().optional(),\n topPinCount: z.number().optional(),\n bottomPinCount: z.number().optional(),\n }),\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\nexpectTypesMatch<\n SchematicPortArrangement,\n z.input<typeof schematicPortArrangement>\n>(true)\n","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport { point, type Point } from \"lib/common/point\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface BoardProps {\n width?: number | string\n height?: number | string\n outline?: Point[]\n pcbX?: number | string\n pcbY?: number | string\n layout?: any\n routingDisabled?: boolean\n children?: any\n}\n\nexport const boardProps = z.object({\n width: distance.optional(),\n height: distance.optional(),\n outline: z.array(point).optional(),\n pcbX: distance.optional().default(0),\n pcbY: distance.optional().default(0),\n layout: z.any().optional(),\n routingDisabled: z.boolean().optional(),\n children: z.any(),\n})\n\nexpectTypesMatch<BoardProps, z.input<typeof boardProps>>(true)\n","import { distance } from \"@tscircuit/soup\"\nimport { z } from \"zod\"\n\nexport const point = z.object({\n x: distance,\n y: distance,\n})\n\nexport type Point = { x: number | string; y: number | string }\n","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport { commonComponentProps } from \"lib/common/layout\"\nimport { schematicPortArrangement } from \"lib/common/schematicPinDefinitions\"\nimport { schematicPinStyle } from \"lib/common/schematicPinStyle\"\n\nexport const chipProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z.record(z.number().or(z.string()), z.string()).optional(),\n\n schPortArrangement: schematicPortArrangement.optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n})\n\nexport type SchematicPinStyle = {\n leftMargin?: number | string\n rightMargin?: number | string\n topMargin?: number | string\n bottomMargin?: number | string\n}\nexport type SchematicPinStyles = Record<string, SchematicPinStyle>\n\n/**\n * @deprecated Use ChipProps instead.\n */\nexport const bugProps = chipProps\nexport type ChipProps = z.input<typeof chipProps>\n","import { z } from \"zod\"\nimport { distance } from \"@tscircuit/soup\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport type SchematicPinStyle = Record<\n string,\n {\n leftMargin?: number | string\n rightMargin?: number | string\n topMargin?: number | string\n bottomMargin?: number | string\n }\n>\n\nexport const schematicPinStyle = z.record(\n z.object({\n leftMargin: distance.optional(),\n rightMargin: distance.optional(),\n topMargin: distance.optional(),\n bottomMargin: distance.optional(),\n }),\n)\n\nexpectTypesMatch<SchematicPinStyle, z.input<typeof schematicPinStyle>>(true)\n","import { z } from \"zod\"\nimport {\n commonComponentProps,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicPinStyle,\n type SchematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { distance } from \"@tscircuit/soup\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport {\n schematicPortArrangement,\n type SchematicPortArrangement,\n} from \"lib/common/schematicPinDefinitions\"\n\nexport interface JumperProps extends CommonComponentProps {\n manufacturerPartNumber?: string\n pinLabels?: Record<number | string, string>\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: number | string\n schWidth?: number | string\n schHeight?: number | string\n schDirection?: \"left\" | \"right\"\n schPortArrangement?: SchematicPortArrangement\n}\n\nexport const jumperProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z.record(z.number().or(z.string()), z.string()).optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n schDirection: z.enum([\"left\", \"right\"]).optional(),\n schPortArrangement: schematicPortArrangement.optional(),\n})\n\ntype InferredJumperProps = z.input<typeof jumperProps>\nexpectTypesMatch<JumperProps, InferredJumperProps>(true)\n","import { z } from \"zod\"\nimport { resistance } from \"@tscircuit/soup\"\nimport {\n commonComponentProps,\n lrPins,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface ResistorProps extends CommonComponentProps {\n resistance: number | string\n pullupFor?: string\n pullupTo?: string\n pulldownFor?: string\n pulldownTo?: string\n}\n\nexport const resistorProps = commonComponentProps.extend({\n resistance,\n\n pullupFor: z.string().optional(),\n pullupTo: z.string().optional(),\n\n pulldownFor: z.string().optional(),\n pulldownTo: z.string().optional(),\n})\nexport const resistorPins = lrPins\n\ntype InferredResistorProps = z.input<typeof resistorProps>\nexpectTypesMatch<ResistorProps, InferredResistorProps>(true)\n","import { z } from \"zod\"\nimport { capacitance } from \"@tscircuit/soup\"\nimport {\n commonComponentProps,\n lrPins,\n lrPolarPins,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface CapacitorProps extends CommonComponentProps {\n capacitance: number | string\n\n decouplingFor?: string\n decouplingTo?: string\n\n bypassFor?: string\n bypassTo?: string\n}\n\nexport const capacitorProps = commonComponentProps.extend({\n capacitance,\n\n decouplingFor: z.string().optional(),\n decouplingTo: z.string().optional(),\n\n bypassFor: z.string().optional(),\n bypassTo: z.string().optional(),\n})\nexport const capacitorPins = lrPolarPins\n\nexpectTypesMatch<CapacitorProps, z.input<typeof capacitorProps>>(true)\n","import { z } from \"zod\"\nimport { commonLayoutProps, type CommonLayoutProps } from \"lib/common/layout\"\nimport type { LayoutBuilder } from \"@tscircuit/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface GroupProps extends CommonLayoutProps {\n name?: string\n layout?: LayoutBuilder\n children?: any\n routingDisabled?: boolean\n}\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 routingDisabled: z.boolean().optional(),\n})\n\nexport type InferredGroupProps = z.input<typeof groupProps>\nexpectTypesMatch<GroupProps, InferredGroupProps>(true)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAAA;AAAA,EAAA;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;AASA,IAAAC,gBAeO;AAEP,IAAAC,eAAkB;;;ACxBX,IAAM,mBAAmB,CAC9B,aACS;AAAC;;;ACHZ,iBAAkB;AACX,I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AA,EACrC,KAAK,eACF,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,eAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,QAAQ,+BAAiB,GAAG,mBAAmB,EAAE,SAAS;AAAA,EAC1D,SAAS,eACN,MAAM,8BAAgB,EACtB,GAAG,eAAE,MAAM,mBAAmB,CAAC,EAC/B,SAAS;AAAA,EACZ,YAAY,eAAE,OAAO,EAAE,SAAS;AAClC,CAAC;AAIM,IAAM,gBAAgB,eAAE,OAAO;AAAA,EACpC,OAAO,eAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,WAAW,uBAAS,SAAS;AAAA,EAC7B,OAAO,eAAE,MAAM,8BAAgB;AACjC,CAAC;AAGM,IAAM,2BAA2B,eAAe,OAAO;AAAA,EAC5D,MAAM,eAAE,OAAO;AAAA,EACf,iBAAiB,eACd,KAAK,CAAC,UAAU,YAAY,aAAa,eAAe,cAAc,CAAC,EACvE,QAAQ,QAAQ;AAAA,EACnB,MAAM,eAAE,KAAK,CAAC,eAAe,CAAC,EAAE,SAAS;AAAA,EACzC,UAAU,qBAAO,SAAS;AAC5B,CAAC;AAGM,IAAM,2BAA2B,eACrC,KAAK,EAAE,MAAM,MAAM,MAAM,MAAM,aAAa,KAAK,CAAC,EAClD,OAAO;AAAA,EACN,OAAO,eAAE,MAAM,8BAAgB;AAAA,EAC/B,aAAa,qBAAO,SAAS;AAC/B,CAAC;","names":["distanceOrMultiplier","import_soup","import_zod","import_zod","import_zod","import_soup","import_zod","import_zod","import_zod","import_zod","import_zod","import_soup","import_soup","import_zod","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","import_zod","import_soup","import_zod","distanceOrMultiplier"]}
|
|
@@ -1,5 +1,47 @@
|
|
|
1
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
1
2
|
import { z } from "zod"
|
|
2
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use SchematicPortArrangementWithPinCounts instead.
|
|
6
|
+
*/
|
|
7
|
+
export interface SchematicPortArrangementWithSizes {
|
|
8
|
+
leftSize?: number
|
|
9
|
+
topSize?: number
|
|
10
|
+
rightSize?: number
|
|
11
|
+
bottomSize?: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Specifies the number of pins on each side of the schematic box component.
|
|
16
|
+
*/
|
|
17
|
+
export interface SchematicPortArrangementWithPinCounts {
|
|
18
|
+
leftPinCount?: number
|
|
19
|
+
topPinCount?: number
|
|
20
|
+
rightPinCount?: number
|
|
21
|
+
bottomPinCount?: number
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface PinSideDefinition {
|
|
25
|
+
pins: number[]
|
|
26
|
+
direction:
|
|
27
|
+
| "top-to-bottom"
|
|
28
|
+
| "left-to-right"
|
|
29
|
+
| "bottom-to-top"
|
|
30
|
+
| "right-to-left"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface SchematicPortArrangementWithSides {
|
|
34
|
+
leftSide?: PinSideDefinition
|
|
35
|
+
topSide?: PinSideDefinition
|
|
36
|
+
rightSide?: PinSideDefinition
|
|
37
|
+
bottomSide?: PinSideDefinition
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type SchematicPortArrangement =
|
|
41
|
+
| SchematicPortArrangementWithSizes
|
|
42
|
+
| SchematicPortArrangementWithSides
|
|
43
|
+
| SchematicPortArrangementWithPinCounts
|
|
44
|
+
|
|
3
45
|
export const explicitPinSideDefinition = z.object({
|
|
4
46
|
pins: z.array(z.number()),
|
|
5
47
|
direction: z.union([
|
|
@@ -36,3 +78,8 @@ export const schematicPortArrangement = z
|
|
|
36
78
|
bottomSide: explicitPinSideDefinition.optional(),
|
|
37
79
|
}),
|
|
38
80
|
)
|
|
81
|
+
|
|
82
|
+
expectTypesMatch<
|
|
83
|
+
SchematicPortArrangement,
|
|
84
|
+
z.input<typeof schematicPortArrangement>
|
|
85
|
+
>(true)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod"
|
|
2
|
+
import { commonLayoutProps, type CommonLayoutProps } from "lib/common/layout"
|
|
3
|
+
import type { LayoutBuilder } from "@tscircuit/layout"
|
|
4
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
5
|
+
|
|
6
|
+
export interface GroupProps extends CommonLayoutProps {
|
|
7
|
+
name?: string
|
|
8
|
+
layout?: LayoutBuilder
|
|
9
|
+
children?: any
|
|
10
|
+
routingDisabled?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const groupProps = commonLayoutProps.extend({
|
|
14
|
+
name: z.string().optional(),
|
|
15
|
+
layout: z.custom<LayoutBuilder>((v) => true).optional(),
|
|
16
|
+
children: z.any().optional(),
|
|
17
|
+
routingDisabled: z.boolean().optional(),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
export type InferredGroupProps = z.input<typeof groupProps>
|
|
21
|
+
expectTypesMatch<GroupProps, InferredGroupProps>(true)
|
package/lib/components/jumper.ts
CHANGED
|
@@ -9,6 +9,10 @@ import {
|
|
|
9
9
|
} from "lib/common/schematicPinStyle"
|
|
10
10
|
import { distance } from "@tscircuit/soup"
|
|
11
11
|
import { expectTypesMatch } from "lib/typecheck"
|
|
12
|
+
import {
|
|
13
|
+
schematicPortArrangement,
|
|
14
|
+
type SchematicPortArrangement,
|
|
15
|
+
} from "lib/common/schematicPinDefinitions"
|
|
12
16
|
|
|
13
17
|
export interface JumperProps extends CommonComponentProps {
|
|
14
18
|
manufacturerPartNumber?: string
|
|
@@ -17,6 +21,8 @@ export interface JumperProps extends CommonComponentProps {
|
|
|
17
21
|
schPinSpacing?: number | string
|
|
18
22
|
schWidth?: number | string
|
|
19
23
|
schHeight?: number | string
|
|
24
|
+
schDirection?: "left" | "right"
|
|
25
|
+
schPortArrangement?: SchematicPortArrangement
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
export const jumperProps = commonComponentProps.extend({
|
|
@@ -26,6 +32,8 @@ export const jumperProps = commonComponentProps.extend({
|
|
|
26
32
|
schPinSpacing: distance.optional(),
|
|
27
33
|
schWidth: distance.optional(),
|
|
28
34
|
schHeight: distance.optional(),
|
|
35
|
+
schDirection: z.enum(["left", "right"]).optional(),
|
|
36
|
+
schPortArrangement: schematicPortArrangement.optional(),
|
|
29
37
|
})
|
|
30
38
|
|
|
31
39
|
type InferredJumperProps = z.input<typeof jumperProps>
|
package/lib/index.ts
CHANGED
|
@@ -50,7 +50,7 @@ export * from "./components/jumper"
|
|
|
50
50
|
|
|
51
51
|
export * from "./components/resistor"
|
|
52
52
|
export * from "./components/capacitor"
|
|
53
|
-
|
|
53
|
+
export * from "./components/group"
|
|
54
54
|
export const inductorProps = commonComponentProps.extend({
|
|
55
55
|
inductance,
|
|
56
56
|
})
|
|
@@ -207,14 +207,6 @@ export type FootprintProps = z.input<typeof footprintProps>
|
|
|
207
207
|
export const componentProps = commonComponentProps
|
|
208
208
|
export type ComponentProps = z.input<typeof componentProps>
|
|
209
209
|
|
|
210
|
-
export const groupProps = commonLayoutProps.extend({
|
|
211
|
-
name: z.string().optional(),
|
|
212
|
-
layout: z.custom<LayoutBuilder>((v) => true).optional(),
|
|
213
|
-
children: z.any().optional(),
|
|
214
|
-
routingDisabled: z.boolean().optional(),
|
|
215
|
-
})
|
|
216
|
-
export type GroupProps = z.input<typeof groupProps>
|
|
217
|
-
|
|
218
210
|
export const powerSourceProps = commonComponentProps.extend({
|
|
219
211
|
voltage,
|
|
220
212
|
})
|