@grammyjs/types 2.12.0 → 3.0.0
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/README.md +15 -2
- package/api.d.ts +10 -13
- package/inline.d.ts +532 -586
- package/manage.d.ts +375 -423
- package/markup.d.ts +159 -189
- package/message.d.ts +535 -633
- package/methods.d.ts +1531 -0
- package/mod.d.ts +10 -0
- package/package.json +15 -5
- package/passport.d.ts +113 -182
- package/payment.d.ts +77 -85
- package/{menu-button.d.ts → settings.d.ts} +45 -57
- package/update.d.ts +50 -52
- package/.editorconfig +0 -8
- package/deno.jsonc +0 -1
- package/index.d.ts +0 -10
- package/proxied.d.ts +0 -1702
- /package/{index.js → mod.js} +0 -0
package/README.md
CHANGED
|
@@ -71,8 +71,9 @@ grammY automatically translates calls to `sendDocument` and the like to multipar
|
|
|
71
71
|
Consequently, the type `InputFile` is not defined in this library.
|
|
72
72
|
|
|
73
73
|
Instead, grammY specifies its own version of what an `InputFile` is, hence automatically adjusting `@grammyjs/types` with a custom `InputFile` type used throughout all affected methods and interfaces.
|
|
74
|
-
This is possible by
|
|
75
|
-
grammY then
|
|
74
|
+
This is possible by adding a type parameter to all affected types.
|
|
75
|
+
grammY then import types parametrises these types with its version of `InputFile`, and re-exports the adjusted types.
|
|
76
|
+
This is why you should always import Bot API as described here: <https://grammy.dev/guide/api.html#type-definitions-for-the-api>.
|
|
76
77
|
|
|
77
78
|
## Differences to the Bot API
|
|
78
79
|
|
|
@@ -91,3 +92,15 @@ The actual type definitions themselves are never different.
|
|
|
91
92
|
Also, without the links, it's useless anyway.
|
|
92
93
|
5. No images.
|
|
93
94
|
Documentation strings containing an image are adjusted to make sense without the images, too.
|
|
95
|
+
|
|
96
|
+
## Contributing
|
|
97
|
+
|
|
98
|
+
This is a Deno project.
|
|
99
|
+
All the files are TypeScript files that are published on <https://deno.land/x/grammy_types>.
|
|
100
|
+
This project uses [deno2node](https://github.com/fromdeno/deno2node) to emit declaration files which are then published on npm.
|
|
101
|
+
|
|
102
|
+
If you want to work on this, you do not need to have Node.js installed.
|
|
103
|
+
You also should not run `npm install`.
|
|
104
|
+
You only need [Deno](https://deno.land) and the VSCode extensions recommended in this repo.
|
|
105
|
+
|
|
106
|
+
Run `deno task` to see available development scripts.
|
package/api.d.ts
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
export interface ApiError {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
ok: false;
|
|
3
|
+
error_code: number;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters?: ResponseParameters;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
7
|
export interface ApiSuccess<T> {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
ok: true;
|
|
9
|
+
result: T;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
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.
|
|
14
12
|
|
|
15
13
|
All methods in the Bot API are case-insensitive.
|
|
16
14
|
All queries must be made using UTF-8. */
|
|
17
15
|
export type ApiResponse<T> = ApiError | ApiSuccess<T>;
|
|
18
|
-
|
|
19
16
|
/** Describes why a request was unsuccessful. */
|
|
20
17
|
export interface ResponseParameters {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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;
|
|
25
22
|
}
|