react-native-nitro-storage 0.5.8 → 0.6.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/CHANGELOG.md +384 -0
- package/README.md +178 -10
- package/android/src/main/AndroidManifest.xml +9 -0
- package/android/src/main/java/com/nitrostorage/NitroStorageInitializer.kt +38 -0
- package/app.plugin.js +3 -47
- package/cpp/bindings/HybridStorage.cpp +25 -9
- package/cpp/bindings/HybridStorage.hpp +5 -0
- package/lib/commonjs/index.js +19 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +19 -2
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/shared.js.map +1 -1
- package/lib/commonjs/storage-core.js +306 -10
- package/lib/commonjs/storage-core.js.map +1 -1
- package/lib/commonjs/storage-events.js.map +1 -1
- package/lib/commonjs/storage-hooks.js +16 -1
- package/lib/commonjs/storage-hooks.js.map +1 -1
- package/lib/commonjs/testing.js +267 -0
- package/lib/commonjs/testing.js.map +1 -0
- package/lib/module/index.js +5 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +5 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/shared.js.map +1 -1
- package/lib/module/storage-core.js +307 -11
- package/lib/module/storage-core.js.map +1 -1
- package/lib/module/storage-events.js.map +1 -1
- package/lib/module/storage-hooks.js +15 -2
- package/lib/module/storage-hooks.js.map +1 -1
- package/lib/module/testing.js +188 -0
- package/lib/module/testing.js.map +1 -0
- package/lib/typescript/index.d.ts +22 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/index.web.d.ts +22 -4
- package/lib/typescript/index.web.d.ts.map +1 -1
- package/lib/typescript/shared.d.ts +1 -0
- package/lib/typescript/shared.d.ts.map +1 -1
- package/lib/typescript/storage-core.d.ts +51 -2
- package/lib/typescript/storage-core.d.ts.map +1 -1
- package/lib/typescript/storage-events.d.ts +1 -1
- package/lib/typescript/storage-events.d.ts.map +1 -1
- package/lib/typescript/storage-hooks.d.ts +18 -1
- package/lib/typescript/storage-hooks.d.ts.map +1 -1
- package/lib/typescript/testing.d.ts +148 -0
- package/lib/typescript/testing.d.ts.map +1 -0
- package/package.json +8 -1
- package/src/index.ts +16 -2
- package/src/index.web.ts +16 -2
- package/src/shared.ts +1 -0
- package/src/storage-core.ts +446 -11
- package/src/storage-events.ts +2 -0
- package/src/storage-hooks.ts +42 -3
- package/src/testing.ts +270 -0
package/src/index.ts
CHANGED
|
@@ -58,7 +58,7 @@ export type {
|
|
|
58
58
|
StorageEventListener,
|
|
59
59
|
StorageKeyChangeEvent,
|
|
60
60
|
} from "./storage-events";
|
|
61
|
-
export type { StorageSetter } from "./storage-hooks";
|
|
61
|
+
export type { StorageActions, StorageSetter } from "./storage-hooks";
|
|
62
62
|
export type {
|
|
63
63
|
WebDiskStorageBackend,
|
|
64
64
|
WebSecureStorageBackend,
|
|
@@ -67,9 +67,13 @@ export type {
|
|
|
67
67
|
WebStorageScope,
|
|
68
68
|
} from "./web-storage-backend";
|
|
69
69
|
export type {
|
|
70
|
+
SetItemConfig,
|
|
71
|
+
SetStorageItem,
|
|
70
72
|
StorageBatchSetItem,
|
|
73
|
+
StorageClearOptions,
|
|
71
74
|
StorageItem,
|
|
72
75
|
StorageItemConfig,
|
|
76
|
+
StorageKeyRef,
|
|
73
77
|
TransactionContext,
|
|
74
78
|
} from "./storage-core";
|
|
75
79
|
|
|
@@ -307,6 +311,10 @@ export const storage = {
|
|
|
307
311
|
};
|
|
308
312
|
|
|
309
313
|
export const createStorageItem = core.createStorageItem;
|
|
314
|
+
export const memoryItem = core.memoryItem;
|
|
315
|
+
export const diskItem = core.diskItem;
|
|
316
|
+
export const secureItem = core.secureItem;
|
|
317
|
+
export const createSetItem = core.createSetItem;
|
|
310
318
|
export const getBatch = core.getBatch;
|
|
311
319
|
export const setBatch = core.setBatch;
|
|
312
320
|
export const removeBatch = core.removeBatch;
|
|
@@ -341,5 +349,11 @@ export async function flushWebStorageBackends(): Promise<void> {
|
|
|
341
349
|
// Native platforms do not use web storage backends.
|
|
342
350
|
}
|
|
343
351
|
|
|
344
|
-
export {
|
|
352
|
+
export {
|
|
353
|
+
useSetStorage,
|
|
354
|
+
useStorage,
|
|
355
|
+
useStorageActions,
|
|
356
|
+
useStorageSelector,
|
|
357
|
+
useStorageValue,
|
|
358
|
+
} from "./storage-hooks";
|
|
345
359
|
export { createIndexedDBBackend } from "./indexeddb-backend";
|
package/src/index.web.ts
CHANGED
|
@@ -57,7 +57,7 @@ export type {
|
|
|
57
57
|
StorageEventListener,
|
|
58
58
|
StorageKeyChangeEvent,
|
|
59
59
|
} from "./storage-events";
|
|
60
|
-
export type { StorageSetter } from "./storage-hooks";
|
|
60
|
+
export type { StorageActions, StorageSetter } from "./storage-hooks";
|
|
61
61
|
export type {
|
|
62
62
|
WebDiskStorageBackend,
|
|
63
63
|
WebSecureStorageBackend,
|
|
@@ -66,9 +66,13 @@ export type {
|
|
|
66
66
|
WebStorageScope,
|
|
67
67
|
} from "./web-storage-backend";
|
|
68
68
|
export type {
|
|
69
|
+
SetItemConfig,
|
|
70
|
+
SetStorageItem,
|
|
69
71
|
StorageBatchSetItem,
|
|
72
|
+
StorageClearOptions,
|
|
70
73
|
StorageItem,
|
|
71
74
|
StorageItemConfig,
|
|
75
|
+
StorageKeyRef,
|
|
72
76
|
TransactionContext,
|
|
73
77
|
} from "./storage-core";
|
|
74
78
|
|
|
@@ -818,6 +822,10 @@ export const storage = {
|
|
|
818
822
|
};
|
|
819
823
|
|
|
820
824
|
export const createStorageItem = core.createStorageItem;
|
|
825
|
+
export const memoryItem = core.memoryItem;
|
|
826
|
+
export const diskItem = core.diskItem;
|
|
827
|
+
export const secureItem = core.secureItem;
|
|
828
|
+
export const createSetItem = core.createSetItem;
|
|
821
829
|
export const getBatch = core.getBatch;
|
|
822
830
|
export const setBatch = core.setBatch;
|
|
823
831
|
export const removeBatch = core.removeBatch;
|
|
@@ -886,5 +894,11 @@ export async function flushWebStorageBackends(): Promise<void> {
|
|
|
886
894
|
await Promise.all(flushes);
|
|
887
895
|
}
|
|
888
896
|
|
|
889
|
-
export {
|
|
897
|
+
export {
|
|
898
|
+
useSetStorage,
|
|
899
|
+
useStorage,
|
|
900
|
+
useStorageActions,
|
|
901
|
+
useStorageSelector,
|
|
902
|
+
useStorageValue,
|
|
903
|
+
} from "./storage-hooks";
|
|
890
904
|
export { createIndexedDBBackend } from "./indexeddb-backend";
|
package/src/shared.ts
CHANGED