// Type definitions for react-select v1.0.0
// Project: https://github.com/JedWatson/react-select
// Definitions by: ESQUIBET Hugo , Gilad Gray , Izaak Baker
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///
declare namespace ReactSelect {
interface AutocompleteResult {
/** the search-results to be displayed */
data: Option[],
/** Should be set to true, if and only if a longer query with the same prefix
* would return a subset of the results
* If set to true, more specific queries will not be sent to the server.
**/
complete: boolean;
}
interface Option {
/** Text for rendering */
label: string;
/** Value for searching */
value: string | number;
/**
* Allow this option to be cleared
* @default true
*/
clearableValue?: boolean;
}
interface MenuRendererProps {
/**
* The currently focused option; should be visible in the menu by default.
* default {}
*/
focusedOption: Option;
/**
* Callback to focus a new option; receives the option as a parameter.
*/
focusOption: (option: Option) => void;
/**
* Option labels are accessible with this string key.
*/
labelKey: string;
/**
* Ordered array of options to render.
*/
options: Option[];
/**
* Callback to select a new option; receives the option as a parameter.
*/
selectValue: (option: Option) => void;
/**
* Array of currently selected options.
*/
valueArray: Option[];
}
interface ReactSelectProps extends __React.Props {
/**
* text to display when `allowCreate` is true.
* @default 'Add "{label}"?'
*/
addLabelText?: string;
/**
* blurs the input element after a selection has been made. Handy for lowering the keyboard on mobile devices.
* @default false
*/
autoBlur?: boolean;
/**
* autofocus the component on mount
* @default false
*/
autofocus?: boolean;
/**
* If enabled, the input will expand as the length of its value increases
*/
autosize?: boolean;
/**
* whether pressing backspace removes the last item when there is no input value
* @default true
*/
backspaceRemoves?: boolean;
/**
* CSS className for the outer element
*/
className?: string;
/**
* title for the "clear" control when `multi` is true
* @default "Clear all"
*/
clearAllText?: string;
/**
* title for the "clear" control
* @default "Clear value"
*/
clearValueText?: string;
/**
* whether it is possible to reset value. if enabled, an X button will appear at the right side.
* @default true
*/
clearable?: boolean;
/**
* delimiter to use to join multiple values
* @default ","
*/
delimiter?: string;
/**
* whether the Select is disabled or not
* @default false
*/
disabled?: boolean;
/**
* whether escape clears the value when the menu is closed
* @default true
*/
escapeClearsValue?: boolean;
/**
* method to filter a single option
*/
filterOption?: (option: Option, filter: string) => Option;
/**
* method to filter the options array
*/
filterOptions?: (options: Array