jsx-slack
Version:
Build JSON object for Slack Block Kit surfaces from JSX
34 lines (33 loc) • 1.81 kB
TypeScript
import { BuiltInComponent } from '../../jsx-internals';
import { DistributedProps } from '../../utils';
import { ConfirmableProps } from '../composition/Confirm';
import { InputComponentProps } from '../layout/Input';
import { ActionProps, AutoFocusibleProps, SingleSelectableProps, MultiSelectablePropsFrom, ResponsableUrlProps } from './utils';
interface SingleChannelsSelectProps extends ActionProps, AutoFocusibleProps, ConfirmableProps, SingleSelectableProps {
children?: never;
/** A string of ID for the initially selected public channel. */
initialChannel?: string;
/** The placeholder text shown in select field. */
placeholder?: string;
/** An alias into `initialChannel` prop. */
value?: string;
}
interface MultiChannelsSelectProps extends MultiSelectablePropsFrom<SingleChannelsSelectProps, 'initialChannel' | 'value'> {
/** In multiple select, you can set multiple channel IDs through array. */
initialChannel?: string | string[];
value?: string | string[];
}
export type ChannelsSelectProps = DistributedProps<InputComponentProps<SingleChannelsSelectProps, ResponsableUrlProps> | InputComponentProps<MultiChannelsSelectProps>>;
/**
* The interactive component or input component for
* [the `channels_select` element](https://api.slack.com/reference/block-kit/block-elements#channel_select) and
* [the `multi_channels_select` element](https://api.slack.com/reference/block-kit/block-elements#channel_multi_select).
*
* Provide a selectable menu element from a list of _public_ channels visible to
* the current user in the active workspace.
*
* @return The partial JSON of a block element for selecting from channels, or
* `input` layout block with it
*/
export declare const ChannelsSelect: BuiltInComponent<ChannelsSelectProps>;
export {};