UNPKG

1.46 kBTypeScriptView Raw
1import * as React from 'react';
2import { OptionsType as SelectOptionsType, RenderNode } from './interface';
3import { RawValueType, FlattenOptionsType } from './interface/generator';
4export interface OptionListProps<OptionsType extends object[]> {
5 prefixCls: string;
6 id: string;
7 options: OptionsType;
8 flattenOptions: FlattenOptionsType<OptionsType>;
9 height: number;
10 itemHeight: number;
11 values: Set<RawValueType>;
12 multiple: boolean;
13 open: boolean;
14 defaultActiveFirstOption?: boolean;
15 notFoundContent?: React.ReactNode;
16 menuItemSelectedIcon?: RenderNode;
17 childrenAsData: boolean;
18 searchValue: string;
19 virtual: boolean;
20 onSelect: (value: RawValueType, option: {
21 selected: boolean;
22 }) => void;
23 onToggleOpen: (open?: boolean) => void;
24 /** Tell Select that some value is now active to make accessibility work */
25 onActiveValue: (value: RawValueType, index: number) => void;
26 onScroll: React.UIEventHandler<HTMLDivElement>;
27 /** Tell Select that mouse enter the popup to force re-render */
28 onMouseEnter?: React.MouseEventHandler;
29}
30export interface RefOptionListProps {
31 onKeyDown: React.KeyboardEventHandler;
32 onKeyUp: React.KeyboardEventHandler;
33 scrollTo?: (index: number) => void;
34}
35declare const RefOptionList: React.ForwardRefExoticComponent<OptionListProps<SelectOptionsType> & React.RefAttributes<RefOptionListProps>>;
36export default RefOptionList;