Skip to content

fullpipe/twa-sdk-types

Repository files navigation

Types for Telegram Web Apps (TWA) SDK

Telegram webapps docs NPM Version

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

Usage

Install

npm install twa-sdk-types

Declare in global.d.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

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

Build

npm run build

Publish or patch

npm version patch
npm publish

Todo

  • Update and generate with github cron actions

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors