UNPKG

fox-block-builder

Version:

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

37 lines (36 loc) 2.1 kB
import { SlackBlockDto, SlackDto } from '../internal/dto'; import type { BlockBuilder, Appendable } from '../internal/types'; import type { AttachmentBuilder, OptionBuilder, OptionGroupBuilder } from '../bits'; import { PluginFormDto } from '../plugin'; import { TPlanfixTaskAnalytic } from '../internal/types/analytics.types'; export * from './block-parser'; /** * @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>[]; /** Обработка аналитики блоков */ export declare function getModalAnalytics(form: PluginFormDto): TPlanfixTaskAnalytic[]; declare const utilities: { AttachmentCollection: typeof AttachmentCollection; BlockCollection: typeof BlockCollection; OptionCollection: typeof OptionCollection; OptionGroupCollection: typeof OptionGroupCollection; buildBlock: typeof buildBlock; buildBlocks: typeof buildBlocks; getModalAnalytics: typeof getModalAnalytics; }; export { utilities as Utilities };