google-places-web
Version:
A simple wrapper for the Google Places Web API
28 lines (27 loc) • 1.13 kB
TypeScript
import { BaseSearch } from './BaseSearch';
import { GooglePlaceBaseResponse, PlacesSearchResult, PlacesRequest, PlacesPageTokenRequest, PlacesRegionRequest } from '../types';
interface BaseTextSearchRequest extends PlacesPageTokenRequest, PlacesRequest, PlacesRegionRequest {
query: string;
language: string;
minprice: number;
maxprice: number;
opennow: boolean;
type?: string;
}
interface TextSearchWithoutLocationRequest extends BaseTextSearchRequest {
location: never;
radius?: number;
}
interface TextSearchWithLocationRequest extends BaseTextSearchRequest {
location: string;
radius: number;
}
export declare type TextSearchRequest = TextSearchWithoutLocationRequest | TextSearchWithLocationRequest;
export declare type TextSearchResult = Pick<PlacesSearchResult, 'formatted_address' | 'geometry' | 'icon' | 'id' | 'name' | 'photos' | 'place_id' | 'reference' | 'types'>;
export interface TextSearchResponse extends GooglePlaceBaseResponse {
results: TextSearchResult[];
}
export declare class TextSearch extends BaseSearch<TextSearchRequest> {
isValid(): boolean;
}
export {};