UNPKG

@shaaz1000/rn-storage

Version:

A comprehensive storage solution for React Native with encryption, caching, and offline sync

45 lines 1.35 kB
declare class StorageManager { private static instance; private memoryCache; private constructor(); /** * Initialize storage with encryption key * @param encryptionKey - Key used for encrypting/decrypting data */ static initialize(encryptionKey: string): void; static getInstance(): StorageManager; /** * Set item in storage * @param key - Storage key * @param value - Value to store * @param encrypt - Whether to encrypt the data * @param expiryTime - Time in milliseconds after which the data expires */ setItem(key: string, value: any, encrypt?: boolean, expiryTime?: number): Promise<void>; /** * Get item from storage * @param key - Storage key * @param decrypt - Whether to decrypt the data */ getItem(key: string, decrypt?: boolean): Promise<any | null>; /** * Remove item from storage * @param key - Storage key */ removeItem(key: string): Promise<void>; /** * Clear all storage */ clear(): Promise<void>; /** * Get all keys in storage */ getAllKeys(): Promise<string[]>; /** * Check if key exists in storage * @param key - Storage key */ hasKey(key: string): Promise<boolean>; } export default StorageManager; //# sourceMappingURL=storageManager.d.ts.map