import type { ImapFlow } from '../imap-flow.js'; import type { AppendResponseObject } from '../types.js'; /** * Result of an APPEND: the destination, the selected mailbox path at the time of the append, * and the UID information the server reported */ export interface AppendResult extends AppendResponseObject { /** Path of the currently selected mailbox, if any */ path?: string | undefined; } /** * Appends a message to a mailbox. * * @param connection - IMAP connection instance * @param destination - Destination mailbox path * @param content - Message content (RFC 822 format) * @param flags - Message flags to set on the appended message * @param idate - Internal date to set for the message * @returns Append result with UID info if available, or undefined if preconditions not met * @throws {Error} If the APPEND command fails or message exceeds APPENDLIMIT */ export default function append(connection: ImapFlow, destination: string | string[], content: Buffer | Uint8Array | string, flags?: string | string[] | undefined, idate?: Date | string | false | undefined): Promise;