declare namespace AMap {
  namespace Autocomplete {
    interface Options {
      city?: string
      citylimit?: boolean
      type?: string
      datatype?: 'all' | 'poi' | 'bus' | 'busline'
      input?: string | HTMLInputElement
      output?: string | HTMLDivElement
      outPutDirAuto?: boolean
    }

    interface Tip {
      id: string
      name: string
      district: string
      adcode: string
      address: string
    }

    interface AutocompleteResult {
      info: string
      count: number
      tips: Tip[]
    }
  }

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

    search(
      keyword: string,
      callback: (status: string, result: Autocomplete.AutocompleteResult) => any
    ): void
    setType(type: string): void
    setCity(city: string): void
    setCityLimit(limit: boolean): void
  }
}
