@cclr/react 0.1.44 → 0.1.47
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/lib/type/index.d.ts +27 -7
- package/package.json +6 -6
package/lib/type/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
1
3
|
import { TPlainObject, TAny, TPlainFunction, TNoop } from '@cclr/lang';
|
|
2
4
|
import { TEventMap } from '@cclr/front';
|
|
3
5
|
|
|
@@ -5,7 +7,7 @@ import { TEventMap } from '@cclr/front';
|
|
|
5
7
|
* 适配子元素为DOM元素
|
|
6
8
|
* 如果没有传入dom子元素,则返回一个空的div
|
|
7
9
|
*/
|
|
8
|
-
declare const AdaptDomChildren: any
|
|
10
|
+
declare const AdaptDomChildren: React__default.ForwardRefExoticComponent<Omit<any, "ref"> & React__default.RefAttributes<any>>;
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* 简化 createContext 的使用
|
|
@@ -51,7 +53,16 @@ declare const useDebounceFn: <T extends TPlainFunction>(cb: T, options?: {
|
|
|
51
53
|
trailing?: boolean;
|
|
52
54
|
/** 最大等待时间,单位为毫秒 */
|
|
53
55
|
maxWait?: number;
|
|
54
|
-
}) =>
|
|
56
|
+
}) => {
|
|
57
|
+
run: T & {
|
|
58
|
+
cancel: () => void;
|
|
59
|
+
flush: () => void;
|
|
60
|
+
fun: T;
|
|
61
|
+
};
|
|
62
|
+
cancel: () => void;
|
|
63
|
+
flush: () => void;
|
|
64
|
+
fun: T;
|
|
65
|
+
};
|
|
55
66
|
|
|
56
67
|
/**
|
|
57
68
|
* 使用多个事件监听器
|
|
@@ -66,7 +77,7 @@ declare const useEventListenerMultiple: <T extends HTMLElement = HTMLElement>(re
|
|
|
66
77
|
* @param eventMap 事件监听器映射
|
|
67
78
|
*/
|
|
68
79
|
declare const useEventListenerMultipleRef: <T extends HTMLElement = HTMLElement>(eventMap: TEventMap) => {
|
|
69
|
-
ref:
|
|
80
|
+
ref: React$1.RefObject<T>;
|
|
70
81
|
};
|
|
71
82
|
|
|
72
83
|
/**
|
|
@@ -82,7 +93,7 @@ declare const useOnceFun: (fun: TNoop) => void;
|
|
|
82
93
|
* @param initFun 初始化函数
|
|
83
94
|
* @returns
|
|
84
95
|
*/
|
|
85
|
-
declare const useRefPro: <T>(initFun: (() => T) | T) =>
|
|
96
|
+
declare const useRefPro: <T>(initFun: (() => T) | T) => React$1.MutableRefObject<T | undefined>;
|
|
86
97
|
|
|
87
98
|
/**
|
|
88
99
|
* 节流
|
|
@@ -96,15 +107,24 @@ declare const useThrottleFn: <T extends TPlainFunction>(cb: T, options?: {
|
|
|
96
107
|
leading?: boolean;
|
|
97
108
|
/** 是否在延迟开始后调用函数 default: true */
|
|
98
109
|
trailing?: boolean;
|
|
99
|
-
}) =>
|
|
110
|
+
}) => {
|
|
111
|
+
run: T & {
|
|
112
|
+
cancel: () => void;
|
|
113
|
+
flush: () => void;
|
|
114
|
+
fun: T;
|
|
115
|
+
};
|
|
116
|
+
cancel: () => void;
|
|
117
|
+
flush: () => void;
|
|
118
|
+
fun: T;
|
|
119
|
+
};
|
|
100
120
|
|
|
101
|
-
declare const useUpdate: () => () =>
|
|
121
|
+
declare const useUpdate: () => () => void;
|
|
102
122
|
|
|
103
123
|
/**
|
|
104
124
|
* 生成一个 uuid
|
|
105
125
|
* @returns string
|
|
106
126
|
*/
|
|
107
|
-
declare const useUuid: () =>
|
|
127
|
+
declare const useUuid: () => string;
|
|
108
128
|
|
|
109
129
|
interface ICommonUiProps {
|
|
110
130
|
className?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cclr/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47",
|
|
4
4
|
"description": "react 相关功能",
|
|
5
5
|
"author": "cclr <18843152354@163.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"g:test": "vitest run",
|
|
28
28
|
"g:build": "drr build"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "7e698eb3b9c3e4498659709be4d0b960230e3c62",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cclr/front": "
|
|
33
|
-
"@cclr/lang": "
|
|
34
|
-
"@cclr/model": "
|
|
35
|
-
"@cclr/utils": "
|
|
32
|
+
"@cclr/front": "0.1.47",
|
|
33
|
+
"@cclr/lang": "0.1.47",
|
|
34
|
+
"@cclr/model": "workspace:*",
|
|
35
|
+
"@cclr/utils": "0.1.47"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/react": "^18.3.27",
|