mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* feat(prop-types): use conditional types for better prop type inference * fix(tests): fix publish tests * fix(prop-types): add custom prop validator, and switch requireables * fix(test): revert ReactFragment change * fix(prop-types): namespace imports from react like a good boy * CR changes * actually remove param from validator * remove anyvalidationmap * everyday i'm test...ering * SEMICOLONS WHY * retain null in undefaultize
37 lines
1.5 KiB
TypeScript
37 lines
1.5 KiB
TypeScript
// Type definitions for react-virtualized-select 3.0
|
|
// Project: https://github.com/bvaughn/react-virtualized-select
|
|
// Definitions by: Sean Kelley <https://github.com/seansfkelley>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.8
|
|
|
|
import * as React from "react";
|
|
import { ReactSelectProps, ReactAsyncSelectProps, ReactCreatableSelectProps, LoadOptionsHandler, OptionValues } 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;
|
|
optionHeight?: number;
|
|
optionRenderer?(options: VirtualizedOptionRenderOptions<TValue>): JSX.Element;
|
|
selectComponent?: React.ComponentClass<any> | React.StatelessComponent<any>;
|
|
}
|
|
|
|
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;
|