From 3716056736ddd48ebe12b3d2061461381f9013ec Mon Sep 17 00:00:00 2001 From: Gilad Gray Date: Wed, 9 Mar 2016 13:30:15 -0800 Subject: [PATCH] update typings for React Select 1.0.0 - use `export = var` syntax so it works as a global library - put interfaces in ghost module so they don't pollute global namespace - add JSDoc comments for each prop - move old version to -0.9.10 --- react-select/react-select-0.9.10-tests.tsx | 29 +++ react-select/react-select-0.9.10.d.ts | 80 ++++++ react-select/react-select-tests.tsx | 23 +- react-select/react-select.d.ts | 287 +++++++++++++++------ 4 files changed, 335 insertions(+), 84 deletions(-) create mode 100644 react-select/react-select-0.9.10-tests.tsx create mode 100644 react-select/react-select-0.9.10.d.ts diff --git a/react-select/react-select-0.9.10-tests.tsx b/react-select/react-select-0.9.10-tests.tsx new file mode 100644 index 0000000000..e0a25b2034 --- /dev/null +++ b/react-select/react-select-0.9.10-tests.tsx @@ -0,0 +1,29 @@ + +/// +/// +/// + +import * as React from "react" +import * as ReactDOM from "react-dom" + +import Select from "react-select" + +class SelectTest extends React.Component, {}> { + + render() { + return
+ -
- } + render() { + const options: ReactSelect.Option[] = [{ label: "Foo", value: "bar" }] + return
+ ` tag + */ + name?: string; + /** + * factory to create new options when `allowCreate` is true + * @default false + */ + newOptionCreator?: (input: string) => Option; + /** + * placeholder displayed when there are no matching search results or a falsy value to hide it + * @default "No results found" + */ + noResultsText?: string; + onBlur?: __React.FocusEventHandler; + /** + * whether to clear input on blur or not + * @default true + */ + onBlurResetsInput?: boolean; + onChange?: (newValue: Option | Option[]) => void; + onFocus?: __React.FocusEventHandler; + onInputChange?: (inputValue: string) => void; + onOptionLabelClick?: (value: string, event: Event) => void; + /** + * function which returns a custom way to render the options in the menu + */ + optionRenderer?: () => void; + /** + * array of Select options + * @default false + */ + options?: Array