@fractorysolutions/safe-units
Version:
Type-safe TypeScript units of measure
19 lines (18 loc) • 610 B
TypeScript
import { GenericMeasure } from "./genericMeasure";
import { GenericMeasureType } from "./genericMeasureFactory";
import { NthRootFn, SpreadFn, UnaryFn } from "./genericMeasureUtils";
import { Unit } from "./unitTypeArithmetic";
interface MeasureStaticMethods {
abs: UnaryFn;
ceil: UnaryFn;
floor: UnaryFn;
fround: UnaryFn;
round: UnaryFn;
trunc: UnaryFn;
hypot: SpreadFn;
sqrt: NthRootFn<"2">;
cbrt: NthRootFn<"3">;
}
export type Measure<U extends Unit> = GenericMeasure<number, U>;
export declare const Measure: GenericMeasureType<number, MeasureStaticMethods>;
export {};