import { ImapFlow } from 'imapflow'; import type { MessageStructureObject } from 'imapflow'; import type { ICredentialDataDecryptedObject } from 'n8n-workflow'; import { type NormalizedMessage } from './normalize'; export interface ImapConfig { host: string; port: number; secure: boolean; auth: { user: string; pass: string; }; logger?: false; tls?: any; socketTimeout?: number; commandTimeout?: number; } export interface SearchOptions { search?: string; since?: Date; before?: Date; unread?: boolean; flagged?: boolean; hasAttachment?: boolean; limit?: number; offset?: number; } export interface AttachmentInfo { partId: string; fileName?: string; mimeType: string; size: number; disposition?: string; contentId?: string; } export declare const createImapConfig: (credentials: ICredentialDataDecryptedObject) => ImapConfig; export declare const connectImap: (config: ImapConfig) => Promise; export declare const buildSearchQuery: (options?: SearchOptions) => { [key: string]: any; }; export declare const fetchMessages: (client: ImapFlow, mailbox: string, options?: SearchOptions, includeBody?: boolean) => Promise; export declare const fetchMessageByUid: (client: ImapFlow, mailbox: string, uid: number, includeBody?: boolean) => Promise; export declare const extractTextAndHtml: (bodyStructure?: MessageStructureObject, bodyParts?: Map) => { text?: string; html?: string; }; export declare const getAttachments: (bodyStructure?: MessageStructureObject) => AttachmentInfo[]; export declare const downloadAttachment: (client: ImapFlow, mailbox: string, uid: number, partId: string) => Promise; export declare const markMessage: (client: ImapFlow, mailbox: string, uid: number, flags: { seen?: boolean; flagged?: boolean; answered?: boolean; }) => Promise; export declare const moveMessage: (client: ImapFlow, fromMailbox: string, uid: number, toMailbox: string) => Promise; export declare const deleteMessage: (client: ImapFlow, mailbox: string, uid: number, hardDelete?: boolean) => Promise; export declare const normalizeMailboxName: (uiName: string) => string; export declare const denormalizeMailboxName: (imapName: string) => string; export declare const listMailboxes: (client: ImapFlow) => Promise; export declare const createMailbox: (client: ImapFlow, name: string) => Promise; export declare const deleteMailbox: (client: ImapFlow, name: string) => Promise; export declare const emptyTrash: (client: ImapFlow) => Promise; //# sourceMappingURL=imap.d.ts.map