@hoxhaolsi/cloud-sdk
Version:
LiquidCommerce Cloud SDK
29 lines (28 loc) • 1.72 kB
TypeScript
import type { AuthenticatedService } from '../core';
import type { IAddressAutocompleteParams, IAddressAutocompleteResult, IAddressDetailsParams, IAddressDetailsResult } from '../interfaces';
import type { AddressServiceResponse } from '../types';
/**
* Represents a service for interacting with address-related functionality.
*/
export declare class AddressService {
private client;
constructor(client: AuthenticatedService);
/**
* Performs autocomplete on an address using the Google Places API.
* @param {IAddressAutocompleteParams} params - The parameters for the autocomplete request.
* @param {string} googlePlacesApiKey - The API key for accessing the Google Places API.
* @return {Promise<AddressServiceResponse<IAddressAutocompleteResult[]>>} - A Promise that resolves to the autocomplete response.
* @throws {Error} - If the autocomplete request fails.
*/
autocomplete(params: IAddressAutocompleteParams, googlePlacesApiKey: string): Promise<AddressServiceResponse<IAddressAutocompleteResult[]>>;
/**
* Retrieves detailed information about an address using Google Places API.
*
* @async
* @param {IAddressDetailsParams} params - The parameters for retrieving address details.
* @param {string} googlePlacesApiKey - The API key for accessing Google Places API.
* @return {Promise<AddressServiceResponse<IAddressDetailsResult>>} A promise that resolves to the response containing the detailed information about an address.
* @throws {Error} if the request to retrieve address details fails.
*/
details(params: IAddressDetailsParams, googlePlacesApiKey: string): Promise<AddressServiceResponse<IAddressDetailsResult>>;
}