import encryption from './encryption'; import EventManager from './eventmanager'; import indexer from './indexer/indexer'; import transactions from './transactions'; import { DataType, StorageOptions } from './types'; export default class MMKVInstance { transactions: transactions; instanceID: string; encryption: encryption; indexer: indexer; ev: EventManager; options: StorageOptions; constructor(id: string); isRegisterd(key: string): Function[]; handleNullOrUndefined(key: string, value: any): boolean; /** * Set a string value to storage for the given key. * This method is added for redux-persist/zustand support. * */ setItem(key: string, value: string, callback?: (err?: Error | null) => void): Promise; /** * Get the string value for the given key. * This method is added for redux-persist/zustand support. */ getItem(key: string, callback?: (error?: Error | null, result?: string | null) => void): Promise; /** * Set a string value to storage for the given key. */ setStringAsync(key: string, value: string): Promise; /** * Get the string value for the given key. */ getStringAsync(key: string): Promise; /** * Set a number value to storage for the given key. */ setIntAsync(key: string, value: number): Promise; /** * Get the number value for the given key. */ getIntAsync(key: string): Promise; /** * Set a boolean value to storage for the given key. * */ setBoolAsync(key: string, value: boolean): Promise; /** * Get the boolean value for the given key. */ getBoolAsync(key: string): Promise; /** * 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; /** * Get then Object from storage for the given key. */ getMapAsync(key: string): Promise; /** * Set items in bulk of same type at once * * If a value against a key is null/undefined, it will be * set as null. * * @param keys Array of keys * @param values Array of values * @param type */ setMultipleItemsAsync(items: [string, any][], type: DataType | 'map'): Promise; /** * Retrieve multiple items for the given array of keys */ getMultipleItemsAsync(keys: string[], type: DataType | 'map'): Promise<[string, T][]>; /** * Set an array to storage for the given key. */ setArrayAsync(key: string, value: any[]): Promise; /** * Get the array from the storage for the given key. */ getArrayAsync(key: string): Promise; /** * Set a string value to storage for the given key. */ setString: (key: string, value: string) => boolean | undefined; /** * Get the string value for the given key. */ getString: (key: string, callback?: (error: any, value: string | undefined | null) => void) => string | null | undefined; /** * Set a number value to storage for the given key. */ setInt: (key: string, value: number) => boolean | undefined; /** * Get the number value for the given key */ getInt: (key: string, callback?: (error: any, value: number | undefined | null) => void) => number | null | undefined; /** * Set a boolean value to storage for the given key */ setBool: (key: string, value: boolean) => boolean | undefined; /** * Get the boolean value for the given key. */ getBool: (key: string, callback?: (error: any, value: boolean | undefined | null) => void) => 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 | undefined; /** * Get an Object from storage for a given key. */ getMap: (key: string, callback?: (error: any, value: T | undefined | null) => void) => T | null | undefined; /** * Set an array to storage for the given key. */ setArray: (key: string, value: any[]) => boolean | undefined; /** * get an array from the storage for give key. */ getArray: (key: string, callback?: (error: any, value: T[] | undefined | null) => void) => T[] | null | undefined; /** * Retrieve multiple items for the given array of keys. * */ getMultipleItems: (keys: string[], type: DataType | "map") => [string, 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. * * If you are removing large number of keys, use `removeItems` instead. */ removeItem(key: string): boolean; /** * Remove multiple items from storage for given keys * */ removeItems(keys: string[]): boolean; /** * Remove all keys and values from storage. */ clearStore(): boolean; /** * Get the key and alias for the encrypted storage */ getKey(): { alias: string; key: string; }; /** * Clear memory cache of the current MMKV instance */ clearMemoryCache(): boolean; } //# sourceMappingURL=mmkvinstance.d.ts.map