fox-block-builder
Version:
Maintainable code for loop slack-block-kit-like modal builder
58 lines (57 loc) • 2.18 kB
TypeScript
import { Builder } from '../lib';
import { SlackDto, SlackBlockDto } from '../dto';
export declare abstract class BuildToJSON extends Builder {
/**
* @description Builds the view and returns it as a Slack API-compatible JSON string.
*/
buildToJSON(): string;
}
export declare abstract class BuildToObject<T> extends Builder {
/**
* @description Builds the view and returns it as a Slack API-compatible object.
*/
buildToObject(): T;
}
export declare abstract class End extends Builder {
/**
* @description Performs no alterations to the object on which it is called. It is meant to simulate a closing HTML tag for those who prefer to have an explicit end declared for an object.
*
* {@link https://api.slack.com/block-kit|Open Official Slack Block Kit Documentation}
* {@link https://www.blockbuilder.dev|Open Block Builder Documentation}
*/
end(): this;
}
export declare abstract class GetAttachments extends Builder {
/**
* @description Builds the view and returns a Slack API-compatible array of attachments.
*
* {@link https://api.slack.com/reference/messaging/attachments|View in Slack API Documentation}
*/
getAttachments(): Readonly<SlackDto>[];
}
export declare abstract class GetBlocks extends Builder {
/**
* @description Builds the view and returns a Slack API-compatible array of blocks.
*
* {@link https://api.slack.com/block-kit|View in Slack API Documentation}
*/
getBlocks(): Readonly<SlackBlockDto>[];
}
export declare abstract class GetBlockId extends Builder {
/**
* @description Builds the block and returns its id
*/
getBlockId(): Readonly<string>;
}
export declare abstract class GetPreviewUrl extends Builder {
/**
* @description Builds the view and returns the preview URL in order to open and preview the view on Slack's Block Kit Builder web application.
*/
getPreviewUrl(): string;
}
export declare abstract class PrintPreviewUrl extends GetPreviewUrl {
/**
* @description Calls getPreviewUrl to build the preview URL and log it to the console.
*/
printPreviewUrl(): void;
}