import { GroupedSelectValues, InputSelectValue, PossibleSelectValue } from './InputSelect'; /** * Helper function to understand and refine type of a single selected value * @param selectedValue possible value returned from select component * @returns true if selected value is single, from this point TypeScript will treat this as `SelectValue` type */ export declare function isSingleValueSelected(selectedValue: PossibleSelectValue): selectedValue is InputSelectValue; /** * Helper function to understand and refine type of a set of selected values * @param selectedValue possible value returned from select component * @returns true if selected value is an array of selected values, from this point TypeScript will treat this as `SelectValue[]` type */ export declare function isMultiValueSelected(selectedValue: PossibleSelectValue): selectedValue is InputSelectValue[]; /** * Type-guard to check if prop `initialValues` is a GroupedSelectValues or SelectValue */ export declare function isGroupedSelectValues(initialValues?: GroupedSelectValues | InputSelectValue[]): initialValues is GroupedSelectValues; /** * Helper function to extract only a specific property from the `SelectValue` * @param selectedValue possible value returned from select component * @param pathToValue optional path.to.property. Default is `value` * @returns a string or an array of strings. * Examples: * ``` * flatSelectValues({value: 'ABCD', label: 'T-Shirt XL'}) * // returns 'ABCD' * * flatSelectValues([ * {value: 'ABCD', label: 'T-Shirt M'}, * {value: '1234', label: 'T-Shirt XL'}, * ], 'label') * // returns ['T-Shirt M', 'T-Shirt XL'] * ``` */ export declare function flatSelectValues(selectedValue: PossibleSelectValue, pathToValue?: string): null | string | Array; /** * To be used when storing the flatten value and there is the need * to retrieve the `defaultValue` to pass as prop * @param currentValue the current value that is being stored in app state * @param initialValues the array of SelectValue objects that should contain the `currentValue` * @param pathToValue optional path.to.property. Default is `value` * @returns the matched value or values, otherwise undefined. */ export declare function getDefaultValueFromFlatten({ currentValue, initialValues, pathToValue, }: { currentValue?: string | Array | null; initialValues?: GroupedSelectValues | InputSelectValue[]; pathToValue?: string; }): InputSelectValue | InputSelectValue[] | undefined;