circuit-json 0.0.513 → 0.0.515
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/README.md +112 -0
- package/dist/index.d.mts +3170 -153
- package/dist/index.mjs +2212 -2048
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,6 +63,7 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
|
|
|
63
63
|
- [SourceManuallyPlacedVia](#sourcemanuallyplacedvia)
|
|
64
64
|
- [SourceMissingManufacturerPartNumberWarning](#sourcemissingmanufacturerpartnumberwarning)
|
|
65
65
|
- [SourceMissingPropertyError](#sourcemissingpropertyerror)
|
|
66
|
+
- [SourceMotor](#sourcemotor)
|
|
66
67
|
- [SourceNet](#sourcenet)
|
|
67
68
|
- [SourceNoGroundPinDefinedWarning](#sourcenogroundpindefinedwarning)
|
|
68
69
|
- [SourceNoPowerPinDefinedWarning](#sourcenopowerpindefinedwarning)
|
|
@@ -72,6 +73,7 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
|
|
|
72
73
|
- [SourcePinMissingTraceWarning](#sourcepinmissingtracewarning)
|
|
73
74
|
- [SourcePinMustBeConnectedError](#sourcepinmustbeconnectederror)
|
|
74
75
|
- [SourcePort](#sourceport)
|
|
76
|
+
- [SourcePrintedPart](#sourceprintedpart)
|
|
75
77
|
- [SourceProjectMetadata](#sourceprojectmetadata)
|
|
76
78
|
- [SourcePropertyIgnoredWarning](#sourcepropertyignoredwarning)
|
|
77
79
|
- [SourceRefdesConventionWarning](#sourcerefdesconventionwarning)
|
|
@@ -102,6 +104,7 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
|
|
|
102
104
|
- [SourceSimpleTransistor](#sourcesimpletransistor)
|
|
103
105
|
- [SourceSimpleVoltageProbe](#sourcesimplevoltageprobe)
|
|
104
106
|
- [SourceSimpleVoltageSource](#sourcesimplevoltagesource)
|
|
107
|
+
- [SourceSubassembly](#sourcesubassembly)
|
|
105
108
|
- [SourceTrace](#sourcetrace)
|
|
106
109
|
- [SourceTraceNotConnectedError](#sourcetracenotconnectederror)
|
|
107
110
|
- [SourceUnnamedTraceWarning](#sourceunnamedtracewarning)
|
|
@@ -114,6 +117,8 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
|
|
|
114
117
|
- [PcbBend](#pcbbend)
|
|
115
118
|
- [PcbBoard](#pcbboard)
|
|
116
119
|
- [PcbBreakoutPoint](#pcbbreakoutpoint)
|
|
120
|
+
- [PcbBusRoutingConstraintError](#pcbbusroutingconstrainterror)
|
|
121
|
+
- [PcbBusRoutingConstraintWarning](#pcbbusroutingconstraintwarning)
|
|
117
122
|
- [PcbBusLengthSkewError](#pcbbuslengthskewerror)
|
|
118
123
|
- [PcbComponent](#pcbcomponent)
|
|
119
124
|
- [PcbComponentInvalidLayerError](#pcbcomponentinvalidlayererror)
|
|
@@ -357,8 +362,47 @@ interface SourceBus {
|
|
|
357
362
|
source_trace_ids: string[]
|
|
358
363
|
/** Maximum difference between the longest and shortest member, in millimeters. */
|
|
359
364
|
max_length_skew?: number
|
|
365
|
+
/** Intended single-ended characteristic impedance, in ohms. */
|
|
366
|
+
target_impedance?: number
|
|
367
|
+
/** Intended differential characteristic impedance, in ohms. */
|
|
368
|
+
target_differential_impedance?: number
|
|
369
|
+
/** Ordered polarity for a resolved point-to-point differential pair. */
|
|
370
|
+
differential_pair?: {
|
|
371
|
+
positive_source_trace_id: string
|
|
372
|
+
negative_source_trace_id: string
|
|
373
|
+
trace_gap?: number
|
|
374
|
+
max_uncoupled_length?: number
|
|
375
|
+
}
|
|
376
|
+
/** Additional traces for length comparison, without changing electrical membership. */
|
|
377
|
+
length_match_source_trace_ids?: string[]
|
|
378
|
+
min_length?: SourceBusRouteLength
|
|
379
|
+
max_length?: SourceBusRouteLength
|
|
380
|
+
target_length?: SourceBusRouteLength
|
|
381
|
+
length_tolerance?: number
|
|
382
|
+
/** Within this bus, excluding declared differential partners. */
|
|
383
|
+
pcb_trace_spacing?: SourceBusTraceSpacing
|
|
384
|
+
/** To all signals outside this bus or pair. */
|
|
385
|
+
pcb_spacing_to_other_signals?: SourceBusTraceSpacing
|
|
386
|
+
target_impedance_min?: number
|
|
387
|
+
target_impedance_max?: number
|
|
388
|
+
target_differential_impedance_min?: number
|
|
389
|
+
target_differential_impedance_max?: number
|
|
360
390
|
subcircuit_id?: string
|
|
361
391
|
}
|
|
392
|
+
|
|
393
|
+
/** A routed length in mm, or an offset from the longest endpoint Manhattan distance.
|
|
394
|
+
* Explicit references are resolved source traces; omitted references use the bus
|
|
395
|
+
* members and length_match_source_trace_ids. */
|
|
396
|
+
type SourceBusRouteLength =
|
|
397
|
+
| number
|
|
398
|
+
| {
|
|
399
|
+
reference: "longest_manhattan"
|
|
400
|
+
source_trace_ids?: string[]
|
|
401
|
+
offset?: number
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/** Centerline separation in mm or a multiple of the larger local trace width. */
|
|
405
|
+
type SourceBusTraceSpacing = number | { width_multiplier: number }
|
|
362
406
|
```
|
|
363
407
|
|
|
364
408
|
### SourceComponentBase
|
|
@@ -598,6 +642,19 @@ interface SourceMissingPropertyError extends BaseCircuitJsonError {
|
|
|
598
642
|
}
|
|
599
643
|
```
|
|
600
644
|
|
|
645
|
+
### SourceMotor
|
|
646
|
+
|
|
647
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/source_motor.ts)
|
|
648
|
+
|
|
649
|
+
Defines a motor component.
|
|
650
|
+
|
|
651
|
+
```typescript
|
|
652
|
+
/** Defines a motor component. */
|
|
653
|
+
interface SourceMotor extends SourceComponentBase {
|
|
654
|
+
ftype: "motor"
|
|
655
|
+
}
|
|
656
|
+
```
|
|
657
|
+
|
|
601
658
|
### SourceNet
|
|
602
659
|
|
|
603
660
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/source_net.ts)
|
|
@@ -813,6 +870,19 @@ interface SourcePort extends SourcePinAttributes {
|
|
|
813
870
|
}
|
|
814
871
|
```
|
|
815
872
|
|
|
873
|
+
### SourcePrintedPart
|
|
874
|
+
|
|
875
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/source_printed_part.ts)
|
|
876
|
+
|
|
877
|
+
Defines a 3D-printed part in an assembly.
|
|
878
|
+
|
|
879
|
+
```typescript
|
|
880
|
+
/** Defines a 3D-printed part in an assembly. */
|
|
881
|
+
interface SourcePrintedPart extends SourceComponentBase {
|
|
882
|
+
ftype: "printedpart"
|
|
883
|
+
}
|
|
884
|
+
```
|
|
885
|
+
|
|
816
886
|
### SourceProjectMetadata
|
|
817
887
|
|
|
818
888
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/source_project_metadata.ts)
|
|
@@ -1263,6 +1333,19 @@ interface SourceSimpleVoltageSource extends SourceComponentBase {
|
|
|
1263
1333
|
}
|
|
1264
1334
|
```
|
|
1265
1335
|
|
|
1336
|
+
### SourceSubassembly
|
|
1337
|
+
|
|
1338
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/source_subassembly.ts)
|
|
1339
|
+
|
|
1340
|
+
Defines a subassembly component.
|
|
1341
|
+
|
|
1342
|
+
```typescript
|
|
1343
|
+
/** Defines a subassembly component. */
|
|
1344
|
+
interface SourceSubassembly extends SourceComponentBase {
|
|
1345
|
+
ftype: "subassembly"
|
|
1346
|
+
}
|
|
1347
|
+
```
|
|
1348
|
+
|
|
1266
1349
|
### SourceTrace
|
|
1267
1350
|
|
|
1268
1351
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/source_trace.ts)
|
|
@@ -1526,6 +1609,35 @@ interface PcbBreakoutPoint {
|
|
|
1526
1609
|
}
|
|
1527
1610
|
```
|
|
1528
1611
|
|
|
1612
|
+
### PcbBusRoutingConstraintError
|
|
1613
|
+
|
|
1614
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_error.ts)
|
|
1615
|
+
|
|
1616
|
+
A discriminated union of bus/pair constraint violations. Every variant includes `source_bus_id`, `source_trace_ids`, `pcb_trace_ids`, `message`, and the error identity fields. Lengths and centerline spacing are mm; impedance is ohms. Spacing variants also require `other_pcb_trace_id` and may include `other_source_trace_id`.
|
|
1617
|
+
|
|
1618
|
+
| `routing_rule` | Required measurements | Optional bounds |
|
|
1619
|
+
| --- | --- | --- |
|
|
1620
|
+
| `length_skew` | `actual_length_skew`, `maximum_length_skew` | — |
|
|
1621
|
+
| `min_length` | `actual_trace_length`, `minimum_trace_length` | — |
|
|
1622
|
+
| `max_length` | `actual_trace_length`, `maximum_trace_length` | — |
|
|
1623
|
+
| `target_length` | `actual_trace_length`, `target_trace_length`, `length_tolerance` | — |
|
|
1624
|
+
| `pcb_trace_spacing` | `actual_centerline_spacing`, `minimum_centerline_spacing` | — |
|
|
1625
|
+
| `pcb_spacing_to_other_signals` | `actual_centerline_spacing`, `minimum_centerline_spacing` | — |
|
|
1626
|
+
| `impedance_target` | `target_impedance` | `minimum_impedance`, `maximum_impedance` (at least one) |
|
|
1627
|
+
|
|
1628
|
+
```typescript
|
|
1629
|
+
if (error.routing_rule === "max_length") {
|
|
1630
|
+
// Narrowed to the maximum-length variant; these fields are required.
|
|
1631
|
+
console.log(error.actual_trace_length, error.maximum_trace_length)
|
|
1632
|
+
}
|
|
1633
|
+
```
|
|
1634
|
+
|
|
1635
|
+
### PcbBusRoutingConstraintWarning
|
|
1636
|
+
|
|
1637
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_warning.ts)
|
|
1638
|
+
|
|
1639
|
+
An unverified constraint, discriminated by `routing_rule`: `route_geometry`, `reference_geometry`, `spacing_geometry`, `target_length`, or `physical_impedance`. Every variant includes `source_bus_id`, `source_trace_ids`, `pcb_trace_ids`, `message`, and warning identity fields. Missing geometry uses an empty `pcb_trace_ids` array; these warnings contain no measurements and must not be interpreted as a pass.
|
|
1640
|
+
|
|
1529
1641
|
### PcbBusLengthSkewError
|
|
1530
1642
|
|
|
1531
1643
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_length_skew_error.ts)
|