import { EventEmitter } from 'events'; import { type Lock } from '../../shell/client/mailbox-lock'; import type { CommandContext, CommandContextState, ExecOptions, ExecResponse } from '../../shell/commands/types'; import type { ConnectionId, Logger, MailboxPath, ModSeq } from '../../types/common'; import type { AuthOptions, ConnectionOptions } from '../../types/connection'; import type { MailboxInfo, MailboxListEntry } from '../../types/mailbox'; import type { CommandAttribute } from '../../types/protocol'; export type IMAPClientOptions = ConnectionOptions & { readonly id?: string; }; export type IMAPClientEvents = { close: []; error: [Error]; exists: [{ path: MailboxPath; count: number; prevCount: number; }]; expunge: [{ path: MailboxPath; seq: number; vanished: boolean; }]; flags: [{ path: MailboxPath; seq: number; uid?: number; flags: Set; modseq?: ModSeq; }]; log: [object]; mailboxClose: [MailboxInfo]; mailboxOpen: [MailboxInfo]; }; export declare class IMAPClient extends EventEmitter implements CommandContext, AsyncDisposable { readonly id: ConnectionId; private readonly options; private readonly listenerTracker; private readonly timerManager; private readonly stateMachine; private readonly commandQueue; private responseRouter; private readonly mailboxLock; private socketManager; private imapStream; private disposed; private greeting; private _capabilities; private readonly _enabled; private readonly _authCapabilities; private _mailbox; private readonly _folders; private _expectCapabilityUpdate; private readonly _log; constructor(options: IMAPClientOptions); get log(): Logger; get capabilities(): ReadonlySet; get enabled(): ReadonlySet; get authCapabilities(): ReadonlyMap; get servername(): string; get state(): CommandContextState; get mailbox(): MailboxInfo | null; get folders(): ReadonlyMap; get expectCapabilityUpdate(): boolean; get isDisposed(): boolean; get isCompressed(): boolean; enableCompression: () => void; setCapabilities: (capabilities: Set) => void; addEnabled: (extension: string) => void; setAuthCapability: (method: string, success: boolean) => void; setExpectCapabilityUpdate: (expect: boolean) => void; setMailbox: (mailbox: MailboxInfo | null) => void; setFolder: (path: MailboxPath, folder: MailboxListEntry) => void; emitMailboxOpen: (mailbox: MailboxInfo) => void; emitMailboxClose: (mailbox: MailboxInfo) => void; emitExists: (info: { path: MailboxPath; count: number; prevCount: number; }) => void; emitExpunge: (info: { path: MailboxPath; seq: number; vanished: boolean; }) => void; emitFlags: (info: { path: MailboxPath; seq: number; uid?: number; flags: Set; modseq?: ModSeq; }) => void; connect(): Promise; authenticate(auth: AuthOptions): Promise; private enableExtensions; exec(command: string, attributes?: readonly CommandAttribute[], options?: ExecOptions): Promise; write: (data: string | Buffer) => void; run: (command: string, ...args: unknown[]) => Promise; getMailboxLock(path: MailboxPath): Promise; logout(): Promise; close(): Promise; dispose(): void; [Symbol.asyncDispose](): Promise; private setupSocketListeners; private setupStreamListeners; private handleStreamData; private waitForGreeting; private parseGreetingCapabilities; private handleGlobalUntagged; private handleCapabilityResponse; private handleExistsResponse; private handleExpungeResponse; private handleFetchResponse; } export declare const createIMAPClient: (options: IMAPClientOptions) => IMAPClient; //# sourceMappingURL=index.d.ts.map