seventimer-api
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Seventimer API

Interfaces and types for the 7Timer! API.

Usage

Example in combination with axios

import axios from "axios"
import { Seventimer } from "seventimer-api"

/* Use the api class to manage parameters and url */
const api = new Seventimer.Api()
api.lat = 52.520
api.lon = 13.404

/* Tell axios what to expect and use generated url */
axios.get<Seventimer.CivilLightResponse>(api.getRequestUrl())
.then(response => {
    for (const item of response.data.dataseries) {
        console.log(item.temp2m)
    }
})

Todos

  • [ ] The two api returns malformed json responses and is therefore not really functional
  • [ ] Types should be moved to the Types.ts file
  • [ ] Maybe implement the graphical API
  • [ ] Improve quality of comments

Package Sidebar

Install

npm i seventimer-api

Weekly Downloads

1

Version

0.3.0

License

MIT

Unpacked Size

38.1 kB

Total Files

30

Last publish

Collaborators

  • haukeschulz