google-places-web
Version:
A simple wrapper for the Google Places Web API
20 lines (19 loc) • 760 B
TypeScript
import { PlacesRequest } from '../types';
export interface Searchable<T> {
exec(): Promise<T>;
}
export interface ValidatableSearch {
isValid(): boolean;
}
export declare type BaseSearchType = 'queryautocomplete' | 'details' | 'nearbysearch' | 'findplacefromtext' | 'textsearch';
export declare class BaseSearch<T extends PlacesRequest = PlacesRequest> implements ValidatableSearch {
protected _dev: boolean;
protected _params: Map<keyof T, T[keyof T]>;
constructor(opts?: T);
setDev(dev: boolean): BaseSearch<T>;
set<Key extends keyof T>(key: Key, value: T[Key]): BaseSearch<T>;
get<K extends keyof T>(key: K): T[K] | undefined;
remove<K extends keyof T>(key: K): boolean;
toRequestJSON(): T;
isValid(): boolean;
}