declare namespace AMap {
  namespace PlaceSearch {
    interface Options {
      city?: string
      citylimit?: boolean
      children?: number
      type?: string
      lang?: string
      pageSize?: number
      pageIndex?: number
      extensions?: 'base' | 'all'
    }
  }

  interface PlaceSearch {
    new (options?: PlaceSearch.Options): PlaceSearch

    search(
      keyword: string,
      callback: (status: string, result: SearchResult) => any
    ): void
    searchNearBy(
      keyword: string,
      center: LngLat,
      radius: number,
      callback: (status: string, result: SearchResult) => any
    ): void
    searchInBounds(
      keyword: string,
      bounds: Bounds | Polygon,
      callback: (status: string, result: SearchResult) => any
    ): void
    setType(type: string): void
    setCity(city: string): void
    setCityLimit(limit: boolean): void
    setLang(lang: Lang): void
    setPageIndex(pageIndex: number): void
    setPageSize(pageSize: number): void
    getLang(): string
    clear(): void
    poiOnAMAP(obj: any): void // 补全参数类型
    detailOnAMAP(obj: any): void // 补全参数类型
  }
}
