import { UseSecureStorageResult } from '../types'; import { SecureStorage } from '../secure-storage'; /** * Options for the useSecureStorage hook */ export interface UseSecureStorageOptions { /** Custom SecureStorage instance (defaults to global instance) */ storage?: SecureStorage; /** Initial value before first load */ initialValue?: unknown; /** Whether to sync with other tabs via storage events */ syncAcrossTabs?: boolean; /** Auto-refresh interval in milliseconds */ refreshInterval?: number; } /** * Hook for accessing encrypted secure storage * * Provides a React-friendly interface for reading and writing * encrypted data with automatic state management. * * @param key - The storage key * @param options - Hook options * @returns Secure storage operations and state * * @example * ```tsx * function SecureDataComponent() { * const { * value, * isLoading, * error, * setValue, * removeValue, * refresh, * } = useSecureStorage('user-preferences'); * * if (isLoading) return ; * if (error) return ; * * return ( *
*

Theme: {value?.theme ?? 'default'}

* *
* ); * } * ``` */ export declare function useSecureStorage(key: string, options?: UseSecureStorageOptions): UseSecureStorageResult; /** * Hook for accessing secure storage with TTL * Convenience wrapper with automatic expiration * * @param key - The storage key * @param ttl - Time-to-live in milliseconds * @param options - Hook options (excluding refreshInterval which is set automatically) * @returns Secure storage operations and state with TTL enforcement */ export declare function useSecureStorageWithTTL(key: string, ttl: number, options?: Omit): UseSecureStorageResult;