jk-vue-comps 0.2.13 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/GoogleAuth.d.ts +83 -1
- package/dist/components/TelegramAuth.d.ts +88 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/useCopyToClipboard.d.ts +9 -1
- package/dist/hooks/useFormKeypressEnter.d.ts +2 -1
- package/dist/hooks/useMemo.d.ts +2 -1
- package/dist/index.d.ts +226 -1
- package/dist/utils/index.d.ts +55 -1
- package/dist/utils/is.d.ts +59 -1
- package/dist/utils/lodash.d.ts +39 -1
- package/dist/utils/math.d.ts +113 -1
- package/dist/utils/timeZone.d.ts +9 -1
- package/dist/utils/vuePropTypes.d.ts +17 -1
- package/dist/utils/withInstall.d.ts +3 -1
- package/package.json +2 -2
- package/dist/src/components/GoogleAuth.d.ts +0 -83
- package/dist/src/components/TelegramAuth.d.ts +0 -88
- package/dist/src/components/index.d.ts +0 -2
- package/dist/src/hooks/index.d.ts +0 -3
- package/dist/src/hooks/useCopyToClipboard.d.ts +0 -9
- package/dist/src/hooks/useFormKeypressEnter.d.ts +0 -2
- package/dist/src/hooks/useMemo.d.ts +0 -2
- package/dist/src/index.d.ts +0 -226
- package/dist/src/utils/index.d.ts +0 -55
- package/dist/src/utils/is.d.ts +0 -59
- package/dist/src/utils/lodash.d.ts +0 -39
- package/dist/src/utils/math.d.ts +0 -113
- package/dist/src/utils/timeZone.d.ts +0 -9
- package/dist/src/utils/vuePropTypes.d.ts +0 -17
- package/dist/src/utils/withInstall.d.ts +0 -3
package/dist/src/utils/is.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export declare function is(val: unknown, type: string): boolean;
|
|
2
|
-
/** 是否undefined */
|
|
3
|
-
export declare function isDef<T = unknown>(val?: T): val is T;
|
|
4
|
-
/** 是否不是undefined */
|
|
5
|
-
export declare function isUnDef<T = unknown>(val?: T): val is T;
|
|
6
|
-
/** 是否对象 */
|
|
7
|
-
export declare function isObject(val: any): val is Record<any, any>;
|
|
8
|
-
/** 是否Date */
|
|
9
|
-
export declare function isDate(val: unknown): val is Date;
|
|
10
|
-
/** 是否null */
|
|
11
|
-
export declare function isNull(val: unknown): val is null;
|
|
12
|
-
/** 是否null && 不是undefined */
|
|
13
|
-
export declare function isNullAndUnDef(val: unknown): val is null | undefined;
|
|
14
|
-
/** 是否null || 不是undefined */
|
|
15
|
-
export declare function isNullOrUnDef(val: unknown): val is null | undefined;
|
|
16
|
-
/** 是否数字(NaN也是数字) */
|
|
17
|
-
export declare function isNumber(val: unknown): val is number;
|
|
18
|
-
/** 是否字符串 */
|
|
19
|
-
export declare function isString(val: unknown): val is string;
|
|
20
|
-
/** 是否函数 */
|
|
21
|
-
export declare function isFunction(val: unknown): val is (...args: any[]) => any;
|
|
22
|
-
/** 是否布尔 */
|
|
23
|
-
export declare function isBoolean(val: unknown): val is boolean;
|
|
24
|
-
/** 是否正则 */
|
|
25
|
-
export declare function isRegExp(val: unknown): val is RegExp;
|
|
26
|
-
/** 是否数组 */
|
|
27
|
-
export declare function isArray(val: any): val is Array<any>;
|
|
28
|
-
/** 是否空 */
|
|
29
|
-
export declare function isEmpty<T = unknown>(val: T): val is T;
|
|
30
|
-
/** 是否Promise */
|
|
31
|
-
export declare function isPromise<T = any>(val: unknown): val is Promise<T>;
|
|
32
|
-
/** 是否PromiseLink */
|
|
33
|
-
export declare function isPromiseLink<T>(it: T | PromiseLike<T>): it is PromiseLike<T>;
|
|
34
|
-
/** 是否Window */
|
|
35
|
-
export declare function isWindow(val: any): val is Window;
|
|
36
|
-
/** 是否Element */
|
|
37
|
-
export declare function isElement(val: unknown): val is Element;
|
|
38
|
-
/** 是否Map */
|
|
39
|
-
export declare function isMap(val: unknown): val is Map<any, any>;
|
|
40
|
-
/** 是否服务端渲染,没有window对象 */
|
|
41
|
-
export declare function isServer(): boolean;
|
|
42
|
-
/** 是否客户端,window对象不为undefined */
|
|
43
|
-
export declare function isClient(): boolean;
|
|
44
|
-
/** 是否url */
|
|
45
|
-
export declare function isUrl(path: string): boolean;
|
|
46
|
-
/** 是否Ip */
|
|
47
|
-
export declare function isIp(ip: string): boolean;
|
|
48
|
-
/** 是否邮箱 */
|
|
49
|
-
export declare function isEmail(v: any): boolean;
|
|
50
|
-
/** 是否号码 */
|
|
51
|
-
export declare function isValidPhoneNumber(phoneNumber: string): boolean;
|
|
52
|
-
/** 是否移动端浏览器 */
|
|
53
|
-
export declare function isInMobileBrowser(): false | RegExpMatchArray | null;
|
|
54
|
-
/** 是否中文 */
|
|
55
|
-
export declare function isZhLang(lang: string): boolean;
|
|
56
|
-
/** 是否Edge浏览器 */
|
|
57
|
-
export declare function isEdgeBrowser(): boolean;
|
|
58
|
-
/** 是否html字符串 */
|
|
59
|
-
export declare function isHtmlStr(str: string): boolean;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/** 代替lodash.clone */
|
|
2
|
-
export declare function clone<T>(value: T): T;
|
|
3
|
-
/** 深拷贝 */
|
|
4
|
-
export declare function cloneDeep<T>(target: T, map?: WeakMap<object, any>): T;
|
|
5
|
-
/** 代替lodash.pick */
|
|
6
|
-
export declare function pick<T extends object, K extends keyof T>(obj: T | null | undefined, keys: K | K[]): Pick<T, K>;
|
|
7
|
-
/** 代替lodash.pickBy */
|
|
8
|
-
export declare function pickBy<T extends object, S extends T[keyof T]>(obj: T | null | undefined, predicate: (value: T[keyof T], key: keyof T) => value is S): {
|
|
9
|
-
[K in keyof T]?: S;
|
|
10
|
-
};
|
|
11
|
-
export declare function pickBy<T extends object>(obj: T | null | undefined, predicate: (value: T[keyof T], key: keyof T) => any): Partial<T>;
|
|
12
|
-
/** 代替lodash.omit */
|
|
13
|
-
export declare function omit<T extends object, K extends keyof T = keyof T>(obj: T, keys: K | K[]): Omit<T, K>;
|
|
14
|
-
export declare function omit<T extends object>(obj: T): T;
|
|
15
|
-
export declare function omit<T extends null | undefined>(obj: T, keys?: any): T;
|
|
16
|
-
export declare function omit<T extends string | number | boolean | symbol>(obj: T, keys?: any): T;
|
|
17
|
-
type GetPathValue<T, P extends string> = P extends `${infer Key}.${infer Rest}` ? Key extends keyof T ? GetPathValue<Exclude<T[Key], undefined | null>, Rest> : undefined : P extends keyof T ? T[P] : undefined;
|
|
18
|
-
/** 代替lodash.get */
|
|
19
|
-
export declare function get<T extends object, P extends string>(obj: T, path: P): GetPathValue<T, P>;
|
|
20
|
-
export declare function get<T extends object, P extends string, D>(obj: T, path: P, defaultValue: D): Exclude<GetPathValue<T, P>, undefined> | D;
|
|
21
|
-
/** 代替lodash.set */
|
|
22
|
-
export declare function set<T>(obj: T, path: string | number, value: any): T;
|
|
23
|
-
/** 代替lodash.isNil */
|
|
24
|
-
export declare function isNil(value: any): value is null | undefined;
|
|
25
|
-
/** 代替lodash.isEqual */
|
|
26
|
-
export declare function isEqual(value: any, other: any): boolean;
|
|
27
|
-
/** 代替lodash.uniq */
|
|
28
|
-
export declare function uniq<T>(array: T[] | null | undefined): T[];
|
|
29
|
-
/** 代替lodash.uniqBy */
|
|
30
|
-
export declare function uniqBy<T>(array: T[] | null | undefined, iteratee: ((item: T) => any) | keyof T): T[];
|
|
31
|
-
/** 代替lodash.upperFirst */
|
|
32
|
-
export declare function upperFirst(str: string | null | undefined): string;
|
|
33
|
-
/** 代替lodash.merge */
|
|
34
|
-
export declare function merge<T extends object, S extends object[]>(target: T, ...sources: S): T & any;
|
|
35
|
-
/** 代替lodash.difference */
|
|
36
|
-
export declare function difference<T>(array: T[] | null | undefined, ...values: T[][]): T[];
|
|
37
|
-
/** 代替lodash.intersection */
|
|
38
|
-
export declare function intersection<T>(...arrays: T[][]): T[];
|
|
39
|
-
export {};
|
package/dist/src/utils/math.d.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { default as BJS } from 'bignumber.js';
|
|
2
|
-
export type BigNumVal = BJS.Value;
|
|
3
|
-
export type BigNumValType = BigNumVal | undefined | null | boolean;
|
|
4
|
-
export type BigNumObj = BJS;
|
|
5
|
-
export declare const DOWN: 1;
|
|
6
|
-
export declare const UP: 0;
|
|
7
|
-
export declare const BigNumber: typeof BJS;
|
|
8
|
-
export declare function helper(val: BigNumValType): BigNumObj;
|
|
9
|
-
/** 是否为boolean值 */
|
|
10
|
-
export declare function isBool(val: any): val is boolean;
|
|
11
|
-
/** 是否为BigNumber对象 */
|
|
12
|
-
export declare function isBigNum(val: any): val is BigNumObj;
|
|
13
|
-
/** 是否为数字 */
|
|
14
|
-
export declare function isNum(val: any): val is number;
|
|
15
|
-
/** 是否为NaN值(传入任意值转bignumber是否为NaN) */
|
|
16
|
-
export declare function isNanValue(val: any): boolean;
|
|
17
|
-
/** 是否为整数(传入任意值转bignumber是否为整数) */
|
|
18
|
-
export declare function isInt(val: any): boolean;
|
|
19
|
-
/** 是否大于
|
|
20
|
-
* @example isGreaterThan('456', 132) => true
|
|
21
|
-
*/
|
|
22
|
-
export declare function isGreaterThan(num1: BigNumVal, num2: BigNumVal): boolean;
|
|
23
|
-
/** 是否小于
|
|
24
|
-
* @example isLessThan('123', 132) => true
|
|
25
|
-
*/
|
|
26
|
-
export declare function isLessThan(num1: BigNumVal, num2: BigNumVal): boolean;
|
|
27
|
-
/** 是否等于
|
|
28
|
-
* @example isEqualTo('123', 123) => true
|
|
29
|
-
*/
|
|
30
|
-
export declare function isEqualTo(num1: BigNumVal, num2: BigNumVal): boolean;
|
|
31
|
-
/** 是否大于等于
|
|
32
|
-
* @example isGreaterThanOrEqualTo('1223', 123) => true
|
|
33
|
-
* @example isGreaterThanOrEqualTo('123', 123) => true
|
|
34
|
-
*/
|
|
35
|
-
export declare function isGreaterThanOrEqualTo(num1: BigNumVal, num2: BigNumVal): boolean;
|
|
36
|
-
/** 是否小于等于
|
|
37
|
-
* @example isLessThanOrEqualTo('123', 123) => true
|
|
38
|
-
* @example isLessThanOrEqualTo('13', 123) => true
|
|
39
|
-
*/
|
|
40
|
-
export declare function isLessThanOrEqualTo(num1: BigNumVal, num2: BigNumVal): boolean;
|
|
41
|
-
/** 转为BigNumber对象 */
|
|
42
|
-
export declare function toBigNum(val: BigNumValType): BJS;
|
|
43
|
-
/** 转为数字 */
|
|
44
|
-
export declare function toNum(val: BigNumValType): number;
|
|
45
|
-
/**
|
|
46
|
-
* 转为整数
|
|
47
|
-
* @example toInt(15.99) => 15
|
|
48
|
-
* @example toInt(-22.22) => -22
|
|
49
|
-
*/
|
|
50
|
-
export declare function toInt(val: BigNumValType, isUp?: boolean): number;
|
|
51
|
-
/** 转为字符串 */
|
|
52
|
-
export declare function toString(val: BigNumValType): string;
|
|
53
|
-
/**
|
|
54
|
-
* 保留小数位(超过指定位数截断,小于位数不进行0补充)
|
|
55
|
-
* @param val val
|
|
56
|
-
* @param decimal 保留小数位数
|
|
57
|
-
* @param isUp 是否向上舍入 default: false
|
|
58
|
-
* @example toDecimalPlaces(2.326, 2) => 2.32
|
|
59
|
-
* @example toDecimalPlaces(-5.526, 2) => -5.52
|
|
60
|
-
* @example toDecimalPlaces(2.326, 2, true) => 2.33
|
|
61
|
-
* @example toDecimalPlaces(-5.526, 2, true) => -5.53
|
|
62
|
-
*/
|
|
63
|
-
export declare function toDecimalPlaces(val: BigNumValType, decimal?: number, isUp?: boolean): number;
|
|
64
|
-
/** 转为千位符数字 */
|
|
65
|
-
export declare function toLocaleString(val: BigNumValType): string;
|
|
66
|
-
/**
|
|
67
|
-
* 相加
|
|
68
|
-
* @example add(3, 3) => 6
|
|
69
|
-
* @example add(3, 3, 4) => 10
|
|
70
|
-
*/
|
|
71
|
-
export declare function add(...vals: BigNumValType[]): number;
|
|
72
|
-
/**
|
|
73
|
-
* 相减
|
|
74
|
-
* @example subtract('5', 3) => 2
|
|
75
|
-
* @example subtract(5, 3, '2') => 0
|
|
76
|
-
*/
|
|
77
|
-
export declare function subtract(...vals: BigNumValType[]): number;
|
|
78
|
-
/**
|
|
79
|
-
* 相乘
|
|
80
|
-
* @example multiply('3', 5) => 15
|
|
81
|
-
* @example multiply(3, 5, '2') => 30
|
|
82
|
-
*/
|
|
83
|
-
export declare function multiply(...vals: BigNumValType[]): number;
|
|
84
|
-
/**
|
|
85
|
-
* 相除
|
|
86
|
-
* @example divide('9', 3) => 3
|
|
87
|
-
* @example divide('100', 2, 10) => 5
|
|
88
|
-
* @example divide('100', 0, 10) => 0
|
|
89
|
-
*/
|
|
90
|
-
export declare function divide(...vals: BigNumValType[]): number;
|
|
91
|
-
/**
|
|
92
|
-
* 幂运算
|
|
93
|
-
* @example power('2', '3') => 8
|
|
94
|
-
* @example power('10', 2) => 100
|
|
95
|
-
* @example power('-2', 3) => -8
|
|
96
|
-
*/
|
|
97
|
-
export declare function power(base: BigNumValType, exponent: BigNumValType): number;
|
|
98
|
-
/**
|
|
99
|
-
* 小数转为百分比
|
|
100
|
-
* @example 0.1111 => 11.11%
|
|
101
|
-
*/
|
|
102
|
-
export declare function formatRate(val: BigNumValType, unit?: string): string;
|
|
103
|
-
/**
|
|
104
|
-
* 转为百分小数
|
|
105
|
-
* @example 22.22 => 0.2222
|
|
106
|
-
*/
|
|
107
|
-
export declare function unFormatRate(val: BigNumValType): number;
|
|
108
|
-
export declare const gt: typeof isGreaterThan;
|
|
109
|
-
export declare const gte: typeof isGreaterThanOrEqualTo;
|
|
110
|
-
export declare const lt: typeof isLessThan;
|
|
111
|
-
export declare const lte: typeof isLessThanOrEqualTo;
|
|
112
|
-
export declare const eq: typeof isEqualTo;
|
|
113
|
-
export declare const isNan: typeof isNanValue;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, VNode, VNodeChild } from 'vue';
|
|
2
|
-
import { VueTypeValidableDef } from 'vue-types';
|
|
3
|
-
import * as VueTypes from 'vue-types';
|
|
4
|
-
declare const VuePropTypes_base: ReturnType<typeof VueTypes.createTypes>;
|
|
5
|
-
declare class VuePropTypes extends VuePropTypes_base {
|
|
6
|
-
static vueTypes: typeof VueTypes;
|
|
7
|
-
static anyType: typeof VueTypes.any;
|
|
8
|
-
static stringType: typeof VueTypes.string;
|
|
9
|
-
static boolType: typeof VueTypes.bool;
|
|
10
|
-
static numberType: typeof VueTypes.number;
|
|
11
|
-
static funcType: typeof VueTypes.func;
|
|
12
|
-
static get style(): VueTypeValidableDef<CSSProperties>;
|
|
13
|
-
static get vueNode(): VueTypeValidableDef<VNode | VNodeChild>;
|
|
14
|
-
}
|
|
15
|
-
/** vue-types类型工具 */
|
|
16
|
-
export declare const propTypes: typeof VuePropTypes;
|
|
17
|
-
export default VuePropTypes;
|