import type { ImapFlow, MailboxLockObject } from 'imapflow'; import type { EmailAccessor } from '../../accessor/email.ts'; import { type ParsedRfc822 } from './_parse.ts'; export interface FetchedMessage extends ParsedRfc822 { uid: string; flags: string[]; /** IMAP's own arrival stamp, ISO-8601, empty when the server omits it. */ internalDate: string; } export interface FolderEntry { name: string; /** The RFC 6154 special-use attribute the server tagged it with. */ specialUse: string | null; } export declare function listFolderEntries(accessor: EmailAccessor): Promise; export declare function listFolders(accessor: EmailAccessor): Promise; /** * Selects and locks a mailbox, failing loudly when it does not exist. * * imapflow reports every refused command as a bare "Command failed" and * keeps the server's own words on `responseText`, so a missing mailbox * arrives naming neither itself nor the problem. A `responseText` means * the server answered and refused, which is the same condition python * checks through the SELECT response code. */ export declare function lockMailbox(imap: ImapFlow, folder: string): Promise; export declare function listMessageUids(accessor: EmailAccessor, folder: string, searchCriteria?: string, maxResults?: number | null): Promise; /** * imapflow's search object. AND is expressed by several keys on one * object; `or` and `not` nest further objects. */ export interface SearchQuery { all?: boolean; seen?: boolean; answered?: boolean; flagged?: boolean; draft?: boolean; deleted?: boolean; body?: string; text?: string; subject?: string; from?: string; to?: string; on?: Date; since?: Date; before?: Date; sentOn?: Date; sentSince?: Date; sentBefore?: Date; not?: SearchQuery; or?: SearchQuery[]; } export declare function parseSearchCriteria(criteria: string): SearchQuery; export declare function fetchRawMessage(accessor: EmailAccessor, folder: string, uid: string): Promise; export declare function fetchMessage(accessor: EmailAccessor, folder: string, uid: string): Promise; export declare function fetchHeaders(accessor: EmailAccessor, folder: string, uids: readonly string[]): Promise; export declare function fetchAttachment(accessor: EmailAccessor, folder: string, uid: string, filename: string): Promise; //# sourceMappingURL=client.d.ts.map