import { CSSObject } from '@emotion/react'; import { Props } from './Select'; import { StylesProps } from './styles'; export interface GroupBase { readonly options: readonly Option[]; readonly label?: string; } export declare type OptionsOrGroups> = readonly (Option | Group)[]; export declare type Options = readonly Option[]; export declare type SingleValue = Option | null; export declare type MultiValue = readonly Option[]; export declare type PropsValue = MultiValue | SingleValue; export declare type OnChangeValue = IsMulti extends true ? MultiValue : SingleValue; export interface Colors { primary: string; primary75: string; primary50: string; primary25: string; danger: string; dangerLight: string; neutral0: string; neutral5: string; neutral10: string; neutral20: string; neutral30: string; neutral40: string; neutral50: string; neutral60: string; neutral70: string; neutral80: string; neutral90: string; } export interface ThemeSpacing { baseUnit: number; controlHeight: number; menuGutter: number; } export interface Theme { borderRadius: number; colors: Colors; spacing: ThemeSpacing; } export declare type ClassNamesState = { [key: string]: boolean; }; export declare type CX = (state: ClassNamesState, ...classNames: (string | undefined)[]) => string; export declare type GetStyles> = >(propertyName: Key, props: StylesProps[Key]) => CSSObjectWithLabel; export interface CommonProps> { clearValue: () => void; cx: CX; /** Get the styles of a particular part of the select. Pass in the name of the property as the first argument, and the current props as the second argument. See the `styles` object for the properties available. */ getStyles: GetStyles; getClassNames: >(propertyName: Key, props: StylesProps[Key]) => string | undefined; getValue: () => Options; hasValue: boolean; isMulti: boolean; isRtl: boolean; options: OptionsOrGroups; selectOption: (newValue: Option) => void; selectProps: Props; setValue: (newValue: OnChangeValue, action: SetValueAction, option?: Option) => void; theme: Theme; } export interface CommonPropsAndClassName> extends CommonProps { className?: string | undefined; } export interface ActionMetaBase { option?: Option | undefined; removedValue?: Option; removedValues?: Options; name?: string; } export interface SelectOptionActionMeta extends ActionMetaBase { action: 'select-option'; option: Option | undefined; name?: string; } export interface DeselectOptionActionMeta extends ActionMetaBase { action: 'deselect-option'; option: Option | undefined; name?: string; } export interface RemoveValueActionMeta extends ActionMetaBase { action: 'remove-value'; removedValue: Option; name?: string; } export interface PopValueActionMeta extends ActionMetaBase { action: 'pop-value'; removedValue: Option; name?: string; } export interface ClearActionMeta extends ActionMetaBase { action: 'clear'; removedValues: Options; name?: string; } export interface CreateOptionActionMeta extends ActionMetaBase { action: 'create-option'; name?: string; option: Option; } export interface InitialInputFocusedActionMeta extends ActionMetaBase { action: 'initial-input-focus'; value: OnChangeValue; options?: Options; } export declare type ActionMeta = SelectOptionActionMeta | DeselectOptionActionMeta | RemoveValueActionMeta | PopValueActionMeta | ClearActionMeta | CreateOptionActionMeta; export declare type SetValueAction = 'select-option' | 'deselect-option'; export declare type InputAction = 'set-value' | 'input-change' | 'input-blur' | 'menu-close'; export interface InputActionMeta { action: InputAction; /** The previous value of the search input. */ prevInputValue: string; } export declare type MenuPlacement = 'auto' | 'bottom' | 'top'; export declare type CoercedMenuPlacement = 'bottom' | 'top'; export declare type MenuPosition = 'absolute' | 'fixed'; export declare type FocusDirection = 'up' | 'down' | 'pageup' | 'pagedown' | 'first' | 'last'; export declare type GetOptionLabel = (option: Option) => string; export declare type GetOptionValue = (option: Option) => string; export declare type CSSObjectWithLabel = CSSObject & { label?: string; };