@telegram.ts/types 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +14 -0
- package/package.json +26 -0
- package/src/api.d.ts +22 -0
- package/src/index.d.ts +10 -0
- package/src/index.js +2 -0
- package/src/inline.d.ts +693 -0
- package/src/manage.d.ts +466 -0
- package/src/markup.d.ts +226 -0
- package/src/message.d.ts +743 -0
- package/src/methods.d.ts +1543 -0
- package/src/passport.d.ts +163 -0
- package/src/payment.d.ts +103 -0
- package/src/settings.d.ts +122 -0
- package/src/update.d.ts +74 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including, without limitation, the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
2
|
+
|
|
3
|
+
1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
4
|
+
|
|
5
|
+
2. THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
6
|
+
|
|
7
|
+
By exercising the rights granted herein, you agree to the terms and conditions of this License.
|
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @telegram.ts/types: Type Declarations for Telegram Bot API
|
|
2
|
+
|
|
3
|
+
The `@telegram.ts/types` package provides comprehensive type declarations for the Telegram Bot API, specifically tailored for use with `telegramsjs`.
|
|
4
|
+
|
|
5
|
+
This package is designed to simplify the development of Telegram bots using `telegramsjs` by providing accurate type annotations for all API methods and objects. It does not contain any executable code.
|
|
6
|
+
|
|
7
|
+
Key Features:
|
|
8
|
+
- Type annotations for all API methods and objects
|
|
9
|
+
- Consistent with the Telegram Bot API documentation
|
|
10
|
+
- Simplifies handling of JSON-serialized objects
|
|
11
|
+
- Customization support for InputFile handling
|
|
12
|
+
- Maintained and updated in sync with the Telegram Bot API
|
|
13
|
+
|
|
14
|
+
Join the `telegramsjs` community and make building Telegram bots even easier with `@telegram.ts/types`!
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@telegram.ts/types",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "@telegram.ts/types: Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"types": "src/index.d.ts",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"telegramsjs",
|
|
9
|
+
"telegram",
|
|
10
|
+
"bot",
|
|
11
|
+
"api",
|
|
12
|
+
"types"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/Sempai-07/telegram-ts-types/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/Sempai-07/telegram-ts-types.git"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"src/*.d.ts",
|
|
24
|
+
"src/index.js"
|
|
25
|
+
]
|
|
26
|
+
}
|
package/src/api.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ApiError {
|
|
2
|
+
ok: false;
|
|
3
|
+
error_code: number;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters?: ResponseParameters;
|
|
6
|
+
}
|
|
7
|
+
export interface ApiSuccess < T > {
|
|
8
|
+
ok: true;
|
|
9
|
+
result: T;
|
|
10
|
+
}
|
|
11
|
+
/** The response contains an object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals true, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error.
|
|
12
|
+
|
|
13
|
+
All methods in the Bot API are case-insensitive.
|
|
14
|
+
All queries must be made using UTF-8. */
|
|
15
|
+
export type ApiResponse < T > = ApiError | ApiSuccess < T >;
|
|
16
|
+
/** Describes why a request was unsuccessful. */
|
|
17
|
+
export interface ResponseParameters {
|
|
18
|
+
/** The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */
|
|
19
|
+
migrate_to_chat_id?: number;
|
|
20
|
+
/** In case of exceeding flood control, the number of seconds left to wait before the request can be repeated */
|
|
21
|
+
retry_after?: number;
|
|
22
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./api.js";
|
|
2
|
+
export * from "./inline.js";
|
|
3
|
+
export * from "./manage.js";
|
|
4
|
+
export * from "./markup.js";
|
|
5
|
+
export * from "./message.js";
|
|
6
|
+
export * from "./methods.js";
|
|
7
|
+
export * from "./passport.js";
|
|
8
|
+
export * from "./payment.js";
|
|
9
|
+
export * from "./settings.js";
|
|
10
|
+
export * from "./update.js";
|
package/src/index.js
ADDED