import { Observable } from 'rxjs'; import * as i0 from '@angular/core'; /** Defines the keys that can be used in the `AddressModel` type. */ type AddressKey = 'streetNumber' | 'postalCode' | 'street' | 'region' | 'regionCode' | 'city' | 'countryCode' | 'country' | 'addressLine2'; /** * Defines a type for an address model, where the values can be of type `T`. * The keys that can be used in the `AddressModel` type are defined in the `AddressKey` type. * @template T The type of the values in the address model. */ type AddressModel = Record; /** * Service that provides functionality for interacting with new Google Maps Places API. */ declare class NgxGoogleMapsPlacesApiService { /** * Lazily imports the Google Maps Places library and provides a shared observable for it. * This ensures the library is only loaded once and can be shared across the application. */ private readonly _placesLibrary$; /** * Stores the current Google Maps Places autocomplete session token. * This token is used to associate autocomplete suggestions with a particular session. */ private _token; /** * Refreshes the Google Maps Places autocomplete session token. * The session token is used to associate autocomplete suggestions with a particular session. * This method creates a new session token and stores it in the `_token` property. * * @returns The new session token. */ refreshToken(): google.maps.places.AutocompleteSessionToken; /** * Fetches autocomplete suggestions from the Google Maps Places API based on the provided request * or input string. * @param requestOrInput The autocomplete request object or an input string to fetch * suggestions for. * @returns An observable that emits an array of autocomplete suggestions. */ fetchSuggestions(requestOrInput: google.maps.places.AutocompleteRequest | string): Observable; /** * Fetches the details of a Google Maps place based on an autocomplete suggestion or * place prediction. * @param suggestionOrPrediction The autocomplete suggestion or place prediction to fetch * details for. * @param fields An optional array of fields to fetch for the place. * Defaults to `[ 'addressComponents' ]`. * @returns An observable that emits the fetched place details, or null if the place prediction * is invalid. */ fetchPlaceDetails(suggestionOrPrediction: google.maps.places.AutocompleteSuggestion | google.maps.places.PlacePrediction, fields?: string[]): Observable; /** * Parses the address components of a Google Maps place and returns an `AddressModel` object. * @param place The Google Maps place object to parse the address components from. * @returns An `AddressModel` object containing the parsed address components, or `null` if * the place is null or has no address components. */ parseAddressComponents(place: google.maps.places.Place | null): AddressModel | null; /** * Applies bold formatting to the matched text within the provided `FormattableText`. * @param formattableText The `FormattableText` object containing the text and match information. * @returns The formatted text with the matched portions wrapped in `` tags. */ applyBoldToMatches(formattableText: google.maps.places.FormattableText | null): string; /** * Determines whether the provided `suggestionOrPrediction` object is an instance of * `google.maps.places.AutocompleteSuggestion`. * @param suggestionOrPrediction The object to check. * @returns `true` if the object is an `AutocompleteSuggestion`, `false` otherwise. */ private _isAutocompleteSuggestion; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { NgxGoogleMapsPlacesApiService }; export type { AddressKey, AddressModel };