fox-block-builder
Version:
Maintainable code for loop slack-block-kit-like modal builder
57 lines (56 loc) • 2.54 kB
TypeScript
import { FetchValuesParams } from '..';
import { PlainTextObject } from '../objects';
import { FoxKnownBlock } from './blocks.interfaces';
interface FoxBaseView {
/** @description An array of {@link AnyBlock} that defines the content of the view. Max of 100 blocks. */
blocks: FoxKnownBlock[];
/**
* @description String that will be sent to your app in
* {@link https://api.slack.com/reference/interaction-payloads/views#view_submission `view_submission`} and
* {@link https://api.slack.com/reference/interaction-payloads/block-actions `block_actions`} events.
* Maximum length of 3000 characters.
*/
private_metadata?: string;
/**
* @description An identifier to recognize interactions and submissions of this particular view. Don't use this to
* store sensitive information (use `private_metadata` instead). Maximum length of 255 characters.
* @see {@link https://api.slack.com/surfaces/modals#interactions Handling and responding to interactions}.
*/
callback_id?: string;
}
export interface FoxModalView extends FoxBaseView {
/** @description The type of view. Set to `modal` for modals. */
type: 'modal';
/**
* @description The title that appears in the top-left of the modal. Must be a {@link PlainTextObject} with a
* maximum length of 24 characters.
*/
title: PlainTextObject;
/**
* @description An optional {@link PlainTextObject} that defines the text displayed in the close button at the
* bottom-right of the view. Maximum length of 24 characters.
*/
close?: PlainTextObject;
/**
* @description An optional {@link PlainTextObject} that defines the text displayed in the submit button at the
* bottom-right of the view. `submit` is required when an input block is within the `blocks` array. Max length of 24
* characters.
*/
submit?: PlainTextObject;
/**
* @description When set to `true`, clicking on the close button will clear all views in a modal and close it.
* Defaults to `false`.
*/
clear_on_close?: boolean;
/**
* @description Indicates whether Slack will send your app a
* {@link https://api.slack.com/reference/interaction-payloads/views#view_closed `view_closed`} event when a user
* clicks the close button. Defaults to `false`.
*/
notify_on_close?: boolean;
/**
* @description Запрос изначальных данных для блоков
*/
fetchValues?: FetchValuesParams;
}
export {};