UNPKG

react-google-places-autocomplete

Version:
37 lines (36 loc) 1.14 kB
/// <reference types="google.maps" /> import { LoaderOptions } from '@googlemaps/js-api-loader'; import { GroupBase } from 'react-select'; import { AsyncProps } from 'react-select/async'; export declare type GooglePlacesAutocompleteHandle = { getSessionToken: () => google.maps.places.AutocompleteSessionToken | undefined; refreshSessionToken: () => void; }; export interface LatLng { lat: number; lng: number; } export interface AutocompletionRequest { bounds?: [LatLng, LatLng]; componentRestrictions?: { country: string | string[]; }; location?: LatLng; offset?: number; radius?: number; types?: string[]; } export declare type Option = { label: string; value: any; }; export default interface GooglePlacesAutocompleteProps { apiKey?: string; apiOptions?: Partial<LoaderOptions>; autocompletionRequest?: AutocompletionRequest; debounce?: number; minLengthAutocomplete?: number; onLoadFailed?: (error: Error) => void; selectProps?: AsyncProps<Option, false, GroupBase<Option>>; withSessionToken?: boolean; }