import { APIMethods, APIMethodParams } from '@gramio/types'; type MiddlewareContext = { [M in keyof APIMethods]: { method: M; params: APIMethodParams; formData?: FormData; }; }[keyof APIMethods]; /** * Middleware that automatically decomposes {@link FormattableString} values in API params * into plain text + entities, making them ready for the Telegram Bot API. * * @example * ```ts * import { Telegram } from "wrappergram"; * import { formatMiddleware } from "@gramio/format/middleware"; * import { format, bold, italic } from "@gramio/format"; * * const telegram = new Telegram("BOT_TOKEN", { * middlewares: [formatMiddleware], * }); * * await telegram.api.sendMessage({ * chat_id: 123, * text: format`Hello ${bold`world`}!`, * }); * ``` */ declare const formatMiddleware: (context: MiddlewareContext, next: () => Promise) => Promise; export { formatMiddleware };