generated from google-gemini/aistudio-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
54 lines (48 loc) · 1.15 KB
/
types.ts
File metadata and controls
54 lines (48 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
export type ComponentType =
| 'MCU'
| 'POWER_MODULE'
| 'BUTTON_MODULE'
| 'DISPLAY_MODULE'
| 'CAMERA_MODULE'
| 'BATTERY_HOLDER'
| 'SWITCH_TOGGLE'
| 'LIGHT_BULB'
| 'FAN_MODULE';
export interface Point {
x: number;
y: number;
}
export interface Port {
id: string;
x: number;
y: number;
label?: string; // Pin label (e.g., "VCC", "GND")
relativePosition: { x: number; y: number }; // Original position relative to center without rotation
type?: 'power' | 'ground' | 'signal' | 'passive'; // Hint for simulation
}
export interface SchematicComponent {
id: string;
type: ComponentType;
x: number;
y: number;
rotation: number; // In degrees, typically 0, 90, 180, 270
label: string;
value?: string;
simState?: {
isOn: boolean; // Is the component currently "Active" (e.g. Switch Closed, Bulb Lit)
isPowered?: boolean; // Is the component receiving power (for passive loads)
};
}
export interface Wire {
id: string;
sourceCompId: string;
sourcePortId: string;
targetCompId: string;
targetPortId: string;
color?: string;
}
export interface ViewportTransform {
x: number;
y: number;
k: number;
}