@sswroom/sswr 1.4.1 → 1.5.1

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/unit.d.ts CHANGED
@@ -1,49 +1,365 @@
1
- export enum AngleUnit
1
+ export class UnitInfo<UnitType>
2
2
  {
3
- RADIAN = 1,
4
- GRADIAN,
5
- TURN,
6
- DEGREE,
7
- ARCMINUTE,
8
- ARCSECOND,
9
- MILLIARCSECOND,
10
- MICROARCSECOND
3
+ unit: UnitType;
4
+ symbol: string;
5
+ name: string;
6
+ ratio: number;
7
+ scale: number;
8
+
9
+ constructor(unit: any, symbol: string, name: string, ratio: number, scale?: number);
10
+ }
11
+
12
+ module Acceleration
13
+ {
14
+ enum Unit
15
+ {
16
+ METER_PER_SECOND_SQUARED,
17
+ STANDARD_GRAVITY
18
+ }
19
+ }
20
+
21
+ export class Acceleration
22
+ {
23
+ static getUnitInfo(u: Acceleration.Unit): UnitInfo<Acceleration.Unit> | null;
24
+ static getUnitRatio(u: Acceleration.Unit) : number;
25
+ static convert(fromUnit: Acceleration.Unit, toUnit: Acceleration.Unit, fromValue: number): number;
26
+ }
27
+
28
+ module Angle
29
+ {
30
+ enum Unit
31
+ {
32
+ RADIAN,
33
+ GRADIAN,
34
+ TURN,
35
+ DEGREE,
36
+ ARCMINUTE,
37
+ ARCSECOND,
38
+ MILLIARCSECOND,
39
+ MICROARCSECOND
40
+ }
11
41
  }
12
42
 
13
43
  export class Angle
14
44
  {
15
- static getUnitRatio(u: AngleUnit) : number;
16
- }
17
-
18
- export enum DistanceUnit
19
- {
20
- METER,
21
- CENTIMETER,
22
- MILLIMETER,
23
- MICROMETER,
24
- NANOMETER,
25
- PICOMETER,
26
- KILOMETER,
27
- INCH,
28
- FOOT,
29
- YARD,
30
- MILE,
31
- NAUTICAL_MILE,
32
- AU,
33
- LIGHTSECOND,
34
- LIGHTMINUTE,
35
- LIGHTHOUR,
36
- LIGHTDAY,
37
- LIGHTWEEK,
38
- LIGHTYEAR,
39
- EMU,
40
- POINT,
41
- PIXEL,
42
- TWIP
45
+ static getUnitInfo(u: Angle.Unit): UnitInfo<Angle.Unit> | null;
46
+ static getUnitRatio(u: Angle.Unit) : number;
47
+ static convert(fromUnit: Angle.Unit, toUnit: Angle.Unit, fromValue: number): number;
48
+ }
49
+
50
+ module ApparentPower
51
+ {
52
+ enum Unit
53
+ {
54
+ VOLT_AMPERE
55
+ }
56
+ }
57
+
58
+ export class ApparentPower
59
+ {
60
+ static getUnitInfo(u: ApparentPower.Unit): UnitInfo<ApparentPower.Unit> | null;
61
+ static getUnitRatio(u: ApparentPower.Unit) : number;
62
+ static convert(fromUnit: ApparentPower.Unit, toUnit: ApparentPower.Unit, fromValue: number): number;
63
+ }
64
+
65
+ module Count
66
+ {
67
+ enum Unit
68
+ {
69
+ UNIT,
70
+ K_UNIT,
71
+ KI_UNIT,
72
+ M_UNIT,
73
+ MI_UNIT,
74
+ G_UNIT,
75
+ GI_UNIT,
76
+ T_UNIT,
77
+ TI_UNIT
78
+ }
79
+ }
80
+
81
+ export class Count
82
+ {
83
+ static getUnitInfo(u: Count.Unit): UnitInfo<Count.Unit> | null;
84
+ static getUnitRatio(u: Count.Unit) : number;
85
+ static convert(fromUnit: Count.Unit, toUnit: Count.Unit, fromValue: number): number;
86
+ }
87
+
88
+ module Distance
89
+ {
90
+ enum Unit
91
+ {
92
+ METER,
93
+ CENTIMETER,
94
+ MILLIMETER,
95
+ MICROMETER,
96
+ NANOMETER,
97
+ PICOMETER,
98
+ KILOMETER,
99
+ INCH,
100
+ FOOT,
101
+ YARD,
102
+ MILE,
103
+ NAUTICAL_MILE,
104
+ AU,
105
+ LIGHTSECOND,
106
+ LIGHTMINUTE,
107
+ LIGHTHOUR,
108
+ LIGHTDAY,
109
+ LIGHTWEEK,
110
+ LIGHTYEAR,
111
+ EMU,
112
+ POINT,
113
+ PIXEL,
114
+ TWIP
115
+ }
43
116
  }
44
117
 
45
118
  export class Distance
46
119
  {
47
- static getUnitRatio(u: DistanceUnit): number;
48
- static convert(fromUnit: DistanceUnit, toUnit: DistanceUnit, fromValue: number): number;
120
+ static getUnitInfo(u: Distance.Unit): UnitInfo<Distance.Unit> | null;
121
+ static getUnitRatio(u: Distance.Unit): number;
122
+ static convert(fromUnit: Distance.Unit, toUnit: Distance.Unit, fromValue: number): number;
123
+ }
124
+
125
+ module ElectricCurrent
126
+ {
127
+ enum Unit
128
+ {
129
+ AMPERE,
130
+ MILLIAMPERE,
131
+ MICROAMPERE
132
+ }
133
+ }
134
+
135
+ export class ElectricCurrent
136
+ {
137
+ static getUnitInfo(u: ElectricCurrent.Unit): UnitInfo<ElectricCurrent.Unit> | null;
138
+ static getUnitRatio(u: ElectricCurrent.Unit): number;
139
+ static convert(fromUnit: ElectricCurrent.Unit, toUnit: ElectricCurrent.Unit, fromValue: number): number;
140
+ }
141
+
142
+ module ElectricPotential
143
+ {
144
+ enum Unit
145
+ {
146
+ VOLT,
147
+ MILLIVOLT
148
+ }
149
+ }
150
+
151
+ export class ElectricPotential
152
+ {
153
+ static getUnitInfo(u: ElectricPotential.Unit): UnitInfo<ElectricPotential.Unit> | null;
154
+ static getUnitRatio(u: ElectricPotential.Unit): number;
155
+ static convert(fromUnit: ElectricPotential.Unit, toUnit: ElectricPotential.Unit, fromValue: number): number;
156
+ }
157
+
158
+ module Energy
159
+ {
160
+ enum Unit
161
+ {
162
+ JOULE,
163
+ WATTHOUR,
164
+ KILOWATTHOUR,
165
+ CALORIE,
166
+ KILOCALORIE
167
+ }
168
+ }
169
+
170
+ export class Energy
171
+ {
172
+ static getUnitInfo(u: Energy.Unit): UnitInfo<Energy.Unit> | null;
173
+ static getUnitRatio(u: Energy.Unit): number;
174
+ static convert(fromUnit: Energy.Unit, toUnit: Energy.Unit, fromValue: number): number;
175
+ }
176
+
177
+ module Force
178
+ {
179
+ enum Unit
180
+ {
181
+ NEWTON
182
+ }
183
+ }
184
+
185
+ export class Force
186
+ {
187
+ static getUnitInfo(u: Force.Unit): UnitInfo<Force.Unit> | null;
188
+ static getUnitRatio(u: Force.Unit): number;
189
+ static convert(fromUnit: Force.Unit, toUnit: Force.Unit, fromValue: number): number;
190
+ }
191
+
192
+ module Frequency
193
+ {
194
+ enum Unit
195
+ {
196
+ HERTZ,
197
+ KILOHERTZ
198
+ }
199
+ }
200
+
201
+ export class Frequency
202
+ {
203
+ static getUnitInfo(u: Frequency.Unit): UnitInfo<Frequency.Unit> | null;
204
+ static getUnitRatio(u: Frequency.Unit): number;
205
+ static convert(fromUnit: Frequency.Unit, toUnit: Frequency.Unit, fromValue: number): number;
49
206
  }
207
+
208
+ module MagneticField
209
+ {
210
+ enum Unit
211
+ {
212
+ TESLA,
213
+ GAUSS,
214
+ MICROTESLA,
215
+ MILLITESLA
216
+ }
217
+ }
218
+
219
+ export class MagneticField
220
+ {
221
+ static getUnitInfo(u: MagneticField.Unit): UnitInfo<MagneticField.Unit> | null;
222
+ static getUnitRatio(u: MagneticField.Unit): number;
223
+ static convert(fromUnit: MagneticField.Unit, toUnit: MagneticField.Unit, fromValue: number): number;
224
+ }
225
+
226
+ module Mass
227
+ {
228
+ enum Unit
229
+ {
230
+ KILOGRAM,
231
+ GRAM,
232
+ TONNE,
233
+ POUND,
234
+ OZ
235
+ }
236
+ }
237
+
238
+ export class Mass
239
+ {
240
+ static getUnitInfo(u: Mass.Unit): UnitInfo<Mass.Unit> | null;
241
+ static getUnitRatio(u: Mass.Unit): number;
242
+ static convert(fromUnit: Mass.Unit, toUnit: Mass.Unit, fromValue: number): number;
243
+ }
244
+
245
+ module Power
246
+ {
247
+ enum Unit
248
+ {
249
+ WATT,
250
+ MILLIWATT,
251
+ KILOWATT
252
+ }
253
+ }
254
+
255
+ export class Power
256
+ {
257
+ static getUnitInfo(u: Power.Unit): UnitInfo<Power.Unit> | null;
258
+ static getUnitRatio(u: Power.Unit): number;
259
+ static convert(fromUnit: Power.Unit, toUnit: Power.Unit, fromValue: number): number;
260
+ }
261
+
262
+ module Pressure
263
+ {
264
+ enum Unit
265
+ {
266
+ PASCAL,
267
+ BAR,
268
+ ATM,
269
+ TORR,
270
+ PSI,
271
+ KPASCAL,
272
+ HPASCAL
273
+ }
274
+ }
275
+
276
+ export class Pressure
277
+ {
278
+ static getUnitInfo(u: Pressure.Unit): UnitInfo<Pressure.Unit> | null;
279
+ static getUnitRatio(u: Pressure.Unit): number;
280
+ static convert(fromUnit: Pressure.Unit, toUnit: Pressure.Unit, fromValue: number): number;
281
+ }
282
+
283
+ module Ratio
284
+ {
285
+ enum Unit
286
+ {
287
+ RATIO,
288
+ PERCENT
289
+ }
290
+ }
291
+
292
+ export class Ratio
293
+ {
294
+ static getUnitInfo(u: Ratio.Unit): UnitInfo<Ratio.Unit> | null;
295
+ static getUnitRatio(u: Ratio.Unit): number;
296
+ static convert(fromUnit: Ratio.Unit, toUnit: Ratio.Unit, fromValue: number): number;
297
+ }
298
+
299
+ module ReactiveEnergy
300
+ {
301
+ enum Unit
302
+ {
303
+ KVARH
304
+ }
305
+ }
306
+
307
+ export class ReactiveEnergy
308
+ {
309
+ static getUnitInfo(u: ReactiveEnergy.Unit): UnitInfo<ReactiveEnergy.Unit> | null;
310
+ static getUnitRatio(u: ReactiveEnergy.Unit): number;
311
+ static convert(fromUnit: ReactiveEnergy.Unit, toUnit: ReactiveEnergy.Unit, fromValue: number): number;
312
+ }
313
+
314
+ module ReactivePower
315
+ {
316
+ enum Unit
317
+ {
318
+ VAR
319
+ }
320
+ }
321
+
322
+ export class ReactivePower
323
+ {
324
+ static getUnitInfo(u: ReactivePower.Unit): UnitInfo<ReactivePower.Unit> | null;
325
+ static getUnitRatio(u: ReactivePower.Unit): number;
326
+ static convert(fromUnit: ReactivePower.Unit, toUnit: ReactivePower.Unit, fromValue: number): number;
327
+ }
328
+
329
+ module Speed
330
+ {
331
+ enum Unit
332
+ {
333
+ METER_PER_SECOND,
334
+ KM_PER_HOUR,
335
+ MILE_PER_HOUR,
336
+ KNOT
337
+ }
338
+ }
339
+
340
+ export class Speed
341
+ {
342
+ static getUnitInfo(u: Speed.Unit): UnitInfo<Speed.Unit> | null;
343
+ static getUnitRatio(u: Speed.Unit): number;
344
+ static convert(fromUnit: Speed.Unit, toUnit: Speed.Unit, fromValue: number): number;
345
+ }
346
+
347
+ module Temperature
348
+ {
349
+ enum Unit
350
+ {
351
+ CELSIUS,
352
+ KELVIN,
353
+ FAHRENHEIT
354
+ }
355
+ }
356
+
357
+ export class Temperature
358
+ {
359
+ static getUnitInfo(u: Temperature.Unit): UnitInfo<Temperature.Unit> | null;
360
+ static getUnitRatio(u: Temperature.Unit): number;
361
+ static getUnitScale(u: Temperature.Unit): number;
362
+ static convert(fromUnit: Temperature.Unit, toUnit: Temperature.Unit, fromValue: number): number;
363
+ }
364
+
365
+ export function getList(): any[];