eecircuit-engine 1.0.0

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.
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Read output from spice
3
+ */
4
+ export type ResultType = {
5
+ param: ParamType;
6
+ header: string;
7
+ data: RealDataType | ComplexDataType;
8
+ };
9
+ export type ParamType = {
10
+ varNum: number;
11
+ pointNum: number;
12
+ variables: VariableType[];
13
+ dataType: "real" | "complex";
14
+ };
15
+ export type VariableType = {
16
+ name: string;
17
+ type: "voltage" | "current" | "time";
18
+ };
19
+ export type RealDataType = number[][];
20
+ export type ComplexDataType = {
21
+ real: number;
22
+ img: number;
23
+ }[][];
24
+ export default function readOutput(rawData: Uint8Array): ResultType;
@@ -0,0 +1,31 @@
1
+ import { ResultType } from './readOutput.ts';
2
+ export declare class Simulation {
3
+ private pass;
4
+ private commandList;
5
+ private cmd;
6
+ private dataRaw;
7
+ private results;
8
+ private output;
9
+ private info;
10
+ private initInfo;
11
+ private error;
12
+ private initialized;
13
+ private netList;
14
+ private resolve;
15
+ private resolveWait;
16
+ private resolveInit;
17
+ private getInput;
18
+ private start2;
19
+ start: () => Promise<void>;
20
+ runSimP: () => Promise<void>;
21
+ private waitSimResolve;
22
+ private outputEvent;
23
+ setNetList: (input: string) => void;
24
+ setOutputEvent: (outputEvent: (out: string) => void) => void;
25
+ getResult: () => ResultType;
26
+ getInfo: () => string;
27
+ getInitInfo: () => string;
28
+ getError: () => string[];
29
+ isInitialized: () => boolean;
30
+ private log_debug;
31
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ *
3
+ */
4
+
5
+ type ModuleType = {
6
+ argumnets?: string;
7
+ noInitialRun: boolean;
8
+ preRun: [() => void];
9
+ FS?: FSType;
10
+ Asyncify?: AsyncifyType;
11
+ setHandleThings: (handleThings: () => void) => void;
12
+ setGetInput: (getInput: () => void) => void;
13
+ runThings: () => void;
14
+ print: (e?: any) => void;
15
+ printErr: (e?: any) => void;
16
+ };
17
+
18
+ /**
19
+ * File System
20
+ */
21
+ type FSType = {
22
+ writeFile: (path: string, data: string) => void;
23
+ readFile: (path: string) => Uint8Array;
24
+ };
25
+
26
+ type AsyncifyType = {
27
+ handleAsync: (handle: () => void) => void;
28
+ };
29
+
30
+ export default function Module(m: ModuleType): Promise<ModuleType>;
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "eecircuit-engine",
3
+ "version": "1.0.0",
4
+ "description": "EEcircuit's simulation engine",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "main": "./dist/eecircuit-engine.umd.cjs",
9
+ "module": "./dist/eecircuit-engine.mjs",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/main.d.ts",
13
+ "import": "./dist/eecircuit-engine.mjs",
14
+ "require": "./dist/eecircuit-engine.cjs"
15
+ }
16
+ },
17
+
18
+ "scripts": {
19
+ "dev": "vite",
20
+ "build": "vite build",
21
+ "preview": "vite preview"
22
+ },
23
+ "author": "Danial Chitnis",
24
+ "license": "MIT",
25
+ "devDependencies": {
26
+ "@types/node": "^22.13.9",
27
+ "typescript": "^5.8.2",
28
+ "vite": "^6.2.0",
29
+ "vite-plugin-dts": "^4.5.3"
30
+ }
31
+ }