aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/language-web/src/main/js/xtext/xtextMessages.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-12 17:48:47 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-12 17:48:47 +0100
commitfc7e9312d00e60171ed77c477ed91231d3dbfff9 (patch)
treecc185dd088b5fa6e9357aab3c9062a70626d1953 /subprojects/language-web/src/main/js/xtext/xtextMessages.ts
parentbuild: refactor java-application conventions (diff)
downloadrefinery-fc7e9312d00e60171ed77c477ed91231d3dbfff9.tar.gz
refinery-fc7e9312d00e60171ed77c477ed91231d3dbfff9.tar.zst
refinery-fc7e9312d00e60171ed77c477ed91231d3dbfff9.zip
build: move modules into subproject directory
Diffstat (limited to 'subprojects/language-web/src/main/js/xtext/xtextMessages.ts')
-rw-r--r--subprojects/language-web/src/main/js/xtext/xtextMessages.ts40
1 files changed, 40 insertions, 0 deletions
diff --git a/subprojects/language-web/src/main/js/xtext/xtextMessages.ts b/subprojects/language-web/src/main/js/xtext/xtextMessages.ts
new file mode 100644
index 00000000..c4305fcf
--- /dev/null
+++ b/subprojects/language-web/src/main/js/xtext/xtextMessages.ts
@@ -0,0 +1,40 @@
1import { z } from 'zod';
2
3export const xtextWebRequest = z.object({
4 id: z.string().nonempty(),
5 request: z.unknown(),
6});
7
8export type XtextWebRequest = z.infer<typeof xtextWebRequest>;
9
10export const xtextWebOkResponse = z.object({
11 id: z.string().nonempty(),
12 response: z.unknown(),
13});
14
15export type XtextWebOkResponse = z.infer<typeof xtextWebOkResponse>;
16
17export const xtextWebErrorKind = z.enum(['request', 'server']);
18
19export type XtextWebErrorKind = z.infer<typeof xtextWebErrorKind>;
20
21export const xtextWebErrorResponse = z.object({
22 id: z.string().nonempty(),
23 error: xtextWebErrorKind,
24 message: z.string(),
25});
26
27export type XtextWebErrorResponse = z.infer<typeof xtextWebErrorResponse>;
28
29export const xtextWebPushService = z.enum(['highlight', 'validate']);
30
31export type XtextWebPushService = z.infer<typeof xtextWebPushService>;
32
33export const xtextWebPushMessage = z.object({
34 resource: z.string().nonempty(),
35 stateId: z.string().nonempty(),
36 service: xtextWebPushService,
37 push: z.unknown(),
38});
39
40export type XtextWebPushMessage = z.infer<typeof xtextWebPushMessage>;