-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
30 lines (27 loc) · 674 Bytes
/
Copy pathtypes.ts
File metadata and controls
30 lines (27 loc) · 674 Bytes
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
export enum UnitMultiplier {
Ohm = 1,
kOhm = 1000,
MOhm = 1000000,
}
export interface Resistor {
id: string;
value: number; // The user input number
multiplier: UnitMultiplier;
}
export interface CalculatedResistor extends Resistor {
actualResistance: number; // value * multiplier
voltageDrop: number; // Volts
currentFlow: number; // Amps
power: number; // Watts
sharePercentage: number; // % of total V or I
}
export enum CalculationMode {
Series = 'series',
Parallel = 'parallel',
VoltageDivider = 'voltage-divider',
LED = 'led',
OhmsLaw = 'ohms-law',
RCTime = 'rc-time',
BatteryLife = 'battery-life',
ColorCode = 'color-code',
}