@sunyard-szyy-ui/hooks 0.3.0 → 0.3.2
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/README.md +4 -61
- package/dist/index.cjs +5 -56744
- package/dist/index.d.cts +1 -22
- package/dist/index.d.ts +1 -22
- package/dist/index.js +4 -56752
- package/package.json +6 -3
package/dist/index.d.cts
CHANGED
|
@@ -14,26 +14,5 @@ declare function useNamespace(block: string): {
|
|
|
14
14
|
* @returns 防抖后的值
|
|
15
15
|
*/
|
|
16
16
|
declare function useDebounce<T>(value: Ref<T>, delay?: number): Ref<T>;
|
|
17
|
-
/**
|
|
18
|
-
* 切换布尔值的 hook
|
|
19
|
-
* @param initialValue 初始值,默认 false
|
|
20
|
-
* @returns 包含值、切换函数、设置函数的对象
|
|
21
|
-
*/
|
|
22
|
-
declare function useToggle(initialValue?: boolean): {
|
|
23
|
-
value: Ref<boolean, boolean>;
|
|
24
|
-
toggle: () => void;
|
|
25
|
-
setValue: (val: boolean) => void;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* 本地存储 hook
|
|
29
|
-
* @param key 存储的键名
|
|
30
|
-
* @param defaultValue 默认值
|
|
31
|
-
* @returns 包含值、设置函数、移除函数的对象
|
|
32
|
-
*/
|
|
33
|
-
declare function useLocalStorage<T>(key: string, defaultValue: T): {
|
|
34
|
-
value: Ref<T, T>;
|
|
35
|
-
setValue: (val: T) => void;
|
|
36
|
-
removeValue: () => void;
|
|
37
|
-
};
|
|
38
17
|
|
|
39
|
-
export { useDebounce,
|
|
18
|
+
export { useDebounce, useNamespace };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,26 +14,5 @@ declare function useNamespace(block: string): {
|
|
|
14
14
|
* @returns 防抖后的值
|
|
15
15
|
*/
|
|
16
16
|
declare function useDebounce<T>(value: Ref<T>, delay?: number): Ref<T>;
|
|
17
|
-
/**
|
|
18
|
-
* 切换布尔值的 hook
|
|
19
|
-
* @param initialValue 初始值,默认 false
|
|
20
|
-
* @returns 包含值、切换函数、设置函数的对象
|
|
21
|
-
*/
|
|
22
|
-
declare function useToggle(initialValue?: boolean): {
|
|
23
|
-
value: Ref<boolean, boolean>;
|
|
24
|
-
toggle: () => void;
|
|
25
|
-
setValue: (val: boolean) => void;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* 本地存储 hook
|
|
29
|
-
* @param key 存储的键名
|
|
30
|
-
* @param defaultValue 默认值
|
|
31
|
-
* @returns 包含值、设置函数、移除函数的对象
|
|
32
|
-
*/
|
|
33
|
-
declare function useLocalStorage<T>(key: string, defaultValue: T): {
|
|
34
|
-
value: Ref<T, T>;
|
|
35
|
-
setValue: (val: T) => void;
|
|
36
|
-
removeValue: () => void;
|
|
37
|
-
};
|
|
38
17
|
|
|
39
|
-
export { useDebounce,
|
|
18
|
+
export { useDebounce, useNamespace };
|