import { AppBit, Logger, ServiceLoaderAppSaveCallback } from '@o/kit';
import { GMailHistoryLoadResult, GMailThread, GMailUserProfile } from './GMailModels';
/**
 * Loads data from GMail service.
 */
export declare class GMailLoader {
    private app;
    private log;
    private loader;
    constructor(app: AppBit, log?: Logger, saveCallback?: ServiceLoaderAppSaveCallback);
    /**
     * Loads user's GMail profile.
     */
    loadProfile(): Promise<GMailUserProfile>;
    /**
     * Loads user history.
     * History represents latest changes in user inbox.
     * For example when user receives new messages or removes exist messages.
     */
    loadHistory(startHistoryId: string, pageToken?: string): Promise<GMailHistoryLoadResult>;
    /**
     * Loads threads from the gmail.
     * Count is the maximal number of threads to load.
     */
    loadThreads(options: {
        count: number;
        queryFilter?: string;
        filteredIds?: string[];
        pageToken?: string;
        loadedCount?: number;
        handler: (thread: GMailThread, cursor?: string, loadedCount?: number, isLast?: boolean) => Promise<boolean> | boolean;
    }): Promise<void>;
    /**
     * Loads thread messages and pushes them into threads.
     */
    loadMessages(threads: GMailThread[]): Promise<void>;
}
