@veracity/vui
Version:
Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.
17 lines (16 loc) • 780 B
TypeScript
import { ChangeEvent } from "../utils/types.js";
import "../utils/index.js";
import { UseSelectProps } from "./useSelect.types.js";
import { SelectOptionData, SelectValue } from "./select.types.js";
//#region src/select/useSelect.d.ts
declare const getOptionText: (value: SelectValue, options: SelectOptionData[]) => SelectValue;
/** Handles controlled/uncontrolled value state. Supports single and multiple values. */
declare function useSelect(props: UseSelectProps): {
onChange: (e: ChangeEvent) => void;
value: SelectValue[] | SelectValue | undefined;
valueText: SelectValue | undefined;
};
type UseSelectReturnType = ReturnType<typeof useSelect>;
//#endregion
export { UseSelectReturnType, useSelect as default, getOptionText };
//# sourceMappingURL=useSelect.d.ts.map