@k8ts/instruments
Version:
A collection of utilities and core components for k8ts.
19 lines • 752 B
TypeScript
import { Set } from "immutable";
import { type Parjser } from "parjs";
export declare class UnitValue<Unit extends string = string> {
readonly unit: Unit;
readonly value: number;
readonly type: string;
constructor(unit: Unit, value: number, type: string);
get str(): string;
toString(): string;
}
export declare class UnitParser<const Unit extends string = string> {
private readonly unitType;
private readonly _units;
readonly parser: Parjser<UnitValue<Unit>>;
constructor(unitType: string, _units: Set<Unit>);
parse: (input: `${number}${Unit}`) => UnitValue<Unit>;
static make<const Unit extends string>(unitType: string, units: Set<Unit>): UnitParser<Unit>;
}
//# sourceMappingURL=unit-parser.d.ts.map