kicadts 0.0.15 → 0.0.16
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 +4 -0
- package/dist/index.js +23 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1591,6 +1591,7 @@ interface KicadSchConstructorParams {
|
|
|
1591
1591
|
globalLabels?: GlobalLabel[];
|
|
1592
1592
|
wires?: Wire[];
|
|
1593
1593
|
junctions?: Junction[];
|
|
1594
|
+
noConnects?: NoConnect[];
|
|
1594
1595
|
}
|
|
1595
1596
|
declare class KicadSch extends SxClass {
|
|
1596
1597
|
static token: string;
|
|
@@ -1613,6 +1614,7 @@ declare class KicadSch extends SxClass {
|
|
|
1613
1614
|
private _globalLabels;
|
|
1614
1615
|
private _wires;
|
|
1615
1616
|
private _junctions;
|
|
1617
|
+
private _noConnects;
|
|
1616
1618
|
constructor(params?: KicadSchConstructorParams);
|
|
1617
1619
|
static fromSexprPrimitives(primitiveSexprs: PrimitiveSExpr[]): KicadSch;
|
|
1618
1620
|
get version(): number | undefined;
|
|
@@ -1651,6 +1653,8 @@ declare class KicadSch extends SxClass {
|
|
|
1651
1653
|
set junctions(value: Junction[]);
|
|
1652
1654
|
get wires(): Wire[];
|
|
1653
1655
|
set wires(value: Wire[]);
|
|
1656
|
+
get noConnects(): NoConnect[];
|
|
1657
|
+
set noConnects(value: NoConnect[]);
|
|
1654
1658
|
getChildren(): SxClass[];
|
|
1655
1659
|
}
|
|
1656
1660
|
|
package/dist/index.js
CHANGED
|
@@ -3530,11 +3530,15 @@ var NoConnect = class _NoConnect extends SxClass {
|
|
|
3530
3530
|
static fromSexprPrimitives(primitiveSexprs) {
|
|
3531
3531
|
const noConnect = new _NoConnect();
|
|
3532
3532
|
const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
)
|
|
3533
|
+
for (const token of Object.keys(arrayPropertyMap)) {
|
|
3534
|
+
if (!SUPPORTED_TOKENS3.has(token)) {
|
|
3535
|
+
continue;
|
|
3536
|
+
}
|
|
3537
|
+
if (arrayPropertyMap[token].length > 1) {
|
|
3538
|
+
throw new Error(
|
|
3539
|
+
`no_connect does not support repeated child tokens: ${token}`
|
|
3540
|
+
);
|
|
3541
|
+
}
|
|
3538
3542
|
}
|
|
3539
3543
|
const unsupportedTokens = Object.keys(propertyMap).filter(
|
|
3540
3544
|
(token) => !SUPPORTED_TOKENS3.has(token)
|
|
@@ -5082,6 +5086,7 @@ var MULTI_CHILD_TOKENS = /* @__PURE__ */ new Set([
|
|
|
5082
5086
|
"global_label",
|
|
5083
5087
|
"junction",
|
|
5084
5088
|
"wire",
|
|
5089
|
+
"no_connect",
|
|
5085
5090
|
"sheet_instances"
|
|
5086
5091
|
]);
|
|
5087
5092
|
var SUPPORTED_CHILD_TOKENS2 = /* @__PURE__ */ new Set([
|
|
@@ -5109,6 +5114,7 @@ var KicadSch = class _KicadSch extends SxClass {
|
|
|
5109
5114
|
_globalLabels = [];
|
|
5110
5115
|
_wires = [];
|
|
5111
5116
|
_junctions = [];
|
|
5117
|
+
_noConnects = [];
|
|
5112
5118
|
constructor(params = {}) {
|
|
5113
5119
|
super();
|
|
5114
5120
|
if (params.version instanceof KicadSchVersion) {
|
|
@@ -5171,6 +5177,9 @@ var KicadSch = class _KicadSch extends SxClass {
|
|
|
5171
5177
|
if (params.junctions !== void 0) {
|
|
5172
5178
|
this.junctions = params.junctions;
|
|
5173
5179
|
}
|
|
5180
|
+
if (params.noConnects !== void 0) {
|
|
5181
|
+
this.noConnects = params.noConnects;
|
|
5182
|
+
}
|
|
5174
5183
|
}
|
|
5175
5184
|
static fromSexprPrimitives(primitiveSexprs) {
|
|
5176
5185
|
for (const primitive of primitiveSexprs) {
|
|
@@ -5223,7 +5232,8 @@ var KicadSch = class _KicadSch extends SxClass {
|
|
|
5223
5232
|
labels: arrayPropertyMap.label ?? [],
|
|
5224
5233
|
globalLabels: arrayPropertyMap.global_label ?? [],
|
|
5225
5234
|
junctions: arrayPropertyMap.junction ?? [],
|
|
5226
|
-
wires: arrayPropertyMap.wire ?? []
|
|
5235
|
+
wires: arrayPropertyMap.wire ?? [],
|
|
5236
|
+
noConnects: arrayPropertyMap.no_connect ?? []
|
|
5227
5237
|
});
|
|
5228
5238
|
}
|
|
5229
5239
|
get version() {
|
|
@@ -5342,6 +5352,12 @@ var KicadSch = class _KicadSch extends SxClass {
|
|
|
5342
5352
|
set wires(value) {
|
|
5343
5353
|
this._wires = [...value];
|
|
5344
5354
|
}
|
|
5355
|
+
get noConnects() {
|
|
5356
|
+
return [...this._noConnects];
|
|
5357
|
+
}
|
|
5358
|
+
set noConnects(value) {
|
|
5359
|
+
this._noConnects = [...value];
|
|
5360
|
+
}
|
|
5345
5361
|
getChildren() {
|
|
5346
5362
|
const children = [];
|
|
5347
5363
|
if (this._sxVersion) children.push(this._sxVersion);
|
|
@@ -5362,6 +5378,7 @@ var KicadSch = class _KicadSch extends SxClass {
|
|
|
5362
5378
|
children.push(...this._globalLabels);
|
|
5363
5379
|
children.push(...this._junctions);
|
|
5364
5380
|
children.push(...this._wires);
|
|
5381
|
+
children.push(...this._noConnects);
|
|
5365
5382
|
return children;
|
|
5366
5383
|
}
|
|
5367
5384
|
};
|