twa-sdk-types
is a TypeScript package that provides type definitions for the Telegram Web Apps SDK.
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');
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.
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
- Update and generate with github cron actions