import type { ExtractPropTypes, PropType } from 'vue'; import type { DataNode } from '../tree'; import PropTypes from '../_util/vue-types'; import type { FlattenDataNode, RawValueType } from './interface'; export function optionListProps() { return { prefixCls: String, id: String, options: { type: Array as PropType as PropType }, flattenOptions: { type: Array as PropType }, height: Number, itemHeight: Number, virtual: { type: Boolean, default: undefined }, values: { type: Set as PropType> }, multiple: { type: Boolean, default: undefined }, open: { type: Boolean, default: undefined }, defaultActiveFirstOption: { type: Boolean, default: undefined }, notFoundContent: PropTypes.any, menuItemSelectedIcon: PropTypes.any, childrenAsData: { type: Boolean, default: undefined }, searchValue: String, onSelect: { type: Function as PropType<(value: RawValueType, option: { selected: boolean }) => void>, }, onToggleOpen: { type: Function as PropType<(open?: boolean) => void> }, /** Tell Select that some value is now active to make accessibility work */ onActiveValue: { type: Function as PropType<(value: RawValueType, index: number) => void> }, onScroll: { type: Function as PropType<(e: UIEvent) => void> }, onMouseenter: { type: Function as PropType<() => void> }, }; } class Helper { Return = optionListProps(); } type FuncReturnType = Helper['Return']; export type OptionListProps = Partial>>;