import React, { ComponentType } from 'react'; import { MultiSelectProps as BPMultiSelectProps } from '@blueprintjs/select'; import { FieldBaseProps } from '@blueprintjs-formik/core'; import { FormikItemRenderer, SelectOptionProps } from './types'; interface MultiSelectCommonProps { itemRenderer?: FormikItemRenderer; onItemSelect?: (item: T, event?: React.SyntheticEvent) => void; selectedItems?: T[]; tagRenderer?: (item: T) => React.ReactNode; valueAccessor?: string; labelAccessor?: string; textAccessor?: string; tagAccessor?: string; noResultsText?: string; onCreateItemSelect?: (item: T, event?: React.SyntheticEvent) => void; } interface BaseMultiSelectProps extends Omit, 'itemRenderer' | 'onItemSelect' | 'selectedItems' | 'tagRenderer'>, MultiSelectCommonProps { } export interface MultiSelectProps extends BaseMultiSelectProps { selectedValues?: (string | number)[]; initialSelectedValues?: (string | number)[]; onValuesChange?: (values: (string | number)[]) => void; } export interface FormikMultiSelectProps extends Omit, BaseMultiSelectProps { name: string; } /** * MultiSelect component (standalone, not bound to Formik). * @param {MultiSelectProps} props * @returns {JSX.Element} */ export declare function MultiSelect(props: MultiSelectProps): JSX.Element; /** * Props for the Formik-bound MultiSelect component created by withFormikMultiSelect. */ export type WithFormikMultiSelectProps = Omit, 'selectedValues' | 'onValuesChange' | 'initialSelectedValues'> & Omit & { name: string; }; /** * Higher-Order Component that wraps a MultiSelect component to bind it with Formik. * * @example * ```tsx * const FormikBoundMultiSelect = withFormikMultiSelect(MultiSelect); * * // Usage in a Formik form: * * ``` * * @param WrappedComponent - The MultiSelect component to wrap * @returns A new component that is bound to Formik */ export declare function withFormikMultiSelect(WrappedComponent: ComponentType>): { (props: WithFormikMultiSelectProps): JSX.Element; displayName: string; }; /** * MultiSelect component bound to Formik. Built using withFormikMultiSelect HOC. * @exports * @param {FormikMultiSelectProps} props * @returns {JSX.Element} */ export declare const FormikMultiSelect: (props: WithFormikMultiSelectProps) => JSX.Element; /** * @deprecated Use FormikMultiSelect instead. This alias is provided for backwards compatibility. */ export declare const MultiSelectField: (props: WithFormikMultiSelectProps) => JSX.Element; export {};