/** * Secure storage types and interfaces */ /** Result of a storage operation */ export type StorageResult = { ok: true; value: T; } | { ok: false; error: string; }; /** * Secure storage adapter interface * * All implementations must provide atomic, encrypted storage * with platform-appropriate protection (Keychain, Keystore, etc.) */ export interface SecureStorageAdapter { /** Storage backend name for diagnostics */ readonly name: string; /** Whether this adapter is available on current platform */ readonly available: boolean; /** * Store a value securely * @param key - Storage key (will be hashed internally) * @param value - Value to store (will be encrypted) */ set(key: string, value: string): Promise>; /** * Retrieve a stored value * @param key - Storage key */ get(key: string): Promise>; /** * Delete a stored value * @param key - Storage key */ delete(key: string): Promise>; /** * Check if a key exists * @param key - Storage key */ has(key: string): Promise>; /** * List all keys (may not be available on all platforms) */ keys?(): Promise>; /** * Clear all stored values */ clear?(): Promise>; } /** * Simple secure storage interface (legacy compatibility) * Used by inbox-store and other packages */ export interface SecureStorage { getString(key: string): Promise; setString(key: string, value: string): Promise; delete(key: string): Promise; remove(key: string): Promise; } /** * Options for secure storage operations */ export interface SecureStorageOptions { /** Namespace prefix for keys */ namespace?: string; /** Custom encryption key (derived from user credentials) */ encryptionKey?: Uint8Array; /** Biometric protection level (mobile only) */ biometric?: "none" | "optional" | "required"; /** Accessibility (iOS only) */ accessible?: "unlocked" | "always" | "passcode"; } /** * Encrypted envelope format for web storage */ export interface EncryptedEnvelope { /** Version for future upgrades */ v: 1; /** Algorithm identifier */ alg: "xchacha20-poly1305"; /** Base64-encoded nonce */ n: string; /** Base64-encoded ciphertext */ c: string; /** Key derivation salt (if using password) */ s?: string; } //# sourceMappingURL=types.d.ts.map