UNPKG

jsx-slack

Version:

Build JSON object for Slack Block Kit surfaces from JSX

33 lines (32 loc) 1.61 kB
import { BuiltInComponent } from '../../jsx-internals'; import { ConfirmableProps } from '../composition/Confirm'; import { InputComponentProps } from '../layout/Input'; import { ActionProps, AutoFocusibleProps, SingleSelectableProps, MultiSelectablePropsFrom } from './utils'; interface SingleUsersSelectProps extends ActionProps, AutoFocusibleProps, ConfirmableProps, SingleSelectableProps { children?: never; /** A string of ID for the initially selected user. */ initialUser?: string; /** The placeholder text shown in select field. */ placeholder?: string; /** An alias into `initialUser` prop. */ value?: string; } interface MultiUsersSelectProps extends MultiSelectablePropsFrom<SingleUsersSelectProps, 'initialUser' | 'value'> { /** In multiple select, you can set multiple user IDs through array. */ initialUser?: string | string[]; value?: string | string[]; } export type UsersSelectProps = InputComponentProps<SingleUsersSelectProps | MultiUsersSelectProps>; /** * The interactive component or input component for * [the `users_select` element](https://api.slack.com/reference/block-kit/block-elements#users_select) and * [the `multi_users_select` element](https://api.slack.com/reference/block-kit/block-elements#users_multi_select). * * Provide a selectable menu element from a list of Slack users visible to the * current user in the active workspace. * * @return The partial JSON of a block element for selecting from users, or * `input` layout block with it */ export declare const UsersSelect: BuiltInComponent<UsersSelectProps>; export {};