@types/react-places-autocomplete
Advanced tools
Comparing version 7.2.1 to 7.2.2
// Type definitions for react-places-autocomplete 7.2 | ||
// Project: https://github.com/kenny-hibino/react-places-autocomplete/ | ||
// Project: https://github.com/hibiken/react-places-autocomplete/ | ||
// Definitions by: Guilherme Hübner <https://github.com/guilhermehubner> | ||
// Andrew Makarov <https://github.com/r3nya> | ||
// Nokky Goren <https://github.com/ApeNox> | ||
// Aziz Khambati <https://github.com/azizhk> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -13,31 +14,22 @@ // TypeScript Version: 2.8 | ||
export interface formattedSuggestionType { | ||
mainText: string; | ||
secundaryText: string; | ||
export type AutocompletePrediction = google.maps.places.AutocompletePrediction; | ||
export interface Suggestion { | ||
id: string; | ||
active: boolean; | ||
index: number; | ||
description: AutocompletePrediction["description"]; | ||
placeId: AutocompletePrediction["place_id"]; | ||
formattedSuggestion: { | ||
mainText: AutocompletePrediction["structured_formatting"]["main_text"]; | ||
secondaryText: AutocompletePrediction["structured_formatting"]["secondary_text"]; | ||
}; | ||
matchedSubstrings: AutocompletePrediction["matched_substrings"]; | ||
terms: AutocompletePrediction["terms"]; | ||
types: AutocompletePrediction["types"]; | ||
} | ||
export interface PropTypes { | ||
inputProps?: { | ||
type?: string; | ||
name?: string; | ||
placeholder?: string; | ||
disabled?: boolean; | ||
}; | ||
onError?: (status: string, clearSuggestion: () => void) => void; | ||
onSelect?: (address: string, placeID: string) => void; | ||
renderSuggestion?: (suggestion: string, formattedSuggestion: formattedSuggestionType) => React.ReactNode; | ||
classNames?: { | ||
root?: string; | ||
input?: string; | ||
autocompleteContainer?: string; | ||
autocompleteItem?: string; | ||
autocompleteItemActive?: string; | ||
}; | ||
styles?: { | ||
root?: React.CSSProperties; | ||
input?: React.CSSProperties; | ||
autocompleteContainer?: React.CSSProperties; | ||
autocompleteItem?: React.CSSProperties; | ||
autocompleteItemActive?: React.CSSProperties; | ||
}; | ||
searchOptions?: { | ||
@@ -53,14 +45,40 @@ bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral; | ||
onChange?: (value: string) => void; | ||
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void; | ||
debounce?: number; | ||
highlightFirstSuggestion?: boolean; | ||
renderFooter?: () => React.ReactNode; | ||
shouldFetchSuggestions?: (value: string) => boolean; | ||
shouldFetchSuggestions?: boolean; | ||
children: (opts: Readonly<{ | ||
loading: boolean; | ||
suggestions: ReadonlyArray<Suggestion>; | ||
getInputProps: <InputProps extends {}>(options?: InputProps) => { | ||
type: 'text'; | ||
autoComplete: 'off'; | ||
role: 'combobox'; | ||
'aria-autocomplete': 'list'; | ||
'aria-expanded': boolean; | ||
'aria-activedescendant': string | null; | ||
disabled: boolean; | ||
onKeyDown: React.KeyboardEventHandler; | ||
onBlur: () => void; | ||
value: string | undefined; | ||
onChange: (ev: { target: { value: string }}) => void; | ||
} & InputProps; | ||
getSuggestionItemProps: <SuggestionProps extends {}>(suggestion: Suggestion, options?: SuggestionProps) => { | ||
key: number; | ||
id: string | null; | ||
role: 'option'; | ||
onMouseEnter: () => void; | ||
onMouseLeave: () => void; | ||
onMouseDown: React.MouseEventHandler; | ||
onMouseUp: () => void; | ||
onTouchStart: () => void; | ||
onTouchEnd: () => void; | ||
onClick: (event?: Event) => void; | ||
} & SuggestionProps; | ||
}>) => React.ReactNode; | ||
} | ||
export function geocodeByAddress(address: string, callback: (results: google.maps.GeocoderResult[], status: google.maps.GeocoderStatus) => void): void; | ||
export function geocodeByAddress(address: string): Promise<google.maps.GeocoderResult[]>; | ||
export function geocodeByPlaceId(placeId: string, callback: (results: google.maps.GeocoderResult[], status: google.maps.GeocoderStatus) => void): void; | ||
export function geocodeByPlaceId(placeId: string): Promise<google.maps.GeocoderResult[]>; | ||
@@ -67,0 +85,0 @@ |
{ | ||
"name": "@types/react-places-autocomplete", | ||
"version": "7.2.1", | ||
"version": "7.2.2", | ||
"description": "TypeScript definitions for react-places-autocomplete", | ||
@@ -21,2 +21,7 @@ "license": "MIT", | ||
"githubUsername": "ApeNox" | ||
}, | ||
{ | ||
"name": "Aziz Khambati", | ||
"url": "https://github.com/azizhk", | ||
"githubUsername": "azizhk" | ||
} | ||
@@ -35,4 +40,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "7ee711b62e5ce058105729dc45a85a3638f300b75544f8b0001732852ea9df95", | ||
"typesPublisherContentHash": "dc202afbcd24f9de2cc6359c02b0b5a4dac933b13614a1419768289b1ea40fd9", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for react-places-autocomplete (https://github.com/kenny-hibino/react-places-autocomplete/). | ||
This package contains type definitions for react-places-autocomplete (https://github.com/hibiken/react-places-autocomplete/). | ||
@@ -12,3 +12,3 @@ # Details | ||
Additional Details | ||
* Last updated: Wed, 12 Dec 2018 22:20:32 GMT | ||
* Last updated: Mon, 31 Dec 2018 16:26:30 GMT | ||
* Dependencies: @types/react, @types/googlemaps | ||
@@ -18,2 +18,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Guilherme Hübner <https://github.com/guilhermehubner>, Andrew Makarov <https://github.com/r3nya>, Nokky Goren <https://github.com/ApeNox>. | ||
These definitions were written by Guilherme Hübner <https://github.com/guilhermehubner>, Andrew Makarov <https://github.com/r3nya>, Nokky Goren <https://github.com/ApeNox>, Aziz Khambati <https://github.com/azizhk>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6493
76