UNPKG

fox-block-builder

Version:

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

50 lines (49 loc) 2.81 kB
import { AttachmentBuilder, AttachmentParams } from './attachment'; import { ConfirmationDialogBuilder, ConfirmationDialogParams } from './confirmation-dialog'; import { OptionBuilder, OptionParams } from './option'; import { OptionGroupBuilder, OptionGroupParams } from './option-group'; export type { AttachmentBuilder, AttachmentParams, ConfirmationDialogBuilder, ConfirmationDialogParams, OptionBuilder, OptionParams, OptionGroupBuilder, OptionGroupParams, }; /** * 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} */ export declare function Attachment(params?: AttachmentParams): AttachmentBuilder; /** * @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} */ export declare function ConfirmationDialog(params?: ConfirmationDialogParams): ConfirmationDialogBuilder; /** * @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} */ export declare function Option(params?: OptionParams): OptionBuilder; /** * @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} */ export declare function OptionGroup(params?: OptionGroupParams): OptionGroupBuilder; declare const bits: { Attachment: typeof Attachment; ConfirmationDialog: typeof ConfirmationDialog; Option: typeof Option; OptionGroup: typeof OptionGroup; }; export { bits as Bits };