import * as React from 'react'; import Input, { InputProps } from './Input'; export interface SearchProps extends InputProps { inputPrefixCls?: string; onSearch?: (value: string) => any; enterButton?: boolean | React.ReactNode; allowClear?: boolean | React.ReactNode; clearIcon?: React.ReactNode; } export default class Search extends React.Component { static defaultProps: { inputPrefixCls: string; prefixCls: string; enterButton: boolean; allowClear: boolean; }; private input; constructor(props: SearchProps); componentWillReceiveProps({ value }: SearchProps): void; onSearch: () => void; onChange: (e: React.ChangeEvent) => void; onClear: (e: React.MouseEvent) => void; focus(): void; blur(): void; saveInput: (node: Input) => void; getInputValue: () => string; /** * 获取 input Event + 重置 input value * @param e * @param value */ getInputEvent(e: React.ChangeEvent | React.MouseEvent, value: string): any; /** * 获取搜索按钮 class */ getInnerButtonCls: () => any; /** * 获取 clear icon * allowClear === true -> 默认的 clear icon * clearIcon -> 自定义的clear icon */ getClearIcon: () => {} | null; /** * searchIcon + props.prefix * searchIcon: 放在 前面的 search icon 装饰用,不可点击 */ getPrefix: () => any[] | undefined; /** * props.suffix + clearIcon + buttonIcon * clearIcon: 清除按钮, 由 allowClear || clearIcon 控制 * buttonIcon: 放在后面的 搜索, 可以点击,点击 -> 触发 onSearch * enterButton === true -> 默认的 搜索 icon * enterButton === ReactNode -> 自定义的搜索 */ getSuffix: () => any[] | undefined; render(): JSX.Element; }