react-native-storage-inspector 1.0.2 → 1.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/README.md CHANGED
@@ -49,12 +49,11 @@ The component fills its container. The consumer is responsible for header, back
49
49
 
50
50
  ### Props
51
51
 
52
- | Prop | Type | Description |
53
- | ----------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
54
- | `mmkvInstances` | `MMKV[]` | **Required for MMKV.** Pass your MMKV instances to inspect. |
55
- | `secureStoreKeys` | `string[]` | **Required for Secure Store.** Keys to list (no list API). |
56
- | `keychainKeys` | `string[]` | Optional. Only for internet credentials (no list API). Generic passwords auto-discovered via `getAllGenericPasswordServices`. |
57
- | `customAdapters` | `IStorageAdapter[]` | Optional. Custom adapters for other storages. |
52
+ | Prop | Type | Description |
53
+ | ----------------- | ------------------- | ------------------------------------------------------------------------------------------------- |
54
+ | `mmkvInstances` | `MMKV[]` | **Required for MMKV.** Pass your MMKV instances to inspect. |
55
+ | `secureStoreKeys` | `string[]` | Optional. Known keys for Secure Store (no list API). Merged with keys persisted by the inspector. |
56
+ | `customAdapters` | `IStorageAdapter[]` | Optional. Custom adapters for other storages. |
58
57
 
59
58
  ## Expo
60
59
 
package/dist/index.d.mts CHANGED
@@ -16,81 +16,6 @@ interface IStorageAdapter {
16
16
  isAvailable(): boolean;
17
17
  }
18
18
 
19
- /**
20
- * AsyncStorage-compatible module interface.
21
- * Pass your AsyncStorage instance to avoid Metro "unknown module" errors in Expo:
22
- * @example
23
- * import AsyncStorage from '@react-native-async-storage/async-storage';
24
- * createAsyncStorageAdapter(AsyncStorage)
25
- */
26
- type AsyncStorageModule = {
27
- getAllKeys(): Promise<string[]>;
28
- getItem(key: string): Promise<string | null>;
29
- setItem(key: string, value: string): Promise<void>;
30
- removeItem(key: string): Promise<void>;
31
- };
32
- /**
33
- * Creates an AsyncStorage adapter. Pass the AsyncStorage instance for reliable
34
- * bundling in Expo/Metro (avoids "unknown module" errors):
35
- *
36
- * @example
37
- * import AsyncStorage from '@react-native-async-storage/async-storage';
38
- * createAsyncStorageAdapter(AsyncStorage)
39
- */
40
- declare function createAsyncStorageAdapter(instance?: AsyncStorageModule | null): IStorageAdapter;
41
-
42
- /**
43
- * Keychain-compatible module. Pass your keychain instance to avoid Metro
44
- * "unknown module" errors in Expo.
45
- */
46
- type KeychainModule = {
47
- getAllGenericPasswordServices?(options?: object): Promise<string[]>;
48
- getGenericPassword?(options?: {
49
- service?: string;
50
- }): Promise<{
51
- password: string;
52
- } | false>;
53
- setGenericPassword?(username: string, password: string, options?: {
54
- service?: string;
55
- }): Promise<{
56
- storage: string;
57
- } | false>;
58
- resetGenericPassword?(options?: {
59
- service?: string;
60
- }): Promise<void>;
61
- setInternetCredentials(server: string, username: string, password: string): Promise<{
62
- storage: string;
63
- } | false>;
64
- getInternetCredentials(server: string): Promise<{
65
- username: string;
66
- password: string;
67
- } | null>;
68
- resetInternetCredentials(server: string): Promise<void>;
69
- };
70
- /**
71
- * Keychain adapter. Pass the keychain instance for reliable bundling in Expo:
72
- * @example import * as Keychain from 'react-native-keychain';
73
- * createKeychainAdapter([], Keychain)
74
- */
75
- declare function createKeychainAdapter(knownKeys?: string[], instance?: KeychainModule | null): IStorageAdapter;
76
-
77
- /**
78
- * expo-secure-store compatible module. Pass the module to avoid Metro
79
- * "unknown module" errors in Expo.
80
- */
81
- type SecureStoreModule = {
82
- getItemAsync(key: string): Promise<string | null>;
83
- setItemAsync(key: string, value: string): Promise<void>;
84
- deleteItemAsync(key: string): Promise<void>;
85
- };
86
- /**
87
- * expo-secure-store has no API to list all keys. Pass knownKeys to inspect
88
- * those entries. Pass the module for reliable bundling in Expo:
89
- * @example import * as SecureStore from 'expo-secure-store';
90
- * createSecureStoreAdapter([], SecureStore)
91
- */
92
- declare function createSecureStoreAdapter(knownKeys?: string[], instance?: SecureStoreModule | null): IStorageAdapter;
93
-
94
19
  interface StorageInspectorProps {
95
20
  mmkvInstances?: Array<{
96
21
  getAllKeys(): string[];
@@ -98,17 +23,10 @@ interface StorageInspectorProps {
98
23
  set(k: string, v: string | number | boolean): void;
99
24
  delete(k: string): void;
100
25
  }>;
101
- /** Pass AsyncStorage to avoid Metro "unknown module" in Expo. */
102
- asyncStorageInstance?: AsyncStorageModule | null;
103
- keychainKeys?: string[];
104
- /** Pass Keychain module to avoid Metro "unknown module" in Expo. */
105
- keychainInstance?: KeychainModule | null;
106
26
  secureStoreKeys?: string[];
107
- /** Pass SecureStore module to avoid Metro "unknown module" in Expo. */
108
- secureStoreInstance?: SecureStoreModule | null;
109
27
  customAdapters?: IStorageAdapter[];
110
28
  }
111
- declare function StorageInspector({ mmkvInstances, asyncStorageInstance, keychainKeys: keychainKeysProp, keychainInstance, secureStoreKeys: secureStoreKeysProp, secureStoreInstance, customAdapters, }: StorageInspectorProps): React.JSX.Element;
29
+ declare function StorageInspector(props: StorageInspectorProps): React.JSX.Element;
112
30
 
113
31
  /**
114
32
  * Centralized user-facing text for the storage inspector.
@@ -116,19 +34,18 @@ declare function StorageInspector({ mmkvInstances, asyncStorageInstance, keychai
116
34
  */
117
35
  declare const strings: {
118
36
  readonly noAdapterAvailable: "No storage adapter available. Install at least one of: react-native-mmkv, @react-native-async-storage/async-storage, react-native-keychain, expo-secure-store";
119
- readonly keychainHint: "No generic password items yet. Add a key using + above, or pass keychainKeys for internet credentials.";
37
+ readonly keychainHint: "No generic password items yet. Add a key using + above.";
120
38
  readonly secureStoreHint: "Secure Store has no list API. Pass secureStoreKeys prop with known keys, or add a key using + above.";
121
39
  readonly loading: "Loading…";
122
40
  readonly noItems: "No items";
123
41
  readonly valueLabel: "Value";
124
- readonly emptyValue: "(empty)";
125
42
  readonly charCount: (n: number) => string;
126
43
  readonly deleteItemTitle: (key: string) => string;
127
44
  readonly deleteItemMessage: (key: string) => string;
128
45
  readonly clearAllTitle: (name: string) => string;
129
46
  readonly clearAllMessage: (count: number, name: string) => string;
130
47
  readonly storageNotAvailable: "This storage is not available.";
131
- readonly keychainHintShort: "No items yet. Add a key below, or pass keychainKeys for internet credentials.";
48
+ readonly keychainHintShort: "No items yet. Add a key below.";
132
49
  readonly edit: "Edit";
133
50
  readonly delete: "Delete";
134
51
  readonly addItem: "Add item";
@@ -163,6 +80,7 @@ declare const theme: {
163
80
  readonly textSecondary: "#666666";
164
81
  readonly textMuted: "#999999";
165
82
  readonly inverted: "#ffffff";
83
+ readonly overlayBackdrop: "rgba(0,0,0,0.5)";
166
84
  };
167
85
  };
168
86
  type Theme = typeof theme;
@@ -175,4 +93,56 @@ type MMKVInstance = {
175
93
  };
176
94
  declare function createMMKVAdapter(instance: MMKVInstance, name?: string): IStorageAdapter;
177
95
 
96
+ /**
97
+ * AsyncStorage-compatible module interface.
98
+ */
99
+ type AsyncStorageModule = {
100
+ getAllKeys(): Promise<string[]>;
101
+ getItem(key: string): Promise<string | null>;
102
+ setItem(key: string, value: string): Promise<void>;
103
+ removeItem(key: string): Promise<void>;
104
+ };
105
+ /**
106
+ * Creates an AsyncStorage adapter.
107
+ */
108
+ declare function createAsyncStorageAdapter(): IStorageAdapter;
109
+
110
+ /**
111
+ * Keychain-compatible module (generic password only).
112
+ */
113
+ type KeychainModule = {
114
+ getAllGenericPasswordServices?(options?: object): Promise<string[]>;
115
+ getGenericPassword?(options?: {
116
+ service?: string;
117
+ }): Promise<{
118
+ password: string;
119
+ } | false>;
120
+ setGenericPassword?(username: string, password: string, options?: {
121
+ service?: string;
122
+ }): Promise<{
123
+ storage: string;
124
+ } | false>;
125
+ resetGenericPassword?(options?: {
126
+ service?: string;
127
+ }): Promise<void>;
128
+ };
129
+ /**
130
+ * Creates a Keychain adapter.
131
+ */
132
+ declare function createKeychainAdapter(): IStorageAdapter;
133
+
134
+ /**
135
+ * expo-secure-store compatible module. Pass the module to avoid Metro
136
+ * "unknown module" errors in Expo.
137
+ */
138
+ type SecureStoreModule = {
139
+ getItemAsync(key: string): Promise<string | null>;
140
+ setItemAsync(key: string, value: string): Promise<void>;
141
+ deleteItemAsync(key: string): Promise<void>;
142
+ };
143
+ /**
144
+ * Creates a Secure Store adapter. Since expo-secure-store has no API to list all keys, we persist the list of keys in Secure Store.
145
+ */
146
+ declare function createSecureStoreAdapter(knownKeys?: string[]): IStorageAdapter;
147
+
178
148
  export { type AsyncStorageModule, type IStorageAdapter, type KeychainModule, type SecureStoreModule, StorageInspector, type StorageInspectorProps, type StorageItem, type Theme, createAsyncStorageAdapter, createKeychainAdapter, createMMKVAdapter, createSecureStoreAdapter, strings, theme };
package/dist/index.d.ts CHANGED
@@ -16,81 +16,6 @@ interface IStorageAdapter {
16
16
  isAvailable(): boolean;
17
17
  }
18
18
 
19
- /**
20
- * AsyncStorage-compatible module interface.
21
- * Pass your AsyncStorage instance to avoid Metro "unknown module" errors in Expo:
22
- * @example
23
- * import AsyncStorage from '@react-native-async-storage/async-storage';
24
- * createAsyncStorageAdapter(AsyncStorage)
25
- */
26
- type AsyncStorageModule = {
27
- getAllKeys(): Promise<string[]>;
28
- getItem(key: string): Promise<string | null>;
29
- setItem(key: string, value: string): Promise<void>;
30
- removeItem(key: string): Promise<void>;
31
- };
32
- /**
33
- * Creates an AsyncStorage adapter. Pass the AsyncStorage instance for reliable
34
- * bundling in Expo/Metro (avoids "unknown module" errors):
35
- *
36
- * @example
37
- * import AsyncStorage from '@react-native-async-storage/async-storage';
38
- * createAsyncStorageAdapter(AsyncStorage)
39
- */
40
- declare function createAsyncStorageAdapter(instance?: AsyncStorageModule | null): IStorageAdapter;
41
-
42
- /**
43
- * Keychain-compatible module. Pass your keychain instance to avoid Metro
44
- * "unknown module" errors in Expo.
45
- */
46
- type KeychainModule = {
47
- getAllGenericPasswordServices?(options?: object): Promise<string[]>;
48
- getGenericPassword?(options?: {
49
- service?: string;
50
- }): Promise<{
51
- password: string;
52
- } | false>;
53
- setGenericPassword?(username: string, password: string, options?: {
54
- service?: string;
55
- }): Promise<{
56
- storage: string;
57
- } | false>;
58
- resetGenericPassword?(options?: {
59
- service?: string;
60
- }): Promise<void>;
61
- setInternetCredentials(server: string, username: string, password: string): Promise<{
62
- storage: string;
63
- } | false>;
64
- getInternetCredentials(server: string): Promise<{
65
- username: string;
66
- password: string;
67
- } | null>;
68
- resetInternetCredentials(server: string): Promise<void>;
69
- };
70
- /**
71
- * Keychain adapter. Pass the keychain instance for reliable bundling in Expo:
72
- * @example import * as Keychain from 'react-native-keychain';
73
- * createKeychainAdapter([], Keychain)
74
- */
75
- declare function createKeychainAdapter(knownKeys?: string[], instance?: KeychainModule | null): IStorageAdapter;
76
-
77
- /**
78
- * expo-secure-store compatible module. Pass the module to avoid Metro
79
- * "unknown module" errors in Expo.
80
- */
81
- type SecureStoreModule = {
82
- getItemAsync(key: string): Promise<string | null>;
83
- setItemAsync(key: string, value: string): Promise<void>;
84
- deleteItemAsync(key: string): Promise<void>;
85
- };
86
- /**
87
- * expo-secure-store has no API to list all keys. Pass knownKeys to inspect
88
- * those entries. Pass the module for reliable bundling in Expo:
89
- * @example import * as SecureStore from 'expo-secure-store';
90
- * createSecureStoreAdapter([], SecureStore)
91
- */
92
- declare function createSecureStoreAdapter(knownKeys?: string[], instance?: SecureStoreModule | null): IStorageAdapter;
93
-
94
19
  interface StorageInspectorProps {
95
20
  mmkvInstances?: Array<{
96
21
  getAllKeys(): string[];
@@ -98,17 +23,10 @@ interface StorageInspectorProps {
98
23
  set(k: string, v: string | number | boolean): void;
99
24
  delete(k: string): void;
100
25
  }>;
101
- /** Pass AsyncStorage to avoid Metro "unknown module" in Expo. */
102
- asyncStorageInstance?: AsyncStorageModule | null;
103
- keychainKeys?: string[];
104
- /** Pass Keychain module to avoid Metro "unknown module" in Expo. */
105
- keychainInstance?: KeychainModule | null;
106
26
  secureStoreKeys?: string[];
107
- /** Pass SecureStore module to avoid Metro "unknown module" in Expo. */
108
- secureStoreInstance?: SecureStoreModule | null;
109
27
  customAdapters?: IStorageAdapter[];
110
28
  }
111
- declare function StorageInspector({ mmkvInstances, asyncStorageInstance, keychainKeys: keychainKeysProp, keychainInstance, secureStoreKeys: secureStoreKeysProp, secureStoreInstance, customAdapters, }: StorageInspectorProps): React.JSX.Element;
29
+ declare function StorageInspector(props: StorageInspectorProps): React.JSX.Element;
112
30
 
113
31
  /**
114
32
  * Centralized user-facing text for the storage inspector.
@@ -116,19 +34,18 @@ declare function StorageInspector({ mmkvInstances, asyncStorageInstance, keychai
116
34
  */
117
35
  declare const strings: {
118
36
  readonly noAdapterAvailable: "No storage adapter available. Install at least one of: react-native-mmkv, @react-native-async-storage/async-storage, react-native-keychain, expo-secure-store";
119
- readonly keychainHint: "No generic password items yet. Add a key using + above, or pass keychainKeys for internet credentials.";
37
+ readonly keychainHint: "No generic password items yet. Add a key using + above.";
120
38
  readonly secureStoreHint: "Secure Store has no list API. Pass secureStoreKeys prop with known keys, or add a key using + above.";
121
39
  readonly loading: "Loading…";
122
40
  readonly noItems: "No items";
123
41
  readonly valueLabel: "Value";
124
- readonly emptyValue: "(empty)";
125
42
  readonly charCount: (n: number) => string;
126
43
  readonly deleteItemTitle: (key: string) => string;
127
44
  readonly deleteItemMessage: (key: string) => string;
128
45
  readonly clearAllTitle: (name: string) => string;
129
46
  readonly clearAllMessage: (count: number, name: string) => string;
130
47
  readonly storageNotAvailable: "This storage is not available.";
131
- readonly keychainHintShort: "No items yet. Add a key below, or pass keychainKeys for internet credentials.";
48
+ readonly keychainHintShort: "No items yet. Add a key below.";
132
49
  readonly edit: "Edit";
133
50
  readonly delete: "Delete";
134
51
  readonly addItem: "Add item";
@@ -163,6 +80,7 @@ declare const theme: {
163
80
  readonly textSecondary: "#666666";
164
81
  readonly textMuted: "#999999";
165
82
  readonly inverted: "#ffffff";
83
+ readonly overlayBackdrop: "rgba(0,0,0,0.5)";
166
84
  };
167
85
  };
168
86
  type Theme = typeof theme;
@@ -175,4 +93,56 @@ type MMKVInstance = {
175
93
  };
176
94
  declare function createMMKVAdapter(instance: MMKVInstance, name?: string): IStorageAdapter;
177
95
 
96
+ /**
97
+ * AsyncStorage-compatible module interface.
98
+ */
99
+ type AsyncStorageModule = {
100
+ getAllKeys(): Promise<string[]>;
101
+ getItem(key: string): Promise<string | null>;
102
+ setItem(key: string, value: string): Promise<void>;
103
+ removeItem(key: string): Promise<void>;
104
+ };
105
+ /**
106
+ * Creates an AsyncStorage adapter.
107
+ */
108
+ declare function createAsyncStorageAdapter(): IStorageAdapter;
109
+
110
+ /**
111
+ * Keychain-compatible module (generic password only).
112
+ */
113
+ type KeychainModule = {
114
+ getAllGenericPasswordServices?(options?: object): Promise<string[]>;
115
+ getGenericPassword?(options?: {
116
+ service?: string;
117
+ }): Promise<{
118
+ password: string;
119
+ } | false>;
120
+ setGenericPassword?(username: string, password: string, options?: {
121
+ service?: string;
122
+ }): Promise<{
123
+ storage: string;
124
+ } | false>;
125
+ resetGenericPassword?(options?: {
126
+ service?: string;
127
+ }): Promise<void>;
128
+ };
129
+ /**
130
+ * Creates a Keychain adapter.
131
+ */
132
+ declare function createKeychainAdapter(): IStorageAdapter;
133
+
134
+ /**
135
+ * expo-secure-store compatible module. Pass the module to avoid Metro
136
+ * "unknown module" errors in Expo.
137
+ */
138
+ type SecureStoreModule = {
139
+ getItemAsync(key: string): Promise<string | null>;
140
+ setItemAsync(key: string, value: string): Promise<void>;
141
+ deleteItemAsync(key: string): Promise<void>;
142
+ };
143
+ /**
144
+ * Creates a Secure Store adapter. Since expo-secure-store has no API to list all keys, we persist the list of keys in Secure Store.
145
+ */
146
+ declare function createSecureStoreAdapter(knownKeys?: string[]): IStorageAdapter;
147
+
178
148
  export { type AsyncStorageModule, type IStorageAdapter, type KeychainModule, type SecureStoreModule, StorageInspector, type StorageInspectorProps, type StorageItem, type Theme, createAsyncStorageAdapter, createKeychainAdapter, createMMKVAdapter, createSecureStoreAdapter, strings, theme };