# Interface WeatherProviderMethods

interface WeatherProviderMethods {
getForecasts: (
position: Position,
type: WeatherForecastType,
options?: WeatherReqParams,
) => Promise<WeatherData[]>;
getObservations: (
position: Position,
options?: WeatherReqParams,
) => Promise<WeatherData[]>;
getWarnings: (position: Position) => Promise<WeatherWarning[]>;
pluginId?: string;
}

- Defined in weatherapi.ts:165

##### Index

### Other

pluginId?

### Weather API

getForecasts
getObservations
getWarnings

## Other

### `Optional` pluginId

pluginId?: string

- Defined in weatherapi.ts:166

## Weather API

### getForecasts

getForecasts: (
position: Position,
type: WeatherForecastType,
options?: WeatherReqParams,
) => Promise<WeatherData[]>

Retrieves forecast data from the weather provider for the supplied position, forecast type and number of intervals. The returned array of forecasts should be ordered in ascending date order.

#### Type declaration

- - (
    position: Position,
    type: WeatherForecastType,
    options?: WeatherReqParams,
    ): Promise<WeatherData[]>

  - #### Parameters

    - position: Position

      Location of interest

    - type: WeatherForecastType

      Type of forecast point | daily

    - `Optional` options: WeatherReqParams

      Options

    #### Returns Promise<WeatherData[]>

#### Example

Retrieve point forecast data for the next eight point intervalss

    getForecasts(
      {latitude: 16.34765, longitude: 12.5432},
      'point',
      {maxCount: 8}
    );

    [
        {
            "date": "2024-05-03T06:00:00.259Z",
            "type": "point",
            "outside": { ... }
        },
        {
            "date": "2024-05-03T05:00:00.259Z",
            "type": "point",
            "outside": { ... }
        }
    ]

- Defined in weatherapi.ts:237

### getObservations

getObservations: (
position: Position,
options?: WeatherReqParams,
) => Promise<WeatherData[]>

Retrieves observation data from the weather provider for the supplied position. The returned array of observations should be ordered in descending date order.

#### Type declaration

- - (position: Position, options?: WeatherReqParams): Promise<WeatherData[]>

  - #### Parameters

    - position: Position

      Location of interest

    - `Optional` options: WeatherReqParams

      Options

    #### Returns Promise<WeatherData[]>

#### Example

     getObservations({latitude: 16.34765, longitude: 12.5432}, {maxCount: 1});

    [
        {
            "date": "2024-05-03T06:00:00.259Z",
            "type": "observation",
            "outside": { ... }
        },
        {
            "date": "2024-05-03T05:00:00.259Z",
            "type": "observation",
            "outside": { ... }
        }
    ]

- Defined in weatherapi.ts:197

### getWarnings

getWarnings: (position: Position) => Promise<WeatherWarning[]>

Retrieves warning data from the weather provider for the supplied position. The returned array of warnings should be ordered in ascending date order.

#### Type declaration

- - (position: Position): Promise<WeatherWarning[]>

  - #### Parameters

    - position: Position

      Location of interest

    #### Returns Promise<WeatherWarning[]>

#### Example

     getWarnings({latitude: 16.34765, longitude: 12.5432});

    [
      {
        "startTime": "2024-05-03T05:00:00.259Z",
        "endTime": "2024-05-03T08:00:00.702Z",
        "details": "Strong wind warning.",
        "source": "MyWeatherService",
        "type": "Warning"
      }
    ]

- Defined in weatherapi.ts:268