import { MTProtoSender } from "./MTProtoSender"; import type { TelegramBaseClient } from "../client/telegramBaseClient"; export interface ApiSenderPoolOptions { /** * Disconnect an idle borrowed sender after this many ms of inactivity. * The next {@link ApiSenderPool.borrow} call will lazily reconnect. */ idleTimeoutMs: number; } /** * One borrowed MTProtoSender per non-main DC for arbitrary API calls * (everything except file transfer, which uses {@link FilePool}). * * Slots are lazily connected on first borrow. A broken auth key on a * non-main DC purges the session's stored key for that DC and the slot * is discarded; the next borrow rebuilds it. */ export declare class ApiSenderPool { private readonly _slots; private readonly _client; private readonly _idleTimeoutMs; private _closed; constructor(client: TelegramBaseClient, opts: ApiSenderPoolOptions); borrow(dcId: number): Promise; has(dcId: number): boolean; private _createSlot; private _onSenderBreak; purge(dcId?: number): Promise; close(): Promise; }