jsx-slack
Version:
Build JSON object for Slack Block Kit surfaces from JSX
60 lines (59 loc) • 2.85 kB
TypeScript
import { ConversationsSelect, PlainTextElement } from '@slack/types';
import { JSXSlack } from '../../jsx';
type DispatchActionConfigTriggerActionsOn = 'onEnterPressed' | 'onCharacterEntered';
type FilterComposition = ConversationsSelect['filter'];
type FilterIncludeKind = 'im' | 'mpim' | 'private' | 'public';
declare const spaceSeparatedDispatchActionConfigTriggerActionsOn: unique symbol;
type SpaceSeparatedDispatchActionConfigTriggerActionsOn = string & {
[spaceSeparatedDispatchActionConfigTriggerActionsOn]?: never;
};
declare const spaceSeparatedFilterIncludeKind: unique symbol;
type SpaceSeparatedFilterIncludeKind = string & {
[spaceSeparatedFilterIncludeKind]?: never;
};
export interface FilterProps {
/**
* An array of the kind of conversation types, or a string of space-separated
* conversation types, to indicate which types are included in the list.
*
* - `im`: Direct message
* - `mpim`: Group direct message
* - `private`: Private channel
* - `public`: Public channel
*
* By default, all conversation types are included.
*/
include?: FilterIncludeKind | FilterIncludeKind[] | SpaceSeparatedFilterIncludeKind;
/**
* A boolean value whether to exclude external
* [shared channels](https://api.slack.com/apis/channels-between-orgs) from
* conversations list.
*/
excludeExternalSharedChannels?: boolean;
/** A boolean value whether to exclude bot users from conversations list. */
excludeBotUsers?: boolean;
}
export interface DispatchActionConfigComposition {
trigger_actions_on?: ('on_enter_pressed' | 'on_character_entered')[];
}
export interface InputDispatchActionProps {
/**
* @doc-input-dispatch-action
* If defined interaction type(s) as space-separated string or array, you can
* determine when the text input component will return the payload, as same as
* [defining `dispatch_action_config` in Slack API](https://api.slack.com/reference/block-kit/composition-objects#dispatch_action_config).
*
* - `onEnterPressed`: Payload is dispatched when hitting Enter key while
* focusing to the input component.
* - `onCharacterEntered`: Payload is dispatched when changing input
* characters.
*/
dispatchAction?: boolean | DispatchActionConfigTriggerActionsOn | DispatchActionConfigTriggerActionsOn[] | SpaceSeparatedDispatchActionConfigTriggerActionsOn;
}
export declare const plainText: (textOrElements: JSXSlack.ChildElements, { emoji, layoutTags, }?: {
emoji?: boolean | undefined;
layoutTags?: boolean | undefined;
}) => PlainTextElement;
export declare const filter: (props: FilterProps) => FilterComposition;
export declare const inputDispatchActionConfig: (props: InputDispatchActionProps) => DispatchActionConfigComposition | undefined;
export {};