UNPKG

fox-block-builder

Version:

Maintainable code for loop slack-block-kit-like modal builder

65 lines 2.78 kB
"use strict"; /* eslint-disable max-len */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Bits = void 0; exports.Attachment = Attachment; exports.ConfirmationDialog = ConfirmationDialog; exports.Option = Option; exports.OptionGroup = OptionGroup; const attachment_1 = require("./attachment"); const confirmation_dialog_1 = require("./confirmation-dialog"); const option_1 = require("./option"); const option_group_1 = require("./option-group"); /** * Functions here do not use arrow functions stored in variables for IDE color compatibility. */ /** * @param {Object} [config] Parameters passed to the constructor. * @param {string} [config.color] Sets the color of the block quote border. * * {@link https://api.slack.com/reference/messaging/attachments|View in Slack API Documentation} */ function Attachment(params) { return new attachment_1.AttachmentBuilder(params); } /** * @param {Object} [config] Parameters passed to the constructor. * @param {string} [config.title] Sets the title displayed in the confirmation dialog. * @param {string} [config.text] Sets the textual content of the confirmation dialog. * @param {string} [config.confirm] Sets the text for the button that confirms the action. * @param {string} [config.deny]Sets the text for the button that cancels the action. * * {@link https://api.slack.com/reference/block-kit/composition-objects#confirm|View in Slack API Documentation} */ function ConfirmationDialog(params) { return new confirmation_dialog_1.ConfirmationDialogBuilder(params); } /** * @param {Object} [config] Parameters passed to the constructor. * @param {string} [config.text] Sets the text displayed in the menu for the current option. * @param {string} [config.value] Sets the value passed to your app when this OptionBuilder is clicked or submitted. * @param {string} [config.description] Sets a description shown next to the option, if in a radio button input. * @param {string} [config.url] Sets the URL to redirect the user to when this option is clicked, if in an overlow menu. * * {@link https://api.slack.com/reference/block-kit/composition-objects#option|View in Slack API Documentation} */ function Option(params) { return new option_1.OptionBuilder(params); } /** * @param {Object} [config] Parameters passed to the constructor. * @param {string} [config.label] Sets the label shown above the group of option. * * {@link https://api.slack.com/reference/block-kit/composition-objects#option_group|View in Slack API Documentation} */ function OptionGroup(params) { return new option_group_1.OptionGroupBuilder(params); } const bits = { Attachment, ConfirmationDialog, Option, OptionGroup, }; exports.Bits = bits; //# sourceMappingURL=index.js.map