@plvxn/tgraf-types
v9.5.0
Published
Type declarations for the Telegram Bot API — telegraf fork
Maintainers
Readme
Types for the Telegram Bot API
TypeScript types for the Telegram Bot API. Fork of @telegraf/types with Bot API 9.5 support.
Zero executable code.
Installation
npm install --save-dev @plvxn/tgraf-typesAvailable Types
The package exposes interfaces that correspond to types used throughout the Telegram Bot API. Types like Update, Message, CallbackQuery, Chat, etc. are represented as unions for type narrowing.
Using API Response objects
The API wraps responses in an object with ok: boolean. This is modelled by the ApiResponse type.
Customizing InputFile
import * as Telegram from "@plvxn/tgraf-types";
type API = Telegram.ApiMethods<MyInputFile>;
type Opts<M extends keyof API> = Telegram.Opts<MyInputFile>[M];
type Ret<M extends keyof API> = Telegram.Ret<MyInputFile>[M];Development
Written for Deno, built for Node. npm prepare runs deno2node.
Credits
Fork of @telegraf/types. Originally from Typegram.
