dphelper 2.6.4 → 3.0.0
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/CODE_OF_CONDUCT.md +108 -0
- package/COPYRIGHT.md +6 -0
- package/README.md +133 -291
- package/SECURITY.md +3 -0
- package/index.js +173 -1
- package/package.json +53 -153
- package/types/dphelper.d.ts +143 -543
- package/types/index.d.ts +48 -0
- package/types/scripts/generate-imports.d.ts +1 -0
- package/types/scripts/over.d.ts +1 -0
- package/types/scripts/setProps.d.ts +1 -0
- package/types/scripts/setupGlobal.d.ts +1 -0
- package/types/tools/ai/index.d.ts +1 -0
- package/types/tools/anchor/index.d.ts +1 -0
- package/types/tools/array/index.d.ts +1 -0
- package/types/tools/audio/index.d.ts +1 -0
- package/types/tools/avoid/index.d.ts +1 -0
- package/types/tools/browser/index.d.ts +1 -0
- package/types/tools/check/index.d.ts +1 -0
- package/types/tools/color/index.d.ts +1 -0
- package/types/tools/cookie/index.d.ts +1 -0
- package/types/tools/coords/index.d.ts +1 -0
- package/types/tools/credits/index.d.ts +1 -0
- package/types/tools/date/index.d.ts +1 -0
- package/types/tools/disable/index.d.ts +1 -0
- package/types/tools/dispatch/index.d.ts +1 -0
- package/types/tools/elements/index.d.ts +1 -0
- package/types/tools/events/index.d.ts +1 -0
- package/types/tools/fetch/index.d.ts +1 -0
- package/types/tools/form/index.d.ts +1 -0
- package/types/tools/format/index.d.ts +1 -0
- package/types/tools/json/index.d.ts +1 -0
- package/types/tools/load/index.d.ts +1 -0
- package/types/tools/logging/index.d.ts +1 -0
- package/types/tools/math/index.d.ts +1 -0
- package/types/tools/memory/index.d.ts +1 -0
- package/types/tools/objects/index.d.ts +1 -0
- package/types/tools/path/index.d.ts +1 -0
- package/types/tools/promise/index.d.ts +1 -0
- package/types/tools/sanitize/index.d.ts +1 -0
- package/types/tools/screen/index.d.ts +1 -0
- package/types/tools/screen/popupManager.d.ts +32 -0
- package/types/tools/scrollbar/index.d.ts +1 -0
- package/types/tools/security/index.d.ts +1 -0
- package/types/tools/shortcut/index.d.ts +1 -0
- package/types/tools/socket/index.d.ts +1 -0
- package/types/tools/sse/index.d.ts +1 -0
- package/types/tools/svg/index.d.ts +1 -0
- package/types/tools/sync/index.d.ts +1 -0
- package/types/tools/system/index.d.ts +1 -0
- package/types/tools/text/index.d.ts +1 -0
- package/types/tools/timer/index.d.ts +1 -0
- package/types/tools/tools/index.d.ts +1 -0
- package/types/tools/translators/index.d.ts +1 -0
- package/types/tools/triggers/index.d.ts +1 -0
- package/types/tools/types/index.d.ts +1 -0
- package/types/tools/ui/index.d.ts +1 -0
- package/types/tools/window/index.d.ts +1 -0
- package/DISCLAIMER.md +0 -11
- package/docs/_config.yml +0 -1
- package/docs/index.md +0 -380
- package/documents/OBSERVER.md +0 -63
- package/documents/SESSION.md +0 -54
- package/documents/STATE.md +0 -65
- package/documents/STORE.md +0 -76
- package/documents/SUMMARY.md +0 -24
- package/documents/TOOLS.md +0 -1282
- package/documents/USEOBSERVER.md +0 -26
- package/index.d.ts +0 -22
- package/types/cache.d.ts +0 -27
- package/types/idb.d.ts +0 -21
- package/types/jquery.d.ts +0 -20
- package/types/memorio.d.ts +0 -21
- package/types/observer.d.ts +0 -47
- package/types/session.d.ts +0 -67
- package/types/state.d.ts +0 -71
- package/types/store.d.ts +0 -91
- package/types/useobserver.d.ts +0 -28
package/documents/OBSERVER.md
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# Observer
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
This document provides a comprehensive list of all available observer functions in the `dphelper` library along with their descriptions and examples.
|
|
6
|
-
|
|
7
|
-
## Functions
|
|
8
|
-
|
|
9
|
-
### observer([state.name], [function])
|
|
10
|
-
|
|
11
|
-
- **Description:** Sets up an observer to monitor state changes and trigger a callback.
|
|
12
|
-
- **Parameters:**
|
|
13
|
-
- `stateName` (string): The name of the state to monitor.
|
|
14
|
-
- `callBack` (Function): The callback function to run when the state changes.
|
|
15
|
-
- `option` (object): Additional options for the observer.
|
|
16
|
-
- **Example:**
|
|
17
|
-
|
|
18
|
-
```javascript
|
|
19
|
-
observer('state.test', (newValue) => {
|
|
20
|
-
console.log('State changed:', newValue);
|
|
21
|
-
});
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### observer([state.name])
|
|
25
|
-
|
|
26
|
-
- **Description:** Recall the observer previously generated.
|
|
27
|
-
- **Returns:** Console log with a note
|
|
28
|
-
- **Example:**
|
|
29
|
-
|
|
30
|
-
```javascript
|
|
31
|
-
observer('state.test');
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### observer.list
|
|
35
|
-
|
|
36
|
-
- **Description:** See the list of all your observer (eventListener) actually installed.
|
|
37
|
-
- **Returns:** The list of all installed observers.
|
|
38
|
-
- **Example:**
|
|
39
|
-
|
|
40
|
-
```javascript
|
|
41
|
-
observer.list;
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### remove
|
|
45
|
-
|
|
46
|
-
- **Description:** Remove an observer.
|
|
47
|
-
- **Parameters:**
|
|
48
|
-
- `name` (string): The name of the observer to remove.
|
|
49
|
-
- **Example:**
|
|
50
|
-
|
|
51
|
-
```javascript
|
|
52
|
-
observer.remove('state.test');
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### removeAll
|
|
56
|
-
|
|
57
|
-
- **Description:** Remove all observers.
|
|
58
|
-
- **Returns:** void
|
|
59
|
-
- **Example:**
|
|
60
|
-
|
|
61
|
-
```javascript
|
|
62
|
-
observer.removeAll();
|
|
63
|
-
```
|
package/documents/SESSION.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# dpHelper Session
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
This document provides a comprehensive list of all available session functions in the `dphelper` library along with their descriptions and examples.
|
|
6
|
-
|
|
7
|
-
**Based on [Memorio](https://www.npmjs.com/package/memorio) by Dario Passariello** to manage STATE, STORE, SESSION and OBSERVER. You can use Memorio is you need only state management. DpHelper is indicate when you use a complete suite of tools.
|
|
8
|
-
|
|
9
|
-
## Functions
|
|
10
|
-
|
|
11
|
-
### session.get([session.name])
|
|
12
|
-
|
|
13
|
-
- **Description:** Retrieve an item from session storage.
|
|
14
|
-
- **Parameters:**
|
|
15
|
-
- `name` (string): The name of the item to retrieve.
|
|
16
|
-
- **Example:**
|
|
17
|
-
|
|
18
|
-
```javascript
|
|
19
|
-
const value = session.get('itemName');
|
|
20
|
-
console.log(value);
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### session.set([name, value])
|
|
24
|
-
|
|
25
|
-
- **Description:** Set an item in session storage.
|
|
26
|
-
- **Parameters:**
|
|
27
|
-
- `name` (string): The name of the item to set.
|
|
28
|
-
- `value` (any): The value of the item to set.
|
|
29
|
-
- **Example:**
|
|
30
|
-
|
|
31
|
-
```javascript
|
|
32
|
-
session.set('itemName', value);
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### session.remove([session.name])
|
|
36
|
-
|
|
37
|
-
- **Description:** Delete an item from session storage.
|
|
38
|
-
- **Parameters:**
|
|
39
|
-
- `name` (string): The name of the item to delete.
|
|
40
|
-
- **Example:**
|
|
41
|
-
|
|
42
|
-
```javascript
|
|
43
|
-
session.remove('itemName');
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### session.removeAll()
|
|
47
|
-
|
|
48
|
-
- **Description:** Remove all items from session storage.
|
|
49
|
-
- **Parameters:** None
|
|
50
|
-
- **Example:**
|
|
51
|
-
|
|
52
|
-
```javascript
|
|
53
|
-
session.removeAll();
|
|
54
|
-
```
|
package/documents/STATE.md
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# dpHelper State
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
This document provides a comprehensive list of all available state functions in the `dphelper` library along with their descriptions and examples.
|
|
6
|
-
|
|
7
|
-
**Based on [Memorio](https://www.npmjs.com/package/memorio) by Dario Passariello** to manage STATE, STORE, SESSION and OBSERVER. You can use Memorio is you need only state management. DpHelper is indicate when you use a complete suite of tools.
|
|
8
|
-
|
|
9
|
-
## Functions
|
|
10
|
-
|
|
11
|
-
### state.[state.name] ex: _state.test_
|
|
12
|
-
|
|
13
|
-
- **Description:** Set and get state values.
|
|
14
|
-
- **Example:**
|
|
15
|
-
|
|
16
|
-
```javascript
|
|
17
|
-
// To set a state value
|
|
18
|
-
state.name = 'value';
|
|
19
|
-
|
|
20
|
-
// To get a state value
|
|
21
|
-
const value = state.name;
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### state.list
|
|
25
|
-
|
|
26
|
-
- **Description:** Show all states out of proxy.
|
|
27
|
-
- **Example:**
|
|
28
|
-
|
|
29
|
-
```javascript
|
|
30
|
-
state.list;
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### state.remove([state.name])
|
|
34
|
-
|
|
35
|
-
- **Description:** Remove a state.
|
|
36
|
-
- **Parameters:**
|
|
37
|
-
- `name` (string): The name of the state to remove.
|
|
38
|
-
- **Example:**
|
|
39
|
-
|
|
40
|
-
```javascript
|
|
41
|
-
state.remove('stateName');
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### state.name.lock()
|
|
45
|
-
|
|
46
|
-
- **Description:** Lock a state (only for types: Array, Object).
|
|
47
|
-
- **Example:**
|
|
48
|
-
|
|
49
|
-
```javascript
|
|
50
|
-
state.name = {test:"test"}
|
|
51
|
-
state.name.lock();
|
|
52
|
-
"Now you can't add more data or remove it"
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### state.removeAll()
|
|
56
|
-
|
|
57
|
-
- **Description:** Remove all states.
|
|
58
|
-
- **Example:**
|
|
59
|
-
|
|
60
|
-
```javascript
|
|
61
|
-
state.name = {test:"test"}
|
|
62
|
-
state.removeAll();
|
|
63
|
-
"Now you can't see state.name (all states are removed)"
|
|
64
|
-
"Use for Log-out / Sign-out operation"
|
|
65
|
-
```
|
package/documents/STORE.md
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# dpHelper Store
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
This document provides a comprehensive list of all available store functions in the `dphelper` library along with their descriptions and examples.
|
|
6
|
-
|
|
7
|
-
**Based on [Memorio](https://www.npmjs.com/package/memorio) by Dario Passariello** to manage STATE, STORE, SESSION and OBSERVER. You can use Memorio is you need only state management. DpHelper is indicate when you use a complete suite of tools.
|
|
8
|
-
|
|
9
|
-
## Functions
|
|
10
|
-
|
|
11
|
-
### store.get([store.name])
|
|
12
|
-
|
|
13
|
-
- **Description:** Retrieve an item from local storage.
|
|
14
|
-
- **Parameters:**
|
|
15
|
-
- `name` (string): The name of the item to retrieve.
|
|
16
|
-
- **Example:**
|
|
17
|
-
|
|
18
|
-
```javascript
|
|
19
|
-
const value = store.get('itemName');
|
|
20
|
-
console.log(value);
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### store.set([name, value])
|
|
24
|
-
|
|
25
|
-
- **Description:** Set an item in local storage.
|
|
26
|
-
- **Parameters:**
|
|
27
|
-
- `name` (string): The name of the item to set.
|
|
28
|
-
- `value` (any): The value of the item to set.
|
|
29
|
-
- **Example:**
|
|
30
|
-
|
|
31
|
-
```javascript
|
|
32
|
-
store.set('itemName', value);
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### store.remove([store.name])
|
|
36
|
-
|
|
37
|
-
- **Description:** Delete an item from local storage.
|
|
38
|
-
- **Parameters:**
|
|
39
|
-
- `name` (string): The name of the item to delete.
|
|
40
|
-
- **Example:**
|
|
41
|
-
|
|
42
|
-
```javascript
|
|
43
|
-
store.remove('itemName');
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### store.removeAll()
|
|
47
|
-
|
|
48
|
-
- **Description:** Remove all items from local storage.
|
|
49
|
-
- **Parameters:** None
|
|
50
|
-
- **Example:**
|
|
51
|
-
|
|
52
|
-
```javascript
|
|
53
|
-
store.removeAll();
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### store.quota()
|
|
57
|
-
|
|
58
|
-
- **Description:** Estimate the storage quota and usage.
|
|
59
|
-
- **Parameters:** None
|
|
60
|
-
- **Example:**
|
|
61
|
-
|
|
62
|
-
```javascript
|
|
63
|
-
const quota = store.quota();
|
|
64
|
-
console.log(quota);
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### store.size()
|
|
68
|
-
|
|
69
|
-
- **Description:** Calculate the total size of all items in local storage.
|
|
70
|
-
- **Parameters:** None
|
|
71
|
-
- **Example:**
|
|
72
|
-
|
|
73
|
-
```javascript
|
|
74
|
-
const totalSize = store.size();
|
|
75
|
-
console.log(totalSize);
|
|
76
|
-
```
|
package/documents/SUMMARY.md
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Table of contents
|
|
2
|
-
|
|
3
|
-
* [dpHelper](README.md)
|
|
4
|
-
|
|
5
|
-
## General
|
|
6
|
-
|
|
7
|
-
* [State](/documents/STATE.md)
|
|
8
|
-
* [Observer](/documents/OBSERVER.md)
|
|
9
|
-
* [useObserver](/documents/USEOBSERVER.md)
|
|
10
|
-
* [Store](/documents/STORE.md)
|
|
11
|
-
* [Session](/documents/SESSION.md)
|
|
12
|
-
* [All Functions](/documents/TOOLS.md)
|
|
13
|
-
|
|
14
|
-
<!-- ## documents
|
|
15
|
-
|
|
16
|
-
* [License](LICENSE.md)
|
|
17
|
-
* [Contributing](CONTRIBUTING.md)
|
|
18
|
-
* [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
19
|
-
* [Security](SECURITY.md) -->
|
|
20
|
-
|
|
21
|
-
<!-- ## changes
|
|
22
|
-
|
|
23
|
-
* [Changelog](CAHNGELOG.md)
|
|
24
|
-
* [History](HISTORY.md) -->
|