memorio 2.6.6 → 2.7.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/README.md +102 -0
- package/examples/basic.ts +41 -1
- package/examples/browser-vanilla.html +358 -0
- package/examples/node-server.ts +308 -0
- package/examples/platform.ts +115 -0
- package/examples/react-app.tsx +357 -0
- package/examples/session-advanced.ts +13 -0
- package/examples/store-advanced.ts +13 -0
- package/index.cjs +331 -119
- package/index.js +331 -119
- package/package.json +17 -12
- package/types/memorio.d.ts +22 -0
- package/types/session.d.ts +7 -6
- package/types/state.d.ts +1 -6
- package/types/store.d.ts +6 -7
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memorio",
|
|
3
3
|
"code": "memorio",
|
|
4
|
-
"version": "2.
|
|
5
|
-
"description": "Memorio, State + Observer, Store and iDB for an easy life",
|
|
4
|
+
"version": "2.7.0",
|
|
5
|
+
"description": "Memorio, State + Observer, Store and iDB for an easy life - Cross-platform compatible",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"browser": "./index.cjs",
|
|
8
|
+
"module": "./index.js",
|
|
8
9
|
"types": "./index.d.ts",
|
|
9
10
|
"typing": "./types/*",
|
|
10
11
|
"homepage": "https://a51.gitbook.io/memorio",
|
|
@@ -22,15 +23,20 @@
|
|
|
22
23
|
}
|
|
23
24
|
],
|
|
24
25
|
"keywords": [
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
26
|
+
"state",
|
|
27
|
+
"observer",
|
|
28
|
+
"store",
|
|
29
|
+
"session",
|
|
30
|
+
"cache",
|
|
31
|
+
"idb",
|
|
32
|
+
"indexeddb",
|
|
33
|
+
"reactive",
|
|
34
|
+
"universal",
|
|
35
|
+
"cross-platform",
|
|
36
|
+
"node",
|
|
37
|
+
"deno",
|
|
38
|
+
"browser",
|
|
39
|
+
"frontend"
|
|
34
40
|
],
|
|
35
41
|
"funding": [
|
|
36
42
|
{
|
|
@@ -67,7 +73,6 @@
|
|
|
67
73
|
"optional": false
|
|
68
74
|
}
|
|
69
75
|
},
|
|
70
|
-
"module": "./index.js",
|
|
71
76
|
"exports": {
|
|
72
77
|
".": {
|
|
73
78
|
"import": "./index.js",
|
package/types/memorio.d.ts
CHANGED
|
@@ -25,6 +25,28 @@ interface _memorio {
|
|
|
25
25
|
_tracking?: boolean
|
|
26
26
|
_trackedPaths?: Set<string>
|
|
27
27
|
_locked?: boolean
|
|
28
|
+
// Platform properties
|
|
29
|
+
_platform?: string
|
|
30
|
+
_capabilities?: any
|
|
31
|
+
_sessionId?: string
|
|
32
|
+
_currentContext?: string
|
|
33
|
+
// Context management (for server-side isolation)
|
|
34
|
+
createContext?: (name?: string) => {
|
|
35
|
+
id: string
|
|
36
|
+
state: any
|
|
37
|
+
store: any
|
|
38
|
+
session: any
|
|
39
|
+
cache: any
|
|
40
|
+
}
|
|
41
|
+
listContexts?: () => string[]
|
|
42
|
+
deleteContext?: (id: string) => boolean
|
|
43
|
+
isolate?: (name?: string) => {
|
|
44
|
+
id: string
|
|
45
|
+
state: any
|
|
46
|
+
store: any
|
|
47
|
+
session: any
|
|
48
|
+
cache: any
|
|
49
|
+
}
|
|
28
50
|
}
|
|
29
51
|
|
|
30
52
|
type memorio = _memorio
|
package/types/session.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
memorio
|
|
3
|
-
Copyright (c) 2025 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
-
Licensed under Private License, see
|
|
5
|
-
https://dario.passariello.ca
|
|
6
|
-
*/
|
|
1
|
+
|
|
7
2
|
|
|
8
3
|
/**
|
|
9
4
|
* Create states using: session.set("example",{test:"test"})
|
|
@@ -94,6 +89,12 @@ interface _session {
|
|
|
94
89
|
*/
|
|
95
90
|
list?: () => object
|
|
96
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Check if using real persistent storage or fallback
|
|
94
|
+
* @since memorio 2.7.0
|
|
95
|
+
*/
|
|
96
|
+
isPersistent?: boolean
|
|
97
|
+
|
|
97
98
|
// TODO
|
|
98
99
|
// readonly increaseQuota: (value: number) => void
|
|
99
100
|
}
|
package/types/state.d.ts
CHANGED
package/types/store.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
memorio
|
|
3
|
-
Copyright (c) 2025 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
-
Licensed under Private License, see
|
|
5
|
-
https://dario.passariello.ca
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
1
|
/**
|
|
9
2
|
* Create states using: store.set("example",{test:"test"})
|
|
10
3
|
*/
|
|
@@ -94,6 +87,12 @@ interface _store {
|
|
|
94
87
|
*/
|
|
95
88
|
list?: () => object
|
|
96
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Check if using real persistent storage or fallback
|
|
92
|
+
* @since memorio 2.7.0
|
|
93
|
+
*/
|
|
94
|
+
isPersistent?: boolean
|
|
95
|
+
|
|
97
96
|
// TODO
|
|
98
97
|
// readonly increaseQuota: (value: number) => void
|
|
99
98
|
}
|