reykit 1.0.37 → 1.0.39

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/react.d.ts CHANGED
@@ -2,9 +2,7 @@ import { ReactNode } from 'react';
2
2
  /**
3
3
  * Render react note.
4
4
  *
5
- * Parameters
6
- * ----------
7
- * @param app React note.
8
- * @param elementId Render HTML element ID.
5
+ * @param app - React note.
6
+ * @param elementId - Render HTML element ID.
9
7
  */
10
8
  export declare function renderReact(app: ReactNode, elementId?: string): void;
package/dist/storage.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Key, Value, KeyByValue } from './type';
1
2
  /**
2
3
  * Manage local storage data.
3
4
  */
@@ -6,25 +7,31 @@ export default class Storager<Data extends Record<string, any>> {
6
7
  /**
7
8
  * Build instance.
8
9
  *
9
- * Parameters
10
- * ----------
11
- * @param name Local storage key.
10
+ * @param name - Local storage key.
12
11
  */
13
12
  constructor(name: string);
14
13
  /**
15
14
  * Get all data.
16
15
  *
17
- * Returns
18
- * -------
19
16
  * @returns All data.
20
17
  */
21
18
  get data(): Data;
19
+ /**
20
+ * Get all keys.
21
+ *
22
+ * @returns All keys.
23
+ */
24
+ get keys(): Key<Data>[];
25
+ /**
26
+ * Get all values.
27
+ *
28
+ * @returns All values.
29
+ */
30
+ get values(): Value<Data>[];
22
31
  /**
23
32
  * Update data.
24
33
  *
25
- * Parameters
26
- * ----------
27
- * @param data New data.
34
+ * @param data - New data.
28
35
  */
29
36
  update(data: Partial<Data>): void;
30
37
  /**
@@ -34,30 +41,27 @@ export default class Storager<Data extends Record<string, any>> {
34
41
  /**
35
42
  * Get a item value.
36
43
  *
37
- * Parameters
38
- * ----------
39
- * @param key Item key.
40
- *
41
- * Returns
42
- * -------
44
+ * @param key - Item key.
43
45
  * @returns Item value.
44
46
  */
45
47
  get<K extends keyof Data>(key: K): Data[K];
46
48
  /**
47
49
  * Set a item.
48
50
  *
49
- * Parameters
50
- * ----------
51
- * @param key Item key.
52
- * @param value Item value.
51
+ * @param key - Item key.
52
+ * @param value - Item value.
53
53
  */
54
54
  set<K extends keyof Data>(key: K, value: Data[K]): void;
55
55
  /**
56
56
  * Delete a item.
57
57
  *
58
- * Parameters
59
- * ----------
60
- * @param key Item key.
58
+ * @param key - Item key.
61
59
  */
62
60
  del<K extends keyof Data>(key: K): void;
61
+ /**
62
+ * Toggle boolean value.
63
+ *
64
+ * @param key - Item key.
65
+ */
66
+ toggle<K extends KeyByValue<Data, boolean>>(key: K): void;
63
67
  }
@@ -2,12 +2,7 @@ import { ClassValue } from 'clsx';
2
2
  /**
3
3
  * Merge TailwindCSS class style string array.
4
4
  *
5
- * Parameters
6
- * ----------
7
- * @param inputs TailwindCSS class style string array.
8
- *
9
- * Returns
10
- * -------
5
+ * @param inputs - TailwindCSS class style string array.
11
6
  * @returns Merged string.
12
7
  */
13
8
  export declare function cn(...inputs: ClassValue[]): string;
package/dist/type.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export type Key<T> = keyof T;
2
+ export type Value<T> = T[keyof T];
3
+ export type KeyByValue<T, V> = {
4
+ [K in keyof T]: T[K] extends V ? K : never;
5
+ }[keyof T];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reykit",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "Kit method set.",
5
5
  "author": "reyxbo",
6
6
  "keywords": [