import { Alert, Language, Location, Options, Unit, CurrentWeather, MinutelyWeather, HourlyWeather, DailyWeather, HistoricalWeather, Everything, AirPollution, ForecastWeather } from "./types"; export declare class OpenWeatherAPI { private globalOptions; /** * Constructor of the class. You can specify global options here * * @constructor * @param globalOptions - object that defines global options * @returns OpenWeatherAPI object */ constructor(globalOptions?: Options); /** * Sets global API key * * @param key - api key */ setKey(key: string): void; /** * Getter for global key * * @returns global API key */ getKey(): string | undefined; /** * Sets global language (Language must be listed [here](https://openweathermap.org/current#multi)) * * @param lang - language */ setLanguage(lang: Language): void; /** * Getter for global language * * @return global language */ getLanguage(): Language | undefined; private evaluateLanguage; /** * Sets global units * * @param units - units (Only **standard**, **metric** or **imperial** are supported) */ setUnits(units: Unit): void; /** * Getter for global units * * @returns global units */ getUnits(): Unit | undefined; private evaluateUnits; /** * Sets global location by provided name * * @param name - name of the location (`q` parameter [here](https://openweathermap.org/api/geocoding-api#direct_name)) */ setLocationByName(name: string): void; private evaluateLocationByName; /** * Sets global location by provided coordinates * * @param lat - latitude of the location * @param lon - longitude of the location */ setLocationByCoordinates(lat: number, lon: number): void; private evaluateLocationByCoordinates; /** * Sets global location by provided zip/post code * * @param zipCode - zip/post code and country code divided by comma (`zip` parameter [here](https://openweathermap.org/api/geocoding-api#direct_zip)) */ setLocationByZipCode(zipCode: string): void; private evaluateLocationByZipCode; /** * Getter for location * * @param options - options used only for this call * @returns location or null for no location */ getLocation(options?: Options): Promise; /** * Getter for locations from query * * @param query - query used to search the locations (`q` parameter [here](https://openweathermap.org/api/geocoding-api#direct_name)) * @param options - options used only for this call * @returns all found locations */ getAllLocations(query: string, options?: Options): Promise; /** * Getter for current weather * * @param options - options used only for this call * @returns weather object of current weather */ getCurrent(options?: Options): Promise; /** * Getter for forecasted weather * * @param limit - maximum length of returned array * @param options - options used only for this call * @returns array of Weather objects, one for every 3 hours, up to 5 days */ getForecast(limit?: number, options?: Options): Promise; /** * Getter for minutely weather * * @param limit - maximum length of returned array * @param options - options used only for this call * @returns array of Weather objects, one for every next minute (Empty if API returned no info about minutely weather) */ getMinutelyForecast(limit?: number, options?: Options): Promise; /** * Getter for hourly weather * * @param limit - maximum length of returned array * @param options - options used only for this call * @returns array of Weather objects, one for every next hour (Empty if API returned no info about hourly weather) */ getHourlyForecast(limit?: number, options?: Options): Promise; /** * Getter for daily weather * * @param limit - maximum length of returned array * @param includeToday - boolean indicating whether to include today's weather in returned array * @param options - options used only for this call * @returns array of Weather objects, one for every next day (Empty if API returned no info about daily weather) */ getDailyForecast(limit?: number, includeToday?: boolean, options?: Options): Promise; /** * Getter for today's weather * * @param options - options used only for this call * @returns weather object of today's weather **NOT the same as current!** */ getToday(options?: Options): Promise; /** * Getter for alerts\ * **Note:** some agencies provide the alert’s description only in a local language. * * @param options - options used only for this call * @returns alerts */ getAlerts(options?: Options): Promise; /** * Getter for every type of weather call and alerts * * @param options - options used only for this call * @returns object that contains everything */ getEverything(options?: Options): Promise; /** * Getter for historical data about weather * * @param dt - Date from the **previous five days** (Unix time, UTC time zone) * @param options - options used only for this call */ getHistory(dt: Date | number | string, options?: Options): Promise; /** * Getter for current data about air pollution * * @param options - options used only for this call * @returns Air Pollution Object with data about current pollution */ getCurrentAirPollution(options?: Options): Promise; /** * Getter for future data about air pollution * * @param limit - maximum length of returned array * @param options - options used only for this call * @returns Array of Air Pollution Objects with data about future pollution */ getForecastedAirPollution(limit?: number, options?: Options): Promise; /** * Getter for historical data about air pollution * WARNING: Historical data is accessible from 27th November 2020 * * @param from - Start date (unix time, UTC time zone) * @param to - End date (unix time, UTC time zone) * @param options - options used only for this call * @returns Array of Air Pollution Objects with data about historical pollution */ getHistoryAirPollution(from: Date | number | string, to: Date | number | string, options?: Options): Promise; private uncacheLocation; private createURL; private fetch; private parseOptions; } export default OpenWeatherAPI; export * from "./types";