import { AMap } from './AMap'; import { Event } from './Event'; export class Weather extends Event { getLive(city: string, callback: (result: WeatherLiveResult) => void): void getForecast(city: string, callback: (result: WeatherForecastResult) => void): void } interface WeatherLiveResult { err: any LiveData : LiveData } interface LiveData { info: string province: string city: string adcode: string weather: string temperature: string windDirection: string windPower: string humidity: string reportTime: string } interface WeatherForecastResult { err: any ForecastData : ForecastData } interface ForecastData { info: string province: string city: string adcode: string reportTime: string forecast: Forecast[] } interface Forecast { date: string week: string dayWeather: string nightWeather: string dayTemp: string nightTemp: string dayWindDir: string dayWindPower: string nightWindPower: string } // region Event type WeatherEventType = 'error' | 'complete' type WeatherEvent = Record // endregion