@tscircuit/core 0.0.144 → 0.0.146
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 +434 -2
- package/dist/index.js +83 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { PcbTraceError, PcbPlacementError, LayerRef, AnyCircuitElement, AnySourc
|
|
|
6
6
|
import { Matrix } from 'transformation-matrix';
|
|
7
7
|
import { SoupUtilObjects } from '@tscircuit/soup-util';
|
|
8
8
|
import * as _tscircuit_props from '@tscircuit/props';
|
|
9
|
-
import { traceProps, groupProps, boardProps, capacitorProps, chipProps, diodeProps, jumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, holeProps, pcbKeepoutProps, netAliasProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, traceHintProps, viaProps, batteryProps, inductorProps, CapacitorProps, ChipProps, ResistorProps } from '@tscircuit/props';
|
|
9
|
+
import { traceProps, groupProps, boardProps, capacitorProps, chipProps, diodeProps, jumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, holeProps, pcbKeepoutProps, netAliasProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, traceHintProps, viaProps, batteryProps, pinHeaderProps, inductorProps, CapacitorProps, ChipProps, ResistorProps } from '@tscircuit/props';
|
|
10
10
|
import * as _tscircuit_layout from '@tscircuit/layout';
|
|
11
11
|
|
|
12
12
|
declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTraceHintsFromProps", "SourceRender", "SourceParentAttachment", "PortDiscovery", "PortMatching", "SourceTraceRender", "SchematicComponentRender", "SchematicPortRender", "SchematicLayout", "SchematicTraceRender", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbTraceRender", "PcbTraceHintRender", "PcbRouteNetIslands", "PcbComponentSizeCalculation", "CadModelRender"];
|
|
@@ -671,6 +671,7 @@ type PortMap<T extends string> = {
|
|
|
671
671
|
*/
|
|
672
672
|
declare class NormalComponent<ZodProps extends ZodType = any, PortNames extends string = never> extends PrimitiveComponent<ZodProps> {
|
|
673
673
|
reactSubtrees: Array<ReactSubtree>;
|
|
674
|
+
_impliedFootprint?: string | undefined;
|
|
674
675
|
isPrimitiveContainer: boolean;
|
|
675
676
|
constructor(props: z.input<ZodProps>);
|
|
676
677
|
/**
|
|
@@ -688,6 +689,7 @@ declare class NormalComponent<ZodProps extends ZodType = any, PortNames extends
|
|
|
688
689
|
*
|
|
689
690
|
*/
|
|
690
691
|
initPorts(): void;
|
|
692
|
+
_getImpliedFootprintString(): string | null;
|
|
691
693
|
_addChildrenFromStringFootprint(): void;
|
|
692
694
|
get portMap(): PortMap<PortNames>;
|
|
693
695
|
getInstanceForReactElement(element: ReactElement): NormalComponent | null;
|
|
@@ -5811,6 +5813,435 @@ declare class Battery extends NormalComponent<typeof batteryProps, PassivePorts>
|
|
|
5811
5813
|
doInitialSourceRender(): void;
|
|
5812
5814
|
}
|
|
5813
5815
|
|
|
5816
|
+
declare class PinHeader extends NormalComponent<typeof pinHeaderProps> {
|
|
5817
|
+
get config(): {
|
|
5818
|
+
componentName: string;
|
|
5819
|
+
zodProps: zod.ZodObject<zod.objectUtil.extendShape<zod.objectUtil.extendShape<zod.objectUtil.extendShape<{
|
|
5820
|
+
pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
5821
|
+
pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
5822
|
+
pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
5823
|
+
schX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
5824
|
+
schY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
5825
|
+
schRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
5826
|
+
layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
|
|
5827
|
+
name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
5828
|
+
}, "strip", zod.ZodTypeAny, {
|
|
5829
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5830
|
+
}, {
|
|
5831
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5832
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
5833
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5834
|
+
}>>;
|
|
5835
|
+
footprint: zod.ZodOptional<zod.ZodType<_tscircuit_props.Footprint, zod.ZodTypeDef, _tscircuit_props.Footprint>>;
|
|
5836
|
+
}, {
|
|
5837
|
+
supplierPartNumbers: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["jlcpcb", "macrofab", "pcbway", "digikey", "mouser", "lcsc"]>, zod.ZodArray<zod.ZodString, "many">>>;
|
|
5838
|
+
}>, {
|
|
5839
|
+
key: zod.ZodOptional<zod.ZodAny>;
|
|
5840
|
+
name: zod.ZodString;
|
|
5841
|
+
cadModel: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodObject<zod.objectUtil.extendShape<{
|
|
5842
|
+
rotationOffset: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodObject<{
|
|
5843
|
+
x: zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>;
|
|
5844
|
+
y: zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>;
|
|
5845
|
+
z: zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>;
|
|
5846
|
+
}, "strip", zod.ZodTypeAny, {
|
|
5847
|
+
x: string | number;
|
|
5848
|
+
y: string | number;
|
|
5849
|
+
z: string | number;
|
|
5850
|
+
}, {
|
|
5851
|
+
x: string | number;
|
|
5852
|
+
y: string | number;
|
|
5853
|
+
z: string | number;
|
|
5854
|
+
}>]>>;
|
|
5855
|
+
positionOffset: zod.ZodOptional<zod.ZodObject<{
|
|
5856
|
+
x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5857
|
+
y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5858
|
+
z: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5859
|
+
}, "strip", zod.ZodTypeAny, {
|
|
5860
|
+
x: number;
|
|
5861
|
+
y: number;
|
|
5862
|
+
z: number;
|
|
5863
|
+
}, {
|
|
5864
|
+
x: string | number;
|
|
5865
|
+
y: string | number;
|
|
5866
|
+
z: string | number;
|
|
5867
|
+
}>>;
|
|
5868
|
+
size: zod.ZodOptional<zod.ZodObject<{
|
|
5869
|
+
x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5870
|
+
y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5871
|
+
z: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5872
|
+
}, "strip", zod.ZodTypeAny, {
|
|
5873
|
+
x: number;
|
|
5874
|
+
y: number;
|
|
5875
|
+
z: number;
|
|
5876
|
+
}, {
|
|
5877
|
+
x: string | number;
|
|
5878
|
+
y: string | number;
|
|
5879
|
+
z: string | number;
|
|
5880
|
+
}>>;
|
|
5881
|
+
}, {
|
|
5882
|
+
stlUrl: zod.ZodString;
|
|
5883
|
+
}>, "strip", zod.ZodTypeAny, {
|
|
5884
|
+
stlUrl: string;
|
|
5885
|
+
rotationOffset?: number | {
|
|
5886
|
+
x: string | number;
|
|
5887
|
+
y: string | number;
|
|
5888
|
+
z: string | number;
|
|
5889
|
+
} | undefined;
|
|
5890
|
+
positionOffset?: {
|
|
5891
|
+
x: number;
|
|
5892
|
+
y: number;
|
|
5893
|
+
z: number;
|
|
5894
|
+
} | undefined;
|
|
5895
|
+
size?: {
|
|
5896
|
+
x: number;
|
|
5897
|
+
y: number;
|
|
5898
|
+
z: number;
|
|
5899
|
+
} | undefined;
|
|
5900
|
+
}, {
|
|
5901
|
+
stlUrl: string;
|
|
5902
|
+
rotationOffset?: number | {
|
|
5903
|
+
x: string | number;
|
|
5904
|
+
y: string | number;
|
|
5905
|
+
z: string | number;
|
|
5906
|
+
} | undefined;
|
|
5907
|
+
positionOffset?: {
|
|
5908
|
+
x: string | number;
|
|
5909
|
+
y: string | number;
|
|
5910
|
+
z: string | number;
|
|
5911
|
+
} | undefined;
|
|
5912
|
+
size?: {
|
|
5913
|
+
x: string | number;
|
|
5914
|
+
y: string | number;
|
|
5915
|
+
z: string | number;
|
|
5916
|
+
} | undefined;
|
|
5917
|
+
}>, zod.ZodObject<zod.objectUtil.extendShape<{
|
|
5918
|
+
rotationOffset: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodObject<{
|
|
5919
|
+
x: zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>;
|
|
5920
|
+
y: zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>;
|
|
5921
|
+
z: zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>;
|
|
5922
|
+
}, "strip", zod.ZodTypeAny, {
|
|
5923
|
+
x: string | number;
|
|
5924
|
+
y: string | number;
|
|
5925
|
+
z: string | number;
|
|
5926
|
+
}, {
|
|
5927
|
+
x: string | number;
|
|
5928
|
+
y: string | number;
|
|
5929
|
+
z: string | number;
|
|
5930
|
+
}>]>>;
|
|
5931
|
+
positionOffset: zod.ZodOptional<zod.ZodObject<{
|
|
5932
|
+
x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5933
|
+
y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5934
|
+
z: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5935
|
+
}, "strip", zod.ZodTypeAny, {
|
|
5936
|
+
x: number;
|
|
5937
|
+
y: number;
|
|
5938
|
+
z: number;
|
|
5939
|
+
}, {
|
|
5940
|
+
x: string | number;
|
|
5941
|
+
y: string | number;
|
|
5942
|
+
z: string | number;
|
|
5943
|
+
}>>;
|
|
5944
|
+
size: zod.ZodOptional<zod.ZodObject<{
|
|
5945
|
+
x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5946
|
+
y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5947
|
+
z: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
5948
|
+
}, "strip", zod.ZodTypeAny, {
|
|
5949
|
+
x: number;
|
|
5950
|
+
y: number;
|
|
5951
|
+
z: number;
|
|
5952
|
+
}, {
|
|
5953
|
+
x: string | number;
|
|
5954
|
+
y: string | number;
|
|
5955
|
+
z: string | number;
|
|
5956
|
+
}>>;
|
|
5957
|
+
}, {
|
|
5958
|
+
objUrl: zod.ZodString;
|
|
5959
|
+
mtlUrl: zod.ZodOptional<zod.ZodString>;
|
|
5960
|
+
}>, "strip", zod.ZodTypeAny, {
|
|
5961
|
+
objUrl: string;
|
|
5962
|
+
rotationOffset?: number | {
|
|
5963
|
+
x: string | number;
|
|
5964
|
+
y: string | number;
|
|
5965
|
+
z: string | number;
|
|
5966
|
+
} | undefined;
|
|
5967
|
+
positionOffset?: {
|
|
5968
|
+
x: number;
|
|
5969
|
+
y: number;
|
|
5970
|
+
z: number;
|
|
5971
|
+
} | undefined;
|
|
5972
|
+
size?: {
|
|
5973
|
+
x: number;
|
|
5974
|
+
y: number;
|
|
5975
|
+
z: number;
|
|
5976
|
+
} | undefined;
|
|
5977
|
+
mtlUrl?: string | undefined;
|
|
5978
|
+
}, {
|
|
5979
|
+
objUrl: string;
|
|
5980
|
+
rotationOffset?: number | {
|
|
5981
|
+
x: string | number;
|
|
5982
|
+
y: string | number;
|
|
5983
|
+
z: string | number;
|
|
5984
|
+
} | undefined;
|
|
5985
|
+
positionOffset?: {
|
|
5986
|
+
x: string | number;
|
|
5987
|
+
y: string | number;
|
|
5988
|
+
z: string | number;
|
|
5989
|
+
} | undefined;
|
|
5990
|
+
size?: {
|
|
5991
|
+
x: string | number;
|
|
5992
|
+
y: string | number;
|
|
5993
|
+
z: string | number;
|
|
5994
|
+
} | undefined;
|
|
5995
|
+
mtlUrl?: string | undefined;
|
|
5996
|
+
}>, zod.ZodObject<zod.objectUtil.extendShape<{
|
|
5997
|
+
rotationOffset: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodObject<{
|
|
5998
|
+
x: zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>;
|
|
5999
|
+
y: zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>;
|
|
6000
|
+
z: zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>;
|
|
6001
|
+
}, "strip", zod.ZodTypeAny, {
|
|
6002
|
+
x: string | number;
|
|
6003
|
+
y: string | number;
|
|
6004
|
+
z: string | number;
|
|
6005
|
+
}, {
|
|
6006
|
+
x: string | number;
|
|
6007
|
+
y: string | number;
|
|
6008
|
+
z: string | number;
|
|
6009
|
+
}>]>>;
|
|
6010
|
+
positionOffset: zod.ZodOptional<zod.ZodObject<{
|
|
6011
|
+
x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
6012
|
+
y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
6013
|
+
z: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
6014
|
+
}, "strip", zod.ZodTypeAny, {
|
|
6015
|
+
x: number;
|
|
6016
|
+
y: number;
|
|
6017
|
+
z: number;
|
|
6018
|
+
}, {
|
|
6019
|
+
x: string | number;
|
|
6020
|
+
y: string | number;
|
|
6021
|
+
z: string | number;
|
|
6022
|
+
}>>;
|
|
6023
|
+
size: zod.ZodOptional<zod.ZodObject<{
|
|
6024
|
+
x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
6025
|
+
y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
6026
|
+
z: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
6027
|
+
}, "strip", zod.ZodTypeAny, {
|
|
6028
|
+
x: number;
|
|
6029
|
+
y: number;
|
|
6030
|
+
z: number;
|
|
6031
|
+
}, {
|
|
6032
|
+
x: string | number;
|
|
6033
|
+
y: string | number;
|
|
6034
|
+
z: string | number;
|
|
6035
|
+
}>>;
|
|
6036
|
+
}, {
|
|
6037
|
+
jscad: zod.ZodRecord<zod.ZodString, zod.ZodAny>;
|
|
6038
|
+
}>, "strip", zod.ZodTypeAny, {
|
|
6039
|
+
jscad: Record<string, any>;
|
|
6040
|
+
rotationOffset?: number | {
|
|
6041
|
+
x: string | number;
|
|
6042
|
+
y: string | number;
|
|
6043
|
+
z: string | number;
|
|
6044
|
+
} | undefined;
|
|
6045
|
+
positionOffset?: {
|
|
6046
|
+
x: number;
|
|
6047
|
+
y: number;
|
|
6048
|
+
z: number;
|
|
6049
|
+
} | undefined;
|
|
6050
|
+
size?: {
|
|
6051
|
+
x: number;
|
|
6052
|
+
y: number;
|
|
6053
|
+
z: number;
|
|
6054
|
+
} | undefined;
|
|
6055
|
+
}, {
|
|
6056
|
+
jscad: Record<string, any>;
|
|
6057
|
+
rotationOffset?: number | {
|
|
6058
|
+
x: string | number;
|
|
6059
|
+
y: string | number;
|
|
6060
|
+
z: string | number;
|
|
6061
|
+
} | undefined;
|
|
6062
|
+
positionOffset?: {
|
|
6063
|
+
x: string | number;
|
|
6064
|
+
y: string | number;
|
|
6065
|
+
z: string | number;
|
|
6066
|
+
} | undefined;
|
|
6067
|
+
size?: {
|
|
6068
|
+
x: string | number;
|
|
6069
|
+
y: string | number;
|
|
6070
|
+
z: string | number;
|
|
6071
|
+
} | undefined;
|
|
6072
|
+
}>]>>;
|
|
6073
|
+
children: zod.ZodOptional<zod.ZodAny>;
|
|
6074
|
+
symbolName: zod.ZodOptional<zod.ZodString>;
|
|
6075
|
+
}>, {
|
|
6076
|
+
pinCount: zod.ZodNumber;
|
|
6077
|
+
pitch: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
6078
|
+
gender: zod.ZodOptional<zod.ZodEnum<["male", "female"]>>;
|
|
6079
|
+
showSilkscreenPinLabels: zod.ZodOptional<zod.ZodBoolean>;
|
|
6080
|
+
doubleRow: zod.ZodOptional<zod.ZodBoolean>;
|
|
6081
|
+
holeDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
6082
|
+
platedDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
6083
|
+
pinLabels: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
6084
|
+
}>, "strip", zod.ZodTypeAny, {
|
|
6085
|
+
name: string;
|
|
6086
|
+
pinCount: number;
|
|
6087
|
+
pcbX?: number | undefined;
|
|
6088
|
+
pcbY?: number | undefined;
|
|
6089
|
+
pcbRotation?: number | undefined;
|
|
6090
|
+
schX?: number | undefined;
|
|
6091
|
+
schY?: number | undefined;
|
|
6092
|
+
schRotation?: number | undefined;
|
|
6093
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
6094
|
+
footprint?: _tscircuit_props.Footprint | undefined;
|
|
6095
|
+
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
6096
|
+
key?: any;
|
|
6097
|
+
cadModel?: string | {
|
|
6098
|
+
stlUrl: string;
|
|
6099
|
+
rotationOffset?: number | {
|
|
6100
|
+
x: string | number;
|
|
6101
|
+
y: string | number;
|
|
6102
|
+
z: string | number;
|
|
6103
|
+
} | undefined;
|
|
6104
|
+
positionOffset?: {
|
|
6105
|
+
x: number;
|
|
6106
|
+
y: number;
|
|
6107
|
+
z: number;
|
|
6108
|
+
} | undefined;
|
|
6109
|
+
size?: {
|
|
6110
|
+
x: number;
|
|
6111
|
+
y: number;
|
|
6112
|
+
z: number;
|
|
6113
|
+
} | undefined;
|
|
6114
|
+
} | {
|
|
6115
|
+
objUrl: string;
|
|
6116
|
+
rotationOffset?: number | {
|
|
6117
|
+
x: string | number;
|
|
6118
|
+
y: string | number;
|
|
6119
|
+
z: string | number;
|
|
6120
|
+
} | undefined;
|
|
6121
|
+
positionOffset?: {
|
|
6122
|
+
x: number;
|
|
6123
|
+
y: number;
|
|
6124
|
+
z: number;
|
|
6125
|
+
} | undefined;
|
|
6126
|
+
size?: {
|
|
6127
|
+
x: number;
|
|
6128
|
+
y: number;
|
|
6129
|
+
z: number;
|
|
6130
|
+
} | undefined;
|
|
6131
|
+
mtlUrl?: string | undefined;
|
|
6132
|
+
} | {
|
|
6133
|
+
jscad: Record<string, any>;
|
|
6134
|
+
rotationOffset?: number | {
|
|
6135
|
+
x: string | number;
|
|
6136
|
+
y: string | number;
|
|
6137
|
+
z: string | number;
|
|
6138
|
+
} | undefined;
|
|
6139
|
+
positionOffset?: {
|
|
6140
|
+
x: number;
|
|
6141
|
+
y: number;
|
|
6142
|
+
z: number;
|
|
6143
|
+
} | undefined;
|
|
6144
|
+
size?: {
|
|
6145
|
+
x: number;
|
|
6146
|
+
y: number;
|
|
6147
|
+
z: number;
|
|
6148
|
+
} | undefined;
|
|
6149
|
+
} | undefined;
|
|
6150
|
+
children?: any;
|
|
6151
|
+
symbolName?: string | undefined;
|
|
6152
|
+
holeDiameter?: number | undefined;
|
|
6153
|
+
pinLabels?: string[] | undefined;
|
|
6154
|
+
pitch?: number | undefined;
|
|
6155
|
+
gender?: "male" | "female" | undefined;
|
|
6156
|
+
showSilkscreenPinLabels?: boolean | undefined;
|
|
6157
|
+
doubleRow?: boolean | undefined;
|
|
6158
|
+
platedDiameter?: number | undefined;
|
|
6159
|
+
}, {
|
|
6160
|
+
name: string;
|
|
6161
|
+
pinCount: number;
|
|
6162
|
+
pcbX?: string | number | undefined;
|
|
6163
|
+
pcbY?: string | number | undefined;
|
|
6164
|
+
pcbRotation?: string | number | undefined;
|
|
6165
|
+
schX?: string | number | undefined;
|
|
6166
|
+
schY?: string | number | undefined;
|
|
6167
|
+
schRotation?: string | number | undefined;
|
|
6168
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
6169
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
6170
|
+
} | undefined;
|
|
6171
|
+
footprint?: _tscircuit_props.Footprint | undefined;
|
|
6172
|
+
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
6173
|
+
key?: any;
|
|
6174
|
+
cadModel?: string | {
|
|
6175
|
+
stlUrl: string;
|
|
6176
|
+
rotationOffset?: number | {
|
|
6177
|
+
x: string | number;
|
|
6178
|
+
y: string | number;
|
|
6179
|
+
z: string | number;
|
|
6180
|
+
} | undefined;
|
|
6181
|
+
positionOffset?: {
|
|
6182
|
+
x: string | number;
|
|
6183
|
+
y: string | number;
|
|
6184
|
+
z: string | number;
|
|
6185
|
+
} | undefined;
|
|
6186
|
+
size?: {
|
|
6187
|
+
x: string | number;
|
|
6188
|
+
y: string | number;
|
|
6189
|
+
z: string | number;
|
|
6190
|
+
} | undefined;
|
|
6191
|
+
} | {
|
|
6192
|
+
objUrl: string;
|
|
6193
|
+
rotationOffset?: number | {
|
|
6194
|
+
x: string | number;
|
|
6195
|
+
y: string | number;
|
|
6196
|
+
z: string | number;
|
|
6197
|
+
} | undefined;
|
|
6198
|
+
positionOffset?: {
|
|
6199
|
+
x: string | number;
|
|
6200
|
+
y: string | number;
|
|
6201
|
+
z: string | number;
|
|
6202
|
+
} | undefined;
|
|
6203
|
+
size?: {
|
|
6204
|
+
x: string | number;
|
|
6205
|
+
y: string | number;
|
|
6206
|
+
z: string | number;
|
|
6207
|
+
} | undefined;
|
|
6208
|
+
mtlUrl?: string | undefined;
|
|
6209
|
+
} | {
|
|
6210
|
+
jscad: Record<string, any>;
|
|
6211
|
+
rotationOffset?: number | {
|
|
6212
|
+
x: string | number;
|
|
6213
|
+
y: string | number;
|
|
6214
|
+
z: string | number;
|
|
6215
|
+
} | undefined;
|
|
6216
|
+
positionOffset?: {
|
|
6217
|
+
x: string | number;
|
|
6218
|
+
y: string | number;
|
|
6219
|
+
z: string | number;
|
|
6220
|
+
} | undefined;
|
|
6221
|
+
size?: {
|
|
6222
|
+
x: string | number;
|
|
6223
|
+
y: string | number;
|
|
6224
|
+
z: string | number;
|
|
6225
|
+
} | undefined;
|
|
6226
|
+
} | undefined;
|
|
6227
|
+
children?: any;
|
|
6228
|
+
symbolName?: string | undefined;
|
|
6229
|
+
holeDiameter?: string | number | undefined;
|
|
6230
|
+
pinLabels?: string[] | undefined;
|
|
6231
|
+
pitch?: string | number | undefined;
|
|
6232
|
+
gender?: "male" | "female" | undefined;
|
|
6233
|
+
showSilkscreenPinLabels?: boolean | undefined;
|
|
6234
|
+
doubleRow?: boolean | undefined;
|
|
6235
|
+
platedDiameter?: string | number | undefined;
|
|
6236
|
+
}>;
|
|
6237
|
+
schematicSymbolName: BaseSymbolName;
|
|
6238
|
+
};
|
|
6239
|
+
_getImpliedFootprintString(): string | null;
|
|
6240
|
+
initPorts(): void;
|
|
6241
|
+
doInitialSourceRender(): void;
|
|
6242
|
+
doInitialSchematicComponentRender(): void;
|
|
6243
|
+
}
|
|
6244
|
+
|
|
5814
6245
|
declare class Inductor extends NormalComponent<typeof inductorProps, PassivePorts> {
|
|
5815
6246
|
get config(): {
|
|
5816
6247
|
componentName: string;
|
|
@@ -6423,9 +6854,10 @@ declare global {
|
|
|
6423
6854
|
constraint: _tscircuit_props.ConstraintProps;
|
|
6424
6855
|
constrainedlayout: _tscircuit_props.ConstrainedLayoutProps;
|
|
6425
6856
|
battery: _tscircuit_props.BatteryProps;
|
|
6857
|
+
pinheader: _tscircuit_props.PinHeaderProps;
|
|
6426
6858
|
jscad: any;
|
|
6427
6859
|
}
|
|
6428
6860
|
}
|
|
6429
6861
|
}
|
|
6430
6862
|
|
|
6431
|
-
export { Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Diode, FabricationNotePath, FabricationNoteText, Footprint, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Net, NetAlias, NormalComponent, type PinLabelSpec, PlatedHole, Port, PowerSource, PrimitiveComponent, Project, Renderable, Resistor, SilkscreenCircle, SilkscreenPath, SilkscreenRect, SilkscreenText, SmtPad, Trace, TraceHint, Via, createUseComponent, useCapacitor, useChip, useDiode, useRenderedCircuit, useResistor };
|
|
6863
|
+
export { Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Diode, FabricationNotePath, FabricationNoteText, Footprint, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Net, NetAlias, NormalComponent, PinHeader, type PinLabelSpec, PlatedHole, Port, PowerSource, PrimitiveComponent, Project, Renderable, Resistor, SilkscreenCircle, SilkscreenPath, SilkscreenRect, SilkscreenText, SmtPad, Trace, TraceHint, Via, createUseComponent, useCapacitor, useChip, useDiode, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __export(components_exports, {
|
|
|
25
25
|
Net: () => Net,
|
|
26
26
|
NetAlias: () => NetAlias,
|
|
27
27
|
NormalComponent: () => NormalComponent,
|
|
28
|
+
PinHeader: () => PinHeader,
|
|
28
29
|
PlatedHole: () => PlatedHole,
|
|
29
30
|
Port: () => Port,
|
|
30
31
|
PowerSource: () => PowerSource,
|
|
@@ -2024,6 +2025,7 @@ var rotation3 = z4.object({
|
|
|
2024
2025
|
});
|
|
2025
2026
|
var NormalComponent = class extends PrimitiveComponent {
|
|
2026
2027
|
reactSubtrees = [];
|
|
2028
|
+
_impliedFootprint;
|
|
2027
2029
|
isPrimitiveContainer = true;
|
|
2028
2030
|
constructor(props) {
|
|
2029
2031
|
super(props);
|
|
@@ -2135,8 +2137,12 @@ var NormalComponent = class extends PrimitiveComponent {
|
|
|
2135
2137
|
this.addAll(portsToCreate);
|
|
2136
2138
|
}
|
|
2137
2139
|
}
|
|
2140
|
+
_getImpliedFootprintString() {
|
|
2141
|
+
return null;
|
|
2142
|
+
}
|
|
2138
2143
|
_addChildrenFromStringFootprint() {
|
|
2139
|
-
|
|
2144
|
+
let { footprint } = this.props;
|
|
2145
|
+
footprint ??= this._getImpliedFootprintString?.();
|
|
2140
2146
|
if (!footprint) return;
|
|
2141
2147
|
if (typeof footprint === "string") {
|
|
2142
2148
|
const fpSoup = fp.string(footprint).soup();
|
|
@@ -2326,9 +2332,18 @@ var NormalComponent = class extends PrimitiveComponent {
|
|
|
2326
2332
|
}
|
|
2327
2333
|
if (!isValidElement(footprint) && footprint && footprint.componentName === "Footprint") {
|
|
2328
2334
|
const fp2 = footprint;
|
|
2335
|
+
let pinNumber = 1;
|
|
2329
2336
|
const newPorts2 = [];
|
|
2330
2337
|
for (const fpChild of fp2.children) {
|
|
2331
|
-
|
|
2338
|
+
let portHintsList = fpChild.props.portHints ?? [];
|
|
2339
|
+
const hasPinPrefix = portHintsList.some(
|
|
2340
|
+
(hint) => hint.startsWith("pin")
|
|
2341
|
+
);
|
|
2342
|
+
if (!hasPinPrefix) {
|
|
2343
|
+
portHintsList = [...portHintsList, `pin${pinNumber}`];
|
|
2344
|
+
}
|
|
2345
|
+
pinNumber++;
|
|
2346
|
+
const newPort = getPortFromHints(portHintsList);
|
|
2332
2347
|
if (!newPort) continue;
|
|
2333
2348
|
newPort.originDescription = `footprint:${footprint}`;
|
|
2334
2349
|
newPorts2.push(newPort);
|
|
@@ -4479,6 +4494,71 @@ var Battery = class extends NormalComponent {
|
|
|
4479
4494
|
}
|
|
4480
4495
|
};
|
|
4481
4496
|
|
|
4497
|
+
// lib/components/normal-components/PinHeader.ts
|
|
4498
|
+
import { pinHeaderProps } from "@tscircuit/props";
|
|
4499
|
+
var PinHeader = class extends NormalComponent {
|
|
4500
|
+
get config() {
|
|
4501
|
+
return {
|
|
4502
|
+
componentName: "PinHeader",
|
|
4503
|
+
zodProps: pinHeaderProps,
|
|
4504
|
+
schematicSymbolName: "pinrow_horz"
|
|
4505
|
+
};
|
|
4506
|
+
}
|
|
4507
|
+
_getImpliedFootprintString() {
|
|
4508
|
+
const pinCount = this._parsedProps.pinCount ?? this._parsedProps.pinLabels?.length ?? 0;
|
|
4509
|
+
const holeDiameter = this._parsedProps.holeDiameter;
|
|
4510
|
+
const platedDiameter = this._parsedProps.platedDiameter;
|
|
4511
|
+
const pitch = this._parsedProps.pitch;
|
|
4512
|
+
if (pinCount > 0 && pitch) {
|
|
4513
|
+
if (!holeDiameter && !platedDiameter) {
|
|
4514
|
+
return `pinrow${pinCount}_p${pitch}`;
|
|
4515
|
+
}
|
|
4516
|
+
return `pinrow${pinCount}_p${pitch}_id${holeDiameter}_od${platedDiameter}`;
|
|
4517
|
+
}
|
|
4518
|
+
return null;
|
|
4519
|
+
}
|
|
4520
|
+
initPorts() {
|
|
4521
|
+
const pinCount = this._parsedProps.pinCount ?? this._parsedProps.pinLabels?.length ?? 1;
|
|
4522
|
+
for (let i = 1; i <= pinCount; i++) {
|
|
4523
|
+
this.add(
|
|
4524
|
+
new Port({
|
|
4525
|
+
name: `pin${i}`,
|
|
4526
|
+
pinNumber: i,
|
|
4527
|
+
aliases: []
|
|
4528
|
+
})
|
|
4529
|
+
);
|
|
4530
|
+
}
|
|
4531
|
+
}
|
|
4532
|
+
doInitialSourceRender() {
|
|
4533
|
+
const { db } = this.root;
|
|
4534
|
+
const { _parsedProps: props } = this;
|
|
4535
|
+
const source_component = db.source_component.insert({
|
|
4536
|
+
ftype: "simple_chip",
|
|
4537
|
+
name: props.name,
|
|
4538
|
+
// manufacturer_part_number: props.,
|
|
4539
|
+
supplier_part_numbers: props.supplierPartNumbers
|
|
4540
|
+
// gender: props.gender,
|
|
4541
|
+
// pitch: props.pitch,
|
|
4542
|
+
});
|
|
4543
|
+
this.source_component_id = source_component.source_component_id;
|
|
4544
|
+
}
|
|
4545
|
+
doInitialSchematicComponentRender() {
|
|
4546
|
+
const { db } = this.root;
|
|
4547
|
+
const { _parsedProps: props } = this;
|
|
4548
|
+
const schematic_component2 = db.schematic_component.insert({
|
|
4549
|
+
center: { x: props.schX ?? 0, y: props.schY ?? 0 },
|
|
4550
|
+
rotation: props.schRotation ?? 0,
|
|
4551
|
+
size: { width: 2, height: props.pinCount ?? 1 },
|
|
4552
|
+
source_component_id: this.source_component_id,
|
|
4553
|
+
port_arrangement: {
|
|
4554
|
+
left_size: 0,
|
|
4555
|
+
right_size: props.pinCount ?? 1
|
|
4556
|
+
}
|
|
4557
|
+
});
|
|
4558
|
+
this.schematic_component_id = schematic_component2.schematic_component_id;
|
|
4559
|
+
}
|
|
4560
|
+
};
|
|
4561
|
+
|
|
4482
4562
|
// lib/components/normal-components/Inductor.ts
|
|
4483
4563
|
import { inductorProps } from "@tscircuit/props";
|
|
4484
4564
|
var Inductor = class extends NormalComponent {
|
|
@@ -4774,6 +4854,7 @@ export {
|
|
|
4774
4854
|
Net,
|
|
4775
4855
|
NetAlias,
|
|
4776
4856
|
NormalComponent,
|
|
4857
|
+
PinHeader,
|
|
4777
4858
|
PlatedHole,
|
|
4778
4859
|
Port,
|
|
4779
4860
|
PowerSource,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.146",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@tscircuit/footprinter": "^0.0.77",
|
|
41
41
|
"@tscircuit/infgrid-ijump-astar": "^0.0.24",
|
|
42
42
|
"@tscircuit/math-utils": "^0.0.4",
|
|
43
|
-
"@tscircuit/props": "^0.0.
|
|
43
|
+
"@tscircuit/props": "^0.0.83",
|
|
44
44
|
"@tscircuit/schematic-autolayout": "^0.0.5",
|
|
45
45
|
"@tscircuit/soup-util": "^0.0.33",
|
|
46
46
|
"circuit-json": "^0.0.91",
|