@tmlmobilidade/types 20260717.2210.46 → 20260719.1344.38

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.
@@ -0,0 +1,247 @@
1
+ import { z } from 'zod';
2
+ export declare const UserPreferenceValueSchema: z.ZodObject<{
3
+ updated_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>;
4
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ updated_at: number & {
7
+ __brand: "UnixTimestamp";
8
+ };
9
+ value: string | number | boolean | string[] | number[];
10
+ }, {
11
+ updated_at: number;
12
+ value: string | number | boolean | string[] | number[];
13
+ }>;
14
+ export type UserPreferenceValue = z.infer<typeof UserPreferenceValueSchema>;
15
+ export declare const UserPreferencesSchema: z.ZodObject<{
16
+ controller: z.ZodObject<{
17
+ favorite_rides: z.ZodObject<{
18
+ updated_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>;
19
+ } & {
20
+ value: z.ZodArray<z.ZodString, "many">;
21
+ }, "strip", z.ZodTypeAny, {
22
+ updated_at: number & {
23
+ __brand: "UnixTimestamp";
24
+ };
25
+ value: string[];
26
+ }, {
27
+ updated_at: number;
28
+ value: string[];
29
+ }>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ favorite_rides: {
32
+ updated_at: number & {
33
+ __brand: "UnixTimestamp";
34
+ };
35
+ value: string[];
36
+ };
37
+ }, {
38
+ favorite_rides: {
39
+ updated_at: number;
40
+ value: string[];
41
+ };
42
+ }>;
43
+ map: z.ZodObject<{
44
+ 'data:search': z.ZodObject<{
45
+ updated_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>;
46
+ } & {
47
+ value: z.ZodDefault<z.ZodString>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ updated_at: number & {
50
+ __brand: "UnixTimestamp";
51
+ };
52
+ value: string;
53
+ }, {
54
+ updated_at: number;
55
+ value?: string | undefined;
56
+ }>;
57
+ 'flags:scroll-zoom': z.ZodObject<{
58
+ updated_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>;
59
+ } & {
60
+ value: z.ZodDefault<z.ZodBoolean>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ updated_at: number & {
63
+ __brand: "UnixTimestamp";
64
+ };
65
+ value: boolean;
66
+ }, {
67
+ updated_at: number;
68
+ value?: boolean | undefined;
69
+ }>;
70
+ 'flags:style': z.ZodObject<{
71
+ updated_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>;
72
+ } & {
73
+ value: z.ZodDefault<z.ZodString>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ updated_at: number & {
76
+ __brand: "UnixTimestamp";
77
+ };
78
+ value: string;
79
+ }, {
80
+ updated_at: number;
81
+ value?: string | undefined;
82
+ }>;
83
+ }, "strip", z.ZodTypeAny, {
84
+ 'data:search': {
85
+ updated_at: number & {
86
+ __brand: "UnixTimestamp";
87
+ };
88
+ value: string;
89
+ };
90
+ 'flags:scroll-zoom': {
91
+ updated_at: number & {
92
+ __brand: "UnixTimestamp";
93
+ };
94
+ value: boolean;
95
+ };
96
+ 'flags:style': {
97
+ updated_at: number & {
98
+ __brand: "UnixTimestamp";
99
+ };
100
+ value: string;
101
+ };
102
+ }, {
103
+ 'data:search': {
104
+ updated_at: number;
105
+ value?: string | undefined;
106
+ };
107
+ 'flags:scroll-zoom': {
108
+ updated_at: number;
109
+ value?: boolean | undefined;
110
+ };
111
+ 'flags:style': {
112
+ updated_at: number;
113
+ value?: string | undefined;
114
+ };
115
+ }>;
116
+ panes: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
117
+ sidebar: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
118
+ ui: z.ZodObject<{
119
+ active_mode: z.ZodObject<{
120
+ updated_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>;
121
+ } & {
122
+ value: z.ZodEnum<["light", "dark"]>;
123
+ }, "strip", z.ZodTypeAny, {
124
+ updated_at: number & {
125
+ __brand: "UnixTimestamp";
126
+ };
127
+ value: "light" | "dark";
128
+ }, {
129
+ updated_at: number;
130
+ value: "light" | "dark";
131
+ }>;
132
+ active_theme: z.ZodObject<{
133
+ updated_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>;
134
+ } & {
135
+ value: z.ZodEnum<["light", "dark"]>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ updated_at: number & {
138
+ __brand: "UnixTimestamp";
139
+ };
140
+ value: "light" | "dark";
141
+ }, {
142
+ updated_at: number;
143
+ value: "light" | "dark";
144
+ }>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ active_mode: {
147
+ updated_at: number & {
148
+ __brand: "UnixTimestamp";
149
+ };
150
+ value: "light" | "dark";
151
+ };
152
+ active_theme: {
153
+ updated_at: number & {
154
+ __brand: "UnixTimestamp";
155
+ };
156
+ value: "light" | "dark";
157
+ };
158
+ }, {
159
+ active_mode: {
160
+ updated_at: number;
161
+ value: "light" | "dark";
162
+ };
163
+ active_theme: {
164
+ updated_at: number;
165
+ value: "light" | "dark";
166
+ };
167
+ }>;
168
+ }, "strip", z.ZodTypeAny, {
169
+ map: {
170
+ 'data:search': {
171
+ updated_at: number & {
172
+ __brand: "UnixTimestamp";
173
+ };
174
+ value: string;
175
+ };
176
+ 'flags:scroll-zoom': {
177
+ updated_at: number & {
178
+ __brand: "UnixTimestamp";
179
+ };
180
+ value: boolean;
181
+ };
182
+ 'flags:style': {
183
+ updated_at: number & {
184
+ __brand: "UnixTimestamp";
185
+ };
186
+ value: string;
187
+ };
188
+ };
189
+ controller: {
190
+ favorite_rides: {
191
+ updated_at: number & {
192
+ __brand: "UnixTimestamp";
193
+ };
194
+ value: string[];
195
+ };
196
+ };
197
+ panes: {};
198
+ sidebar: {};
199
+ ui: {
200
+ active_mode: {
201
+ updated_at: number & {
202
+ __brand: "UnixTimestamp";
203
+ };
204
+ value: "light" | "dark";
205
+ };
206
+ active_theme: {
207
+ updated_at: number & {
208
+ __brand: "UnixTimestamp";
209
+ };
210
+ value: "light" | "dark";
211
+ };
212
+ };
213
+ }, {
214
+ map: {
215
+ 'data:search': {
216
+ updated_at: number;
217
+ value?: string | undefined;
218
+ };
219
+ 'flags:scroll-zoom': {
220
+ updated_at: number;
221
+ value?: boolean | undefined;
222
+ };
223
+ 'flags:style': {
224
+ updated_at: number;
225
+ value?: string | undefined;
226
+ };
227
+ };
228
+ controller: {
229
+ favorite_rides: {
230
+ updated_at: number;
231
+ value: string[];
232
+ };
233
+ };
234
+ panes: {};
235
+ sidebar: {};
236
+ ui: {
237
+ active_mode: {
238
+ updated_at: number;
239
+ value: "light" | "dark";
240
+ };
241
+ active_theme: {
242
+ updated_at: number;
243
+ value: "light" | "dark";
244
+ };
245
+ };
246
+ }>;
247
+ export type UserPreferences = z.infer<typeof UserPreferencesSchema>;
@@ -0,0 +1,36 @@
1
+ /* * */
2
+ import { UnixTimestampSchema } from '@tmlmobilidade/go-types-shared';
3
+ import { z } from 'zod';
4
+ /* * */
5
+ // NONE OF THIS IS BEING USED RIGHT NOW
6
+ // HOWEVER; IT SHOULD BE BECAUSE IT AVOIDS UNNECESSARY TYPE CHECKS
7
+ // AND PREVENTS STALE PREFERENCES TO BE KEPT IN THE DATABASE
8
+ export const UserPreferenceValueSchema = z.object({
9
+ updated_at: UnixTimestampSchema,
10
+ value: z.union([
11
+ z.string(),
12
+ z.number(),
13
+ z.boolean(),
14
+ z.array(z.string()),
15
+ z.array(z.number()),
16
+ ]),
17
+ });
18
+ /* * */
19
+ export const UserPreferencesSchema = z.object({
20
+ controller: z.object({
21
+ favorite_rides: UserPreferenceValueSchema.extend({
22
+ value: z.array(z.string()),
23
+ }),
24
+ }),
25
+ map: z.object({
26
+ 'data:search': UserPreferenceValueSchema.extend({ value: z.string().default('') }),
27
+ 'flags:scroll-zoom': UserPreferenceValueSchema.extend({ value: z.boolean().default(true) }),
28
+ 'flags:style': UserPreferenceValueSchema.extend({ value: z.string().default('map') }),
29
+ }),
30
+ panes: z.object({}),
31
+ sidebar: z.object({}),
32
+ ui: z.object({
33
+ active_mode: UserPreferenceValueSchema.extend({ value: z.enum(['light', 'dark']) }),
34
+ active_theme: UserPreferenceValueSchema.extend({ value: z.enum(['light', 'dark']) }),
35
+ }),
36
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/types",
3
- "version": "20260717.2210.46",
3
+ "version": "20260719.1344.38",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"