declare namespace AMap {
  namespace Geolocation {
    interface Options {
      enableHighAccuracy?: boolean
      timeout?: number
      noIpLocale?: number
      noGeoLocation?: 0 | 1 | 2 | 3
      GeoLocationFirst?: boolean
      maximunAge?: number
      convert?: boolean
      showButton?: boolean
      buttonDom?: string | Element
      buttonPosition: 'LT' | 'LB' | 'RT' | 'RB'
      buttonOffset?: Pixel
      showMarker?: boolean
      MarkerOptions?: Marker.Options
      showCircle?: boolean
      circleOptions?: Circle.Options
      panToLocation?: boolean
      zoomToAccuracy?: boolean
      useNative?: boolean
      extensions?: 'base' | 'all'
    }

    interface GeolocationResult {
      position: LngLat
      accuracy: number
      location_type: 'html5' | 'ip' | 'sdk'
      message: string
      isConverted: boolean
      info: string
      addressComponent: AddressComponent
      formattedAddres: string
      pois: Poi[]
      roads: Road[]
      crosses: Cross[]
    }
  }

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

    isSupported(): boolean
    getCurrentPosition(
      callback: (status: string, result: Geolocation.GeolocationResult) => any
    ): void
    watchPosition(): number
    clearWatch(id: number): number
    getCityInfo(callback: (status: string, result: any) => any): void // TODO: 补全result类型
  }
}
