import type { AxiosInstance } from 'axios' ; import { ReverseCommand } from '../../../command' ; import type { ReverseQuery } from '../../../model' ; import type { GoogleMapsReverseQueryInterface } from '../interface' ; import { GoogleMapsLocationCommandMixin } from './mixin' ; link export class GoogleMapsReverseCommand extends GoogleMapsLocationCommandMixin ( ReverseCommand ) < GoogleMapsReverseQueryInterface > { constructor ( httpClient , private readonly apiKey ) { super ( httpClient , apiKey ) ; } static getUrl ( ) { return 'https://maps.googleapis.com/maps/api/geocode/json' ; } protected async buildQuery ( query ) { const providerQuery = { key : this . apiKey , latlng : `${ query . lat },${ query . lon }` , limit : query . limit , language : query . language , sensor : false , } ; if ( query . countryCode ) { providerQuery . region = `.${ query . countryCode . toLowerCase ( ) }` ; } return providerQuery ; } }