@microsoft/teams.cards
Version:
<p> <a href="https://www.npmjs.com/package/@microsoft/teams.cards" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.cards/latest" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.cards?activeTab=c
53 lines (51 loc) • 1.37 kB
JavaScript
import { SubmitAction } from '../../core.mjs';
class MessageBackAction extends SubmitAction {
/**
* Initial data that input fields will be combined with. These are essentially ‘hidden’ properties.
*/
data;
constructor(data, options = {}) {
super(options);
Object.assign(this, options);
this.data = {
msteams: new MessageBackData(data.text, data.value, data.displayText)
};
}
static from(options) {
return new MessageBackAction(options.data.msteams, options);
}
withData(value) {
super.withData({ msteams: value });
return this;
}
}
class MessageBackData {
type;
/**
* Sent to your bot when the action is performed.
*/
text;
/**
* Used by the user in the chat stream when the action is performed.
* This text isn't sent to your bot.
*/
displayText;
/**
* Sent to your bot when the action is performed. You can encode context
* for the action, such as unique identifiers or a `JSON` object.
*/
value;
constructor(text, value, displayText) {
this.type = "messageBack";
this.text = text;
this.value = value;
this.displayText = displayText;
}
withDisplayText(value) {
this.displayText = value;
return this;
}
}
export { MessageBackAction, MessageBackData };
//# sourceMappingURL=message-back.mjs.map
//# sourceMappingURL=message-back.mjs.map