UNPKG

844 BTypeScriptView Raw
1/**
2 * A time duration.
3 */
4export type DurationUnit = 'nanosecond' | 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week';
5/**
6 * Size of information derived from bytes.
7 */
8export type InformationUnit = 'bit' | 'byte' | 'kilobyte' | 'kibibyte' | 'megabyte' | 'mebibyte' | 'gigabyte' | 'terabyte' | 'tebibyte' | 'petabyte' | 'exabyte' | 'exbibyte';
9/**
10 * Fractions such as percentages.
11 */
12export type FractionUnit = 'ratio' | 'percent';
13/**
14 * Untyped value without a unit.
15 */
16export type NoneUnit = '' | 'none';
17type LiteralUnion<T extends string> = T | Omit<T, T>;
18export type MeasurementUnit = LiteralUnion<DurationUnit | InformationUnit | FractionUnit | NoneUnit>;
19export type Measurements = Record<string, {
20 value: number;
21 unit: MeasurementUnit;
22}>;
23export {};
24//# sourceMappingURL=measurement.d.ts.map
\No newline at end of file