-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56826aa
commit d858b66
Showing
73 changed files
with
3,189 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
dist/ | ||
|
||
|
||
# Xcode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { useMMKVStorage, create } from './src/hooks/useMMKV'; | ||
import { getCurrentMMKVInstanceIDs } from './src/initializer'; | ||
import { useIndex } from './src/hooks/useIndex'; | ||
import { isLoaded, init } from './src/mmkv/init'; | ||
import Loader from './src/loader'; | ||
import API from './src/api'; | ||
declare const MMKVStorage: { | ||
Loader: typeof Loader; | ||
API: typeof API; | ||
MODES: { | ||
SINGLE_PROCESS: number; | ||
MULTI_PROCESS: number; | ||
}; | ||
ACCESSIBLE: { | ||
WHEN_UNLOCKED: string; | ||
AFTER_FIRST_UNLOCK: string; | ||
ALWAYS: string; | ||
WHEN_PASSCODE_SET_THIS_DEVICE_ONLY: string; | ||
WHEN_UNLOCKED_THIS_DEVICE_ONLY: string; | ||
AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY: string; | ||
ALWAYS_THIS_DEVICE_ONLY: string; | ||
}; | ||
getAllMMKVInstanceIDs: () => string[]; | ||
getCurrentMMKVInstanceIDs: typeof getCurrentMMKVInstanceIDs; | ||
IDSTORE_ID: string; | ||
_jsiModule: { | ||
setupMMKVInstance: (id: string, mode?: number | undefined, cryptKey?: string | undefined, path?: string | undefined) => boolean; | ||
setMMKVServiceName: (alias: string, serviceName: string) => string; | ||
getSecureKey: (alias: string) => string; | ||
setSecureKey: (alias: string, key: string, accessibleMode: string) => boolean; | ||
secureKeyExists: (alias: string) => boolean; | ||
removeSecureKey: (alias: string) => boolean; | ||
setStringMMKV: (key: string, value: string, id: string) => boolean | undefined; | ||
getStringMMKV: (key: string, id: string) => string | null | undefined; | ||
setMapMMKV: (key: string, value: string, id: string) => boolean | undefined; | ||
getMapMMKV: (key: string, id: string) => string | null | undefined; | ||
setArrayMMKV: (key: string, value: string, id: string) => boolean | undefined; | ||
getArrayMMKV: (key: string, id: string) => string | null | undefined; | ||
setNumberMMKV: (key: string, value: number, id: string) => boolean | undefined; | ||
getNumberMMKV: (key: string, id: string) => number | null | undefined; | ||
setBoolMMKV: (key: string, value: boolean, id: string) => boolean | undefined; | ||
getBoolMMKV: (key: string, id: string) => boolean | null | undefined; | ||
removeValueMMKV: (key: string, id: string) => boolean | undefined; | ||
getAllKeysMMKV: (id: string) => string[] | undefined; | ||
getIndexMMKV: (type: import("./src/types").DataType, id: string) => string[] | undefined; | ||
containsKeyMMKV: (key: string, id: string) => boolean | undefined; | ||
clearMMKV: (id: string) => boolean | undefined; | ||
clearMemoryCache: (id: string) => boolean | undefined; | ||
encryptMMKV: (cryptKey: string, id: string) => boolean | undefined; | ||
decryptMMKV: (id: string) => boolean | undefined; | ||
}; | ||
_bridgeModule: { | ||
install: () => boolean; | ||
}; | ||
}; | ||
export default MMKVStorage; | ||
export { useMMKVStorage, create, useIndex, isLoaded, init }; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { useMMKVStorage, create } from './src/hooks/useMMKV'; | ||
import { ACCESSIBLE, MODES } from './src/utils'; | ||
import { getCurrentMMKVInstanceIDs } from './src/initializer'; | ||
import { default as IDStore } from './src/mmkv/IDStore'; | ||
import { useIndex } from './src/hooks/useIndex'; | ||
import { isLoaded, init } from './src/mmkv/init'; | ||
import Loader from './src/loader'; | ||
import API from './src/api'; | ||
import mmkvJsiModule, { mmkvBridgeModule } from './src/module'; | ||
var MMKVStorage = { | ||
Loader: Loader, | ||
API: API, | ||
MODES: MODES, | ||
ACCESSIBLE: ACCESSIBLE, | ||
getAllMMKVInstanceIDs: IDStore.getAllMMKVInstanceIDs, | ||
getCurrentMMKVInstanceIDs: getCurrentMMKVInstanceIDs, | ||
IDSTORE_ID: IDStore.STORE_ID, | ||
_jsiModule: mmkvJsiModule, | ||
_bridgeModule: mmkvBridgeModule | ||
}; | ||
export default MMKVStorage; | ||
export { useMMKVStorage, create, useIndex, isLoaded, init }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
import encryption from './encryption'; | ||
import EventManager from './eventmanager'; | ||
import indexer from './indexer/indexer'; | ||
import transactions from './transactions'; | ||
import { DataType, GenericReturnType, StorageOptions } from './types'; | ||
export default class API { | ||
transactions: transactions; | ||
instanceID: string; | ||
encryption: encryption; | ||
indexer: indexer; | ||
ev: EventManager; | ||
options: StorageOptions; | ||
constructor(id: string); | ||
/** | ||
* Set a string value to storage for the given key. | ||
* This method is added for redux-persist/zustand support. | ||
* | ||
*/ | ||
setItem(key: string, value: string): Promise<unknown>; | ||
/** | ||
* Get the string value for the given key. | ||
* This method is added for redux-persist/zustand support. | ||
*/ | ||
getItem(key: string): Promise<unknown>; | ||
/** | ||
* Set a string value to storage for the given key. | ||
*/ | ||
setStringAsync(key: string, value: string): Promise<unknown>; | ||
/** | ||
* Get the string value for the given key. | ||
*/ | ||
getStringAsync(key: string): Promise<unknown>; | ||
/** | ||
* Set a number value to storage for the given key. | ||
*/ | ||
setIntAsync(key: string, value: number): Promise<unknown>; | ||
/** | ||
* Get the number value for the given key. | ||
*/ | ||
getIntAsync(key: string): Promise<unknown>; | ||
/** | ||
* Set a boolean value to storage for the given key. | ||
* | ||
*/ | ||
setBoolAsync(key: string, value: boolean): Promise<unknown>; | ||
/** | ||
* Get the boolean value for the given key. | ||
*/ | ||
getBoolAsync(key: string): Promise<unknown>; | ||
/** | ||
* Set an Object to storage for the given key. | ||
* | ||
* Note that this function does **not** work with the Map data type. | ||
* | ||
*/ | ||
setMapAsync(key: string, value: object): Promise<unknown>; | ||
/** | ||
* Get then Object from storage for the given key. | ||
*/ | ||
getMapAsync<T>(key: string): Promise<unknown>; | ||
/** | ||
* Retrieve multiple items for the given array of keys. | ||
*/ | ||
getMultipleItemsAsync<T>(keys: string[], type: DataType | 'map'): Promise<unknown>; | ||
/** | ||
* Set an array to storage for the given key. | ||
*/ | ||
setArrayAsync(key: string, value: any[]): Promise<unknown>; | ||
/** | ||
* Get the array from the storage for the given key. | ||
*/ | ||
getArrayAsync<T>(key: string): Promise<unknown>; | ||
/** | ||
* Set a string value to storage for the given key. | ||
*/ | ||
setString: (key: string, value: string) => boolean | null | undefined; | ||
/** | ||
* Get the string value for the given key. | ||
*/ | ||
getString: (key: string, callback?: ((error: any, value: string | undefined | null) => void) | undefined) => string | null | undefined; | ||
/** | ||
* Set a number value to storage for the given key. | ||
*/ | ||
setInt: (key: string, value: number) => boolean | null | undefined; | ||
/** | ||
* Get the number value for the given key | ||
*/ | ||
getInt: (key: string, callback?: ((error: any, value: number | undefined | null) => void) | undefined) => number | null | undefined; | ||
/** | ||
* Set a boolean value to storage for the given key | ||
*/ | ||
setBool: (key: string, value: boolean) => boolean | null | undefined; | ||
/** | ||
* Get the boolean value for the given key. | ||
*/ | ||
getBool: (key: string, callback?: ((error: any, value: boolean | undefined | null) => void) | undefined) => boolean | null | undefined; | ||
/** | ||
* Set an Object to storage for a given key. | ||
* | ||
* Note that this function does **not** work with the Map data type | ||
*/ | ||
setMap: (key: string, value: object) => boolean | null | undefined; | ||
/** | ||
* Get an Object from storage for a given key. | ||
*/ | ||
getMap: <T>(key: string, callback?: ((error: any, value: T | null | undefined) => void) | undefined) => T | null; | ||
/** | ||
* Set an array to storage for the given key. | ||
*/ | ||
setArray: (key: string, value: any[]) => boolean | null | undefined; | ||
/** | ||
* get an array from the storage for give key. | ||
*/ | ||
getArray: <T>(key: string, callback?: ((error: any, value: T[] | null | undefined) => void) | undefined) => T[] | null; | ||
/** | ||
* Retrieve multiple items for the given array of keys. | ||
* | ||
*/ | ||
getMultipleItems: <T>(keys: string[], type: DataType | 'map') => GenericReturnType<T>[]; | ||
/** | ||
* | ||
* Get all Storage Instance IDs that are currently loaded. | ||
* | ||
*/ | ||
getCurrentMMKVInstanceIDs(): { | ||
[x: string]: boolean; | ||
}; | ||
/** | ||
* | ||
* Get all Storage Instance IDs. | ||
* | ||
*/ | ||
getAllMMKVInstanceIDs(): string[]; | ||
/** | ||
* Remove an item from storage for a given key. | ||
* | ||
*/ | ||
removeItem(key: string): boolean | null | undefined; | ||
/** | ||
* Remove all keys and values from storage. | ||
*/ | ||
clearStore(): boolean | null | undefined; | ||
/** | ||
* Get the key and alias for the encrypted storage | ||
*/ | ||
getKey(): { | ||
alias: string | null; | ||
key: string | null; | ||
}; | ||
/** | ||
* Clear memory cache of the current MMKV instance | ||
*/ | ||
clearMemoryCache(): boolean | null | undefined; | ||
} | ||
//# sourceMappingURL=api.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
d858b66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: