/**
 * @bobfrankston/mailx-core
 * Core mail functions — callable directly via IPC or wrapped by Express.
 * No HTTP, no Express, no WebSocket. Just plain async functions.
 */
import { MailxDB } from "@bobfrankston/mailx-store";
import { ImapManager } from "@bobfrankston/mailx-imap";
import type { ComposeMessage } from "@bobfrankston/mailx-types";
declare let db: MailxDB;
declare let imapManager: ImapManager;
export declare function onEvent(handler: (event: any) => void): void;
export declare function initialize(transportFactory?: any): Promise<void>;
export declare function shutdown(): Promise<void>;
export declare function getAccounts(): {
    id: string;
    name: string;
    email: string;
    lastSync: number;
}[];
export declare function getFolders(params: {
    accountId: string;
}): import("@bobfrankston/mailx-types").Folder[];
export declare function getMessages(params: {
    accountId: string;
    folderId: number;
    page?: number;
    pageSize?: number;
    sort?: string;
    sortDir?: string;
    search?: string;
    flaggedOnly?: boolean;
}): import("@bobfrankston/mailx-types").PagedResult<import("@bobfrankston/mailx-types").MessageEnvelope>;
export declare function getUnifiedInbox(params: {
    page?: number;
    pageSize?: number;
}): import("@bobfrankston/mailx-types").PagedResult<import("@bobfrankston/mailx-types").MessageEnvelope>;
export declare function getMessage(params: {
    accountId: string;
    uid: number;
    allowRemote?: boolean;
    folderId?: number;
}): Promise<{
    bodyHtml: string;
    bodyText: string;
    hasRemoteContent: boolean;
    remoteAllowed: boolean;
    attachments: any[];
    deliveredTo: string;
    returnPath: string;
    listUnsubscribe: string;
    listUnsubscribeMail: string;
    listUnsubscribeHttp: string;
    listUnsubscribeOneClick: boolean;
    emlPath: string;
    id: number;
    accountId: string;
    folderId: number;
    folderName?: string;
    uid: number;
    uuid?: string;
    messageId: string;
    inReplyTo: string;
    references: string[];
    threadId?: string;
    date: number;
    sentDate?: number;
    subject: string;
    from: import("@bobfrankston/mailx-types").EmailAddress;
    to: import("@bobfrankston/mailx-types").EmailAddress[];
    cc: import("@bobfrankston/mailx-types").EmailAddress[];
    flags: string[];
    size: number;
    hasAttachments: boolean;
    isReplied?: boolean;
    preview: string;
    bodyPath?: string;
    providerId?: string;
    pending?: boolean;
}>;
export declare function updateFlags(params: {
    accountId: string;
    uid: number;
    flags: string[];
}): Promise<void>;
export declare function deleteMessage(params: {
    accountId: string;
    uid: number;
}): Promise<void>;
export declare function undeleteMessage(params: {
    accountId: string;
    uid: number;
    folderId: number;
}): Promise<void>;
export declare function sendMessage(params: ComposeMessage): Promise<void>;
export declare function saveDraft(params: {
    accountId: string;
    subject: string;
    bodyHtml: string;
    bodyText: string;
    to: string;
    cc: string;
    previousDraftUid?: number;
}): Promise<number>;
export declare function deleteDraft(params: {
    accountId: string;
    draftUid: number;
}): Promise<void>;
export declare function searchMessages(params: {
    query: string;
    page?: number;
    pageSize?: number;
}): import("@bobfrankston/mailx-types").PagedResult<import("@bobfrankston/mailx-types").MessageEnvelope>;
export declare function searchContacts(params: {
    query: string;
}): {
    name: string;
    email: string;
    source: string;
    sources: string[];
    useCount: number;
}[];
export declare function syncAll(): Promise<void>;
export declare function getSyncPending(): {
    pending: number;
};
export declare function allowRemoteContent(params: {
    type: string;
    value: string;
}): Promise<void>;
export declare function getSettings(): import("@bobfrankston/mailx-types").MailxSettings;
export declare function saveSettingsData(data: any): void;
export declare function rebuildSearchIndex(): number;
export declare function seedContacts(): Promise<number>;
export declare function syncGoogleContacts(): Promise<void>;
export declare function getVersion(): {
    server: string;
    client: string;
};
/** Dispatch an action by name — used by IPC and Express wrapper */
export declare function dispatch(action: string, params?: any): Promise<any>;
export { db, imapManager };
//# sourceMappingURL=index.d.ts.map