import 'rollup-plugin-inject-process-env'; import { AddressAutocompleteParameters } from "stentor-models"; export interface AddressAutocompleteConfig { apiKey?: string; baseUrl?: string; } export interface AddressAutocompleteQuery { input: string; componentRestrictions?: { country: "US"; }; params?: AddressAutocompleteParameters; } export interface MainTextMatchedSubstrings { offset: number; length: number; } export interface StructuredFormatting { main_text: string; secondary_text: string; main_text_matched_substrings?: readonly MainTextMatchedSubstrings[]; } export interface PlaceType { description: string; structured_formatting: StructuredFormatting; /** * Google Place ID for the prediction, used to resolve full place details * (the prediction description never includes the postal code). */ placeId?: string; } /** * Place details from the New Places API (v1). Only the fields the widget uses. */ export interface PlaceDetails { id?: string; formattedAddress?: string; } /** * A service that interacts with a Google Places Autocomplete compatible API (New Places API v1). */ export declare class AddressAutocompleteService { private readonly baseUrl; private readonly key?; constructor(config: AddressAutocompleteConfig); getPlacePredictions(query: AddressAutocompleteQuery, callback: (results?: readonly PlaceType[]) => void): void; /** * Resolves a place id from a prediction to full place details, which include * the formatted address with postal code. Calls back with undefined on failure. */ getPlaceDetails(placeId: string, callback: (details?: PlaceDetails) => void): void; }