kicadts 0.0.16 → 0.0.18

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
@@ -558,6 +558,46 @@ declare class FieldsAutoplaced extends SxPrimitiveBoolean {
558
558
  token: string;
559
559
  }
560
560
 
561
+ interface SymbolPolylineFillLike extends SxClass {
562
+ type?: string;
563
+ }
564
+ interface PolylineConstructorParams {
565
+ points?: Pts;
566
+ stroke?: Stroke;
567
+ uuid?: string | Uuid;
568
+ fill?: SymbolPolylineFillLike;
569
+ }
570
+ /**
571
+ * Base Polyline class that can be used in both kicad_sch and symbol contexts.
572
+ * - When parent is "kicad_sch": supports pts, stroke, uuid
573
+ * - When parent is "symbol": supports pts, stroke, fill
574
+ */
575
+ declare class Polyline extends SxClass {
576
+ static token: string;
577
+ token: string;
578
+ private _sxPts?;
579
+ private _sxStroke?;
580
+ private _sxUuid?;
581
+ private _sxFill?;
582
+ constructor(params?: PolylineConstructorParams);
583
+ static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): Polyline;
584
+ get points(): Pts | undefined;
585
+ set points(value: Pts | undefined);
586
+ get stroke(): Stroke | undefined;
587
+ set stroke(value: Stroke | undefined);
588
+ get uuid(): Uuid | undefined;
589
+ set uuid(value: Uuid | string | undefined);
590
+ get fill(): SymbolPolylineFillLike | undefined;
591
+ set fill(value: SymbolPolylineFillLike | undefined);
592
+ getChildren(): SxClass[];
593
+ }
594
+ declare class SchematicPolyline extends Polyline {
595
+ static parentToken: string;
596
+ }
597
+ declare class SymbolPolyline extends Polyline {
598
+ static parentToken: string;
599
+ }
600
+
561
601
  declare class SymbolUnit extends SxPrimitiveNumber {
562
602
  static token: string;
563
603
  static parentToken: string;
@@ -579,6 +619,16 @@ declare class SymbolDuplicatePinNumbersAreJumpers extends SxPrimitiveBoolean {
579
619
  static parentToken: string;
580
620
  token: string;
581
621
  }
622
+ declare class Mirror extends SxClass {
623
+ static token: string;
624
+ static parentToken: string;
625
+ token: string;
626
+ value: string;
627
+ constructor(value: string);
628
+ static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): Mirror;
629
+ getChildren(): SxClass[];
630
+ getString(): string;
631
+ }
582
632
  declare class SymbolPinNumbers extends SxClass {
583
633
  static token: string;
584
634
  static parentToken: string;
@@ -715,22 +765,6 @@ declare class SymbolFillType extends SxClass {
715
765
  getChildren(): SxClass[];
716
766
  getString(): string;
717
767
  }
718
- declare class SymbolPolyline extends SxClass {
719
- static token: string;
720
- static parentToken: string;
721
- token: string;
722
- private _sxPts?;
723
- private _sxStroke?;
724
- private _sxFill?;
725
- static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): SymbolPolyline;
726
- get points(): Pts | undefined;
727
- set points(value: Pts | undefined);
728
- get stroke(): Stroke | undefined;
729
- set stroke(value: Stroke | undefined);
730
- get fill(): SymbolPolylineFill | undefined;
731
- set fill(value: SymbolPolylineFill | undefined);
732
- getChildren(): SxClass[];
733
- }
734
768
  declare class SymbolRectangle extends SxClass {
735
769
  static token: string;
736
770
  static parentToken: string;
@@ -793,6 +827,7 @@ declare class SymbolPower extends SxClass {
793
827
  interface SchematicSymbolConstructorParams {
794
828
  libraryId?: string;
795
829
  at?: AtInput;
830
+ mirror?: string | Mirror;
796
831
  unit?: number | SymbolUnit;
797
832
  pinNumbers?: SymbolPinNumbers;
798
833
  pinNames?: SymbolPinNames;
@@ -819,6 +854,7 @@ declare class SchematicSymbol extends SxClass {
819
854
  token: string;
820
855
  private _sxLibId?;
821
856
  _sxAt?: At;
857
+ _sxMirror?: Mirror;
822
858
  _sxUnit?: SymbolUnit;
823
859
  _sxPinNumbers?: SymbolPinNumbers;
824
860
  _sxPinNames?: SymbolPinNames;
@@ -846,6 +882,8 @@ declare class SchematicSymbol extends SxClass {
846
882
  set libraryId(value: string | SymbolLibId | undefined);
847
883
  get at(): At | undefined;
848
884
  set at(value: AtInput | undefined);
885
+ get mirror(): string | undefined;
886
+ set mirror(value: string | Mirror | undefined);
849
887
  get unit(): number | undefined;
850
888
  set unit(value: number | undefined);
851
889
  get pinNumbers(): SymbolPinNumbers | undefined;
@@ -1592,6 +1630,7 @@ interface KicadSchConstructorParams {
1592
1630
  wires?: Wire[];
1593
1631
  junctions?: Junction[];
1594
1632
  noConnects?: NoConnect[];
1633
+ polylines?: Polyline[];
1595
1634
  }
1596
1635
  declare class KicadSch extends SxClass {
1597
1636
  static token: string;
@@ -1615,6 +1654,7 @@ declare class KicadSch extends SxClass {
1615
1654
  private _wires;
1616
1655
  private _junctions;
1617
1656
  private _noConnects;
1657
+ private _polylines;
1618
1658
  constructor(params?: KicadSchConstructorParams);
1619
1659
  static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): KicadSch;
1620
1660
  get version(): number | undefined;
@@ -1655,6 +1695,8 @@ declare class KicadSch extends SxClass {
1655
1695
  set wires(value: Wire[]);
1656
1696
  get noConnects(): NoConnect[];
1657
1697
  set noConnects(value: NoConnect[]);
1698
+ get polylines(): Polyline[];
1699
+ set polylines(value: Polyline[]);
1658
1700
  getChildren(): SxClass[];
1659
1701
  }
1660
1702
 
@@ -4800,4 +4842,4 @@ declare const parseKicadSch: (sexpr: string) => KicadSch;
4800
4842
  declare const parseKicadPcb: (sexpr: string) => KicadPcb;
4801
4843
  declare const parseKicadMod: (sexpr: string) => Footprint;
4802
4844
 
4803
- export { At, type AtInput, Bus, type BusConstructorParams, BusEntry, type BusEntryConstructorParams, BusEntrySize, Color, Dnp, EmbeddedFonts, ExcludeFromSim, FieldsAutoplaced, Footprint, FootprintAttr, FootprintAutoplaceCost180, FootprintAutoplaceCost90, FootprintClearance, type FootprintConstructorParams, FootprintDescr, FootprintLocked, FootprintModel, FootprintNetTiePadGroups, FootprintPad, type FootprintPadConstructorParams, FootprintPath, FootprintPlaced, FootprintPrivateLayers, FootprintSheetfile, FootprintSheetname, FootprintSolderMaskMargin, FootprintSolderPasteMargin, FootprintSolderPasteRatio, FootprintTags, FootprintTedit, FootprintThermalGap, FootprintThermalWidth, FootprintZoneConnect, FpArc, type FpArcConstructorParams, FpArcEnd, FpArcMid, FpArcStart, FpCircle, FpCircleCenter, type FpCircleConstructorParams, FpCircleEnd, FpCircleFill, FpLine, type FpLineConstructorParams, FpLineEnd, FpLineStart, FpPoly, type FpPolyConstructorParams, FpPolyFill, FpPolyLocked, FpRect, type FpRectConstructorParams, FpRectEnd, FpRectFill, FpRectStart, FpText, FpTextBox, FpTextBoxAngle, type FpTextBoxConstructorParams, FpTextBoxEnd, FpTextBoxStart, type FpTextConstructorParams, type FpTextType, GlobalLabel, type GlobalLabelConstructorParams, type GlobalLabelShape, GrArc, type GrArcConstructorParams, GrArcEnd, GrArcMid, type GrArcPoint, GrArcStart, GrCircle, GrCircleCenter, type GrCircleConstructorParams, GrCircleEnd, type GrCirclePoint, GrCurve, type GrCurveConstructorParams, GrLine, GrLineAngle, type GrLineConstructorParams, GrLineEnd, GrLineLocked, type GrLinePoint, GrLineStart, GrText, type GrTextConstructorParams, type GrTextPosition, Image, type ImageConstructorParams, ImageData, ImageScale, InBom, Junction, type JunctionConstructorParams, JunctionDiameter, KicadPcb, type KicadPcbConstructorParams, KicadSch, type KicadSchConstructorParams, KicadSchGenerator, KicadSchGeneratorVersion, KicadSchVersion, Label, type LabelConstructorParams, Layer, Layers, LibSymbols, 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, PadRectDelta, PadRoundrectRratio, PadSize, type PadSizeInput, PadSolderMaskMargin, PadSolderPasteMargin, PadSolderPasteMarginRatio, PadTeardrops, PadThermalBridgeAngle, PadThermalGap, PadThermalWidth, PadZoneConnect, Paper, 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, PlotParamPlotFrameRef, PlotParamPlotInvisible, PlotParamPlotInvisibleText, PlotParamPlotOnAllLayers, PlotParamPlotOnAllLayersSelection, PlotParamPlotOtherText, PlotParamPlotPadNumbers, PlotParamPlotReference, PlotParamPlotValue, PlotParamProperty, PlotParamPsA4Output, PlotParamPsNegative, PlotParamScaleSelection, PlotParamSketchDnpOnFab, PlotParamSketchPadsOnFab, PlotParamSubtractMaskFromSilk, PlotParamSvgPrecision, PlotParamUseAuxOrigin, PlotParamUseGerberAdvancedAttributes, PlotParamUseGerberAttributes, PlotParamUseGerberExtensions, PlotParamViaOnMask, Property, type PropertyConstructorParams, PropertyHide, PropertyUnlocked, Pts, type RGBAColor, RenderCache, SchematicSymbol, type SchematicSymbolConstructorParams, SchematicText, 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, SymbolCircle, SymbolCircleCenter, SymbolCircleFill, SymbolCircleRadius, SymbolDuplicatePinNumbersAreJumpers, SymbolFillType, SymbolInstancePath, SymbolInstanceReference, SymbolInstanceUnit, SymbolInstances, SymbolInstancesProject, SymbolLibId, SymbolPin, SymbolPinLength, SymbolPinName, SymbolPinNames, SymbolPinNamesHide, SymbolPinNamesOffset, SymbolPinNumber, SymbolPinNumbers, SymbolPinNumbersHide, SymbolPolyline, SymbolPolylineFill, SymbolPower, SymbolProperty, SymbolPropertyId, SymbolRectangle, SymbolRectangleEnd, SymbolRectangleFill, SymbolRectangleStart, SymbolText, SymbolUnit, 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, parseKicadMod, parseKicadPcb, parseKicadSch, parseKicadSexpr };
4845
+ export { At, type AtInput, Bus, type BusConstructorParams, BusEntry, type BusEntryConstructorParams, BusEntrySize, Color, Dnp, EmbeddedFonts, ExcludeFromSim, FieldsAutoplaced, Footprint, FootprintAttr, FootprintAutoplaceCost180, FootprintAutoplaceCost90, FootprintClearance, type FootprintConstructorParams, FootprintDescr, FootprintLocked, FootprintModel, FootprintNetTiePadGroups, FootprintPad, type FootprintPadConstructorParams, FootprintPath, FootprintPlaced, FootprintPrivateLayers, FootprintSheetfile, FootprintSheetname, FootprintSolderMaskMargin, FootprintSolderPasteMargin, FootprintSolderPasteRatio, FootprintTags, FootprintTedit, FootprintThermalGap, FootprintThermalWidth, FootprintZoneConnect, FpArc, type FpArcConstructorParams, FpArcEnd, FpArcMid, FpArcStart, FpCircle, FpCircleCenter, type FpCircleConstructorParams, FpCircleEnd, FpCircleFill, FpLine, type FpLineConstructorParams, FpLineEnd, FpLineStart, FpPoly, type FpPolyConstructorParams, FpPolyFill, FpPolyLocked, FpRect, type FpRectConstructorParams, FpRectEnd, FpRectFill, FpRectStart, FpText, FpTextBox, FpTextBoxAngle, type FpTextBoxConstructorParams, FpTextBoxEnd, FpTextBoxStart, type FpTextConstructorParams, type FpTextType, GlobalLabel, type GlobalLabelConstructorParams, type GlobalLabelShape, GrArc, type GrArcConstructorParams, GrArcEnd, GrArcMid, type GrArcPoint, GrArcStart, GrCircle, GrCircleCenter, type GrCircleConstructorParams, GrCircleEnd, type GrCirclePoint, GrCurve, type GrCurveConstructorParams, GrLine, GrLineAngle, type GrLineConstructorParams, GrLineEnd, GrLineLocked, type GrLinePoint, GrLineStart, GrText, type GrTextConstructorParams, type GrTextPosition, Image, type ImageConstructorParams, ImageData, ImageScale, InBom, Junction, type JunctionConstructorParams, JunctionDiameter, KicadPcb, type KicadPcbConstructorParams, KicadSch, type KicadSchConstructorParams, KicadSchGenerator, KicadSchGeneratorVersion, KicadSchVersion, 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, PadRectDelta, PadRoundrectRratio, PadSize, type PadSizeInput, PadSolderMaskMargin, PadSolderPasteMargin, PadSolderPasteMarginRatio, PadTeardrops, PadThermalBridgeAngle, PadThermalGap, PadThermalWidth, PadZoneConnect, Paper, 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, PlotParamPlotFrameRef, PlotParamPlotInvisible, PlotParamPlotInvisibleText, PlotParamPlotOnAllLayers, PlotParamPlotOnAllLayersSelection, PlotParamPlotOtherText, PlotParamPlotPadNumbers, PlotParamPlotReference, PlotParamPlotValue, PlotParamProperty, PlotParamPsA4Output, PlotParamPsNegative, PlotParamScaleSelection, PlotParamSketchDnpOnFab, PlotParamSketchPadsOnFab, PlotParamSubtractMaskFromSilk, PlotParamSvgPrecision, PlotParamUseAuxOrigin, PlotParamUseGerberAdvancedAttributes, PlotParamUseGerberAttributes, PlotParamUseGerberExtensions, PlotParamViaOnMask, Polyline, type PolylineConstructorParams, Property, type PropertyConstructorParams, PropertyHide, PropertyUnlocked, Pts, type RGBAColor, RenderCache, SchematicPolyline, SchematicSymbol, type SchematicSymbolConstructorParams, SchematicText, 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, SymbolCircle, SymbolCircleCenter, SymbolCircleFill, SymbolCircleRadius, SymbolDuplicatePinNumbersAreJumpers, SymbolFillType, SymbolInstancePath, SymbolInstanceReference, SymbolInstanceUnit, SymbolInstances, SymbolInstancesProject, SymbolLibId, SymbolPin, SymbolPinLength, SymbolPinName, SymbolPinNames, SymbolPinNamesHide, SymbolPinNamesOffset, SymbolPinNumber, SymbolPinNumbers, SymbolPinNumbersHide, SymbolPolyline, SymbolPolylineFill, type SymbolPolylineFillLike, SymbolPower, SymbolProperty, SymbolPropertyId, SymbolRectangle, SymbolRectangleEnd, SymbolRectangleFill, SymbolRectangleStart, SymbolText, SymbolUnit, 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, parseKicadMod, parseKicadPcb, parseKicadSch, parseKicadSexpr };
package/dist/index.js CHANGED
@@ -1918,6 +1918,108 @@ var FieldsAutoplaced = class extends SxPrimitiveBoolean {
1918
1918
  };
1919
1919
  SxClass.register(FieldsAutoplaced);
1920
1920
 
1921
+ // lib/sexpr/classes/Polyline.ts
1922
+ var SUPPORTED_TOKENS_KICAD_SCH = /* @__PURE__ */ new Set(["pts", "stroke", "uuid"]);
1923
+ var SUPPORTED_TOKENS_SYMBOL = /* @__PURE__ */ new Set(["pts", "stroke", "fill"]);
1924
+ var Polyline = class _Polyline extends SxClass {
1925
+ static token = "polyline";
1926
+ token = "polyline";
1927
+ _sxPts;
1928
+ _sxStroke;
1929
+ _sxUuid;
1930
+ _sxFill;
1931
+ constructor(params = {}) {
1932
+ super();
1933
+ if (params.points !== void 0) {
1934
+ this.points = params.points;
1935
+ }
1936
+ if (params.stroke !== void 0) {
1937
+ this.stroke = params.stroke;
1938
+ }
1939
+ if (params.uuid !== void 0) {
1940
+ this.uuid = params.uuid;
1941
+ }
1942
+ if (params.fill !== void 0) {
1943
+ this.fill = params.fill;
1944
+ }
1945
+ }
1946
+ static fromSexprPrimitives(primitiveSexprs) {
1947
+ const polyline = new _Polyline();
1948
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
1949
+ const supportedTokens = this.parentToken === "symbol" ? SUPPORTED_TOKENS_SYMBOL : SUPPORTED_TOKENS_KICAD_SCH;
1950
+ for (const [token, entries] of Object.entries(arrayPropertyMap)) {
1951
+ if (!supportedTokens.has(token)) {
1952
+ throw new Error(
1953
+ `Unsupported child tokens inside polyline expression: ${token}`
1954
+ );
1955
+ }
1956
+ if (entries.length > 1) {
1957
+ throw new Error(
1958
+ `polyline does not support repeated child tokens: ${token}`
1959
+ );
1960
+ }
1961
+ }
1962
+ const unsupportedTokens = Object.keys(propertyMap).filter(
1963
+ (token) => !supportedTokens.has(token)
1964
+ );
1965
+ if (unsupportedTokens.length > 0) {
1966
+ throw new Error(
1967
+ `Unsupported child tokens inside polyline expression: ${unsupportedTokens.join(", ")}`
1968
+ );
1969
+ }
1970
+ polyline._sxPts = arrayPropertyMap.pts?.[0] ?? propertyMap.pts;
1971
+ polyline._sxStroke = propertyMap.stroke;
1972
+ polyline._sxUuid = propertyMap.uuid;
1973
+ polyline._sxFill = propertyMap.fill;
1974
+ return polyline;
1975
+ }
1976
+ get points() {
1977
+ return this._sxPts;
1978
+ }
1979
+ set points(value) {
1980
+ this._sxPts = value;
1981
+ }
1982
+ get stroke() {
1983
+ return this._sxStroke;
1984
+ }
1985
+ set stroke(value) {
1986
+ this._sxStroke = value;
1987
+ }
1988
+ get uuid() {
1989
+ return this._sxUuid;
1990
+ }
1991
+ set uuid(value) {
1992
+ if (value === void 0) {
1993
+ this._sxUuid = void 0;
1994
+ return;
1995
+ }
1996
+ this._sxUuid = value instanceof Uuid ? value : new Uuid(value);
1997
+ }
1998
+ get fill() {
1999
+ return this._sxFill;
2000
+ }
2001
+ set fill(value) {
2002
+ this._sxFill = value;
2003
+ }
2004
+ getChildren() {
2005
+ const children = [];
2006
+ if (this._sxPts) children.push(this._sxPts);
2007
+ if (this._sxStroke) children.push(this._sxStroke);
2008
+ if (this._sxFill) children.push(this._sxFill);
2009
+ if (this._sxUuid) children.push(this._sxUuid);
2010
+ return children;
2011
+ }
2012
+ };
2013
+ SxClass.register(Polyline);
2014
+ var SchematicPolyline = class extends Polyline {
2015
+ static parentToken = "kicad_sch";
2016
+ };
2017
+ SxClass.register(SchematicPolyline);
2018
+ var SymbolPolyline = class extends Polyline {
2019
+ static parentToken = "symbol";
2020
+ };
2021
+ SxClass.register(SymbolPolyline);
2022
+
1921
2023
  // lib/sexpr/classes/Symbol.ts
1922
2024
  var SymbolUnit = class _SymbolUnit extends SxPrimitiveNumber {
1923
2025
  static token = "unit";
@@ -1962,6 +2064,31 @@ var SymbolDuplicatePinNumbersAreJumpers = class extends SxPrimitiveBoolean {
1962
2064
  token = "duplicate_pin_numbers_are_jumpers";
1963
2065
  };
1964
2066
  SxClass.register(SymbolDuplicatePinNumbersAreJumpers);
2067
+ var Mirror = class _Mirror extends SxClass {
2068
+ static token = "mirror";
2069
+ static parentToken = "symbol";
2070
+ token = "mirror";
2071
+ value;
2072
+ constructor(value) {
2073
+ super();
2074
+ this.value = value;
2075
+ }
2076
+ static fromSexprPrimitives(primitiveSexprs) {
2077
+ const [valuePrimitive] = primitiveSexprs;
2078
+ const value = toStringValue(valuePrimitive);
2079
+ if (value === void 0) {
2080
+ throw new Error("mirror expects a string value (x or y)");
2081
+ }
2082
+ return new _Mirror(value);
2083
+ }
2084
+ getChildren() {
2085
+ return [];
2086
+ }
2087
+ getString() {
2088
+ return `(mirror ${this.value})`;
2089
+ }
2090
+ };
2091
+ SxClass.register(Mirror);
1965
2092
  var SymbolPinNumbers = class _SymbolPinNumbers extends SxClass {
1966
2093
  static token = "pin_numbers";
1967
2094
  static parentToken = "symbol";
@@ -2249,51 +2376,6 @@ var SymbolFillType = class _SymbolFillType extends SxClass {
2249
2376
  }
2250
2377
  };
2251
2378
  SxClass.register(SymbolFillType);
2252
- var SymbolPolyline = class _SymbolPolyline extends SxClass {
2253
- static token = "polyline";
2254
- static parentToken = "symbol";
2255
- token = "polyline";
2256
- _sxPts;
2257
- _sxStroke;
2258
- _sxFill;
2259
- static fromSexprPrimitives(primitiveSexprs) {
2260
- const polyline = new _SymbolPolyline();
2261
- const { propertyMap } = SxClass.parsePrimitivesToClassProperties(
2262
- primitiveSexprs,
2263
- this.token
2264
- );
2265
- polyline._sxPts = propertyMap.pts;
2266
- polyline._sxStroke = propertyMap.stroke;
2267
- polyline._sxFill = propertyMap.fill;
2268
- return polyline;
2269
- }
2270
- get points() {
2271
- return this._sxPts;
2272
- }
2273
- set points(value) {
2274
- this._sxPts = value;
2275
- }
2276
- get stroke() {
2277
- return this._sxStroke;
2278
- }
2279
- set stroke(value) {
2280
- this._sxStroke = value;
2281
- }
2282
- get fill() {
2283
- return this._sxFill;
2284
- }
2285
- set fill(value) {
2286
- this._sxFill = value;
2287
- }
2288
- getChildren() {
2289
- const children = [];
2290
- if (this._sxPts) children.push(this._sxPts);
2291
- if (this._sxStroke) children.push(this._sxStroke);
2292
- if (this._sxFill) children.push(this._sxFill);
2293
- return children;
2294
- }
2295
- };
2296
- SxClass.register(SymbolPolyline);
2297
2379
  var SymbolRectangle = class _SymbolRectangle extends SxClass {
2298
2380
  static token = "rectangle";
2299
2381
  static parentToken = "symbol";
@@ -2464,6 +2546,7 @@ var SchematicSymbol = class _SchematicSymbol extends SxClass {
2464
2546
  token = "symbol";
2465
2547
  _sxLibId;
2466
2548
  _sxAt;
2549
+ _sxMirror;
2467
2550
  _sxUnit;
2468
2551
  _sxPinNumbers;
2469
2552
  _sxPinNames;
@@ -2490,6 +2573,7 @@ var SchematicSymbol = class _SchematicSymbol extends SxClass {
2490
2573
  super();
2491
2574
  if (params.libraryId !== void 0) this.libraryId = params.libraryId;
2492
2575
  if (params.at !== void 0) this.at = params.at;
2576
+ if (params.mirror !== void 0) this.mirror = params.mirror;
2493
2577
  if (params.unit !== void 0)
2494
2578
  this.unit = typeof params.unit === "number" ? params.unit : params.unit.value;
2495
2579
  if (params.pinNumbers !== void 0) this.pinNumbers = params.pinNumbers;
@@ -2541,6 +2625,16 @@ var SchematicSymbol = class _SchematicSymbol extends SxClass {
2541
2625
  set at(value) {
2542
2626
  this._sxAt = value !== void 0 ? At.from(value) : void 0;
2543
2627
  }
2628
+ get mirror() {
2629
+ return this._sxMirror?.value;
2630
+ }
2631
+ set mirror(value) {
2632
+ if (value === void 0) {
2633
+ this._sxMirror = void 0;
2634
+ return;
2635
+ }
2636
+ this._sxMirror = value instanceof Mirror ? value : new Mirror(value);
2637
+ }
2544
2638
  get unit() {
2545
2639
  return this._sxUnit?.value;
2546
2640
  }
@@ -2631,6 +2725,7 @@ var SchematicSymbol = class _SchematicSymbol extends SxClass {
2631
2725
  symbol._inlineLibId = inlineId;
2632
2726
  }
2633
2727
  symbol._sxAt = propertyMap.at;
2728
+ symbol._sxMirror = propertyMap.mirror;
2634
2729
  symbol._sxUnit = propertyMap.unit;
2635
2730
  symbol._sxPinNumbers = propertyMap.pin_numbers;
2636
2731
  symbol._sxPinNames = propertyMap.pin_names;
@@ -2658,6 +2753,7 @@ var SchematicSymbol = class _SchematicSymbol extends SxClass {
2658
2753
  const children = [];
2659
2754
  if (this._sxLibId) children.push(this._sxLibId);
2660
2755
  if (this._sxAt) children.push(this._sxAt);
2756
+ if (this._sxMirror) children.push(this._sxMirror);
2661
2757
  if (this._sxUnit) children.push(this._sxUnit);
2662
2758
  if (this._sxPinNumbers) children.push(this._sxPinNumbers);
2663
2759
  if (this._sxPinNames) children.push(this._sxPinNames);
@@ -5087,7 +5183,8 @@ var MULTI_CHILD_TOKENS = /* @__PURE__ */ new Set([
5087
5183
  "junction",
5088
5184
  "wire",
5089
5185
  "no_connect",
5090
- "sheet_instances"
5186
+ "sheet_instances",
5187
+ "polyline"
5091
5188
  ]);
5092
5189
  var SUPPORTED_CHILD_TOKENS2 = /* @__PURE__ */ new Set([
5093
5190
  ...SINGLE_CHILD_TOKENS,
@@ -5115,6 +5212,7 @@ var KicadSch = class _KicadSch extends SxClass {
5115
5212
  _wires = [];
5116
5213
  _junctions = [];
5117
5214
  _noConnects = [];
5215
+ _polylines = [];
5118
5216
  constructor(params = {}) {
5119
5217
  super();
5120
5218
  if (params.version instanceof KicadSchVersion) {
@@ -5180,6 +5278,9 @@ var KicadSch = class _KicadSch extends SxClass {
5180
5278
  if (params.noConnects !== void 0) {
5181
5279
  this.noConnects = params.noConnects;
5182
5280
  }
5281
+ if (params.polylines !== void 0) {
5282
+ this.polylines = params.polylines;
5283
+ }
5183
5284
  }
5184
5285
  static fromSexprPrimitives(primitiveSexprs) {
5185
5286
  for (const primitive of primitiveSexprs) {
@@ -5233,7 +5334,8 @@ var KicadSch = class _KicadSch extends SxClass {
5233
5334
  globalLabels: arrayPropertyMap.global_label ?? [],
5234
5335
  junctions: arrayPropertyMap.junction ?? [],
5235
5336
  wires: arrayPropertyMap.wire ?? [],
5236
- noConnects: arrayPropertyMap.no_connect ?? []
5337
+ noConnects: arrayPropertyMap.no_connect ?? [],
5338
+ polylines: arrayPropertyMap.polyline ?? []
5237
5339
  });
5238
5340
  }
5239
5341
  get version() {
@@ -5358,6 +5460,12 @@ var KicadSch = class _KicadSch extends SxClass {
5358
5460
  set noConnects(value) {
5359
5461
  this._noConnects = [...value];
5360
5462
  }
5463
+ get polylines() {
5464
+ return [...this._polylines];
5465
+ }
5466
+ set polylines(value) {
5467
+ this._polylines = [...value];
5468
+ }
5361
5469
  getChildren() {
5362
5470
  const children = [];
5363
5471
  if (this._sxVersion) children.push(this._sxVersion);
@@ -5379,6 +5487,7 @@ var KicadSch = class _KicadSch extends SxClass {
5379
5487
  children.push(...this._junctions);
5380
5488
  children.push(...this._wires);
5381
5489
  children.push(...this._noConnects);
5490
+ children.push(...this._polylines);
5382
5491
  return children;
5383
5492
  }
5384
5493
  };
@@ -15303,6 +15412,7 @@ export {
15303
15412
  Layer,
15304
15413
  Layers,
15305
15414
  LibSymbols,
15415
+ Mirror,
15306
15416
  NoConnect,
15307
15417
  OnBoard,
15308
15418
  PadChamfer,
@@ -15393,11 +15503,13 @@ export {
15393
15503
  PlotParamUseGerberAttributes,
15394
15504
  PlotParamUseGerberExtensions,
15395
15505
  PlotParamViaOnMask,
15506
+ Polyline,
15396
15507
  Property,
15397
15508
  PropertyHide,
15398
15509
  PropertyUnlocked,
15399
15510
  Pts,
15400
15511
  RenderCache,
15512
+ SchematicPolyline,
15401
15513
  SchematicSymbol,
15402
15514
  SchematicText,
15403
15515
  Segment,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kicadts",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.16",
4
+ "version": "0.0.18",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",