import * as React from 'react'; export interface FieldNamesType { value?: string; label?: string; children?: string; } export interface FilledFieldNamesType { value: string; label: string; children: string; } export interface ShowSearchType { filter?: (inputValue: string, path: CascaderOptionType[], names: FilledFieldNamesType) => boolean; render?: (inputValue: string, path: CascaderOptionType[], prefixCls: string | undefined, names: FilledFieldNamesType) => React.ReactNode; sort?: (a: CascaderOptionType[], b: CascaderOptionType[], inputValue: string, names: FilledFieldNamesType) => number; matchInputWidth?: boolean; limit?: number | false; } declare type OmitKeys = 'onPopupVisibleChange'; export interface CascaderProps extends Omit { style?: React.CSSProperties; className?: string; inputPrefixCls?: string; showSearch?: boolean | ShowSearchType; allowClear?: boolean; placeholder?: string; size?: string; notFoundContent?: React.ReactNode; displayRender?: (label: string[], selectedOptions?: CascaderOptionType[]) => React.ReactNode; onVisibleChange?: (popupVisible: boolean) => void; getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; } export interface CascaderState { inputFocused: boolean; inputValue: string; value: string[]; popupVisible: boolean | undefined; flattenOptions: CascaderOptionType[][] | undefined; prevProps: CascaderProps; } export interface CascaderOptionType { value?: string; label?: React.ReactNode; disabled?: boolean; children?: Array; [key: string]: any; } export interface RcCascaderProps { prefixCls?: string; transitionName?: string; defaultValue?: string[]; value?: string[]; options: CascaderOptionType[]; fieldNames?: FieldNamesType; popupVisible?: boolean; popupClassName?: string; builtinPlacements?: BuildInPlacements; popupPlacement?: string; expandTrigger?: CascaderExpandTrigger; onPopupVisibleChange?: (popupVisible: boolean) => unknown; dropdownMenuColumnStyle?: React.CSSProperties; disabled?: boolean; changeOnSelect?: boolean; esc?: boolean; expandIcon?: React.ReactNode; loadData?: (selectedOptions?: CascaderOptionType[]) => void; children?: React.ReactElement; onChange?: (value: string[], selectedOptions?: CascaderOptionType[]) => void; onKeyDown?: React.KeyboardEventHandler; } export interface AlignType { /** * move point of source node to align with point of target node. * Such as ['tr','cc'], align top right point of source node with center point of target node. * Point can be 't'(top), 'b'(bottom), 'c'(center), 'l'(left), 'r'(right) */ points?: string[]; /** * offset source node by offset[0] in x and offset[1] in y. * If offset contains percentage string value, it is relative to sourceNode region. */ offset?: number[]; /** * If adjustX field is true, will adjust source node in x direction if source node is invisible. * If adjustY field is true, will adjust source node in y direction if source node is invisible. */ overflow?: { adjustX?: boolean | number; adjustY?: boolean | number; }; } export declare type BuildInPlacements = Record; export declare type CascaderExpandTrigger = 'click' | 'hover'; export declare type SelectEvent = React.KeyboardEvent | React.MouseEvent; declare type OnSelect = (targetOption: CascaderOptionType, menuIndex: number, e?: SelectEvent) => void; export declare type SelectEventHandler = (event: SelectEvent) => void; export declare type DelayOnSelect = (onSelect?: OnSelect) => void; export declare type DelaySelectEventHandler = (event: React.MouseEvent) => ReturnType; export interface MenuItemProps extends React.HTMLProps { onClick: SelectEventHandler; onMouseEnter?: DelaySelectEventHandler; onMouseLeave?: DelaySelectEventHandler; ref?: (node: HTMLLIElement) => void; } export interface MenusProps { prefixCls?: string; dropdownMenuColumnStyle?: React.CSSProperties; value?: string[]; activeValue?: string[]; options: CascaderOptionType[]; expandTrigger: CascaderExpandTrigger; onSelect: OnSelect; visible?: boolean; defaultFieldNames: FieldNamesType; fieldNames: FieldNamesType; expandIcon: React.ReactNode; } export {};