UNPKG

@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" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.cards?activeTab=code" ta

53 lines (51 loc) 1.36 kB
import { SubmitAction } from './submit'; 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