import type { ConnectionScope, IImapConnection, MailCredentials } from "@remit/mailbox-service"; export type PoolOverflow = "Wait" | "Open"; export interface ConnectionPoolOptions { readonly size: number; readonly overflow: PoolOverflow; } export interface PoolAccount { readonly accountId: string; readonly username: string; readonly imapHost: string; readonly imapPort: number; readonly imapTls: boolean; } export type ConnectImap = (account: PoolAccount, credentials: MailCredentials) => ConnectionScope; export interface BorrowedConnection { getConnection: () => Promise; release: () => Promise; } export interface ConnectionPool { borrow: (account: PoolAccount, credentials: MailCredentials) => BorrowedConnection; } export declare const createConnectionPool: (options: ConnectionPoolOptions, connect: ConnectImap) => ConnectionPool;