diff --git a/react-autosuggest/react-autosuggest-tests.tsx b/react-autosuggest/react-autosuggest-tests.tsx new file mode 100644 index 0000000000..4fb4947e19 --- /dev/null +++ b/react-autosuggest/react-autosuggest-tests.tsx @@ -0,0 +1,12 @@ +/// +/// + +import Autosuggest = require('react-autosuggest'); +import * as React from 'react'; + +let autosuggest = suggestion.name} + renderSuggestion={(suggestion: any) => ({suggestion.name})} + inputProps={{value: "El", onChange: (event: any, params: {newValue: string, method: string}) => {}}} +/> diff --git a/react-autosuggest/react-autosuggest.d.ts b/react-autosuggest/react-autosuggest.d.ts new file mode 100644 index 0000000000..cb67474ae1 --- /dev/null +++ b/react-autosuggest/react-autosuggest.d.ts @@ -0,0 +1,51 @@ +// Type definitions for react-autosuggest 3.7.1 +// Project: https://github.com/moroshko/react-autosuggest +// Definitions by: Stephen Jelfs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "react-autosuggest" { + interface Suggestion { + text: string; + } + + interface Theme { + container?: string; + containerOpen?: string; + input?: string; + suggestionsContainer?: string; + suggestion?: string; + suggestionFocused?: string; + sectionContainer?: string; + sectionTitle?: string; + sectionSuggestionsContainer?: string; + } + + interface InputProps { + value: string; + onChange: (event: any, params: {newValue: string, method: string}) => void; + type?: string; + placeholder?: string; + } + + interface AutosuggestProps extends __React.Props { + suggestions: any[]; + onSuggestionsUpdateRequested?: (params: {value: string, reason: string}) => void; + getSuggestionValue: (suggestion: any) => string; + renderSuggestion: (suggestion: any, params: {value: string, valueBeforeUpDown: string}) => __React.ReactElement; + inputProps: InputProps; + shouldRenderSuggestions?: (value: string) => boolean; + multiSection?: boolean; + renderSectionTitle?: (section: any) => __React.ReactElement; + getSectionSuggestions?: (section: any) => any[]; + onSuggestionSelected?: (event: any, params: {suggestion: any, suggestionValue: string, method: string}) => void; + focusInputOnSuggestionClick?: boolean; + theme?: Theme; + id?: string; + } + + class Autosuggest extends __React.Component {} + + export = Autosuggest; +}