An open API service indexing awesome lists of open source software.

https://github.com/fullpipe/twa-sdk-types

TypeScript package that provides type definitions for the Telegram Web Apps SDK
https://github.com/fullpipe/twa-sdk-types

telegram telegram-mini-app twa types

Last synced: about 1 month ago
JSON representation

TypeScript package that provides type definitions for the Telegram Web Apps SDK

Awesome Lists containing this project

README

          

# Types for Telegram Web Apps (TWA) SDK

[![Telegram webapps docs](https://img.shields.io/badge/webapps%20docs-blue)](https://core.telegram.org/bots/webapps)
[![NPM Version](https://img.shields.io/npm/v/twa-sdk-types)](https://www.npmjs.com/package/twa-sdk-types)

`twa-sdk-types` is a TypeScript package that provides type definitions for the Telegram Web Apps SDK.

## Usage

Install

```sh
npm install twa-sdk-types
```

Declare in `global.d.ts`

```ts
import { Telegram } from 'twa-sdk-types';

declare global {
interface Window {
Telegram: Telegram;
}
}
window.Telegram.WebApp.HapticFeedback.notificationOccurred('success');
```

## Versioning and Updates

Major and minor versions of the package will be synchronized with the SDK.

For example:

- `SDK v9.0` => `twa-sdk-types@9.0.*`

All fixes within a specific SDK version (e.g., `v9.0`) will be published as patch updates.

## Update and generate

rebuild types

```sh
deno --allow-env --allow-read --allow-net --allow-write scrape/main.ts
npx prettier -w src/*
```

Build

```sh
npm run build
```

Publish or patch

```sh
npm version patch
npm publish
```

## Todo

- [ ] Update and generate with github cron actions