Refactor code structure for improved readability and maintainability
Test Suite / test (24.15.0) (push) Has been cancelled

This commit is contained in:
Nils-Johan Gynther
2026-05-06 07:37:59 +02:00
parent e4f201ea36
commit 969dafdbc6
273 changed files with 11357 additions and 39 deletions
+14
View File
@@ -0,0 +1,14 @@
export type UnitType = 'weight' | 'volume' | 'cooking' | 'piece' | 'other';
export interface UnitDefinition {
value: string;
labelSv: string;
type: UnitType;
toBaseFactor: number;
aliases: string[];
}
export declare const UNIT_DEFINITIONS: UnitDefinition[];
export declare function normalizeUnit(unit: string): string;
export declare function getUnitDefinition(unit: string): UnitDefinition | undefined;
export declare function getUnitType(unit: string): UnitType | null;
export declare function canConvert(fromUnit: string, toUnit: string): boolean;
export declare function convertUnit(quantity: number, fromUnit: string, toUnit: string): number;