Skip to content

Commit 1ea8924

Browse files
Improved typings
1 parent eb45651 commit 1ea8924

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

index.d.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Type definitions for react-native-dropdown-autocomplete 1.0
22

33
import * as React from 'react';
4+
import { ViewStyle, TextStyle, StyleProp } from 'react-native';
45

56
type AutocompleteProps = {
67
autoCorrect?: boolean,
@@ -16,19 +17,19 @@ type AutocompleteProps = {
1617
listHeader?: string,
1718
fetchDataUrl?: string,
1819
noDataText?: string;
19-
inputContainerStyle?: any;
20-
inputStyle?: any;
21-
spinnerStyle?: any;
22-
noDataTextStyle?: any;
23-
separatorStyle?: any;
24-
listFooterStyle?: any;
25-
listHeaderStyle?: any;
26-
rightContentStyle?: any;
27-
rightContentItemStyle?: any;
28-
listHeaderTextStyle?: any;
29-
overlayStyle?: any;
30-
pickerStyle?: any;
31-
containerStyle?: any;
20+
inputContainerStyle?: StyleProp<ViewStyle>;
21+
inputStyle?: StyleProp<TextStyle>;
22+
spinnerStyle?: StyleProp<ViewStyle>;
23+
noDataTextStyle?: StyleProp<TextStyle>;
24+
separatorStyle?: StyleProp<ViewStyle>;
25+
listFooterStyle?: StyleProp<ViewStyle>;
26+
listHeaderStyle?: StyleProp<ViewStyle>;
27+
rightContentStyle?: StyleProp<ViewStyle>;
28+
rightContentItemStyle?: StyleProp<TextStyle>;
29+
listHeaderTextStyle?: StyleProp<TextStyle>;
30+
overlayStyle?: StyleProp<TextStyle>;
31+
pickerStyle?: StyleProp<TextStyle>;
32+
containerStyle?: StyleProp<ViewStyle>;
3233

3334
scrollToInput: (ev: any) => void,
3435
handleSelectItem: (item: any, index: number) => void,
@@ -37,7 +38,7 @@ type AutocompleteProps = {
3738
renderIcon?: () => void,
3839
valueExtractor?: (item: any) => void,
3940
rightTextExtractor?: (item: any) => void,
40-
fetchData?: (search: string) => Promise<any>,
41+
fetchData?: (search: string) => Promise<any[]>,
4142
}
4243

4344
export class Autocomplete extends React.Component<AutocompleteProps, any> {

0 commit comments

Comments
 (0)