declare global { interface Window { google?: { maps?: { places?: { AutocompleteService: new () => any; PlacesService: new (map: any) => any; PlacesServiceStatus: { OK: string; ZERO_RESULTS: string; }; }; Map: new (element: HTMLElement) => any; }; }; } } export interface GooglePrediction { place_id: string; description: string; structured_formatting?: { main_text: string; secondary_text: string; }; } export interface GoogleAddressComponent { long_name: string; short_name: string; types: string[]; } export interface GooglePlaceDetails { address_components: GoogleAddressComponent[]; formatted_address: string; } export interface ExtractedAddress { streetNumber: string; route: string; locality: string; administrativeAreaLevel1: string; administrativeAreaLevel1Long: string; administrativeAreaLevel2: string; administrativeAreaLevel2Long: string; country: string; postalCode: string; } export interface UseGoogleAutocompleteOptions { apiKey: string; libraries?: string[]; version?: string; language?: string; region?: string; } export interface UseGoogleAutocompleteResult { predictions: GooglePrediction[]; isLoading: boolean; isScriptLoaded: boolean; searchPlaces: (input: string, countryRestriction?: string) => void; getPlaceDetails: (placeId: string) => Promise; extractAddressComponents: (place: GooglePlaceDetails) => ExtractedAddress; clearPredictions: () => void; } /** * React hook for Google Places Autocomplete with automatic script injection * Automatically loads the Google Maps JavaScript API with Places library */ export declare function useGoogleAutocomplete(options: UseGoogleAutocompleteOptions): UseGoogleAutocompleteResult; /** * Hook to check if Google Maps API is loaded * @deprecated Use useGoogleAutocomplete with isScriptLoaded instead */ export declare function useGoogleMapsLoaded(): boolean;