@bantis/local-cipher 2.0.0 → 2.1.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.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * React Hooks for @bantis/local-cipher
3
+ * Provides reactive hooks for encrypted browser storage
4
+ */
5
+ import { SecureStorage } from '../core/SecureStorage';
6
+ import type { SecureStorageConfig, StorageEventType, StorageEventData, ExpiryOptions } from '../types';
7
+ /**
8
+ * Initialize SecureStorage with custom configuration
9
+ */
10
+ export declare function initializeSecureStorage(config?: SecureStorageConfig): SecureStorage;
11
+ /**
12
+ * Hook de React para usar SecureStorage de forma reactiva
13
+ * Similar a useState pero con persistencia encriptada
14
+ */
15
+ export declare function useSecureStorage<T = string>(key: string, initialValue: T, storage?: SecureStorage): [T, (value: T) => Promise<void>, boolean, Error | null];
16
+ /**
17
+ * Hook para usar SecureStorage con expiración
18
+ */
19
+ export declare function useSecureStorageWithExpiry<T = string>(key: string, initialValue: T, expiryOptions: ExpiryOptions, storage?: SecureStorage): [T, (value: T) => Promise<void>, boolean, Error | null];
20
+ /**
21
+ * Hook para verificar si una clave existe en SecureStorage
22
+ */
23
+ export declare function useSecureStorageItem(key: string, storage?: SecureStorage): [boolean, boolean, Error | null];
24
+ /**
25
+ * Hook para escuchar eventos de SecureStorage
26
+ */
27
+ export declare function useSecureStorageEvents(event: StorageEventType, handler: (data: StorageEventData) => void, storage?: SecureStorage): void;
28
+ /**
29
+ * Hook para obtener información de debug del almacenamiento
30
+ */
31
+ export declare function useSecureStorageDebug(storage?: SecureStorage): any;
32
+ /**
33
+ * Hook para usar un namespace de SecureStorage
34
+ */
35
+ export declare function useNamespace(namespace: string, storage?: SecureStorage): any;
36
+ /**
37
+ * Exportar la instancia de SecureStorage para uso directo
38
+ */
39
+ export declare const secureStorage: SecureStorage;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @bantis/local-cipher/react - React Integration
3
+ * React hooks for encrypted browser storage
4
+ *
5
+ * @version 2.1.0
6
+ * @license MIT
7
+ */
8
+ export * from './index';
9
+ export { initializeSecureStorage, useSecureStorage, useSecureStorageItem, useSecureStorageWithExpiry, useSecureStorageEvents, useNamespace, useSecureStorageDebug, secureStorage as reactSecureStorage, } from './react/hooks';