circuit-json 0.0.59 → 0.0.75
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 +5 -5
- package/dist/index.d.ts +3518 -281
- package/dist/index.js +516 -394
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Circuit JSON Specification `circuit-json`
|
|
2
2
|
|
|
3
3
|
[tscircuit](https://github.com/tscircuit/tscircuit) · [Soup Specification Docs](https://docs.tscircuit.com/api-reference/advanced/soup)
|
|
4
4
|
|
|
5
5
|
[](https://badge.fury.io/js/%40tscircuit%2Fsoup)
|
|
6
6
|
|
|
7
|
-
“tscircuit soup” is the name of the compiled intermediary low-level JSON circuit representation. It contains all the information needed to visually represent a schematic, PCB, produce Gerber files, produce bill of materials, run SPICE simulations, view warnings and more. It is designed to easily interoperate with a SQL database.
|
|
7
|
+
Circuit JSON (formally “tscircuit soup”) is the name of the compiled intermediary low-level JSON circuit representation. It contains all the information needed to visually represent a schematic, PCB, produce Gerber files, produce bill of materials, run SPICE simulations, view warnings and more. It is designed to easily interoperate with a SQL database.
|
|
8
8
|
|
|
9
9
|
This module has the zod definitions and conversion functions for using tscircuit soup.
|
|
10
10
|
|
|
@@ -12,8 +12,8 @@ This module has the zod definitions and conversion functions for using tscircuit
|
|
|
12
12
|
> This is mostly an internal module, you probably want to use the [main tscircuit library](https://github.com/tscircuit/tscircuit) instead.
|
|
13
13
|
|
|
14
14
|
```ts
|
|
15
|
-
import {
|
|
16
|
-
import type { SourceSimpleResistor } from "
|
|
15
|
+
import { any_circuit_element, simple_source_resistor } from "circuit-json"
|
|
16
|
+
import type { SourceSimpleResistor } from "circuit-json"
|
|
17
17
|
|
|
18
18
|
const resistor: SourceSimpleResistor = simple_source_resistor.parse({
|
|
19
19
|
type: "source_component",
|
|
@@ -26,7 +26,7 @@ const resistor: SourceSimpleResistor = simple_source_resistor.parse({
|
|
|
26
26
|
console.log(resistor.resistance) // 1000
|
|
27
27
|
|
|
28
28
|
// This is the common way to parse/transform any element
|
|
29
|
-
|
|
29
|
+
any_circuit_element.parse({
|
|
30
30
|
/* ... */
|
|
31
31
|
})
|
|
32
32
|
```
|