import type { ImapResponse, ParserOptions } from './types.js'; /** * Parses a raw IMAP command or response buffer into a structured object. * Handles edge cases such as null-byte-padded responses from buggy servers and * multi-word commands like UID and AUTHENTICATE. * * @param command - The raw IMAP command or response data to parse. * @param options - Parser options passed through to the underlying ParserInstance and TokenParser. * @param options.literalPlus - Whether the LITERAL+ extension is in use. * @param options.literals - Pre-parsed literal values extracted from the input stream. * @returns A promise that resolves to a parsed response object with `tag` (the IMAP tag, e.g. "*", * "+", or a command tag like "A1"), `command` (the IMAP command or response name, e.g. "OK", * "FETCH"), `attributes` (parsed attributes of the response), `numbers` (the numbers of an * untagged SEARCH response that holds nothing else, instead of `attributes`) and * `nullBytesRemoved` (number of leading null bytes removed, if any). */ export default function parser(command: Buffer | string, options?: ParserOptions | undefined): Promise;