pulse-ai-utils
Version:
Utility functions and helpers for AI-powered applications
43 lines (42 loc) • 1.09 kB
TypeScript
import { Place } from 'pulse-type-registry';
export interface PlaceSearchOptions {
query?: string;
location?: {
lat: number;
lng: number;
};
radius?: number;
type?: string;
minprice?: number;
maxprice?: number;
opennow?: boolean;
language?: string;
}
export interface PlaceDetailsOptions {
fields?: string[];
language?: string;
}
export default class GooglePlacesHelper {
private client;
private apiKey;
constructor(apiKey?: string);
/**
* Search for places in a given area
*/
searchPlaces(options: PlaceSearchOptions): Promise<Partial<Place>[]>;
/**
* Get detailed information about a specific place
*/
getPlaceDetails(placeId: string, options?: PlaceDetailsOptions): Promise<Partial<Place>>;
/**
* Search for places nearby a location
*/
nearbySearch(location: {
lat: number;
lng: number;
}, radius?: number, type?: string): Promise<Partial<Place>[]>;
/**
* Generate photo URL from photo reference
*/
private getPhotoUrl;
}