Created
April 20, 2018 05:48
-
-
Save markryd/5d912f0082c6209080337820f8b0095b to your computer and use it in GitHub Desktop.
Start of typescript types for react-autocomplete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface AutocompleteProps<T> { | |
items: T[]; | |
value?: string; | |
onChange?(e: React.ChangeEvent<HTMLInputElement>, value: string): void; | |
onSelect?(value: string, item: T): void; | |
shouldItemRender?(item: T, value: string): boolean; | |
isItemSelectable?(item: T): boolean; | |
sortItems?(itemA: T, itemB: T, value: string): -1 | 0 | 1; | |
getItemValue(item: T): string; | |
renderItem(item: T, isHighlighted?: boolean, styles?: React.CSSProperties): JSX.Element; | |
renderMenu?(items: T[], value: string, styles?: React.CSSProperties): JSX.Element; | |
menuStyle?: React.CSSProperties; | |
renderInput?(props: any): JSX.Element; | |
inputProps?: object; | |
wrapperProps?: object; | |
wrapperStyle?: React.CSSProperties; | |
autoHighlight?: boolean; | |
selectOnBlur?: boolean; | |
onMenuVisibilityChange?(isOpen: boolean): void; | |
open?: boolean; | |
debug?: boolean; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment