diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 00000000..4a6fcba1 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,65 @@ +import {ViewStyle} from 'react-native' +export interface SelectListProps { + + /** + * Fn to set Selected option value which will be stored in your local state + */ + setSelected: React.Dispatch>, + + /** + * Placeholder text that will be displayed in the select box + */ + placeholder?: string, + + /** + * Additional styles for select box + */ + boxStyles?: ViewStyle, + + /** + * Additional styles for text of select box + */ + inputStyles?: ViewStyle, + + /** + * Additional styles for dropdown scrollview + */ + dropdownStyles?:ViewStyle, + + /** + * Additional styles for dropdown list item + */ + dropdownItemStyles?: ViewStyle, + + /** + * Additional styles for list items text + */ + dropdownTextStyles?: ViewStyle, + + /** + * Maximum height of the dropdown wrapper to occupy + */ + maxHeight?: number, + + /** + * Data which will be iterated as options of select list + */ + data: Array<{}>, + + /** + * Pass any JSX to this prop like Text, Image or Icon to show instead of search icon + */ + searchicon?: JSX.Element, + + /** + * Pass any JSX to this prop like Text, Image or Icon to show instead of chevron icon + */ + arrowicon?: JSX.Element, + + /** + * set to false if you dont want to use search functionality + */ + search?: boolean + + +} \ No newline at end of file diff --git a/package.json b/package.json index 0d38a328..421d2a74 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.0.12", "description": "⭐ React Native Select List Equivalent to Html's Select with options\"", "main": "index.tsx", + "types": "index.d.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" },