UNPKG

fox-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.

31 lines (30 loc) 1.75 kB
import { SlackBlockDto, SlackDto } from '../internal/dto'; import type { BlockBuilder, Appendable } from '../internal/types'; import type { AttachmentBuilder, OptionBuilder, OptionGroupBuilder } from '../bits'; /** * @description Creates and returns an array of built blocks. Behaves in the same way as all appending methods, such as Surface.blocks(). */ export declare function BlockCollection(...blocks: Appendable<BlockBuilder>): Readonly<SlackBlockDto>[]; /** * @description Creates and returns an array of built attachments. Behaves in the same way as all appending methods, such as Message.attachments(). */ export declare function AttachmentCollection(...attachments: Appendable<AttachmentBuilder>): Readonly<SlackDto>[]; export declare function OptionCollection(...options: Appendable<OptionBuilder>): Readonly<SlackDto>[]; export declare function OptionGroupCollection(...optionGroups: Appendable<OptionGroupBuilder>): Readonly<SlackDto>[]; /** * @description Returns the block passed into the function as a built block, an object that conforms to the Slack API. */ export declare function buildBlock(block: BlockBuilder): Readonly<SlackBlockDto>; /** * @description Creates and returns an array of built blocks. Behaves in the same way as all appending methods, such as Surface.blocks(). */ export declare function buildBlocks(...blocks: Appendable<BlockBuilder>): Readonly<SlackBlockDto>[]; declare const utilities: { AttachmentCollection: typeof AttachmentCollection; BlockCollection: typeof BlockCollection; OptionCollection: typeof OptionCollection; OptionGroupCollection: typeof OptionGroupCollection; buildBlock: typeof buildBlock; buildBlocks: typeof buildBlocks; }; export { utilities as Utilities };