@core-ease/telegram-kit 3.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.
Files changed (86) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +299 -0
  3. package/dist/animation/index.d.mts +4 -0
  4. package/dist/animation/index.d.ts +4 -0
  5. package/dist/animation/index.js +2413 -0
  6. package/dist/animation/index.mjs +5 -0
  7. package/dist/animation/lottie/index.d.mts +10 -0
  8. package/dist/animation/lottie/index.d.ts +10 -0
  9. package/dist/animation/lottie/index.js +2313 -0
  10. package/dist/animation/lottie/index.mjs +4 -0
  11. package/dist/animation/tgs/index.d.mts +18 -0
  12. package/dist/animation/tgs/index.d.ts +18 -0
  13. package/dist/animation/tgs/index.js +2402 -0
  14. package/dist/animation/tgs/index.mjs +4 -0
  15. package/dist/bot/index.d.mts +477 -0
  16. package/dist/bot/index.d.ts +477 -0
  17. package/dist/bot/index.js +870 -0
  18. package/dist/bot/index.mjs +847 -0
  19. package/dist/bot-D8BnLWIi.d.mts +2041 -0
  20. package/dist/bot-D8BnLWIi.d.ts +2041 -0
  21. package/dist/browser.global.js +23 -0
  22. package/dist/chunk-7AARTHNW.mjs +40 -0
  23. package/dist/chunk-7CVYPKAL.mjs +15 -0
  24. package/dist/chunk-B3PWALX5.mjs +4418 -0
  25. package/dist/chunk-BQEUEAVK.mjs +2262 -0
  26. package/dist/chunk-FPWYSKK2.mjs +3089 -0
  27. package/dist/chunk-JXK5HCDV.mjs +254 -0
  28. package/dist/chunk-OMH2JGOH.mjs +88 -0
  29. package/dist/chunk-PXO36YTU.mjs +38 -0
  30. package/dist/core/index.d.mts +151 -0
  31. package/dist/core/index.d.ts +151 -0
  32. package/dist/core/index.js +3837 -0
  33. package/dist/core/index.mjs +495 -0
  34. package/dist/dev/index.d.mts +77 -0
  35. package/dist/dev/index.d.ts +77 -0
  36. package/dist/dev/index.js +3214 -0
  37. package/dist/dev/index.mjs +151 -0
  38. package/dist/engine-BDm1_hzn.d.mts +382 -0
  39. package/dist/engine-BDm1_hzn.d.ts +382 -0
  40. package/dist/format/index.d.mts +61 -0
  41. package/dist/format/index.d.ts +61 -0
  42. package/dist/format/index.js +121 -0
  43. package/dist/format/index.mjs +112 -0
  44. package/dist/hooks/index.d.mts +1 -0
  45. package/dist/hooks/index.d.ts +1 -0
  46. package/dist/hooks/index.js +4234 -0
  47. package/dist/hooks/index.mjs +3 -0
  48. package/dist/hooks-C5Per70R.d.mts +1066 -0
  49. package/dist/hooks-C5Per70R.d.ts +1066 -0
  50. package/dist/index.d.mts +849 -0
  51. package/dist/index.d.ts +849 -0
  52. package/dist/index.js +5026 -0
  53. package/dist/index.mjs +478 -0
  54. package/dist/keyboards/index.d.mts +50 -0
  55. package/dist/keyboards/index.d.ts +50 -0
  56. package/dist/keyboards/index.js +127 -0
  57. package/dist/keyboards/index.mjs +124 -0
  58. package/dist/links/index.d.mts +53 -0
  59. package/dist/links/index.d.ts +53 -0
  60. package/dist/links/index.js +139 -0
  61. package/dist/links/index.mjs +133 -0
  62. package/dist/lottie/index.d.mts +3 -0
  63. package/dist/lottie/index.d.ts +3 -0
  64. package/dist/lottie/index.js +2313 -0
  65. package/dist/lottie/index.mjs +4 -0
  66. package/dist/qr/index.d.mts +75 -0
  67. package/dist/qr/index.d.ts +75 -0
  68. package/dist/qr/index.js +983 -0
  69. package/dist/qr/index.mjs +946 -0
  70. package/dist/sdk/index.d.mts +322 -0
  71. package/dist/sdk/index.d.ts +322 -0
  72. package/dist/sdk/index.js +3138 -0
  73. package/dist/sdk/index.mjs +2 -0
  74. package/dist/server/index.d.mts +28 -0
  75. package/dist/server/index.d.ts +28 -0
  76. package/dist/server/index.js +254 -0
  77. package/dist/server/index.mjs +246 -0
  78. package/dist/tgs/index.d.mts +3 -0
  79. package/dist/tgs/index.d.ts +3 -0
  80. package/dist/tgs/index.js +2402 -0
  81. package/dist/tgs/index.mjs +4 -0
  82. package/dist/webapp-B-3_74nK.d.mts +842 -0
  83. package/dist/webapp-B-3_74nK.d.ts +842 -0
  84. package/dist/webapp-BDi9q3-a.d.mts +42 -0
  85. package/dist/webapp-YvmwFYUQ.d.ts +42 -0
  86. package/package.json +165 -0
@@ -0,0 +1,42 @@
1
+ import { a as WebApp } from './webapp-B-3_74nK.mjs';
2
+
3
+ /**
4
+ * Public-facing types for `window.Telegram.WebApp`, used throughout
5
+ * `core/`, `react/hooks.ts`, and `_internal/providers/TelegramProvider.tsx`.
6
+ *
7
+ * These are now thin re-exports/aliases of the bundled SDK's real types
8
+ * (`../sdk`) rather than a hand-maintained parallel interface set. Two
9
+ * things made that possible:
10
+ *
11
+ * 1. `TgWebApp` is a straight alias for the SDK's real `WebApp` class -
12
+ * every property/method here is authoritative, not a best-effort copy
13
+ * that can drift out of sync.
14
+ * 2. `core/dev.ts` no longer builds a plain-object mock that has to
15
+ * structurally satisfy this type (see its own docs): it seeds fake init
16
+ * data and lets the *real* SDK bootstrap from it, so there's no more
17
+ * need for a parallel, private-field-free interface just to keep mocks
18
+ * buildable.
19
+ *
20
+ * `getWebApp()` in `core/index.ts` returns the SDK's `WebApp` type
21
+ * directly; `TgWebApp` exists mainly so older imports of this module don't
22
+ * need to change.
23
+ */
24
+
25
+ /** `WebApp.setEmojiStatus()` options. Not exported by the SDK as a named type (it's inline there), so kept here. */
26
+ interface EmojiStatusParams {
27
+ duration?: number;
28
+ }
29
+ type RuntimeMode = 'node' | 'edge';
30
+ /** The real, authoritative `WebApp` class from the bundled SDK. */
31
+ type TgWebApp = WebApp;
32
+ declare global {
33
+ interface Window {
34
+ Telegram?: {
35
+ WebApp: TgWebApp;
36
+ WebView?: unknown;
37
+ Utils?: unknown;
38
+ };
39
+ }
40
+ }
41
+
42
+ export type { EmojiStatusParams as E, RuntimeMode as R };
@@ -0,0 +1,42 @@
1
+ import { a as WebApp } from './webapp-B-3_74nK.js';
2
+
3
+ /**
4
+ * Public-facing types for `window.Telegram.WebApp`, used throughout
5
+ * `core/`, `react/hooks.ts`, and `_internal/providers/TelegramProvider.tsx`.
6
+ *
7
+ * These are now thin re-exports/aliases of the bundled SDK's real types
8
+ * (`../sdk`) rather than a hand-maintained parallel interface set. Two
9
+ * things made that possible:
10
+ *
11
+ * 1. `TgWebApp` is a straight alias for the SDK's real `WebApp` class -
12
+ * every property/method here is authoritative, not a best-effort copy
13
+ * that can drift out of sync.
14
+ * 2. `core/dev.ts` no longer builds a plain-object mock that has to
15
+ * structurally satisfy this type (see its own docs): it seeds fake init
16
+ * data and lets the *real* SDK bootstrap from it, so there's no more
17
+ * need for a parallel, private-field-free interface just to keep mocks
18
+ * buildable.
19
+ *
20
+ * `getWebApp()` in `core/index.ts` returns the SDK's `WebApp` type
21
+ * directly; `TgWebApp` exists mainly so older imports of this module don't
22
+ * need to change.
23
+ */
24
+
25
+ /** `WebApp.setEmojiStatus()` options. Not exported by the SDK as a named type (it's inline there), so kept here. */
26
+ interface EmojiStatusParams {
27
+ duration?: number;
28
+ }
29
+ type RuntimeMode = 'node' | 'edge';
30
+ /** The real, authoritative `WebApp` class from the bundled SDK. */
31
+ type TgWebApp = WebApp;
32
+ declare global {
33
+ interface Window {
34
+ Telegram?: {
35
+ WebApp: TgWebApp;
36
+ WebView?: unknown;
37
+ Utils?: unknown;
38
+ };
39
+ }
40
+ }
41
+
42
+ export type { EmojiStatusParams as E, RuntimeMode as R };
package/package.json ADDED
@@ -0,0 +1,165 @@
1
+ {
2
+ "name": "@core-ease/telegram-kit",
3
+ "version": "3.0.1",
4
+ "description": "Professional Telegram library : Mini Apps SDK bundled in full (a complete typed TypeScript re-implementation of Telegram's official telegram-web-app.js - no CDN script required) + React hooks, providers, types + Bot API server-side client + zero-dependency .tgs sticker player and Lottie JSON player + standards-compliant zero-dependency QR Code encoder (ISO/IEC 18004) + safe Markdown/HTML formatting, deep-link, and keyboard-builder utilities. Works with React, Vue, vanilla JS, HTML, and Node.js.",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "browser": "./dist/browser.global.js",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.mjs",
13
+ "require": "./dist/index.js"
14
+ },
15
+ "./hooks": {
16
+ "types": "./dist/hooks/index.d.ts",
17
+ "import": "./dist/hooks/index.mjs",
18
+ "require": "./dist/hooks/index.js"
19
+ },
20
+ "./core": {
21
+ "types": "./dist/core/index.d.ts",
22
+ "import": "./dist/core/index.mjs",
23
+ "require": "./dist/core/index.js"
24
+ },
25
+ "./server": {
26
+ "types": "./dist/server/index.d.ts",
27
+ "import": "./dist/server/index.mjs",
28
+ "require": "./dist/server/index.js"
29
+ },
30
+ "./bot": {
31
+ "types": "./dist/bot/index.d.ts",
32
+ "import": "./dist/bot/index.mjs",
33
+ "require": "./dist/bot/index.js"
34
+ },
35
+ "./sdk": {
36
+ "types": "./dist/sdk/index.d.ts",
37
+ "import": "./dist/sdk/index.mjs",
38
+ "require": "./dist/sdk/index.js"
39
+ },
40
+ "./dev": {
41
+ "types": "./dist/dev/index.d.ts",
42
+ "import": "./dist/dev/index.mjs",
43
+ "require": "./dist/dev/index.js"
44
+ },
45
+ "./animation": {
46
+ "types": "./dist/animation/index.d.ts",
47
+ "import": "./dist/animation/index.mjs",
48
+ "require": "./dist/animation/index.js"
49
+ },
50
+ "./animation/lottie": {
51
+ "types": "./dist/animation/lottie/index.d.ts",
52
+ "import": "./dist/animation/lottie/index.mjs",
53
+ "require": "./dist/animation/lottie/index.js"
54
+ },
55
+ "./animation/tgs": {
56
+ "types": "./dist/animation/tgs/index.d.ts",
57
+ "import": "./dist/animation/tgs/index.mjs",
58
+ "require": "./dist/animation/tgs/index.js"
59
+ },
60
+ "./tgs": {
61
+ "types": "./dist/tgs/index.d.ts",
62
+ "import": "./dist/tgs/index.mjs",
63
+ "require": "./dist/tgs/index.js"
64
+ },
65
+ "./lottie": {
66
+ "types": "./dist/lottie/index.d.ts",
67
+ "import": "./dist/lottie/index.mjs",
68
+ "require": "./dist/lottie/index.js"
69
+ },
70
+ "./qr": {
71
+ "types": "./dist/qr/index.d.ts",
72
+ "import": "./dist/qr/index.mjs",
73
+ "require": "./dist/qr/index.js"
74
+ },
75
+ "./format": {
76
+ "types": "./dist/format/index.d.ts",
77
+ "import": "./dist/format/index.mjs",
78
+ "require": "./dist/format/index.js"
79
+ },
80
+ "./links": {
81
+ "types": "./dist/links/index.d.ts",
82
+ "import": "./dist/links/index.mjs",
83
+ "require": "./dist/links/index.js"
84
+ },
85
+ "./keyboards": {
86
+ "types": "./dist/keyboards/index.d.ts",
87
+ "import": "./dist/keyboards/index.mjs",
88
+ "require": "./dist/keyboards/index.js"
89
+ },
90
+ "./browser": "./dist/browser.global.js"
91
+ },
92
+ "files": [
93
+ "dist"
94
+ ],
95
+ "scripts": {
96
+ "build": "tsup",
97
+ "dev": "tsup --watch",
98
+ "typecheck": "tsc --noEmit",
99
+ "lint": "tsc --noEmit"
100
+ },
101
+ "keywords": [
102
+ "telegram",
103
+ "telegram-web-app",
104
+ "telegram-mini-app",
105
+ "twa",
106
+ "mini-app",
107
+ "react",
108
+ "bot-api",
109
+ "telegram-bot",
110
+ "nextjs",
111
+ "tma",
112
+ "hooks",
113
+ "server",
114
+ "tg",
115
+ "tgs",
116
+ "tgs-player",
117
+ "player",
118
+ "lottie",
119
+ "lottie-player",
120
+ "bot-telegram",
121
+ "telegram-kit",
122
+ "animation",
123
+ "qrcode",
124
+ "qr-code",
125
+ "qr-code-generator",
126
+ "markdown-v2",
127
+ "deep-link",
128
+ "inline-keyboard"
129
+ ],
130
+ "author": "mr-m-apps",
131
+ "repository": {
132
+ "type": "git",
133
+ "url": "git+https://github.com/CoreEase/telegram-kit.git"
134
+ },
135
+ "bugs": {
136
+ "url": "https://github.com/CoreEase/telegram-kit/issues"
137
+ },
138
+ "homepage": "https://github.com/CoreEase/telegram-kit#readme",
139
+ "license": "MIT",
140
+ "sideEffects": false,
141
+ "peerDependencies": {
142
+ "react": ">=18.0.0",
143
+ "react-dom": ">=18.0.0"
144
+ },
145
+ "peerDependenciesMeta": {
146
+ "react": {
147
+ "optional": true
148
+ },
149
+ "react-dom": {
150
+ "optional": true
151
+ }
152
+ },
153
+ "devDependencies": {
154
+ "@types/node": "^24.0.0",
155
+ "@types/react": "^18.0.0",
156
+ "@types/react-dom": "^18.0.0",
157
+ "react": "^18.0.0",
158
+ "react-dom": "^18.0.0",
159
+ "tsup": "^8.5.1",
160
+ "typescript": "^5.9.3"
161
+ },
162
+ "engines": {
163
+ "node": ">=18.0.0"
164
+ }
165
+ }