From af2acebec6452c8ff1009d1bdc20ff49a9e1c059 Mon Sep 17 00:00:00 2001 From: Claas Ahlrichs Date: Mon, 27 Aug 2018 08:25:06 +0200 Subject: [PATCH] updated types for react-select/lib/components --- types/react-select/lib/animated/index.d.ts | 4 +-- types/react-select/lib/components/Menu.d.ts | 4 +-- types/react-select/lib/components/index.d.ts | 36 +++----------------- 3 files changed, 9 insertions(+), 35 deletions(-) diff --git a/types/react-select/lib/animated/index.d.ts b/types/react-select/lib/animated/index.d.ts index 6760d55e81..c5180398b8 100644 --- a/types/react-select/lib/animated/index.d.ts +++ b/types/react-select/lib/animated/index.d.ts @@ -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(externalComponents?: SelectComponents): SelectComponents; +export function makeAnimated(externalComponents?: SelectComponentsConfig): SelectComponents; export const Input: ComponentType; export const MultiValue: ComponentType>; diff --git a/types/react-select/lib/components/Menu.d.ts b/types/react-select/lib/components/Menu.d.ts index 0af2bf16c1..387b538882 100644 --- a/types/react-select/lib/components/Menu.d.ts +++ b/types/react-select/lib/components/Menu.d.ts @@ -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; minHeight: number; diff --git a/types/react-select/lib/components/index.d.ts b/types/react-select/lib/components/index.d.ts index d9d505b119..1436336d26 100644 --- a/types/react-select/lib/components/index.d.ts +++ b/types/react-select/lib/components/index.d.ts @@ -81,36 +81,10 @@ export interface SelectComponents { export type SelectComponentsConfig = Partial>; -export namespace components { - const ClearIndicator: IndicatorComponentType | null; - const Control: ComponentType>; - const DropdownIndicator: IndicatorComponentType | null; - const DownChevron: ComponentType; - const CrossIcon: ComponentType; - const Group: ComponentType>; - const GroupHeading: ComponentType; - const IndicatorsContainer: ComponentType>; - const IndicatorSeparator: IndicatorComponentType | null; - const Input: ComponentType; - const LoadingIndicator: ComponentType> | null; - const Menu: ComponentType>; - const MenuList: ComponentType>; - const MenuPortal: ComponentType>; - const LoadingMessage: ComponentType>; - const NoOptionsMessage: ComponentType>; - const MultiValue: ComponentType>; - const MultiValueContainer: ComponentType; - const MultiValueLabel: ComponentType; - const MultiValueRemove: ComponentType; - const Option: ComponentType>; - const Placeholder: ComponentType>; - const SelectContainer: ComponentType>; - const SingleValue: ComponentType>; - const ValueContainer: ComponentType>; +export const components: Required>; + +export interface Props { + components: SelectComponentsConfig; } -export interface Props { - components: SelectComponentsConfig; -} - -export function defaultComponents(props: Props): SelectComponentsConfig; +export function defaultComponents(props: Props): SelectComponents;