slack-block-builder
Version:
Maintainable code for interactive Slack messages, modals, home tabs, and workflow steps. A must-have for the Slack Block Kit framework.
32 lines (31 loc) • 1.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SectionBuilder = void 0;
const base_1 = require("../internal/base");
const constants_1 = require("../internal/constants");
const dto_1 = require("../internal/dto");
const helpers_1 = require("../internal/helpers");
const methods_1 = require("../internal/methods");
/**
* @@link https://api.slack.com/reference/block-kit/blocks#section
* @@displayName Section
*/
class SectionBuilder extends base_1.BlockBuilderBase {
/** @internal */
build() {
return this.getResult(dto_1.SlackBlockDto, {
type: constants_1.BlockType.Section,
text: helpers_1.getMarkdownObject(this.props.text),
fields: helpers_1.getFields(this.props.fields),
accessory: helpers_1.getBuilderResult(this.props.accessory),
});
}
}
exports.SectionBuilder = SectionBuilder;
helpers_1.applyMixins(SectionBuilder, [
methods_1.Accessory,
methods_1.BlockId,
methods_1.End,
methods_1.Fields,
methods_1.Text,
]);