1 | import { ComponentType, ReactElement, ReactNode, Ref as ElementRef } from 'react';
|
2 | import { CSSObject } from '@emotion/serialize';
|
3 |
|
4 | import { borderRadius, colors, spacing } from '../theme';
|
5 | import { CommonProps, GroupTypeBase, OptionTypeBase } from '../types';
|
6 |
|
7 | interface State {
|
8 |
|
9 | isDisabled: boolean;
|
10 |
|
11 | isFocused: boolean;
|
12 |
|
13 | menuIsOpen: boolean;
|
14 | }
|
15 |
|
16 | export type ControlProps<
|
17 | OptionType extends OptionTypeBase,
|
18 | IsMulti extends boolean,
|
19 | GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
|
20 | > = CommonProps<OptionType, IsMulti, GroupType> &
|
21 | State & {
|
22 |
|
23 | children: ReactNode;
|
24 | innerRef: ElementRef<any>;
|
25 |
|
26 | innerProps: {
|
27 | onMouseDown: (event: React.MouseEvent<HTMLElement>) => void;
|
28 | };
|
29 | };
|
30 |
|
31 | export function css(state: State): CSSObject;
|
32 |
|
33 | declare function Control<
|
34 | OptionType extends OptionTypeBase,
|
35 | IsMulti extends boolean,
|
36 | GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
|
37 | // tslint:disable-next-line:no-unnecessary-generics
|
38 | >(props: ControlProps<OptionType, IsMulti, GroupType>): ReactElement;
|
39 |
|
40 | export default Control;
|