/// <reference path="Autocomplete.d.ts" />
/// <reference path="CitySearch.d.ts" />
/// <reference path="Geocoder.d.ts" />
/// <reference path="Geolocation.d.ts" />
/// <reference path="PlaceSearch.d.ts" />

declare namespace AMap {
  interface PoiBase {
    id: string
    name: string
    type: string
    location: LngLat
    address: string
    distance: number
    tel: string
  }

  interface PoiDetail {
    website: string
    pcode: string
    citycode: string
    adcode: string
    postcode: string
    pname: string
    cityname: string
    adname: string
    email: string
    entr_location: LngLat
    exit_location: LngLat
    groupbuy: boolean
    discount: boolean
  }

  interface Photo {
    title: string
    url: string
  }

  interface PoiExtensions {
    // TBD
  }

  interface Poi extends PoiBase, PoiDetail, PoiExtensions {
    photos: Photo[]
  }

  interface PoiList {
    pois: Poi[]
    pageIndex: number
    pageSize: number
    count: number
  }

  interface CityInfo {
    name: string
    citycode: string
    adcode: string
    count: number
  }
  interface SearchResult {
    info: string
    poiList: PoiList
    keywordList: string[]
    cityList: CityInfo[]
  }

  export interface BusinessArea {
    id: string
    name: string
    location: string
  }
  export interface AddressComponent {
    province: string
    city: string
    citycode: string
    district: string
    adcode: string
    township: string
    street: string
    streetNumber: string
    neighborhood: string
    neighborhoodType: string
    building: string
    buildingType: string
    businessAreas: BusinessArea[]
  }

  export interface Road {
    id: string
    name: string
    distance: number
    location: LngLat
    direction: string
  }

  export interface Cross {
    distance: number
    direction: string
    location: LngLat
    first_id: string
    first_name: string
    second_id: string
    second_name: string
  }
}
