@emqx/shared-ui-utils 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/dist/format.d.ts CHANGED
@@ -5,31 +5,4 @@
5
5
  * @throws {Error} If the input is not a non-negative number.
6
6
  */
7
7
  export declare const formatSizeUnit: (val: number) => string;
8
- /**
9
- * Converts a given value from one unit to its equivalent in the smallest unit of the same type.
10
- *
11
- * For example, it converts a value in kilobytes (KB) to bytes (B), or a value in hours (h) to milliseconds (ms).
12
- * The smallest unit for time is millisecond (ms), and for size is byte (B).
13
- *
14
- * @param {number} value - The numeric value to be converted.
15
- * @param {string} unit - The unit of the value, which is a key of the SizeOrTimeUnit enum.
16
- * @returns {number} The input value converted to the smallest unit.
17
- * @throws {Error} If the provided unit is not a key in the SizeOrTimeUnit enum.
18
- *
19
- * @example
20
- * // returns 1024, converts 1 kilobyte to bytes
21
- * formatValueToMinUnit(1, 'KB');
22
- */
23
- declare enum SizeOrTimeUnit {
24
- ms = 1,
25
- s = 1000,
26
- m = 60000,
27
- h = 3600000,
28
- d = 86400000,
29
- B = 1,
30
- KB = 1024,
31
- MB = 1048576,
32
- GB = 1073741824
33
- }
34
- export declare const formatValueToMinUnit: (value: number, unit: keyof typeof SizeOrTimeUnit) => number;
35
- export {};
8
+ export declare const formatValueToMinUnit: (value: number, unit: string) => number;