// Type definitions for react-virtualized-select 3.0 // Project: https://github.com/bvaughn/react-virtualized-select // Definitions by: Sean Kelley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import * as React from "react"; import { ReactSelectProps } from "react-select"; import { ListProps } from "react-virtualized"; export interface VirtualizedOptionRenderOptions { focusedOption: T; focusedOptionIndex: number; focusOption(option: T): void; key: string; labelKey: keyof T; listProps: ListProps; option: T; options: T[]; selectValue(option: T): void; style: Record; valueArray: T[]; } /** * Dummy interface to allow `VirtualizedSelectProps` to have an `optionRenderer` type * incompatible with the one in `ReactSelectProps`. */ interface VirtualizedSelectPropsBase extends ReactSelectProps { optionRenderer?: any; } export interface VirtualizedSelectProps extends VirtualizedSelectPropsBase { async?: boolean; maxHeight?: number; optionHeight?: number; optionRenderer?(options: VirtualizedOptionRenderOptions): JSX.Element; selectComponent?: React.ComponentClass | React.StatelessComponent; } declare class VirtualizedSelect extends React.PureComponent {} export default VirtualizedSelect;