Comparing version 3.0.3 to 3.1.0
@@ -18,2 +18,6 @@ import { Typegram } from "./proxied"; | ||
export type TelegramP = DefaultTypegram["TelegramP"]; | ||
/** Utility type providing a version Telegram where all methods return ApiResponse objects instead of raw data */ | ||
export type TelegramR = DefaultTypegram["TelegramR"]; | ||
/** Utility type providing a version Telegram where all methods return Promises of ApiResponse objects, combination of TelegramP and TelegramR */ | ||
export type TelegramPR = DefaultTypegram["TelegramPR"]; | ||
@@ -20,0 +24,0 @@ /** This object represents the content of a media message to be sent. It should be one of |
{ | ||
"name": "typegram", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"description": "Type declarations for the Telegram API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -73,2 +73,17 @@ # Types for the Telegram API | ||
## Using API Response Objects | ||
The Telegram API does not return just the requested data in the body of the response objects. | ||
Instead, they are wrapped inside an object that has an `ok: boolean` status flag, indicating success or failure of the preceding API request. | ||
This outer object is modelled in `typegram` by the `ApiResponse` type. | ||
If you need the methods of `Telegram` to return `ApiResponse` objects instead of the raw data, consider using `TelegramR`. | ||
This works analogously to `TelegramP`. | ||
The type maps all methods of `Telegram` to a version where they return `ApiResponse` objects of the data, instead of the data themselves. | ||
## Using Both Promises and API Response Objects | ||
Yes. | ||
`TelegramPR`. | ||
## Customizing `InputFile` | ||
@@ -75,0 +90,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
212346
17
3469
166