From 094fd3d21ed4780f1a9e747657675e6de3c534ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo?= Date: Thu, 27 Dec 2018 13:36:18 +0100 Subject: [PATCH 1/4] Add googleCallbackName property to PropTypes --- types/react-places-autocomplete/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-places-autocomplete/index.d.ts b/types/react-places-autocomplete/index.d.ts index 62e3d93a1d..e0fb483eac 100644 --- a/types/react-places-autocomplete/index.d.ts +++ b/types/react-places-autocomplete/index.d.ts @@ -6,8 +6,7 @@ // TypeScript Version: 2.8 // /// - -import * as React from "react"; +import * as React from 'react'; export interface formattedSuggestionType { mainText: string; @@ -52,6 +51,7 @@ export interface PropTypes { debounce?: number; highlightFirstSuggestion?: boolean; + googleCallbackName?: string; renderFooter?: () => React.ReactNode; shouldFetchSuggestions?: (value: string) => boolean; } From cda3ad7d5523ea2e27a5f5a2ed54c92703f7600d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo?= Date: Thu, 27 Dec 2018 15:59:39 +0100 Subject: [PATCH 2/4] Commented react-places-autocomplete version --- types/react-places-autocomplete/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-places-autocomplete/index.d.ts b/types/react-places-autocomplete/index.d.ts index e0fb483eac..25ae14e33a 100644 --- a/types/react-places-autocomplete/index.d.ts +++ b/types/react-places-autocomplete/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-places-autocomplete 6.1 +// Type definitions for react-places-autocomplete 7.2 // Project: https://github.com/kenny-hibino/react-places-autocomplete/ // Definitions by: Guilherme Hübner // Andrew Makarov From 09babd8bb368eefbde45506f1d56a91f5eabda16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo?= Date: Thu, 27 Dec 2018 16:20:49 +0100 Subject: [PATCH 3/4] Included googleCalbackName on the test --- .../react-places-autocomplete-tests.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/react-places-autocomplete/react-places-autocomplete-tests.tsx b/types/react-places-autocomplete/react-places-autocomplete-tests.tsx index 41e6ff37b4..2a567df8a4 100644 --- a/types/react-places-autocomplete/react-places-autocomplete-tests.tsx +++ b/types/react-places-autocomplete/react-places-autocomplete-tests.tsx @@ -1,5 +1,7 @@ import * as React from 'react'; -import PlacesAutocomplete, { geocodeByAddress, geocodeByPlaceId, getLatLng } from 'react-places-autocomplete'; +import PlacesAutocomplete, { + geocodeByAddress, geocodeByPlaceId, getLatLng +} from 'react-places-autocomplete'; class Test extends React.Component { state = { @@ -45,7 +47,7 @@ class Test extends React.Component { return (
- + ); } From 94e24d5c7422b933839392acae0a2fdfacdedd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo?= Date: Thu, 27 Dec 2018 17:30:42 +0100 Subject: [PATCH 4/4] Resolve conflict --- types/react-places-autocomplete/index.d.ts | 11 ++++++----- .../react-places-autocomplete-tests.tsx | 7 +------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/types/react-places-autocomplete/index.d.ts b/types/react-places-autocomplete/index.d.ts index 25ae14e33a..b2f0c661cd 100644 --- a/types/react-places-autocomplete/index.d.ts +++ b/types/react-places-autocomplete/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/kenny-hibino/react-places-autocomplete/ // Definitions by: Guilherme Hübner // Andrew Makarov +// Nokky Goren // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 // @@ -14,13 +15,10 @@ export interface formattedSuggestionType { } export interface PropTypes { - inputProps: { - value: string; - onChange: (value: string) => void; + inputProps?: { type?: string; name?: string; placeholder?: string; - onBlur?: (event: React.FocusEvent) => void; disabled?: boolean; }; onError?: (status: string, clearSuggestion: () => void) => void; @@ -40,7 +38,7 @@ export interface PropTypes { autocompleteItem?: React.CSSProperties; autocompleteItemActive?: React.CSSProperties; }; - options?: { + searchOptions?: { bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; componentRestrictions?: google.maps.GeocoderComponentRestrictions; location?: google.maps.LatLng | google.maps.LatLngLiteral; @@ -48,6 +46,9 @@ export interface PropTypes { radius?: number | string; types?: string[]; }; + value?: string; + onChange?: (value: string) => void; + onBlur?: (event: React.FocusEvent) => void; debounce?: number; highlightFirstSuggestion?: boolean; diff --git a/types/react-places-autocomplete/react-places-autocomplete-tests.tsx b/types/react-places-autocomplete/react-places-autocomplete-tests.tsx index 2a567df8a4..331d453bf0 100644 --- a/types/react-places-autocomplete/react-places-autocomplete-tests.tsx +++ b/types/react-places-autocomplete/react-places-autocomplete-tests.tsx @@ -40,14 +40,9 @@ class Test extends React.Component { onChange = (address: string) => this.setState({ address }); render() { - const inputProps = { - value: this.state.address, - onChange: this.onChange, - }; - return (
- + ); }