simple-circuit-engine 0.0.12 → 0.0.14
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/AGENTS.md +9 -6
- package/CLAUDE.md +2 -0
- package/README.md +8 -8
- package/dist/core/index.js +109 -74
- package/dist/core/setup.d.ts +18 -0
- package/dist/core/simulation/behaviors/arithmetic/AdderBehavior.d.ts +28 -0
- package/dist/core/simulation/behaviors/arithmetic/ArithmeticBehaviorMixin.d.ts +63 -0
- package/dist/core/simulation/behaviors/arithmetic/EightBitAdderBehavior.d.ts +51 -0
- package/dist/core/simulation/behaviors/arithmetic/EightBitOnesComplementBehavior.d.ts +29 -0
- package/dist/core/simulation/behaviors/arithmetic/HalfAdderBehavior.d.ts +22 -0
- package/dist/core/simulation/behaviors/arithmetic/index.d.ts +7 -0
- package/dist/core/simulation/behaviors/index.d.ts +14 -0
- package/dist/core/simulation/behaviors/interface/EightInputBehavior.d.ts +9 -0
- package/dist/core/simulation/behaviors/interface/EightLightBehavior.d.ts +9 -0
- package/dist/core/simulation/behaviors/interface/FourInputBehavior.d.ts +9 -0
- package/dist/core/simulation/behaviors/interface/FourLightBehavior.d.ts +9 -0
- package/dist/core/simulation/behaviors/interface/InputBehaviorMixin.d.ts +37 -0
- package/dist/core/simulation/behaviors/interface/LightBehaviorMixin.d.ts +60 -0
- package/dist/core/simulation/behaviors/interface/OneInputBehavior.d.ts +9 -0
- package/dist/core/simulation/behaviors/interface/OneLightBehavior.d.ts +9 -0
- package/dist/core/simulation/behaviors/interface/TwoInputBehavior.d.ts +9 -0
- package/dist/core/simulation/behaviors/interface/TwoLightBehavior.d.ts +9 -0
- package/dist/core/simulation/behaviors/interface/index.d.ts +0 -0
- package/dist/core/simulation/states/arithmetic/AdderState.d.ts +16 -0
- package/dist/core/simulation/states/arithmetic/ArithmeticState.d.ts +53 -0
- package/dist/core/simulation/states/arithmetic/EightBitAdderState.d.ts +25 -0
- package/dist/core/simulation/states/arithmetic/EightBitOnesComplementState.d.ts +18 -0
- package/dist/core/simulation/states/arithmetic/HalfAdderState.d.ts +16 -0
- package/dist/core/simulation/states/arithmetic/index.d.ts +7 -0
- package/dist/core/simulation/states/index.d.ts +15 -0
- package/dist/core/simulation/states/interface/EightInputState.d.ts +6 -0
- package/dist/core/simulation/states/interface/EightLightState.d.ts +6 -0
- package/dist/core/simulation/states/interface/FourInputState.d.ts +6 -0
- package/dist/core/simulation/states/interface/FourLightState.d.ts +6 -0
- package/dist/core/simulation/states/interface/InputState.d.ts +45 -0
- package/dist/core/simulation/states/interface/LightState.d.ts +54 -0
- package/dist/core/simulation/states/interface/OneInputState.d.ts +6 -0
- package/dist/core/simulation/states/interface/OneLightState.d.ts +6 -0
- package/dist/core/simulation/states/interface/TwoInputState.d.ts +6 -0
- package/dist/core/simulation/states/interface/TwoLightState.d.ts +6 -0
- package/dist/core/simulation/types.d.ts +10 -2
- package/dist/core/topology/Component.d.ts +6 -1
- package/dist/core/topology/ENode.d.ts +7 -2
- package/dist/core/topology/index.d.ts +2 -0
- package/dist/core/topology/networkTraversal.d.ts +50 -0
- package/dist/core/topology/types.d.ts +31 -6
- package/dist/core-HH6iRWtB.js +4671 -0
- package/dist/core-HH6iRWtB.js.map +1 -0
- package/dist/i18n/index.d.ts +1158 -0
- package/dist/i18n/locales/en.json.d.ts +366 -0
- package/dist/i18n/locales/fr.json.d.ts +366 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +172 -118
- package/dist/scene/CircuitEngine.d.ts +49 -4
- package/dist/scene/index.d.ts +6 -2
- package/dist/scene/index.js +62 -45
- package/dist/scene/setup.d.ts +18 -0
- package/dist/scene/shared/AbstractCircuitController.d.ts +11 -3
- package/dist/scene/shared/HoverManager.d.ts +15 -0
- package/dist/scene/shared/components/arithmetic/AdderVisualFactory.d.ts +54 -0
- package/dist/scene/shared/components/arithmetic/EightBitAdderVisualFactory.d.ts +45 -0
- package/dist/scene/shared/components/arithmetic/EightBitOnesComplementVisualFactory.d.ts +63 -0
- package/dist/scene/shared/components/arithmetic/HalfAdderVisualFactory.d.ts +55 -0
- package/dist/scene/shared/components/arithmetic/index.d.ts +4 -0
- package/dist/scene/shared/components/index.d.ts +14 -0
- package/dist/scene/shared/components/interface/EightInputVisualFactory.d.ts +15 -0
- package/dist/scene/shared/components/interface/EightLightVisualFactory.d.ts +15 -0
- package/dist/scene/shared/components/interface/FourInputVisualFactory.d.ts +15 -0
- package/dist/scene/shared/components/interface/FourLightVisualFactory.d.ts +15 -0
- package/dist/scene/shared/components/interface/InputVisualFactoryBase.d.ts +50 -0
- package/dist/scene/shared/components/interface/LightVisualFactoryBase.d.ts +46 -0
- package/dist/scene/shared/components/interface/OneInputVisualFactory.d.ts +15 -0
- package/dist/scene/shared/components/interface/OneLightVisualFactory.d.ts +15 -0
- package/dist/scene/shared/components/interface/TwoInputVisualFactory.d.ts +15 -0
- package/dist/scene/shared/components/interface/TwoLightVisualFactory.d.ts +15 -0
- package/dist/scene/shared/types.d.ts +34 -4
- package/dist/scene/shared/utils/ControlsUtils.d.ts +1 -1
- package/dist/scene/shared/utils/GeometryUtils.d.ts +111 -0
- package/dist/scene/static/CircuitController.d.ts +13 -1
- package/dist/scene/static/tools/BuildTool.d.ts +81 -0
- package/dist/scene/static/tools/ComponentPickerWidget.d.ts +7 -0
- package/dist/scene/static/tools/ConfigPanelWidget.d.ts +14 -0
- package/dist/scene/static/tools/MultiWiringPlacement.d.ts +40 -0
- package/dist/scene/widgets/HelpWidget.d.ts +13 -0
- package/dist/scene/widgets/ModeWidget.d.ts +16 -0
- package/dist/scene/widgets/MultiWiringWidget.d.ts +21 -0
- package/dist/scene/{static → widgets}/PinTooltipWidget.d.ts +7 -1
- package/dist/scene/widgets/SimulationPlayerWidget.d.ts +62 -0
- package/dist/scene/widgets/ToolsWidget.d.ts +18 -0
- package/dist/scene/widgets/WidgetsManager.d.ts +65 -0
- package/dist/scene/widgets/assets/icons.d.ts +20 -0
- package/dist/scene/widgets/index.d.ts +9 -0
- package/dist/scene/widgets/styles.d.ts +33 -0
- package/dist/{scene-CVsDdySt.js → scene-C1xhdw_B.js} +3993 -772
- package/dist/scene-C1xhdw_B.js.map +1 -0
- package/package.json +14 -9
- package/dist/core-Bjta9Y7_.js +0 -2707
- package/dist/core-Bjta9Y7_.js.map +0 -1
- package/dist/scene-CVsDdySt.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { ICameraOptions, IPosition, UUID } from '../utils';
|
|
|
2
2
|
/**
|
|
3
3
|
* canonic version for circuit files produced
|
|
4
4
|
*/
|
|
5
|
-
export declare const CIRCUIT_FILE_VERSION = "0.0.
|
|
5
|
+
export declare const CIRCUIT_FILE_VERSION = "0.0.14";
|
|
6
6
|
/**
|
|
7
7
|
* Type of electrical pinSources in the circuit.
|
|
8
8
|
*
|
|
@@ -50,27 +50,39 @@ export declare enum ENodeType {
|
|
|
50
50
|
*/
|
|
51
51
|
BranchingPoint = "BranchingPoint"
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Metadata describing a logic pin's interface data.
|
|
55
|
+
*
|
|
56
|
+
* @property interface - name of the pin's interface (one interface combine several pins in the case of numeric inputs/outpus)
|
|
57
|
+
* @property index - index of the pin within the interface (starts at 0 by convention)
|
|
58
|
+
* @property size - whole size of the interface, e.g. number of pins it has
|
|
59
|
+
*/
|
|
60
|
+
export interface ILogicPinMetadata {
|
|
61
|
+
readonly interface: string;
|
|
62
|
+
readonly index: number;
|
|
63
|
+
readonly size: number;
|
|
64
|
+
}
|
|
53
65
|
/**
|
|
54
66
|
* Metadata describing a component pin's source type and subtype.
|
|
55
67
|
*
|
|
56
|
-
* @property sourceType - Voltage/Current source or undefined for passive pins
|
|
57
68
|
* @property subtype - Pin role classification: 'free', 'vcc', 'logicInput', 'logicOutput'
|
|
69
|
+
* @property logicPinData - only for pins of subtype 'logicInput' and 'logicOutput' (MANDATORY in these cases): their logic pin metadata (interface/index)
|
|
70
|
+
* @property sourceType - Voltage/Current source or undefined for passive pins
|
|
58
71
|
*/
|
|
59
72
|
export interface IPinMetadata {
|
|
60
73
|
readonly subtype: string;
|
|
61
|
-
readonly
|
|
74
|
+
readonly logicPinData?: ILogicPinMetadata;
|
|
75
|
+
readonly sourceType?: ENodeSourceType;
|
|
62
76
|
}
|
|
63
77
|
/**
|
|
64
78
|
* Metadata for a component type.
|
|
65
79
|
*
|
|
66
80
|
* @property id - Unique string identifier matching the enum value
|
|
67
|
-
* @property name - Human-readable display name
|
|
68
81
|
* @property pins - Array of pin labels (order-significant)
|
|
69
82
|
* @property config - Default configuration parameters (depends on the component, e.g., initialState, activationLogic, color...)
|
|
70
83
|
*/
|
|
71
84
|
export interface IComponentTypeMetadata {
|
|
72
85
|
readonly id: string;
|
|
73
|
-
readonly name: string;
|
|
74
86
|
readonly pins: Map<string, IPinMetadata>;
|
|
75
87
|
readonly config: Map<string, string>;
|
|
76
88
|
}
|
|
@@ -95,6 +107,7 @@ export interface IENode {
|
|
|
95
107
|
position?: IPosition | null;
|
|
96
108
|
source?: ENodeSourceType | null;
|
|
97
109
|
subtype: string;
|
|
110
|
+
logicMetadata: ILogicPinMetadata | null;
|
|
98
111
|
}
|
|
99
112
|
/** Interface defining a Wire (link between 2 ENodes supporting intermediate position to tune its path) **/
|
|
100
113
|
export interface IWire {
|
|
@@ -163,7 +176,19 @@ export declare enum ComponentType {
|
|
|
163
176
|
Nor8Gate = "nor8Gate",
|
|
164
177
|
XorGate = "xorGate",
|
|
165
178
|
Xor4Gate = "xor4Gate",
|
|
166
|
-
Xor8Gate = "xor8Gate"
|
|
179
|
+
Xor8Gate = "xor8Gate",
|
|
180
|
+
HalfAdder = "halfAdder",
|
|
181
|
+
Adder = "adder",
|
|
182
|
+
EightBitAdder = "eightBitAdder",
|
|
183
|
+
EightBitOnesComplement = "eightBitOnesComplement",
|
|
184
|
+
OneInput = "oneInput",
|
|
185
|
+
TwoInput = "twoInput",
|
|
186
|
+
FourInput = "fourInput",
|
|
187
|
+
EightInput = "eightInput",
|
|
188
|
+
OneLight = "oneLight",
|
|
189
|
+
TwoLight = "twoLight",
|
|
190
|
+
FourLight = "fourLight",
|
|
191
|
+
EightLight = "eightLight"
|
|
167
192
|
}
|
|
168
193
|
/**
|
|
169
194
|
* Component type metadata lookup table.
|