openweathermap-api-client
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,1 +1,8 @@ | ||
## [1.0.1](https://github.com/tdolsen/openweathermap-api-client/compare/v1.0.0...v1.0.1) (2018-07-26) | ||
### Bug Fixes | ||
* **api:** sets return type for current/forecast for proper definitions ([647a03a](https://github.com/tdolsen/openweathermap-api-client/commit/647a03a)) | ||
# 1.0.0 (2018-07-25) | ||
@@ -2,0 +9,0 @@ |
import { AxiosInstance } from "axios"; | ||
import { Coord, CountryCode, Endpoint, Options, RequestQuery, Response } from "./interfaces"; | ||
import { Coord, CountryCode, Endpoint, ForecastResponse, Options, RequestQuery, Response, WeatherResponse } from "./interfaces"; | ||
export declare class ApiClient { | ||
@@ -7,5 +7,5 @@ axios: AxiosInstance; | ||
constructor(options: string | Options); | ||
current(query: number | string | Coord | RequestQuery<Endpoint.Weather>): Promise<import("src/interfaces").WeatherResponse>; | ||
weather(query: number | string | Coord | RequestQuery<Endpoint.Weather>): Promise<import("src/interfaces").WeatherResponse>; | ||
forecast(query: number | string | Coord | RequestQuery<Endpoint.Forecast>): Promise<import("src/interfaces").ForecastResponse>; | ||
current(query: number | string | Coord | RequestQuery<Endpoint.Weather>): Promise<WeatherResponse>; | ||
weather(query: number | string | Coord | RequestQuery<Endpoint.Weather>): Promise<WeatherResponse>; | ||
forecast(query: number | string | Coord | RequestQuery<Endpoint.Forecast>): Promise<ForecastResponse>; | ||
getByCityId<T extends Endpoint>(id: number, endpoint?: T): Promise<Response<T>>; | ||
@@ -12,0 +12,0 @@ getByCityName<T extends Endpoint>(name: string, endpoint?: T): Promise<Response<T>>; |
{ | ||
"name": "openweathermap-api-client", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Promise based API client for getting weather data and forecasts from openweathermap.org", | ||
@@ -5,0 +5,0 @@ "author": "Torkild Dyvik Olsen", |
import axios, { AxiosInstance, AxiosResponse } from "axios"; | ||
import qs from "query-string"; | ||
import { Coord, CountryCode, Endpoint, Language, Options, RequestQuery, Response, Units } from "./interfaces"; | ||
import { | ||
Coord, | ||
CountryCode, | ||
Endpoint, | ||
ForecastResponse, | ||
Language, | ||
Options, | ||
RequestQuery, | ||
Response, | ||
Units, | ||
WeatherResponse, | ||
} from "./interfaces"; | ||
import { isEndpoint, isCoord, isRequestQuery, isCountryCode } from "./utils"; | ||
@@ -44,3 +55,3 @@ import { ApiException } from "./api-exception"; | ||
// Returns the current weather for given query. | ||
async current(query: number | string | Coord | RequestQuery<Endpoint.Weather>) { | ||
async current(query: number | string | Coord | RequestQuery<Endpoint.Weather>): Promise<WeatherResponse> { | ||
return this.request("weather", this._prepQuery(query)); | ||
@@ -55,3 +66,3 @@ } | ||
// Returns forecast for given query. | ||
async forecast(query: number | string | Coord | RequestQuery<Endpoint.Forecast>) { | ||
async forecast(query: number | string | Coord | RequestQuery<Endpoint.Forecast>): Promise<ForecastResponse> { | ||
return this.request("forecast", this._prepQuery(query)); | ||
@@ -58,0 +69,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
210222
789