kicadts 0.0.18 → 0.0.19
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 +185 -2
- package/dist/index.js +554 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3404,6 +3404,7 @@ interface GrCircleConstructorParams {
|
|
|
3404
3404
|
width?: Width | number;
|
|
3405
3405
|
stroke?: Stroke;
|
|
3406
3406
|
fill?: PadPrimitiveGrCircleFill | string;
|
|
3407
|
+
locked?: boolean;
|
|
3407
3408
|
tstamp?: Tstamp | string;
|
|
3408
3409
|
uuid?: Uuid | string;
|
|
3409
3410
|
}
|
|
@@ -3416,6 +3417,7 @@ declare class GrCircle extends SxClass {
|
|
|
3416
3417
|
private _sxWidth?;
|
|
3417
3418
|
private _sxStroke?;
|
|
3418
3419
|
private _sxFill?;
|
|
3420
|
+
private _sxLocked?;
|
|
3419
3421
|
private _sxTstamp?;
|
|
3420
3422
|
private _sxUuid?;
|
|
3421
3423
|
constructor(params?: GrCircleConstructorParams);
|
|
@@ -3438,8 +3440,11 @@ declare class GrCircle extends SxClass {
|
|
|
3438
3440
|
set fill(value: PadPrimitiveGrCircleFill | string | undefined);
|
|
3439
3441
|
get tstamp(): Tstamp | undefined;
|
|
3440
3442
|
set tstamp(value: Tstamp | string | undefined);
|
|
3441
|
-
get uuid():
|
|
3443
|
+
get uuid(): string | undefined;
|
|
3444
|
+
get uuidClass(): Uuid | undefined;
|
|
3442
3445
|
set uuid(value: Uuid | string | undefined);
|
|
3446
|
+
get locked(): boolean;
|
|
3447
|
+
set locked(value: boolean);
|
|
3443
3448
|
getChildren(): SxClass[];
|
|
3444
3449
|
private normalizeCenter;
|
|
3445
3450
|
private normalizeEnd;
|
|
@@ -3468,6 +3473,15 @@ declare class GrCircleEnd extends SxClass {
|
|
|
3468
3473
|
getChildren(): SxClass[];
|
|
3469
3474
|
getString(): string;
|
|
3470
3475
|
}
|
|
3476
|
+
declare class GrCircleLocked extends SxClass {
|
|
3477
|
+
static token: string;
|
|
3478
|
+
static parentToken: string;
|
|
3479
|
+
token: string;
|
|
3480
|
+
value: boolean;
|
|
3481
|
+
constructor(value: boolean);
|
|
3482
|
+
static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): GrCircleLocked;
|
|
3483
|
+
getString(): string;
|
|
3484
|
+
}
|
|
3471
3485
|
|
|
3472
3486
|
interface GrCurveConstructorParams {
|
|
3473
3487
|
points?: Pts | Xy[] | Array<{
|
|
@@ -3585,6 +3599,128 @@ declare class GrLineLocked extends SxPrimitiveBoolean {
|
|
|
3585
3599
|
getString(): string;
|
|
3586
3600
|
}
|
|
3587
3601
|
|
|
3602
|
+
interface GrRectConstructorParams {
|
|
3603
|
+
start?: GrRectStart | {
|
|
3604
|
+
x: number;
|
|
3605
|
+
y: number;
|
|
3606
|
+
};
|
|
3607
|
+
end?: GrRectEnd | {
|
|
3608
|
+
x: number;
|
|
3609
|
+
y: number;
|
|
3610
|
+
};
|
|
3611
|
+
layer?: Layer | string | string[];
|
|
3612
|
+
width?: number | Width;
|
|
3613
|
+
stroke?: Stroke;
|
|
3614
|
+
fill?: boolean | GrRectFill;
|
|
3615
|
+
uuid?: string | Uuid;
|
|
3616
|
+
locked?: boolean;
|
|
3617
|
+
}
|
|
3618
|
+
declare class GrRect extends SxClass {
|
|
3619
|
+
static token: string;
|
|
3620
|
+
token: string;
|
|
3621
|
+
private _sxStart?;
|
|
3622
|
+
private _sxEnd?;
|
|
3623
|
+
private _sxLayer?;
|
|
3624
|
+
private _sxWidth?;
|
|
3625
|
+
private _sxStroke?;
|
|
3626
|
+
private _sxFill?;
|
|
3627
|
+
private _sxUuid?;
|
|
3628
|
+
private _sxLocked?;
|
|
3629
|
+
constructor(params?: GrRectConstructorParams);
|
|
3630
|
+
static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): GrRect;
|
|
3631
|
+
get start(): GrRectStart | undefined;
|
|
3632
|
+
set start(value: GrRectStart | {
|
|
3633
|
+
x: number;
|
|
3634
|
+
y: number;
|
|
3635
|
+
} | undefined);
|
|
3636
|
+
get end(): GrRectEnd | undefined;
|
|
3637
|
+
set end(value: GrRectEnd | {
|
|
3638
|
+
x: number;
|
|
3639
|
+
y: number;
|
|
3640
|
+
} | undefined);
|
|
3641
|
+
get startPoint(): {
|
|
3642
|
+
x: number;
|
|
3643
|
+
y: number;
|
|
3644
|
+
} | undefined;
|
|
3645
|
+
get endPoint(): {
|
|
3646
|
+
x: number;
|
|
3647
|
+
y: number;
|
|
3648
|
+
} | undefined;
|
|
3649
|
+
get layer(): Layer | undefined;
|
|
3650
|
+
set layer(value: Layer | string | string[] | undefined);
|
|
3651
|
+
get stroke(): Stroke | undefined;
|
|
3652
|
+
set stroke(value: Stroke | undefined);
|
|
3653
|
+
get width(): number | undefined;
|
|
3654
|
+
set width(value: number | Width | undefined);
|
|
3655
|
+
get widthClass(): Width | undefined;
|
|
3656
|
+
set widthClass(value: Width | undefined);
|
|
3657
|
+
get fill(): boolean | undefined;
|
|
3658
|
+
set fill(value: boolean | GrRectFill | undefined);
|
|
3659
|
+
get fillClass(): GrRectFill | undefined;
|
|
3660
|
+
get uuid(): string | undefined;
|
|
3661
|
+
set uuid(value: string | Uuid | undefined);
|
|
3662
|
+
get uuidClass(): Uuid | undefined;
|
|
3663
|
+
get locked(): boolean;
|
|
3664
|
+
set locked(value: boolean);
|
|
3665
|
+
getChildren(): SxClass[];
|
|
3666
|
+
}
|
|
3667
|
+
declare class GrRectStart extends SxClass {
|
|
3668
|
+
static token: string;
|
|
3669
|
+
static parentToken: string;
|
|
3670
|
+
token: string;
|
|
3671
|
+
private _x;
|
|
3672
|
+
private _y;
|
|
3673
|
+
constructor(x: number, y: number);
|
|
3674
|
+
static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): GrRectStart;
|
|
3675
|
+
get x(): number;
|
|
3676
|
+
set x(value: number);
|
|
3677
|
+
get y(): number;
|
|
3678
|
+
set y(value: number);
|
|
3679
|
+
toObject(): {
|
|
3680
|
+
x: number;
|
|
3681
|
+
y: number;
|
|
3682
|
+
};
|
|
3683
|
+
getChildren(): SxClass[];
|
|
3684
|
+
getString(): string;
|
|
3685
|
+
}
|
|
3686
|
+
declare class GrRectEnd extends SxClass {
|
|
3687
|
+
static token: string;
|
|
3688
|
+
static parentToken: string;
|
|
3689
|
+
token: string;
|
|
3690
|
+
private _x;
|
|
3691
|
+
private _y;
|
|
3692
|
+
constructor(x: number, y: number);
|
|
3693
|
+
static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): GrRectEnd;
|
|
3694
|
+
get x(): number;
|
|
3695
|
+
set x(value: number);
|
|
3696
|
+
get y(): number;
|
|
3697
|
+
set y(value: number);
|
|
3698
|
+
toObject(): {
|
|
3699
|
+
x: number;
|
|
3700
|
+
y: number;
|
|
3701
|
+
};
|
|
3702
|
+
getChildren(): SxClass[];
|
|
3703
|
+
getString(): string;
|
|
3704
|
+
}
|
|
3705
|
+
declare class GrRectFill extends SxClass {
|
|
3706
|
+
static token: string;
|
|
3707
|
+
static parentToken: string;
|
|
3708
|
+
token: string;
|
|
3709
|
+
filled: boolean;
|
|
3710
|
+
constructor(filled: boolean);
|
|
3711
|
+
static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): GrRectFill;
|
|
3712
|
+
getString(): string;
|
|
3713
|
+
}
|
|
3714
|
+
declare class GrRectLocked extends SxClass {
|
|
3715
|
+
static token: string;
|
|
3716
|
+
static parentToken: string;
|
|
3717
|
+
token: string;
|
|
3718
|
+
value: boolean;
|
|
3719
|
+
constructor(value: boolean);
|
|
3720
|
+
static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): GrRectLocked;
|
|
3721
|
+
getString(): string;
|
|
3722
|
+
}
|
|
3723
|
+
|
|
3588
3724
|
interface GrTextPosition {
|
|
3589
3725
|
x: number;
|
|
3590
3726
|
y: number;
|
|
@@ -3625,6 +3761,53 @@ declare class GrText extends SxClass {
|
|
|
3625
3761
|
getString(): string;
|
|
3626
3762
|
}
|
|
3627
3763
|
|
|
3764
|
+
interface GroupConstructorParams {
|
|
3765
|
+
name?: string;
|
|
3766
|
+
uuid?: string | Uuid;
|
|
3767
|
+
locked?: boolean;
|
|
3768
|
+
members?: string[];
|
|
3769
|
+
}
|
|
3770
|
+
declare class Group extends SxClass {
|
|
3771
|
+
static token: string;
|
|
3772
|
+
token: string;
|
|
3773
|
+
private _name;
|
|
3774
|
+
private _sxUuid?;
|
|
3775
|
+
private _sxLocked?;
|
|
3776
|
+
private _sxMembers?;
|
|
3777
|
+
constructor(params?: GroupConstructorParams);
|
|
3778
|
+
static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): Group;
|
|
3779
|
+
get name(): string;
|
|
3780
|
+
set name(value: string);
|
|
3781
|
+
get uuid(): string | undefined;
|
|
3782
|
+
set uuid(value: string | Uuid | undefined);
|
|
3783
|
+
get uuidClass(): Uuid | undefined;
|
|
3784
|
+
get locked(): boolean;
|
|
3785
|
+
set locked(value: boolean);
|
|
3786
|
+
get members(): string[];
|
|
3787
|
+
set members(value: string[]);
|
|
3788
|
+
get membersClass(): GroupMembers | undefined;
|
|
3789
|
+
getChildren(): SxClass[];
|
|
3790
|
+
getString(): string;
|
|
3791
|
+
}
|
|
3792
|
+
declare class GroupLocked extends SxClass {
|
|
3793
|
+
static token: string;
|
|
3794
|
+
static parentToken: string;
|
|
3795
|
+
token: string;
|
|
3796
|
+
value: boolean;
|
|
3797
|
+
constructor(value: boolean);
|
|
3798
|
+
static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): GroupLocked;
|
|
3799
|
+
getString(): string;
|
|
3800
|
+
}
|
|
3801
|
+
declare class GroupMembers extends SxClass {
|
|
3802
|
+
static token: string;
|
|
3803
|
+
static parentToken: string;
|
|
3804
|
+
token: string;
|
|
3805
|
+
members: string[];
|
|
3806
|
+
constructor(members: string[]);
|
|
3807
|
+
static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): GroupMembers;
|
|
3808
|
+
getString(): string;
|
|
3809
|
+
}
|
|
3810
|
+
|
|
3628
3811
|
declare class SegmentEnd extends SxClass {
|
|
3629
3812
|
static token: string;
|
|
3630
3813
|
static parentToken: string;
|
|
@@ -4842,4 +5025,4 @@ declare const parseKicadSch: (sexpr: string) => KicadSch;
|
|
|
4842
5025
|
declare const parseKicadPcb: (sexpr: string) => KicadPcb;
|
|
4843
5026
|
declare const parseKicadMod: (sexpr: string) => Footprint;
|
|
4844
5027
|
|
|
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 };
|
|
5028
|
+
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, GrCircleLocked, type GrCirclePoint, GrCurve, type GrCurveConstructorParams, GrLine, GrLineAngle, type GrLineConstructorParams, GrLineEnd, GrLineLocked, type GrLinePoint, GrLineStart, GrRect, type GrRectConstructorParams, GrRectEnd, GrRectFill, GrRectLocked, GrRectStart, GrText, type GrTextConstructorParams, type GrTextPosition, Group, type GroupConstructorParams, GroupLocked, GroupMembers, 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
|
@@ -11227,6 +11227,7 @@ var SUPPORTED_SINGLE_TOKENS6 = /* @__PURE__ */ new Set([
|
|
|
11227
11227
|
"width",
|
|
11228
11228
|
"stroke",
|
|
11229
11229
|
"fill",
|
|
11230
|
+
"locked",
|
|
11230
11231
|
"tstamp",
|
|
11231
11232
|
"uuid"
|
|
11232
11233
|
]);
|
|
@@ -11239,6 +11240,7 @@ var GrCircle = class _GrCircle extends SxClass {
|
|
|
11239
11240
|
_sxWidth;
|
|
11240
11241
|
_sxStroke;
|
|
11241
11242
|
_sxFill;
|
|
11243
|
+
_sxLocked;
|
|
11242
11244
|
_sxTstamp;
|
|
11243
11245
|
_sxUuid;
|
|
11244
11246
|
constructor(params = {}) {
|
|
@@ -11249,6 +11251,7 @@ var GrCircle = class _GrCircle extends SxClass {
|
|
|
11249
11251
|
if (params.width !== void 0) this.width = params.width;
|
|
11250
11252
|
if (params.stroke !== void 0) this.stroke = params.stroke;
|
|
11251
11253
|
if (params.fill !== void 0) this.fill = params.fill;
|
|
11254
|
+
if (params.locked !== void 0) this.locked = params.locked;
|
|
11252
11255
|
if (params.tstamp !== void 0) this.tstamp = params.tstamp;
|
|
11253
11256
|
if (params.uuid !== void 0) this.uuid = params.uuid;
|
|
11254
11257
|
}
|
|
@@ -11289,6 +11292,8 @@ var GrCircle = class _GrCircle extends SxClass {
|
|
|
11289
11292
|
grCircle._sxWidth = propertyMap.width;
|
|
11290
11293
|
grCircle._sxStroke = propertyMap.stroke;
|
|
11291
11294
|
grCircle._sxFill = propertyMap.fill;
|
|
11295
|
+
const locked = propertyMap.locked;
|
|
11296
|
+
grCircle._sxLocked = locked && locked.value ? locked : void 0;
|
|
11292
11297
|
grCircle._sxTstamp = propertyMap.tstamp;
|
|
11293
11298
|
grCircle._sxUuid = propertyMap.uuid;
|
|
11294
11299
|
if (!grCircle._sxCenter) {
|
|
@@ -11389,6 +11394,9 @@ var GrCircle = class _GrCircle extends SxClass {
|
|
|
11389
11394
|
this._sxTstamp = value instanceof Tstamp ? value : new Tstamp(value);
|
|
11390
11395
|
}
|
|
11391
11396
|
get uuid() {
|
|
11397
|
+
return this._sxUuid?.value;
|
|
11398
|
+
}
|
|
11399
|
+
get uuidClass() {
|
|
11392
11400
|
return this._sxUuid;
|
|
11393
11401
|
}
|
|
11394
11402
|
set uuid(value) {
|
|
@@ -11398,6 +11406,12 @@ var GrCircle = class _GrCircle extends SxClass {
|
|
|
11398
11406
|
}
|
|
11399
11407
|
this._sxUuid = value instanceof Uuid ? value : new Uuid(value);
|
|
11400
11408
|
}
|
|
11409
|
+
get locked() {
|
|
11410
|
+
return this._sxLocked?.value ?? false;
|
|
11411
|
+
}
|
|
11412
|
+
set locked(value) {
|
|
11413
|
+
this._sxLocked = value ? new GrCircleLocked(true) : void 0;
|
|
11414
|
+
}
|
|
11401
11415
|
getChildren() {
|
|
11402
11416
|
const children = [];
|
|
11403
11417
|
if (this._sxCenter) children.push(this._sxCenter);
|
|
@@ -11405,6 +11419,7 @@ var GrCircle = class _GrCircle extends SxClass {
|
|
|
11405
11419
|
if (this._sxStroke) children.push(this._sxStroke);
|
|
11406
11420
|
if (this._sxWidth) children.push(this._sxWidth);
|
|
11407
11421
|
if (this._sxFill) children.push(this._sxFill);
|
|
11422
|
+
if (this._sxLocked) children.push(this._sxLocked);
|
|
11408
11423
|
if (this._sxLayer) children.push(this._sxLayer);
|
|
11409
11424
|
if (this._sxTstamp) children.push(this._sxTstamp);
|
|
11410
11425
|
if (this._sxUuid) children.push(this._sxUuid);
|
|
@@ -11488,6 +11503,27 @@ var GrCircleEnd = class _GrCircleEnd extends SxClass {
|
|
|
11488
11503
|
}
|
|
11489
11504
|
};
|
|
11490
11505
|
SxClass.register(GrCircleEnd);
|
|
11506
|
+
var GrCircleLocked = class _GrCircleLocked extends SxClass {
|
|
11507
|
+
static token = "locked";
|
|
11508
|
+
static parentToken = "gr_circle";
|
|
11509
|
+
token = "locked";
|
|
11510
|
+
value;
|
|
11511
|
+
constructor(value) {
|
|
11512
|
+
super();
|
|
11513
|
+
this.value = value;
|
|
11514
|
+
}
|
|
11515
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
11516
|
+
if (primitiveSexprs.length === 0) {
|
|
11517
|
+
return new _GrCircleLocked(true);
|
|
11518
|
+
}
|
|
11519
|
+
const state = String(primitiveSexprs[0]);
|
|
11520
|
+
return new _GrCircleLocked(state === "yes");
|
|
11521
|
+
}
|
|
11522
|
+
getString() {
|
|
11523
|
+
return this.value ? "(locked yes)" : "(locked no)";
|
|
11524
|
+
}
|
|
11525
|
+
};
|
|
11526
|
+
SxClass.register(GrCircleLocked);
|
|
11491
11527
|
|
|
11492
11528
|
// lib/sexpr/classes/GrCurve.ts
|
|
11493
11529
|
var SUPPORTED_TOKENS14 = /* @__PURE__ */ new Set([
|
|
@@ -11932,8 +11968,347 @@ var GrLine = class _GrLine extends SxClass {
|
|
|
11932
11968
|
};
|
|
11933
11969
|
SxClass.register(GrLine);
|
|
11934
11970
|
|
|
11935
|
-
// lib/sexpr/classes/
|
|
11971
|
+
// lib/sexpr/classes/GrRect.ts
|
|
11936
11972
|
var SUPPORTED_SINGLE_TOKENS8 = /* @__PURE__ */ new Set([
|
|
11973
|
+
"start",
|
|
11974
|
+
"end",
|
|
11975
|
+
"layer",
|
|
11976
|
+
"width",
|
|
11977
|
+
"stroke",
|
|
11978
|
+
"fill",
|
|
11979
|
+
"uuid",
|
|
11980
|
+
"locked"
|
|
11981
|
+
]);
|
|
11982
|
+
var GrRect = class _GrRect extends SxClass {
|
|
11983
|
+
static token = "gr_rect";
|
|
11984
|
+
token = "gr_rect";
|
|
11985
|
+
_sxStart;
|
|
11986
|
+
_sxEnd;
|
|
11987
|
+
_sxLayer;
|
|
11988
|
+
_sxWidth;
|
|
11989
|
+
_sxStroke;
|
|
11990
|
+
_sxFill;
|
|
11991
|
+
_sxUuid;
|
|
11992
|
+
_sxLocked;
|
|
11993
|
+
constructor(params = {}) {
|
|
11994
|
+
super();
|
|
11995
|
+
if (params.start !== void 0) this.start = params.start;
|
|
11996
|
+
if (params.end !== void 0) this.end = params.end;
|
|
11997
|
+
if (params.layer !== void 0) this.layer = params.layer;
|
|
11998
|
+
if (params.width !== void 0) this.width = params.width;
|
|
11999
|
+
if (params.stroke !== void 0) this.stroke = params.stroke;
|
|
12000
|
+
if (params.fill !== void 0) this.fill = params.fill;
|
|
12001
|
+
if (params.uuid !== void 0) this.uuid = params.uuid;
|
|
12002
|
+
if (params.locked !== void 0) this.locked = params.locked;
|
|
12003
|
+
}
|
|
12004
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12005
|
+
const grRect = new _GrRect();
|
|
12006
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
12007
|
+
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
12008
|
+
for (const token of Object.keys(propertyMap)) {
|
|
12009
|
+
if (!SUPPORTED_SINGLE_TOKENS8.has(token)) {
|
|
12010
|
+
unexpectedTokens.add(token);
|
|
12011
|
+
}
|
|
12012
|
+
}
|
|
12013
|
+
for (const token of Object.keys(arrayPropertyMap)) {
|
|
12014
|
+
if (!SUPPORTED_SINGLE_TOKENS8.has(token)) {
|
|
12015
|
+
unexpectedTokens.add(token);
|
|
12016
|
+
continue;
|
|
12017
|
+
}
|
|
12018
|
+
if (arrayPropertyMap[token].length > 1) {
|
|
12019
|
+
throw new Error(
|
|
12020
|
+
`gr_rect does not support repeated child tokens: ${token}`
|
|
12021
|
+
);
|
|
12022
|
+
}
|
|
12023
|
+
}
|
|
12024
|
+
if (unexpectedTokens.size > 0) {
|
|
12025
|
+
throw new Error(
|
|
12026
|
+
`Unsupported child tokens inside gr_rect expression: ${[...unexpectedTokens].join(", ")}`
|
|
12027
|
+
);
|
|
12028
|
+
}
|
|
12029
|
+
for (const primitive of primitiveSexprs) {
|
|
12030
|
+
if (Array.isArray(primitive)) continue;
|
|
12031
|
+
throw new Error(
|
|
12032
|
+
`gr_rect encountered unexpected primitive child: ${JSON.stringify(primitive)}`
|
|
12033
|
+
);
|
|
12034
|
+
}
|
|
12035
|
+
grRect._sxStart = propertyMap.start;
|
|
12036
|
+
grRect._sxEnd = propertyMap.end;
|
|
12037
|
+
grRect._sxLayer = propertyMap.layer;
|
|
12038
|
+
grRect._sxWidth = propertyMap.width;
|
|
12039
|
+
grRect._sxStroke = propertyMap.stroke;
|
|
12040
|
+
grRect._sxFill = propertyMap.fill;
|
|
12041
|
+
const locked = propertyMap.locked;
|
|
12042
|
+
grRect._sxLocked = locked && locked.value ? locked : void 0;
|
|
12043
|
+
grRect._sxUuid = propertyMap.uuid;
|
|
12044
|
+
if (!grRect._sxStart) {
|
|
12045
|
+
throw new Error("gr_rect requires a start child token");
|
|
12046
|
+
}
|
|
12047
|
+
if (!grRect._sxEnd) {
|
|
12048
|
+
throw new Error("gr_rect requires an end child token");
|
|
12049
|
+
}
|
|
12050
|
+
if (!grRect._sxLayer) {
|
|
12051
|
+
throw new Error("gr_rect requires a layer child token");
|
|
12052
|
+
}
|
|
12053
|
+
return grRect;
|
|
12054
|
+
}
|
|
12055
|
+
get start() {
|
|
12056
|
+
return this._sxStart;
|
|
12057
|
+
}
|
|
12058
|
+
set start(value) {
|
|
12059
|
+
if (value === void 0) {
|
|
12060
|
+
this._sxStart = void 0;
|
|
12061
|
+
return;
|
|
12062
|
+
}
|
|
12063
|
+
if (value instanceof GrRectStart) {
|
|
12064
|
+
this._sxStart = value;
|
|
12065
|
+
return;
|
|
12066
|
+
}
|
|
12067
|
+
this._sxStart = new GrRectStart(value.x, value.y);
|
|
12068
|
+
}
|
|
12069
|
+
get end() {
|
|
12070
|
+
return this._sxEnd;
|
|
12071
|
+
}
|
|
12072
|
+
set end(value) {
|
|
12073
|
+
if (value === void 0) {
|
|
12074
|
+
this._sxEnd = void 0;
|
|
12075
|
+
return;
|
|
12076
|
+
}
|
|
12077
|
+
if (value instanceof GrRectEnd) {
|
|
12078
|
+
this._sxEnd = value;
|
|
12079
|
+
return;
|
|
12080
|
+
}
|
|
12081
|
+
this._sxEnd = new GrRectEnd(value.x, value.y);
|
|
12082
|
+
}
|
|
12083
|
+
get startPoint() {
|
|
12084
|
+
return this._sxStart ? { x: this._sxStart.x, y: this._sxStart.y } : void 0;
|
|
12085
|
+
}
|
|
12086
|
+
get endPoint() {
|
|
12087
|
+
return this._sxEnd ? { x: this._sxEnd.x, y: this._sxEnd.y } : void 0;
|
|
12088
|
+
}
|
|
12089
|
+
get layer() {
|
|
12090
|
+
return this._sxLayer;
|
|
12091
|
+
}
|
|
12092
|
+
set layer(value) {
|
|
12093
|
+
if (value === void 0) {
|
|
12094
|
+
this._sxLayer = void 0;
|
|
12095
|
+
return;
|
|
12096
|
+
}
|
|
12097
|
+
if (value instanceof Layer) {
|
|
12098
|
+
this._sxLayer = value;
|
|
12099
|
+
return;
|
|
12100
|
+
}
|
|
12101
|
+
const names = Array.isArray(value) ? value : [value];
|
|
12102
|
+
this._sxLayer = new Layer(names);
|
|
12103
|
+
}
|
|
12104
|
+
get stroke() {
|
|
12105
|
+
return this._sxStroke;
|
|
12106
|
+
}
|
|
12107
|
+
set stroke(value) {
|
|
12108
|
+
this._sxStroke = value;
|
|
12109
|
+
}
|
|
12110
|
+
get width() {
|
|
12111
|
+
return this._sxWidth?.value;
|
|
12112
|
+
}
|
|
12113
|
+
set width(value) {
|
|
12114
|
+
if (value === void 0) {
|
|
12115
|
+
this._sxWidth = void 0;
|
|
12116
|
+
return;
|
|
12117
|
+
}
|
|
12118
|
+
if (value instanceof Width) {
|
|
12119
|
+
this._sxWidth = value;
|
|
12120
|
+
return;
|
|
12121
|
+
}
|
|
12122
|
+
this._sxWidth = new Width(value);
|
|
12123
|
+
}
|
|
12124
|
+
get widthClass() {
|
|
12125
|
+
return this._sxWidth;
|
|
12126
|
+
}
|
|
12127
|
+
set widthClass(value) {
|
|
12128
|
+
this._sxWidth = value;
|
|
12129
|
+
}
|
|
12130
|
+
get fill() {
|
|
12131
|
+
return this._sxFill?.filled;
|
|
12132
|
+
}
|
|
12133
|
+
set fill(value) {
|
|
12134
|
+
if (value === void 0) {
|
|
12135
|
+
this._sxFill = void 0;
|
|
12136
|
+
return;
|
|
12137
|
+
}
|
|
12138
|
+
if (value instanceof GrRectFill) {
|
|
12139
|
+
this._sxFill = value;
|
|
12140
|
+
return;
|
|
12141
|
+
}
|
|
12142
|
+
this._sxFill = new GrRectFill(value);
|
|
12143
|
+
}
|
|
12144
|
+
get fillClass() {
|
|
12145
|
+
return this._sxFill;
|
|
12146
|
+
}
|
|
12147
|
+
get uuid() {
|
|
12148
|
+
return this._sxUuid?.value;
|
|
12149
|
+
}
|
|
12150
|
+
set uuid(value) {
|
|
12151
|
+
if (value === void 0) {
|
|
12152
|
+
this._sxUuid = void 0;
|
|
12153
|
+
return;
|
|
12154
|
+
}
|
|
12155
|
+
if (value instanceof Uuid) {
|
|
12156
|
+
this._sxUuid = value;
|
|
12157
|
+
return;
|
|
12158
|
+
}
|
|
12159
|
+
this._sxUuid = new Uuid(value);
|
|
12160
|
+
}
|
|
12161
|
+
get uuidClass() {
|
|
12162
|
+
return this._sxUuid;
|
|
12163
|
+
}
|
|
12164
|
+
get locked() {
|
|
12165
|
+
return this._sxLocked?.value ?? false;
|
|
12166
|
+
}
|
|
12167
|
+
set locked(value) {
|
|
12168
|
+
this._sxLocked = value ? new GrRectLocked(true) : void 0;
|
|
12169
|
+
}
|
|
12170
|
+
getChildren() {
|
|
12171
|
+
const children = [];
|
|
12172
|
+
if (this._sxStart) children.push(this._sxStart);
|
|
12173
|
+
if (this._sxEnd) children.push(this._sxEnd);
|
|
12174
|
+
if (this._sxStroke) children.push(this._sxStroke);
|
|
12175
|
+
if (this._sxWidth) children.push(this._sxWidth);
|
|
12176
|
+
if (this._sxFill) children.push(this._sxFill);
|
|
12177
|
+
if (this._sxLocked) children.push(this._sxLocked);
|
|
12178
|
+
if (this._sxLayer) children.push(this._sxLayer);
|
|
12179
|
+
if (this._sxUuid) children.push(this._sxUuid);
|
|
12180
|
+
return children;
|
|
12181
|
+
}
|
|
12182
|
+
};
|
|
12183
|
+
SxClass.register(GrRect);
|
|
12184
|
+
var GrRectStart = class _GrRectStart extends SxClass {
|
|
12185
|
+
static token = "start";
|
|
12186
|
+
static parentToken = "gr_rect";
|
|
12187
|
+
token = "start";
|
|
12188
|
+
_x;
|
|
12189
|
+
_y;
|
|
12190
|
+
constructor(x, y) {
|
|
12191
|
+
super();
|
|
12192
|
+
this._x = x;
|
|
12193
|
+
this._y = y;
|
|
12194
|
+
}
|
|
12195
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12196
|
+
const [rawX, rawY] = primitiveSexprs;
|
|
12197
|
+
const x = toNumberValue(rawX);
|
|
12198
|
+
const y = toNumberValue(rawY);
|
|
12199
|
+
if (x === void 0 || y === void 0) {
|
|
12200
|
+
throw new Error("gr_rect start expects two numeric arguments");
|
|
12201
|
+
}
|
|
12202
|
+
return new _GrRectStart(x, y);
|
|
12203
|
+
}
|
|
12204
|
+
get x() {
|
|
12205
|
+
return this._x;
|
|
12206
|
+
}
|
|
12207
|
+
set x(value) {
|
|
12208
|
+
this._x = value;
|
|
12209
|
+
}
|
|
12210
|
+
get y() {
|
|
12211
|
+
return this._y;
|
|
12212
|
+
}
|
|
12213
|
+
set y(value) {
|
|
12214
|
+
this._y = value;
|
|
12215
|
+
}
|
|
12216
|
+
toObject() {
|
|
12217
|
+
return { x: this._x, y: this._y };
|
|
12218
|
+
}
|
|
12219
|
+
getChildren() {
|
|
12220
|
+
return [];
|
|
12221
|
+
}
|
|
12222
|
+
getString() {
|
|
12223
|
+
return `(start ${this._x} ${this._y})`;
|
|
12224
|
+
}
|
|
12225
|
+
};
|
|
12226
|
+
SxClass.register(GrRectStart);
|
|
12227
|
+
var GrRectEnd = class _GrRectEnd extends SxClass {
|
|
12228
|
+
static token = "end";
|
|
12229
|
+
static parentToken = "gr_rect";
|
|
12230
|
+
token = "end";
|
|
12231
|
+
_x;
|
|
12232
|
+
_y;
|
|
12233
|
+
constructor(x, y) {
|
|
12234
|
+
super();
|
|
12235
|
+
this._x = x;
|
|
12236
|
+
this._y = y;
|
|
12237
|
+
}
|
|
12238
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12239
|
+
const [rawX, rawY] = primitiveSexprs;
|
|
12240
|
+
const x = toNumberValue(rawX);
|
|
12241
|
+
const y = toNumberValue(rawY);
|
|
12242
|
+
if (x === void 0 || y === void 0) {
|
|
12243
|
+
throw new Error("gr_rect end expects two numeric arguments");
|
|
12244
|
+
}
|
|
12245
|
+
return new _GrRectEnd(x, y);
|
|
12246
|
+
}
|
|
12247
|
+
get x() {
|
|
12248
|
+
return this._x;
|
|
12249
|
+
}
|
|
12250
|
+
set x(value) {
|
|
12251
|
+
this._x = value;
|
|
12252
|
+
}
|
|
12253
|
+
get y() {
|
|
12254
|
+
return this._y;
|
|
12255
|
+
}
|
|
12256
|
+
set y(value) {
|
|
12257
|
+
this._y = value;
|
|
12258
|
+
}
|
|
12259
|
+
toObject() {
|
|
12260
|
+
return { x: this._x, y: this._y };
|
|
12261
|
+
}
|
|
12262
|
+
getChildren() {
|
|
12263
|
+
return [];
|
|
12264
|
+
}
|
|
12265
|
+
getString() {
|
|
12266
|
+
return `(end ${this._x} ${this._y})`;
|
|
12267
|
+
}
|
|
12268
|
+
};
|
|
12269
|
+
SxClass.register(GrRectEnd);
|
|
12270
|
+
var GrRectFill = class _GrRectFill extends SxClass {
|
|
12271
|
+
static token = "fill";
|
|
12272
|
+
static parentToken = "gr_rect";
|
|
12273
|
+
token = "fill";
|
|
12274
|
+
filled;
|
|
12275
|
+
constructor(filled) {
|
|
12276
|
+
super();
|
|
12277
|
+
this.filled = filled;
|
|
12278
|
+
}
|
|
12279
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12280
|
+
const state = toStringValue(primitiveSexprs[0]);
|
|
12281
|
+
return new _GrRectFill(state === "yes");
|
|
12282
|
+
}
|
|
12283
|
+
getString() {
|
|
12284
|
+
return `(fill ${this.filled ? "yes" : "no"})`;
|
|
12285
|
+
}
|
|
12286
|
+
};
|
|
12287
|
+
SxClass.register(GrRectFill);
|
|
12288
|
+
var GrRectLocked = class _GrRectLocked extends SxClass {
|
|
12289
|
+
static token = "locked";
|
|
12290
|
+
static parentToken = "gr_rect";
|
|
12291
|
+
token = "locked";
|
|
12292
|
+
value;
|
|
12293
|
+
constructor(value) {
|
|
12294
|
+
super();
|
|
12295
|
+
this.value = value;
|
|
12296
|
+
}
|
|
12297
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12298
|
+
if (primitiveSexprs.length === 0) {
|
|
12299
|
+
return new _GrRectLocked(true);
|
|
12300
|
+
}
|
|
12301
|
+
const state = toStringValue(primitiveSexprs[0]);
|
|
12302
|
+
return new _GrRectLocked(state === "yes");
|
|
12303
|
+
}
|
|
12304
|
+
getString() {
|
|
12305
|
+
return this.value ? "(locked yes)" : "(locked no)";
|
|
12306
|
+
}
|
|
12307
|
+
};
|
|
12308
|
+
SxClass.register(GrRectLocked);
|
|
12309
|
+
|
|
12310
|
+
// lib/sexpr/classes/GrText.ts
|
|
12311
|
+
var SUPPORTED_SINGLE_TOKENS9 = /* @__PURE__ */ new Set([
|
|
11937
12312
|
"at",
|
|
11938
12313
|
"xy",
|
|
11939
12314
|
"layer",
|
|
@@ -11976,12 +12351,12 @@ var GrText = class _GrText extends SxClass {
|
|
|
11976
12351
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rest, this.token);
|
|
11977
12352
|
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
11978
12353
|
for (const token of Object.keys(propertyMap)) {
|
|
11979
|
-
if (!
|
|
12354
|
+
if (!SUPPORTED_SINGLE_TOKENS9.has(token)) {
|
|
11980
12355
|
unexpectedTokens.add(token);
|
|
11981
12356
|
}
|
|
11982
12357
|
}
|
|
11983
12358
|
for (const token of Object.keys(arrayPropertyMap)) {
|
|
11984
|
-
if (!
|
|
12359
|
+
if (!SUPPORTED_SINGLE_TOKENS9.has(token)) {
|
|
11985
12360
|
unexpectedTokens.add(token);
|
|
11986
12361
|
continue;
|
|
11987
12362
|
}
|
|
@@ -12116,6 +12491,170 @@ var GrText = class _GrText extends SxClass {
|
|
|
12116
12491
|
};
|
|
12117
12492
|
SxClass.register(GrText);
|
|
12118
12493
|
|
|
12494
|
+
// lib/sexpr/classes/Group.ts
|
|
12495
|
+
var SUPPORTED_SINGLE_TOKENS10 = /* @__PURE__ */ new Set(["uuid", "locked", "members"]);
|
|
12496
|
+
var Group = class _Group extends SxClass {
|
|
12497
|
+
static token = "group";
|
|
12498
|
+
token = "group";
|
|
12499
|
+
_name = "";
|
|
12500
|
+
_sxUuid;
|
|
12501
|
+
_sxLocked;
|
|
12502
|
+
_sxMembers;
|
|
12503
|
+
constructor(params = {}) {
|
|
12504
|
+
super();
|
|
12505
|
+
if (params.name !== void 0) this.name = params.name;
|
|
12506
|
+
if (params.uuid !== void 0) this.uuid = params.uuid;
|
|
12507
|
+
if (params.locked !== void 0) this.locked = params.locked;
|
|
12508
|
+
if (params.members !== void 0) this.members = params.members;
|
|
12509
|
+
}
|
|
12510
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12511
|
+
const group = new _Group();
|
|
12512
|
+
if (primitiveSexprs.length > 0 && typeof primitiveSexprs[0] === "string") {
|
|
12513
|
+
group._name = primitiveSexprs[0];
|
|
12514
|
+
}
|
|
12515
|
+
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(
|
|
12516
|
+
primitiveSexprs.slice(1),
|
|
12517
|
+
this.token
|
|
12518
|
+
);
|
|
12519
|
+
const unexpectedTokens = /* @__PURE__ */ new Set();
|
|
12520
|
+
for (const token of Object.keys(propertyMap)) {
|
|
12521
|
+
if (!SUPPORTED_SINGLE_TOKENS10.has(token)) {
|
|
12522
|
+
unexpectedTokens.add(token);
|
|
12523
|
+
}
|
|
12524
|
+
}
|
|
12525
|
+
for (const token of Object.keys(arrayPropertyMap)) {
|
|
12526
|
+
if (!SUPPORTED_SINGLE_TOKENS10.has(token)) {
|
|
12527
|
+
unexpectedTokens.add(token);
|
|
12528
|
+
continue;
|
|
12529
|
+
}
|
|
12530
|
+
if (arrayPropertyMap[token].length > 1) {
|
|
12531
|
+
throw new Error(
|
|
12532
|
+
`group does not support repeated child tokens: ${token}`
|
|
12533
|
+
);
|
|
12534
|
+
}
|
|
12535
|
+
}
|
|
12536
|
+
if (unexpectedTokens.size > 0) {
|
|
12537
|
+
throw new Error(
|
|
12538
|
+
`Unsupported child tokens inside group expression: ${[...unexpectedTokens].join(", ")}`
|
|
12539
|
+
);
|
|
12540
|
+
}
|
|
12541
|
+
for (const primitive of primitiveSexprs.slice(1)) {
|
|
12542
|
+
if (Array.isArray(primitive)) continue;
|
|
12543
|
+
throw new Error(
|
|
12544
|
+
`group encountered unexpected primitive child: ${JSON.stringify(primitive)}`
|
|
12545
|
+
);
|
|
12546
|
+
}
|
|
12547
|
+
group._sxUuid = propertyMap.uuid;
|
|
12548
|
+
const locked = propertyMap.locked;
|
|
12549
|
+
group._sxLocked = locked && locked.value ? locked : void 0;
|
|
12550
|
+
group._sxMembers = propertyMap.members;
|
|
12551
|
+
return group;
|
|
12552
|
+
}
|
|
12553
|
+
get name() {
|
|
12554
|
+
return this._name;
|
|
12555
|
+
}
|
|
12556
|
+
set name(value) {
|
|
12557
|
+
this._name = value;
|
|
12558
|
+
}
|
|
12559
|
+
get uuid() {
|
|
12560
|
+
return this._sxUuid?.value;
|
|
12561
|
+
}
|
|
12562
|
+
set uuid(value) {
|
|
12563
|
+
if (value === void 0) {
|
|
12564
|
+
this._sxUuid = void 0;
|
|
12565
|
+
return;
|
|
12566
|
+
}
|
|
12567
|
+
this._sxUuid = value instanceof Uuid ? value : new Uuid(value);
|
|
12568
|
+
}
|
|
12569
|
+
get uuidClass() {
|
|
12570
|
+
return this._sxUuid;
|
|
12571
|
+
}
|
|
12572
|
+
get locked() {
|
|
12573
|
+
return this._sxLocked?.value ?? false;
|
|
12574
|
+
}
|
|
12575
|
+
set locked(value) {
|
|
12576
|
+
this._sxLocked = value ? new GroupLocked(true) : void 0;
|
|
12577
|
+
}
|
|
12578
|
+
get members() {
|
|
12579
|
+
return this._sxMembers?.members ?? [];
|
|
12580
|
+
}
|
|
12581
|
+
set members(value) {
|
|
12582
|
+
this._sxMembers = new GroupMembers(value);
|
|
12583
|
+
}
|
|
12584
|
+
get membersClass() {
|
|
12585
|
+
return this._sxMembers;
|
|
12586
|
+
}
|
|
12587
|
+
getChildren() {
|
|
12588
|
+
const children = [];
|
|
12589
|
+
if (this._sxUuid) children.push(this._sxUuid);
|
|
12590
|
+
if (this._sxLocked) children.push(this._sxLocked);
|
|
12591
|
+
if (this._sxMembers) children.push(this._sxMembers);
|
|
12592
|
+
return children;
|
|
12593
|
+
}
|
|
12594
|
+
getString() {
|
|
12595
|
+
const lines = [`(group "${this._name}"`];
|
|
12596
|
+
const push = (value) => {
|
|
12597
|
+
if (!value) return;
|
|
12598
|
+
lines.push(value.getStringIndented());
|
|
12599
|
+
};
|
|
12600
|
+
push(this._sxUuid);
|
|
12601
|
+
push(this._sxLocked);
|
|
12602
|
+
push(this._sxMembers);
|
|
12603
|
+
lines.push(")");
|
|
12604
|
+
return lines.join("\n");
|
|
12605
|
+
}
|
|
12606
|
+
};
|
|
12607
|
+
SxClass.register(Group);
|
|
12608
|
+
var GroupLocked = class _GroupLocked extends SxClass {
|
|
12609
|
+
static token = "locked";
|
|
12610
|
+
static parentToken = "group";
|
|
12611
|
+
token = "locked";
|
|
12612
|
+
value;
|
|
12613
|
+
constructor(value) {
|
|
12614
|
+
super();
|
|
12615
|
+
this.value = value;
|
|
12616
|
+
}
|
|
12617
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12618
|
+
if (primitiveSexprs.length === 0) {
|
|
12619
|
+
return new _GroupLocked(true);
|
|
12620
|
+
}
|
|
12621
|
+
const state = toStringValue(primitiveSexprs[0]);
|
|
12622
|
+
return new _GroupLocked(state === "yes");
|
|
12623
|
+
}
|
|
12624
|
+
getString() {
|
|
12625
|
+
return this.value ? "(locked yes)" : "(locked no)";
|
|
12626
|
+
}
|
|
12627
|
+
};
|
|
12628
|
+
SxClass.register(GroupLocked);
|
|
12629
|
+
var GroupMembers = class _GroupMembers extends SxClass {
|
|
12630
|
+
static token = "members";
|
|
12631
|
+
static parentToken = "group";
|
|
12632
|
+
token = "members";
|
|
12633
|
+
members;
|
|
12634
|
+
constructor(members) {
|
|
12635
|
+
super();
|
|
12636
|
+
this.members = members;
|
|
12637
|
+
}
|
|
12638
|
+
static fromSexprPrimitives(primitiveSexprs) {
|
|
12639
|
+
const members = [];
|
|
12640
|
+
for (const primitive of primitiveSexprs) {
|
|
12641
|
+
const str = toStringValue(primitive);
|
|
12642
|
+
if (str) {
|
|
12643
|
+
members.push(str);
|
|
12644
|
+
}
|
|
12645
|
+
}
|
|
12646
|
+
return new _GroupMembers(members);
|
|
12647
|
+
}
|
|
12648
|
+
getString() {
|
|
12649
|
+
if (this.members.length === 0) {
|
|
12650
|
+
return "(members)";
|
|
12651
|
+
}
|
|
12652
|
+
const memberStrings = this.members.map((m) => `"${m}"`).join(" ");
|
|
12653
|
+
return `(members ${memberStrings})`;
|
|
12654
|
+
}
|
|
12655
|
+
};
|
|
12656
|
+
SxClass.register(GroupMembers);
|
|
12657
|
+
|
|
12119
12658
|
// lib/sexpr/classes/SegmentEnd.ts
|
|
12120
12659
|
var SegmentEnd = class _SegmentEnd extends SxClass {
|
|
12121
12660
|
static token = "end";
|
|
@@ -12278,7 +12817,7 @@ var SegmentStart = class _SegmentStart extends SxClass {
|
|
|
12278
12817
|
SxClass.register(SegmentStart);
|
|
12279
12818
|
|
|
12280
12819
|
// lib/sexpr/classes/Segment.ts
|
|
12281
|
-
var
|
|
12820
|
+
var SUPPORTED_SINGLE_TOKENS11 = /* @__PURE__ */ new Set([
|
|
12282
12821
|
"start",
|
|
12283
12822
|
"end",
|
|
12284
12823
|
"width",
|
|
@@ -12314,7 +12853,7 @@ var Segment = class _Segment extends SxClass {
|
|
|
12314
12853
|
const segment = new _Segment();
|
|
12315
12854
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
12316
12855
|
const unexpectedSingleTokens = Object.keys(propertyMap).filter(
|
|
12317
|
-
(token) => !
|
|
12856
|
+
(token) => !SUPPORTED_SINGLE_TOKENS11.has(token)
|
|
12318
12857
|
);
|
|
12319
12858
|
if (unexpectedSingleTokens.length > 0) {
|
|
12320
12859
|
throw new Error(
|
|
@@ -12322,7 +12861,7 @@ var Segment = class _Segment extends SxClass {
|
|
|
12322
12861
|
);
|
|
12323
12862
|
}
|
|
12324
12863
|
for (const [token, entries] of Object.entries(arrayPropertyMap)) {
|
|
12325
|
-
if (!
|
|
12864
|
+
if (!SUPPORTED_SINGLE_TOKENS11.has(token)) {
|
|
12326
12865
|
throw new Error(
|
|
12327
12866
|
`Unsupported child tokens inside segment expression: ${token}`
|
|
12328
12867
|
);
|
|
@@ -15390,13 +15929,22 @@ export {
|
|
|
15390
15929
|
GrCircle,
|
|
15391
15930
|
GrCircleCenter,
|
|
15392
15931
|
GrCircleEnd,
|
|
15932
|
+
GrCircleLocked,
|
|
15393
15933
|
GrCurve,
|
|
15394
15934
|
GrLine,
|
|
15395
15935
|
GrLineAngle,
|
|
15396
15936
|
GrLineEnd,
|
|
15397
15937
|
GrLineLocked,
|
|
15398
15938
|
GrLineStart,
|
|
15939
|
+
GrRect,
|
|
15940
|
+
GrRectEnd,
|
|
15941
|
+
GrRectFill,
|
|
15942
|
+
GrRectLocked,
|
|
15943
|
+
GrRectStart,
|
|
15399
15944
|
GrText,
|
|
15945
|
+
Group,
|
|
15946
|
+
GroupLocked,
|
|
15947
|
+
GroupMembers,
|
|
15400
15948
|
Image,
|
|
15401
15949
|
ImageData,
|
|
15402
15950
|
ImageScale,
|