UNPKG

1.35 kBTypeScriptView Raw
1import * as React from 'react';
2import { TreeNode, SHOW_ALL, SHOW_PARENT, SHOW_CHILD, TreeSelectProps as RcTreeSelectProps } from 'rc-tree-select';
3import { DefaultValueType } from 'rc-tree-select/lib/interface';
4import { SizeType } from '../config-provider/SizeContext';
5declare type RawValue = string | number;
6export interface LabeledValue {
7 key?: string;
8 value: RawValue;
9 label: React.ReactNode;
10}
11export declare type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[];
12export interface TreeSelectProps<T> extends Omit<RcTreeSelectProps<T>, 'showTreeIcon' | 'treeMotion' | 'inputIcon' | 'mode' | 'getInputElement' | 'backfill'> {
13 suffixIcon?: React.ReactNode;
14 size?: SizeType;
15 bordered?: boolean;
16}
17export interface RefTreeSelectProps {
18 focus: () => void;
19 blur: () => void;
20}
21declare const TreeSelectRef: <T extends DefaultValueType>(props: TreeSelectProps<T> & {
22 ref?: React.Ref<RefTreeSelectProps> | undefined;
23}) => React.ReactElement;
24declare type InternalTreeSelectType = typeof TreeSelectRef;
25interface TreeSelectInterface extends InternalTreeSelectType {
26 TreeNode: typeof TreeNode;
27 SHOW_ALL: typeof SHOW_ALL;
28 SHOW_PARENT: typeof SHOW_PARENT;
29 SHOW_CHILD: typeof SHOW_CHILD;
30}
31declare const TreeSelect: TreeSelectInterface;
32export { TreeNode };
33export default TreeSelect;