Created
July 10, 2018 05:45
-
-
Save thehappybug/5c6b414c53d42b2315e166dc6aaa28ce to your computer and use it in GitHub Desktop.
Typescript type declaration for Fuzzy Picker
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
declare module 'react-fuzzy-picker' { | |
import * as React from 'react'; | |
export interface FuzzyPickerProps<T> { | |
label?: string; | |
displayCount?: number; | |
cycleAtEndsOfList?: boolean; | |
onChangeHighlightedItem?: (choice: T) => void; | |
isOpen: boolean; | |
onClose: () => void; | |
onChange: (choice: T) => void; | |
items: ReadonlyArray<T>; | |
renderItem?: (item: T) => React.ReactNode; | |
itemValue?: (item: T) => string; | |
} | |
export interface FuzzyWrapperProps<T> { | |
isKeyPressed: (ev: KeyboardEvent) => boolean; | |
popup: ( | |
isOpen: FuzzyPickerProps<T>['isOpen'], | |
onClose: FuzzyPickerProps<T>['onClose'] | |
) => React.ReactNode; | |
} | |
export default class FuzzyPicker<T> extends React.Component< | |
FuzzyPickerProps<T> | |
> {} | |
export class FuzzyWrapper<T> extends React.Component<FuzzyWrapperProps<T>> {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment