/// <reference path="../../adonis-typings/mail.d.ts" />
/// <reference path="../../adonis-typings/events.d.ts" />
/// <reference types="@adonisjs/view" />
/// <reference types="@adonisjs/events/build/adonis-typings" />
/// <reference types="@adonisjs/logger/build/adonis-typings/logger" />
/// <reference types="@adonisjs/profiler/build/adonis-typings/profiler" />
/// <reference types="@adonisjs/application/build/adonis-typings" />
/// <reference types="@adonisjs/events/build/adonis-typings/events" />
import { Manager } from '@poppinss/manager';
import { ApplicationContract } from '@ioc:Adonis/Core/Application';
import { MailConfig, MailersList, MailerContract, CompiledMailNode, MailDriverContract, QueueMonitorCallback, MailManagerContract, MessageComposeCallback } from '@ioc:Adonis/Addons/Mail';
import { FakeMailManager } from '../Fake';
import { BaseMailer } from '../BaseMailer';
import { prettyPrint } from '../Helpers/prettyPrint';
/**
 * The manager exposes the API to pull instance of [[Mailer]] class for pre-defined mappings
 * in the config file. The manager internally manages the state of mappings and cache
 * them for re-use.
 */
export declare class MailManager extends Manager<ApplicationContract, MailDriverContract, MailerContract<keyof MailersList>, {
    [P in keyof MailersList]: MailerContract<keyof MailersList>;
}> implements MailManagerContract {
    private app;
    private config;
    /**
     * Emails queue to scheduling emails to be delivered later
     */
    private emailsQueue;
    /**
     * Method to monitor in-memory email queue
     */
    private queueMonitor;
    /**
     * Reference to the fake mailer manager
     */
    private fakeMailManager;
    /**
     * Caching driver instances. One must call `close` to clean it up
     */
    protected singleton: boolean;
    /**
     * Method to pretty print sent emails
     */
    prettyPrint: typeof prettyPrint;
    /**
     * Reference to the base mailer since Ioc container doesn't allow
     * multiple exports
     */
    BaseMailer: typeof BaseMailer;
    /**
     * Dependencies from the "@adonisjs/core" and "@adonisjs/view". The manager classes
     * in AdonisJS codebase heavily relies on the container and hence we can pull
     * container bindings directly here.
     */
    view: import("@ioc:Adonis/Core/View").ViewContract | undefined;
    emitter: import("@ioc:Adonis/Core/Event").EmitterContract;
    logger: import("@ioc:Adonis/Core/Logger").LoggerContract;
    profiler: import("@ioc:Adonis/Core/Profiler").ProfilerContract;
    constructor(app: ApplicationContract, config: MailConfig);
    /**
     * Validate config at runtime
     */
    private validateConfig;
    /**
     * Sends the email by pulling it from the queue. This method is invoked
     * automatically by fastq.
     */
    private sendQueuedEmail;
    /**
     * Creates and returns an ethereal email account. Node mailer internally
     * ensures only a single email account is created and hence we don't
     * have to worry about caching credentials.
     */
    private getEtherealAccount;
    /**
     * Since we don't expose the drivers instances directly, we wrap them
     * inside the mailer instance.
     */
    protected wrapDriverResponse<Name extends keyof MailersList>(mappingName: Name, driver: MailDriverContract): MailerContract<Name>;
    /**
     * Returns the driver name for a given mapping
     */
    protected getMappingDriver(name: string): any;
    /**
     * Returns the config for a given mapping
     */
    protected getMappingConfig(name: string): any;
    /**
     * Returns the name of the default mapping
     */
    protected getDefaultMappingName(): keyof MailersList;
    /**
     * Creates an instance of `smtp` driver by lazy loading. This method
     * is invoked internally when a new driver instance is required
     */
    protected createSmtp(_: string, config: any): any;
    /**
     * Creates an instance of `ses` driver by lazy loading. This method
     * is invoked internally when a new driver instance is required
     */
    protected createSes(_: string, config: any): any;
    /**
     * Creates an instance of `mailgun` driver by lazy loading. This method
     * is invoked internally when a new driver instance is required
     */
    protected createMailgun(_: string, config: any): any;
    /**
     * Creates an instance of `sparkpost` driver by lazy loading. This method
     * is invoked internally when a new driver instance is required
     */
    protected createSparkpost(_: string, config: any): any;
    /**
     * Method to schedule email for sending. This method is invoked by
     * the mailer when `sendLater` method is called
     */
    scheduleEmail(mail: CompiledMailNode): void;
    /**
     * Fake one or more mailers. Calling the method multiple times
     * appends to the list of faked mailers
     */
    fake(mailers?: keyof MailersList | (keyof MailersList)[]): FakeMailManager;
    /**
     * Define a callback to monitor emails queue
     */
    monitorQueue(callback: QueueMonitorCallback): void;
    /**
     * Restore fakes
     */
    restore(mailers?: keyof MailersList | (keyof MailersList)[]): void;
    /**
     * Sends email using the default `mailer`
     */
    send(callback: MessageComposeCallback): Promise<any>;
    /**
     * Send email by pushing it to the in-memory queue
     */
    sendLater(callback: MessageComposeCallback): Promise<any>;
    /**
     * Use a named or the default mailer
     */
    use(name?: keyof MailersList): MailerContract<any>;
    /**
     * Closes the mapping instance and removes it from the cache
     */
    close(name?: keyof MailersList): Promise<void>;
    /**
     * Closes the mapping instance and removes it from the cache
     */
    closeAll(): Promise<void>;
    /**
     * Sends email to the ethereal email account. This is great
     * for previewing emails
     */
    preview(callback: MessageComposeCallback): Promise<any>;
}
