/**
 * Web-compatible MailxService for Android/browser.
 * Replaces @bobfrankston/mailx-service which depends on Node.js (fs, dns, mailparser).
 *
 * Key differences from desktop:
 * - Uses WebMailxDB (wa-sqlite) instead of MailxDB (node:sqlite)
 * - Uses WebMessageStore (IndexedDB) instead of FileMessageStore (filesystem)
 * - Uses postal-mime or manual header parsing instead of mailparser's simpleParser
 * - Settings via IndexedDB + GDrive API instead of filesystem
 * - No dns.resolveMx — provider detection is static (Gmail/Outlook/Yahoo/iCloud)
 */
import type { WebMailxDB } from "./db.js";
import type { WebMessageStore } from "./web-message-store.js";
import type { Folder, AutocompleteSettings } from "@bobfrankston/mailx-types";
export interface WebSyncManager {
    syncAll(): Promise<void>;
    syncFolders(accountId: string): Promise<Folder[]>;
    syncFolder(accountId: string, folderId: number): Promise<void>;
    fetchMessageBody(accountId: string, folderId: number, uid: number): Promise<Uint8Array | null>;
    updateFlagsLocal(accountId: string, uid: number, folderId: number, flags: string[]): Promise<void>;
    trashMessage(accountId: string, folderId: number, uid: number): Promise<void>;
    trashMessages(accountId: string, messages: {
        uid: number;
        folderId: number;
    }[]): Promise<void>;
    moveMessage(accountId: string, uid: number, folderId: number, targetFolderId: number): Promise<void>;
    moveMessages(accountId: string, messages: {
        uid: number;
        folderId: number;
    }[], targetFolderId: number): Promise<void>;
    moveMessageCrossAccount(accountId: string, uid: number, folderId: number, targetAccountId: string, targetFolderId: number): Promise<void>;
    undeleteMessage(accountId: string, uid: number, folderId: number): Promise<void>;
    queueOutgoingLocal(accountId: string, rawMessage: string): void | Promise<void>;
    saveDraft(accountId: string, raw: string, previousDraftUid?: number, draftId?: string): Promise<number | null>;
    deleteDraft(accountId: string, draftUid: number): Promise<void>;
    reauthenticate(accountId: string): Promise<boolean>;
    searchOnServer(accountId: string, folderPath: string, criteria: any): Promise<number[]>;
    syncAllContacts(): Promise<void>;
    addAccount(account: any): Promise<void>;
    on(event: string, handler: (...args: any[]) => void): void;
    emit(event: string, ...args: any[]): void;
}
export declare class WebMailxService {
    private db;
    private bodyStore;
    private syncManager;
    constructor(db: WebMailxDB, bodyStore: WebMessageStore, syncManager: WebSyncManager);
    getAccounts(): Promise<any[]>;
    getFolders(accountId: string): Folder[];
    getUnifiedInbox(page?: number, pageSize?: number): any;
    getMessages(accountId: string, folderId: number, page?: number, pageSize?: number, sort?: string, sortDir?: string, search?: string): any;
    getMessage(accountId: string, uid: number, allowRemote?: boolean, folderId?: number): Promise<any>;
    updateFlags(accountId: string, uid: number, flags: string[]): Promise<void>;
    allowRemoteContent(type: "sender" | "domain" | "recipient", value: string): Promise<void>;
    search(q: string, page?: number, pageSize?: number, scope?: string, accountId?: string, folderId?: number): Promise<any>;
    getSyncPending(): {
        pending: number;
    };
    syncAll(): Promise<void>;
    syncAccount(accountId: string): Promise<void>;
    reauthenticate(accountId: string): Promise<boolean>;
    send(msg: any): Promise<void>;
    deleteMessage(accountId: string, uid: number): Promise<void>;
    deleteMessages(accountId: string, uids: number[]): Promise<void>;
    moveMessage(accountId: string, uid: number, targetFolderId: number, targetAccountId?: string): Promise<void>;
    moveMessages(accountId: string, uids: number[], targetFolderId: number): Promise<void>;
    undeleteMessage(accountId: string, uid: number, folderId: number): Promise<void>;
    saveDraft(accountId: string, subject: string, bodyHtml: string, bodyText: string, to?: string, cc?: string, previousDraftUid?: number, draftId?: string): Promise<{
        uid: number | null;
        draftId: string;
    }>;
    deleteDraft(accountId: string, draftUid: number): Promise<void>;
    searchContacts(query: string): any[];
    /** Address-book listing — paginated, filterable. Mirrors mailx-service's
     *  signature so the same client-side address-book modal works on Android
     *  without an "ipc(...).listContacts is not a function" crash. */
    listContacts(query: string, page?: number, pageSize?: number): {
        items: any[];
        total: number;
        page: number;
        pageSize: number;
    };
    /** Manual upsert from the address-book UI. The desktop path queues a
     *  Google People sync; Android relies on the desktop pushing changes
     *  back, so this is local-only for now. */
    upsertContact(name: string, email: string): {
        ok: true;
    };
    deleteContact(email: string): {
        ok: true;
    };
    addContact(name: string, email: string): boolean;
    /** Q49 heuristic mirror: true if the user has ever sent a message to
     *  `recipientEmail` that had a non-empty Cc field. Compose uses this to
     *  decide whether to auto-expand the Cc row on reply. */
    hasCcHistoryTo(recipientEmail: string): boolean;
    getSettings(): Promise<any>;
    saveSettingsData(settings: any): Promise<void>;
    getStorageInfo(): {
        provider: string;
        mode: string;
    };
    markFolderRead(folderId: number): void;
    getAutocompleteSettings(): Promise<AutocompleteSettings>;
    saveAutocompleteSettings(settings: AutocompleteSettings): Promise<void>;
    autocomplete(_req: any): Promise<{
        suggestion: string;
    }>;
    resetStore(): Promise<void>;
}
//# sourceMappingURL=web-service.d.ts.map