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.
70 lines (69 loc) • 3.35 kB
JavaScript
;
/* eslint-disable max-len */
Object.defineProperty(exports, "__esModule", { value: true });
exports.Surfaces = exports.WorkflowStep = exports.Modal = exports.Message = exports.HomeTab = void 0;
const home_tab_1 = require("./home-tab");
const message_1 = require("./message");
const modal_1 = require("./modal");
const workflow_step_1 = require("./workflow-step");
/**
* Functions here do not use arrow functions stored in variables for IDE color compatibility.
*/
/**
* @param {Object} [params] Parameters passed to the constructor.
* @param {string} [params.callbackId] Sets a string sent back to your server together with all action and submission events.
* @param {string} [params.externalId] Sets a custom identifier that must be unique for all views on a per-team basis.
* @param {string} [params.privateMetaData] Sets a string sent back to your server together with all action and submission events.
*
* {@link https://api.slack.com/surfaces/tabs|View in Slack API Documentation}
*/
function HomeTab(params) {
return new home_tab_1.HomeTabBuilder(params);
}
exports.HomeTab = HomeTab;
/**
* @param {Object} [params] Parameters passed to the constructor.
* @param {string} [params.channel] The Slack channel ID to which the message is to be sent.
* @param {string} [params.text] Text to be displayed in the notification on the Message, or in the body, if there are no Blocks available.
* @param {timestamp} [params.threadTs] Sets the message to be a reply in a thread to the message whose timestamp is passed.
* @param {timestamp} [params.postAt] Sets a time for the message to be posted, as a scheduled message.
*
* {@link https://api.slack.com/messaging/composing|View in Slack API Documentation}
*/
function Message(params) {
return new message_1.MessageBuilder(params);
}
exports.Message = Message;
/**
* @param {Object} [params] Parameters passed to the constructor.
* @param {string} [params.title] Sets a title for your modal.
* @param {string} [params.close] Sets the text for the close button.
* @param {string} [params.submit] Sets the text for the submit button.
* @param {string} [params.callbackId] Sets a string sent back to your server together with all action and submission events.
* @param {string} [params.externalId] Sets a custom identifier that must be unique for all views on a per-team basis.
* @param {string} [params.privateMetaData] Sets a string sent back to your server together with all action and submission events.
*
* {@link https://api.slack.com/reference/surfaces/views|View in Slack API Documentation}
*/
function Modal(params) {
return new modal_1.ModalBuilder(params);
}
exports.Modal = Modal;
/**
* @param {Object} [params] Parameters passed to the constructor.
* @param {string} [params.callbackId] Sets a string sent back to your server together with all action and submission events.
* @param {string} [params.privateMetaData] Sets a string sent back to your server together with all action and submission events.
*
* {@link https://api.slack.com/reference/surfaces/views|View in Slack API Documentation}
*/
function WorkflowStep(params) {
return new workflow_step_1.WorkflowStepBuilder(params);
}
exports.WorkflowStep = WorkflowStep;
const surfaces = {
HomeTab,
Message,
Modal,
WorkflowStep,
};
exports.Surfaces = surfaces;