UNPKG

1.18 kBTypeScriptView Raw
1import { Component } from 'react';
2import { TextInput } from 'react-native';
3import { InputProps } from '../input/Input';
4import { IconNode } from '../icons/Icon';
5import { SearchBarBaseProps } from './SearchBar';
6import { ThemeProps } from '../config';
7export declare type SearchBarAndroidProps = InputProps & SearchBarBaseProps & typeof SearchBar.defaultProps & {
8 cancelIcon?: IconNode;
9};
10declare type SearchBarState = {
11 hasFocus: boolean;
12 isEmpty: boolean;
13};
14declare class SearchBar extends Component<SearchBarAndroidProps & Partial<ThemeProps<SearchBarAndroidProps>>, SearchBarState> {
15 input: TextInput;
16 static defaultProps: {
17 onClear: () => any;
18 onCancel: () => any;
19 onFocus: () => any;
20 onBlur: () => any;
21 onChangeText: () => any;
22 };
23 focus: () => void;
24 blur: () => void;
25 clear: () => void;
26 cancel: () => void;
27 onFocus: InputProps['onFocus'];
28 onBlur: InputProps['onBlur'];
29 onChangeText: (text: string) => void;
30 constructor(props: SearchBarAndroidProps);
31 _keyboardDidHide: () => void;
32 componentWillUnmount(): void;
33 render(): JSX.Element;
34}
35export default SearchBar;