@types/react-virtualized-select
TypeScript icon, indicating that this package has built-in type declarations

3.0.17 • Public • Published

Installation

npm install --save @types/react-virtualized-select

Summary

This package contains type definitions for react-virtualized-select (https://github.com/bvaughn/react-virtualized-select).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-virtualized-select.

index.d.ts

import * as React from "react";
import {
    LoadOptionsHandler,
    OptionValues,
    ReactAsyncSelectProps,
    ReactCreatableSelectProps,
    ReactSelectProps,
} from "react-select";
import { ListProps } from "react-virtualized";

export interface VirtualizedOptionRenderOptions<T> {
    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<string, string>;
    valueArray: T[];
}

export interface AdditionalVirtualizedSelectProps<TValue> {
    maxHeight?: number | undefined;
    optionHeight?: number | ((options: { option: TValue }) => number) | undefined;
    optionRenderer?(options: VirtualizedOptionRenderOptions<TValue>): React.JSX.Element;
    selectComponent?: React.ComponentClass<any> | React.FunctionComponent<any> | undefined;
}

type VirtualizedSelectProps<TValue = OptionValues> =
    | (ReactCreatableSelectProps<TValue> & ReactAsyncSelectProps<TValue> & AdditionalVirtualizedSelectProps<TValue> & {
        async: true;
    })
    | ReactCreatableSelectProps<TValue> & ReactSelectProps<TValue> & AdditionalVirtualizedSelectProps<TValue>;

declare class VirtualizedSelect<TValue = OptionValues> extends React.PureComponent<VirtualizedSelectProps<TValue>> {}
export default VirtualizedSelect;

Additional Details

Credits

These definitions were written by Sean Kelley.

Versions

Current Tags

Version History

Package Sidebar

Install

npm i @types/react-virtualized-select

Weekly Downloads

3,277

Version

3.0.17

License

MIT

Unpacked Size

5.79 kB

Total Files

5

Last publish

Collaborators

  • types