updated types for react-select/lib/components

This commit is contained in:
Claas Ahlrichs
2018-08-27 08:25:06 +02:00
parent 5e58f71c5e
commit af2acebec6
3 changed files with 9 additions and 35 deletions

View File

@@ -1,12 +1,12 @@
import { ComponentType } from 'react';
import { SelectComponents, defaultComponents } from '../components/index';
import { SelectComponents, SelectComponentsConfig } from '../components/index';
import { default as AnimatedInput, AnimatedInputProps } from './Input';
import { default as AnimatedMultiValue, AnimatedMultiValueProps } from './MultiValue';
import { default as AnimatedPlaceholder, AnimatedPlaceholderProps } from './Placeholder';
import { default as AnimatedSingleValue, AnimatedSingleValueProps } from './SingleValue';
import { default as AnimatedValueContainer, AnimatedValueContainerProps } from './ValueContainer';
export function makeAnimated<OptionType>(externalComponents?: SelectComponents<OptionType>): SelectComponents<OptionType>;
export function makeAnimated<OptionType>(externalComponents?: SelectComponentsConfig<OptionType>): SelectComponents<OptionType>;
export const Input: ComponentType<AnimatedInputProps>;
export const MultiValue: ComponentType<AnimatedMultiValueProps<any>>;

View File

@@ -30,8 +30,8 @@ import {
// Get Menu Placement
// ------------------------------
interface MenuState { placement: 'bottom' | 'top' | null; maxHeight: number; }
interface PlacementArgs {
export interface MenuState { placement: 'bottom' | 'top' | null; maxHeight: number; }
export interface PlacementArgs {
maxHeight: number;
menuEl: ElementRef<any>;
minHeight: number;

View File

@@ -81,36 +81,10 @@ export interface SelectComponents<OptionType> {
export type SelectComponentsConfig<OptionType> = Partial<SelectComponents<OptionType>>;
export namespace components {
const ClearIndicator: IndicatorComponentType<any> | null;
const Control: ComponentType<ControlProps<any>>;
const DropdownIndicator: IndicatorComponentType<any> | null;
const DownChevron: ComponentType<any>;
const CrossIcon: ComponentType<any>;
const Group: ComponentType<GroupProps<any>>;
const GroupHeading: ComponentType<any>;
const IndicatorsContainer: ComponentType<IndicatorContainerProps<any>>;
const IndicatorSeparator: IndicatorComponentType<any> | null;
const Input: ComponentType<InputProps>;
const LoadingIndicator: ComponentType<LoadingIconProps<any>> | null;
const Menu: ComponentType<MenuProps<any>>;
const MenuList: ComponentType<MenuListComponentProps<any>>;
const MenuPortal: ComponentType<MenuPortalProps<any>>;
const LoadingMessage: ComponentType<NoticeProps<any>>;
const NoOptionsMessage: ComponentType<NoticeProps<any>>;
const MultiValue: ComponentType<MultiValueProps<any>>;
const MultiValueContainer: ComponentType<any>;
const MultiValueLabel: ComponentType<any>;
const MultiValueRemove: ComponentType<any>;
const Option: ComponentType<OptionProps<any>>;
const Placeholder: ComponentType<PlaceholderProps<any>>;
const SelectContainer: ComponentType<ContainerProps<any>>;
const SingleValue: ComponentType<SingleValueProps<any>>;
const ValueContainer: ComponentType<ValueContainerProps<any>>;
export const components: Required<SelectComponents<any>>;
export interface Props<OptionType> {
components: SelectComponentsConfig<OptionType>;
}
export interface Props {
components: SelectComponentsConfig<any>;
}
export function defaultComponents(props: Props): SelectComponentsConfig<any>;
export function defaultComponents<OptionType>(props: Props<OptionType>): SelectComponents<OptionType>;