import React, { ComponentType } from 'react'; import { ButtonProps as BPButtonProps } from '@blueprintjs/core'; import { SelectProps as BPSelectProps, ItemRenderer } from '@blueprintjs/select'; import { FieldBaseProps } from '@blueprintjs-formik/core'; import { Accessor, SelectOptionProps } from './types'; interface SelectCommonProps { itemRenderer?: ItemRenderer; onItemSelect?: (item: T, event?: React.SyntheticEvent) => void; onItemChange?: (item: T, event?: React.SyntheticEvent) => void; onCreateItemSelect?: (item: T, event?: React.SyntheticEvent) => void; input?: (props: { activeItem: T | null; label: string; text: string; value: string | number; }) => React.ReactNode; noResultsText?: string; placeholder?: string; buttonProps?: Partial; valueAccessor?: Accessor; labelAccessor?: Accessor; textAccessor?: Accessor; } interface BaseSelectProps extends Omit, 'itemRenderer' | 'onItemSelect' | 'children'>, SelectCommonProps { } export interface SelectProps extends BaseSelectProps { selectedValue?: string | number; initialSelectedValue?: string | number; onValueChange?: (value: string | number | null) => void; } export interface FormikSelectProps extends Omit, BaseSelectProps { name: string; } /** * Select component (standalone, not bound to Formik). * @param {SelectProps} props * @returns {JSX.Element} */ export declare function Select(props: SelectProps): JSX.Element; /** * Props for the Formik-bound Select component created by withFormikSelect. */ export type WithFormikSelectProps = Omit, 'selectedValue' | 'onValueChange' | 'initialSelectedValue'> & Omit & { name: string; }; /** * Higher-Order Component that wraps a Select component to bind it with Formik. * * @example * ```tsx * const FormikBoundSelect = withFormikSelect(Select); * * // Usage in a Formik form: * * ``` * * @param WrappedComponent - The Select component to wrap * @returns A new component that is bound to Formik */ export declare function withFormikSelect(WrappedComponent: ComponentType>): { (props: WithFormikSelectProps): JSX.Element; displayName: string; }; /** * Select component bound to Formik. * Built using withFormikSelect HOC. * @exports * @param {FormikSelectProps} props * @returns {JSX.Element} */ export declare const FormikSelect: (props: WithFormikSelectProps) => JSX.Element; /** * @deprecated Use FormikSelect instead. This alias is provided for backwards compatibility. */ export declare const SelectField: (props: WithFormikSelectProps) => JSX.Element; export {};