@mgarlik/datastore 0.1.0 → 0.1.2
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 +28 -1
- package/dist/chunk-7XDRKNJQ.js +14 -0
- package/dist/chunk-7XDRKNJQ.js.map +1 -0
- package/dist/expo-sqlite.cjs +210 -0
- package/dist/expo-sqlite.cjs.map +1 -0
- package/dist/expo-sqlite.d.cts +31 -0
- package/dist/expo-sqlite.d.ts +31 -0
- package/dist/expo-sqlite.js +166 -0
- package/dist/expo-sqlite.js.map +1 -0
- package/dist/index.cjs +990 -1097
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -75
- package/dist/index.d.ts +117 -75
- package/dist/index.js +1005 -1101
- package/dist/index.js.map +1 -1
- package/dist/storage-D_xv8gFb.d.cts +18 -0
- package/dist/storage-D_xv8gFb.d.ts +18 -0
- package/package.json +16 -6
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstrakce perzistentní vrstvy používané DataStorem.
|
|
3
|
+
*
|
|
4
|
+
* Implementace může používat SQLite, IndexedDB, in-memory úložiště
|
|
5
|
+
* nebo jiný backend podporující SQL-like read/query operace.
|
|
6
|
+
*/
|
|
7
|
+
interface DataStoreStorage {
|
|
8
|
+
/** Provede read-only dotaz a vrátí namapované řádky. */
|
|
9
|
+
read<T>(query: string, args?: unknown): Promise<T[]>;
|
|
10
|
+
/** Provede dotaz, který může měnit data, a volitelně vrátí řádky. */
|
|
11
|
+
query<T>(query: string, args?: unknown): Promise<T[]>;
|
|
12
|
+
/** Smaže všechny řádky z dané tabulky. */
|
|
13
|
+
emptyTable?(table: string): Promise<unknown>;
|
|
14
|
+
/** Znovu vytvoří nebo vyčistí podkladovou databázi. */
|
|
15
|
+
resetDatabase?(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type { DataStoreStorage as D };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstrakce perzistentní vrstvy používané DataStorem.
|
|
3
|
+
*
|
|
4
|
+
* Implementace může používat SQLite, IndexedDB, in-memory úložiště
|
|
5
|
+
* nebo jiný backend podporující SQL-like read/query operace.
|
|
6
|
+
*/
|
|
7
|
+
interface DataStoreStorage {
|
|
8
|
+
/** Provede read-only dotaz a vrátí namapované řádky. */
|
|
9
|
+
read<T>(query: string, args?: unknown): Promise<T[]>;
|
|
10
|
+
/** Provede dotaz, který může měnit data, a volitelně vrátí řádky. */
|
|
11
|
+
query<T>(query: string, args?: unknown): Promise<T[]>;
|
|
12
|
+
/** Smaže všechny řádky z dané tabulky. */
|
|
13
|
+
emptyTable?(table: string): Promise<unknown>;
|
|
14
|
+
/** Znovu vytvoří nebo vyčistí podkladovou databázi. */
|
|
15
|
+
resetDatabase?(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type { DataStoreStorage as D };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgarlik/datastore",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Full DataStoreProvider package extracted from src/dataStore with REST and Socket support.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"import": "./dist/index.js",
|
|
17
17
|
"require": "./dist/index.cjs"
|
|
18
|
+
},
|
|
19
|
+
"./expo-sqlite": {
|
|
20
|
+
"types": "./dist/expo-sqlite.d.ts",
|
|
21
|
+
"import": "./dist/expo-sqlite.js",
|
|
22
|
+
"require": "./dist/expo-sqlite.cjs"
|
|
18
23
|
}
|
|
19
24
|
},
|
|
20
25
|
"files": [
|
|
@@ -23,16 +28,20 @@
|
|
|
23
28
|
"LICENSE"
|
|
24
29
|
],
|
|
25
30
|
"scripts": {
|
|
26
|
-
"build": "tsup src/index.ts --dts --format esm,cjs --sourcemap --external react --external react-native --external expo-
|
|
31
|
+
"build": "tsup src/index.ts src/expo-sqlite.ts --clean --dts --format esm,cjs --sourcemap --external react --external react-native --external expo-sqlite",
|
|
32
|
+
"docs": "typedoc --options typedoc.json",
|
|
27
33
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
28
34
|
"prepublishOnly": "npm run typecheck && npm run build"
|
|
29
35
|
},
|
|
30
36
|
"peerDependencies": {
|
|
37
|
+
"expo-sqlite": ">=14",
|
|
31
38
|
"react": ">=18",
|
|
32
|
-
"react-native": ">=0.73"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"expo-sqlite":
|
|
39
|
+
"react-native": ">=0.73"
|
|
40
|
+
},
|
|
41
|
+
"peerDependenciesMeta": {
|
|
42
|
+
"expo-sqlite": {
|
|
43
|
+
"optional": true
|
|
44
|
+
}
|
|
36
45
|
},
|
|
37
46
|
"dependencies": {
|
|
38
47
|
"axios": "^1.14.0",
|
|
@@ -42,6 +51,7 @@
|
|
|
42
51
|
},
|
|
43
52
|
"devDependencies": {
|
|
44
53
|
"@types/react": "^19.1.0",
|
|
54
|
+
"typedoc": "^0.28.13",
|
|
45
55
|
"tsup": "^8.5.1",
|
|
46
56
|
"typescript": "^5.9.2"
|
|
47
57
|
}
|