From 60541cffb75313a372d84a9862ed12cd2cf705c6 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 25 Nov 2022 18:54:13 +0200 Subject: [PATCH] fix: overload declaration for calculateSize in Utils --- packages/utils/src/svg/size.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/utils/src/svg/size.ts b/packages/utils/src/svg/size.ts index 4cedb1c..3186e27 100644 --- a/packages/utils/src/svg/size.ts +++ b/packages/utils/src/svg/size.ts @@ -7,6 +7,21 @@ const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g; /** * Calculate second dimension when only 1 dimension is set */ +export function calculateSize( + size: string, + ratio: number, + precision?: number +): string; +export function calculateSize( + size: number, + ratio: number, + precision?: number +): number; +export function calculateSize( + size: string | number, + ratio: number, + precision?: number +): string | number; export function calculateSize( size: string | number, ratio: number,