jscad-electronics 0.0.148 → 0.0.150

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 CHANGED
@@ -96,7 +96,7 @@ declare const ExtrudedPads: ({ circuitJson, footprint, }: {
96
96
  declare const FootprintPad: ({ pad, isPin1, }: {
97
97
  pad: PcbSmtPad;
98
98
  isPin1?: boolean;
99
- }) => react_jsx_runtime.JSX.Element;
99
+ }) => react_jsx_runtime.JSX.Element | null;
100
100
 
101
101
  declare const FootprintPlatedHole: ({ hole, isPin1, }: {
102
102
  hole: PcbPlatedHole;
@@ -334,7 +334,26 @@ declare const SOD123F: () => react_jsx_runtime.JSX.Element;
334
334
 
335
335
  declare const SOD123FL: () => react_jsx_runtime.JSX.Element;
336
336
 
337
- declare const SOD123W: () => react_jsx_runtime.JSX.Element;
337
+ interface SOD123WProps {
338
+ /** Body extent along the leads (X). */
339
+ bodyWidth?: number;
340
+ /** Body extent across the leads (Y). */
341
+ bodyLength?: number;
342
+ bodyHeight?: number;
343
+ }
344
+ /**
345
+ * SOD-123W.
346
+ *
347
+ * Defaults are the package outline for that designation — 2.60 x 1.70, per
348
+ * KiCad's `Nexperia_CFP3_SOD-123W` F.Fab layer, which is the same reference
349
+ * footprinter's own kicad-parity tests compare against.
350
+ *
351
+ * The dimensions are props because the shape (a moulded body with a metal cap
352
+ * at each end) serves several designations at different sizes; the SIZE is
353
+ * what makes it one package or another, so it must never be assumed. `sod110`
354
+ * used these defaults for a while and rendered a body 24% too long.
355
+ */
356
+ declare const SOD123W: ({ bodyWidth, bodyLength, bodyHeight, }?: SOD123WProps) => react_jsx_runtime.JSX.Element;
338
357
 
339
358
  declare const SOD128: () => react_jsx_runtime.JSX.Element;
340
359
 
@@ -346,7 +365,29 @@ declare const SOD323FL: () => react_jsx_runtime.JSX.Element;
346
365
 
347
366
  declare const SOD923: () => react_jsx_runtime.JSX.Element;
348
367
 
349
- declare const SOT223: () => react_jsx_runtime.JSX.Element;
368
+ interface SOT223Props {
369
+ /** Pad-to-pad span across the leads (X). */
370
+ fullWidth?: number;
371
+ /** X extent of the moulded body. */
372
+ bodyWidth?: number;
373
+ /** Y extent of the moulded body. */
374
+ bodyLength?: number;
375
+ bodyHeight?: number;
376
+ /** Y width of the three signal leads. */
377
+ leadWidth?: number;
378
+ /** Y width of the single wide tab lead on the opposite side. */
379
+ tabLeadWidth?: number;
380
+ /** Y pitch of the signal leads. */
381
+ padPitch?: number;
382
+ /** How high the lead rises from the pad to the body face. */
383
+ leadHeight?: number;
384
+ }
385
+ /**
386
+ * SOT-223 and its smaller relative SOT-89: three leads one side, one wide tab
387
+ * lead the other. Same construction, different dimensions, so the dimensions
388
+ * are props — SOT-89's body is 4.5 x 2.5 x 1.5, barely a third of the volume.
389
+ */
390
+ declare const SOT223: ({ fullWidth, bodyWidth, bodyLength, bodyHeight, leadWidth, tabLeadWidth, padPitch, leadHeight, }?: SOT223Props) => react_jsx_runtime.JSX.Element;
350
391
 
351
392
  declare const SOT457: () => react_jsx_runtime.JSX.Element;
352
393
 
@@ -419,9 +460,94 @@ declare const MS013: ({ pinCount, padContactLength, leadWidth, pitch, }: {
419
460
  padContactLength?: number;
420
461
  }) => react_jsx_runtime.JSX.Element;
421
462
 
422
- declare const TO220: () => react_jsx_runtime.JSX.Element;
463
+ interface TO220Lead {
464
+ x: number;
465
+ y: number;
466
+ }
467
+ interface TO220Props {
468
+ /**
469
+ * TO-220F is the fully-moulded (isolated) variant: same outline, but the
470
+ * metal tab is encapsulated rather than exposed. Aliasing the two would
471
+ * report a bare metal face where there is plastic — which matters as soon
472
+ * as anything reasons about the tab, so it is a flag rather than an alias.
473
+ */
474
+ mouldedTab?: boolean;
475
+ /** Where the leads meet the board, from the footprint's plated holes. */
476
+ leads?: TO220Lead[];
477
+ /** Width across the package (X). */
478
+ bodyWidth?: number;
479
+ /** Thickness of the moulded body (Y). */
480
+ bodyThickness?: number;
481
+ /** Height of the moulded body above its own base. */
482
+ bodyHeight?: number;
483
+ /** How much metal tab stands above the moulded body. */
484
+ tabHeight?: number;
485
+ tabThickness?: number;
486
+ mountingHoleDiameter?: number;
487
+ /** Gap between the board and the underside of the body. */
488
+ standoff?: number;
489
+ /** How far the leads run below the board. */
490
+ leadLength?: number;
491
+ bodyColor?: string;
492
+ tabColor?: string;
493
+ leadColor?: string;
494
+ }
495
+ /**
496
+ * TO-220, mounted upright.
497
+ *
498
+ * Authored standing up, in board coordinates, rather than lying down and
499
+ * rotated into place. The rotations it used to carry were bare numbers
500
+ * (`rotation={[0, 55, -55]}`), which both renderers read as RADIANS: 55 rad is
501
+ * 271.3°, so the part stood up only because 271.3° is nearly -90°, and it
502
+ * leaned 1.3° off vertical. With 16mm leads it also measured 32.5mm tall for a
503
+ * part that is 18mm over the board, and the holes met the leads at their tips
504
+ * instead of just under the body.
505
+ */
506
+ declare const TO220: ({ mouldedTab, leads, bodyWidth, bodyThickness, bodyHeight, tabHeight, tabThickness, mountingHoleDiameter, standoff, leadLength, bodyColor, tabColor, leadColor, }?: TO220Props) => react_jsx_runtime.JSX.Element;
423
507
 
424
- declare const TO92: () => react_jsx_runtime.JSX.Element;
508
+ interface TO92Lead {
509
+ x: number;
510
+ y: number;
511
+ }
512
+ interface TO92Props {
513
+ /**
514
+ * Diameter of the round body. TO-92 comes in more than one size — `to92l`
515
+ * is 4.8mm across, `to92s` 2.5mm — and the difference is the whole reason
516
+ * these are separate footprints, so it must not be baked in.
517
+ */
518
+ bodyDiameter?: number;
519
+ bodyHeight?: number;
520
+ /** Depth of the flat cut across the cylinder. */
521
+ flatCut?: number;
522
+ /**
523
+ * Where the leads meet the board, taken from the footprint's plated holes.
524
+ *
525
+ * The pattern differs per footprint and cannot be inferred from the pitch:
526
+ * `to92` sets its middle pin 1.27mm behind the outer two, `to92s` puts all
527
+ * three in a row, and `to92l` places pin 1 at the origin so the group is not
528
+ * centred at all. Defaults to `to92`'s pattern.
529
+ */
530
+ leads?: TO92Lead[];
531
+ /**
532
+ * Gap between the board and the underside of the moulded body — the leads
533
+ * are formed in it.
534
+ */
535
+ standoff?: number;
536
+ /** How far the leads run below the board. */
537
+ leadLength?: number;
538
+ bodyColor?: string;
539
+ }
540
+ /**
541
+ * TO-92.
542
+ *
543
+ * Seated and aligned from the footprint: the body is centred on the two outer
544
+ * leads, starts `standoff` above the board and ends `bodyHeight` higher, and
545
+ * every lead is formed from its own hole up to a row of exit points under the
546
+ * body. It used to be translated 10.5mm up with 15mm leads on a hardcoded
547
+ * pattern, which measured 19.5mm end to end for a 4.5mm part and only lined up
548
+ * with one of the three TO-92 footprints.
549
+ */
550
+ declare const TO92: ({ bodyDiameter, bodyHeight, flatCut, leads, standoff, leadLength, bodyColor, }?: TO92Props) => react_jsx_runtime.JSX.Element;
425
551
 
426
552
  declare const MountedPcbModule: ({ numPins, rows, p, id, od, boardThickness, width, height, pinRowSide, holes, holeInset, pinRowHoleEdgeToEdgeDist, female, nopin, screen, screenWidth, screenHeight, screenCenterOffsetX, screenCenterOffsetY, }: {
427
553
  numPins?: number;
@@ -540,4 +666,215 @@ interface RJ45Props {
540
666
  */
541
667
  declare const RJ45: ({ bodyWidth, bodyDepth, bodyHeight, bodyCenterY, ledPins, firstPinLeft, firstPinTop, signalPitch, signalRowPitch, signalHoleDiameter, shieldPinX, shieldPinY, shieldHoleDiameter, locatorHoleX, locatorHoleY, locatorHoleDiameter, ledPinX, ledPinPitch, ledPinY, openingDirection, shellColor, housingColor, contactColor, }: RJ45Props) => react_jsx_runtime.JSX.Element;
542
668
 
543
- export { A01005, A0201, A0402, A0603, A0805, A1206, A1210, A2010, A2512, AxialCapacitor, BGA, ChipBody, type ChipBodyProps, Crystal, type CrystalProps, DFN, Display, ExtrudedPads, FPC, type FPCProps, FemaleHeader, FemaleHeaderRow, FootprintPad, FootprintPlatedHole, Footprinter3d, HC49, type HC49Props, JSTZH1_5mm, LQFP, Led5050, type Led5050Props, MELF, type MELFProps, MINIMELF, type MINIMELFProps, MS012, MS013, MSOP, MicroMELF, type MicroMELFProps, MountedPcbModule, PinHeader, PinRow, QFN, QFP, RJ45, type RJ45Props, SMA, SMB, SMC, SMF, SOD123, SOD123F, SOD123FL, type SOD123Props, SOD123W, SOD128, SOD323, SOD323F, SOD323FL, SOD523, SOD723, SOD882, SOD923, SOT223, SOT233P, SOT23W, SOT323, SOT363, SOT457, SOT563, SOT723, SOT886, SOT963, Screen, type ScreenProps, SmdChipLead, type SmdChipLeadProps, SmdPinHeader, type SmdPinHeaderProps, StampBoard, TO220, TO92, TQFP, Tssop, VSSOP };
669
+ interface DPAKProps {
670
+ /** X extent of the moulded body (the lead-to-tab axis) */
671
+ bodyWidth?: number;
672
+ /** Y extent of the moulded body (across the leads) */
673
+ bodyLength?: number;
674
+ /** Height of the moulded body above the board */
675
+ bodyHeight?: number;
676
+ /** X extent of the exposed metal tab (the drain/collector pad) */
677
+ tabWidth?: number;
678
+ /** Y extent of the exposed metal tab */
679
+ tabLength?: number;
680
+ /** Distance between the lead pad centres and the tab pad centre */
681
+ span?: number;
682
+ /** Lead pitch along Y */
683
+ pitch?: number;
684
+ /** Y width of one lead */
685
+ leadWidth?: number;
686
+ /** X length of the lead's flat pad contact */
687
+ leadContactLength?: number;
688
+ /**
689
+ * TO-252 (DPAK) and TO-263 (D2PAK) differ only in size, so one body serves
690
+ * both — pass the dimensions footprinter reports for the specific package.
691
+ */
692
+ color?: string;
693
+ tabColor?: string;
694
+ leadColor?: string;
695
+ }
696
+ /**
697
+ * TO-252 (DPAK) / TO-263 (D2PAK): a moulded body sitting on a large exposed
698
+ * metal tab, with gull leads leaving the opposite face.
699
+ *
700
+ * The footprint is asymmetric — footprinter puts the lead pads at -span/2 and
701
+ * the tab pad at +span/2 — so the body is placed over the tab rather than over
702
+ * the origin. Getting that wrong moves a 4.4mm-tall part several millimetres,
703
+ * which is exactly the error an enclosure clearance check cannot see.
704
+ */
705
+ declare const DPAK: ({ bodyWidth, bodyLength, bodyHeight, tabWidth, tabLength, span, pitch, leadWidth, leadContactLength, color, tabColor, leadColor, }: DPAKProps) => react_jsx_runtime.JSX.Element;
706
+
707
+ interface ElectrolyticCapacitorProps {
708
+ /** Can diameter. footprinter reports this as `d` for `electrolytic`. */
709
+ diameter?: number;
710
+ /**
711
+ * Can height. Not part of any footprint: the same 10mm can is made in a
712
+ * dozen heights. Defaults to `heightToDiameterRatio * diameter`, which for
713
+ * the common radial series is a slight OVER-estimate — for a clearance
714
+ * check that is the safe direction to be wrong in.
715
+ */
716
+ height?: number;
717
+ heightToDiameterRatio?: number;
718
+ /** Lead pitch (footprinter's `p`). */
719
+ leadPitch?: number;
720
+ leadDiameter?: number;
721
+ /** How far the leads run below the board. */
722
+ leadLength?: number;
723
+ sleeveColor?: string;
724
+ baseColor?: string;
725
+ }
726
+ /**
727
+ * Radial (can) electrolytic capacitor: the part an enclosure cavity is usually
728
+ * sized around, and until now one with no body at all.
729
+ *
730
+ * Only the diameter and the lead pitch come from the footprint. The height is
731
+ * derived, and deliberately generous — see `heightToDiameterRatio`.
732
+ */
733
+ declare const ElectrolyticCapacitor: ({ diameter, heightToDiameterRatio, height, leadPitch, leadDiameter, leadLength, sleeveColor, baseColor, }: ElectrolyticCapacitorProps) => react_jsx_runtime.JSX.Element;
734
+
735
+ interface Led2835Props {
736
+ /** X extent of the package (footprinter reports 3.5 for `led2835`). */
737
+ bodyWidth?: number;
738
+ /** Y extent of the package. */
739
+ bodyLength?: number;
740
+ bodyHeight?: number;
741
+ /** Emitter colour when lit — the lens square on the top face. */
742
+ color?: string;
743
+ bodyColor?: string;
744
+ padColor?: string;
745
+ /** Pad centres and widths, so the terminals line up with the footprint. */
746
+ pad1X?: number;
747
+ pad1Width?: number;
748
+ pad2X?: number;
749
+ pad2Width?: number;
750
+ padLength?: number;
751
+ }
752
+ /**
753
+ * 2835 chip LED: a flat rectangular package with an emitter window, unlike the
754
+ * symmetric two-terminal chips (0805 etc.) whose pads are mirrored — footprinter
755
+ * gives `led2835` two DIFFERENT pad widths at two different offsets, so the body
756
+ * is not centred on the pads.
757
+ */
758
+ declare const Led2835: ({ bodyWidth, bodyLength, bodyHeight, color, bodyColor, padColor, pad1X, pad1Width, pad2X, pad2Width, padLength, }?: Led2835Props) => react_jsx_runtime.JSX.Element;
759
+
760
+ interface PotentiometerLead {
761
+ x: number;
762
+ y: number;
763
+ }
764
+ interface PotentiometerProps {
765
+ /** X extent of the body (footprinter's `w`). */
766
+ bodyWidth?: number;
767
+ /** Y extent of the body (footprinter's `ca`). */
768
+ bodyLength?: number;
769
+ /** Height of the body above the board (footprinter's `h`). */
770
+ bodyHeight?: number;
771
+ /** X offset of the body centre from the footprint origin. */
772
+ bodyCenterX?: number;
773
+ /** Diameter of the adjuster on the top face. */
774
+ adjusterDiameter?: number;
775
+ /**
776
+ * A panel-mount pot's shaft. Zero by default and on purpose: the footprint
777
+ * carries no shaft dimension, and inventing one would make an enclosure
778
+ * cut a hole for a part that has no shaft, or clear a volume it does not
779
+ * need. Pass it explicitly for a panel pot.
780
+ */
781
+ shaftDiameter?: number;
782
+ shaftHeight?: number;
783
+ /**
784
+ * Where the pins meet the board, from the footprint's plated holes. A
785
+ * through-hole part with no pins at all is not a body anyone can check
786
+ * against its footprint — it just floats over three empty holes.
787
+ */
788
+ leads?: PotentiometerLead[];
789
+ /** Diameter of a pin, and how far it runs below the board. */
790
+ leadDiameter?: number;
791
+ leadLength?: number;
792
+ bodyColor?: string;
793
+ adjusterColor?: string;
794
+ }
795
+ /**
796
+ * Trimmer / potentiometer body.
797
+ *
798
+ * The extent comes from the footprint: `w` across, `ca` along, `h` tall. What
799
+ * the footprint cannot tell us is the shaft, so there is none unless asked
800
+ * for — see `shaftHeight`.
801
+ *
802
+ * Name: `core` also exports a `Potentiometer`, and that one is a circuit
803
+ * element (a React component with ports and a footprint). This is a JSCAD
804
+ * solid with no electrical meaning, and it is named for the package the way
805
+ * every other body in this directory is (`PushButton`, `RJ45`, `Crystal`,
806
+ * which shadow core the same way). Renaming it would break that convention to
807
+ * avoid a collision that cannot occur: nothing imports both.
808
+ */
809
+ declare const Potentiometer: ({ bodyWidth, bodyLength, bodyHeight, bodyCenterX, adjusterDiameter, shaftDiameter, shaftHeight, leads, leadDiameter, leadLength, bodyColor, adjusterColor, }: PotentiometerProps) => react_jsx_runtime.JSX.Element;
810
+
811
+ interface SmdPushButtonProps {
812
+ /** X extent of the moulded body. */
813
+ bodyWidth?: number;
814
+ /** Y extent of the moulded body. */
815
+ bodyLength?: number;
816
+ /** Height of the body above the board. */
817
+ bodyHeight?: number;
818
+ /** Diameter of the actuator on the top face. */
819
+ actuatorDiameter?: number;
820
+ /** How far the actuator stands proud of the body — the real part height. */
821
+ actuatorHeight?: number;
822
+ /** X distance between the pad centres on opposite sides. */
823
+ padSpanX?: number;
824
+ /** Y distance between the two pad rows. */
825
+ padSpanY?: number;
826
+ padWidth?: number;
827
+ padLength?: number;
828
+ bodyColor?: string;
829
+ actuatorColor?: string;
830
+ leadColor?: string;
831
+ }
832
+ /**
833
+ * SMD tactile push button.
834
+ *
835
+ * The body outline is the footprint's silkscreen (2.86 x 3.04 for footprinter's
836
+ * `smdpushbutton`); the height is the switch's, not the footprint's — a
837
+ * footprint cannot describe an actuator. `actuatorHeight` is the part of that
838
+ * height an enclosure lid has to clear or press on, so it is separate from
839
+ * `bodyHeight` rather than folded into it.
840
+ */
841
+ declare const SmdPushButton: ({ bodyWidth, bodyLength, bodyHeight, actuatorDiameter, actuatorHeight, padSpanX, padSpanY, padWidth, padLength, bodyColor, actuatorColor, leadColor, }: SmdPushButtonProps) => react_jsx_runtime.JSX.Element;
842
+
843
+ interface SmdLeadPad {
844
+ x: number;
845
+ y: number;
846
+ width?: number;
847
+ height?: number;
848
+ }
849
+ interface GullWingBodyProps {
850
+ /** X extent of the moulded body. */
851
+ bodyWidth: number;
852
+ /** Y extent of the moulded body. */
853
+ bodyLength: number;
854
+ bodyHeight?: number;
855
+ /** Where each lead meets the board, from the footprint's own pads. */
856
+ pads: SmdLeadPad[];
857
+ leadThickness?: number;
858
+ /** How high the lead rises from the board to the body, as a fraction of the body height. */
859
+ leadHeightRatio?: number;
860
+ }
861
+ /**
862
+ * A small-outline package with gull-wing leads on its left and right faces,
863
+ * one lead per PAD.
864
+ *
865
+ * Two things come from two different places on purpose:
866
+ *
867
+ * - the body is the designation's (`bodyWidth`/`bodyLength` are passed in
868
+ * from the package outline, never derived from the land pattern);
869
+ * - the leads are the footprint's, because lead COUNT is not a property of a
870
+ * body outline. SOT-23-5 and SOT-23-6 share a body; SC-70-4 and SC-70-6
871
+ * share a body. A body picked by outline alone ends up with the wrong
872
+ * number of legs, which is what this component exists to prevent.
873
+ *
874
+ * The leg itself is `SmdChipLead`, the same S-curve every other gull-wing part
875
+ * here uses (SOIC, SOT-235, SOT-223, MSOP, QFP, MS-012). Anything else is a
876
+ * second kind of leg in a repo that already has one.
877
+ */
878
+ declare const GullWingBody: ({ bodyWidth, bodyLength, bodyHeight, pads, leadThickness, leadHeightRatio, }: GullWingBodyProps) => react_jsx_runtime.JSX.Element;
879
+
880
+ export { A01005, A0201, A0402, A0603, A0805, A1206, A1210, A2010, A2512, AxialCapacitor, BGA, ChipBody, type ChipBodyProps, Crystal, type CrystalProps, DFN, DPAK, type DPAKProps, Display, ElectrolyticCapacitor, type ElectrolyticCapacitorProps, ExtrudedPads, FPC, type FPCProps, FemaleHeader, FemaleHeaderRow, FootprintPad, FootprintPlatedHole, Footprinter3d, GullWingBody, type GullWingBodyProps, HC49, type HC49Props, JSTZH1_5mm, LQFP, Led2835, type Led2835Props, Led5050, type Led5050Props, MELF, type MELFProps, MINIMELF, type MINIMELFProps, MS012, MS013, MSOP, MicroMELF, type MicroMELFProps, MountedPcbModule, PinHeader, PinRow, Potentiometer, type PotentiometerLead, type PotentiometerProps, QFN, QFP, RJ45, type RJ45Props, SMA, SMB, SMC, SMF, SOD123, SOD123F, SOD123FL, type SOD123Props, SOD123W, type SOD123WProps, SOD128, SOD323, SOD323F, SOD323FL, SOD523, SOD723, SOD882, SOD923, SOT223, type SOT223Props, SOT233P, SOT23W, SOT323, SOT363, SOT457, SOT563, SOT723, SOT886, SOT963, Screen, type ScreenProps, SmdChipLead, type SmdChipLeadProps, type SmdLeadPad, SmdPinHeader, type SmdPinHeaderProps, SmdPushButton, type SmdPushButtonProps, StampBoard, TO220, type TO220Lead, type TO220Props, TO92, type TO92Lead, type TO92Props, TQFP, Tssop, VSSOP };