@bantis/local-cipher 2.0.1 → 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.
- package/README.md +112 -17
- package/dist/angular/SecureStorageService.d.ts +156 -0
- package/dist/angular.d.ts +9 -0
- package/dist/angular.esm.js +1516 -0
- package/dist/angular.esm.js.map +1 -0
- package/dist/angular.js +1535 -0
- package/dist/angular.js.map +1 -0
- package/dist/core/EncryptionHelper.d.ts +76 -0
- package/dist/core/EventEmitter.d.ts +36 -0
- package/dist/core/KeyRotation.d.ts +24 -0
- package/dist/core/NamespacedStorage.d.ts +39 -0
- package/dist/core/SecureStorage.d.ts +114 -0
- package/dist/index.d.ts +16 -700
- package/dist/index.esm.js +9 -440
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +8 -444
- package/dist/index.js.map +1 -1
- package/dist/react/hooks.d.ts +39 -0
- package/dist/react.d.ts +9 -0
- package/dist/react.esm.js +1414 -0
- package/dist/react.esm.js.map +1 -0
- package/dist/react.js +1440 -0
- package/dist/react.js.map +1 -0
- package/dist/types/index.d.ts +153 -0
- package/dist/utils/compression.d.ts +23 -0
- package/dist/utils/debug.d.ts +18 -0
- package/dist/utils/logger.d.ts +22 -0
- package/package.json +30 -9
|
@@ -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;
|
package/dist/react.d.ts
ADDED
|
@@ -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';
|