

























@@ -5,14 +5,21 @@ import {
5566export type InteractiveButtonStyle = "primary" | "secondary" | "success" | "danger";
778+/** Visual tone for a portable message presentation. */
89export type MessagePresentationTone = "info" | "success" | "warning" | "danger" | "neutral";
91011+/** Button style hint for renderers that support styled actions. */
1012export type MessagePresentationButtonStyle = InteractiveButtonStyle;
111314+/** Portable action control rendered as a button or link by channel adapters. */
1215export type MessagePresentationButton = {
16+/** User-visible button label. */
1317label: string;
18+/** Callback command or opaque value sent when the button is pressed. */
1419value?: string;
20+/** External URL opened by the button instead of sending a callback value. */
1521url?: string;
22+/** Telegram-style web app launch target. */
1623webApp?: {
1724url: string;
1825};
@@ -22,13 +29,19 @@ export type MessagePresentationButton = {
2229web_app?: {
2330url: string;
2431};
32+/** Higher-priority buttons are kept first when channel limits require truncation. */
2533priority?: number;
34+/** Disable the button when the target channel supports disabled controls. */
2635disabled?: boolean;
36+/** Optional visual style hint; unsupported channels ignore or normalize it. */
2737style?: InteractiveButtonStyle;
2838};
293940+/** Portable select/menu option. */
3041export type MessagePresentationOption = {
42+/** User-visible option label. */
3143label: string;
44+/** Callback command or opaque value sent when the option is selected. */
3245value: string;
3346};
3447@@ -84,11 +97,13 @@ export type InteractiveReply = {
84978598export type MessagePresentationTextBlock = {
8699type: "text";
100+/** Primary markdown-ish text rendered in the message body. */
87101text: string;
88102};
8910390104export type MessagePresentationContextBlock = {
91105type: "context";
106+/** Lower-emphasis contextual text, or normal text on channels without context support. */
92107text: string;
93108};
94109@@ -98,12 +113,15 @@ export type MessagePresentationDividerBlock = {
9811399114export type MessagePresentationButtonsBlock = {
100115type: "buttons";
116+/** Button row candidates; core may split or truncate them for channel limits. */
101117buttons: MessagePresentationButton[];
102118};
103119104120export type MessagePresentationSelectBlock = {
105121type: "select";
122+/** Optional prompt shown above or inside the select control. */
106123placeholder?: string;
124+/** Menu options; core may truncate them for channel limits. */
107125options: MessagePresentationOption[];
108126};
109127@@ -119,8 +137,11 @@ export type MessagePresentationBlock =
119137| MessagePresentationSelectBlock;
120138121139export type MessagePresentation = {
140+/** Optional short heading rendered before blocks when the channel supports it. */
122141title?: string;
142+/** Optional severity/status tone for renderers that support toned presentations. */
123143tone?: MessagePresentationTone;
144+/** Ordered portable blocks rendered or downgraded by the target channel adapter. */
124145blocks: MessagePresentationBlock[];
125146};
126147此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。