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.
79 lines (78 loc) • 2.29 kB
TypeScript
/**
* @description Wraps a string in quotation marks.
*/
export declare function quote(string: string): string;
/**
* @description Makes a string a block quote.
*/
export declare function blockquote(string: string): string;
/**
* @description Makes a string bold.
*/
export declare function bold(string: string): string;
/**
* @description Makes a string italic.
*/
export declare function italic(string: string): string;
/**
* @description Strikes out a string.
*/
export declare function strike(string: string): string;
/**
* @description Turns a string into an inline block of code.
*/
export declare function codeInline(string: string): string;
/**
* @description Turns a string into a multi-line block of code.
*/
export declare function codeBlock(string: string): string;
/**
* @description Formats multiple strings into a dashed list.
*/
export declare function listDash(...items: Array<string | string[]>): string;
/**
* @description Formats multiple strings into a bulleted list.
*/
export declare function listBullet(...items: Array<string | string[]>): string;
/**
* @description Formats a URL into a clickable link, with an optional alias.
*/
export declare function link(url: string, alias?: string): string;
/**
* @description Formats an email address into a clickable link.
*/
export declare function mailto(email: string, alias: string): string;
/**
* @description Creates a named emoji in the colon format.
*/
export declare function emoji(name: string): string;
/**
* @description Mentions a user in a channel.
*/
export declare function user(id: string): string;
/**
* @description Creates a clickable link to a channel.
*/
export declare function channel(id: string): string;
/**
* @description Mentions a Slack user group.
*/
export declare function group(id: string): string;
declare const md: {
quote: typeof quote;
blockquote: typeof blockquote;
bold: typeof bold;
italic: typeof italic;
strike: typeof strike;
codeInline: typeof codeInline;
codeBlock: typeof codeBlock;
listDash: typeof listDash;
listBullet: typeof listBullet;
link: typeof link;
mailto: typeof mailto;
emoji: typeof emoji;
user: typeof user;
channel: typeof channel;
group: typeof group;
};
export { md as Md };