fui-fancyui
Version:
FancyUI Libary
26 lines (25 loc) • 1.19 kB
TypeScript
/**
* Size calculator that follows an alternating ratio pattern:
* - Even steps use a 1.5x multiplier
* - Odd steps use a 1.33x multiplier
* Starting with a base size of 16px at level 1
*/
/**
* Calculates the size at a given level using alternating ratios
* @param level - The level number (1-based index)
* @param withPx - Whether to return the value with 'px' suffix
* @param baseSize - The starting size (default: 16)
* @returns The calculated size for the given level, as a string with 'px' or as a number
*/
export declare function generateComponentSize<T extends boolean>(level: number, withPx?: T, baseSize?: number): T extends true ? string : number;
/**
* Get a mapping of level numbers to their corresponding sizes
* @param maxLevel - The maximum level to calculate
* @param withPx - Whether to return sizes with 'px' suffix
* @param baseSize - The starting size (default: 16)
* @returns An object mapping level numbers to sizes (either numbers or strings with 'px')
*/
export declare function getComponentSizeMap<T extends boolean>(maxLevel: number, withPx?: T, baseSize?: number): Record<number, T extends true ? string : number>;
/**
* Example usage
*/