import { ReactNode } from 'react'; import { OptionDefinition, OptionGroup as OptionGroupDefinition } from '../internal/components/option/interfaces'; import { NonCancelableEventHandler } from '../internal/events'; import { BaseSelectProps } from '../select/interfaces'; export interface MultiselectProps extends BaseSelectProps { /** * Specifies the currently selected options. * Provide an empty array to clear the selection. */ selectedOptions: ReadonlyArray; /** * Specifies an inline label that appears next to the multiselect trigger. */ inlineLabelText?: string; /** * Determines whether the dropdown list stays open after the user selects an item. */ keepOpen?: boolean; /** * Specifies the maximum number of displayed tokens. If the property isn't set, all of the tokens are displayed. */ tokenLimit?: number; /** * Hides the tokens displayed underneath the component. * Only use this if the selected options are displayed elsewhere on the page. */ hideTokens?: boolean; /** * Shows tokens inside the trigger instead of below it. */ inlineTokens?: boolean; /** * Specifies an `aria-label` for the token deselection button. * @i18n */ deselectAriaLabel?: MultiselectProps.DeselectAriaLabelFunction; /** * An object containing all the localized strings required by the component. * * * `selectAllText` (string) - Specifies the text to be displayed next to the checkbox that selects or deselects all options. * * `tokenLimitShowFewer` (string) - Specifies the text to be displayed in the "Show fewer" button for the token group control. * * `tokenLimitShowMore` (string) - Specifies the text to be displayed in the "Show more" button for the token group control. This string should not contain the number of hidden tokens * because this will be added by the component automatically. * @i18n */ i18nStrings?: MultiselectProps.I18nStrings; /** * Called when the user selects or deselects an option. * The event `detail` contains the current `selectedOptions`. */ onChange?: NonCancelableEventHandler; /** * Automatically focuses the trigger when component is mounted. */ autoFocus?: boolean; /** * Adds an aria-label to the "Show fewer" button for the token group control. * Use to assign unique labels when there are multiple token groups with the same `tokenLimitShowFewer` label on one page. */ tokenLimitShowFewerAriaLabel?: string; /** * Adds an aria-label to the "Show more" button for the token group control. * Use to assign unique labels when there are multiple token groups with the same `tokenLimitShowMore` label on one page. */ tokenLimitShowMoreAriaLabel?: string; /** * Enables users to select and deselect all options with a special extra checkbox which is displayed at the start of the dropdown. */ enableSelectAll?: boolean; /** * Specifies a render function to render custom options in the dropdown menu. * * @awsuiSystem core */ renderOption?: MultiselectProps.MultiselectOptionItemRenderer; } export declare namespace MultiselectProps { type Option = OptionDefinition; type OptionGroup = OptionGroupDefinition; type Options = ReadonlyArray