kicadts 0.0.43 → 0.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1169,6 +1169,23 @@ declare class SymbolPinNumber extends SxClass {
1169
1169
  getChildren(): SxClass[];
1170
1170
  getString(): string;
1171
1171
  }
1172
+ interface SymbolPinAlternateConstructorParams {
1173
+ alternateName: string;
1174
+ pinElectricalType: PinElectricalType;
1175
+ pinGraphicStyle: PinGraphicStyle;
1176
+ }
1177
+ declare class SymbolPinAlternate extends SxClass {
1178
+ static token: string;
1179
+ static parentToken: string;
1180
+ token: string;
1181
+ alternateName: string;
1182
+ pinElectricalType: PinElectricalType;
1183
+ pinGraphicStyle: PinGraphicStyle;
1184
+ constructor(params: SymbolPinAlternateConstructorParams);
1185
+ static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): SymbolPinAlternate;
1186
+ getChildren(): SxClass[];
1187
+ getString(): string;
1188
+ }
1172
1189
  declare class SymbolPin extends SxClass {
1173
1190
  static token: string;
1174
1191
  static parentToken: string;
@@ -1182,6 +1199,7 @@ declare class SymbolPin extends SxClass {
1182
1199
  _sxUuid?: Uuid;
1183
1200
  private inlineNumber?;
1184
1201
  private _sxHide?;
1202
+ private _alternates;
1185
1203
  static fromSexprPrimitives(args: PrimitiveSExpr[]): SymbolPin;
1186
1204
  get at(): At | undefined;
1187
1205
  set at(value: AtInput | undefined);
@@ -1195,6 +1213,8 @@ declare class SymbolPin extends SxClass {
1195
1213
  set uuid(value: string | undefined);
1196
1214
  get hidden(): boolean;
1197
1215
  set hidden(value: boolean);
1216
+ get alternates(): SymbolPinAlternate[];
1217
+ set alternates(value: SymbolPinAlternate[]);
1198
1218
  getChildren(): SxClass[];
1199
1219
  getString(): string;
1200
1220
  }
@@ -1274,6 +1294,8 @@ declare class KicadSymbolLib extends SxClass {
1274
1294
  set symbols(value: SchematicSymbol[]);
1275
1295
  getChildren(): SxClass[];
1276
1296
  }
1297
+ declare const KicadSym: typeof KicadSymbolLib;
1298
+ type KicadSym = KicadSymbolLib;
1277
1299
 
1278
1300
  declare class LibSymbols extends SxClass {
1279
1301
  static token: string;
@@ -3963,6 +3985,14 @@ declare class ZoneKeepoutVias extends SxPrimitiveString {
3963
3985
  token: string;
3964
3986
  }
3965
3987
 
3988
+ type ZoneKeepoutRule = "allowed" | "not_allowed";
3989
+ interface ZoneKeepoutConstructorParams {
3990
+ tracks?: ZoneKeepoutTracks | ZoneKeepoutRule;
3991
+ vias?: ZoneKeepoutVias | ZoneKeepoutRule;
3992
+ pads?: ZoneKeepoutPads | ZoneKeepoutRule;
3993
+ copperpour?: ZoneKeepoutCopperpour | ZoneKeepoutRule;
3994
+ footprints?: ZoneKeepoutFootprints | ZoneKeepoutRule;
3995
+ }
3966
3996
  declare class ZoneKeepout extends SxClass {
3967
3997
  static token: string;
3968
3998
  static parentToken: string;
@@ -3972,6 +4002,7 @@ declare class ZoneKeepout extends SxClass {
3972
4002
  private _sxPads?;
3973
4003
  private _sxCopperpour?;
3974
4004
  private _sxFootprints?;
4005
+ constructor(params?: ZoneKeepoutConstructorParams);
3975
4006
  static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): ZoneKeepout;
3976
4007
  get tracks(): string | undefined;
3977
4008
  set tracks(value: ZoneKeepoutTracks | string | undefined);
@@ -6452,6 +6483,7 @@ declare class KicadPcb extends SxClass {
6452
6483
  declare const parseKicadSexpr: (sexpr: string) => SxClass[];
6453
6484
  declare const parseKicadSch: (sexpr: string) => KicadSch;
6454
6485
  declare const parseKicadPcb: (sexpr: string) => KicadPcb;
6486
+ declare const parseKicadSym: (sexpr: string) => KicadSymbolLib;
6455
6487
  declare const parseKicadMod: (sexpr: string) => Footprint;
6456
6488
 
6457
- export { At, type AtInput, Back, Bus, type BusConstructorParams, BusEntry, type BusEntryConstructorParams, BusEntrySize, Capping, Color, Covering, Dimension, DimensionFormat, DimensionStyle, Dnp, EmbeddedFile, EmbeddedFileChecksum, type EmbeddedFileConstructorParams, EmbeddedFileData, EmbeddedFileName, EmbeddedFileType, EmbeddedFiles, type EmbeddedFilesConstructorParams, EmbeddedFonts, ExcludeFromSim, FieldsAutoplaced, Filling, Footprint, FootprintAttr, FootprintAutoplaceCost180, FootprintAutoplaceCost90, FootprintClearance, type FootprintConstructorParams, FootprintDescr, FootprintDuplicatePadNumbersAreJumpers, FootprintGenerator, FootprintGeneratorVersion, FootprintLocked, FootprintModel, FootprintNetTiePadGroups, FootprintPad, type FootprintPadConstructorParams, FootprintPath, FootprintPlaced, FootprintPoint, FootprintPointSize, FootprintPrivateLayers, FootprintSheetfile, FootprintSheetname, FootprintSolderMaskMargin, FootprintSolderPasteMargin, FootprintSolderPasteMarginRatio, FootprintSolderPasteRatio, FootprintTags, FootprintTedit, FootprintThermalGap, FootprintThermalWidth, FootprintUnit, FootprintUnitName, FootprintUnitPins, FootprintUnits, FootprintVersion, FootprintZoneConnect, FpArc, type FpArcConstructorParams, FpArcEnd, FpArcMid, FpArcStart, FpCircle, FpCircleCenter, type FpCircleConstructorParams, FpCircleEnd, FpCircleFill, FpCircleNet, FpCurve, type FpCurveConstructorParams, FpCurveLocked, FpLine, type FpLineConstructorParams, FpLineEnd, FpLineNet, FpLineStart, FpPoly, type FpPolyConstructorParams, FpPolyFill, FpPolyLocked, FpRect, type FpRectConstructorParams, FpRectEnd, FpRectFill, FpRectNet, FpRectStart, FpText, FpTextBox, FpTextBoxAngle, type FpTextBoxConstructorParams, FpTextBoxEnd, FpTextBoxStart, type FpTextConstructorParams, type FpTextType, Front, Generated, GlobalLabel, type GlobalLabelConstructorParams, type GlobalLabelShape, GrArc, type GrArcConstructorParams, GrArcEnd, GrArcLocked, GrArcMid, type GrArcPoint, GrArcStart, GrCircle, GrCircleCenter, type GrCircleConstructorParams, GrCircleEnd, GrCircleLocked, type GrCirclePoint, GrCurve, type GrCurveConstructorParams, GrLine, GrLineAngle, type GrLineConstructorParams, GrLineEnd, GrLineLocked, type GrLinePoint, GrLineStart, GrPoly, type GrPolyConstructorParams, GrPolyFill, GrPolyNet, GrRect, type GrRectConstructorParams, GrRectEnd, GrRectFill, GrRectLocked, GrRectStart, GrText, type GrTextConstructorParams, GrTextLocked, type GrTextPosition, GrTextRenderCache, GrTextRenderCachePolygon, Group, type GroupConstructorParams, GroupLocked, GroupMembers, Image, type ImageConstructorParams, ImageData, ImageScale, InBom, InPosFiles, Junction, type JunctionConstructorParams, JunctionDiameter, KicadPcb, type KicadPcbConstructorParams, KicadSch, type KicadSchConstructorParams, KicadSchGenerator, KicadSchGeneratorVersion, KicadSchVersion, KicadSymbolLib, type KicadSymbolLibConstructorParams, KicadSymbolLibGenerator, KicadSymbolLibGeneratorVersion, KicadSymbolLibVersion, Label, type LabelConstructorParams, Layer, Layers, LibSymbols, Mirror, type ModelVector, NoConnect, type NoConnectConstructorParams, OnBoard, PadChamfer, PadChamferRatio, PadClearance, PadDieLength, PadDrill, PadDrillOffset, PadLayers, type PadLayersInput, PadNet, PadOptions, type PadOptionsAnchorShape, type PadOptionsClearanceType, PadPinFunction, PadPinType, PadPrimitiveGrArc, type PadPrimitiveGrArcConstructorParams, PadPrimitiveGrCircle, type PadPrimitiveGrCircleConstructorParams, PadPrimitiveGrCircleFill, PadPrimitiveGrLine, PadPrimitiveGrPoly, PadPrimitives, PadProperty, PadRectDelta, PadRoundrectRratio, PadSize, type PadSizeInput, PadSolderMaskMargin, PadSolderPasteMargin, PadSolderPasteMarginRatio, PadTeardrops, PadThermalBridgeAngle, PadThermalGap, PadThermalWidth, PadZoneConnect, PadZoneLayerConnections, Paper, PcbArc, type PcbArcConstructorParams, type PcbArcPoint, PcbGeneral, PcbGeneralLegacyTeardrops, PcbGeneralThickness, PcbGenerator, PcbGeneratorVersion, PcbLayerDefinition, PcbLayers, PcbNet, PcbPlotParams, PcbVersion, PlotParamCreateGerberJobFile, PlotParamCrossoutDnpOnFab, PlotParamDashedLineDashRatio, PlotParamDashedLineGapRatio, PlotParamDisableApertMacros, PlotParamDrillShape, PlotParamDxfImperialUnits, PlotParamDxfPolygonMode, PlotParamDxfUsePcbnewFont, PlotParamExcludeEdgeLayer, PlotParamHideDnpOnFab, PlotParamHpglPenDiameter, PlotParamHpglPenNumber, PlotParamHpglPenOverlay, PlotParamHpglPenSpeed, PlotParamLayerSelection, PlotParamLineWidth, PlotParamMirror, PlotParamMode, PlotParamOutputDirectory, PlotParamOutputFormat, PlotParamPadOnSilk, PlotParamPdfBackFpPropertyPopups, PlotParamPdfFrontFpPropertyPopups, PlotParamPdfMetadata, PlotParamPdfSingleDocument, PlotParamPlotBlackAndWhite, PlotParamPlotFpText, PlotParamPlotFrameRef, PlotParamPlotInvisible, PlotParamPlotInvisibleText, PlotParamPlotOnAllLayers, PlotParamPlotOnAllLayersSelection, PlotParamPlotOtherText, PlotParamPlotPadNumbers, PlotParamPlotReference, PlotParamPlotValue, PlotParamProperty, PlotParamPsA4Output, PlotParamPsNegative, PlotParamScaleSelection, PlotParamSketchDnpOnFab, PlotParamSketchPadsOnFab, PlotParamSubtractMaskFromSilk, PlotParamSvgPrecision, PlotParamSvgUseInch, PlotParamUseAuxOrigin, PlotParamUseGerberAdvancedAttributes, PlotParamUseGerberAttributes, PlotParamUseGerberExtensions, PlotParamViaOnMask, Plugging, Polyline, type PolylineConstructorParams, Property, type PropertyConstructorParams, PropertyDoNotAutoplace, PropertyHide, PropertyShowName, PropertyUnlocked, Pts, PtsArc, PtsArcEnd, PtsArcMid, PtsArcStart, type RGBAColor, RenderCache, SchematicPolyline, SchematicRectangle, SchematicSymbol, type SchematicSymbolConstructorParams, SchematicText, SchematicTextBox, type SchematicTextConstructorParams, Segment, type SegmentConstructorParams, SegmentEnd, SegmentLocked, SegmentNet, SegmentStart, Setup, SetupAllowSoldermaskBridgesInFootprints, SetupAuxAxisOrigin, SetupEdgeWidth, SetupGridOrigin, SetupLastTraceWidth, SetupModEdgeWidth, SetupModTextSize, SetupModTextWidth, SetupPadDrill, SetupPadSize, SetupPadToMaskClearance, SetupPadToPasteClearance, SetupPadToPasteClearanceRatio, SetupPadToPasteClearanceValues, SetupPcbTextSize, SetupPcbTextWidth, type SetupProperty, type SetupPropertyValues, SetupSegmentWidth, SetupSolderMaskMinWidth, SetupTenting, SetupTraceClearance, SetupTraceMin, SetupTraceWidth, SetupUviaDrill, SetupUviaMinDrill, SetupUviaMinSize, SetupUviaSize, SetupUviasAllowed, SetupViaDrill, SetupViaMinDrill, SetupViaMinSize, SetupViaSize, SetupVisibleElements, SetupZone45Only, SetupZoneClearance, Sheet, type SheetConstructorParams, SheetFill, SheetInstancePage, SheetInstancePath, SheetInstances, SheetInstancesForSheet, SheetInstancesProject, SheetInstancesRoot, SheetInstancesRootPage, SheetInstancesRootPath, SheetPin, type SheetPinElectricalType, SheetProperty, SheetSize, Stackup, StackupCastellatedPads, StackupCopperFinish, StackupDielectricConstraints, StackupEdgeConnector, StackupEdgePlating, StackupLayer, StackupLayerColor, StackupLayerEpsilonR, StackupLayerLossTangent, StackupLayerMaterial, StackupLayerThickness, StackupLayerType, type StandardPaperSize, Stroke, type StrokeProperty, StrokeType, type StrokeTypeString, SxClass, SymbolArc, SymbolArcEnd, SymbolArcFill, SymbolArcMid, SymbolArcStart, SymbolBodyStyle, SymbolBodyStyles, SymbolCircle, SymbolCircleCenter, SymbolCircleFill, SymbolCircleRadius, SymbolDuplicatePinNumbersAreJumpers, SymbolFillType, SymbolInstancePath, SymbolInstanceReference, SymbolInstanceUnit, SymbolInstances, SymbolInstancesProject, SymbolLibId, SymbolLibName, SymbolPin, SymbolPinLength, SymbolPinName, SymbolPinNames, SymbolPinNamesHide, SymbolPinNamesOffset, SymbolPinNumber, SymbolPinNumbers, SymbolPinNumbersHide, SymbolPolyline, SymbolPolylineFill, type SymbolPolylineFillLike, SymbolPower, SymbolProperty, SymbolPropertyId, SymbolRectangle, SymbolRectangleEnd, SymbolRectangleFill, SymbolRectangleStart, SymbolText, SymbolTextBox, SymbolUnit, Target, TextBoxFill, TextBoxSize, TextEffects, type TextEffectsConstructorParams, TextEffectsFont, TextEffectsFontBold, TextEffectsFontFace, TextEffectsFontItalic, TextEffectsFontLineSpacing, type TextEffectsFontProperty, TextEffectsFontSize, TextEffectsFontThickness, TextEffectsJustify, type TextEffectsProperty, TitleBlock, TitleBlockComment, TitleBlockCompany, type TitleBlockConstructorParams, TitleBlockDate, TitleBlockRevision, TitleBlockTitle, Tstamp, Unit, type UnitString, Uuid, Via, type ViaConstructorParams, ViaNet, Width, Wire, type WireConstructorParams, Xy, Zone, ZoneAttr, ZoneAttrTeardrop, ZoneAttrTeardropType, ZoneConnectPads, ZoneConnectPadsClearance, type ZoneConnectPadsMode, type ZoneConstructorParams, ZoneFill, ZoneFillIslandAreaMin, ZoneFillIslandRemovalMode, ZoneFillRadius, ZoneFillSmoothing, ZoneFillThermalBridgeWidth, ZoneFillThermalGap, ZoneFilledAreasThickness, ZoneFilledPolygon, ZoneFilledPolygonIsland, ZoneHatch, ZoneKeepout, ZoneKeepoutCopperpour, ZoneKeepoutFootprints, ZoneKeepoutPads, ZoneKeepoutTracks, ZoneKeepoutVias, ZoneLocked, ZoneMinThickness, ZoneName, ZoneNet, ZoneNetName, ZonePlacement, ZonePlacementEnabled, ZonePlacementSheetname, ZonePolygon, ZonePriority, parseKicadMod, parseKicadPcb, parseKicadSch, parseKicadSexpr };
6489
+ export { At, type AtInput, Back, Bus, type BusConstructorParams, BusEntry, type BusEntryConstructorParams, BusEntrySize, Capping, Color, Covering, Dimension, DimensionFormat, DimensionStyle, Dnp, EmbeddedFile, EmbeddedFileChecksum, type EmbeddedFileConstructorParams, EmbeddedFileData, EmbeddedFileName, EmbeddedFileType, EmbeddedFiles, type EmbeddedFilesConstructorParams, EmbeddedFonts, ExcludeFromSim, FieldsAutoplaced, Filling, Footprint, FootprintAttr, FootprintAutoplaceCost180, FootprintAutoplaceCost90, FootprintClearance, type FootprintConstructorParams, FootprintDescr, FootprintDuplicatePadNumbersAreJumpers, FootprintGenerator, FootprintGeneratorVersion, FootprintLocked, FootprintModel, FootprintNetTiePadGroups, FootprintPad, type FootprintPadConstructorParams, FootprintPath, FootprintPlaced, FootprintPoint, FootprintPointSize, FootprintPrivateLayers, FootprintSheetfile, FootprintSheetname, FootprintSolderMaskMargin, FootprintSolderPasteMargin, FootprintSolderPasteMarginRatio, FootprintSolderPasteRatio, FootprintTags, FootprintTedit, FootprintThermalGap, FootprintThermalWidth, FootprintUnit, FootprintUnitName, FootprintUnitPins, FootprintUnits, FootprintVersion, FootprintZoneConnect, FpArc, type FpArcConstructorParams, FpArcEnd, FpArcMid, FpArcStart, FpCircle, FpCircleCenter, type FpCircleConstructorParams, FpCircleEnd, FpCircleFill, FpCircleNet, FpCurve, type FpCurveConstructorParams, FpCurveLocked, FpLine, type FpLineConstructorParams, FpLineEnd, FpLineNet, FpLineStart, FpPoly, type FpPolyConstructorParams, FpPolyFill, FpPolyLocked, FpRect, type FpRectConstructorParams, FpRectEnd, FpRectFill, FpRectNet, FpRectStart, FpText, FpTextBox, FpTextBoxAngle, type FpTextBoxConstructorParams, FpTextBoxEnd, FpTextBoxStart, type FpTextConstructorParams, type FpTextType, Front, Generated, GlobalLabel, type GlobalLabelConstructorParams, type GlobalLabelShape, GrArc, type GrArcConstructorParams, GrArcEnd, GrArcLocked, GrArcMid, type GrArcPoint, GrArcStart, GrCircle, GrCircleCenter, type GrCircleConstructorParams, GrCircleEnd, GrCircleLocked, type GrCirclePoint, GrCurve, type GrCurveConstructorParams, GrLine, GrLineAngle, type GrLineConstructorParams, GrLineEnd, GrLineLocked, type GrLinePoint, GrLineStart, GrPoly, type GrPolyConstructorParams, GrPolyFill, GrPolyNet, GrRect, type GrRectConstructorParams, GrRectEnd, GrRectFill, GrRectLocked, GrRectStart, GrText, type GrTextConstructorParams, GrTextLocked, type GrTextPosition, GrTextRenderCache, GrTextRenderCachePolygon, Group, type GroupConstructorParams, GroupLocked, GroupMembers, Image, type ImageConstructorParams, ImageData, ImageScale, InBom, InPosFiles, Junction, type JunctionConstructorParams, JunctionDiameter, KicadPcb, type KicadPcbConstructorParams, KicadSch, type KicadSchConstructorParams, KicadSchGenerator, KicadSchGeneratorVersion, KicadSchVersion, KicadSym, KicadSymbolLib, type KicadSymbolLibConstructorParams, KicadSymbolLibGenerator, KicadSymbolLibGeneratorVersion, KicadSymbolLibVersion, Label, type LabelConstructorParams, Layer, Layers, LibSymbols, Mirror, type ModelVector, NoConnect, type NoConnectConstructorParams, OnBoard, PadChamfer, PadChamferRatio, PadClearance, PadDieLength, PadDrill, PadDrillOffset, PadLayers, type PadLayersInput, PadNet, PadOptions, type PadOptionsAnchorShape, type PadOptionsClearanceType, PadPinFunction, PadPinType, PadPrimitiveGrArc, type PadPrimitiveGrArcConstructorParams, PadPrimitiveGrCircle, type PadPrimitiveGrCircleConstructorParams, PadPrimitiveGrCircleFill, PadPrimitiveGrLine, PadPrimitiveGrPoly, PadPrimitives, PadProperty, PadRectDelta, PadRoundrectRratio, PadSize, type PadSizeInput, PadSolderMaskMargin, PadSolderPasteMargin, PadSolderPasteMarginRatio, PadTeardrops, PadThermalBridgeAngle, PadThermalGap, PadThermalWidth, PadZoneConnect, PadZoneLayerConnections, Paper, PcbArc, type PcbArcConstructorParams, type PcbArcPoint, PcbGeneral, PcbGeneralLegacyTeardrops, PcbGeneralThickness, PcbGenerator, PcbGeneratorVersion, PcbLayerDefinition, PcbLayers, PcbNet, PcbPlotParams, PcbVersion, type PinElectricalType, type PinGraphicStyle, PlotParamCreateGerberJobFile, PlotParamCrossoutDnpOnFab, PlotParamDashedLineDashRatio, PlotParamDashedLineGapRatio, PlotParamDisableApertMacros, PlotParamDrillShape, PlotParamDxfImperialUnits, PlotParamDxfPolygonMode, PlotParamDxfUsePcbnewFont, PlotParamExcludeEdgeLayer, PlotParamHideDnpOnFab, PlotParamHpglPenDiameter, PlotParamHpglPenNumber, PlotParamHpglPenOverlay, PlotParamHpglPenSpeed, PlotParamLayerSelection, PlotParamLineWidth, PlotParamMirror, PlotParamMode, PlotParamOutputDirectory, PlotParamOutputFormat, PlotParamPadOnSilk, PlotParamPdfBackFpPropertyPopups, PlotParamPdfFrontFpPropertyPopups, PlotParamPdfMetadata, PlotParamPdfSingleDocument, PlotParamPlotBlackAndWhite, PlotParamPlotFpText, PlotParamPlotFrameRef, PlotParamPlotInvisible, PlotParamPlotInvisibleText, PlotParamPlotOnAllLayers, PlotParamPlotOnAllLayersSelection, PlotParamPlotOtherText, PlotParamPlotPadNumbers, PlotParamPlotReference, PlotParamPlotValue, PlotParamProperty, PlotParamPsA4Output, PlotParamPsNegative, PlotParamScaleSelection, PlotParamSketchDnpOnFab, PlotParamSketchPadsOnFab, PlotParamSubtractMaskFromSilk, PlotParamSvgPrecision, PlotParamSvgUseInch, PlotParamUseAuxOrigin, PlotParamUseGerberAdvancedAttributes, PlotParamUseGerberAttributes, PlotParamUseGerberExtensions, PlotParamViaOnMask, Plugging, Polyline, type PolylineConstructorParams, Property, type PropertyConstructorParams, PropertyDoNotAutoplace, PropertyHide, PropertyShowName, PropertyUnlocked, Pts, PtsArc, PtsArcEnd, PtsArcMid, PtsArcStart, type RGBAColor, RenderCache, SchematicPolyline, SchematicRectangle, SchematicSymbol, type SchematicSymbolConstructorParams, SchematicText, SchematicTextBox, type SchematicTextConstructorParams, Segment, type SegmentConstructorParams, SegmentEnd, SegmentLocked, SegmentNet, SegmentStart, Setup, SetupAllowSoldermaskBridgesInFootprints, SetupAuxAxisOrigin, SetupEdgeWidth, SetupGridOrigin, SetupLastTraceWidth, SetupModEdgeWidth, SetupModTextSize, SetupModTextWidth, SetupPadDrill, SetupPadSize, SetupPadToMaskClearance, SetupPadToPasteClearance, SetupPadToPasteClearanceRatio, SetupPadToPasteClearanceValues, SetupPcbTextSize, SetupPcbTextWidth, type SetupProperty, type SetupPropertyValues, SetupSegmentWidth, SetupSolderMaskMinWidth, SetupTenting, SetupTraceClearance, SetupTraceMin, SetupTraceWidth, SetupUviaDrill, SetupUviaMinDrill, SetupUviaMinSize, SetupUviaSize, SetupUviasAllowed, SetupViaDrill, SetupViaMinDrill, SetupViaMinSize, SetupViaSize, SetupVisibleElements, SetupZone45Only, SetupZoneClearance, Sheet, type SheetConstructorParams, SheetFill, SheetInstancePage, SheetInstancePath, SheetInstances, SheetInstancesForSheet, SheetInstancesProject, SheetInstancesRoot, SheetInstancesRootPage, SheetInstancesRootPath, SheetPin, type SheetPinElectricalType, SheetProperty, SheetSize, Stackup, StackupCastellatedPads, StackupCopperFinish, StackupDielectricConstraints, StackupEdgeConnector, StackupEdgePlating, StackupLayer, StackupLayerColor, StackupLayerEpsilonR, StackupLayerLossTangent, StackupLayerMaterial, StackupLayerThickness, StackupLayerType, type StandardPaperSize, Stroke, type StrokeProperty, StrokeType, type StrokeTypeString, SxClass, SymbolArc, SymbolArcEnd, SymbolArcFill, SymbolArcMid, SymbolArcStart, SymbolBodyStyle, SymbolBodyStyles, SymbolCircle, SymbolCircleCenter, SymbolCircleFill, SymbolCircleRadius, SymbolDuplicatePinNumbersAreJumpers, SymbolFillType, SymbolInstancePath, SymbolInstanceReference, SymbolInstanceUnit, SymbolInstances, SymbolInstancesProject, SymbolLibId, SymbolLibName, SymbolPin, SymbolPinAlternate, type SymbolPinAlternateConstructorParams, SymbolPinLength, SymbolPinName, SymbolPinNames, SymbolPinNamesHide, SymbolPinNamesOffset, SymbolPinNumber, SymbolPinNumbers, SymbolPinNumbersHide, SymbolPolyline, SymbolPolylineFill, type SymbolPolylineFillLike, SymbolPower, SymbolProperty, SymbolPropertyId, SymbolRectangle, SymbolRectangleEnd, SymbolRectangleFill, SymbolRectangleStart, SymbolText, SymbolTextBox, SymbolUnit, Target, TextBoxFill, TextBoxSize, TextEffects, type TextEffectsConstructorParams, TextEffectsFont, TextEffectsFontBold, TextEffectsFontFace, TextEffectsFontItalic, TextEffectsFontLineSpacing, type TextEffectsFontProperty, TextEffectsFontSize, TextEffectsFontThickness, TextEffectsJustify, type TextEffectsProperty, TitleBlock, TitleBlockComment, TitleBlockCompany, type TitleBlockConstructorParams, TitleBlockDate, TitleBlockRevision, TitleBlockTitle, Tstamp, Unit, type UnitString, Uuid, Via, type ViaConstructorParams, ViaNet, Width, Wire, type WireConstructorParams, Xy, Zone, ZoneAttr, ZoneAttrTeardrop, ZoneAttrTeardropType, ZoneConnectPads, ZoneConnectPadsClearance, type ZoneConnectPadsMode, type ZoneConstructorParams, ZoneFill, ZoneFillIslandAreaMin, ZoneFillIslandRemovalMode, ZoneFillRadius, ZoneFillSmoothing, ZoneFillThermalBridgeWidth, ZoneFillThermalGap, ZoneFilledAreasThickness, ZoneFilledPolygon, ZoneFilledPolygonIsland, ZoneHatch, ZoneKeepout, type ZoneKeepoutConstructorParams, ZoneKeepoutCopperpour, ZoneKeepoutFootprints, ZoneKeepoutPads, type ZoneKeepoutRule, ZoneKeepoutTracks, ZoneKeepoutVias, ZoneLocked, ZoneMinThickness, ZoneName, ZoneNet, ZoneNetName, ZonePlacement, ZonePlacementEnabled, ZonePlacementSheetname, ZonePolygon, ZonePriority, parseKicadMod, parseKicadPcb, parseKicadSch, parseKicadSexpr, parseKicadSym };
package/dist/index.js CHANGED
@@ -3495,6 +3495,51 @@ var SymbolPinNumber = class _SymbolPinNumber extends SxClass {
3495
3495
  }
3496
3496
  };
3497
3497
  SxClass.register(SymbolPinNumber);
3498
+ var SymbolPinAlternate = class _SymbolPinAlternate extends SxClass {
3499
+ static token = "alternate";
3500
+ static parentToken = "pin";
3501
+ token = "alternate";
3502
+ alternateName;
3503
+ pinElectricalType;
3504
+ pinGraphicStyle;
3505
+ constructor(params) {
3506
+ super();
3507
+ this.alternateName = params.alternateName;
3508
+ this.pinElectricalType = params.pinElectricalType;
3509
+ this.pinGraphicStyle = params.pinGraphicStyle;
3510
+ }
3511
+ static fromSexprPrimitives(primitiveSexprs) {
3512
+ const [namePrimitive, electricalTypePrimitive, graphicStylePrimitive] = primitiveSexprs;
3513
+ const alternateName = toStringValue(namePrimitive);
3514
+ const electricalType = toStringValue(electricalTypePrimitive);
3515
+ const graphicStyle = toStringValue(graphicStylePrimitive);
3516
+ if (alternateName === void 0) {
3517
+ throw new Error("alternate expects a string name");
3518
+ }
3519
+ if (electricalType === void 0 || !electricalTypeSet.has(electricalType)) {
3520
+ throw new Error(
3521
+ `alternate encountered unsupported electrical type "${electricalType}"`
3522
+ );
3523
+ }
3524
+ if (graphicStyle === void 0 || !graphicStyleSet.has(graphicStyle)) {
3525
+ throw new Error(
3526
+ `alternate encountered unsupported graphic style "${graphicStyle}"`
3527
+ );
3528
+ }
3529
+ return new _SymbolPinAlternate({
3530
+ alternateName,
3531
+ pinElectricalType: electricalType,
3532
+ pinGraphicStyle: graphicStyle
3533
+ });
3534
+ }
3535
+ getChildren() {
3536
+ return [];
3537
+ }
3538
+ getString() {
3539
+ return `(alternate ${quoteSExprString(this.alternateName)} ${this.pinElectricalType} ${this.pinGraphicStyle})`;
3540
+ }
3541
+ };
3542
+ SxClass.register(SymbolPinAlternate);
3498
3543
  var SymbolPin = class _SymbolPin extends SxClass {
3499
3544
  static token = "pin";
3500
3545
  static parentToken = "symbol";
@@ -3508,6 +3553,7 @@ var SymbolPin = class _SymbolPin extends SxClass {
3508
3553
  _sxUuid;
3509
3554
  inlineNumber;
3510
3555
  _sxHide;
3556
+ _alternates = [];
3511
3557
  static fromSexprPrimitives(args) {
3512
3558
  const symbolPin = new _SymbolPin();
3513
3559
  let index = 0;
@@ -3536,16 +3582,14 @@ var SymbolPin = class _SymbolPin extends SxClass {
3536
3582
  }
3537
3583
  primitiveNodes.push(primitive);
3538
3584
  }
3539
- const { propertyMap } = SxClass.parsePrimitivesToClassProperties(
3540
- primitiveNodes,
3541
- this.token
3542
- );
3585
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveNodes, this.token);
3543
3586
  symbolPin._sxAt = propertyMap.at;
3544
3587
  symbolPin._sxLength = propertyMap.length;
3545
3588
  symbolPin._sxName = propertyMap.name;
3546
3589
  symbolPin._sxNumber = propertyMap.number;
3547
3590
  symbolPin._sxUuid = propertyMap.uuid;
3548
3591
  symbolPin._sxHide = propertyMap.hide;
3592
+ symbolPin.alternates = arrayPropertyMap.alternate ?? [];
3549
3593
  for (const flag of primitiveStrings) {
3550
3594
  if (flag === "hide") {
3551
3595
  symbolPin._sxHide = new SymbolPinHide(true, { inline: true });
@@ -3601,6 +3645,12 @@ var SymbolPin = class _SymbolPin extends SxClass {
3601
3645
  set hidden(value) {
3602
3646
  this._sxHide = value ? new SymbolPinHide(value) : void 0;
3603
3647
  }
3648
+ get alternates() {
3649
+ return [...this._alternates];
3650
+ }
3651
+ set alternates(value) {
3652
+ this._alternates = [...value];
3653
+ }
3604
3654
  getChildren() {
3605
3655
  const children = [];
3606
3656
  if (this._sxAt) children.push(this._sxAt);
@@ -3609,6 +3659,7 @@ var SymbolPin = class _SymbolPin extends SxClass {
3609
3659
  if (this._sxNumber) children.push(this._sxNumber);
3610
3660
  if (this._sxUuid) children.push(this._sxUuid);
3611
3661
  if (this._sxHide) children.push(this._sxHide);
3662
+ children.push(...this._alternates);
3612
3663
  return children;
3613
3664
  }
3614
3665
  getString() {
@@ -3901,6 +3952,7 @@ var KicadSymbolLib = class _KicadSymbolLib extends SxClass {
3901
3952
  }
3902
3953
  };
3903
3954
  SxClass.register(KicadSymbolLib);
3955
+ var KicadSym = KicadSymbolLib;
3904
3956
 
3905
3957
  // lib/sexpr/classes/LibSymbols.ts
3906
3958
  var SUPPORTED_ARRAY_TOKENS = /* @__PURE__ */ new Set(["symbol"]);
@@ -12771,6 +12823,14 @@ var ZoneKeepout = class _ZoneKeepout extends SxClass {
12771
12823
  _sxPads;
12772
12824
  _sxCopperpour;
12773
12825
  _sxFootprints;
12826
+ constructor(params = {}) {
12827
+ super();
12828
+ if (params.tracks !== void 0) this.tracks = params.tracks;
12829
+ if (params.vias !== void 0) this.vias = params.vias;
12830
+ if (params.pads !== void 0) this.pads = params.pads;
12831
+ if (params.copperpour !== void 0) this.copperpour = params.copperpour;
12832
+ if (params.footprints !== void 0) this.footprints = params.footprints;
12833
+ }
12774
12834
  static fromSexprPrimitives(primitiveSexprs) {
12775
12835
  const keepout = new _ZoneKeepout();
12776
12836
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
@@ -20502,6 +20562,15 @@ var parseKicadPcb = (sexpr) => {
20502
20562
  }
20503
20563
  return root;
20504
20564
  };
20565
+ var parseKicadSym = (sexpr) => {
20566
+ const [root] = parseKicadSexpr(sexpr);
20567
+ if (!(root instanceof KicadSymbolLib)) {
20568
+ throw new Error(
20569
+ `Expected KicadSym root, got ${root?.constructor.name ?? "undefined"}`
20570
+ );
20571
+ }
20572
+ return root;
20573
+ };
20505
20574
  var parseKicadMod = (sexpr) => {
20506
20575
  const [root] = parseKicadSexpr(sexpr);
20507
20576
  if (!(root instanceof Footprint)) {
@@ -20641,6 +20710,7 @@ export {
20641
20710
  KicadSchGenerator,
20642
20711
  KicadSchGeneratorVersion,
20643
20712
  KicadSchVersion,
20713
+ KicadSym,
20644
20714
  KicadSymbolLib,
20645
20715
  KicadSymbolLibGenerator,
20646
20716
  KicadSymbolLibGeneratorVersion,
@@ -20853,6 +20923,7 @@ export {
20853
20923
  SymbolLibId,
20854
20924
  SymbolLibName,
20855
20925
  SymbolPin,
20926
+ SymbolPinAlternate,
20856
20927
  SymbolPinLength,
20857
20928
  SymbolPinName,
20858
20929
  SymbolPinNames,
@@ -20935,5 +21006,6 @@ export {
20935
21006
  parseKicadMod,
20936
21007
  parseKicadPcb,
20937
21008
  parseKicadSch,
20938
- parseKicadSexpr
21009
+ parseKicadSexpr,
21010
+ parseKicadSym
20939
21011
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kicadts",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.43",
4
+ "version": "0.0.45",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",