declare namespace AMap {
  namespace ToolBar {
    type Position = 'LT' | 'RT' | 'LB' | 'RB'
    interface Options {
      offset?: Pixel
      position?: Position
      ruler?: boolean
      noIpLocate?: boolean
      locate?: boolean
      liteStyle?: boolean
      direction?: boolean
      autoPosition?: boolean
      locationMarker?: Marker
      useNative?: boolean
    }
  }

  interface ToolBar extends Control {
    new (options?: ToolBar.Options): ToolBar

    getOffset(): Pixel
    setOffset(pixel: Pixel): void
    hideRuler(): void
    showRuler(): void
    hideDirection(): void
    showDirection(): void
    hideLocation(): void
    showLocation(): void
    doLocation(): void
    getLocation(): LngLat | undefined
    hide(): void
    show(): void
  }
}
