import { type Constructor } from '@adonisjs/core/types/common';
import type { EmitterLike } from '@adonisjs/core/types/events';
import type { SentMessageInfo } from 'nodemailer/lib/json-transport/index.js';
import { Mailer } from './mailer.js';
import { BaseMail } from './base_mail.js';
import type { Message } from './message.js';
import { JSONTransport } from './transports/json.js';
import type { MailResponse } from './mail_response.js';
import type { MailEvents, MailerConfig, MailerContract, MailerMessenger, MessageSearchOptions, MessageComposeCallback } from './types.js';
/**
 * Mails collection to collect mails sent or queued during
 * the fake mode
 */
declare class MailsCollection {
    #private;
    trackSent(mail: BaseMail): void;
    trackQueued(mail: BaseMail): void;
    clear(): void;
    /**
     * Returns a list of sent emails captured by the fake mailer
     */
    sent(filterFn?: (mail: BaseMail) => boolean): BaseMail[];
    /**
     * Returns a list of queued emails captured by the fake mailer
     */
    queued(filterFn?: (mail: BaseMail) => boolean): BaseMail[];
    /**
     * Assert the mentioned mail was sent during the fake
     * mode
     */
    assertSent<T extends Constructor<unknown>>(mailConstructor: T, findFn?: (mail: InstanceType<T>) => boolean): this;
    /**
     * Assert the mentioned mail was NOT sent during the fake
     * mode
     */
    assertNotSent<T extends Constructor<unknown>>(mailConstructor: T, findFn?: (mail: InstanceType<T>) => boolean): this;
    /**
     * Assert a total of expected number of mails were sent
     */
    assertSentCount(count: number): this;
    /**
     * Assert the mentioned mail was sent for expected number
     * of times
     */
    assertSentCount(mailConstructor: Constructor<unknown>, count: number): this;
    /**
     * Assert zero emails were sent
     */
    assertNoneSent(): this;
    /**
     * Assert the mentioned mail was queued during the fake
     * mode
     */
    assertQueued<T extends Constructor<unknown>>(mailConstructor: T, findFn?: (mail: InstanceType<T>) => boolean): this;
    /**
     * Assert the mentioned mail was NOT queued during the fake
     * mode
     */
    assertNotQueued<T extends Constructor<unknown>>(mailConstructor: T, findFn?: (mail: InstanceType<T>) => boolean): this;
    /**
     * Assert a total of expected number of mails were queued
     */
    assertQueuedCount(count: number): this;
    /**
     * Assert the mentioned mail was queued for expected number
     * of times
     */
    assertQueuedCount(mailConstructor: Constructor<unknown>, count: number): this;
    /**
     * Assert zero emails were queued
     */
    assertNoneQueued(): this;
}
/**
 * Messages collection to collect messages sent or queued during
 * the fake mode
 */
declare class MessagesCollection {
    #private;
    trackSent(message: Message): void;
    trackQueued(message: Message): void;
    clear(): void;
    /**
     * Returns a list of sent messages captured by the fake mailer
     */
    sent(filterFn?: (message: Message) => boolean): Message[];
    /**
     * Returns a list of queued messages captured by the fake mailer
     */
    queued(filterFn?: (message: Message) => boolean): Message[];
    /**
     * Assert the mentioned message was sent during the fake
     * mode
     */
    assertSent(finder: ((message: Message) => boolean) | MessageSearchOptions): void;
    /**
     * Assert the mentioned message was NOT sent during the fake
     * mode
     */
    assertNotSent(finder: ((message: Message) => boolean) | MessageSearchOptions): void;
    /**
     * Assert a total of expected number of messages were sent
     */
    assertSentCount(count: number): void;
    /**
     * Assert the mentioned message was sent for expected number
     * of times
     */
    assertSentCount(finder: ((message: Message) => boolean) | MessageSearchOptions, count: number): void;
    /**
     * Assert zero messages were sent
     */
    assertNoneSent(): void;
    /**
     * Assert the mentioned message was queued during the fake
     * mode
     */
    assertQueued(finder: ((message: Message) => boolean) | MessageSearchOptions): void;
    /**
     * Assert the mentioned message was NOT queued during the fake
     * mode
     */
    assertNotQueued(finder: ((message: Message) => boolean) | MessageSearchOptions): void;
    /**
     * Assert a total of expected number of messages were queued
     */
    assertQueuedCount(count: number): void;
    /**
     * Assert the mentioned message was queued for expected number
     * of times
     */
    assertQueuedCount(finder: ((message: Message) => boolean) | MessageSearchOptions, count: number): void;
    /**
     * Assert zero messages were queued
     */
    assertNoneQueued(): void;
}
/**
 * Fake mailer uses the JSON transport to send emails and
 * collects them within memory for a better testing
 * experience.
 */
export declare class FakeMailer extends Mailer<JSONTransport> implements MailerContract<JSONTransport> {
    #private;
    mails: MailsCollection;
    messages: MessagesCollection;
    constructor(name: string, emitter: EmitterLike<MailEvents>, config: MailerConfig, onDispose?: () => void);
    /**
     * Define the messenger to use for queueing emails.
     * The fake mailer ignores using a custom messenger
     */
    setMessenger(_: MailerMessenger): this;
    /**
     * @inheritdoc
     */
    send(callbackOrMail: MessageComposeCallback | BaseMail, config?: undefined): Promise<MailResponse<SentMessageInfo>>;
    /**
     * @inheritdoc
     */
    sendLater(callbackOrMail: MessageComposeCallback | BaseMail, config?: undefined): Promise<void>;
    [Symbol.dispose](): void;
    close(): Promise<void>;
}
export {};
