From e6f1efda56162ba4a45683f7755147e4b49697ff Mon Sep 17 00:00:00 2001 From: techmannih Date: Mon, 9 Feb 2026 09:28:59 +0530 Subject: [PATCH 1/2] Add doc for courtyardrect,courtyardcircle and courtyardoutline --- TSCIRCUIT_REACT_PROPS_OVERVIEW.md | 2058 ++++++++++++++++++++++++++ docs/footprints/courtyardcircle.mdx | 26 + docs/footprints/courtyardoutline.mdx | 45 + docs/footprints/courtyardrect.mdx | 27 + 4 files changed, 2156 insertions(+) create mode 100644 TSCIRCUIT_REACT_PROPS_OVERVIEW.md create mode 100644 docs/footprints/courtyardcircle.mdx create mode 100644 docs/footprints/courtyardoutline.mdx create mode 100644 docs/footprints/courtyardrect.mdx diff --git a/TSCIRCUIT_REACT_PROPS_OVERVIEW.md b/TSCIRCUIT_REACT_PROPS_OVERVIEW.md new file mode 100644 index 00000000..55df65db --- /dev/null +++ b/TSCIRCUIT_REACT_PROPS_OVERVIEW.md @@ -0,0 +1,2058 @@ +# @tscircuit/props Overview + +> Generated by scripts/generate-props-overview.ts +> Latest version: https://github.com/tscircuit/props/blob/main/generated/PROPS_OVERVIEW.md + +This document provides an overview of all the prop types available in @tscircuit/props. +Each interface has a corresponding zod validator that can be imported from the package. + +For example, for `ChipProps` there is a `chipProps` zod validator: + +```ts +import { chipProps, type ChipProps } from "@tscircuit/props" + +// Validate/parse props +const validatedProps = chipProps.parse(unknownProps) +``` + +## Available Props + +```ts +export interface AnalogSimulationProps { + simulationType?: "spice_transient_analysis" + duration?: number | string + timePerStep?: number | string + spiceEngine?: AutocompleteString<"spicey" | "ngspice"> +} + + +export interface AutorouterConfig { + serverUrl?: string + inputFormat?: "simplified" | "circuit-json" + serverMode?: "job" | "solve-endpoint" + serverCacheEnabled?: boolean + cache?: PcbRouteCache + traceClearance?: Distance + availableJumperTypes?: Array<"1206x4" | "0603"> + groupMode?: + | "sequential_trace" + | "subcircuit" + | /** @deprecated Use "sequential_trace" */ "sequential-trace" + local?: boolean + algorithmFn?: (simpleRouteJson: any) => Promise + preset?: + | "sequential_trace" + | "subcircuit" + | "auto" + | "auto_local" + | "auto_cloud" + | "auto_jumper" + | "tscircuit_beta" + | "freerouting" + | "laser_prefab" // Prefabricated PCB with laser copper ablation + | /** @deprecated Use "auto_jumper" */ "auto-jumper" + | /** @deprecated Use "sequential_trace" */ "sequential-trace" + | /** @deprecated Use "auto_local" */ "auto-local" + | /** @deprecated Use "auto_cloud" */ "auto-cloud" +} + + +export interface AutorouterDefinition { + createAutorouter: ( + simpleRouteJson: SimpleRouteJson, + opts?: Record, + ) => AutorouterInstance | Promise +} + + +export interface AutorouterInstance { + run: () => Promise + getOutputSimpleRouteJson: () => Promise +} + + +export interface BaseGroupProps extends CommonLayoutProps, LayoutConfig { + name?: string + key?: any + children?: any + + pcbStyle?: PcbStyle + + /** + * Title to display above this group in the schematic view + */ + schTitle?: string + + /** + * If true, render this group as a single schematic box + */ + showAsSchematicBox?: boolean + + /** + * Mapping of external pin names to internal connection targets + */ + connections?: Connections + + /** + * Arrangement for pins when rendered as a schematic box + */ + schPinArrangement?: SchematicPinArrangement + + /** + * Spacing between pins when rendered as a schematic box + */ + schPinSpacing?: Distance + + /** + * Styles to apply to individual pins in the schematic box representation + */ + schPinStyle?: SchematicPinStyle + + pcbWidth?: Distance + pcbHeight?: Distance + minTraceWidth?: Distance + nominalTraceWidth?: Distance + schWidth?: Distance + schHeight?: Distance + + pcbLayout?: LayoutConfig + schLayout?: LayoutConfig + cellBorder?: Border | null + border?: Border | null + schPadding?: Distance + schPaddingLeft?: Distance + schPaddingRight?: Distance + schPaddingTop?: Distance + schPaddingBottom?: Distance + + pcbPadding?: Distance + pcbPaddingLeft?: Distance + pcbPaddingRight?: Distance + pcbPaddingTop?: Distance + pcbPaddingBottom?: Distance + /** + * Anchor to use when interpreting pcbX/pcbY/pcbOffsetX/pcbOffsetY relative to pcbPosition + */ + pcbAnchorAlignment?: AutocompleteString> + + /** @deprecated Use `pcbGrid` */ + grid?: boolean + /** @deprecated Use `pcbFlex` */ + flex?: boolean | string + + pcbGrid?: boolean + pcbGridCols?: number | string + pcbGridRows?: number | string + pcbGridTemplateRows?: string + pcbGridTemplateColumns?: string + pcbGridTemplate?: string + pcbGridGap?: number | string + pcbGridRowGap?: number | string + pcbGridColumnGap?: number | string + + pcbFlex?: boolean | string + pcbFlexGap?: number | string + pcbFlexDirection?: "row" | "column" + pcbAlignItems?: "start" | "center" | "end" | "stretch" + pcbJustifyContent?: + | "start" + | "center" + | "end" + | "stretch" + | "space-between" + | "space-around" + | "space-evenly" + pcbFlexRow?: boolean + pcbFlexColumn?: boolean + pcbGap?: number | string + pcbPack?: boolean + pcbPackGap?: number | string + + schGrid?: boolean + schGridCols?: number | string + schGridRows?: number | string + schGridTemplateRows?: string + schGridTemplateColumns?: string + schGridTemplate?: string + schGridGap?: number | string + schGridRowGap?: number | string + schGridColumnGap?: number | string + + schFlex?: boolean | string + schFlexGap?: number | string + schFlexDirection?: "row" | "column" + schAlignItems?: "start" | "center" | "end" | "stretch" + schJustifyContent?: + | "start" + | "center" + | "end" + | "stretch" + | "space-between" + | "space-around" + | "space-evenly" + schFlexRow?: boolean + schFlexColumn?: boolean + schGap?: number | string + schPack?: boolean + schMatchAdapt?: boolean +} + + +export interface BaseManualEditEvent { + edit_event_id: string + in_progress?: boolean + created_at: number +} + + +export interface BatteryProps + extends CommonComponentProps { + capacity?: number | string + voltage?: number | string + standard?: "AA" | "AAA" | "9V" | "CR2032" | "18650" | "C" + schOrientation?: SchematicOrientation +} + + +export interface BoardProps + extends Omit { + title?: string + material?: "fr4" | "fr1" + /** Number of layers for the PCB */ + layers?: 1 | 2 | 4 | 6 | 8 + borderRadius?: Distance + thickness?: Distance + boardAnchorPosition?: Point + anchorAlignment?: z.infer + boardAnchorAlignment?: z.infer + /** Color applied to both top and bottom solder masks */ + solderMaskColor?: BoardColor + /** Color of the top solder mask */ + topSolderMaskColor?: BoardColor + /** Color of the bottom solder mask */ + bottomSolderMaskColor?: BoardColor + /** Color applied to both top and bottom silkscreens */ + silkscreenColor?: BoardColor + /** Color of the top silkscreen */ + topSilkscreenColor?: BoardColor + /** Color of the bottom silkscreen */ + bottomSilkscreenColor?: BoardColor + /** Whether the board should be assembled on both sides */ + doubleSidedAssembly?: boolean + /** Whether this board should be omitted from the schematic view */ + schematicDisabled?: boolean +} + + +export interface Border { + strokeWidth?: Distance + dashed?: boolean + solid?: boolean +} + + +export interface BreakoutPointProps + extends Omit { + connection: string +} + + +export interface BreakoutProps + extends Omit { + padding?: Distance + paddingLeft?: Distance + paddingRight?: Distance + paddingTop?: Distance + paddingBottom?: Distance +} + + +export interface CadAssemblyProps { + /** + * The layer that the CAD assembly is designed for. If you set this to "top" + * then it means the children were intended to represent the top layer. If + * the with this assembly is moved to the bottom layer, then the + * components will be mirrored. + * + * Generally, you shouldn't set this except where it can help prevent + * confusion because you have a complex multi-layer assembly. Default is + * "top" and this is most intuitive. + */ + originalLayer?: LayerRef + + children?: any +} + + +export interface CadModelBase { + rotationOffset?: + | number + | { x: number | string; y: number | string; z: number | string } + positionOffset?: { + x: number | string + y: number | string + z: number | string + } + size?: { x: number | string; y: number | string; z: number | string } + modelUnitToMmScale?: Distance + zOffsetFromSurface?: Distance +} + + +export interface CadModelGlb extends CadModelBase { + glbUrl: string +} + + +export interface CadModelGltf extends CadModelBase { + gltfUrl: string +} + + +export interface CadModelJscad extends CadModelBase { + jscad: Record +} + + +export interface CadModelObj extends CadModelBase { + objUrl: string + mtlUrl?: string +} + + +export interface CadModelProps extends CadModelBase { + modelUrl: string + stepUrl?: string + pcbX?: Distance + pcbY?: Distance + pcbLeftEdgeX?: Distance + pcbRightEdgeX?: Distance + pcbTopEdgeY?: Distance + pcbBottomEdgeY?: Distance + pcbOffsetX?: Distance + pcbOffsetY?: Distance + pcbZ?: Distance +} + + +export interface CadModelStep extends CadModelBase { + stepUrl: string +} + + +export interface CadModelStl extends CadModelBase { + stlUrl: string +} + + +export interface CadModelWrl extends CadModelBase { + wrlUrl: string +} + + +export interface CapacitorProps + extends CommonComponentProps { + capacitance: number | string + maxVoltageRating?: number | string + schShowRatings?: boolean + polarized?: boolean + decouplingFor?: string + decouplingTo?: string + bypassFor?: string + bypassTo?: string + maxDecouplingTraceLength?: number + schOrientation?: SchematicOrientation + schSize?: SchematicSymbolSize + connections?: Connections +} + + +export interface ChipPropsSU< + PinLabel extends SchematicPinLabel = SchematicPinLabel, +> extends CommonComponentProps { + manufacturerPartNumber?: string + pinLabels?: PinLabelsProp + /** + * Whether to show pin aliases in the schematic + */ + showPinAliases?: boolean + /** + * Labels for PCB pins + */ + pcbPinLabels?: Record + schPinArrangement?: SchematicPortArrangement + /** @deprecated Use schPinArrangement instead. */ + schPortArrangement?: SchematicPortArrangement + pinCompatibleVariants?: PinCompatibleVariant[] + schPinStyle?: SchematicPinStyle + schPinSpacing?: Distance + schWidth?: Distance + schHeight?: Distance + noSchematicRepresentation?: boolean + internallyConnectedPins?: (string | number)[][] + externallyConnectedPins?: string[][] + connections?: Connections +} + + +export interface CircleCutoutProps + extends Omit { + name?: string + shape: "circle" + radius: Distance +} + + +export interface CircleHoleProps extends PcbLayoutProps { + name?: string + shape?: "circle" + diameter?: Distance + radius?: Distance + solderMaskMargin?: Distance + coveredWithSolderMask?: boolean +} + + +export interface CirclePlatedHoleProps + extends Omit { + name?: string + connectsTo?: string | string[] + shape: "circle" + holeDiameter: number | string + outerDiameter: number | string + padDiameter?: number | string + portHints?: PortHints + solderMaskMargin?: Distance + coveredWithSolderMask?: boolean +} + + +export interface CircleSmtPadProps extends Omit { + name?: string + shape: "circle" + radius: Distance + portHints?: PortHints + coveredWithSolderMask?: boolean + solderMaskMargin?: Distance +} + + +export interface CircleSolderPasteProps + extends Omit { + shape: "circle" + radius: Distance +} + + +export interface CircularHoleWithRectPlatedProps + extends Omit { + name?: string + connectsTo?: string | string[] + shape: "circular_hole_with_rect_pad" + holeDiameter: number | string + rectPadWidth: number | string + rectPadHeight: number | string + rectBorderRadius?: number | string + holeShape?: "circle" + padShape?: "rect" + portHints?: PortHints + holeOffsetX?: number | string + holeOffsetY?: number | string + solderMaskMargin?: Distance + coveredWithSolderMask?: boolean +} + + +export interface CommonComponentProps + extends CommonLayoutProps { + key?: any + name: string + displayName?: string + datasheetUrl?: string + pinAttributes?: Record + supplierPartNumbers?: SupplierPartNumbers + cadModel?: CadModelProp + kicadFootprintMetadata?: KicadFootprintMetadata + kicadSymbolMetadata?: KicadSymbolMetadata + children?: any + symbolName?: string + doNotPlace?: boolean + /** + * Does this component take up all the space within its bounds on a layer. This is generally true + * except for when separated pin headers are being represented by a single component (in which case, + * chips can be placed between the pin headers) or for tall modules where chips fit underneath. + */ + obstructsWithinBounds?: boolean + /** + * Whether to show this component's CAD model as translucent in the 3D viewer. + */ + showAsTranslucentModel?: boolean + mfn?: string + manufacturerPartNumber?: string +} + + +export interface CommonLayoutProps { + pcbX?: string | number + pcbY?: string | number + /** + * Position the left, right, top, or bottom edge of the component. Setting any of these + * properties changes the anchor used for pcb positioning to the specified edge. + */ + pcbLeftEdgeX?: string | number + pcbRightEdgeX?: string | number + pcbTopEdgeY?: string | number + pcbBottomEdgeY?: string | number + pcbOffsetX?: string | number + pcbOffsetY?: string | number + pcbRotation?: string | number + pcbPositionAnchor?: string + pcbPositionMode?: PcbPositionMode + + pcbMarginTop?: string | number + pcbMarginRight?: string | number + pcbMarginBottom?: string | number + pcbMarginLeft?: string | number + pcbMarginX?: string | number + pcbMarginY?: string | number + pcbStyle?: PcbStyle + pcbSx?: PcbSx + + schMarginTop?: string | number + schMarginRight?: string | number + schMarginBottom?: string | number + schMarginLeft?: string | number + schMarginX?: string | number + schMarginY?: string | number + + schX?: string | number + schY?: string | number + schRotation?: string | number + + layer?: LayerRefInput + footprint?: FootprintProp + symbol?: SymbolProp + schStyle?: SchStyle + + /** + * If true, X/Y coordinates will be interpreted relative to the parent group + */ + relative?: boolean + + /** + * If true, schX/schY will be interpreted relative to the parent group + */ + schRelative?: boolean + + /** + * If true, pcbX/pcbY will be interpreted relative to the parent group + */ + pcbRelative?: boolean +} + + +export interface ConnectorProps extends CommonComponentProps { + manufacturerPartNumber?: string + pinLabels?: Record< + number | SchematicPinLabel, + SchematicPinLabel | SchematicPinLabel[] + > + schPinStyle?: SchematicPinStyle + schPinSpacing?: number | string + schWidth?: number | string + schHeight?: number | string + schDirection?: "left" | "right" + schPortArrangement?: SchematicPortArrangement + /** + * Groups of pins that are internally connected + * e.g., [["1","2"], ["2","3"]] + */ + internallyConnectedPins?: (string | number)[][] + /** + * Connector standard, e.g. usb_c, m2 + */ + standard?: "usb_c" | "m2" +} + + +export interface ConstrainedLayoutProps { + name?: string + pcbOnly?: boolean + schOnly?: boolean +} + + +export interface CopperPourProps { + name?: string + layer: LayerRefInput + connectsTo: string + padMargin?: Distance + traceMargin?: Distance + clearance?: Distance + boardEdgeMargin?: Distance + cutoutMargin?: Distance + outline?: Point[] + coveredWithSolderMask?: boolean +} + + +export interface CrystalProps + extends CommonComponentProps { + frequency: number | string + loadCapacitance: number | string + manufacturerPartNumber?: string + mpn?: string + pinVariant?: PinVariant + schOrientation?: SchematicOrientation + connections?: Connections +} + + +export interface CurrentSourceProps + extends CommonComponentProps { + current?: number | string + frequency?: number | string + peakToPeakCurrent?: number | string + waveShape?: WaveShape + phase?: number | string + dutyCycle?: number | string + connections?: Connections +} + + +export interface DiodeProps + extends CommonComponentProps { + connections?: { + anode?: string | string[] | readonly string[] + cathode?: string | string[] | readonly string[] + pin1?: string | string[] | readonly string[] + pin2?: string | string[] | readonly string[] + pos?: string | string[] | readonly string[] + neg?: string | string[] | readonly string[] + } + variant?: "standard" | "schottky" | "zener" | "avalanche" | "photo" | "tvs" + standard?: boolean + schottky?: boolean + zener?: boolean + avalanche?: boolean + photo?: boolean + tvs?: boolean + schOrientation?: SchematicOrientation +} + + +export interface EditPcbComponentLocationEvent extends BaseManualEditEvent { + edit_event_type: "edit_pcb_component_location" + /** @deprecated */ + pcb_edit_event_type: "edit_component_location" + pcb_component_id: string + original_center: { x: number; y: number } + new_center: { x: number; y: number } +} + + +export interface EditPcbGroupLocationEvent extends BaseManualEditEvent { + edit_event_type: "edit_pcb_group_location" + pcb_group_id: string + original_center: { x: number; y: number } + new_center: { x: number; y: number } +} + + +export interface EditSchematicComponentLocationEvent + extends BaseManualEditEvent { + edit_event_type: "edit_schematic_component_location" + schematic_component_id: string + original_center: { x: number; y: number } + new_center: { x: number; y: number } +} + + +export interface EditSchematicGroupLocationEvent extends BaseManualEditEvent { + edit_event_type: "edit_schematic_group_location" + schematic_group_id: string + original_center: { x: number; y: number } + new_center: { x: number; y: number } +} + + +export interface EditTraceHintEvent extends BaseManualEditEvent { + /** @deprecated */ + pcb_edit_event_type: "edit_trace_hint" + edit_event_type?: "edit_pcb_trace_hint" + pcb_port_id: string + pcb_trace_hint_id?: string + route: Array<{ x: number; y: number; via?: boolean }> +} + + +export interface FabricationNoteDimensionProps + extends Omit< + PcbLayoutProps, + | "pcbLeftEdgeX" + | "pcbRightEdgeX" + | "pcbTopEdgeY" + | "pcbBottomEdgeY" + | "pcbX" + | "pcbY" + | "pcbOffsetX" + | "pcbOffsetY" + | "pcbRotation" + > { + from: string | Point + to: string | Point + text?: string + offset?: string | number + font?: "tscircuit2024" + fontSize?: string | number + color?: string + arrowSize?: string | number + units?: "in" | "mm" + outerEdgeToEdge?: true + centerToCenter?: true + innerEdgeToEdge?: true +} + + +export interface FabricationNoteTextProps extends PcbLayoutProps { + text: string + anchorAlignment?: + | "center" + | "top_left" + | "top_right" + | "bottom_left" + | "bottom_right" + font?: "tscircuit2024" + fontSize?: string | number + color?: string +} + + +export interface FiducialProps extends CommonComponentProps { + soldermaskPullback?: Distance + padDiameter?: Distance +} + + +export interface FootprintFileParserEntry { + loadFromUrl: (url: string) => Promise +} + + +export interface FootprintLibraryResult { + footprintCircuitJson: any[] + cadModel?: CadModelProp +} + + +export interface FootprintProps { + children?: any + /** + * The layer that the footprint is designed for. If you set this to "top" + * then it means the children were intended to represent the top layer. If + * the with this footprint is moved to the bottom layer, then the + * components will be mirrored. + * + * Generally, you shouldn't set this except where it can help prevent + * confusion because you have a complex multi-layer footprint. Default is + * "top" and this is most intuitive. + */ + originalLayer?: LayerRef + /** + * Serialized circuit JSON describing a precompiled footprint + */ + circuitJson?: any[] + /** + * Can be a footprint or kicad string + */ + src?: FootprintProp +} + + +export interface FuseProps + extends CommonComponentProps { + /** + * Current rating of the fuse in amperes + */ + currentRating: number | string + + /** + * Voltage rating of the fuse + */ + voltageRating?: number | string + + /** + * Whether to show ratings on schematic + */ + schShowRatings?: boolean + + schOrientation?: SchematicOrientation + + /** + * Connections to other components + */ + connections?: Connections +} + + +export interface HoleWithPolygonPadPlatedHoleProps + extends Omit { + name?: string + connectsTo?: string | string[] + shape: "hole_with_polygon_pad" + holeShape: "circle" | "oval" | "pill" | "rotated_pill" + holeDiameter?: number | string + holeWidth?: number | string + holeHeight?: number | string + padOutline: Point[] + holeOffsetX: number | string + holeOffsetY: number | string + portHints?: PortHints + solderMaskMargin?: Distance + coveredWithSolderMask?: boolean +} + + +export interface InductorProps + extends CommonComponentProps { + inductance: number | string + maxCurrentRating?: number | string + schOrientation?: SchematicOrientation + connections?: Connections +} + + +export interface InterconnectProps extends CommonComponentProps { + standard?: "TSC0001_36P_XALT_2025_11" | "0805" | "0603" | "1206" + pinLabels?: Record< + number | SchematicPinLabel, + SchematicPinLabel | SchematicPinLabel[] + > + /** + * Groups of pins that are internally connected + * e.g., [["1","2"], ["2","3"]] + */ + internallyConnectedPins?: (string | number)[][] +} + + +export interface JumperProps extends CommonComponentProps { + manufacturerPartNumber?: string + pinLabels?: Record< + number | SchematicPinLabel, + SchematicPinLabel | SchematicPinLabel[] + > + schPinStyle?: SchematicPinStyle + schPinSpacing?: number | string + schWidth?: number | string + schHeight?: number | string + schDirection?: "left" | "right" + schPinArrangement?: SchematicPortArrangement + /** + * @deprecated Use schPinArrangement instead. + */ + schPortArrangement?: SchematicPortArrangement + /** + * Labels for PCB pins + */ + pcbPinLabels?: Record + /** + * Number of pins on the jumper (2 or 3) + */ + pinCount?: 2 | 3 + /** + * Groups of pins that are internally connected + * e.g., [["1","2"], ["2","3"]] + */ + internallyConnectedPins?: (string | number)[][] + /** + * Connections to other components + */ + connections?: Connections +} + + +export interface KicadAt { + x: number | string + y: number | string + rotation?: number | string +} + + +export interface KicadEffects { + font?: KicadFont +} + + +export interface KicadFont { + size?: { x: number | string; y: number | string } + thickness?: number | string +} + + +export interface KicadFootprintAttributes { + through_hole?: boolean + smd?: boolean + exclude_from_pos_files?: boolean + exclude_from_bom?: boolean +} + + +export interface KicadFootprintMetadata { + footprintName?: string + version?: number | string + generator?: string + generatorVersion?: number | string + layer?: string + properties?: KicadFootprintProperties + attributes?: KicadFootprintAttributes + pads?: KicadFootprintPad[] + embeddedFonts?: boolean + model?: KicadFootprintModel +} + + +export interface KicadFootprintModel { + path: string + offset?: { x: number | string; y: number | string; z: number | string } + scale?: { x: number | string; y: number | string; z: number | string } + rotate?: { x: number | string; y: number | string; z: number | string } +} + + +export interface KicadFootprintPad { + name: string + type: string + shape?: string + at?: KicadAt + size?: { x: number | string; y: number | string } + drill?: number | string + layers?: string[] + removeUnusedLayers?: boolean + uuid?: string +} + + +export interface KicadFootprintProperties { + Reference?: KicadProperty + Value?: KicadProperty + Datasheet?: KicadProperty + Description?: KicadProperty +} + + +export interface KicadPinMetadata { + electricalType?: KicadPinElectricalType + graphicStyle?: KicadPinGraphicStyle + pinLength?: Distance + nameTextSize?: Distance + numberTextSize?: Distance +} + + +export interface KicadProperty { + value: string + at?: KicadAt + layer?: string + uuid?: string + hide?: boolean + effects?: KicadEffects +} + + +export interface KicadSymbolEffects { + font?: KicadFont + justify?: string | string[] + hide?: boolean +} + + +export interface KicadSymbolMetadata { + symbolName?: string + extends?: string + pinNumbers?: KicadSymbolPinNumbers + pinNames?: KicadSymbolPinNames + excludeFromSim?: boolean + inBom?: boolean + onBoard?: boolean + properties?: KicadSymbolProperties + embeddedFonts?: boolean +} + + +export interface KicadSymbolPinNames { + offset?: number | string + hide?: boolean +} + + +export interface KicadSymbolPinNumbers { + hide?: boolean +} + + +export interface KicadSymbolProperties { + Reference?: KicadSymbolProperty + Value?: KicadSymbolProperty + Footprint?: KicadSymbolProperty + Datasheet?: KicadSymbolProperty + Description?: KicadSymbolProperty + ki_keywords?: KicadSymbolProperty + ki_fp_filters?: KicadSymbolProperty +} + + +export interface KicadSymbolProperty { + value: string + id?: number | string + at?: KicadAt + effects?: KicadSymbolEffects +} + + +export interface LayoutConfig { + layoutMode?: "grid" | "flex" | "match-adapt" | "relative" | "none" + position?: "absolute" | "relative" + + grid?: boolean + gridCols?: number | string + gridRows?: number | string + gridTemplateRows?: string + gridTemplateColumns?: string + gridTemplate?: string + gridGap?: number | string + gridRowGap?: number | string + gridColumnGap?: number | string + + flex?: boolean | string + flexDirection?: "row" | "column" + alignItems?: "start" | "center" | "end" | "stretch" + justifyContent?: + | "start" + | "center" + | "end" + | "stretch" + | "space-between" + | "space-around" + | "space-evenly" + flexRow?: boolean + flexColumn?: boolean + gap?: number | string + + pack?: boolean + packOrderStrategy?: + | "largest_to_smallest" + | "first_to_last" + | "highest_to_lowest_pin_count" + packPlacementStrategy?: "shortest_connection_along_outline" + + padding?: Distance + paddingLeft?: Distance + paddingRight?: Distance + paddingTop?: Distance + paddingBottom?: Distance + paddingX?: Distance + paddingY?: Distance + + width?: Distance + height?: Distance + + matchAdapt?: boolean + matchAdaptTemplate?: any +} + + +export interface ManualEditsFile { + pcb_placements?: ManualPcbPlacement[] + manual_trace_hints?: ManualTraceHint[] + schematic_placements?: ManualSchematicPlacement[] +} + + +export interface ManualPcbPlacement { + selector: string + relative_to: string + center: Point +} + + +export interface ManualSchematicPlacement { + selector: string + relative_to: string + center: Point +} + + +export interface ManualTraceHint { + pcb_port_selector: string + offsets: Array +} + + +export interface MosfetProps + extends CommonComponentProps { + channelType: "n" | "p" + mosfetMode: "enhancement" | "depletion" +} + + +export interface MountedBoardProps extends SubcircuitGroupProps { + boardToBoardDistance?: Distance + mountOrientation?: "faceDown" | "faceUp" +} + + +export interface NetAliasProps { + net?: string + connection?: string + schX?: number | string + schY?: number | string + schRotation?: number | string + anchorSide?: "left" | "top" | "right" | "bottom" +} + + +export interface NetLabelProps { + net?: string + connection?: string + connectsTo?: string | string[] + schX?: number | string + schY?: number | string + schRotation?: number | string + anchorSide?: "left" | "top" | "right" | "bottom" +} + + +export interface NetProps { + name: string + connectsTo?: string | string[] + highlightColor?: string + isPowerNet?: boolean + isGroundNet?: boolean +} + + +export interface NonSubcircuitGroupProps extends BaseGroupProps { + subcircuit?: false | undefined +} + + +export interface OpAmpProps + extends CommonComponentProps { + connections?: Connections +} + + +export interface OvalPlatedHoleProps extends Omit { + name?: string + connectsTo?: string | string[] + shape: "oval" + outerWidth: number | string + outerHeight: number | string + holeWidth: number | string + holeHeight: number | string + portHints?: PortHints + solderMaskMargin?: Distance + + /** @deprecated use holeWidth */ + innerWidth?: number | string + /** @deprecated use holeHeight */ + innerHeight?: number | string + coveredWithSolderMask?: boolean +} + + +export interface PanelProps + extends Omit { + width?: Distance + height?: Distance + children?: BaseGroupProps["children"] + anchorAlignment?: z.infer + /** + * If true, prevent a solder mask from being applied to this panel. + */ + noSolderMask?: boolean + /** Method for panelization */ + panelizationMethod?: "tab-routing" | "none" + /** Gap between boards in a panel */ + boardGap?: Distance + layoutMode?: "grid" | "pack" | "none" + row?: number + col?: number + cellWidth?: Distance + cellHeight?: Distance + tabWidth?: Distance + tabLength?: Distance + mouseBites?: boolean + edgePadding?: Distance + edgePaddingLeft?: Distance + edgePaddingRight?: Distance + edgePaddingTop?: Distance + edgePaddingBottom?: Distance +} + + +export interface PcbLayoutProps { + pcbX?: string | number + pcbY?: string | number + /** + * Position the left, right, top, or bottom edge of the component. Setting any of these + * properties changes the anchor used for pcb positioning to the specified edge. + */ + pcbLeftEdgeX?: string | number + pcbRightEdgeX?: string | number + pcbTopEdgeY?: string | number + pcbBottomEdgeY?: string | number + pcbOffsetX?: string | number + pcbOffsetY?: string | number + pcbRotation?: string | number + pcbPositionAnchor?: string + pcbPositionMode?: PcbPositionMode + layer?: LayerRefInput + pcbMarginTop?: string | number + pcbMarginRight?: string | number + pcbMarginBottom?: string | number + pcbMarginLeft?: string | number + pcbMarginX?: string | number + pcbMarginY?: string | number + pcbStyle?: PcbStyle + pcbSx?: PcbSx + /** + * If true, pcbX/pcbY will be interpreted relative to the parent group + */ + pcbRelative?: boolean + /** + * If true, both pcb and schematic coordinates will be interpreted relative to the parent group + */ + relative?: boolean +} + + +export interface PcbNoteDimensionProps + extends Omit< + PcbLayoutProps, + | "pcbLeftEdgeX" + | "pcbRightEdgeX" + | "pcbTopEdgeY" + | "pcbBottomEdgeY" + | "pcbX" + | "pcbY" + | "pcbOffsetX" + | "pcbOffsetY" + | "pcbRotation" + > { + from: string | Point + to: string | Point + text?: string + offset?: string | number + font?: "tscircuit2024" + fontSize?: string | number + color?: string + arrowSize?: string | number + units?: "in" | "mm" + outerEdgeToEdge?: true + centerToCenter?: true + innerEdgeToEdge?: true +} + + +export interface PcbNoteLineProps + extends Omit< + PcbLayoutProps, + | "pcbLeftEdgeX" + | "pcbRightEdgeX" + | "pcbTopEdgeY" + | "pcbBottomEdgeY" + | "pcbX" + | "pcbY" + | "pcbOffsetX" + | "pcbOffsetY" + | "pcbRotation" + > { + x1: string | number + y1: string | number + x2: string | number + y2: string | number + strokeWidth?: string | number + color?: string + isDashed?: boolean +} + + +export interface PcbNotePathProps + extends Omit< + PcbLayoutProps, + | "pcbLeftEdgeX" + | "pcbRightEdgeX" + | "pcbTopEdgeY" + | "pcbBottomEdgeY" + | "pcbX" + | "pcbY" + | "pcbOffsetX" + | "pcbOffsetY" + | "pcbRotation" + > { + route: RouteHintPointInput[] + strokeWidth?: string | number + color?: string +} + + +export interface PcbNoteRectProps extends Omit { + width: string | number + height: string | number + strokeWidth?: string | number + isFilled?: boolean + hasStroke?: boolean + isStrokeDashed?: boolean + color?: string + cornerRadius?: string | number +} + + +export interface PcbNoteTextProps extends PcbLayoutProps { + text: string + anchorAlignment?: + | "center" + | "top_left" + | "top_right" + | "bottom_left" + | "bottom_right" + font?: "tscircuit2024" + fontSize?: string | number + color?: string +} + + +export interface PcbRouteCache { + pcbTraces: PcbTrace[] + cacheKey: string +} + + +export interface PcbStyle { + silkscreenFontSize?: string | number + viaPadDiameter?: string | number + viaHoleDiameter?: string | number + silkscreenTextPosition?: + | "centered" + | "outside" + | "none" + | { + offsetX: number + offsetY: number + } + silkscreenTextVisibility?: "hidden" | "visible" | "inherit" +} + + +export interface PcbSxValue { + fontSize?: string | number + pcbX?: string | number + pcbY?: string | number +} + + +export interface PillHoleProps extends PcbLayoutProps { + name?: string + shape: "pill" + width: Distance + height: Distance + solderMaskMargin?: Distance + coveredWithSolderMask?: boolean +} + + +export interface PillPlatedHoleProps extends Omit { + name?: string + rectPad?: boolean + connectsTo?: string | string[] + shape: "pill" + outerWidth: number | string + outerHeight: number | string + holeWidth: number | string + holeHeight: number | string + holeOffsetX?: number | string + holeOffsetY?: number | string + + /** @deprecated use holeWidth */ + innerWidth?: number | string + /** @deprecated use holeHeight */ + innerHeight?: number | string + + portHints?: PortHints + solderMaskMargin?: Distance + coveredWithSolderMask?: boolean +} + + +export interface PillSmtPadProps extends Omit { + name?: string + shape: "pill" + width: Distance + height: Distance + radius: Distance + portHints?: PortHints + coveredWithSolderMask?: boolean + solderMaskMargin?: Distance +} + + +export interface PillWithRectPadPlatedHoleProps + extends Omit { + name?: string + connectsTo?: string | string[] + shape: "pill_hole_with_rect_pad" + holeShape?: "pill" + padShape?: "rect" + holeWidth: number | string + holeHeight: number | string + rectPadWidth: number | string + rectPadHeight: number | string + portHints?: PortHints + holeOffsetX?: number | string + holeOffsetY?: number | string + solderMaskMargin?: Distance + coveredWithSolderMask?: boolean +} + + +export interface PinAttributeMap { + providesPower?: boolean + requiresPower?: boolean + providesGround?: boolean + requiresGround?: boolean + providesVoltage?: string | number + requiresVoltage?: string | number + doNotConnect?: boolean + includeInBoardPinout?: boolean + highlightColor?: string + mustBeConnected?: boolean +} + + +export interface PinCompatibleVariant { + manufacturerPartNumber?: string + supplierPartNumber?: SupplierPartNumbers +} + + +export interface PinHeaderProps extends CommonComponentProps { + /** + * Number of pins in the header + */ + pinCount: number + + /** + * Distance between pins + */ + pitch?: number | string + + /** + * Schematic facing direction + */ + schFacingDirection?: "up" | "down" | "left" | "right" + + /** + * Whether the header is male, female, or unpopulated + */ + gender?: "male" | "female" | "unpopulated" + + /** + * Whether to show pin labels in silkscreen + */ + showSilkscreenPinLabels?: boolean + + /** + * Labels for PCB pins + */ + pcbPinLabels?: Record + + /** + * Whether the header has two rows of pins + */ + doubleRow?: boolean + + /** + * If true, the header is a right-angle style connector + */ + rightAngle?: boolean + + /** + * Orientation of the header on the PCB + */ + pcbOrientation?: PcbOrientation + + /** + * Diameter of the through-hole for each pin + */ + holeDiameter?: number | string + + /** + * Diameter of the plated area around each hole + */ + platedDiameter?: number | string + + /** + * Labels for each pin + */ + pinLabels?: Record | SchematicPinLabel[] + + /** + * Connections to other components + */ + connections?: Connections + + /** + * Direction the header is facing + */ + facingDirection?: "left" | "right" + + /** + * Pin arrangement in schematic view + */ + schPinArrangement?: SchematicPinArrangement + + /** + * Schematic pin style (margins, etc) + */ + schPinStyle?: SchematicPinStyle + + /** + * Schematic pin spacing + */ + schPinSpacing?: number | string + + /** + * Schematic width + */ + schWidth?: number | string + + /** + * Schematic height + */ + schHeight?: number | string +} + + +export interface PinSideDefinition { + pins: Array + direction: + | "top-to-bottom" + | "left-to-right" + | "bottom-to-top" + | "right-to-left" +} + + +export interface PlatformConfig { + partsEngine?: PartsEngine + + autorouter?: AutorouterProp + + autorouterMap?: Record + + // TODO this follows a subset of the localStorage interface + localCacheEngine?: any + + registryApiUrl?: string + + cloudAutorouterUrl?: string + + projectName?: string + projectBaseUrl?: string + version?: string + url?: string + printBoardInformationToSilkscreen?: boolean + includeBoardFiles?: string[] + snapshotsDir?: string + + defaultSpiceEngine?: AutocompleteString<"spicey" | "ngspice"> + + pcbDisabled?: boolean + schematicDisabled?: boolean + partsEngineDisabled?: boolean + + spiceEngineMap?: Record + + footprintLibraryMap?: Record< + string, + | (( + path: string, + options?: { resolvedPcbStyle?: PcbStyle }, + ) => Promise) + | Record< + string, + | any[] + | (( + path: string, + options?: { resolvedPcbStyle?: PcbStyle }, + ) => Promise) + > + > + + footprintFileParserMap?: Record + + resolveProjectStaticFileImportUrl?: (path: string) => Promise + nodeModulesResolver?: (modulePath: string) => Promise + platformFetch?: typeof fetch +} + + +export interface PolygonCutoutProps + extends Omit { + name?: string + shape: "polygon" + points: Point[] +} + + +export interface PolygonSmtPadProps + extends Omit { + name?: string + shape: "polygon" + points: Point[] + portHints?: PortHints + coveredWithSolderMask?: boolean + solderMaskMargin?: Distance +} + + +export interface PotentiometerProps extends CommonComponentProps { + maxResistance: number | string + pinVariant?: PotentiometerPinVariant +} + + +export interface RectCutoutProps + extends Omit { + name?: string + shape: "rect" + width: Distance + height: Distance +} + + +export interface RectHoleProps extends PcbLayoutProps { + name?: string + shape: "rect" + width: Distance + height: Distance + solderMaskMargin?: Distance + coveredWithSolderMask?: boolean +} + + +export interface RectSmtPadProps extends Omit { + name?: string + shape: "rect" + width: Distance + height: Distance + rectBorderRadius?: Distance + cornerRadius?: Distance + portHints?: PortHints + coveredWithSolderMask?: boolean + solderMaskMargin?: Distance + solderMaskMarginLeft?: Distance + solderMaskMarginRight?: Distance + solderMaskMarginTop?: Distance + solderMaskMarginBottom?: Distance +} + + +export interface RectSolderPasteProps + extends Omit { + shape: "rect" + width: Distance + height: Distance +} + + +export interface ResistorProps + extends CommonComponentProps { + resistance: number | string + tolerance?: number | string + pullupFor?: string + pullupTo?: string + pulldownFor?: string + pulldownTo?: string + schOrientation?: SchematicOrientation + schSize?: SchematicSymbolSize + connections?: Connections +} + + +export interface ResonatorProps extends CommonComponentProps { + frequency: number | string + loadCapacitance: number | string + pinVariant?: ResonatorPinVariant +} + + +export interface RotatedRectSmtPadProps + extends Omit { + name?: string + shape: "rotated_rect" + width: Distance + height: Distance + cornerRadius?: Distance + ccwRotation: number + portHints?: PortHints + coveredWithSolderMask?: boolean + solderMaskMargin?: Distance + solderMaskMarginLeft?: Distance + solderMaskMarginRight?: Distance + solderMaskMarginTop?: Distance + solderMaskMarginBottom?: Distance +} + + +export interface SchematicArcProps { + center: Point + radius: Distance + startAngleDegrees: number | string + endAngleDegrees: number | string + direction?: "clockwise" | "counterclockwise" + strokeWidth?: Distance + color?: string + isDashed?: boolean +} + + +export interface SchematicBoxProps { + schX?: Distance + schY?: Distance + width?: Distance + height?: Distance + overlay?: string[] + padding?: Distance + paddingLeft?: Distance + paddingRight?: Distance + paddingTop?: Distance + paddingBottom?: Distance + title?: string + titleAlignment?: z.infer + titleColor?: string + titleFontSize?: Distance + titleInside?: boolean + strokeStyle?: "solid" | "dashed" +} + + +export interface SchematicCellProps { + children?: string + horizontalAlign?: "left" | "center" | "right" + verticalAlign?: "top" | "middle" | "bottom" + fontSize?: number | string + rowSpan?: number + colSpan?: number + width?: number | string + text?: string +} + + +export interface SchematicCircleProps { + center: Point + radius: Distance + strokeWidth?: Distance + color?: string + isFilled?: boolean + fillColor?: string + isDashed?: boolean +} + + +export interface SchematicLineProps { + x1: Distance + y1: Distance + x2: Distance + y2: Distance + strokeWidth?: Distance + color?: string + isDashed?: boolean +} + + +export interface SchematicPathProps { + points?: Point[] + svgPath?: string + strokeWidth?: Distance + strokeColor?: string + isFilled?: boolean + fillColor?: string +} + + +export interface SchematicPortArrangementWithPinCounts { + leftPinCount?: number + topPinCount?: number + rightPinCount?: number + bottomPinCount?: number +} + + +export interface SchematicPortArrangementWithSides { + leftSide?: PinSideDefinitionInput + topSide?: PinSideDefinitionInput + rightSide?: PinSideDefinitionInput + bottomSide?: PinSideDefinitionInput +} + + +export interface SchematicPortArrangementWithSizes { + leftSize?: number + topSize?: number + rightSize?: number + bottomSize?: number +} + + +export interface SchematicRectProps { + schX?: Distance + schY?: Distance + width: Distance + height: Distance + rotation?: number | string + strokeWidth?: Distance + color?: string + isFilled?: boolean + fillColor?: string + isDashed?: boolean + cornerRadius?: Distance +} + + +export interface SchematicRowProps { + children?: any + height?: number | string +} + + +export interface SchematicTableProps { + schX?: number | string + schY?: number | string + children?: any + cellPadding?: number | string + borderWidth?: number | string + anchor?: z.infer + fontSize?: number | string +} + + +export interface SchematicTextProps { + schX?: Distance + schY?: Distance + text: string + fontSize?: number + anchor?: z.infer | z.infer + color?: string + schRotation?: number | string +} + + +export interface SchStyle { + defaultPassiveSize?: "xs" | "sm" | "md" | string | number + defaultCapacitorOrientation?: "vertical" | "none" +} + + +export interface SolderJumperProps extends JumperProps { + /** + * Pins that are bridged with solder by default + */ + bridgedPins?: string[][] + /** + * If true, all pins are connected with cuttable traces + */ + bridged?: boolean +} + + +export interface SpiceEngine { + simulate: (spiceString: string) => Promise +} + + +export interface SpiceEngineSimulationResult { + engineVersionString?: string + simulationResultCircuitJson: CircuitJson +} + + +export interface StampboardProps extends BoardProps { + leftPinCount?: number + rightPinCount?: number + topPinCount?: number + bottomPinCount?: number + leftPins?: string[] + rightPins?: string[] + topPins?: string[] + bottomPins?: string[] + pinPitch?: number | string + innerHoles?: boolean +} + + +export interface SubcircuitGroupProps extends BaseGroupProps { + manualEdits?: ManualEditsFileInput + routingDisabled?: boolean + bomDisabled?: boolean + defaultTraceWidth?: Distance + minTraceWidth?: Distance + nominalTraceWidth?: Distance + pcbRouteCache?: PcbRouteCache + + autorouter?: AutorouterProp + autorouterEffortLevel?: "1x" | "2x" | "5x" | "10x" | "100x" + autorouterVersion?: "v1" | "v2" | "latest" + + /** + * Serialized circuit JSON describing a precompiled subcircuit + */ + circuitJson?: any[] + + /** + * If true, we'll automatically layout the schematic for this group. Must be + * a subcircuit (currently). This is eventually going to be replaced with more + * sophisticated layout options/modes and will be enabled by default. + */ + schAutoLayoutEnabled?: boolean + + /** + * If true, net labels will automatically be created for complex traces + */ + schTraceAutoLabelEnabled?: boolean + + /** Maximum length a trace can span on the schematic */ + schMaxTraceDistance?: Distance + + partsEngine?: PartsEngine + _subcircuitCachingEnabled?: boolean + + /** When autosizing, the board will be made square */ + square?: boolean + /** Desired empty area of the board e.g. "22mm^2" or "20%" */ + emptyArea?: string + /** Desired filled area of the board e.g. "22mm^2" or "20%" */ + filledArea?: string + + width?: number | string + height?: number | string + outline?: Point[] + outlineOffsetX?: number | string + outlineOffsetY?: number | string +} + + +export interface SubcircuitGroupPropsWithBool extends SubcircuitGroupProps { + subcircuit: true +} + + +export interface SupplierProps { + supplierPartNumbers?: SupplierPartNumbers +} + + +export interface SwitchProps extends CommonComponentProps { + type?: "spst" | "spdt" | "dpst" | "dpdt" + isNormallyClosed?: boolean + spdt?: boolean + spst?: boolean + dpst?: boolean + dpdt?: boolean + simSwitchFrequency?: number | string + simCloseAt?: number | string + simOpenAt?: number | string + simStartClosed?: boolean + simStartOpen?: boolean + connections?: Connections +} + + +export interface SymbolProps { + /** + * The facing direction that the symbol is designed for. If you set this to "right", + * then it means the children were intended to represent the symbol facing right. + * Generally, you shouldn't set this except where it can help prevent confusion + * because you have a complex symbol. Default is "right" and this is most intuitive. + */ + originalFacingDirection?: "up" | "down" | "left" | "right" + width?: string | number + height?: string | number + name?: string +} + + +export interface TestpointProps extends CommonComponentProps { + /** + * The footprint variant of the testpoint either a surface pad or through-hole + */ + footprintVariant?: "pad" | "through_hole" + /** + * The shape of the pad if using a pad variant + */ + padShape?: "rect" | "circle" + /** + * Diameter of the copper pad (applies to both SMD pads and plated holes) + */ + padDiameter?: number | string + /** + * Diameter of the hole if using a through-hole testpoint + */ + holeDiameter?: number | string + /** + * Width of the pad when padShape is rect + */ + width?: number | string + /** + * Height of the pad when padShape is rect + */ + height?: number | string + connections?: TestpointConnections +} + + +export interface ToolingrailProps { + children?: any +} + + +export interface TransistorProps + extends CommonComponentProps { + type: "npn" | "pnp" | "bjt" | "jfet" | "mosfet" | "igbt" + connections?: Connections +} + + +export interface ViaProps extends CommonLayoutProps { + name?: string + fromLayer: LayerRefInput + toLayer: LayerRefInput + holeDiameter?: number | string + outerDiameter?: number | string + connectsTo?: string | string[] + netIsAssignable?: boolean +} + + +export interface VoltageProbeProps extends Omit { + name?: string + connectsTo: string + referenceTo?: string + color?: string +} + + +export interface VoltageSourceProps + extends CommonComponentProps { + voltage?: number | string + frequency?: number | string + peakToPeakVoltage?: number | string + waveShape?: WaveShape + phase?: number | string + dutyCycle?: number | string + connections?: Connections +} + +``` diff --git a/docs/footprints/courtyardcircle.mdx b/docs/footprints/courtyardcircle.mdx new file mode 100644 index 00000000..ddab611f --- /dev/null +++ b/docs/footprints/courtyardcircle.mdx @@ -0,0 +1,26 @@ +--- +title: +description: Courtyard circles are used to define the physical boundary of a component. +--- + +## Overview + +Courtyard circles define the physical boundary of a circular component or feature, including potential tolerance. + +import CircuitPreview from "@site/src/components/CircuitPreview" + + ( + + + + + ) +`} /> + +## Props + +| Prop | Type | Description | +| :--- | :--- | :--- | +| `radius` | `number \| string` | The radius of the circle. | +| ...`PcbLayoutProps` | | Inherited PcbLayoutProps (e.g. `pcbX`, `pcbY`, `layer`, `pcbRotation`). | diff --git a/docs/footprints/courtyardoutline.mdx b/docs/footprints/courtyardoutline.mdx new file mode 100644 index 00000000..b43d7b4a --- /dev/null +++ b/docs/footprints/courtyardoutline.mdx @@ -0,0 +1,45 @@ +--- +title: +description: Courtyard outlines are used to define the physical boundary of a component with a custom shape. +--- + +## Overview + +Courtyard outlines define the physical boundary of a component using a custom shape defined by a series of points. + +import CircuitPreview from "@site/src/components/CircuitPreview" + + ( + + {/* Triangle shape */} + + {/* L-shaped polygon on bottom layer */} + + + ) +`} /> + +## Props + +| Prop | Type | Description | +| :--- | :--- | :--- | +| `outline` | `Point[]` | An array of points defining the vertices of the polygon. | +| `close` | `boolean` | Whether the outline should be closed. Defaults to `true` (implicit). | +| ...`PcbLayoutProps` | | Inherited PcbLayoutProps (e.g. `pcbX`, `pcbY`, `layer`, `pcbRotation`). | diff --git a/docs/footprints/courtyardrect.mdx b/docs/footprints/courtyardrect.mdx new file mode 100644 index 00000000..627c6c2e --- /dev/null +++ b/docs/footprints/courtyardrect.mdx @@ -0,0 +1,27 @@ +--- +title: +description: Courtyard rectangles are used to define the physical boundary of a component. +--- + +## Overview + +Courtyard rectangles define the physical boundary of a component, including potential tolerance. They are critical for ensuring components are not placed too close together. + +import CircuitPreview from "@site/src/components/CircuitPreview" + + ( + + + + + ) +`} /> + +## Props + +| Prop | Type | Description | +| :--- | :--- | :--- | +| `width` | `number \| string` | The width of the rectangle. | +| `height` | `number \| string` | The height of the rectangle. | +| ...`PcbLayoutProps` | | Inherited PcbLayoutProps (e.g. `pcbX`, `pcbY`, `layer`, `pcbRotation`). | From b326bfa60fce9c9ffd0f4cd18a0721d0a5c6d4d0 Mon Sep 17 00:00:00 2001 From: techmannih Date: Mon, 9 Feb 2026 09:38:10 +0530 Subject: [PATCH 2/2] up --- TSCIRCUIT_REACT_PROPS_OVERVIEW.md | 2058 ----------------------------- 1 file changed, 2058 deletions(-) delete mode 100644 TSCIRCUIT_REACT_PROPS_OVERVIEW.md diff --git a/TSCIRCUIT_REACT_PROPS_OVERVIEW.md b/TSCIRCUIT_REACT_PROPS_OVERVIEW.md deleted file mode 100644 index 55df65db..00000000 --- a/TSCIRCUIT_REACT_PROPS_OVERVIEW.md +++ /dev/null @@ -1,2058 +0,0 @@ -# @tscircuit/props Overview - -> Generated by scripts/generate-props-overview.ts -> Latest version: https://github.com/tscircuit/props/blob/main/generated/PROPS_OVERVIEW.md - -This document provides an overview of all the prop types available in @tscircuit/props. -Each interface has a corresponding zod validator that can be imported from the package. - -For example, for `ChipProps` there is a `chipProps` zod validator: - -```ts -import { chipProps, type ChipProps } from "@tscircuit/props" - -// Validate/parse props -const validatedProps = chipProps.parse(unknownProps) -``` - -## Available Props - -```ts -export interface AnalogSimulationProps { - simulationType?: "spice_transient_analysis" - duration?: number | string - timePerStep?: number | string - spiceEngine?: AutocompleteString<"spicey" | "ngspice"> -} - - -export interface AutorouterConfig { - serverUrl?: string - inputFormat?: "simplified" | "circuit-json" - serverMode?: "job" | "solve-endpoint" - serverCacheEnabled?: boolean - cache?: PcbRouteCache - traceClearance?: Distance - availableJumperTypes?: Array<"1206x4" | "0603"> - groupMode?: - | "sequential_trace" - | "subcircuit" - | /** @deprecated Use "sequential_trace" */ "sequential-trace" - local?: boolean - algorithmFn?: (simpleRouteJson: any) => Promise - preset?: - | "sequential_trace" - | "subcircuit" - | "auto" - | "auto_local" - | "auto_cloud" - | "auto_jumper" - | "tscircuit_beta" - | "freerouting" - | "laser_prefab" // Prefabricated PCB with laser copper ablation - | /** @deprecated Use "auto_jumper" */ "auto-jumper" - | /** @deprecated Use "sequential_trace" */ "sequential-trace" - | /** @deprecated Use "auto_local" */ "auto-local" - | /** @deprecated Use "auto_cloud" */ "auto-cloud" -} - - -export interface AutorouterDefinition { - createAutorouter: ( - simpleRouteJson: SimpleRouteJson, - opts?: Record, - ) => AutorouterInstance | Promise -} - - -export interface AutorouterInstance { - run: () => Promise - getOutputSimpleRouteJson: () => Promise -} - - -export interface BaseGroupProps extends CommonLayoutProps, LayoutConfig { - name?: string - key?: any - children?: any - - pcbStyle?: PcbStyle - - /** - * Title to display above this group in the schematic view - */ - schTitle?: string - - /** - * If true, render this group as a single schematic box - */ - showAsSchematicBox?: boolean - - /** - * Mapping of external pin names to internal connection targets - */ - connections?: Connections - - /** - * Arrangement for pins when rendered as a schematic box - */ - schPinArrangement?: SchematicPinArrangement - - /** - * Spacing between pins when rendered as a schematic box - */ - schPinSpacing?: Distance - - /** - * Styles to apply to individual pins in the schematic box representation - */ - schPinStyle?: SchematicPinStyle - - pcbWidth?: Distance - pcbHeight?: Distance - minTraceWidth?: Distance - nominalTraceWidth?: Distance - schWidth?: Distance - schHeight?: Distance - - pcbLayout?: LayoutConfig - schLayout?: LayoutConfig - cellBorder?: Border | null - border?: Border | null - schPadding?: Distance - schPaddingLeft?: Distance - schPaddingRight?: Distance - schPaddingTop?: Distance - schPaddingBottom?: Distance - - pcbPadding?: Distance - pcbPaddingLeft?: Distance - pcbPaddingRight?: Distance - pcbPaddingTop?: Distance - pcbPaddingBottom?: Distance - /** - * Anchor to use when interpreting pcbX/pcbY/pcbOffsetX/pcbOffsetY relative to pcbPosition - */ - pcbAnchorAlignment?: AutocompleteString> - - /** @deprecated Use `pcbGrid` */ - grid?: boolean - /** @deprecated Use `pcbFlex` */ - flex?: boolean | string - - pcbGrid?: boolean - pcbGridCols?: number | string - pcbGridRows?: number | string - pcbGridTemplateRows?: string - pcbGridTemplateColumns?: string - pcbGridTemplate?: string - pcbGridGap?: number | string - pcbGridRowGap?: number | string - pcbGridColumnGap?: number | string - - pcbFlex?: boolean | string - pcbFlexGap?: number | string - pcbFlexDirection?: "row" | "column" - pcbAlignItems?: "start" | "center" | "end" | "stretch" - pcbJustifyContent?: - | "start" - | "center" - | "end" - | "stretch" - | "space-between" - | "space-around" - | "space-evenly" - pcbFlexRow?: boolean - pcbFlexColumn?: boolean - pcbGap?: number | string - pcbPack?: boolean - pcbPackGap?: number | string - - schGrid?: boolean - schGridCols?: number | string - schGridRows?: number | string - schGridTemplateRows?: string - schGridTemplateColumns?: string - schGridTemplate?: string - schGridGap?: number | string - schGridRowGap?: number | string - schGridColumnGap?: number | string - - schFlex?: boolean | string - schFlexGap?: number | string - schFlexDirection?: "row" | "column" - schAlignItems?: "start" | "center" | "end" | "stretch" - schJustifyContent?: - | "start" - | "center" - | "end" - | "stretch" - | "space-between" - | "space-around" - | "space-evenly" - schFlexRow?: boolean - schFlexColumn?: boolean - schGap?: number | string - schPack?: boolean - schMatchAdapt?: boolean -} - - -export interface BaseManualEditEvent { - edit_event_id: string - in_progress?: boolean - created_at: number -} - - -export interface BatteryProps - extends CommonComponentProps { - capacity?: number | string - voltage?: number | string - standard?: "AA" | "AAA" | "9V" | "CR2032" | "18650" | "C" - schOrientation?: SchematicOrientation -} - - -export interface BoardProps - extends Omit { - title?: string - material?: "fr4" | "fr1" - /** Number of layers for the PCB */ - layers?: 1 | 2 | 4 | 6 | 8 - borderRadius?: Distance - thickness?: Distance - boardAnchorPosition?: Point - anchorAlignment?: z.infer - boardAnchorAlignment?: z.infer - /** Color applied to both top and bottom solder masks */ - solderMaskColor?: BoardColor - /** Color of the top solder mask */ - topSolderMaskColor?: BoardColor - /** Color of the bottom solder mask */ - bottomSolderMaskColor?: BoardColor - /** Color applied to both top and bottom silkscreens */ - silkscreenColor?: BoardColor - /** Color of the top silkscreen */ - topSilkscreenColor?: BoardColor - /** Color of the bottom silkscreen */ - bottomSilkscreenColor?: BoardColor - /** Whether the board should be assembled on both sides */ - doubleSidedAssembly?: boolean - /** Whether this board should be omitted from the schematic view */ - schematicDisabled?: boolean -} - - -export interface Border { - strokeWidth?: Distance - dashed?: boolean - solid?: boolean -} - - -export interface BreakoutPointProps - extends Omit { - connection: string -} - - -export interface BreakoutProps - extends Omit { - padding?: Distance - paddingLeft?: Distance - paddingRight?: Distance - paddingTop?: Distance - paddingBottom?: Distance -} - - -export interface CadAssemblyProps { - /** - * The layer that the CAD assembly is designed for. If you set this to "top" - * then it means the children were intended to represent the top layer. If - * the with this assembly is moved to the bottom layer, then the - * components will be mirrored. - * - * Generally, you shouldn't set this except where it can help prevent - * confusion because you have a complex multi-layer assembly. Default is - * "top" and this is most intuitive. - */ - originalLayer?: LayerRef - - children?: any -} - - -export interface CadModelBase { - rotationOffset?: - | number - | { x: number | string; y: number | string; z: number | string } - positionOffset?: { - x: number | string - y: number | string - z: number | string - } - size?: { x: number | string; y: number | string; z: number | string } - modelUnitToMmScale?: Distance - zOffsetFromSurface?: Distance -} - - -export interface CadModelGlb extends CadModelBase { - glbUrl: string -} - - -export interface CadModelGltf extends CadModelBase { - gltfUrl: string -} - - -export interface CadModelJscad extends CadModelBase { - jscad: Record -} - - -export interface CadModelObj extends CadModelBase { - objUrl: string - mtlUrl?: string -} - - -export interface CadModelProps extends CadModelBase { - modelUrl: string - stepUrl?: string - pcbX?: Distance - pcbY?: Distance - pcbLeftEdgeX?: Distance - pcbRightEdgeX?: Distance - pcbTopEdgeY?: Distance - pcbBottomEdgeY?: Distance - pcbOffsetX?: Distance - pcbOffsetY?: Distance - pcbZ?: Distance -} - - -export interface CadModelStep extends CadModelBase { - stepUrl: string -} - - -export interface CadModelStl extends CadModelBase { - stlUrl: string -} - - -export interface CadModelWrl extends CadModelBase { - wrlUrl: string -} - - -export interface CapacitorProps - extends CommonComponentProps { - capacitance: number | string - maxVoltageRating?: number | string - schShowRatings?: boolean - polarized?: boolean - decouplingFor?: string - decouplingTo?: string - bypassFor?: string - bypassTo?: string - maxDecouplingTraceLength?: number - schOrientation?: SchematicOrientation - schSize?: SchematicSymbolSize - connections?: Connections -} - - -export interface ChipPropsSU< - PinLabel extends SchematicPinLabel = SchematicPinLabel, -> extends CommonComponentProps { - manufacturerPartNumber?: string - pinLabels?: PinLabelsProp - /** - * Whether to show pin aliases in the schematic - */ - showPinAliases?: boolean - /** - * Labels for PCB pins - */ - pcbPinLabels?: Record - schPinArrangement?: SchematicPortArrangement - /** @deprecated Use schPinArrangement instead. */ - schPortArrangement?: SchematicPortArrangement - pinCompatibleVariants?: PinCompatibleVariant[] - schPinStyle?: SchematicPinStyle - schPinSpacing?: Distance - schWidth?: Distance - schHeight?: Distance - noSchematicRepresentation?: boolean - internallyConnectedPins?: (string | number)[][] - externallyConnectedPins?: string[][] - connections?: Connections -} - - -export interface CircleCutoutProps - extends Omit { - name?: string - shape: "circle" - radius: Distance -} - - -export interface CircleHoleProps extends PcbLayoutProps { - name?: string - shape?: "circle" - diameter?: Distance - radius?: Distance - solderMaskMargin?: Distance - coveredWithSolderMask?: boolean -} - - -export interface CirclePlatedHoleProps - extends Omit { - name?: string - connectsTo?: string | string[] - shape: "circle" - holeDiameter: number | string - outerDiameter: number | string - padDiameter?: number | string - portHints?: PortHints - solderMaskMargin?: Distance - coveredWithSolderMask?: boolean -} - - -export interface CircleSmtPadProps extends Omit { - name?: string - shape: "circle" - radius: Distance - portHints?: PortHints - coveredWithSolderMask?: boolean - solderMaskMargin?: Distance -} - - -export interface CircleSolderPasteProps - extends Omit { - shape: "circle" - radius: Distance -} - - -export interface CircularHoleWithRectPlatedProps - extends Omit { - name?: string - connectsTo?: string | string[] - shape: "circular_hole_with_rect_pad" - holeDiameter: number | string - rectPadWidth: number | string - rectPadHeight: number | string - rectBorderRadius?: number | string - holeShape?: "circle" - padShape?: "rect" - portHints?: PortHints - holeOffsetX?: number | string - holeOffsetY?: number | string - solderMaskMargin?: Distance - coveredWithSolderMask?: boolean -} - - -export interface CommonComponentProps - extends CommonLayoutProps { - key?: any - name: string - displayName?: string - datasheetUrl?: string - pinAttributes?: Record - supplierPartNumbers?: SupplierPartNumbers - cadModel?: CadModelProp - kicadFootprintMetadata?: KicadFootprintMetadata - kicadSymbolMetadata?: KicadSymbolMetadata - children?: any - symbolName?: string - doNotPlace?: boolean - /** - * Does this component take up all the space within its bounds on a layer. This is generally true - * except for when separated pin headers are being represented by a single component (in which case, - * chips can be placed between the pin headers) or for tall modules where chips fit underneath. - */ - obstructsWithinBounds?: boolean - /** - * Whether to show this component's CAD model as translucent in the 3D viewer. - */ - showAsTranslucentModel?: boolean - mfn?: string - manufacturerPartNumber?: string -} - - -export interface CommonLayoutProps { - pcbX?: string | number - pcbY?: string | number - /** - * Position the left, right, top, or bottom edge of the component. Setting any of these - * properties changes the anchor used for pcb positioning to the specified edge. - */ - pcbLeftEdgeX?: string | number - pcbRightEdgeX?: string | number - pcbTopEdgeY?: string | number - pcbBottomEdgeY?: string | number - pcbOffsetX?: string | number - pcbOffsetY?: string | number - pcbRotation?: string | number - pcbPositionAnchor?: string - pcbPositionMode?: PcbPositionMode - - pcbMarginTop?: string | number - pcbMarginRight?: string | number - pcbMarginBottom?: string | number - pcbMarginLeft?: string | number - pcbMarginX?: string | number - pcbMarginY?: string | number - pcbStyle?: PcbStyle - pcbSx?: PcbSx - - schMarginTop?: string | number - schMarginRight?: string | number - schMarginBottom?: string | number - schMarginLeft?: string | number - schMarginX?: string | number - schMarginY?: string | number - - schX?: string | number - schY?: string | number - schRotation?: string | number - - layer?: LayerRefInput - footprint?: FootprintProp - symbol?: SymbolProp - schStyle?: SchStyle - - /** - * If true, X/Y coordinates will be interpreted relative to the parent group - */ - relative?: boolean - - /** - * If true, schX/schY will be interpreted relative to the parent group - */ - schRelative?: boolean - - /** - * If true, pcbX/pcbY will be interpreted relative to the parent group - */ - pcbRelative?: boolean -} - - -export interface ConnectorProps extends CommonComponentProps { - manufacturerPartNumber?: string - pinLabels?: Record< - number | SchematicPinLabel, - SchematicPinLabel | SchematicPinLabel[] - > - schPinStyle?: SchematicPinStyle - schPinSpacing?: number | string - schWidth?: number | string - schHeight?: number | string - schDirection?: "left" | "right" - schPortArrangement?: SchematicPortArrangement - /** - * Groups of pins that are internally connected - * e.g., [["1","2"], ["2","3"]] - */ - internallyConnectedPins?: (string | number)[][] - /** - * Connector standard, e.g. usb_c, m2 - */ - standard?: "usb_c" | "m2" -} - - -export interface ConstrainedLayoutProps { - name?: string - pcbOnly?: boolean - schOnly?: boolean -} - - -export interface CopperPourProps { - name?: string - layer: LayerRefInput - connectsTo: string - padMargin?: Distance - traceMargin?: Distance - clearance?: Distance - boardEdgeMargin?: Distance - cutoutMargin?: Distance - outline?: Point[] - coveredWithSolderMask?: boolean -} - - -export interface CrystalProps - extends CommonComponentProps { - frequency: number | string - loadCapacitance: number | string - manufacturerPartNumber?: string - mpn?: string - pinVariant?: PinVariant - schOrientation?: SchematicOrientation - connections?: Connections -} - - -export interface CurrentSourceProps - extends CommonComponentProps { - current?: number | string - frequency?: number | string - peakToPeakCurrent?: number | string - waveShape?: WaveShape - phase?: number | string - dutyCycle?: number | string - connections?: Connections -} - - -export interface DiodeProps - extends CommonComponentProps { - connections?: { - anode?: string | string[] | readonly string[] - cathode?: string | string[] | readonly string[] - pin1?: string | string[] | readonly string[] - pin2?: string | string[] | readonly string[] - pos?: string | string[] | readonly string[] - neg?: string | string[] | readonly string[] - } - variant?: "standard" | "schottky" | "zener" | "avalanche" | "photo" | "tvs" - standard?: boolean - schottky?: boolean - zener?: boolean - avalanche?: boolean - photo?: boolean - tvs?: boolean - schOrientation?: SchematicOrientation -} - - -export interface EditPcbComponentLocationEvent extends BaseManualEditEvent { - edit_event_type: "edit_pcb_component_location" - /** @deprecated */ - pcb_edit_event_type: "edit_component_location" - pcb_component_id: string - original_center: { x: number; y: number } - new_center: { x: number; y: number } -} - - -export interface EditPcbGroupLocationEvent extends BaseManualEditEvent { - edit_event_type: "edit_pcb_group_location" - pcb_group_id: string - original_center: { x: number; y: number } - new_center: { x: number; y: number } -} - - -export interface EditSchematicComponentLocationEvent - extends BaseManualEditEvent { - edit_event_type: "edit_schematic_component_location" - schematic_component_id: string - original_center: { x: number; y: number } - new_center: { x: number; y: number } -} - - -export interface EditSchematicGroupLocationEvent extends BaseManualEditEvent { - edit_event_type: "edit_schematic_group_location" - schematic_group_id: string - original_center: { x: number; y: number } - new_center: { x: number; y: number } -} - - -export interface EditTraceHintEvent extends BaseManualEditEvent { - /** @deprecated */ - pcb_edit_event_type: "edit_trace_hint" - edit_event_type?: "edit_pcb_trace_hint" - pcb_port_id: string - pcb_trace_hint_id?: string - route: Array<{ x: number; y: number; via?: boolean }> -} - - -export interface FabricationNoteDimensionProps - extends Omit< - PcbLayoutProps, - | "pcbLeftEdgeX" - | "pcbRightEdgeX" - | "pcbTopEdgeY" - | "pcbBottomEdgeY" - | "pcbX" - | "pcbY" - | "pcbOffsetX" - | "pcbOffsetY" - | "pcbRotation" - > { - from: string | Point - to: string | Point - text?: string - offset?: string | number - font?: "tscircuit2024" - fontSize?: string | number - color?: string - arrowSize?: string | number - units?: "in" | "mm" - outerEdgeToEdge?: true - centerToCenter?: true - innerEdgeToEdge?: true -} - - -export interface FabricationNoteTextProps extends PcbLayoutProps { - text: string - anchorAlignment?: - | "center" - | "top_left" - | "top_right" - | "bottom_left" - | "bottom_right" - font?: "tscircuit2024" - fontSize?: string | number - color?: string -} - - -export interface FiducialProps extends CommonComponentProps { - soldermaskPullback?: Distance - padDiameter?: Distance -} - - -export interface FootprintFileParserEntry { - loadFromUrl: (url: string) => Promise -} - - -export interface FootprintLibraryResult { - footprintCircuitJson: any[] - cadModel?: CadModelProp -} - - -export interface FootprintProps { - children?: any - /** - * The layer that the footprint is designed for. If you set this to "top" - * then it means the children were intended to represent the top layer. If - * the with this footprint is moved to the bottom layer, then the - * components will be mirrored. - * - * Generally, you shouldn't set this except where it can help prevent - * confusion because you have a complex multi-layer footprint. Default is - * "top" and this is most intuitive. - */ - originalLayer?: LayerRef - /** - * Serialized circuit JSON describing a precompiled footprint - */ - circuitJson?: any[] - /** - * Can be a footprint or kicad string - */ - src?: FootprintProp -} - - -export interface FuseProps - extends CommonComponentProps { - /** - * Current rating of the fuse in amperes - */ - currentRating: number | string - - /** - * Voltage rating of the fuse - */ - voltageRating?: number | string - - /** - * Whether to show ratings on schematic - */ - schShowRatings?: boolean - - schOrientation?: SchematicOrientation - - /** - * Connections to other components - */ - connections?: Connections -} - - -export interface HoleWithPolygonPadPlatedHoleProps - extends Omit { - name?: string - connectsTo?: string | string[] - shape: "hole_with_polygon_pad" - holeShape: "circle" | "oval" | "pill" | "rotated_pill" - holeDiameter?: number | string - holeWidth?: number | string - holeHeight?: number | string - padOutline: Point[] - holeOffsetX: number | string - holeOffsetY: number | string - portHints?: PortHints - solderMaskMargin?: Distance - coveredWithSolderMask?: boolean -} - - -export interface InductorProps - extends CommonComponentProps { - inductance: number | string - maxCurrentRating?: number | string - schOrientation?: SchematicOrientation - connections?: Connections -} - - -export interface InterconnectProps extends CommonComponentProps { - standard?: "TSC0001_36P_XALT_2025_11" | "0805" | "0603" | "1206" - pinLabels?: Record< - number | SchematicPinLabel, - SchematicPinLabel | SchematicPinLabel[] - > - /** - * Groups of pins that are internally connected - * e.g., [["1","2"], ["2","3"]] - */ - internallyConnectedPins?: (string | number)[][] -} - - -export interface JumperProps extends CommonComponentProps { - manufacturerPartNumber?: string - pinLabels?: Record< - number | SchematicPinLabel, - SchematicPinLabel | SchematicPinLabel[] - > - schPinStyle?: SchematicPinStyle - schPinSpacing?: number | string - schWidth?: number | string - schHeight?: number | string - schDirection?: "left" | "right" - schPinArrangement?: SchematicPortArrangement - /** - * @deprecated Use schPinArrangement instead. - */ - schPortArrangement?: SchematicPortArrangement - /** - * Labels for PCB pins - */ - pcbPinLabels?: Record - /** - * Number of pins on the jumper (2 or 3) - */ - pinCount?: 2 | 3 - /** - * Groups of pins that are internally connected - * e.g., [["1","2"], ["2","3"]] - */ - internallyConnectedPins?: (string | number)[][] - /** - * Connections to other components - */ - connections?: Connections -} - - -export interface KicadAt { - x: number | string - y: number | string - rotation?: number | string -} - - -export interface KicadEffects { - font?: KicadFont -} - - -export interface KicadFont { - size?: { x: number | string; y: number | string } - thickness?: number | string -} - - -export interface KicadFootprintAttributes { - through_hole?: boolean - smd?: boolean - exclude_from_pos_files?: boolean - exclude_from_bom?: boolean -} - - -export interface KicadFootprintMetadata { - footprintName?: string - version?: number | string - generator?: string - generatorVersion?: number | string - layer?: string - properties?: KicadFootprintProperties - attributes?: KicadFootprintAttributes - pads?: KicadFootprintPad[] - embeddedFonts?: boolean - model?: KicadFootprintModel -} - - -export interface KicadFootprintModel { - path: string - offset?: { x: number | string; y: number | string; z: number | string } - scale?: { x: number | string; y: number | string; z: number | string } - rotate?: { x: number | string; y: number | string; z: number | string } -} - - -export interface KicadFootprintPad { - name: string - type: string - shape?: string - at?: KicadAt - size?: { x: number | string; y: number | string } - drill?: number | string - layers?: string[] - removeUnusedLayers?: boolean - uuid?: string -} - - -export interface KicadFootprintProperties { - Reference?: KicadProperty - Value?: KicadProperty - Datasheet?: KicadProperty - Description?: KicadProperty -} - - -export interface KicadPinMetadata { - electricalType?: KicadPinElectricalType - graphicStyle?: KicadPinGraphicStyle - pinLength?: Distance - nameTextSize?: Distance - numberTextSize?: Distance -} - - -export interface KicadProperty { - value: string - at?: KicadAt - layer?: string - uuid?: string - hide?: boolean - effects?: KicadEffects -} - - -export interface KicadSymbolEffects { - font?: KicadFont - justify?: string | string[] - hide?: boolean -} - - -export interface KicadSymbolMetadata { - symbolName?: string - extends?: string - pinNumbers?: KicadSymbolPinNumbers - pinNames?: KicadSymbolPinNames - excludeFromSim?: boolean - inBom?: boolean - onBoard?: boolean - properties?: KicadSymbolProperties - embeddedFonts?: boolean -} - - -export interface KicadSymbolPinNames { - offset?: number | string - hide?: boolean -} - - -export interface KicadSymbolPinNumbers { - hide?: boolean -} - - -export interface KicadSymbolProperties { - Reference?: KicadSymbolProperty - Value?: KicadSymbolProperty - Footprint?: KicadSymbolProperty - Datasheet?: KicadSymbolProperty - Description?: KicadSymbolProperty - ki_keywords?: KicadSymbolProperty - ki_fp_filters?: KicadSymbolProperty -} - - -export interface KicadSymbolProperty { - value: string - id?: number | string - at?: KicadAt - effects?: KicadSymbolEffects -} - - -export interface LayoutConfig { - layoutMode?: "grid" | "flex" | "match-adapt" | "relative" | "none" - position?: "absolute" | "relative" - - grid?: boolean - gridCols?: number | string - gridRows?: number | string - gridTemplateRows?: string - gridTemplateColumns?: string - gridTemplate?: string - gridGap?: number | string - gridRowGap?: number | string - gridColumnGap?: number | string - - flex?: boolean | string - flexDirection?: "row" | "column" - alignItems?: "start" | "center" | "end" | "stretch" - justifyContent?: - | "start" - | "center" - | "end" - | "stretch" - | "space-between" - | "space-around" - | "space-evenly" - flexRow?: boolean - flexColumn?: boolean - gap?: number | string - - pack?: boolean - packOrderStrategy?: - | "largest_to_smallest" - | "first_to_last" - | "highest_to_lowest_pin_count" - packPlacementStrategy?: "shortest_connection_along_outline" - - padding?: Distance - paddingLeft?: Distance - paddingRight?: Distance - paddingTop?: Distance - paddingBottom?: Distance - paddingX?: Distance - paddingY?: Distance - - width?: Distance - height?: Distance - - matchAdapt?: boolean - matchAdaptTemplate?: any -} - - -export interface ManualEditsFile { - pcb_placements?: ManualPcbPlacement[] - manual_trace_hints?: ManualTraceHint[] - schematic_placements?: ManualSchematicPlacement[] -} - - -export interface ManualPcbPlacement { - selector: string - relative_to: string - center: Point -} - - -export interface ManualSchematicPlacement { - selector: string - relative_to: string - center: Point -} - - -export interface ManualTraceHint { - pcb_port_selector: string - offsets: Array -} - - -export interface MosfetProps - extends CommonComponentProps { - channelType: "n" | "p" - mosfetMode: "enhancement" | "depletion" -} - - -export interface MountedBoardProps extends SubcircuitGroupProps { - boardToBoardDistance?: Distance - mountOrientation?: "faceDown" | "faceUp" -} - - -export interface NetAliasProps { - net?: string - connection?: string - schX?: number | string - schY?: number | string - schRotation?: number | string - anchorSide?: "left" | "top" | "right" | "bottom" -} - - -export interface NetLabelProps { - net?: string - connection?: string - connectsTo?: string | string[] - schX?: number | string - schY?: number | string - schRotation?: number | string - anchorSide?: "left" | "top" | "right" | "bottom" -} - - -export interface NetProps { - name: string - connectsTo?: string | string[] - highlightColor?: string - isPowerNet?: boolean - isGroundNet?: boolean -} - - -export interface NonSubcircuitGroupProps extends BaseGroupProps { - subcircuit?: false | undefined -} - - -export interface OpAmpProps - extends CommonComponentProps { - connections?: Connections -} - - -export interface OvalPlatedHoleProps extends Omit { - name?: string - connectsTo?: string | string[] - shape: "oval" - outerWidth: number | string - outerHeight: number | string - holeWidth: number | string - holeHeight: number | string - portHints?: PortHints - solderMaskMargin?: Distance - - /** @deprecated use holeWidth */ - innerWidth?: number | string - /** @deprecated use holeHeight */ - innerHeight?: number | string - coveredWithSolderMask?: boolean -} - - -export interface PanelProps - extends Omit { - width?: Distance - height?: Distance - children?: BaseGroupProps["children"] - anchorAlignment?: z.infer - /** - * If true, prevent a solder mask from being applied to this panel. - */ - noSolderMask?: boolean - /** Method for panelization */ - panelizationMethod?: "tab-routing" | "none" - /** Gap between boards in a panel */ - boardGap?: Distance - layoutMode?: "grid" | "pack" | "none" - row?: number - col?: number - cellWidth?: Distance - cellHeight?: Distance - tabWidth?: Distance - tabLength?: Distance - mouseBites?: boolean - edgePadding?: Distance - edgePaddingLeft?: Distance - edgePaddingRight?: Distance - edgePaddingTop?: Distance - edgePaddingBottom?: Distance -} - - -export interface PcbLayoutProps { - pcbX?: string | number - pcbY?: string | number - /** - * Position the left, right, top, or bottom edge of the component. Setting any of these - * properties changes the anchor used for pcb positioning to the specified edge. - */ - pcbLeftEdgeX?: string | number - pcbRightEdgeX?: string | number - pcbTopEdgeY?: string | number - pcbBottomEdgeY?: string | number - pcbOffsetX?: string | number - pcbOffsetY?: string | number - pcbRotation?: string | number - pcbPositionAnchor?: string - pcbPositionMode?: PcbPositionMode - layer?: LayerRefInput - pcbMarginTop?: string | number - pcbMarginRight?: string | number - pcbMarginBottom?: string | number - pcbMarginLeft?: string | number - pcbMarginX?: string | number - pcbMarginY?: string | number - pcbStyle?: PcbStyle - pcbSx?: PcbSx - /** - * If true, pcbX/pcbY will be interpreted relative to the parent group - */ - pcbRelative?: boolean - /** - * If true, both pcb and schematic coordinates will be interpreted relative to the parent group - */ - relative?: boolean -} - - -export interface PcbNoteDimensionProps - extends Omit< - PcbLayoutProps, - | "pcbLeftEdgeX" - | "pcbRightEdgeX" - | "pcbTopEdgeY" - | "pcbBottomEdgeY" - | "pcbX" - | "pcbY" - | "pcbOffsetX" - | "pcbOffsetY" - | "pcbRotation" - > { - from: string | Point - to: string | Point - text?: string - offset?: string | number - font?: "tscircuit2024" - fontSize?: string | number - color?: string - arrowSize?: string | number - units?: "in" | "mm" - outerEdgeToEdge?: true - centerToCenter?: true - innerEdgeToEdge?: true -} - - -export interface PcbNoteLineProps - extends Omit< - PcbLayoutProps, - | "pcbLeftEdgeX" - | "pcbRightEdgeX" - | "pcbTopEdgeY" - | "pcbBottomEdgeY" - | "pcbX" - | "pcbY" - | "pcbOffsetX" - | "pcbOffsetY" - | "pcbRotation" - > { - x1: string | number - y1: string | number - x2: string | number - y2: string | number - strokeWidth?: string | number - color?: string - isDashed?: boolean -} - - -export interface PcbNotePathProps - extends Omit< - PcbLayoutProps, - | "pcbLeftEdgeX" - | "pcbRightEdgeX" - | "pcbTopEdgeY" - | "pcbBottomEdgeY" - | "pcbX" - | "pcbY" - | "pcbOffsetX" - | "pcbOffsetY" - | "pcbRotation" - > { - route: RouteHintPointInput[] - strokeWidth?: string | number - color?: string -} - - -export interface PcbNoteRectProps extends Omit { - width: string | number - height: string | number - strokeWidth?: string | number - isFilled?: boolean - hasStroke?: boolean - isStrokeDashed?: boolean - color?: string - cornerRadius?: string | number -} - - -export interface PcbNoteTextProps extends PcbLayoutProps { - text: string - anchorAlignment?: - | "center" - | "top_left" - | "top_right" - | "bottom_left" - | "bottom_right" - font?: "tscircuit2024" - fontSize?: string | number - color?: string -} - - -export interface PcbRouteCache { - pcbTraces: PcbTrace[] - cacheKey: string -} - - -export interface PcbStyle { - silkscreenFontSize?: string | number - viaPadDiameter?: string | number - viaHoleDiameter?: string | number - silkscreenTextPosition?: - | "centered" - | "outside" - | "none" - | { - offsetX: number - offsetY: number - } - silkscreenTextVisibility?: "hidden" | "visible" | "inherit" -} - - -export interface PcbSxValue { - fontSize?: string | number - pcbX?: string | number - pcbY?: string | number -} - - -export interface PillHoleProps extends PcbLayoutProps { - name?: string - shape: "pill" - width: Distance - height: Distance - solderMaskMargin?: Distance - coveredWithSolderMask?: boolean -} - - -export interface PillPlatedHoleProps extends Omit { - name?: string - rectPad?: boolean - connectsTo?: string | string[] - shape: "pill" - outerWidth: number | string - outerHeight: number | string - holeWidth: number | string - holeHeight: number | string - holeOffsetX?: number | string - holeOffsetY?: number | string - - /** @deprecated use holeWidth */ - innerWidth?: number | string - /** @deprecated use holeHeight */ - innerHeight?: number | string - - portHints?: PortHints - solderMaskMargin?: Distance - coveredWithSolderMask?: boolean -} - - -export interface PillSmtPadProps extends Omit { - name?: string - shape: "pill" - width: Distance - height: Distance - radius: Distance - portHints?: PortHints - coveredWithSolderMask?: boolean - solderMaskMargin?: Distance -} - - -export interface PillWithRectPadPlatedHoleProps - extends Omit { - name?: string - connectsTo?: string | string[] - shape: "pill_hole_with_rect_pad" - holeShape?: "pill" - padShape?: "rect" - holeWidth: number | string - holeHeight: number | string - rectPadWidth: number | string - rectPadHeight: number | string - portHints?: PortHints - holeOffsetX?: number | string - holeOffsetY?: number | string - solderMaskMargin?: Distance - coveredWithSolderMask?: boolean -} - - -export interface PinAttributeMap { - providesPower?: boolean - requiresPower?: boolean - providesGround?: boolean - requiresGround?: boolean - providesVoltage?: string | number - requiresVoltage?: string | number - doNotConnect?: boolean - includeInBoardPinout?: boolean - highlightColor?: string - mustBeConnected?: boolean -} - - -export interface PinCompatibleVariant { - manufacturerPartNumber?: string - supplierPartNumber?: SupplierPartNumbers -} - - -export interface PinHeaderProps extends CommonComponentProps { - /** - * Number of pins in the header - */ - pinCount: number - - /** - * Distance between pins - */ - pitch?: number | string - - /** - * Schematic facing direction - */ - schFacingDirection?: "up" | "down" | "left" | "right" - - /** - * Whether the header is male, female, or unpopulated - */ - gender?: "male" | "female" | "unpopulated" - - /** - * Whether to show pin labels in silkscreen - */ - showSilkscreenPinLabels?: boolean - - /** - * Labels for PCB pins - */ - pcbPinLabels?: Record - - /** - * Whether the header has two rows of pins - */ - doubleRow?: boolean - - /** - * If true, the header is a right-angle style connector - */ - rightAngle?: boolean - - /** - * Orientation of the header on the PCB - */ - pcbOrientation?: PcbOrientation - - /** - * Diameter of the through-hole for each pin - */ - holeDiameter?: number | string - - /** - * Diameter of the plated area around each hole - */ - platedDiameter?: number | string - - /** - * Labels for each pin - */ - pinLabels?: Record | SchematicPinLabel[] - - /** - * Connections to other components - */ - connections?: Connections - - /** - * Direction the header is facing - */ - facingDirection?: "left" | "right" - - /** - * Pin arrangement in schematic view - */ - schPinArrangement?: SchematicPinArrangement - - /** - * Schematic pin style (margins, etc) - */ - schPinStyle?: SchematicPinStyle - - /** - * Schematic pin spacing - */ - schPinSpacing?: number | string - - /** - * Schematic width - */ - schWidth?: number | string - - /** - * Schematic height - */ - schHeight?: number | string -} - - -export interface PinSideDefinition { - pins: Array - direction: - | "top-to-bottom" - | "left-to-right" - | "bottom-to-top" - | "right-to-left" -} - - -export interface PlatformConfig { - partsEngine?: PartsEngine - - autorouter?: AutorouterProp - - autorouterMap?: Record - - // TODO this follows a subset of the localStorage interface - localCacheEngine?: any - - registryApiUrl?: string - - cloudAutorouterUrl?: string - - projectName?: string - projectBaseUrl?: string - version?: string - url?: string - printBoardInformationToSilkscreen?: boolean - includeBoardFiles?: string[] - snapshotsDir?: string - - defaultSpiceEngine?: AutocompleteString<"spicey" | "ngspice"> - - pcbDisabled?: boolean - schematicDisabled?: boolean - partsEngineDisabled?: boolean - - spiceEngineMap?: Record - - footprintLibraryMap?: Record< - string, - | (( - path: string, - options?: { resolvedPcbStyle?: PcbStyle }, - ) => Promise) - | Record< - string, - | any[] - | (( - path: string, - options?: { resolvedPcbStyle?: PcbStyle }, - ) => Promise) - > - > - - footprintFileParserMap?: Record - - resolveProjectStaticFileImportUrl?: (path: string) => Promise - nodeModulesResolver?: (modulePath: string) => Promise - platformFetch?: typeof fetch -} - - -export interface PolygonCutoutProps - extends Omit { - name?: string - shape: "polygon" - points: Point[] -} - - -export interface PolygonSmtPadProps - extends Omit { - name?: string - shape: "polygon" - points: Point[] - portHints?: PortHints - coveredWithSolderMask?: boolean - solderMaskMargin?: Distance -} - - -export interface PotentiometerProps extends CommonComponentProps { - maxResistance: number | string - pinVariant?: PotentiometerPinVariant -} - - -export interface RectCutoutProps - extends Omit { - name?: string - shape: "rect" - width: Distance - height: Distance -} - - -export interface RectHoleProps extends PcbLayoutProps { - name?: string - shape: "rect" - width: Distance - height: Distance - solderMaskMargin?: Distance - coveredWithSolderMask?: boolean -} - - -export interface RectSmtPadProps extends Omit { - name?: string - shape: "rect" - width: Distance - height: Distance - rectBorderRadius?: Distance - cornerRadius?: Distance - portHints?: PortHints - coveredWithSolderMask?: boolean - solderMaskMargin?: Distance - solderMaskMarginLeft?: Distance - solderMaskMarginRight?: Distance - solderMaskMarginTop?: Distance - solderMaskMarginBottom?: Distance -} - - -export interface RectSolderPasteProps - extends Omit { - shape: "rect" - width: Distance - height: Distance -} - - -export interface ResistorProps - extends CommonComponentProps { - resistance: number | string - tolerance?: number | string - pullupFor?: string - pullupTo?: string - pulldownFor?: string - pulldownTo?: string - schOrientation?: SchematicOrientation - schSize?: SchematicSymbolSize - connections?: Connections -} - - -export interface ResonatorProps extends CommonComponentProps { - frequency: number | string - loadCapacitance: number | string - pinVariant?: ResonatorPinVariant -} - - -export interface RotatedRectSmtPadProps - extends Omit { - name?: string - shape: "rotated_rect" - width: Distance - height: Distance - cornerRadius?: Distance - ccwRotation: number - portHints?: PortHints - coveredWithSolderMask?: boolean - solderMaskMargin?: Distance - solderMaskMarginLeft?: Distance - solderMaskMarginRight?: Distance - solderMaskMarginTop?: Distance - solderMaskMarginBottom?: Distance -} - - -export interface SchematicArcProps { - center: Point - radius: Distance - startAngleDegrees: number | string - endAngleDegrees: number | string - direction?: "clockwise" | "counterclockwise" - strokeWidth?: Distance - color?: string - isDashed?: boolean -} - - -export interface SchematicBoxProps { - schX?: Distance - schY?: Distance - width?: Distance - height?: Distance - overlay?: string[] - padding?: Distance - paddingLeft?: Distance - paddingRight?: Distance - paddingTop?: Distance - paddingBottom?: Distance - title?: string - titleAlignment?: z.infer - titleColor?: string - titleFontSize?: Distance - titleInside?: boolean - strokeStyle?: "solid" | "dashed" -} - - -export interface SchematicCellProps { - children?: string - horizontalAlign?: "left" | "center" | "right" - verticalAlign?: "top" | "middle" | "bottom" - fontSize?: number | string - rowSpan?: number - colSpan?: number - width?: number | string - text?: string -} - - -export interface SchematicCircleProps { - center: Point - radius: Distance - strokeWidth?: Distance - color?: string - isFilled?: boolean - fillColor?: string - isDashed?: boolean -} - - -export interface SchematicLineProps { - x1: Distance - y1: Distance - x2: Distance - y2: Distance - strokeWidth?: Distance - color?: string - isDashed?: boolean -} - - -export interface SchematicPathProps { - points?: Point[] - svgPath?: string - strokeWidth?: Distance - strokeColor?: string - isFilled?: boolean - fillColor?: string -} - - -export interface SchematicPortArrangementWithPinCounts { - leftPinCount?: number - topPinCount?: number - rightPinCount?: number - bottomPinCount?: number -} - - -export interface SchematicPortArrangementWithSides { - leftSide?: PinSideDefinitionInput - topSide?: PinSideDefinitionInput - rightSide?: PinSideDefinitionInput - bottomSide?: PinSideDefinitionInput -} - - -export interface SchematicPortArrangementWithSizes { - leftSize?: number - topSize?: number - rightSize?: number - bottomSize?: number -} - - -export interface SchematicRectProps { - schX?: Distance - schY?: Distance - width: Distance - height: Distance - rotation?: number | string - strokeWidth?: Distance - color?: string - isFilled?: boolean - fillColor?: string - isDashed?: boolean - cornerRadius?: Distance -} - - -export interface SchematicRowProps { - children?: any - height?: number | string -} - - -export interface SchematicTableProps { - schX?: number | string - schY?: number | string - children?: any - cellPadding?: number | string - borderWidth?: number | string - anchor?: z.infer - fontSize?: number | string -} - - -export interface SchematicTextProps { - schX?: Distance - schY?: Distance - text: string - fontSize?: number - anchor?: z.infer | z.infer - color?: string - schRotation?: number | string -} - - -export interface SchStyle { - defaultPassiveSize?: "xs" | "sm" | "md" | string | number - defaultCapacitorOrientation?: "vertical" | "none" -} - - -export interface SolderJumperProps extends JumperProps { - /** - * Pins that are bridged with solder by default - */ - bridgedPins?: string[][] - /** - * If true, all pins are connected with cuttable traces - */ - bridged?: boolean -} - - -export interface SpiceEngine { - simulate: (spiceString: string) => Promise -} - - -export interface SpiceEngineSimulationResult { - engineVersionString?: string - simulationResultCircuitJson: CircuitJson -} - - -export interface StampboardProps extends BoardProps { - leftPinCount?: number - rightPinCount?: number - topPinCount?: number - bottomPinCount?: number - leftPins?: string[] - rightPins?: string[] - topPins?: string[] - bottomPins?: string[] - pinPitch?: number | string - innerHoles?: boolean -} - - -export interface SubcircuitGroupProps extends BaseGroupProps { - manualEdits?: ManualEditsFileInput - routingDisabled?: boolean - bomDisabled?: boolean - defaultTraceWidth?: Distance - minTraceWidth?: Distance - nominalTraceWidth?: Distance - pcbRouteCache?: PcbRouteCache - - autorouter?: AutorouterProp - autorouterEffortLevel?: "1x" | "2x" | "5x" | "10x" | "100x" - autorouterVersion?: "v1" | "v2" | "latest" - - /** - * Serialized circuit JSON describing a precompiled subcircuit - */ - circuitJson?: any[] - - /** - * If true, we'll automatically layout the schematic for this group. Must be - * a subcircuit (currently). This is eventually going to be replaced with more - * sophisticated layout options/modes and will be enabled by default. - */ - schAutoLayoutEnabled?: boolean - - /** - * If true, net labels will automatically be created for complex traces - */ - schTraceAutoLabelEnabled?: boolean - - /** Maximum length a trace can span on the schematic */ - schMaxTraceDistance?: Distance - - partsEngine?: PartsEngine - _subcircuitCachingEnabled?: boolean - - /** When autosizing, the board will be made square */ - square?: boolean - /** Desired empty area of the board e.g. "22mm^2" or "20%" */ - emptyArea?: string - /** Desired filled area of the board e.g. "22mm^2" or "20%" */ - filledArea?: string - - width?: number | string - height?: number | string - outline?: Point[] - outlineOffsetX?: number | string - outlineOffsetY?: number | string -} - - -export interface SubcircuitGroupPropsWithBool extends SubcircuitGroupProps { - subcircuit: true -} - - -export interface SupplierProps { - supplierPartNumbers?: SupplierPartNumbers -} - - -export interface SwitchProps extends CommonComponentProps { - type?: "spst" | "spdt" | "dpst" | "dpdt" - isNormallyClosed?: boolean - spdt?: boolean - spst?: boolean - dpst?: boolean - dpdt?: boolean - simSwitchFrequency?: number | string - simCloseAt?: number | string - simOpenAt?: number | string - simStartClosed?: boolean - simStartOpen?: boolean - connections?: Connections -} - - -export interface SymbolProps { - /** - * The facing direction that the symbol is designed for. If you set this to "right", - * then it means the children were intended to represent the symbol facing right. - * Generally, you shouldn't set this except where it can help prevent confusion - * because you have a complex symbol. Default is "right" and this is most intuitive. - */ - originalFacingDirection?: "up" | "down" | "left" | "right" - width?: string | number - height?: string | number - name?: string -} - - -export interface TestpointProps extends CommonComponentProps { - /** - * The footprint variant of the testpoint either a surface pad or through-hole - */ - footprintVariant?: "pad" | "through_hole" - /** - * The shape of the pad if using a pad variant - */ - padShape?: "rect" | "circle" - /** - * Diameter of the copper pad (applies to both SMD pads and plated holes) - */ - padDiameter?: number | string - /** - * Diameter of the hole if using a through-hole testpoint - */ - holeDiameter?: number | string - /** - * Width of the pad when padShape is rect - */ - width?: number | string - /** - * Height of the pad when padShape is rect - */ - height?: number | string - connections?: TestpointConnections -} - - -export interface ToolingrailProps { - children?: any -} - - -export interface TransistorProps - extends CommonComponentProps { - type: "npn" | "pnp" | "bjt" | "jfet" | "mosfet" | "igbt" - connections?: Connections -} - - -export interface ViaProps extends CommonLayoutProps { - name?: string - fromLayer: LayerRefInput - toLayer: LayerRefInput - holeDiameter?: number | string - outerDiameter?: number | string - connectsTo?: string | string[] - netIsAssignable?: boolean -} - - -export interface VoltageProbeProps extends Omit { - name?: string - connectsTo: string - referenceTo?: string - color?: string -} - - -export interface VoltageSourceProps - extends CommonComponentProps { - voltage?: number | string - frequency?: number | string - peakToPeakVoltage?: number | string - waveShape?: WaveShape - phase?: number | string - dutyCycle?: number | string - connections?: Connections -} - -```