import type FavaLibMediator from '../../FavaLibMediator.mjs'; import Command from '../BaseCommand.mjs'; import type { DeviceId } from '../../interfaces/BrandedTypes.mjs'; import type Entry from '../../interfaces/Entry.mjs'; export type AddEntryData = Entry; /** * Represents a command that when executed add an entry to the vault. */ declare class AddEntryCommand extends Command { /** * Creates a new AddEntryCommand instance. * @inheritdoc * @param data - The data of the entry to be added. */ constructor(data: AddEntryData, id?: string, timestamp?: number, version?: string, fromRemote?: boolean, fromDeviceId?: DeviceId); /** * Executes the command to add the entry to the vault. * @inheritdoc * @throws {InvalidCommandError} If the command data is invalid. */ execute(mediator: FavaLibMediator): Promise; /** * @inheritdoc */ createUndoCommand(): Command; /** * Checks the command data. * * Commands that came from a peer are held to the weaker of the two tiers: * `CommandManager.processRemoteCommands` drops a command that throws and * never retries it, so rejecting an entry over a repairable problem would * lose it on this device permanently. `VaultDataManager` sanitises the * matching fields on the way in instead. * @returns The reason the command is invalid, or null when it is valid. */ private invalidReason; /** * Validates the command data. * @returns True if the command data is valid, false otherwise. */ validate(): boolean; } export default AddEntryCommand;