reykit 1.0.254 → 1.0.256

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.
@@ -1,4 +1,7 @@
1
1
  import { ReactNode, DependencyList } from 'react';
2
+ export { Listener, Listeners, renderReact, isReactNode, useOpen, useCount, useIndex, useRender, useIsMobile, useValueByMobile, useExec, createExternalState };
3
+ type Listener = () => void;
4
+ type Listeners = Set<Listener>;
2
5
  /**
3
6
  * Render react note.
4
7
  * Note: `react` and `react-dom` packages version must be `19.2.4`.
@@ -6,14 +9,14 @@ import { ReactNode, DependencyList } from 'react';
6
9
  * @param app - React note.
7
10
  * @param elementId - Render HTML element ID.
8
11
  */
9
- export declare function renderReact(app: ReactNode, elementId?: string): void;
12
+ declare function renderReact(app: ReactNode, elementId?: string): void;
10
13
  /**
11
14
  * Is it a valid react node.
12
15
  *
13
16
  * @param value - Judgement value.
14
17
  * @returns Judgement result.
15
18
  */
16
- export declare function isReactNode(value: unknown): value is ReactNode;
19
+ declare function isReactNode(value: unknown): value is ReactNode;
17
20
  /**
18
21
  * Hook of toggle.
19
22
  *
@@ -21,7 +24,7 @@ export declare function isReactNode(value: unknown): value is ReactNode;
21
24
  * @param loop - Whether to loop count.
22
25
  * @returns Returns a stateful open value, and a function to automatic count it.
23
26
  */
24
- export declare function useOpen(defaultOpen?: boolean): [boolean, (open?: boolean) => void];
27
+ declare function useOpen(defaultOpen?: boolean): [boolean, (open?: boolean) => void];
25
28
  /**
26
29
  * Hook of count number.
27
30
  *
@@ -31,7 +34,7 @@ export declare function useOpen(defaultOpen?: boolean): [boolean, (open?: boolea
31
34
  * @param loop - Whether to loop count.
32
35
  * @returns Returns a stateful count value, and a function to automatic count it.
33
36
  */
34
- export declare function useCount(start?: number, step?: number, stop?: number, loop?: boolean): [number, () => void];
37
+ declare function useCount(start?: number, step?: number, stop?: number, loop?: boolean): [number, () => void];
35
38
  /**
36
39
  * Hook of count array index.
37
40
  *
@@ -39,17 +42,17 @@ export declare function useCount(start?: number, step?: number, stop?: number, l
39
42
  * @param loop - Whether to loop count.
40
43
  * @returns Returns a stateful index value, and a function to automatic count it.
41
44
  */
42
- export declare function useIndex(array: any[], loop?: boolean): [number, () => void];
45
+ declare function useIndex(array: any[], loop?: boolean): [number, () => void];
43
46
  /**
44
47
  * Hook of force update render.
45
48
  */
46
- export declare function useRender(): () => void;
49
+ declare function useRender(): () => void;
47
50
  /**
48
51
  * Hook of whether is mobile client.
49
52
  *
50
53
  * @returns Judgement.
51
54
  */
52
- export declare function useIsMobile(): boolean;
55
+ declare function useIsMobile(): boolean;
53
56
  /**
54
57
  * Hook of get value by client type.
55
58
  *
@@ -57,7 +60,7 @@ export declare function useIsMobile(): boolean;
57
60
  * @param value - Value of non mobile client.
58
61
  * @returns Value.
59
62
  */
60
- export declare function useValueByMobile<Value, MobileValue>(mobileValue: MobileValue, value: Value): Value | MobileValue;
63
+ declare function useValueByMobile<Value, MobileValue>(mobileValue: MobileValue, value: Value): Value | MobileValue;
61
64
  /**
62
65
  * Hook of execute after rendering or effecting.
63
66
  *
@@ -65,11 +68,11 @@ export declare function useValueByMobile<Value, MobileValue>(mobileValue: Mobile
65
68
  * @param deps - Effect dependency list.
66
69
  * @param args - Execute arguments.
67
70
  */
68
- export declare function useExec<T extends any[]>(func: (...args: T) => any | Promise<any>, deps?: DependencyList, args?: T): void;
71
+ declare function useExec<T extends any[]>(func: (...args: T) => any | Promise<any>, deps?: DependencyList, args?: T): void;
69
72
  /**
70
73
  * Get state value that can be updated externally.
71
74
  *
72
75
  * @param initialValue - Initial state value.
73
76
  * @returns Get state value hook function and set state value general function.
74
77
  */
75
- export declare function createExternalState<State>(initialValue: State): [() => State, (newValue: State) => void];
78
+ declare function createExternalState<State>(initialValue: State): [() => State, (newValue: State) => void];
@@ -4,12 +4,13 @@
4
4
  * @Contact : reyxbo@163.com
5
5
  * @Explain : Text processing module.
6
6
  */
7
- export declare const whitespace = " \t\n\r\v\f";
8
- export declare const asciiLowercase = "abcdefghijklmnopqrstuvwxyz";
9
- export declare const asciiUppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
10
- export declare const asciiLetters: string;
11
- export declare const digits = "0123456789";
12
- export declare const hexdigits: string;
13
- export declare const octdigits = "01234567";
14
- export declare const punctuation = "!\"#$%&'()*+,-./:;<=>?@[]^_`{|}~";
15
- export declare const printable: string;
7
+ export { whitespace, asciiLowercase, asciiUppercase, asciiLetters, digits, hexdigits, octdigits, punctuation, printable };
8
+ declare const whitespace = " \t\n\r\v\f";
9
+ declare const asciiLowercase = "abcdefghijklmnopqrstuvwxyz";
10
+ declare const asciiUppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
11
+ declare const asciiLetters: string;
12
+ declare const digits = "0123456789";
13
+ declare const hexdigits: string;
14
+ declare const octdigits = "01234567";
15
+ declare const punctuation = "!\"#$%&'()*+,-./:;<=>?@[]^_`{|}~";
16
+ declare const printable: string;
@@ -4,9 +4,10 @@
4
4
  * @Contact : reyxbo@163.com
5
5
  * @Explain : Time processing module.
6
6
  */
7
+ export { datetimeLocal };
7
8
  /**
8
9
  * Return local date time string.
9
10
  *
10
11
  * @returns Local date time string.
11
12
  */
12
- export declare function datetimeLocal(): string;
13
+ declare function datetimeLocal(): string;
@@ -1,8 +1,9 @@
1
1
  import { ClassValue } from 'clsx';
2
+ export { cn };
2
3
  /**
3
4
  * Merge TailwindCSS class style string array.
4
5
  *
5
6
  * @param inputs - TailwindCSS class style string array.
6
7
  * @returns Merged string.
7
8
  */
8
- export declare function cn(...inputs: ClassValue[]): string;
9
+ declare function cn(...inputs: ClassValue[]): string;
@@ -1,8 +1,9 @@
1
1
  import { Key, Value, KeyByValue } from '../lib/base';
2
+ export { Storager, openFile, downloadFile };
2
3
  /**
3
4
  * Manage local storage data.
4
5
  */
5
- export declare class Storager<Data extends Record<string, any>> {
6
+ declare class Storager<Data extends Record<string, any>> {
6
7
  name: string;
7
8
  /**
8
9
  * Build instance.
@@ -70,11 +71,11 @@ export declare class Storager<Data extends Record<string, any>> {
70
71
  *
71
72
  * @param obj - Data or URL of with data.
72
73
  */
73
- export declare function openFile(obj: Blob | string): void;
74
+ declare function openFile(obj: Blob | string): void;
74
75
  /**
75
76
  * Browser download file from blob data.
76
77
  *
77
78
  * @param obj - Data or URL of with data.
78
79
  * @param fileName - File name.
79
80
  */
80
- export declare function downloadFile(obj: Blob | string, fileName: string): void;
81
+ declare function downloadFile(obj: Blob | string, fileName: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reykit",
3
- "version": "1.0.254",
3
+ "version": "1.0.256",
4
4
  "description": "General-purpose JavaScript utility method package.",
5
5
  "author": "reyxbo",
6
6
  "keywords": [
@@ -1,23 +0,0 @@
1
- type AliGraphCaptchaOnErrorArg = {
2
- code: string;
3
- msg: string;
4
- desc: {
5
- detail: string;
6
- };
7
- };
8
- type AliGraphCaptchaOnError = (error: AliGraphCaptchaOnErrorArg) => void;
9
- /**
10
- * Initialize Ali graph captcha.
11
- *
12
- * @param appId: Account APP ID.
13
- * @param onError: Callback function of error.
14
- */
15
- export declare function initAliGraphCaptcha(appId: string, onError?: AliGraphCaptchaOnError | null): void;
16
- /**
17
- * Use Ali graph captcha.
18
- *
19
- * @param fn - Execution function after verification.
20
- * @param args - Execution function arguments.
21
- */
22
- export declare function verifyAliGraphCaptcha<T, Args extends any[]>(fn: (...args: Args) => T | Promise<T>, ...args: Args): void;
23
- export {};