@tma.js/transformers 1.0.0 → 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.
@@ -5,5 +5,145 @@ export type ParseInitDataQueryError = ValiError<InitDataGenSchema>;
5
5
  export type ParseLaunchParamsQueryError = ValiError<LaunchParamsGenSchema>;
6
6
  export declare function parseInitDataQueryFp(value: string | URLSearchParams): E.Either<ParseInitDataQueryError, InitDataGenType>;
7
7
  export declare function parseLaunchParamsQueryFp(value: string | URLSearchParams): E.Either<ParseLaunchParamsQueryError, LaunchParamsGenType>;
8
- export declare const parseInitDataQuery: (value: string | URLSearchParams) => ParseInitDataQueryError;
9
- export declare const parseLaunchParamsQuery: (value: string | URLSearchParams) => ParseLaunchParamsQueryError;
8
+ export declare const parseInitDataQuery: (value: string | URLSearchParams) => {
9
+ auth_date: Date;
10
+ can_send_after?: number | undefined;
11
+ chat?: ({
12
+ id: number;
13
+ photo_url?: string | undefined;
14
+ type: string;
15
+ title: string;
16
+ username?: string | undefined;
17
+ } & {
18
+ [key: string]: unknown;
19
+ }) | undefined;
20
+ chat_type?: string | undefined;
21
+ chat_instance?: string | undefined;
22
+ hash: string;
23
+ query_id?: string | undefined;
24
+ receiver?: ({
25
+ added_to_attachment_menu?: boolean | undefined;
26
+ allows_write_to_pm?: boolean | undefined;
27
+ first_name: string;
28
+ id: number;
29
+ is_bot?: boolean | undefined;
30
+ is_premium?: boolean | undefined;
31
+ last_name?: string | undefined;
32
+ language_code?: string | undefined;
33
+ photo_url?: string | undefined;
34
+ username?: string | undefined;
35
+ } & {
36
+ [key: string]: unknown;
37
+ }) | undefined;
38
+ start_param?: string | undefined;
39
+ signature: string;
40
+ user?: ({
41
+ added_to_attachment_menu?: boolean | undefined;
42
+ allows_write_to_pm?: boolean | undefined;
43
+ first_name: string;
44
+ id: number;
45
+ is_bot?: boolean | undefined;
46
+ is_premium?: boolean | undefined;
47
+ last_name?: string | undefined;
48
+ language_code?: string | undefined;
49
+ photo_url?: string | undefined;
50
+ username?: string | undefined;
51
+ } & {
52
+ [key: string]: unknown;
53
+ }) | undefined;
54
+ } & {
55
+ [key: string]: unknown;
56
+ };
57
+ export declare const parseLaunchParamsQuery: (value: string | URLSearchParams) => {
58
+ tgWebAppBotInline?: boolean | undefined;
59
+ tgWebAppData?: ({
60
+ auth_date: Date;
61
+ can_send_after?: number | undefined;
62
+ chat?: ({
63
+ id: number;
64
+ photo_url?: string | undefined;
65
+ type: string;
66
+ title: string;
67
+ username?: string | undefined;
68
+ } & {
69
+ [key: string]: unknown;
70
+ }) | undefined;
71
+ chat_type?: string | undefined;
72
+ chat_instance?: string | undefined;
73
+ hash: string;
74
+ query_id?: string | undefined;
75
+ receiver?: ({
76
+ added_to_attachment_menu?: boolean | undefined;
77
+ allows_write_to_pm?: boolean | undefined;
78
+ first_name: string;
79
+ id: number;
80
+ is_bot?: boolean | undefined;
81
+ is_premium?: boolean | undefined;
82
+ last_name?: string | undefined;
83
+ language_code?: string | undefined;
84
+ photo_url?: string | undefined;
85
+ username?: string | undefined;
86
+ } & {
87
+ [key: string]: unknown;
88
+ }) | undefined;
89
+ start_param?: string | undefined;
90
+ signature: string;
91
+ user?: ({
92
+ added_to_attachment_menu?: boolean | undefined;
93
+ allows_write_to_pm?: boolean | undefined;
94
+ first_name: string;
95
+ id: number;
96
+ is_bot?: boolean | undefined;
97
+ is_premium?: boolean | undefined;
98
+ last_name?: string | undefined;
99
+ language_code?: string | undefined;
100
+ photo_url?: string | undefined;
101
+ username?: string | undefined;
102
+ } & {
103
+ [key: string]: unknown;
104
+ }) | undefined;
105
+ } & {
106
+ [key: string]: unknown;
107
+ }) | undefined;
108
+ tgWebAppDefaultColors?: {
109
+ accent_text_color?: `#${string}` | undefined;
110
+ bg_color?: `#${string}` | undefined;
111
+ button_color?: `#${string}` | undefined;
112
+ button_text_color?: `#${string}` | undefined;
113
+ bottom_bar_bg_color?: `#${string}` | undefined;
114
+ destructive_text_color?: `#${string}` | undefined;
115
+ header_bg_color?: `#${string}` | undefined;
116
+ hint_color?: `#${string}` | undefined;
117
+ link_color?: `#${string}` | undefined;
118
+ secondary_bg_color?: `#${string}` | undefined;
119
+ section_bg_color?: `#${string}` | undefined;
120
+ section_header_text_color?: `#${string}` | undefined;
121
+ section_separator_color?: `#${string}` | undefined;
122
+ subtitle_text_color?: `#${string}` | undefined;
123
+ text_color?: `#${string}` | undefined;
124
+ } | undefined;
125
+ tgWebAppFullscreen?: boolean | undefined;
126
+ tgWebAppPlatform: string;
127
+ tgWebAppShowSettings?: boolean | undefined;
128
+ tgWebAppStartParam?: string | undefined;
129
+ tgWebAppThemeParams: {
130
+ accent_text_color?: `#${string}` | undefined;
131
+ bg_color?: `#${string}` | undefined;
132
+ button_color?: `#${string}` | undefined;
133
+ button_text_color?: `#${string}` | undefined;
134
+ bottom_bar_bg_color?: `#${string}` | undefined;
135
+ destructive_text_color?: `#${string}` | undefined;
136
+ header_bg_color?: `#${string}` | undefined;
137
+ hint_color?: `#${string}` | undefined;
138
+ link_color?: `#${string}` | undefined;
139
+ secondary_bg_color?: `#${string}` | undefined;
140
+ section_bg_color?: `#${string}` | undefined;
141
+ section_header_text_color?: `#${string}` | undefined;
142
+ section_separator_color?: `#${string}` | undefined;
143
+ subtitle_text_color?: `#${string}` | undefined;
144
+ text_color?: `#${string}` | undefined;
145
+ };
146
+ tgWebAppVersion: string;
147
+ } & {
148
+ [key: string]: unknown;
149
+ };
package/dist/dts/rgb.d.ts CHANGED
@@ -27,4 +27,4 @@ export declare function toRGBFp(value: string): E.Either<Error, RGB>;
27
27
  * - `rgba(1,2,3,4)`
28
28
  * @param value - value to convert.
29
29
  */
30
- export declare const toRGB: (value: string) => Error;
30
+ export declare const toRGB: (value: string) => `#${string}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tma.js/transformers",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Transformation utilities we use in the @tma.js packages.",
5
5
  "author": "Vladislav Kibenko <wolfram.deus@gmail.com>",
6
6
  "homepage": "https://github.com/Telegram-Mini-Apps/telegram-apps#readme",
@@ -36,8 +36,8 @@
36
36
  "dependencies": {
37
37
  "fp-ts": "^2.16.11",
38
38
  "valibot": "^1.1.0",
39
- "@tma.js/toolkit": "^1.0.0",
40
- "@tma.js/types": "^1.0.0"
39
+ "@tma.js/types": "^1.0.0",
40
+ "@tma.js/toolkit": "^1.0.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "test-utils": "0.0.1",