UNPKG

1.45 kBTypeScriptView Raw
1import * as React from 'react';
2import { Option, OptGroup, SelectProps as RcSelectProps } from 'rc-select';
3import { OptionProps } from 'rc-select/lib/Option';
4import { SizeType } from '../config-provider/SizeContext';
5declare type RawValue = string | number;
6export { OptionProps };
7export declare type OptionType = typeof Option;
8export interface LabeledValue {
9 key?: string;
10 value: RawValue;
11 label: React.ReactNode;
12}
13export declare type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined;
14export interface InternalSelectProps<VT> extends Omit<RcSelectProps<VT>, 'mode'> {
15 suffixIcon?: React.ReactNode;
16 size?: SizeType;
17 mode?: 'multiple' | 'tags' | 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
18 bordered?: boolean;
19}
20export interface SelectProps<VT> extends Omit<InternalSelectProps<VT>, 'inputIcon' | 'mode' | 'getInputElement' | 'backfill'> {
21 mode?: 'multiple' | 'tags';
22}
23export interface RefSelectProps {
24 focus: () => void;
25 blur: () => void;
26}
27declare const SelectRef: <VT extends SelectValue = SelectValue>(props: SelectProps<VT> & {
28 ref?: React.Ref<RefSelectProps> | undefined;
29}) => React.ReactElement;
30declare type InternalSelectType = typeof SelectRef;
31interface SelectInterface extends InternalSelectType {
32 SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
33 Option: typeof Option;
34 OptGroup: typeof OptGroup;
35}
36declare const Select: SelectInterface;
37export default Select;