diff options
Diffstat (limited to 'subprojects/frontend/src/xtext/xtextMessages.ts')
-rw-r--r-- | subprojects/frontend/src/xtext/xtextMessages.ts | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/subprojects/frontend/src/xtext/xtextMessages.ts b/subprojects/frontend/src/xtext/xtextMessages.ts index 4bf49c17..c4d0c676 100644 --- a/subprojects/frontend/src/xtext/xtextMessages.ts +++ b/subprojects/frontend/src/xtext/xtextMessages.ts | |||
@@ -1,40 +1,42 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-redeclare -- Declare types with their companion objects */ | ||
2 | |||
1 | import { z } from 'zod'; | 3 | import { z } from 'zod'; |
2 | 4 | ||
3 | export const xtextWebRequest = z.object({ | 5 | export const XtextWebRequest = z.object({ |
4 | id: z.string().min(1), | 6 | id: z.string().min(1), |
5 | request: z.unknown(), | 7 | request: z.unknown(), |
6 | }); | 8 | }); |
7 | 9 | ||
8 | export type XtextWebRequest = z.infer<typeof xtextWebRequest>; | 10 | export type XtextWebRequest = z.infer<typeof XtextWebRequest>; |
9 | 11 | ||
10 | export const xtextWebOkResponse = z.object({ | 12 | export const XtextWebOkResponse = z.object({ |
11 | id: z.string().min(1), | 13 | id: z.string().min(1), |
12 | response: z.unknown(), | 14 | response: z.unknown(), |
13 | }); | 15 | }); |
14 | 16 | ||
15 | export type XtextWebOkResponse = z.infer<typeof xtextWebOkResponse>; | 17 | export type XtextWebOkResponse = z.infer<typeof XtextWebOkResponse>; |
16 | 18 | ||
17 | export const xtextWebErrorKind = z.enum(['request', 'server']); | 19 | export const XtextWebErrorKind = z.enum(['request', 'server']); |
18 | 20 | ||
19 | export type XtextWebErrorKind = z.infer<typeof xtextWebErrorKind>; | 21 | export type XtextWebErrorKind = z.infer<typeof XtextWebErrorKind>; |
20 | 22 | ||
21 | export const xtextWebErrorResponse = z.object({ | 23 | export const XtextWebErrorResponse = z.object({ |
22 | id: z.string().min(1), | 24 | id: z.string().min(1), |
23 | error: xtextWebErrorKind, | 25 | error: XtextWebErrorKind, |
24 | message: z.string(), | 26 | message: z.string(), |
25 | }); | 27 | }); |
26 | 28 | ||
27 | export type XtextWebErrorResponse = z.infer<typeof xtextWebErrorResponse>; | 29 | export type XtextWebErrorResponse = z.infer<typeof XtextWebErrorResponse>; |
28 | 30 | ||
29 | export const xtextWebPushService = z.enum(['highlight', 'validate']); | 31 | export const XtextWebPushService = z.enum(['highlight', 'validate']); |
30 | 32 | ||
31 | export type XtextWebPushService = z.infer<typeof xtextWebPushService>; | 33 | export type XtextWebPushService = z.infer<typeof XtextWebPushService>; |
32 | 34 | ||
33 | export const xtextWebPushMessage = z.object({ | 35 | export const XtextWebPushMessage = z.object({ |
34 | resource: z.string().min(1), | 36 | resource: z.string().min(1), |
35 | stateId: z.string().min(1), | 37 | stateId: z.string().min(1), |
36 | service: xtextWebPushService, | 38 | service: XtextWebPushService, |
37 | push: z.unknown(), | 39 | push: z.unknown(), |
38 | }); | 40 | }); |
39 | 41 | ||
40 | export type XtextWebPushMessage = z.infer<typeof xtextWebPushMessage>; | 42 | export type XtextWebPushMessage = z.infer<typeof XtextWebPushMessage>; |