@vexip-ui/utils
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -130,2 +130,4 @@ /** | ||
export declare type ColorType = 'hex' | 'rgb' | 'hsv' | 'hsl'; | ||
/** | ||
@@ -188,2 +190,9 @@ * 升序比较两个日期大小,用于给数组的 sort 方法使用 | ||
/** | ||
* Return decimal length of a number. | ||
* | ||
* @param number The input number | ||
*/ | ||
export declare function decimalLength(number: number | string): number; | ||
/** | ||
* 深度拷贝对象或数组 (避免一层死循环) | ||
@@ -335,5 +344,6 @@ * | ||
/** | ||
* Return digits length of a number. | ||
* Return decimal length of a number. | ||
* | ||
* @param number The input number | ||
* @deprecated Using `decimalLength` to replace it | ||
*/ | ||
@@ -434,2 +444,4 @@ export declare function digitLength(number: number | string): number; | ||
export declare function formatByteSize(byte: number, unit?: SizeUnitWithAuto, joinUtil?: true): number; | ||
/** | ||
@@ -530,3 +542,3 @@ * 获取中文星期 | ||
declare interface HSL { | ||
declare interface HSL extends Record<any, any> { | ||
h: number; | ||
@@ -556,3 +568,3 @@ s: number; | ||
declare interface HSV { | ||
declare interface HSV extends Record<any, any> { | ||
h: number; | ||
@@ -654,5 +666,8 @@ s: number; | ||
* | ||
* 开启严格模式则通过正则以更严格的方法判断 | ||
* | ||
* @param value 需要检测的值 | ||
* @param strict 是否为严格模式 | ||
*/ | ||
export declare function isValidNumber(value: unknown): boolean; | ||
export declare function isValidNumber(value: unknown, strict?: boolean): boolean; | ||
@@ -915,2 +930,10 @@ export declare function isVisible(el?: Element | null): boolean; | ||
/** | ||
* 为给定的整数开头填充 0,直至满足指定的长度 | ||
* | ||
* @param number 需要处理的整数 | ||
* @param length 填充至的长度 | ||
*/ | ||
export declare function padStartZeros(number: number, length: number): string; | ||
/** | ||
* 将给定的 {@link Color} 解析为 {@link ColorMeta} | ||
@@ -949,4 +972,10 @@ * | ||
export declare function randomColor(withAlpha?: boolean, type?: 'hex' | 'rgb' | 'hsv' | 'hsl'): string; | ||
export declare function randomColor(withAlpha?: boolean, type?: ColorType): string; | ||
export declare function randomHardColor(withAlpha?: boolean, type?: ColorType): string; | ||
export declare function randomPreferColor(prefer: 'hard' | 'soft', withAlpha?: boolean, type?: ColorType): string; | ||
export declare function randomSoftColor(withAlpha?: boolean, type?: ColorType): string; | ||
/** | ||
@@ -995,3 +1024,3 @@ * 根据长度生成一串随机的字符串 | ||
declare interface RGB { | ||
declare interface RGB extends Record<any, any> { | ||
r: number; | ||
@@ -1145,2 +1174,9 @@ g: number; | ||
/** | ||
* 将命名转换为驼峰命名 | ||
* | ||
* @param value 需要转换的命名 | ||
*/ | ||
export declare function toCamelCase(value: string): string; | ||
/** | ||
* 将命名转换为首字母大写的驼峰 | ||
@@ -1147,0 +1183,0 @@ * |
{ | ||
"name": "@vexip-ui/utils", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "qmhc", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
388750
2809