import type Entry from '../interfaces/Entry.mjs'; import type { EntryId, Token } from '../interfaces/Entry.mjs'; import type FavaLibMediator from '../FavaLibMediator.mjs'; import { Vault } from '../interfaces/Vault.mjs'; /** * Manages the data within the vault. This class should only be used internally * by the library, for public methods, see VaultOperationsManager. */ declare class VaultDataManager { private readonly mediator; private vault; /** * Constructs a new VaultDataManager instance. * @param mediator - The mediator for accessing other components. */ constructor(mediator: FavaLibMediator); private get persistentStorageManager(); private get dispatchLibEvent(); /** * @returns The number of entries in the vault. */ get size(): number; /** * Retrieve a specific entry. * @param entryId - The unique identifier of the entry. * @returns The entry. * @throws {EntryNotFoundError} If no entry exists with the given ID. */ getFullEntry(entryId: EntryId): Entry; /** * Retrieve all entries in the vault. * @returns An array of all entries. */ getAllEntries(): Vault; /** * Generate a time-based one-time password (TOTP) for a specific entry. * @param id - The unique identifier of the entry. * @param timestamp - Optional timestamp to use for token generation (default is current time). * @returns A promise resolving to an object containing the token and the validity period. * @throws {EntryNotFoundError} If no entry exists with the given ID. * @throws {TokenGenerationError} If token generation fails due to invalid entry data or technical issues. */ generateTokenForEntry(id: EntryId, timestamp?: number): Promise; /** * Add a new entry to the vault. * @param entry - The entry data to add * @param saveAfter - Whether to save the new vault after adding it (set to false when adding multiple entries) * @returns A promise that resolves when the entry is added. */ addEntry(entry: Entry, saveAfter?: boolean): Promise; /** * Delete an entry from the vault. * @param entryId - The identifier of the entry to delete. * @throws {EntryNotFoundError} If no entry exists with the given ID. */ deleteEntry(entryId: EntryId): Promise; /** * Update an existing entry in the vault. * @param updatedEntry - An object containing the updated entry. * @returns A promise that resolves when the entry is updated. * @throws {EntryNotFoundError} If no entry exists with the given ID. */ updateEntry(updatedEntry: Entry): Promise; /** * Replace the current vault with a new one. * @param newVault - The new vault data to replace the existing vault. */ replaceVault(newVault: Vault): void; } export default VaultDataManager;