memorio 0.0.1 → 0.0.3
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/.editorconfig +31 -0
- package/.gitattributes +1 -0
- package/.vscode/extension.json +15 -0
- package/.vscode/settings.json +90 -0
- package/dist/package.json +88 -0
- package/esbuild.config.mjs +46 -0
- package/eslint.config.mjs +174 -0
- package/init.ts +7 -0
- package/package.json +14 -62
- package/tsconfig.json +65 -0
- package/types/memorio.d.ts +16 -0
- package/types/observer.d.ts +47 -0
- package/types/state.d.ts +71 -0
- package/types/store.d.ts +91 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
tab_width = 2
|
|
6
|
+
indent_size = 2
|
|
7
|
+
indent_style = space
|
|
8
|
+
end_of_line = CRLF
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
trim_trailing_whitespace = true
|
|
11
|
+
max_line_length = off
|
|
12
|
+
|
|
13
|
+
[*.md]
|
|
14
|
+
trim_trailing_whitespace = false
|
|
15
|
+
|
|
16
|
+
[*.js]
|
|
17
|
+
block_comment_start = /*
|
|
18
|
+
block_comment = *
|
|
19
|
+
block_comment_end = */
|
|
20
|
+
|
|
21
|
+
[*.yml]
|
|
22
|
+
indent_size = 1
|
|
23
|
+
|
|
24
|
+
[{*.json,Makefile}]
|
|
25
|
+
max_line_length = off
|
|
26
|
+
|
|
27
|
+
[test/{dotdot,resolver,module_dir,multirepo,node_path,pathfilter,precedence}/**/*]
|
|
28
|
+
indent_style = off
|
|
29
|
+
indent_size = off
|
|
30
|
+
max_line_length = off
|
|
31
|
+
insert_final_newline = off
|
package/.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* text=auto
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"alefragnani.project-manager",
|
|
4
|
+
"donjayamanne.githistory",
|
|
5
|
+
"mhutchie.git-graph",
|
|
6
|
+
"mgmcdermott.vscode-language-babel",
|
|
7
|
+
"eamodio.gitlens",
|
|
8
|
+
"ms-vscode.vscode-typescript-next",
|
|
9
|
+
"ms-vscode.js-debug-nightly",
|
|
10
|
+
"pkief.material-icon-theme",
|
|
11
|
+
"jock.svg",
|
|
12
|
+
"simonsiefke.svg-preview",
|
|
13
|
+
"dbaeumer.vscode-eslint"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"npm.exclude": [
|
|
3
|
+
"**/dist",
|
|
4
|
+
"**/out"
|
|
5
|
+
],
|
|
6
|
+
"editor.quickSuggestionsDelay": 2000,
|
|
7
|
+
"editor.quickSuggestions": {
|
|
8
|
+
"comments": "on",
|
|
9
|
+
"strings": "on",
|
|
10
|
+
"other": "on"
|
|
11
|
+
},
|
|
12
|
+
"editor.largeFileOptimizations": true,
|
|
13
|
+
"editor.formatOnType": true,
|
|
14
|
+
"editor.unicodeHighlight.invisibleCharacters": true,
|
|
15
|
+
"editor.unicodeHighlight.ambiguousCharacters": true,
|
|
16
|
+
"editor.unicodeHighlight.nonBasicASCII": true,
|
|
17
|
+
"editor.hover.enabled": true,
|
|
18
|
+
"editor.hover.delay": 2000,
|
|
19
|
+
"editor.codeLens": false,
|
|
20
|
+
"editor.tabCompletion": "off",
|
|
21
|
+
"editor.renderWhitespace": "all",
|
|
22
|
+
"editor.acceptSuggestionOnEnter": "on",
|
|
23
|
+
"editor.formatOnSave": true,
|
|
24
|
+
"editor.autoClosingBrackets": "always",
|
|
25
|
+
"editor.autoClosingOvertype": "always",
|
|
26
|
+
"editor.insertSpaces": true,
|
|
27
|
+
"editor.detectIndentation": false,
|
|
28
|
+
"editor.tabSize": 2,
|
|
29
|
+
"editor.bracketPairColorization.enabled": true,
|
|
30
|
+
"files.insertFinalNewline": true,
|
|
31
|
+
"files.trimFinalNewlines": true,
|
|
32
|
+
"files.trimTrailingWhitespace": true,
|
|
33
|
+
"javascript.format.semicolons": "remove",
|
|
34
|
+
"typescript.format.semicolons": "remove",
|
|
35
|
+
"typescript.referencesCodeLens.enabled": true,
|
|
36
|
+
"typescript.suggestionActions.enabled": false,
|
|
37
|
+
"javascript.suggestionActions.enabled": false,
|
|
38
|
+
"explorer.compactFolders": false,
|
|
39
|
+
"workbench.editor.limit.excludeDirty": true,
|
|
40
|
+
"workbench.editor.limit.enabled": true,
|
|
41
|
+
"workbench.editor.limit.perEditorGroup": true,
|
|
42
|
+
"workbench.editor.limit.value": 10,
|
|
43
|
+
"workbench.colorCustomizations": {
|
|
44
|
+
"editorBracketHighlight.foreground1": "#ffffff",
|
|
45
|
+
"editorBracketHighlight.foreground2": "#d8d0a4",
|
|
46
|
+
"editorBracketHighlight.foreground3": "#b46b6b",
|
|
47
|
+
"editorUnicodeHighlight.border": "#00ff37",
|
|
48
|
+
"editorUnicodeHighlight.background": "#f00",
|
|
49
|
+
"minimap.unicodeHighlight": "#ff0000"
|
|
50
|
+
},
|
|
51
|
+
"emmet.includeLanguages": {
|
|
52
|
+
"javascript": "html"
|
|
53
|
+
},
|
|
54
|
+
"terminal.integrated.defaultProfile.windows": "Git Bash",
|
|
55
|
+
"[*]": {
|
|
56
|
+
"editor.tabSize": 2,
|
|
57
|
+
"editor.insertSpaces": true
|
|
58
|
+
},
|
|
59
|
+
"[html]": {
|
|
60
|
+
"editor.defaultFormatter": "vscode.html-language-features",
|
|
61
|
+
"editor.foldingStrategy": "indentation"
|
|
62
|
+
},
|
|
63
|
+
"search.exclude": {
|
|
64
|
+
".editorconfig": true,
|
|
65
|
+
"**/.cache": true,
|
|
66
|
+
"**/.DS_Store": true,
|
|
67
|
+
"**/.git": true,
|
|
68
|
+
"**/.svg": true,
|
|
69
|
+
"**/.xml": true,
|
|
70
|
+
"**/bower_components": true,
|
|
71
|
+
"**/node_*": true,
|
|
72
|
+
"**/tmp": true,
|
|
73
|
+
"babel.config.js": true,
|
|
74
|
+
"node_modules": true,
|
|
75
|
+
"package-lock.json": true,
|
|
76
|
+
"**/dist": true,
|
|
77
|
+
"**/node_modules": true,
|
|
78
|
+
},
|
|
79
|
+
"files.exclude": {
|
|
80
|
+
".backup": true,
|
|
81
|
+
".archive": true,
|
|
82
|
+
"@OLD": true,
|
|
83
|
+
"#OLD": true,
|
|
84
|
+
"coverage": true,
|
|
85
|
+
"**/**/cmd.exe.lnk": true
|
|
86
|
+
},
|
|
87
|
+
"cSpell.words": [
|
|
88
|
+
"memorio"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "memorio",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "memorio",
|
|
5
|
+
"copyright": "Dario Passariello",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"deprecated": false,
|
|
8
|
+
"preferGlobal": true,
|
|
9
|
+
"target": "web",
|
|
10
|
+
"homepage": "https://a51.gitbook.io/memorio",
|
|
11
|
+
"author": {
|
|
12
|
+
"name": "Dario Passariello",
|
|
13
|
+
"url": "https://dario.passariello.ca/",
|
|
14
|
+
"email": "dariopassariello@gmail.com"
|
|
15
|
+
},
|
|
16
|
+
"support": {
|
|
17
|
+
"name": "Dario Passariello",
|
|
18
|
+
"url": "https://github.com/passariello/",
|
|
19
|
+
"email": "dariopassariello@gmail.com"
|
|
20
|
+
},
|
|
21
|
+
"npmName": "memorio",
|
|
22
|
+
"npmFileMap": [
|
|
23
|
+
{
|
|
24
|
+
"basePath": "/",
|
|
25
|
+
"files": [
|
|
26
|
+
"*.js"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"contributors": [
|
|
31
|
+
{
|
|
32
|
+
"name": "Dario Passariello",
|
|
33
|
+
"email": "dariopassarielloa@gmail.com"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "Valeria Cala Scaglitta",
|
|
37
|
+
"email": "valeriacalascaglitta@gmail.com"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"globals": {
|
|
41
|
+
"memorio": {}
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"memorio",
|
|
45
|
+
"state",
|
|
46
|
+
"store",
|
|
47
|
+
"observer",
|
|
48
|
+
"dario",
|
|
49
|
+
"passariello"
|
|
50
|
+
],
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "git+https://github.com/a51-dev/a51.memorio.git",
|
|
54
|
+
"help": "https://github.com/a51-dev/a51.memorio#readme"
|
|
55
|
+
},
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/a51-dev/a51.memorio/issues"
|
|
58
|
+
},
|
|
59
|
+
"funding": [
|
|
60
|
+
{
|
|
61
|
+
"type": "patreon",
|
|
62
|
+
"url": "https://www.patreon.com/passariello"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"typing": [
|
|
66
|
+
"types/*"
|
|
67
|
+
],
|
|
68
|
+
"scripts": {
|
|
69
|
+
"watch": "esbuild init.ts --bundle --outdir=dist --serve",
|
|
70
|
+
"build": "node ./esbuild.config.mjs",
|
|
71
|
+
"-----------": "",
|
|
72
|
+
"tsc": "tsc -b .",
|
|
73
|
+
"eslint": "eslint .",
|
|
74
|
+
"publish": "npm publish"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "8.39.1",
|
|
78
|
+
"@typescript-eslint/parser": "8.39.1",
|
|
79
|
+
"esbuild": "^0.25.9",
|
|
80
|
+
"esbuild-plugin-clean": "^1.0.1",
|
|
81
|
+
"esbuild-plugin-copy": "^2.1.1",
|
|
82
|
+
"eslint": "9.33.0",
|
|
83
|
+
"ts-loader": "^9.5.2",
|
|
84
|
+
"ts-node": "10.9.2",
|
|
85
|
+
"tslib": "^2.8.1",
|
|
86
|
+
"typescript": "5.9.2"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import esbuild from 'esbuild'
|
|
2
|
+
import { copy } from 'esbuild-plugin-copy'
|
|
3
|
+
import { clean } from 'esbuild-plugin-clean'
|
|
4
|
+
|
|
5
|
+
esbuild.build(
|
|
6
|
+
{
|
|
7
|
+
entryPoints: ['init.ts'],
|
|
8
|
+
outfile: 'dist/index.js',
|
|
9
|
+
legalComments: 'none',
|
|
10
|
+
color: true,
|
|
11
|
+
bundle: true,
|
|
12
|
+
minify: true,
|
|
13
|
+
sourcemap: false,
|
|
14
|
+
allowOverwrite: true,
|
|
15
|
+
plugins: [
|
|
16
|
+
clean(
|
|
17
|
+
{
|
|
18
|
+
patterns: [
|
|
19
|
+
'./dist/*'
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
copy(
|
|
24
|
+
{
|
|
25
|
+
assets: [
|
|
26
|
+
{
|
|
27
|
+
from: 'types/**/*',
|
|
28
|
+
to: './types'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
from: 'src/documents/**/*',
|
|
32
|
+
to: './'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
from: './package.json',
|
|
36
|
+
to: './package.json'
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
.catch(
|
|
45
|
+
() => process.exit(1)
|
|
46
|
+
)
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import tseslint from '@typescript-eslint/eslint-plugin'
|
|
2
|
+
import tsparser from '@typescript-eslint/parser'
|
|
3
|
+
import { defineConfig } from "eslint/config"
|
|
4
|
+
|
|
5
|
+
export default defineConfig([
|
|
6
|
+
{
|
|
7
|
+
ignores: [
|
|
8
|
+
'**/node_modules/**',
|
|
9
|
+
'**/dist/**',
|
|
10
|
+
'**/build/**',
|
|
11
|
+
'**/coverage/**',
|
|
12
|
+
'**/assets/**',
|
|
13
|
+
'**/types/*.d.ts',
|
|
14
|
+
'**/*.min.js',
|
|
15
|
+
'**/documents/**'
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
// Base configuration for all files
|
|
19
|
+
{
|
|
20
|
+
languageOptions: {
|
|
21
|
+
ecmaVersion: 'latest',
|
|
22
|
+
sourceType: 'module',
|
|
23
|
+
globals: {
|
|
24
|
+
a51dev: 'writable',
|
|
25
|
+
process: 'readonly',
|
|
26
|
+
global: 'writable',
|
|
27
|
+
module: 'writable',
|
|
28
|
+
require: 'readonly',
|
|
29
|
+
console: 'readonly',
|
|
30
|
+
__dirname: 'readonly',
|
|
31
|
+
__filename: 'readonly'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
linterOptions: {
|
|
35
|
+
reportUnusedDisableDirectives: true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
// JavaScript files configuration
|
|
39
|
+
{
|
|
40
|
+
files: ['**/*.js', '**/*.mjs', '**/*.cjs'],
|
|
41
|
+
languageOptions: {
|
|
42
|
+
ecmaVersion: 'latest',
|
|
43
|
+
sourceType: 'module'
|
|
44
|
+
},
|
|
45
|
+
rules: {
|
|
46
|
+
'no-var': 'off',
|
|
47
|
+
'no-console': 'off',
|
|
48
|
+
'no-undef': 'off', // Disable undefined variable checking for JS files
|
|
49
|
+
'no-unused-vars': 'warn', // Make unused vars warnings instead of errors
|
|
50
|
+
'semi': ['error', 'never']
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
// TypeScript files configuration
|
|
54
|
+
{
|
|
55
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
56
|
+
plugins: {
|
|
57
|
+
'@typescript-eslint': tseslint
|
|
58
|
+
},
|
|
59
|
+
languageOptions: {
|
|
60
|
+
parser: tsparser,
|
|
61
|
+
parserOptions: {
|
|
62
|
+
ecmaVersion: 'latest',
|
|
63
|
+
sourceType: 'module'
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
rules: {
|
|
67
|
+
'no-var': 'off',
|
|
68
|
+
'no-console': 'off',
|
|
69
|
+
'no-undef': 'off', // TypeScript handles this better
|
|
70
|
+
'no-unused-vars': 'off', // Use the TypeScript specific version instead
|
|
71
|
+
'semi': ['error', 'never'],
|
|
72
|
+
'@typescript-eslint/no-unused-vars': 'warn',
|
|
73
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
74
|
+
'@typescript-eslint/no-var-requires': 'off'
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
// Jest test files
|
|
78
|
+
{
|
|
79
|
+
files: ['**/*.test.js', '**/*.test.ts', '**/*.spec.js', '**/*.spec.ts'],
|
|
80
|
+
languageOptions: {
|
|
81
|
+
globals: {
|
|
82
|
+
jest: 'readonly',
|
|
83
|
+
describe: 'readonly',
|
|
84
|
+
it: 'readonly',
|
|
85
|
+
expect: 'readonly',
|
|
86
|
+
beforeEach: 'readonly',
|
|
87
|
+
beforeAll: 'readonly',
|
|
88
|
+
afterEach: 'readonly',
|
|
89
|
+
afterAll: 'readonly',
|
|
90
|
+
test: 'readonly',
|
|
91
|
+
spyOn: 'readonly'
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
rules: {
|
|
95
|
+
'no-undef': 'off' // Jest globals are defined above
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
rules: {
|
|
100
|
+
"no-var": 0,
|
|
101
|
+
"no-empty": 0,
|
|
102
|
+
"no-console": 0,
|
|
103
|
+
"no-process-exit": 0,
|
|
104
|
+
"no-underscore-dangle": 0,
|
|
105
|
+
"no-param-reassign": 0,
|
|
106
|
+
"no-prototype-builtins": 0,
|
|
107
|
+
"no-unused-vars": 0,
|
|
108
|
+
"no-undef": 0,
|
|
109
|
+
"no-debugger": 0,
|
|
110
|
+
"no-dupe-else-if": 0,
|
|
111
|
+
"no-useless-escape": 0,
|
|
112
|
+
"node/no-extraneous-require": 0,
|
|
113
|
+
"node/no-unpublished-require": 0,
|
|
114
|
+
"node/no-unsupported-features/es-syntax": 0,
|
|
115
|
+
"node/no-missing-import": 0,
|
|
116
|
+
"node/no-unpublished-import": 0,
|
|
117
|
+
"node/no-unsupported-features/node-builtins": 0,
|
|
118
|
+
"node/no-missing-require": 0,
|
|
119
|
+
"react/prop-types": 0,
|
|
120
|
+
"react/no-string-refs": 0,
|
|
121
|
+
"react/no-find-dom-node": 0,
|
|
122
|
+
"react/display-name": 0,
|
|
123
|
+
"react/jsx-no-undef": 0,
|
|
124
|
+
"promise/no-nesting": 0,
|
|
125
|
+
"promise/no-callback-in-promise": 0,
|
|
126
|
+
"promise/always-return": 0,
|
|
127
|
+
"promise/catch-or-return": 0,
|
|
128
|
+
"promise/no-return-wrap": 0,
|
|
129
|
+
"promise/valid-params": 0,
|
|
130
|
+
"import/export": 0,
|
|
131
|
+
"import/namespace": 0,
|
|
132
|
+
"import/default": 0,
|
|
133
|
+
"import/no-named-as-default": 0,
|
|
134
|
+
"import/no-named-as-default-member": 0,
|
|
135
|
+
"import/no-mutable-exports": 0,
|
|
136
|
+
"import/no-extraneous-dependencies": 0,
|
|
137
|
+
"import/no-unresolved": 0,
|
|
138
|
+
"import/no-duplicates": 0,
|
|
139
|
+
"import/named": 0,
|
|
140
|
+
"@typescript-eslint/no-var-requires": 0,
|
|
141
|
+
"@typescript-eslint/no-unused-vars": 0,
|
|
142
|
+
"@typescript-eslint/no-empty-function": 0,
|
|
143
|
+
"@typescript-eslint/no-explicit-any": 0,
|
|
144
|
+
"consistent-return": 0,
|
|
145
|
+
"unicorn/no-process-exit": 0,
|
|
146
|
+
"comma-dangle": [
|
|
147
|
+
"error",
|
|
148
|
+
"never"
|
|
149
|
+
],
|
|
150
|
+
"prefer-const": [
|
|
151
|
+
"warn"
|
|
152
|
+
],
|
|
153
|
+
"semi": [
|
|
154
|
+
"error",
|
|
155
|
+
"never"
|
|
156
|
+
],
|
|
157
|
+
"max-nested-callbacks": [
|
|
158
|
+
"warn",
|
|
159
|
+
4
|
|
160
|
+
],
|
|
161
|
+
"no-plusplus": 0,
|
|
162
|
+
"operator-linebreak": [
|
|
163
|
+
"error",
|
|
164
|
+
"after",
|
|
165
|
+
{
|
|
166
|
+
"overrides": {
|
|
167
|
+
"?": "ignore",
|
|
168
|
+
":": "ignore"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
])
|
package/init.ts
ADDED
package/package.json
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memorio",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "memorio",
|
|
5
5
|
"copyright": "Dario Passariello",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"folder": "/",
|
|
8
|
-
"main": "dist/index.js",
|
|
9
7
|
"deprecated": false,
|
|
10
8
|
"preferGlobal": true,
|
|
11
9
|
"target": "web",
|
|
@@ -20,11 +18,14 @@
|
|
|
20
18
|
"url": "https://github.com/passariello/",
|
|
21
19
|
"email": "dariopassariello@gmail.com"
|
|
22
20
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
"npmName": "memorio",
|
|
22
|
+
"npmFileMap": [
|
|
23
|
+
{
|
|
24
|
+
"basePath": "/",
|
|
25
|
+
"files": [
|
|
26
|
+
"*.js"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
28
29
|
],
|
|
29
30
|
"contributors": [
|
|
30
31
|
{
|
|
@@ -36,45 +37,9 @@
|
|
|
36
37
|
"email": "valeriacalascaglitta@gmail.com"
|
|
37
38
|
}
|
|
38
39
|
],
|
|
39
|
-
"workspaces": [
|
|
40
|
-
".tools"
|
|
41
|
-
],
|
|
42
|
-
"npmName": "memorio",
|
|
43
|
-
"npmFileMap": [
|
|
44
|
-
{
|
|
45
|
-
"basePath": "./dist/",
|
|
46
|
-
"files": [
|
|
47
|
-
"*.js"
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
40
|
"globals": {
|
|
52
41
|
"memorio": {}
|
|
53
42
|
},
|
|
54
|
-
"browserslist": {
|
|
55
|
-
"production": [
|
|
56
|
-
"last 2 Chrome major versions",
|
|
57
|
-
"last 2 Firefox major versions",
|
|
58
|
-
"last 2 Safari major versions",
|
|
59
|
-
"last 2 Edge major versions",
|
|
60
|
-
"last 2 Opera versions",
|
|
61
|
-
"last 2 iOS major versions",
|
|
62
|
-
"last 1 Explorer major version",
|
|
63
|
-
"last 1 ChromeAndroid version",
|
|
64
|
-
"last 1 UCAndroid version",
|
|
65
|
-
"last 1 Samsung version",
|
|
66
|
-
"last 1 OperaMini version",
|
|
67
|
-
"Firefox ESR",
|
|
68
|
-
">0.2%",
|
|
69
|
-
"not dead",
|
|
70
|
-
"not op_mini all"
|
|
71
|
-
],
|
|
72
|
-
"development": [
|
|
73
|
-
"last 1 chrome version",
|
|
74
|
-
"last 1 firefox version",
|
|
75
|
-
"last 1 safari version"
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
43
|
"keywords": [
|
|
79
44
|
"memorio",
|
|
80
45
|
"state",
|
|
@@ -85,11 +50,11 @@
|
|
|
85
50
|
],
|
|
86
51
|
"repository": {
|
|
87
52
|
"type": "git",
|
|
88
|
-
"url": "git+https://github.com/a51-dev/a51.memorio.
|
|
89
|
-
"help": "https://github.com/a51-dev/a51.memorio
|
|
53
|
+
"url": "git+https://github.com/a51-dev/a51.memorio.git",
|
|
54
|
+
"help": "https://github.com/a51-dev/a51.memorio#readme"
|
|
90
55
|
},
|
|
91
56
|
"bugs": {
|
|
92
|
-
"url": "https://github.com/a51-dev/a51.memorio
|
|
57
|
+
"url": "https://github.com/a51-dev/a51.memorio/issues"
|
|
93
58
|
},
|
|
94
59
|
"funding": [
|
|
95
60
|
{
|
|
@@ -105,21 +70,8 @@
|
|
|
105
70
|
"build": "node ./esbuild.config.mjs",
|
|
106
71
|
"-----------": "",
|
|
107
72
|
"tsc": "tsc -b .",
|
|
108
|
-
"eslint": "eslint ."
|
|
109
|
-
|
|
110
|
-
"engines": {
|
|
111
|
-
"node": ">=18",
|
|
112
|
-
"pnpm": ">=10"
|
|
113
|
-
},
|
|
114
|
-
"types": "./index.d.ts",
|
|
115
|
-
"typings": "./types/*",
|
|
116
|
-
"exports": {
|
|
117
|
-
".": {
|
|
118
|
-
"types": "./index.d.ts",
|
|
119
|
-
"default": "./index.js"
|
|
120
|
-
},
|
|
121
|
-
"./package.json": "./package.json",
|
|
122
|
-
"./*": "./*"
|
|
73
|
+
"eslint": "eslint .",
|
|
74
|
+
"publish": "npm publish"
|
|
123
75
|
},
|
|
124
76
|
"devDependencies": {
|
|
125
77
|
"@typescript-eslint/eslint-plugin": "8.39.1",
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"strict": true,
|
|
4
|
+
"noEmit": false,
|
|
5
|
+
"noImplicitThis": false,
|
|
6
|
+
"noUnusedLocals": true,
|
|
7
|
+
"importHelpers": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"allowSyntheticDefaultImports": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"noImplicitAny": false,
|
|
13
|
+
"preserveConstEnums": true,
|
|
14
|
+
"removeComments": true,
|
|
15
|
+
"sourceMap": false,
|
|
16
|
+
"allowJs": true,
|
|
17
|
+
"esModuleInterop": true,
|
|
18
|
+
"strictNullChecks": false,
|
|
19
|
+
"strictPropertyInitialization": false,
|
|
20
|
+
"jsx": "react",
|
|
21
|
+
"moduleDetection": "force",
|
|
22
|
+
"module": "CommonJS",
|
|
23
|
+
"baseUrl": ".",
|
|
24
|
+
"outDir": "./dist/",
|
|
25
|
+
"moduleResolution": "classic",
|
|
26
|
+
"composite": false,
|
|
27
|
+
"incremental": false,
|
|
28
|
+
"tsBuildInfoFile": null,
|
|
29
|
+
"checkJs": true,
|
|
30
|
+
"declaration": false,
|
|
31
|
+
"inlineSourceMap": false,
|
|
32
|
+
"experimentalDecorators": true,
|
|
33
|
+
"emitDecoratorMetadata": false,
|
|
34
|
+
"target": "ES2022",
|
|
35
|
+
"lib": [
|
|
36
|
+
"ES2022",
|
|
37
|
+
"dom"
|
|
38
|
+
],
|
|
39
|
+
"rootDirs": [
|
|
40
|
+
"./"
|
|
41
|
+
],
|
|
42
|
+
"paths": {
|
|
43
|
+
"/*": [
|
|
44
|
+
"./*"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"include": [
|
|
49
|
+
"./**/*.ts*"
|
|
50
|
+
],
|
|
51
|
+
"typeRoots": [
|
|
52
|
+
"./types/*"
|
|
53
|
+
],
|
|
54
|
+
"exclude": [
|
|
55
|
+
"node_modules",
|
|
56
|
+
"private",
|
|
57
|
+
"archive",
|
|
58
|
+
"*backup",
|
|
59
|
+
"dist",
|
|
60
|
+
".old*",
|
|
61
|
+
".OLD*",
|
|
62
|
+
"#OLD*",
|
|
63
|
+
"@OLD*",
|
|
64
|
+
]
|
|
65
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
interface memorio { }
|
|
3
|
+
|
|
4
|
+
declare var memorio: _memorio
|
|
5
|
+
type memorio = _memorio
|
|
6
|
+
|
|
7
|
+
declare var arguments: any
|
|
8
|
+
type arguments = any
|
|
9
|
+
|
|
10
|
+
/////////////////////////////////////////////
|
|
11
|
+
|
|
12
|
+
interface Descr {
|
|
13
|
+
name: string,
|
|
14
|
+
active: boolean,
|
|
15
|
+
subCommand: Array<SubCommand>,
|
|
16
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
memorio
|
|
3
|
+
Copyright (c) 2025 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
+
Licensed under MIT License, see
|
|
5
|
+
https://dario.passariello.ca
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Observer run a callback anytime the associated state going to change
|
|
10
|
+
* @return Execution of function after state change.
|
|
11
|
+
*/
|
|
12
|
+
interface _observer {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Generate your observer
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* observer("myState", Function)
|
|
19
|
+
*
|
|
20
|
+
* @since memorio 1.0.6
|
|
21
|
+
*/
|
|
22
|
+
(stateName: string, callBack: any): any
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* List of active observers
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* observer.list()
|
|
29
|
+
*
|
|
30
|
+
* @since memorio 1.0.6
|
|
31
|
+
*/
|
|
32
|
+
readonly list?: () => void
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Remove the active observer (not the state)
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* observer.remove("myState")
|
|
39
|
+
*
|
|
40
|
+
* @since memorio 1.0.6
|
|
41
|
+
*/
|
|
42
|
+
readonly remove?: (name: string, callBack?: any, flag?: boolean) => void
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare var observer: _observer
|
|
47
|
+
type observer = _observer
|
package/types/state.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
memorio
|
|
3
|
+
Copyright (c) 2025 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
+
Licensed under MIT License, see
|
|
5
|
+
https://dario.passariello.ca
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* If you use only "state" you get the entire Proxy object
|
|
10
|
+
* @return Proxy Object of all states.
|
|
11
|
+
*/
|
|
12
|
+
interface _state {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Create states using: state.test = "example"
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* state.myStuff = any
|
|
19
|
+
*
|
|
20
|
+
* @since memorio 0.0.1
|
|
21
|
+
* @param key The name of the state for which you want to modify the action.
|
|
22
|
+
* @return The previous values (Any).
|
|
23
|
+
* Important: Object is a Proxy.
|
|
24
|
+
*/
|
|
25
|
+
[key: string]: any
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Delete entire state using: state.remove("test")
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* state.remove(stateName)
|
|
32
|
+
*
|
|
33
|
+
* @since memorio 0.0.1
|
|
34
|
+
* @param stateName The name of the state for which you want to delete.
|
|
35
|
+
* @return boolean.
|
|
36
|
+
*/
|
|
37
|
+
readonly remove?: (stateName: string) => any
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* List all states using: state.list
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* state.removeAll()
|
|
44
|
+
*
|
|
45
|
+
* @since memorio 1.8.92
|
|
46
|
+
* @return Remove all states.
|
|
47
|
+
*/
|
|
48
|
+
readonly removeAll?: () => any
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* List all states using: state.list
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* state.list
|
|
55
|
+
*
|
|
56
|
+
* @since memorio 0.0.1
|
|
57
|
+
* @return Object of all states (Not the Proxy).
|
|
58
|
+
*/
|
|
59
|
+
readonly list?: (stateName: string) => any
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Generate a message for "memorio"
|
|
63
|
+
* Note: FOR INTERNAL USE ONLY.
|
|
64
|
+
* @since memorio 0.0.1
|
|
65
|
+
*/
|
|
66
|
+
readonly mex?: any
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare var state: _state
|
|
71
|
+
type state = _state
|
package/types/store.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
memorio
|
|
3
|
+
Copyright (c) 2025 Dario Passariello <dariopassariello@gmail.com>
|
|
4
|
+
Licensed under MIT License, see
|
|
5
|
+
https://dario.passariello.ca
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Create states using: store.set("example",{test:"test"})
|
|
10
|
+
*/
|
|
11
|
+
interface _store {
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Create a new store
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* store.set("test","example") // or Array, Object, Number, Functions...
|
|
18
|
+
*
|
|
19
|
+
* @since memorio 0.0.1
|
|
20
|
+
* @param name The String as name to define the store.
|
|
21
|
+
* @param param The information taht you want to store (Any).
|
|
22
|
+
* @return boolean
|
|
23
|
+
*/
|
|
24
|
+
set: (name: string, value: any) => void
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Have back the data from a store.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* store.get("test")
|
|
31
|
+
*
|
|
32
|
+
* @since memorio 0.0.1
|
|
33
|
+
* @param name The String as name to define the store.
|
|
34
|
+
*/
|
|
35
|
+
get: (name: string) => any
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Delete an existing store:
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* store.delete("test")
|
|
42
|
+
* store.remove("test")
|
|
43
|
+
*
|
|
44
|
+
* @since memorio 0.0.1
|
|
45
|
+
* @param name The String as name to define the store.
|
|
46
|
+
* @return boolean
|
|
47
|
+
*/
|
|
48
|
+
delete: (name: string) => boolean | undefined
|
|
49
|
+
remove: (name: string) => boolean | undefined
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Delete all storages
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* store.clearAll()
|
|
56
|
+
* store.removeAll()
|
|
57
|
+
*
|
|
58
|
+
* @since memorio 0.0.1
|
|
59
|
+
* @return boolean
|
|
60
|
+
*/
|
|
61
|
+
clearAll: () => boolean
|
|
62
|
+
removeAll: () => boolean
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Know how much space you have for total storages
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* store.quota()
|
|
69
|
+
*
|
|
70
|
+
* @since memorio 0.0.1
|
|
71
|
+
* @return values
|
|
72
|
+
*/
|
|
73
|
+
quota: () => void
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Get the size of stores an the total
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* store.size()
|
|
80
|
+
*
|
|
81
|
+
* @since memorio 0.0.1
|
|
82
|
+
* @return dimension in kb
|
|
83
|
+
*/
|
|
84
|
+
size: () => number
|
|
85
|
+
|
|
86
|
+
// TODO
|
|
87
|
+
// readonly increaseQuota: (value: number) => void
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare var store: _store
|
|
91
|
+
type store = _store
|