simple-circuit-engine 0.0.11 → 0.0.12

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.
Files changed (141) hide show
  1. package/AGENTS.md +10 -7
  2. package/CLAUDE.md +4 -6
  3. package/README.md +5 -2
  4. package/dist/core/index.d.ts +0 -1
  5. package/dist/core/index.js +74 -2114
  6. package/dist/core/setup.d.ts +17 -0
  7. package/dist/core/simulation/CircuitRunner.d.ts +176 -0
  8. package/dist/core/simulation/DirtyTracker.d.ts +87 -0
  9. package/dist/core/simulation/EventQueue.d.ts +68 -0
  10. package/dist/core/simulation/StateManager.d.ts +100 -0
  11. package/dist/core/simulation/behaviors/BehaviorRegistry.d.ts +70 -0
  12. package/dist/core/simulation/behaviors/ComponentBehavior.d.ts +53 -0
  13. package/dist/core/simulation/behaviors/basic/BatteryBehavior.d.ts +14 -0
  14. package/dist/core/simulation/behaviors/basic/ClockBehavior.d.ts +24 -0
  15. package/dist/core/simulation/behaviors/basic/DoubleThrowSwitchBehavior.d.ts +33 -0
  16. package/dist/core/simulation/behaviors/basic/LightbulbBehavior.d.ts +23 -0
  17. package/dist/core/simulation/behaviors/basic/RectangleLEDBehavior.d.ts +24 -0
  18. package/dist/core/simulation/behaviors/basic/RelayBehavior.d.ts +33 -0
  19. package/dist/core/simulation/behaviors/basic/SmallLEDBehavior.d.ts +24 -0
  20. package/dist/core/simulation/behaviors/basic/SwitchBehavior.d.ts +33 -0
  21. package/dist/core/simulation/behaviors/basic/index.d.ts +20 -0
  22. package/dist/core/simulation/behaviors/gates/InverterBehavior.d.ts +29 -0
  23. package/dist/core/simulation/behaviors/gates/Nand4GateBehavior.d.ts +18 -0
  24. package/dist/core/simulation/behaviors/gates/Nand8GateBehavior.d.ts +18 -0
  25. package/dist/core/simulation/behaviors/gates/NandGateBehavior.d.ts +28 -0
  26. package/dist/core/simulation/behaviors/gates/Nor4GateBehavior.d.ts +18 -0
  27. package/dist/core/simulation/behaviors/gates/Nor8GateBehavior.d.ts +18 -0
  28. package/dist/core/simulation/behaviors/gates/NorGateBehavior.d.ts +22 -0
  29. package/dist/core/simulation/behaviors/gates/Xor4GateBehavior.d.ts +18 -0
  30. package/dist/core/simulation/behaviors/gates/Xor8GateBehavior.d.ts +18 -0
  31. package/dist/core/simulation/behaviors/gates/XorGateBehavior.d.ts +22 -0
  32. package/dist/core/simulation/behaviors/gates/index.d.ts +34 -0
  33. package/dist/core/simulation/behaviors/index.d.ts +24 -0
  34. package/dist/core/simulation/behaviors/types.d.ts +101 -0
  35. package/dist/core/simulation/index.d.ts +18 -0
  36. package/dist/core/simulation/states/ComponentState.d.ts +57 -0
  37. package/dist/core/simulation/states/SimulationState.d.ts +46 -0
  38. package/dist/core/simulation/states/basic/BatteryState.d.ts +16 -0
  39. package/dist/core/simulation/states/basic/ClockState.d.ts +16 -0
  40. package/dist/core/simulation/states/basic/DoubleThrowSwitchState.d.ts +21 -0
  41. package/dist/core/simulation/states/basic/LightbulbState.d.ts +21 -0
  42. package/dist/core/simulation/states/basic/RectangleLEDState.d.ts +9 -0
  43. package/dist/core/simulation/states/basic/RelayState.d.ts +25 -0
  44. package/dist/core/simulation/states/basic/SmallLEDState.d.ts +21 -0
  45. package/dist/core/simulation/states/basic/SwitchState.d.ts +25 -0
  46. package/dist/core/simulation/states/gates/InverterState.d.ts +17 -0
  47. package/dist/core/simulation/states/gates/Nand4GateState.d.ts +10 -0
  48. package/dist/core/simulation/states/gates/Nand8GateState.d.ts +10 -0
  49. package/dist/core/simulation/states/gates/NandGateState.d.ts +16 -0
  50. package/dist/core/simulation/states/gates/Nor4GateState.d.ts +10 -0
  51. package/dist/core/simulation/states/gates/Nor8GateState.d.ts +10 -0
  52. package/dist/core/simulation/states/gates/NorGateState.d.ts +10 -0
  53. package/dist/core/simulation/states/gates/Xor4GateState.d.ts +10 -0
  54. package/dist/core/simulation/states/gates/Xor8GateState.d.ts +10 -0
  55. package/dist/core/simulation/states/gates/XorGateState.d.ts +10 -0
  56. package/dist/core/simulation/states/gates/index.d.ts +25 -0
  57. package/dist/core/simulation/states/index.d.ts +26 -0
  58. package/dist/core/simulation/states/types.d.ts +32 -0
  59. package/dist/core/simulation/types.d.ts +155 -0
  60. package/dist/core/topology/Circuit.d.ts +420 -0
  61. package/dist/core/topology/CircuitMetadata.d.ts +24 -0
  62. package/dist/core/topology/CircuitOptions.d.ts +14 -0
  63. package/dist/core/topology/Component.d.ts +152 -0
  64. package/dist/core/topology/ENode.d.ts +200 -0
  65. package/dist/core/topology/Wire.d.ts +130 -0
  66. package/dist/core/topology/delays.d.ts +52 -0
  67. package/dist/core/topology/index.d.ts +14 -0
  68. package/dist/core/topology/types.d.ts +175 -0
  69. package/dist/core/utils/CameraOptions.d.ts +83 -0
  70. package/dist/core/utils/MemoizeDecorator.d.ts +9 -0
  71. package/dist/core/utils/Position.d.ts +166 -0
  72. package/dist/core/utils/Position3D.d.ts +77 -0
  73. package/dist/core/utils/Rotation.d.ts +82 -0
  74. package/dist/core/utils/index.d.ts +24 -0
  75. package/dist/core/utils/types.d.ts +35 -0
  76. package/dist/core-Bjta9Y7_.js +2707 -0
  77. package/dist/core-Bjta9Y7_.js.map +1 -0
  78. package/dist/index.d.ts +13 -6306
  79. package/dist/index.js +117 -110
  80. package/dist/scene/CircuitEngine.d.ts +270 -0
  81. package/dist/scene/index.d.ts +0 -1
  82. package/dist/scene/index.js +43 -39
  83. package/dist/scene/setup.d.ts +18 -0
  84. package/dist/scene/shared/AbstractCircuitController.d.ts +211 -0
  85. package/dist/scene/shared/BranchingPointVisualFactory.d.ts +70 -0
  86. package/dist/scene/shared/EventEmitter.d.ts +92 -0
  87. package/dist/scene/shared/HoverManager.d.ts +151 -0
  88. package/dist/scene/shared/SelectionManager.d.ts +159 -0
  89. package/dist/scene/shared/WireVisualManager.d.ts +242 -0
  90. package/dist/scene/shared/components/ComponentVisualFactory.d.ts +438 -0
  91. package/dist/scene/shared/components/DefaultVisualFactory.d.ts +51 -0
  92. package/dist/scene/shared/components/FactoryRegistry.d.ts +84 -0
  93. package/dist/scene/shared/components/GroupedFactoryRegistry.d.ts +153 -0
  94. package/dist/scene/shared/components/basic/BatteryVisualFactory.d.ts +13 -0
  95. package/dist/scene/shared/components/basic/ClockVisualFactory.d.ts +79 -0
  96. package/dist/scene/shared/components/basic/DoubleThrowSwitchVisualFactory.d.ts +87 -0
  97. package/dist/scene/shared/components/basic/LabelVisualFactory.d.ts +148 -0
  98. package/dist/scene/shared/components/basic/LightbulbVisualFactory.d.ts +72 -0
  99. package/dist/scene/shared/components/basic/RectangleLEDVisualFactory.d.ts +86 -0
  100. package/dist/scene/shared/components/basic/RelayVisualFactory.d.ts +92 -0
  101. package/dist/scene/shared/components/basic/SmallLEDVisualFactory.d.ts +86 -0
  102. package/dist/scene/shared/components/basic/SwitchVisualFactory.d.ts +85 -0
  103. package/dist/scene/shared/components/gates/InverterVisualFactory.d.ts +104 -0
  104. package/dist/scene/shared/components/gates/Nand4GateVisualFactory.d.ts +27 -0
  105. package/dist/scene/shared/components/gates/Nand8GateVisualFactory.d.ts +27 -0
  106. package/dist/scene/shared/components/gates/NandGateVisualFactory.d.ts +101 -0
  107. package/dist/scene/shared/components/gates/Nor4GateVisualFactory.d.ts +27 -0
  108. package/dist/scene/shared/components/gates/Nor8GateVisualFactory.d.ts +27 -0
  109. package/dist/scene/shared/components/gates/NorGateVisualFactory.d.ts +101 -0
  110. package/dist/scene/shared/components/gates/Xor4GateVisualFactory.d.ts +29 -0
  111. package/dist/scene/shared/components/gates/Xor8GateVisualFactory.d.ts +29 -0
  112. package/dist/scene/shared/components/gates/XorGateVisualFactory.d.ts +103 -0
  113. package/dist/scene/shared/components/index.d.ts +29 -0
  114. package/dist/scene/shared/components/types.d.ts +43 -0
  115. package/dist/scene/shared/types.d.ts +476 -0
  116. package/dist/scene/shared/utils/CameraUtils.d.ts +23 -0
  117. package/dist/scene/shared/utils/ColorUtils.d.ts +26 -0
  118. package/dist/scene/shared/utils/ControlsUtils.d.ts +8 -0
  119. package/dist/scene/shared/utils/GeometryUtils.d.ts +261 -0
  120. package/dist/scene/shared/utils/LayerConstants.d.ts +40 -0
  121. package/dist/scene/shared/utils/LightingUtils.d.ts +31 -0
  122. package/dist/scene/shared/utils/MaterialUtils.d.ts +73 -0
  123. package/dist/scene/shared/utils/Options.d.ts +16 -0
  124. package/dist/scene/simulation/CircuitRunnerController.d.ts +227 -0
  125. package/dist/scene/static/CircuitController.d.ts +227 -0
  126. package/dist/scene/static/CircuitWriter.d.ts +146 -0
  127. package/dist/scene/static/PinTooltipWidget.d.ts +26 -0
  128. package/dist/scene/static/tools/BuildTool.d.ts +286 -0
  129. package/dist/scene/static/tools/ComponentPickerWidget.d.ts +82 -0
  130. package/dist/scene/static/tools/ConfigPanelWidget.d.ts +93 -0
  131. package/dist/scene/static/tools/MultiSelectTool.d.ts +265 -0
  132. package/dist/scene-CVsDdySt.js +7357 -0
  133. package/dist/scene-CVsDdySt.js.map +1 -0
  134. package/package.json +24 -25
  135. package/dist/CircuitRunner-BQQlhwjD.js +0 -1981
  136. package/dist/CircuitRunner-BQQlhwjD.js.map +0 -1
  137. package/dist/core/index.js.map +0 -1
  138. package/dist/index.js.map +0 -1
  139. package/dist/scene/index.js.map +0 -1
  140. package/dist/setup-CIq_kgaw.js +0 -10230
  141. package/dist/setup-CIq_kgaw.js.map +0 -1
@@ -0,0 +1,101 @@
1
+ import { ComponentVisualFactoryBase } from '../ComponentVisualFactory';
2
+ import { Component, ComponentState } from '../../../../core/index.ts';
3
+ import { ConfigFormDefinition, VisualContext } from '../../types';
4
+ import * as THREE from 'three';
5
+ /**
6
+ * Visual factory for NOR gates components
7
+ *
8
+ * Creates:
9
+ * - Gate mesh
10
+ * - vcc, gnd, inputs and output pin groups
11
+ * - Component hitbox for raycasting
12
+ *
13
+ * Animation:
14
+ * - Emissive glow when Gate is high (based on simulation state)
15
+ */
16
+ export declare class NorGateVisualFactory extends ComponentVisualFactoryBase {
17
+ /** Shared envelope geometry */
18
+ protected readonly ENVELOPE_GEOM: THREE.ExtrudeGeometry;
19
+ /** Shared inner hole geometry */
20
+ protected readonly HOLE_GEOM: THREE.ExtrudeGeometry;
21
+ /** Shared geometry for negative marker **/
22
+ protected readonly NEG_MARKER_GEOM: THREE.CylinderGeometry;
23
+ protected readonly HOLE_COLOR_HIGH: THREE.Color;
24
+ protected readonly HOLE_COLOR_LOW: THREE.Color;
25
+ protected readonly HOLE_EMISSIVE_HIGH_INTENSITY = 0.5;
26
+ protected readonly HOLE_EMISSIVE_LOW_INTENSITY = 0.2;
27
+ constructor();
28
+ defaultRotation(): number;
29
+ createVisual(component: Component, context: VisualContext): THREE.Object3D;
30
+ protected createPinsVisual(component: Component, context: VisualContext, group: THREE.Group): void;
31
+ /**
32
+ * Get config form definition
33
+ *
34
+ * @param config - Optional current config to determine disabled state of transitionSpan
35
+ * @returns Form definition with defaultLogicFamily dropdown, activationLogic boolean, and transitionSpan number
36
+ */
37
+ getConfigFormDefinition(config?: Map<string, string>): ConfigFormDefinition | null;
38
+ /**
39
+ * Map core config to form data
40
+ * Converts "positive"/"negative" strings to boolean
41
+ *
42
+ * @param config - Core component config
43
+ * @returns Form data with boolean activationLogic
44
+ */
45
+ mapCoreConfigToForm(config: Map<string, string>): Map<string, any>;
46
+ /**
47
+ * Map form data to core config
48
+ * Converts boolean to "positive"/"negative" strings
49
+ *
50
+ * @param formData - Form data with boolean activationLogic
51
+ * @returns Core config with string activationLogic
52
+ */
53
+ mapFormToCoreConfig(formData: Map<string, any>): Map<string, string>;
54
+ updateFromConfiguration(object3D: THREE.Object3D, config: Map<string, string>): void;
55
+ /**
56
+ * Update animation based on simulation state
57
+ *
58
+ * @param object3D - The Object3D created by createVisual()
59
+ * @param state - The component current simulation state
60
+ */
61
+ updateAnimation(object3D: THREE.Object3D, state: ComponentState | null): void;
62
+ private _setHoleColor;
63
+ private _ensureClonedHoleMaterial;
64
+ private _restoreSharedHoleMaterial;
65
+ private _cleanupMixer;
66
+ /**
67
+ * Animate the hole color between LOW and HIGH over the transition span.
68
+ * Reads current color for mid-transition support.
69
+ */
70
+ private _animateHoleColor;
71
+ /**
72
+ * Find the envelope mesh within the component group
73
+ *
74
+ * @param object3D - The Object3D group created by createVisual()
75
+ * @returns The envelope mesh if found, null otherwise
76
+ *
77
+ * @remarks
78
+ * Searches for a mesh with userData.part === 'envelope'
79
+ */
80
+ protected findEnvelopeMesh(object3D: THREE.Object3D): THREE.Mesh | null;
81
+ /**
82
+ * Find the hole mesh within the component group
83
+ *
84
+ * @param object3D - The Object3D group created by createVisual()
85
+ * @returns The hole mesh if found, null otherwise
86
+ *
87
+ * @remarks
88
+ * Searches for a mesh with userData.part === 'hole'
89
+ */
90
+ protected findHoleMesh(object3D: THREE.Object3D): THREE.Mesh | null;
91
+ /**
92
+ * Find the negative marker mesh within the component group
93
+ *
94
+ * @param object3D - The Object3D group created by createVisual()
95
+ * @returns The negative marker mesh if found, null otherwise
96
+ *
97
+ * @remarks
98
+ * Searches for a mesh with userData.part === 'negativeMarker'
99
+ */
100
+ protected findNegativeMarkerMesh(object3D: THREE.Object3D): THREE.Mesh | null;
101
+ }
@@ -0,0 +1,29 @@
1
+ import { Component } from '../../../../core/index.ts';
2
+ import { XorGateVisualFactory } from './XorGateVisualFactory';
3
+ import { VisualContext } from '../../types';
4
+ import * as THREE from 'three';
5
+ /**
6
+ * Visual factory for XOR gates components
7
+ *
8
+ * Creates:
9
+ * - Gate mesh
10
+ * - vcc, gnd, inputs and output pin groups
11
+ * - Component hitbox for raycasting
12
+ *
13
+ * Animation:
14
+ * - Emissive glow when Gate is high (based on simulation state)
15
+ */
16
+ export declare class Xor4GateVisualFactory extends XorGateVisualFactory {
17
+ /** XOR tail geometry */
18
+ protected readonly TAIL_GEOM: THREE.ExtrudeGeometry;
19
+ /** Shared open envelope geometry */
20
+ protected readonly ENVELOPE_GEOM: THREE.ExtrudeGeometry;
21
+ /** Shared inner hole geometry */
22
+ protected readonly HOLE_GEOM: THREE.ExtrudeGeometry;
23
+ /** Shared geometry for negative marker **/
24
+ protected readonly NEG_MARKER_GEOM: THREE.CylinderGeometry;
25
+ constructor();
26
+ createVisual(component: Component, context: VisualContext): THREE.Object3D;
27
+ protected createPinsVisual(component: Component, context: VisualContext, group: THREE.Group): void;
28
+ updateFromConfiguration(object3D: THREE.Object3D, config: Map<string, string>): void;
29
+ }
@@ -0,0 +1,29 @@
1
+ import { Component } from '../../../../core/index.ts';
2
+ import { XorGateVisualFactory } from './XorGateVisualFactory';
3
+ import { VisualContext } from '../../types';
4
+ import * as THREE from 'three';
5
+ /**
6
+ * Visual factory for XOR gates components
7
+ *
8
+ * Creates:
9
+ * - Gate mesh
10
+ * - vcc, gnd, inputs and output pin groups
11
+ * - Component hitbox for raycasting
12
+ *
13
+ * Animation:
14
+ * - Emissive glow when Gate is high (based on simulation state)
15
+ */
16
+ export declare class Xor8GateVisualFactory extends XorGateVisualFactory {
17
+ /** XOR tail geometry */
18
+ protected readonly TAIL_GEOM: THREE.ExtrudeGeometry;
19
+ /** Shared open envelope geometry */
20
+ protected readonly ENVELOPE_GEOM: THREE.ExtrudeGeometry;
21
+ /** Shared inner hole geometry */
22
+ protected readonly HOLE_GEOM: THREE.ExtrudeGeometry;
23
+ /** Shared geometry for negative marker **/
24
+ protected readonly NEG_MARKER_GEOM: THREE.CylinderGeometry;
25
+ constructor();
26
+ createVisual(component: Component, context: VisualContext): THREE.Object3D;
27
+ protected createPinsVisual(component: Component, context: VisualContext, group: THREE.Group): void;
28
+ updateFromConfiguration(object3D: THREE.Object3D, config: Map<string, string>): void;
29
+ }
@@ -0,0 +1,103 @@
1
+ import { ComponentVisualFactoryBase } from '../ComponentVisualFactory';
2
+ import { Component, ComponentState } from '../../../../core/index.ts';
3
+ import { ConfigFormDefinition, VisualContext } from '../../types';
4
+ import * as THREE from 'three';
5
+ /**
6
+ * Visual factory for XOR gates components
7
+ *
8
+ * Creates:
9
+ * - Gate mesh
10
+ * - vcc, gnd, inputs and output pin groups
11
+ * - Component hitbox for raycasting
12
+ *
13
+ * Animation:
14
+ * - Emissive glow when Gate is high (based on simulation state)
15
+ */
16
+ export declare class XorGateVisualFactory extends ComponentVisualFactoryBase {
17
+ /** XOR tail geometry */
18
+ protected readonly TAIL_GEOM: THREE.ExtrudeGeometry;
19
+ /** Shared open envelope geometry */
20
+ protected readonly ENVELOPE_GEOM: THREE.ExtrudeGeometry;
21
+ /** Shared inner hole geometry */
22
+ protected readonly HOLE_GEOM: THREE.ExtrudeGeometry;
23
+ /** Shared geometry for negative marker **/
24
+ protected readonly NEG_MARKER_GEOM: THREE.CylinderGeometry;
25
+ protected readonly HOLE_COLOR_HIGH: THREE.Color;
26
+ protected readonly HOLE_COLOR_LOW: THREE.Color;
27
+ protected readonly HOLE_EMISSIVE_HIGH_INTENSITY = 0.5;
28
+ protected readonly HOLE_EMISSIVE_LOW_INTENSITY = 0.2;
29
+ constructor();
30
+ defaultRotation(): number;
31
+ createVisual(component: Component, context: VisualContext): THREE.Object3D;
32
+ protected createPinsVisual(component: Component, context: VisualContext, group: THREE.Group): void;
33
+ /**
34
+ * Get config form definition for XOR/XNOR Gate
35
+ *
36
+ * @param config - Optional current config to determine disabled state of transitionSpan
37
+ * @returns Form definition with defaultLogicFamily dropdown, activationLogic boolean, and transitionSpan number
38
+ */
39
+ getConfigFormDefinition(config?: Map<string, string>): ConfigFormDefinition | null;
40
+ /**
41
+ * Map core config to form data
42
+ * Converts "positive"/"negative" strings to boolean
43
+ *
44
+ * @param config - Core component config
45
+ * @returns Form data with boolean activationLogic
46
+ */
47
+ mapCoreConfigToForm(config: Map<string, string>): Map<string, any>;
48
+ /**
49
+ * Map form data to core config
50
+ * Converts boolean to "positive"/"negative" strings
51
+ *
52
+ * @param formData - Form data with boolean activationLogic
53
+ * @returns Core config with string activationLogic
54
+ */
55
+ mapFormToCoreConfig(formData: Map<string, any>): Map<string, string>;
56
+ updateFromConfiguration(object3D: THREE.Object3D, config: Map<string, string>): void;
57
+ /**
58
+ * Update animation based on simulation state
59
+ *
60
+ * @param object3D - The Object3D created by createVisual()
61
+ * @param state - The component current simulation state
62
+ */
63
+ updateAnimation(object3D: THREE.Object3D, state: ComponentState | null): void;
64
+ private _setHoleColor;
65
+ private _ensureClonedHoleMaterial;
66
+ private _restoreSharedHoleMaterial;
67
+ private _cleanupMixer;
68
+ /**
69
+ * Animate the hole color between LOW and HIGH over the transition span.
70
+ * Reads current color for mid-transition support.
71
+ */
72
+ private _animateHoleColor;
73
+ /**
74
+ * Find the envelope mesh within the component group
75
+ *
76
+ * @param object3D - The Object3D group created by createVisual()
77
+ * @returns The envelope mesh if found, null otherwise
78
+ *
79
+ * @remarks
80
+ * Searches for a mesh with userData.part === 'envelope'
81
+ */
82
+ protected findEnvelopeMesh(object3D: THREE.Object3D): THREE.Mesh | null;
83
+ /**
84
+ * Find the hole mesh within the component group
85
+ *
86
+ * @param object3D - The Object3D group created by createVisual()
87
+ * @returns The hole mesh if found, null otherwise
88
+ *
89
+ * @remarks
90
+ * Searches for a mesh with userData.part === 'hole'
91
+ */
92
+ protected findHoleMesh(object3D: THREE.Object3D): THREE.Mesh | null;
93
+ /**
94
+ * Find the negative marker mesh within the component group
95
+ *
96
+ * @param object3D - The Object3D group created by createVisual()
97
+ * @returns The negative marker mesh if found, null otherwise
98
+ *
99
+ * @remarks
100
+ * Searches for a mesh with userData.part === 'negativeMarker'
101
+ */
102
+ protected findNegativeMarkerMesh(object3D: THREE.Object3D): THREE.Mesh | null;
103
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Component visual factories
3
+ * @module scene/shared/components
4
+ */
5
+ export type { IFactoryRegistry, IComponentVisualFactory } from './ComponentVisualFactory.js';
6
+ export { CmpMatCategory, CmpMatVariant, CmpMatType, CMP_MATERIALS } from './types.js';
7
+ export { FactoryRegistry } from './FactoryRegistry.js';
8
+ export { DefaultVisualFactory } from './DefaultVisualFactory.js';
9
+ export type { ComponentGroup, IComponentGroupBuilder, IGroupedFactoryRegistry, } from './GroupedFactoryRegistry.js';
10
+ export { GroupedFactoryRegistry } from './GroupedFactoryRegistry.js';
11
+ export { BatteryVisualFactory } from './basic/BatteryVisualFactory';
12
+ export { LabelVisualFactory } from './basic/LabelVisualFactory';
13
+ export { LightbulbVisualFactory } from './basic/LightbulbVisualFactory';
14
+ export { RectangleLEDVisualFactory } from './basic/RectangleLEDVisualFactory';
15
+ export { RelayVisualFactory } from './basic/RelayVisualFactory';
16
+ export { SmallLEDVisualFactory } from './basic/SmallLEDVisualFactory';
17
+ export { SwitchVisualFactory } from './basic/SwitchVisualFactory';
18
+ export { DoubleThrowSwitchVisualFactory } from './basic/DoubleThrowSwitchVisualFactory';
19
+ export { ClockVisualFactory } from './basic/ClockVisualFactory';
20
+ export { InverterVisualFactory } from './gates/InverterVisualFactory';
21
+ export { NandGateVisualFactory } from './gates/NandGateVisualFactory';
22
+ export { Nand4GateVisualFactory } from './gates/Nand4GateVisualFactory';
23
+ export { Nand8GateVisualFactory } from './gates/Nand8GateVisualFactory';
24
+ export { NorGateVisualFactory } from './gates/NorGateVisualFactory';
25
+ export { Nor4GateVisualFactory } from './gates/Nor4GateVisualFactory';
26
+ export { Nor8GateVisualFactory } from './gates/Nor8GateVisualFactory';
27
+ export { XorGateVisualFactory } from './gates/XorGateVisualFactory';
28
+ export { Xor4GateVisualFactory } from './gates/Xor4GateVisualFactory';
29
+ export { Xor8GateVisualFactory } from './gates/Xor8GateVisualFactory';
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Component Material Types
3
+ * @module scene/shared/components/types
4
+ *
5
+ * Enums and shared material dictionary for the component visual factory system.
6
+ * Materials are singleton instances shared across all factory instances.
7
+ */
8
+ import * as THREE from 'three';
9
+ /** Material category — identifies a family of related shared materials */
10
+ export declare const enum CmpMatCategory {
11
+ WHITE = "WHITE",
12
+ SHINY_SILVER = "SHINY_SILVER",
13
+ GLASS = "GLASS",
14
+ DARK_GRAY = "DARK_GRAY"
15
+ }
16
+ /** Material variant — visual state within a category */
17
+ export declare const enum CmpMatVariant {
18
+ NORMAL = "NORMAL",
19
+ HOVERED = "HOVERED",
20
+ SELECTED = "SELECTED"
21
+ }
22
+ /**
23
+ * Material ownership type — stored on `material.userData.matType`.
24
+ * Numeric for fast comparison; determines how hover/select/animation interact.
25
+ *
26
+ * - **SHARED** — from CMP_MATERIALS dict; hover/select may swap to a variant
27
+ * - **FACTORY** — per-visual factory material; skip hover/select swap
28
+ * - **PRIVATE** — per-instance material (e.g. LED configurable color); skip hover/select swap
29
+ * - **ANIMATION_CLONE** — cloned from SHARED for animation; skip hover/select swap
30
+ */
31
+ export declare const enum CmpMatType {
32
+ SHARED = 0,
33
+ FACTORY = 1,
34
+ PRIVATE = 2,
35
+ ANIMATION_CLONE = 3
36
+ }
37
+ /**
38
+ * Shared material dictionary: CmpMatCategory → CmpMatVariant → MeshLambertMaterial.
39
+ *
40
+ * Every material carries `userData.matType` and `userData.matCat` (its category)
41
+ * (`CmpMatType.SHARED`) so hover/select logic can identify and swap them.
42
+ */
43
+ export declare const CMP_MATERIALS: Readonly<Record<CmpMatCategory, Record<CmpMatVariant, THREE.MeshLambertMaterial>>>;