import type { TelegramInlineQueryResultArticle, TelegramInlineQueryResultAudio, TelegramInlineQueryResultCachedAudio, TelegramInlineQueryResultCachedDocument, TelegramInlineQueryResultCachedGif, TelegramInlineQueryResultCachedMpeg4Gif, TelegramInlineQueryResultCachedPhoto, TelegramInlineQueryResultCachedSticker, TelegramInlineQueryResultCachedVideo, TelegramInlineQueryResultCachedVoice, TelegramInlineQueryResultContact, TelegramInlineQueryResultDocument, TelegramInlineQueryResultGame, TelegramInlineQueryResultGif, TelegramInlineQueryResultLocation, TelegramInlineQueryResultMpeg4Gif, TelegramInlineQueryResultPhoto, TelegramInlineQueryResultVenue, TelegramInlineQueryResultVideo, TelegramInlineQueryResultVoice, TelegramInlineQueryResultsButton } from '@puregram/api'; import { type Camelize } from './camelize.js'; type RequiredKey = {} extends Pick ? false : true; type FriendlyContent = 'input_message_content' extends keyof T ? RequiredKey extends true ? { content: NonNullable; } : { content?: NonNullable; } : object; type FriendlyReplyMarkup = 'reply_markup' extends keyof T ? { replyMarkup?: NonNullable | { toJSON: () => NonNullable; }; } : object; type ThumbnailMime = 'image/jpeg' | 'image/gif' | 'video/mp4'; type ThumbnailShape = { url: string; } & ('thumbnail_width' extends keyof T ? { width?: number; } : object) & ('thumbnail_height' extends keyof T ? { height?: number; } : object) & ('thumbnail_mime_type' extends keyof T ? { mimeType?: ThumbnailMime; } : object); type FriendlyThumbnail = 'thumbnail_url' extends keyof T ? RequiredKey extends true ? { thumbnail: ThumbnailShape; } : { thumbnail?: ThumbnailShape; } : object; /** strip bot-api snake_case fields, camelize the rest, then re-add the renamed-shape ones */ type Friendly = Camelize> & FriendlyContent & FriendlyReplyMarkup & FriendlyThumbnail; /** factories for `InlineQueryResultCached*` payloads — no thumbnails (cached items reference an existing file) */ export declare class InlineQueryResultCached { /** cached audio file */ static audio(params: Friendly>): TelegramInlineQueryResultCachedAudio; /** cached document file */ static document(params: Friendly>): TelegramInlineQueryResultCachedDocument; /** cached animated gif */ static gif(params: Friendly>): TelegramInlineQueryResultCachedGif; /** cached mpeg4 animation */ static mpeg4Gif(params: Friendly>): TelegramInlineQueryResultCachedMpeg4Gif; /** cached photo */ static photo(params: Friendly>): TelegramInlineQueryResultCachedPhoto; /** cached sticker */ static sticker(params: Friendly>): TelegramInlineQueryResultCachedSticker; /** cached video */ static video(params: Friendly>): TelegramInlineQueryResultCachedVideo; /** cached voice */ static voice(params: Friendly>): TelegramInlineQueryResultCachedVoice; } /** * static factories for `InlineQueryResult*` payloads passed to `answerInlineQuery` * * the bot-api fields `input_message_content`, `reply_markup`, and the * `thumbnail_*` quartet are renamed for ergonomics: * - `input_message_content` → `content` * - `reply_markup` → `replyMarkup` * - `thumbnail_url` / `thumbnail_width` / `thumbnail_height` / * `thumbnail_mime_type` → `thumbnail: { url, width?, height?, mimeType? }` * * cached variants live under `InlineQueryResult.cached.X(...)`; the standalone * `InlineQueryResultCached` class is also re-exported * * @example * ```ts * tg.api.answerInlineQuery({ * inline_query_id: q.id, * results: [ * InlineQueryResult.article({ * id: '1', * title: 'hello', * content: InputMessageContent.text('hi there'), * thumbnail: { url: 'https://example.com/icon.png', width: 100, height: 100 } * }) * ], * button: InlineQueryResult.button('open web app', { web_app: { url: 'https://example.com' } }) * }) * ``` */ export declare class InlineQueryResult { /** factories for `InlineQueryResultCached*` payloads */ static cached: typeof InlineQueryResultCached; /** build an `InlineQueryResultsButton` shown above results */ static button(text: string, params?: Camelize>): { text: string; }; /** article — link to a web page or arbitrary content body */ static article(params: Friendly>): TelegramInlineQueryResultArticle; /** mp3 audio file */ static audio(params: Friendly>): TelegramInlineQueryResultAudio; /** contact card */ static contact(params: Friendly>): TelegramInlineQueryResultContact; /** generic file (pdf, zip) */ static document(params: Friendly>): TelegramInlineQueryResultDocument; /** game shortcut */ static game(params: Friendly>): TelegramInlineQueryResultGame; /** animated gif */ static gif(params: Friendly>): TelegramInlineQueryResultGif; /** location pin */ static location(params: Friendly>): TelegramInlineQueryResultLocation; /** mpeg4 animation (silent video) */ static mpeg4Gif(params: Friendly>): TelegramInlineQueryResultMpeg4Gif; /** photo */ static photo(params: Friendly>): TelegramInlineQueryResultPhoto; /** venue */ static venue(params: Friendly>): TelegramInlineQueryResultVenue; /** video (or page with embedded video player) */ static video(params: Friendly>): TelegramInlineQueryResultVideo; /** ogg/opus voice recording */ static voice(params: Friendly>): TelegramInlineQueryResultVoice; } export {}; //# sourceMappingURL=inline-query-result.d.ts.map