Refactor code structure for improved readability and maintainability
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
Vendored
+14
@@ -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;
|
||||
Reference in New Issue
Block a user