UNPKG

fox-block-builder

Version:

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

63 lines 2.9 kB
"use strict"; /* eslint-disable max-len */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Blocks = void 0; exports.Divider = Divider; exports.Header = Header; exports.Input = Input; exports.Section = Section; const divider_1 = require("./divider"); const header_1 = require("./header"); const input_1 = require("./input"); const section_1 = require("./section"); /** * 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.blockId] Sets a string to be an identifier for any given block in a view or message. This is sent back to your app in interaction payloads and view submissions for your app to process. * * {@link https://api.slack.com/reference/block-kit/blocks#divider|View in Slack API Documentation} */ function Divider(params) { return new divider_1.DividerBuilder(params); } /** * @param {Object} [config] Parameters passed to the constructor. * @param {string} [config.blockId] Sets a string to be an identifier for any given block in a view or message. This is sent back to your app in interaction payloads and view submissions for your app to process. * @param {string} [config.text] Sets the text to be displayed in the header block. * * {@link https://api.slack.com/reference/block-kit/blocks#header|View in Slack API Documentation} */ function Header(params) { return new header_1.HeaderBuilder(params); } /** * @param {Object} [config] Parameters passed to the constructor. * @param {string} [config.blockId] Sets a string to be an identifier for any given block in a view or message. This is sent back to your app in interaction payloads and view submissions for your app to process. * @param {string} [config.label] Sets the label to be displayed above the input. * @param {string} [config.hint] Sets the hint to be displayed under the input. * * {@link https://api.slack.com/reference/block-kit/blocks#input|View in Slack API Documentation} */ function Input(params) { return new input_1.InputBuilder(params); } /** * @param {Object} [config] Parameters passed to the constructor. * @param {string} [config.blockId] Sets a string to be an identifier for the block, that will be available in interaction payloadsSets a string to be an identifier for any given block in a view or message. This is sent back to your app in interaction payloads and view submissions for your app to process. * @param {string} [config.text] Sets the text to be displayed in the section block. * * {@link https://api.slack.com/reference/block-kit/blocks#section|View in Slack API Documentation} */ function Section(params) { return new section_1.SectionBuilder(params); } const blocks = { Divider, Header, Input, Section, }; exports.Blocks = blocks; //# sourceMappingURL=index.js.map