JSPM

@airgram/api

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q36733F
  • License GPL-3.0

Package Exports

  • @airgram/api

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@airgram/api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Wrappers for TDLib API

This repository contains strict typed wrappers for all TDLib (1.4.0) methods and classes.

Differences from the original API:

  • All parameter names are represent in "camelCase".
  • Parameter @type renamed to _.

Installation

# npm
npm install airgram-api

Basic usage

import { apiFactory } from 'airgram-api'

function callApi (method, params) {
    // some function which sends request to TDLib
    return requestToTDLib({
      _: method,
      ...params
    }) 
}

const api = apiFactory(callApi)

// Now you can invoke all TDLib methods
api.getMe().then((response) => {
  console.info(response)
})

License

The source code is licensed under GPL v3. License is available here.